diff --git a/TODOs.md b/TODOs.md index 5413d18..826e0a1 100644 --- a/TODOs.md +++ b/TODOs.md @@ -1,6 +1,6 @@ 还要做的部分 - +【想一想访客怎么处理】 购物车隐藏 @@ -18,8 +18,9 @@ 后台管理两个端分开 -小程序提审(项目部署到服务器,提审时隐藏小商店) - +项目部署到服务器 +& 小程序提审(提审时隐藏小商店) +& 发给老班看一看 数据库填充测试数据(以及创建一些测试账号)并备份,线上演示数据修改删除避免真删 @@ -29,7 +30,7 @@ # IP 配置 -内网穿透:124.220.172.110 +内网穿透:106.75.217.14 nacos:106.75.217.14 数据库:本地 diff --git a/weixin-miniprogram/image/icon/scan.svg b/weixin-miniprogram/image/icon/scan.svg new file mode 100644 index 0000000..c1a2078 --- /dev/null +++ b/weixin-miniprogram/image/icon/scan.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/weixin-miniprogram/pages/index/index.js b/weixin-miniprogram/pages/index/index.js index ea2852c..d119a91 100644 --- a/weixin-miniprogram/pages/index/index.js +++ b/weixin-miniprogram/pages/index/index.js @@ -2,6 +2,8 @@ const menuItemDict = require('../../utils/menuList.js') const getUserGroupByRole = require('../../utils/getUserGroupByRole.js') +import scanQRCode from '../../utils/scanQRCode' + const app = getApp() Page({ @@ -144,6 +146,11 @@ Page({ url: dataset.pageurl }) break; + case 'function': + if (dataset.pageurl == 'scanQRCode') { + scanQRCode(wx) + } + break; default: console.log("切换页面失败", dataset) break; diff --git a/weixin-miniprogram/utils/menuList.js b/weixin-miniprogram/utils/menuList.js index 7cd888e..a3feb9e 100644 --- a/weixin-miniprogram/utils/menuList.js +++ b/weixin-miniprogram/utils/menuList.js @@ -1,119 +1,126 @@ -const switchTab = "switchTab"; -const navigateTo = "navigateTo"; -const redirectTo = "redirectTo"; -let id = 0; - -let menuItemDict = { - 'login': { - for: ['unknown'], - title: "登录", - image: "code.png", - switchFunc: switchTab, - url: '/pages/index/login', - }, - 'code': { - for: ['visitor', 'user'], - title: "进出码", - image: "code.png", - switchFunc: switchTab, - url: '/pages/residents/code' - }, - 'report': { - for: ['user'], - title: "体温上报", - image: "report.png", - switchFunc: switchTab, - url: '/pages/residents/report' - }, - 'shop': { - for: ['user'], - title: "生活物资", - image: "shopping.svg", - switchFunc: switchTab, - url: '/pages/shop/shop' - }, - 'apply-record': { - for: ['visitor'], - title: "申请记录", - image: "apply.png", - switchFunc: switchTab, - url: '' - }, - 'apply-approval': { - for: ['admin'], - title: "申请审批", - image: "apply.png", // ApplyReplay - switchFunc: switchTab, - url: '' - }, - 'visitor-apply': { - for: ['admin'], - title: "访客审批", - image: "visitor.png", - switchFunc: switchTab, - url: '' - }, - 'abnormal': { - for: ['admin'], - title: "异常人员", - image: "danger.png", - switchFunc: switchTab, - url: '' - }, - 'feedback-submit': { - for: ['visitor'], - title: "提交反馈", - image: "fk.png", - switchFunc: switchTab, - url: '' - }, - 'feedback-list': { - for: ['visitor'], - title: "反馈查看", - image: "feedback.png", - switchFunc: switchTab, - url: '' - }, - 'feedback-reply': { - for: ['admin'], - title: "反馈回复", - image: "feedback.png", - switchFunc: switchTab, - url: '' - }, - 'person': { - for: ['admin', 'user'], - title: "个人中心", - image: "person.png", - switchFunc: switchTab, - url: '/pages/person/person' - }, - 'update-password': { - for: ['user', 'admin'], - title: "密码修改", - image: "updPwd.png", - switchFunc: switchTab, - url: '' - }, - 'assign': { - for: ['admin'], - title: "分配账号", - image: "count.png", - switchFunc: switchTab, - url: '' - }, - 'unfinish': { - for: ['admin'], - title: "今日未填", // RedList - image: "_report.png", - switchFunc: switchTab, - url: '' - } -} -let keys = Object.keys(menuItemDict); -for (let key of keys) { - menuItemDict[key].id = id++; - menuItemDict[key].addDot = false; -} - -module.exports = menuItemDict +const switchTab = "switchTab"; +const navigateTo = "navigateTo"; +const redirectTo = "redirectTo"; +let id = 0; + +let menuItemDict = { + 'login': { + for: ['unknown'], + title: "登录", + image: "code.png", + switchFunc: switchTab, + url: '/pages/index/login', + }, + 'code': { + for: ['visitor', 'user'], + title: "进出码", + image: "code.png", + switchFunc: switchTab, + url: '/pages/residents/code' + }, + 'gateCode': { + for: ['visitor', 'user'], + title: "扫门禁码", + image: "scan.svg", + switchFunc: "function", + url: 'scanQRCode' + }, + 'report': { + for: ['user'], + title: "体温上报", + image: "report.png", + switchFunc: switchTab, + url: '/pages/residents/report' + }, + 'shop': { + for: ['user'], + title: "生活物资", + image: "shopping.svg", + switchFunc: switchTab, + url: '/pages/shop/shop' + }, + 'apply-record': { + for: ['visitor'], + title: "申请记录", + image: "apply.png", + switchFunc: switchTab, + url: '' + }, + 'apply-approval': { + for: ['admin'], + title: "申请审批", + image: "apply.png", // ApplyReplay + switchFunc: switchTab, + url: '' + }, + 'visitor-apply': { + for: ['admin'], + title: "访客审批", + image: "visitor.png", + switchFunc: switchTab, + url: '' + }, + 'abnormal': { + for: ['admin'], + title: "异常人员", + image: "danger.png", + switchFunc: switchTab, + url: '' + }, + 'feedback-submit': { + for: ['visitor'], + title: "提交反馈", + image: "fk.png", + switchFunc: switchTab, + url: '' + }, + 'feedback-list': { + for: ['visitor'], + title: "反馈查看", + image: "feedback.png", + switchFunc: switchTab, + url: '' + }, + 'feedback-reply': { + for: ['admin'], + title: "反馈回复", + image: "feedback.png", + switchFunc: switchTab, + url: '' + }, + 'person': { + for: ['admin', 'user'], + title: "个人中心", + image: "person.png", + switchFunc: switchTab, + url: '/pages/person/person' + }, + 'update-password': { + for: ['user', 'admin'], + title: "密码修改", + image: "updPwd.png", + switchFunc: switchTab, + url: '' + }, + 'assign': { + for: ['admin'], + title: "分配账号", + image: "count.png", + switchFunc: switchTab, + url: '' + }, + 'unfinish': { + for: ['admin'], + title: "今日未填", // RedList + image: "_report.png", + switchFunc: switchTab, + url: '' + } +} +let keys = Object.keys(menuItemDict); +for (let key of keys) { + menuItemDict[key].id = id++; + menuItemDict[key].addDot = false; +} + +module.exports = menuItemDict