Compare commits

...

No commits in common. 'WHY_branch' and 'master' have entirely different histories.

@ -1,3 +1 @@
# campus_leader
polo car
111111222233
特殊说明代码质量检测是用的微信小程序开发平台自带的工具。所以没有显示代码量。但是总代码量已经超过了10000行。

@ -1 +0,0 @@
Subproject commit 55dbf15bfa54f6acec84bbda291eea39ba2c5451

Binary file not shown.

Binary file not shown.

@ -1,2 +0,0 @@
其他

14
src/.gitignore vendored

@ -0,0 +1,14 @@
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/
# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
# Node.js
node_modules/

@ -1,5 +0,0 @@
#include<stdio.h>
typedef struct {
};

@ -0,0 +1,6 @@
# campus_leader
1.代码质量测评是利用微信小程序公众平台自带的工具
2.系统简介:可借助手机端的微信小程序来加载“校园指路”,与GPS定位同步提供面对大学生的独特的相对位置导航方式。提供便捷的目的地菜单式可视化表以及对食堂窗口的评价等功能。本校人员注册数据和PC端同步。
3.配置环境整个系统包括智能手机计算机软件系统GPS。其中智能手机计算机和软件系统都部署在互联网上。“校园指路”小程序部署在手机端。软件系统包含若干个部分采用分布式部署方式。计算机负责对软件的维护信息数据管理和交互。系统与GPS交互。

@ -0,0 +1,7 @@
{
"permissions": {
"openapi": [
"wxacode.get"
]
}
}

@ -0,0 +1,56 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
// 创建集合云函数入口函数
exports.main = async (event, context) => {
try {
// 创建集合
await db.createCollection('sales');
await db.collection('sales').add({
// data 字段表示需新增的 JSON 数据
data: {
region: '华东',
city: '上海',
sales: 11
}
});
await db.collection('sales').add({
// data 字段表示需新增的 JSON 数据
data: {
region: '华东',
city: '南京',
sales: 11
}
});
await db.collection('sales').add({
// data 字段表示需新增的 JSON 数据
data: {
region: '华南',
city: '广州',
sales: 22
}
});
await db.collection('sales').add({
// data 字段表示需新增的 JSON 数据
data: {
region: '华南',
city: '深圳',
sales: 22
}
});
return {
success: true
};
} catch (e) {
// 这里catch到的是该collection已经存在从业务逻辑上来说是运行成功的所以catch返回success给前端避免工具在前端抛出异常
return {
success: true,
data: 'create collection success'
};
}
};

@ -0,0 +1,20 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
// 获取小程序二维码云函数入口函数
exports.main = async (event, context) => {
// 获取小程序二维码的buffer
const resp = await cloud.openapi.wxacode.get({
path: 'pages/index/index'
});
const { buffer } = resp;
// 将图片上传云存储空间
const upload = await cloud.uploadFile({
cloudPath: 'code.png',
fileContent: buffer
});
return upload.fileID;
};

@ -0,0 +1,17 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
// 获取openId云函数入口函数
exports.main = async (event, context) => {
// 获取基础信息
const wxContext = cloud.getWXContext();
return {
openid: wxContext.OPENID,
appid: wxContext.APPID,
unionid: wxContext.UNIONID,
};
};

@ -0,0 +1,100 @@
const getOpenId = require('./getOpenId/index');
const getMiniProgramCode = require('./getMiniProgramCode/index');
const createCollection = require('./createCollection/index');
const selectRecord = require('./selectRecord/index');
const updateRecord = require('./updateRecord/index');
const sumRecord = require('./sumRecord/index');
// 云函数入口函数
exports.main = async (event, context) => {
switch (event.type) {
case 'getOpenId':
return await getOpenId.main(event, context);
case 'getMiniProgramCode':
return await getMiniProgramCode.main(event, context);
case 'createCollection':
return await createCollection.main(event, context);
case 'selectRecord':
return await selectRecord.main(event, context);
case 'updateRecord':
return await updateRecord.main(event, context);
case 'sumRecord':
return await sumRecord.main(event, context);
}
const wxContext = cloud.getWXContext()
//写有关于数据库操作的地方
//获取数据库的连接对象
const db = cloud.database();
//在一个云函数里面有4种数据库操作。所以要先判断是什么操作增删改查
//增
if(event.option=='add'){
return await db.collection('log').add({
//花括号里面是你要添加的对象
data:event.addData
//可添加多条或一条
//event:包含传过来的所有数据的一个对象
});
}
//删
else if(event.option=="deleteuser"){
return await db.collection('log').where({
//将要删除的值赋给name
User_ID:event.delUser_ID
}).remove();
}
else if(event.option=="deleteusers"){
return await db.collection('log').where({
//将要删除的值赋给name
User_College:event.delUser_College,
User_Grade:event.delUser_Grade,
User_Class:event.delUser_Class
}).remove();
}
//查
else if(event.option=="getcomments1"){
return await db.collection('log').where({
User_ID:event.getUser_ID
}).get({
success:function(res){
return res
}
})
}
else if(event.option=="getCollege"){
return await db.collection('log').where({
User_College:event.getUser_College,
User_Grade:event.getUser_Grade,
User_Class:event.getUser_Class
}).get({
success:function(res){
return res
}
})
}
else if(event.option=="getcomments2"){
return await db.collection('log').where({
}).get({
success:function(res){
return res
}
})
}
//改
else if(event.option=="update"){
return await db.collection('log').where({
User_ID:event.updateUser_ID
}).update({
data:{
User_College:event.updateUser_College
}
})
}
};

@ -0,0 +1,14 @@
{
"name": "quickstartFunctions",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"wx-server-sdk": "~2.4.0"
}
}

@ -0,0 +1,12 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
// 查询数据库集合云函数入口函数
exports.main = async (event, context) => {
// 返回数据库查询结果
return await db.collection('sales').get();
};

@ -0,0 +1,18 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
const $ = db.command.aggregate;
// 聚合记录云函数入口函数
exports.main = async (event, context) => {
// 返回数据库聚合结果
return db.collection('sales').aggregate()
.group({
_id: '$region',
sum: $.sum('$sales')
})
.end();
};

@ -0,0 +1,32 @@
const cloud = require('wx-server-sdk');
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
// 修改数据库信息云函数入口函数
exports.main = async (event, context) => {
try {
// 遍历修改数据库信息
for (let i = 0; i < event.data.length; i++) {
await db.collection('sales').where({
_id: event.data[i]._id
})
.update({
data: {
sales: event.data[i].sales
},
});
}
return {
success: true,
data: event.data
};
} catch (e) {
return {
success: false,
errMsg: e
};
}
};

@ -0,0 +1,2 @@
project.config.json
config.js

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 莞香广科
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -0,0 +1,97 @@
<div align="center">
<h1> 导览 - 微信地图导览小程序 </h1>
[![GitHub license](https://img.shields.io/github/license/gxgk/school-map)](https://github.com/gxgk/school-map/blob/master/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/gxgk/school-map)](https://github.com/gxgk/school-map/stargazers)
[![test](https://img.shields.io/badge/platform-微信小程序-green)]()
首款开源的微信地图导览小程序,仅需修改地图文件,就可以适配某一学校/景区,具有出色的用户体验。
***官网https://www.gxgkcat.com***
☑️一键配置切换 ☑️地图路径规划 ☑️在线热修补
</div>
---
## 🤩预览
![导览](https://map.gxgkcat.com/%E6%A0%A1%E5%9B%AD%E5%AF%BC%E8%A7%88/Screenshot.jpg)
![二维码](https://map.gxgkcat.com/%E6%A0%A1%E5%9B%AD%E5%AF%BC%E8%A7%88/qrcode.jpg)
---
## 📝使用说明
1、项目根文件新建config.js文件写入以下内容并根据自身需求修改
```js
module.exports = {
// 调试模式开关,调试模式下只调用本地数据
debug: true,
// 学校数据配置名称,学校英文缩写
school: "gdst",
// 高德路线规划密钥必须加入https://restapi.amap.com为request合法域名
// 密钥申请地址http://lbs.amap.com/api/javascript-api/summary/
key: "",
// 地图更新地址,用于热修补,无需每次都提交审核
updateUrl: "https://www.qq.com/json.json",
// 图片CDN域名
imgCDN: "https://www.gxgkcat.com/"
}
```
2、复制resources下的地图数据文件gdst.js重命名gdst.js为(你自己学校的英文缩写.js根据实际情况修改)
```js
module.exports.introduce = {}
module.exports.map = [{}]
```
3、修改地图文件
```
参照例子自行研究
地图经纬度获取http://lbs.qq.com/tool/getpoint/index.html
```
---
## 📒开源许可证
请认真阅读并遵守以下开源协议
`MIT License` [License](https://github.com/gxgk/map/blob/master/LICENSE)
欢迎 pull request and star
允许任何人对该项目进行变动
同时欢迎各位校友参与到该项目(可新增关于界面加入参与贡献者名称)
不过,该项目所有图片均有版权(学院宣传服务中心所有),禁止盗用,包含首页背景
更改历史:
1.配置config.js, 申请key以及request合法域名在微信小程序身份登录的公众平台。然后刷新详情中的基本配置。最后编译就好了。
2.高德地图api:https://lbs.amap.com/api/webservice/guide/api/staticmaps
3.地图控制台https://console.amap.com/dev/index
4.修改resources/gdst
1.改名cauc
2.config.js中将school配置为cauc
3.所以说需要根据自定义的只是cauc.js,地图信息
5.cdn中gdst.json内容和resources中的cauc.js中的内容相同。
6.可配置信息和getApp()得到的全局信息只要在cauc.js中修改就好了
7.index无路线规划polyline有因为调用了amap-wx.js接口
8.details中航大总介绍
index校园建筑地图
ployline校园门口位置导航
9.include points是实现把所有点包含并且只是以第一次包含的点全在为标准。
10.在index.xml中调用map时参数中写include-points="{{buildlData[isSelectedBuildType].data}}",包含所有点
11.第一次迭代效果还不错
12.接下来的工作:
1.实现手机端导航授权成功
2.实现标志性建筑相关位置显示
3.改为调用高德地图实现中航大3d楼块
4.食堂评论功能,前后端绑定
5.收集和添加数据

@ -0,0 +1,113 @@
//app.js
let config = require('config.js')
App({
onLaunch: function() {
if (!wx.cloud) {
console.error('请使用 2.2.3 或以上的基础库以使用云能力');
} else {
wx.cloud.init({
// env 参数说明:
// env 参数决定接下来小程序发起的云开发调用wx.cloud.xxx会默认请求到哪个云环境的资源
// 此处请填入环境 ID, 环境 ID 可打开云控制台查看
// 如不填则使用默认环境(第一个创建的环境)
// env: 'my-env-id',
traceUser: true,
});
}
this.globalData = {};
var _this = this;
//载入学校位置数据
_this.loadSchoolConf()
//如果已经授权,提前获取定位信息
wx.getSetting({
success(res) {
if (res.authSetting['scope.userLocation']) {
//获取地理位置
wx.getLocation({
type: 'wgs84', // 默认为 wgs84 返回 gps 坐标gcj02 返回可用于 wx.openLocation 的坐标
success: function(res) {
_this.globalData.latitude = res.latitude;
_this.globalData.longitude = res.longitude;
_this.globalData.islocation = true
}
})
}
}
})
},
loadNetWorkScoolConf: function() {
var _this = this
return new Promise(function(resolve, reject) {
if (!_this.debug) {
// 优先读取缓存信息
var map = wx.getStorageSync('map')
var introduce = wx.getStorageSync('introduce')
if (map && introduce) {
_this.globalData.map = map;
_this.globalData.introduce = introduce;
}
// 再加载网络数据
wx.request({
url: config.updateUrl,
header: {
'content-type': 'application/json'
},
success: function(res) {
console.log("加载远程数据")
if (res.data.map && res.data.map.length > 0) {
//刷新数据
_this.globalData.map = res.data.map;
_this.globalData.introduce = res.data.introduce;
// 存储学校位置数据于缓存中
wx.setStorage({
key: "map",
data: res.data.map
})
wx.setStorage({
key: "introduce",
data: res.data.introduce
})
}
},
complete: function(info) {
resolve();
}
})
} else {
resolve();
}
});
},
loadSchoolConf: function() {
var _this = this
// 载入本地数据
_this.globalData.map = _this.school.map;
_this.globalData.introduce = _this.school.introduce;
_this.loadNetWorkScoolConf().then(function() {
// 渲染id
for (let i = 0; i < _this.globalData.map.length; i++) {
for (let b = 0; b < _this.globalData.map[i].data.length; b++) {
_this.globalData.map[i].data[b].id = b + 1;
}
}
})
},
debug: config.debug, //开启后只调用本地数据
imgCDN: config.imgCDN,
school: require('/resources/' + config.school),
globalData: {
userInfo: null,
map: null,
introduce: null,
latitude: null,
longitude: null
}
},
)

@ -0,0 +1,38 @@
{
"pages": [
"pages/login",
"pages/log/log",
"pages/checklog/checklog",
"pages/user/user",
"pages/manager/manager",
"pages/managerlogin/managerlogin",
"pages/register/register",
"pages/canteen/canteen",
"pages/index",
"pages/map/index",
"pages/map/details",
"pages/map/polyline",
"pages/map/search",
"pages/web-views/web-views",
"pages/map/test"
],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于辅助规划路线"
}
},
"requiredPrivateInfos":[
"getLocation"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#079df2",
"navigationBarTitleText": "校园导览",
"navigationBarTextStyle": "white"
},
"sitemapLocation": "sitemap.json",
"navigateToMiniProgramAppIdList": [
"wx98d60f2aee3668c3"
]
}

@ -1,4 +1,8 @@
/**app.wxss**/
page{
height: 100%;
width: 100%;
}
.container {
height: 100%;
display: flex;

@ -0,0 +1,432 @@
{
"map": [
{
"name": "景点",
"scale": 16,
"data": [
{
"name": "图书馆",
"latitude": "39.107078",
"longitude": "117.353131",
"iconPath": "/img/ico/jd.png",
"width": "30",
"height": "30",
"img": [
"校园导览/景点/图书馆/图书馆1.jpg",
"校园导览/景点/图书馆/图书馆2.jpg",
"校园导览/景点/图书馆/图书馆3.jpg"
],
"description": "<p> </p>"
},
{
"name": "体育馆",
"latitude": "39.106916",
"longitude": "117.355886",
"iconPath": "/img/ico/jd.png",
"width": "30",
"height": "30",
"img": [
"校园导览/景点/体育馆/体育馆1.jpg",
"校园导览/景点/体育馆/体育馆2.jpg",
"校园导览/景点/体育馆/体育馆3.jpg",
"校园导览/景点/体育馆/体育馆4.jpg"
],
"description": " "
},
{
"name": "千禧湖",
"latitude": "39.10497",
"longitude": "117.355763",
"iconPath": "/img/ico/jd.png",
"width": "30",
"height": "30",
"img": [
"",
"",
""
],
"description": ""
}
]
},
{
"name": "教学楼",
"scale": 16,
"data": [
{
"name": "1号教学楼",
"latitude": "39.105963",
"longitude": "117.353212",
"iconPath": "/img/ico/jxl.png",
"width": "30",
"height": "30",
"img": [
"校园导览/教学楼/1号教学楼.jpg"
],
"description": " "
},
{
"name": "2号教学楼",
"latitude": "39.106449",
"longitude": "117.35235",
"iconPath": "/img/ico/jxl.png",
"width": "30",
"height": "30",
"img": [
"校园导览/教学楼/2号教学楼.jpg"
],
"description": " 2号教学楼有六层楼在1号教学楼的左边创业楼的后面。"
},
{
"name": "3号教学楼",
"latitude": "39.10485",
"longitude": "117.352777",
"iconPath": "/img/ico/jxl.png",
"width": "30",
"height": "30",
"img": [
"校园导览/教学楼/3号教学楼1.jpg",
"校园导览/教学楼/3号教学楼2.jpg"
],
"description": " 3号教学楼有六层楼在1号教学楼的右边。"
},
{
"name": "4号教学楼",
"latitude": "39.104238",
"longitude": "117.352915",
"iconPath": "/img/ico/jxl.png",
"width": "30",
"height": "30",
"img": [
"校园导览/教学楼/4号教学楼1.jpg",
"校园导览/教学楼/4号教学楼2.jpg"
],
"description": " 4栋教学楼位于2栋教学楼后方且与2栋教学楼相连接。4栋教学楼在配套有现代多媒体教学设施且全部装有空调的同时还配套有最新电脑设备帮助学生学习最新现代信息技术。"
},
{
"name": "5号教学楼",
"latitude": "39.101809",
"longitude": "117.35374",
"iconPath": "/img/ico/jxl.png",
"width": "30",
"height": "30",
"img": [
"校园导览/教学楼/5号教学楼1.jpg",
"校园导览/教学楼/5号教学楼2.jpg"
],
"description": " 5栋教学楼位于3栋教学楼后方且与3栋教学楼相连接。3栋教学楼在配套有现代多媒体教学设施且全部装有空调保证了学生学习环境和教师教学环境的质量。使学生能舒适专心地进行高质量学习。"
}
]
},
{
"name": "校门",
"scale": 16,
"data": [
{
"name": "北门",
"latitude": "39.114642",
"longitude": "117.34876",
"iconPath": "/img/ico/xm.png",
"width": "30",
"height": "30",
"img": [
"校园导览/校门/北门.jpg"
],
"description": "北门"
},
{
"name": "南门",
"latitude": "39.107847",
"longitude": "117.354828",
"iconPath": "/img/ico/xm.png",
"width": "30",
"height": "30",
"img": [
"校园导览/校门/南门2.jpg",
"校园导览/校门/南门3.jpg",
"校园导览/校门/南门1.jpg"
],
"description": "南门"
},
{
"name": "西门",
"latitude": "39.105958",
"longitude": "117.351209",
"iconPath": "/img/ico/xm.png",
"width": "30",
"height": "30",
"img": [
"校园导览/校门/雅苑门.jpg"
],
"description": "雅苑门"
}
]
},
{
"scale": 16,
"name": "行政部门",
"data": [
{
"name": "机器人研究所",
"floor": "创业楼301",
"latitude": "39.100547",
"longitude": "117.357268",
"iconPath": "/img/ico/xyfu.png",
"width": "30",
"height": "30",
"img": [
"校园导览/创业楼/广科招生办301.jpg"
],
"description": "创业楼301 广科招生办 Admissions Office"
},
{
"name": "体育部",
"floor": "创业楼1202",
"latitude": "39.105038",
"longitude": "117.355197",
"iconPath": "/img/ico/xyfu.png",
"width": "30",
"height": "30",
"img": [
"校园导览/创业楼/就业指导中心 1202.jpg"
],
"description": "<p> </p><br>"
},
{
"name": "学院办公室",
"floor": "行政楼513",
"latitude": "39.104259",
"longitude": "117.352893",
"iconPath": "/img/ico/xyfu.png",
"width": "30",
"height": "30",
"img": [
"校园导览/行政楼/学院办公室 行政楼513.jpg"
],
"description": "<p></p><br>"
},
{
"name": "教务处",
"floor": "行政楼205",
"latitude": "39.102544",
"longitude": "117.354727",
"iconPath": "/img/ico/xyfu.png",
"width": "30",
"height": "30",
"img": [
"校园导览/行政楼/教务处205.jpg"
],
"description": "<p> </p>"
},
{
"name": "心理辅导中心",
"floor": "图书馆F6",
"latitude": "39.101685",
"longitude": "117.357382",
"iconPath": "/img/ico/xyfu.png",
"width": "30",
"height": "30",
"img": [
"校园导览/行政楼/心理辅导中心 图书馆F6.jpg"
],
"description": "<p> </p>"
},
{
"name": "保卫室(武装部)",
"floor": "教学楼3栋",
"latitude": "39.108148",
"longitude": "117.354363",
"iconPath": "/img/ico/xyfu.png",
"width": "30",
"height": "30",
"img": [
"校园导览/保卫室.jpg"
],
"description": "<p> </p>"
},
{
"name": "思想政治理论课教学部",
"floor": "教学楼3-205",
"latitude": "39.10729",
"longitude": "117.353125",
"iconPath": "/img/ico/xyfu.png",
"width": "30",
"height": "30",
"img": [
"校园导览/各系办公室/思政部 3-205.jpg"
],
"description": "<p> </p><br>"
}
]
},
{
"name": "食堂",
"scale": 16,
"data": [
{
"name": "南一食堂",
"latitude": "39.103575",
"longitude": "117.352881",
"iconPath": "/img/ico/st.png",
"width": "30",
"height": "30",
"img": [
"校园导览/食堂/一饭/一饭1.jpg",
"校园导览/食堂/一饭/一饭2.jpg",
"校园导览/食堂/一饭/一饭二楼1.jpg",
"校园导览/食堂/一饭/一饭二楼2.jpg"
],
"description": "一号饭堂:另外还有煮面食的摊位。"
},
{
"name": "南二食堂",
"latitude": "39.101772",
"longitude": "117.351573",
"iconPath": "/img/ico/st.png",
"width": "30",
"height": "30",
"img": [
"校园导览/食堂/二饭/二饭1.jpg",
"校园导览/食堂/二饭/二饭2.jpg"
],
"description": "二号饭堂位于南苑4号宿舍的一楼接近图书馆环境明亮早餐有肠粉菜色丰富口感鲜美特色是现煮粥材料可自己选择。"
},
{
"name": "南三食堂",
"latitude": "39.10329",
"longitude": "117.351733",
"iconPath": "/img/ico/st.png",
"width": "30",
"height": "30",
"img": [
"校园导览/食堂/三饭/三饭1.jpg",
"校园导览/食堂/三饭/三饭2.jpg",
"校园导览/食堂/三饭/三饭3.jpg"
],
"description": "三号饭堂三饭与二饭相邻在南苑1.2号宿舍的一楼有自助餐和汤粉蒸粉肠粉三饭的特色是煲仔饭材料可自己选择田鸡、鸡肉等菜色丰富不过早餐是4个饭堂中种类最多的味道也都挺不错的。"
}
]
},
{
"scale": 16,
"name": "宿舍",
"data": [
{
"name": "南一公寓",
"latitude": "39.103543",
"longitude": "117.353461",
"iconPath": "/img/ico/boy_ss.png",
"width": "30",
"height": "30",
"img": [
"校园导览/南苑男生/南苑1栋.jpg"
],
"description": "南苑1栋"
},
{
"name": "南苑2栋",
"latitude": "39.103198",
"longitude": "117.353412",
"iconPath": "/img/ico/boy_ss.png",
"width": "30",
"height": "30",
"img": [
"校园导览/南苑男生/南苑2栋.jpg"
],
"description": "南苑2栋"
},
{
"name": "南苑3栋",
"latitude": "39.103467",
"longitude": "117.353915",
"iconPath": "/img/ico/boy_ss.png",
"width": "30",
"height": "30",
"img": [
"校园导览/南苑男生/南苑3-4栋.jpg"
],
"description": "南苑3栋"
},
{
"name": "南苑4栋",
"latitude": "39.103299",
"longitude": "117.353919",
"iconPath": "/img/ico/boy_ss.png",
"width": "30",
"height": "30",
"img": [
"校园导览/南苑男生/南苑4栋.jpg"
],
"description": "南苑4栋"
},
{
"name": "南苑5栋",
"latitude": "39.102828",
"longitude": "117.3534",
"iconPath": "/img/ico/boy_ss.png",
"width": "30",
"height": "30",
"img": [
"校园导览/南苑男生/南苑5栋.jpg"
],
"description": "南苑5栋"
},
{
"name": "南苑6栋",
"latitude": "39.102527",
"longitude": "117.353382",
"iconPath": "/img/ico/girl_ss.png",
"width": "30",
"height": "30",
"img": [
"校园导览/南苑女生/南苑6栋.jpg"
],
"description": "南苑6栋"
},
{
"name": "南苑7栋",
"latitude": "39.102818",
"longitude": "117.353908",
"iconPath": "/img/ico/girl_ss.png",
"width": "30",
"height": "30",
"img": [
"校园导览/南苑女生/南苑7栋.jpg"
],
"description": "南苑7栋"
},
{
"name": "南苑8栋",
"latitude": "39.102518",
"longitude": "117.353906",
"iconPath": "/img/ico/girl_ss.png",
"width": "30",
"height": "30",
"img": [
"校园导览/南苑8910/南苑1.jpg",
"校园导览/南苑8910/南苑2.jpg",
"校园导览/南苑8910/南苑3.jpg"
],
"description": "南苑8栋"
}
]
}
],
"introduce": {
"shortName": "中航大",
"name": "中国民航大学",
"images": "校园导览/gdst.jpg",
"share": "校园导览/share.jpg",
"latitude": "22.972816",
"longitude": "113.756003",
"img": [
"校园导览/校门/北门.jpg",
"校园导览/教学楼/全景.jpg"
],
"description": "<p></p>",
"mapCopyright": {
"name": "软工",
"url": ""
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1506927773816" class="icon" style="" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3359" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M1021.923737 450.547539c-3.949605-59.390357-13.750477-117.46418-33.937347-173.636341-22.381095-62.315991-56.318442-117.317898-105.907928-161.933807-40.373741-36.424135-87.037593-62.169709-138.089895-80.162354C699.665221 19.162899 653.879058 9.800872 607.068924 5.119858c-19.748025-1.901662-39.496051-2.925633-59.244076-4.242168-1.901662-0.146282-3.657042-0.438845-5.558703-0.731408l-60.414329 0c-10.093435 0.731408-20.040589 1.316535-30.134024 2.047943-52.076274 3.364478-103.42114 11.263688-153.44947 26.769545-51.783711 16.090984-99.764098 39.642332-142.185782 74.018524-57.049851 46.225007-95.375648 105.322801-120.09725 173.928904C19.748025 321.819671 10.239717 368.483523 5.119858 416.171347 0 463.127763-1.170253 510.23046 1.170253 557.333157c3.51076 71.092891 14.628167 140.722965 41.543994 207.281124 44.762191 110.588941 124.339418 184.461184 236.244895 224.103516 47.541542 16.822392 96.692183 26.3307 146.866795 31.157995 54.416781 5.26614 108.833561 5.412422 163.250342 0.87769 69.044948-5.851267 136.041952-19.894307 199.089351-49.589486 99.178971-46.810134 164.566877-123.754292 200.991013-226.444023 15.652139-44.323346 25.160447-89.963226 29.84146-136.627078 1.901662-19.455462 2.925633-39.203487 4.38845-58.658949 0.146282-1.609098 0.585127-3.364478 0.87769-4.973577l0-63.486244C1023.240272 470.588128 1022.655145 460.640974 1021.923737 450.547539zM713.708261 537.292569c-22.673659 37.886952-47.102697 74.603651-71.092891 111.759195-37.886952 58.805231-76.066468 117.46418-114.099701 176.269411-11.556252 17.846364-21.210842 17.846364-32.913375-0.292563-59.536639-92.01117-120.09725-183.290931-178.609917-275.887227-93.181423-147.890767-5.119858-328.548628 153.888315-357.219835 13.750477-2.486788 27.647235-3.218197 41.543994-4.681013 114.245983 1.316535 211.523293 83.965678 229.66222 196.602563C750.571241 438.113597 741.940623 489.897308 713.708261 537.292569zM634.423597 429.336697c-4.242168 64.363934-57.927541 114.538546-122.584038 114.392265-63.339962-0.146282-116.732772-48.858077-121.998912-111.32035-5.412422-64.071371 38.472079-121.998912 101.226915-132.092347 45.347317-7.314083 83.673114 7.167802 114.392265 41.397712 6.875238 7.606647 5.851267 19.016617-1.75538 25.745574-7.89921 6.875238-19.162899 6.14383-26.623264-2.194225-12.433942-13.896759-27.500954-23.405067-45.786162-27.647235-46.663852-11.117407-93.912831 19.162899-103.42114 66.411878-9.65459 47.395261 22.088532 93.912831 69.630074 101.812041 49.882049 8.191773 95.52193-27.062109 99.91038-77.383003 0.731408-8.191773 3.949605-14.774449 11.995097-17.992645 6.728957-2.63307 13.16535-1.609098 18.724054 3.218197C633.107061 417.487882 634.862442 422.900304 634.423597 429.336697z" p-id="3360" fill="#1296db"></path></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,72 @@
// pages/checklog/checklog.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
goToLog:function(options){
wx.navigateTo({
url: '../../pages/log/log'
})
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1 @@
<button bindtap="goToLog" type="primary">查看日志</button>

@ -0,0 +1 @@
/* pages/checklog/checklog.wxss */

@ -0,0 +1,32 @@
//获取应用实例
var app = getApp();
Page({
data: {
images: app.globalData.introduce.images,
shortName: app.globalData.introduce.shortName,
mapCopyright: app.globalData.introduce.mapCopyright,
imgCDN: app.imgCDN
},
onLoad: function (options) {
wx.setNavigationBarTitle({
title: app.globalData.introduce.name
})
},
onShareAppMessage: function (res) {
if (res.from === 'button') {
// 来自页面内转发按钮
console.log(res.target)
}
return {
title: app.globalData.introduce.name + ' - 校园导览',
path: '/pages/index',
imageUrl: app.imgCDN + app.globalData.introduce.share,
success: function (res) {
// 转发成功
},
fail: function (res) {
// 转发失败
}
}
},
})

@ -0,0 +1,3 @@
{
"navigationBarBackgroundColor": "#0c101b"
}

@ -0,0 +1,18 @@
<view class="page" style="background: url('{{imgCDN}}{{images}}'); background-size: 100% 100%;">
<view class="button_container">
<navigator class="button" url="map/details">
<text>{{shortName}}简介</text>
</navigator>
<navigator class="button" url="map/index">
<text>逛逛{{shortName}}</text>
</navigator>
</view>
<view class="copyright">
<navigator target="miniProgram" app-id="wx8afedfde046e5916">
<text>© cauc软工</text>
</navigator>
<navigator url="web-views/web-views?url={{mapCopyright.url}}">
<text>{{mapCopyright?"数据版权:"+mapCopyright.name:""}}</text>
</navigator>
</view>
</view>

@ -0,0 +1,44 @@
.page {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
color: white;
}
.button_container {
width: 100%;
display: flex;
align-items: center;
flex-direction: row;
margin-top: 120px;
justify-content: center;
}
.button {
width: 145rpx;
height: 145rpx;
margin: 20px;
background-color: rgba(255, 224, 115, 0.9);
border-radius: 80rpx;
display: flex;
justify-content: center;
}
.button text {
width: 55%;
align-self: center;
text-align: center;
}
.copyright {
display: flex;
justify-content: flex-end;
flex-direction: column;
align-items: center;
height: 55vh;
font-size: 27rpx;
text-align: center;
line-height: 150%;
text-shadow:#000 1rpx 0 0,#000 0 1rpx 0,#000 -1rpx 0 0,#000 0 -1rpx 0;
}

@ -0,0 +1,36 @@
// pages/selectusers/index.js
Page({
inputgetID:function(e){
this.setData({
getUser_ID:e.detail.value
})
},
searchDataNameFn:function(){
wx.cloud.callFunction({
name: 'useroption',
data: {
option: 'getcomments1',
getUser_ID:this.data.getUser_ID
},
success: res => {
this.setData({
array: res.result.data
})
wx.showToast({
title: '日志查询成功',
})
console.log(res.result.data)
},
fail: err => {
wx.showToast({
title: '日志查询失败',
})
}
})
},
getback:function(){
wx.navigateBack({
delta:2,
})
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,26 @@
<view class="getID">
<input
value="{{getUser_ID}}"
placeholder="请输入要查询的日志的id"
bindblur="inputgetID"
/>
</view>
<view>
<view wx:if="{{array}}" class="code_box">
<view class="code_box_title">日志</view>
<view class="code_box_record">
<view class="code_box_record_title">id</view>
<view class="code_box_record_title">key</view>
</view>
<view class="line"></view>
<view class="code_box_record" wx:for="{{array}}" wx:key="_id">
<view class="code_box_record_detail">{{item.User_comments}}</view>
<view class="code_box_record_detail">{{item.User_ID}}</view>
</view>
</view>
</view>
<button class="button" type="primary" bindtap="searchDataNameFn">查询</button>
<button class="button" type="primary" bindtap="getback">返回</button>

@ -0,0 +1,145 @@
/* pages/selectusers/index.wxss */
/* pages/selectusers(college)/index.wxss */
page {
padding-top: 54rpx;
background-color: #f6f6f6;
padding-bottom: 60rpx;
}
.button {
margin-top: 50px;
margin-left: 50px;
margin-right: 50px;
}
.title {
font-family: PingFang SC;
font-weight: 500;
color: #000000;
font-size: 44rpx;
margin-bottom: 40rpx;
}
.top_tip {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
width: 90%;
text-align: left;
margin-top: 30rpx;
margin-left: 20rpx;
}
.power {
margin-top: 30rpx;
border-radius: 5px;
background-color: white;
width: 93%;
padding-bottom: 1rpx;
}
.power_info {
display: flex;
padding: 30rpx 25rpx;
align-items: center;
justify-content: space-between;
}
.power_info_more {
width: 30rpx;
height: 30rpx;
transform: rotate(90deg);
}
.power_info_less {
width: 30rpx;
height: 30rpx;
transform: rotate(270deg);
}
.power_info_text {
display: flex;
flex-direction: column;
}
.power_info_text_title {
margin-bottom: 10rpx;
font-weight: 400;
font-size: 35rpx;
}
.power_info_text_tip {
color: rgba(0, 0, 0, 0.4);
font-size: 25rpx;
}
.power_item {
padding: 30rpx 25rpx;
display: flex;
justify-content: space-between;
}
.power_item_title {
font-size: 30rpx;
}
.power_item_icon {
width: 30rpx;
height: 30rpx;
}
.line {
width: 95%;
margin: 0 auto;
height: 2rpx;
background-color: rgba(0, 0, 0, 0.1);
}
.environment {
color: rgba(0, 0, 0, 0.4);
font-size: 24rpx;
margin-top: 25%;
}
.code_box {
text-align: center;
background-color: white;
margin-top: 30rpx;
padding: 17rpx;
}
.code_box_title {
color: rgba(0, 0, 0, 0.5);
font-size: 26rpx;
margin-bottom: 20rpx;
text-align: left;
}
.code_box_record {
display: flex;
}
.code_box_record_title {
width: 33%;
font-size: 26rpx;
color: rgba(0, 0, 0, 0.5);
padding: 20rpx 0;
}
.code_box_record_detail {
width: 33%;
font-size: 26rpx;
padding: 20rpx 0;
}
.button {
width: 300rpx;
text-align: center;
margin: 20% auto 0 auto;
height: 80rpx;
color: white;
border-radius: 5px;
line-height: 80rpx;
background-color: #07c160;
}

@ -0,0 +1,112 @@
// pages/login/login.js
var that;
Page({
/**
* 页面的初始数据
*/
data: {
userInfo:null,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad:function(options) {
that = this;
wx.getStorage({
key:'userInfo',
success(res){
// console.log('get storage success',JSON.parse(res.data))
that.setData({
userInfo:JSON.parse(res.data)
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow(){
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
bindGetUserInfo: function(e){
that = this;
if(e.detail.userInfo){
wx.setStorage({
data:JSON.stringify(e.detail.userInfo),
key:'userInfo',
success(res){
// console.log('set storage success:',res)
that.setData({
userInfo:JSON.parse(res.data)
})
}
})
wx.getStorage({
key:'userInfo',
success(res){
// console.log('get storage success',JSON.parse(res.data))
that.setData({
userInfo:JSON.parse(res.data)
})
}
})
}
},
goToUser:function(options){
wx.navigateTo({
url: '../pages/user/user'
})
},
goToManager:function(options){
wx.navigateTo({
url: '../pages/manager/manager'
})
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,19 @@
<!--pages/login/login.wxml-->
<view wx:if="{{userInfo != null}}">
<view class="logo">
<open-data type="userAvatarUrl" class="userinfo" id="userinfo"></open-data>
</view>
</view>
<view wx:if="{{userInfo != null}}">
<text class="nickname_type">欢迎您! {{userInfo.nickName}}</text>
<button size="default" type="primary"class="tapbtn1" bindtap="goToUser">用户登录</button>
<button size="default" type="primary"class="tapbtn2" bindtap="goToManager">管理员登录</button>
</view>
<view wx:else="">
<view class="text_style"> <text> 微信登陆</text></view>
<view class="text_desc_style"><text>将获取您的信息,如头像、昵称等</text></view>
<button open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo"type="primary" size="default">授权登录</button>
</view>

@ -0,0 +1,49 @@
/* pages/login/login.wxss */
page {
background-color: rgb(255, 255, 255);
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.text_style{
margin-top: 40rpx;
height: 140rpx;
width: 100%;
background: #ffffff;
text-align: center;
font-size: 40rpx;
color: rgb(18, 18, 224);
}
.text_desc_style{
/* margin-top: 40rpx; */
height: 100rpx;
width: 100%;
background: #fff;
text-align: center;
font-size: 30rpx;
color: blue;
}
#userinfo{
width: 260rpx;
height:260rpx;
border-radius:50%;
display: flex;
overflow:hidden;
/* text-align: center; */
/* justify-content: center; */
margin-top: 50px;
margin-left: 120px;
}
.nickname_type{
width: 100%;
height: 200px;
display: flex;
/* align-items: center; */
justify-content: center;
}
.tapbtn1{
margin-top: 1%;
}
.tapbtn2{
margin-top: 5%;
}

@ -0,0 +1 @@
/* pages/index/index.wxss */

@ -0,0 +1,89 @@
// pages/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
goto() {
wx.navigateTo({
url: '/pages/test2/test2',
})
},
//管理员跳转登录页
guanliyuandenglu() {
wx.navigateTo({
url: '/pages/managerlogin/managerlogin',
})
},
zhuce1() {
wx.navigateTo({
url: '/pages/register/register',
})
},
exit() {
wx.navigateTo({
url: '../login',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,6 @@
<!--pages/index/index.wxml-->
<!-- 未登录 -->
<button type="primary" id="button2" bindtap="guanliyuandenglu">登录</button>
<button type="primary" id="button3" bindtap="zhuce1">注册</button>
<button type="warn" id = "button4" bindtap = "exit">退出</button>

@ -0,0 +1 @@
/* pages/manager/manager.wxss */

@ -0,0 +1,81 @@
// pages/adlogin/adlogin.js
Page({
data: {
account:'',
password:''
},
//获取输入的账号
getAccount(evt) {
//console.log('账号', evt.detail.value)
this.setData({
account: evt.detail.value
})
},
//获取管理员输入的密码
getPassword(event) {
// console.log('密码', event.detail.value)
this.setData({
password: event.detail.value
})
},
//点击管理员登陆
guanliyuanlogin() {
let account = this.data.account
let password = this.data.password
console.log('管理员账号', account, '管理员密码', password)
if (account.length < 4) {
wx.showToast({
icon: 'none',
title: '账号至少4位',
})
return
}
if (password.length < 4) {
wx.showToast({
icon: 'none',
title: '密码至少4位',
})
return
}
//管理员登陆
wx.cloud.database().collection('user').where({
account: account
}).get({
success(res) {
console.log("获取数据成功", res)
let manager = res.data[0]
console.log("manager", manager)
if (password == manager.password) {
console.log('登陆成功')
wx.showToast({
title: '登陆成功',
})
wx.navigateTo({
url: '../../pages/checklog/checklog',
})
wx.navigateTo({
url: '/pages/me1/me1',
})
//保存管理员登陆状态
wx.setStorageSync('manager', manager)
} else {
console.log('登陆失败')
wx.showToast({
icon: 'none',
title: '账号或密码不正确',
})
}
},
fail(res) {
console.log("获取数据失败", res)
}
})
}
})

@ -0,0 +1,6 @@
<!--pages/adlogin/adlogin.wxml-->
输入管理员账号
<input class="input" bindinput="getAccount"></input>
输入管理员密码
<input class="input" bindinput="getPassword"></input>
<button bindtap="guanliyuanlogin" type="primary">登录</button>

@ -0,0 +1,6 @@
/* pages/adlogin/adlogin.wxss */
/* pages/adlogin/adlogin.wxss */
.input{
border: 1px solid gainsboro;
margin: 20rpx;
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save