小程序端扫门禁码跳转;门禁端调整;bugfix小程序端商品售价和划线价反了
This commit is contained in:
27
TODOs.md
27
TODOs.md
@@ -1,7 +1,30 @@
|
|||||||
还要做的部分
|
还要做的部分
|
||||||
|
|
||||||
社区、系统管理员后台管理 frontend项目
|
|
||||||
小程序扫门禁码之后门禁开门
|
|
||||||
|
购物车隐藏
|
||||||
|
|
||||||
|
首页密码修改
|
||||||
|
|
||||||
|
大门人员进出后台管理
|
||||||
|
|
||||||
|
首页加一个扫门禁码
|
||||||
|
|
||||||
|
订单发货小程序端显示
|
||||||
|
|
||||||
|
小程序扫门禁码之后门禁开门(扫码 websocket 推到门禁端)
|
||||||
|
|
||||||
|
门禁段显示大门开放状态
|
||||||
|
|
||||||
|
后台管理两个端分开
|
||||||
|
|
||||||
|
小程序提审(项目部署到服务器,提审时隐藏小商店)
|
||||||
|
|
||||||
|
|
||||||
|
数据库填充测试数据(以及创建一些测试账号)并备份,线上演示数据修改删除避免真删
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
小程序修改密码
|
小程序修改密码
|
||||||
|
|
||||||
# IP 配置
|
# IP 配置
|
||||||
|
@@ -47,6 +47,20 @@ public class GateController {
|
|||||||
return Res.success(gateVOList);
|
return Res.success(gateVOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取大门详情(小程序端)
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/miniprogram/detail")
|
||||||
|
@ResponseBody
|
||||||
|
public Res getGateDetail(String id) {
|
||||||
|
Long gateId = Long.valueOf(id);
|
||||||
|
Gate gate = gateService.getGateById(gateId);
|
||||||
|
GateVO gateVO = GateVO.convertFrom(gate);
|
||||||
|
return Res.success(gateVO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取大门列表
|
* 获取大门列表
|
||||||
*
|
*
|
||||||
@@ -77,10 +91,10 @@ public class GateController {
|
|||||||
"大门名称", FieldBuilder.EDIT_PLACEHOLDER_SAME_AS_ADD_PLACEHOLDER,
|
"大门名称", FieldBuilder.EDIT_PLACEHOLDER_SAME_AS_ADD_PLACEHOLDER,
|
||||||
FieldRuleListBuilder.create()
|
FieldRuleListBuilder.create()
|
||||||
.add(FieldRuleBuilder.create("大门名称").required())
|
.add(FieldRuleBuilder.create("大门名称").required())
|
||||||
.add(FieldRuleBuilder.create("大门名称").minMax(2, 15)),
|
.add(FieldRuleBuilder.create("大门名称").minMax(2, 12)),
|
||||||
"DPD @cword(2, 15)"
|
"DPD @cword(2, 12)"
|
||||||
)
|
)
|
||||||
.add("open", "open", "状态", true,
|
.add("open", "openStatus", "状态", true,
|
||||||
FieldType.TEXT, SearchType.SELECT, AddType.SELECT, EditType.SELECT,
|
FieldType.TEXT, SearchType.SELECT, AddType.SELECT, EditType.SELECT,
|
||||||
FieldBuilder.SEARCH_PLACEHOLDER_SAME_AS_FIELDNAME,
|
FieldBuilder.SEARCH_PLACEHOLDER_SAME_AS_FIELDNAME,
|
||||||
"状态", FieldBuilder.EDIT_PLACEHOLDER_SAME_AS_ADD_PLACEHOLDER,
|
"状态", FieldBuilder.EDIT_PLACEHOLDER_SAME_AS_ADD_PLACEHOLDER,
|
||||||
@@ -96,7 +110,7 @@ public class GateController {
|
|||||||
stateMap.put(false, "禁止通行");
|
stateMap.put(false, "禁止通行");
|
||||||
// build
|
// build
|
||||||
JSONArray fieldMapper = FieldMapperBuilder.create()
|
JSONArray fieldMapper = FieldMapperBuilder.create()
|
||||||
.add("open", "open", stateMap)
|
.add("open", "openStatus", stateMap)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// 拼装返回结果
|
// 拼装返回结果
|
||||||
|
@@ -17,6 +17,9 @@ public class GateService {
|
|||||||
|
|
||||||
|
|
||||||
public Gate getGateById(Long id) {
|
public Gate getGateById(Long id) {
|
||||||
|
if (id == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return gateDao.getGateById(id);
|
return gateDao.getGateById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -13,10 +14,17 @@ body {
|
|||||||
background-color: #0556c6;
|
background-color: #0556c6;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 3fr 4fr;
|
grid-template-columns: 3fr 4fr;
|
||||||
|
grid-template-rows: 60px 1fr;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.top-container {
|
||||||
|
grid-column-start: 1;
|
||||||
|
grid-column-end: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-container,
|
||||||
.left-container {
|
.left-container {
|
||||||
text-shadow: 2px 2px 2px #00000066;
|
text-shadow: 2px 2px 2px #00000066;
|
||||||
}
|
}
|
||||||
|
@@ -64,3 +64,46 @@
|
|||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 弹窗列表样式 */
|
||||||
|
#gate-list {
|
||||||
|
width: 100%;
|
||||||
|
height: 70%;
|
||||||
|
/*box-shadow: 0 2px 10px 0 rgb(0 0 0 / 19%);*/
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gate-list-item {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 70px;
|
||||||
|
height: 50px;
|
||||||
|
margin: 8px 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
place-items: center;
|
||||||
|
background-color: #f6f6f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gate-list-item > p {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gate-list-item:hover {
|
||||||
|
background-color: #dcdcdc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gate-list-item.active {
|
||||||
|
background-color: #b7b7b7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.open {
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
.closed {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
@@ -25,6 +25,15 @@ DOMSettingPanel.addEventListener('click', function (e) {
|
|||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
})
|
})
|
||||||
DOMSaveSettingButton.addEventListener('click', function (e) {
|
DOMSaveSettingButton.addEventListener('click', function (e) {
|
||||||
closeSettingPanel()
|
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
|
if (window.selectGateId) {
|
||||||
|
closeSettingPanel()
|
||||||
|
location.href = "./index.html?gateId=" + window.selectGateId
|
||||||
|
} else {
|
||||||
|
alert("请选择大门")
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 绑定到全局
|
||||||
|
window.showSettingPanel = showSettingPanel
|
||||||
|
window.closeSettingPanel = closeSettingPanel
|
||||||
|
@@ -8,16 +8,19 @@
|
|||||||
<!-- Electron -->
|
<!-- Electron -->
|
||||||
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src *; img-src *; connect-src *;"> -->
|
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src *; img-src *; connect-src *;"> -->
|
||||||
<title>社区疫情防控系统 - 门禁端</title>
|
<title>社区疫情防控系统 - 门禁端</title>
|
||||||
<link rel="stylesheet" href="./assets/css/index.css" />
|
<link rel="stylesheet" href="./assets/css/index.css"/>
|
||||||
<link rel="stylesheet" href="./assets/css/setting-panel.css" />
|
<link rel="stylesheet" href="./assets/css/setting-panel.css"/>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="ctrl-btn">
|
<div class="ctrl-btn">
|
||||||
<img class="btn btn-ctrl" id="setting-button" src="./assets/svg/setting.svg" alt="">
|
<img class="btn btn-ctrl" id="setting-button" src="./assets/svg/setting.svg" alt="">
|
||||||
<img class="btn btn-ctrl" id="fullscreen-button" src="./assets/svg/fullscreen.svg" alt="">
|
<img class="btn btn-ctrl" id="fullscreen-button" src="./assets/svg/fullscreen.svg" alt="">
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
<div class="top-container">
|
||||||
|
<p id="gate-name" style="font-size: 28px;">Loading...</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
|
||||||
<div class="left-container">
|
<div class="left-container">
|
||||||
<h1>进出社区请扫码</h1>
|
<h1>进出社区请扫码</h1>
|
||||||
<h3>社区居民</h3>
|
<h3>社区居民</h3>
|
||||||
@@ -32,25 +35,37 @@
|
|||||||
<p>1. 请联系管理员为你添加进出权限</p>
|
<p>1. 请联系管理员为你添加进出权限</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-container">
|
<div class="right-container">
|
||||||
<img id="qrcode" src="">
|
<h1 id="no-qrcode">请选择大门</h1>
|
||||||
|
<img id="qrcode" src="" style="display: none">
|
||||||
<p id="refreshTimeCountDown"></p>
|
<p id="refreshTimeCountDown"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="full-screen-mask" class="full-screen-mask"></div>
|
<div id="full-screen-mask" class="full-screen-mask hidden"></div>
|
||||||
<div id="setting-container" class="setting-container">
|
<div id="setting-container" class="setting-container hidden">
|
||||||
<div class="setting-panel">
|
<div class="setting-panel">
|
||||||
<!-- 关闭按钮 -->
|
<!-- 关闭按钮 -->
|
||||||
<img id="close-setting-button" class="btn" src="./assets/svg/close.svg" alt="">
|
<img id="close-setting-button" class="btn" src="./assets/svg/close.svg" alt="">
|
||||||
|
|
||||||
|
<h3 style="text-align: center;">请选择大门</h3>
|
||||||
|
|
||||||
|
<div id="gate-list">
|
||||||
|
<div class="gate-list-item">
|
||||||
|
<p>大门1</p>
|
||||||
|
<p class="status open closed">
|
||||||
|
开放 封闭
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="save-button-container" style="text-align: center;">
|
<div class="save-button-container" style="text-align: center;">
|
||||||
<button class="save-setting-button">保 存</button>
|
<button class="save-setting-button">保 存</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="./renderer.js" type="module"></script>
|
<script src="./assets/js/setting-panel.js" type="module"></script>
|
||||||
<script src="./assets/js/setting-panel.js" type="module"></script>
|
<script src="./renderer.js" type="module"></script>
|
||||||
<script src="./assets/js/websocket.js"></script>
|
<script src="./assets/js/websocket.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
// 定义常量
|
||||||
const url = "https://epp.only4.work/access/wechat/getUnlimitedQRCode"
|
const url = "https://epp.only4.work/access/wechat/getUnlimitedQRCode"
|
||||||
const page = "pages/index/index" // "pages/scan/entrance"
|
const page = "pages/index/index" // "pages/scan/entrance"
|
||||||
const envVersion = "develop" // 正式版为 "release",体验版为 "trial",开发版为 "develop"
|
const envVersion = "develop" // 正式版为 "release",体验版为 "trial",开发版为 "develop"
|
||||||
@@ -5,6 +6,36 @@ const autoColor = true
|
|||||||
const isHyaline = false
|
const isHyaline = false
|
||||||
const width = 500
|
const width = 500
|
||||||
|
|
||||||
|
// 页面上的元素
|
||||||
|
const image = document.getElementById('qrcode')
|
||||||
|
const noQrInfo = document.getElementById('no-qrcode')
|
||||||
|
const refreshTimeCountDown = document.getElementById('refreshTimeCountDown')
|
||||||
|
const DOMGateList = document.getElementById('gate-list')
|
||||||
|
|
||||||
|
// 大门列表
|
||||||
|
window.gateList = []
|
||||||
|
|
||||||
|
// 当前大门
|
||||||
|
window.currentGate = null
|
||||||
|
|
||||||
|
// 点击全屏
|
||||||
|
document.getElementById("fullscreen-button").addEventListener("click", function () {
|
||||||
|
if (document.fullscreenElement) {
|
||||||
|
document.exitFullscreen();
|
||||||
|
} else {
|
||||||
|
if (inElectron) {
|
||||||
|
// electron 中
|
||||||
|
const message = JSON.stringify({
|
||||||
|
action: 'fullscreen'
|
||||||
|
});
|
||||||
|
window.parent.postMessage(message, '*');
|
||||||
|
} else {
|
||||||
|
// 浏览器中
|
||||||
|
document.body.requestFullscreen()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// 获取 Url 参数
|
// 获取 Url 参数
|
||||||
function getUrlParams() {
|
function getUrlParams() {
|
||||||
let params = {}
|
let params = {}
|
||||||
@@ -18,46 +49,19 @@ function getUrlParams() {
|
|||||||
// console.log(params)
|
// console.log(params)
|
||||||
return params
|
return params
|
||||||
}
|
}
|
||||||
let urlParams = getUrlParams()
|
|
||||||
console.log("urlParams", urlParams)
|
|
||||||
|
|
||||||
// 是否在 electron 中
|
|
||||||
const inElectron = urlParams['inElectron']
|
|
||||||
|
|
||||||
// 当前的门禁端
|
|
||||||
let gateId = urlParams['gateId'] || ""
|
|
||||||
|
|
||||||
if (!gateId) {
|
|
||||||
// 弹出选择框
|
|
||||||
}
|
|
||||||
|
|
||||||
// 点击全屏
|
|
||||||
document.getElementById("fullscreen-button").addEventListener("click", function () {
|
|
||||||
if (document.fullscreenElement) {
|
|
||||||
document.exitFullscreen();
|
|
||||||
} else {
|
|
||||||
if(inElectron) {
|
|
||||||
// electron 中
|
|
||||||
const message = JSON.stringify({
|
|
||||||
action: 'fullscreen'
|
|
||||||
});
|
|
||||||
window.parent.postMessage(message, '*');
|
|
||||||
} else {
|
|
||||||
// 浏览器中
|
|
||||||
document.body.requestFullscreen()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// 页面上的元素
|
|
||||||
const image = document.getElementById('qrcode')
|
|
||||||
const refreshTimeCountDown = document.getElementById('refreshTimeCountDown')
|
|
||||||
|
|
||||||
// 定时更新页面上的小程序码
|
// 定时更新页面上的小程序码
|
||||||
let i = 0, refreshTime = 10 + 1
|
let i = 0, refreshTime = 10 + 1
|
||||||
|
|
||||||
function updateQRCode() {
|
function updateQRCode() {
|
||||||
|
// 取消图片隐藏
|
||||||
|
image.style.visibility = '';
|
||||||
|
image.style.display = '';
|
||||||
|
noQrInfo.style.display = 'none';
|
||||||
|
|
||||||
if (i % refreshTime == 0) {
|
if (i % refreshTime == 0) {
|
||||||
let scene = encodeURIComponent(`guard&${Date.now()}`);
|
// scene 最长支支持 32 位,所以这里不传入时间戳
|
||||||
|
let scene = encodeURIComponent(`guard&${window.currentGate.id}`); // &${Date.now()}
|
||||||
image.src = `${url}?page=${page}&scene=${scene}&envVersion=${envVersion}&width=${width}&autoColor=${autoColor}&isHyaline=${isHyaline}`
|
image.src = `${url}?page=${page}&scene=${scene}&envVersion=${envVersion}&width=${width}&autoColor=${autoColor}&isHyaline=${isHyaline}`
|
||||||
console.log(image.src)
|
console.log(image.src)
|
||||||
refreshTimeCountDown.innerHTML = ` `
|
refreshTimeCountDown.innerHTML = ` `
|
||||||
@@ -67,5 +71,76 @@ function updateQRCode() {
|
|||||||
i = i % refreshTime + 1
|
i = i % refreshTime + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
updateQRCode()
|
// 挂载到 window 上
|
||||||
setInterval(updateQRCode, 1000)
|
window.updateQRCode = updateQRCode
|
||||||
|
|
||||||
|
// 弹窗中修改 item
|
||||||
|
function changePanelSelectGate(gateId) {
|
||||||
|
// 删除旧的 active
|
||||||
|
let activeList = document.querySelectorAll('.gate-list-item.active')
|
||||||
|
for (let a of activeList) {
|
||||||
|
a.classList.remove('active')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加新的 active
|
||||||
|
let newActiveItem = document.getElementById(`gate-list-${gateId}`)
|
||||||
|
if (newActiveItem) {
|
||||||
|
newActiveItem.classList.add('active')
|
||||||
|
window.selectGateId = gateId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 挂载到 window 上
|
||||||
|
window.changePanelSelectGate = changePanelSelectGate
|
||||||
|
|
||||||
|
// 发送请求,获取大门列表
|
||||||
|
async function getGateList() {
|
||||||
|
const response = await fetch('https://epp.only4.work/access/gate/guard-client/getGateList');
|
||||||
|
const data = await response.json();
|
||||||
|
return data.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onload = async function () {
|
||||||
|
// 获取 url 参数
|
||||||
|
let urlParams = getUrlParams()
|
||||||
|
console.log("urlParams", urlParams)
|
||||||
|
|
||||||
|
// 是否在 electron 中
|
||||||
|
const inElectron = urlParams['inElectron']
|
||||||
|
|
||||||
|
// 当前的门禁端
|
||||||
|
let gateId = urlParams['gateId'] || ""
|
||||||
|
|
||||||
|
// 获取大门列表
|
||||||
|
window.gateList = await getGateList()
|
||||||
|
console.log("gateList", window.gateList)
|
||||||
|
|
||||||
|
let domList = []
|
||||||
|
for (let gate of window.gateList) {
|
||||||
|
domList.push(`
|
||||||
|
<div id="gate-list-${gate.id}" class="gate-list-item" onclick="window.changePanelSelectGate('${gate.id}')">
|
||||||
|
<p>${gate.name}</p>
|
||||||
|
<p class="status ${gate.open ? 'open' : 'closed'}">
|
||||||
|
${gate.open ? '开放' : '封闭'}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
DOMGateList.innerHTML = domList.join('')
|
||||||
|
|
||||||
|
// 通过id 找门禁
|
||||||
|
window.currentGate = gateList.find((gate) => gate.id === gateId)
|
||||||
|
|
||||||
|
if (!window.currentGate) {
|
||||||
|
// 弹出选择框
|
||||||
|
window.showSettingPanel && window.showSettingPanel()
|
||||||
|
} else {
|
||||||
|
document.querySelector('#gate-name').textContent = window.currentGate.name
|
||||||
|
// 开始更新图片
|
||||||
|
updateQRCode()
|
||||||
|
setInterval(updateQRCode, 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
Target Server Version : 80012
|
Target Server Version : 80012
|
||||||
File Encoding : 65001
|
File Encoding : 65001
|
||||||
|
|
||||||
Date: 14/04/2023 00:51:48
|
Date: 15/04/2023 18:50:35
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SET NAMES utf8mb4;
|
SET NAMES utf8mb4;
|
||||||
@@ -321,7 +321,7 @@ CREATE TABLE `order_detail` (
|
|||||||
INDEX `good_id`(`good_id`) USING BTREE,
|
INDEX `good_id`(`good_id`) USING BTREE,
|
||||||
CONSTRAINT `order_detail_ibfk_1` FOREIGN KEY (`good_id`) REFERENCES `goods` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
CONSTRAINT `order_detail_ibfk_1` FOREIGN KEY (`good_id`) REFERENCES `goods` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||||
CONSTRAINT `order_detail_ibfk_2` FOREIGN KEY (`order_id`) REFERENCES `order` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
CONSTRAINT `order_detail_ibfk_2` FOREIGN KEY (`order_id`) REFERENCES `order` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 46 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;
|
) ENGINE = InnoDB AUTO_INCREMENT = 49 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of order_detail
|
-- Records of order_detail
|
||||||
@@ -352,7 +352,7 @@ CREATE TABLE `report` (
|
|||||||
`temperature` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '体温是否正常',
|
`temperature` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '体温是否正常',
|
||||||
`address` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
|
`address` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 71 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
) ENGINE = InnoDB AUTO_INCREMENT = 72 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of report
|
-- Records of report
|
||||||
@@ -366,6 +366,7 @@ INSERT INTO `report` VALUES (60, 3, '用户 密码user', '2023-03-20 00:47:22',
|
|||||||
INSERT INTO `report` VALUES (61, 3, '用户 密码user', '2023-03-23 22:24:14', '0', '湖北省武汉市武昌区修远路');
|
INSERT INTO `report` VALUES (61, 3, '用户 密码user', '2023-03-23 22:24:14', '0', '湖北省武汉市武昌区修远路');
|
||||||
INSERT INTO `report` VALUES (62, 3, '用户 密码user', '2023-03-13 22:54:12', '0', '湖北省武汉市洪山区文治街102-4号');
|
INSERT INTO `report` VALUES (62, 3, '用户 密码user', '2023-03-13 22:54:12', '0', '湖北省武汉市洪山区文治街102-4号');
|
||||||
INSERT INTO `report` VALUES (70, 3, '用户 密码user', '2023-04-14 00:36:55', '0', '湖北省武汉市洪山区文治街102-4号');
|
INSERT INTO `report` VALUES (70, 3, '用户 密码user', '2023-04-14 00:36:55', '0', '湖北省武汉市洪山区文治街102-4号');
|
||||||
|
INSERT INTO `report` VALUES (71, 3, '用户 密码user', '2023-04-14 13:36:23', '0', '湖北省武汉市洪山区紫菘花园东路');
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for role
|
-- Table structure for role
|
||||||
|
@@ -173,6 +173,114 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"response": []
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "http://localhost:8001/user/manage/getUserList?pageIndex=2&pageSize=2&username=&roleId=&realname=&phoneNumber=11&idNumber=&buildingId=&doorplate=",
|
||||||
|
"request": {
|
||||||
|
"method": "GET",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "authority",
|
||||||
|
"value": "epp.only4.work"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "accept",
|
||||||
|
"value": "application/json, text/plain, */*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "accept-language",
|
||||||
|
"value": "zh-CN,zh;q=0.9,en;q=0.8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "origin",
|
||||||
|
"value": "http://localhost:5173"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "referer",
|
||||||
|
"value": "http://localhost:5173/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sec-ch-ua",
|
||||||
|
"value": "\"Google Chrome\";v=\"111\", \"Not(A:Brand\";v=\"8\", \"Chromium\";v=\"111\""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sec-ch-ua-mobile",
|
||||||
|
"value": "?0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sec-ch-ua-platform",
|
||||||
|
"value": "\"Windows\""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sec-fetch-dest",
|
||||||
|
"value": "empty"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sec-fetch-mode",
|
||||||
|
"value": "cors"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sec-fetch-site",
|
||||||
|
"value": "cross-site"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "user-agent",
|
||||||
|
"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"url": {
|
||||||
|
"raw": "http://localhost:8001/user/manage/getUserList?pageIndex=2&pageSize=2&username=&roleId=&realname=&phoneNumber=11&idNumber=&buildingId=&doorplate=",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"localhost"
|
||||||
|
],
|
||||||
|
"port": "8001",
|
||||||
|
"path": [
|
||||||
|
"user",
|
||||||
|
"manage",
|
||||||
|
"getUserList"
|
||||||
|
],
|
||||||
|
"query": [
|
||||||
|
{
|
||||||
|
"key": "pageIndex",
|
||||||
|
"value": "2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "pageSize",
|
||||||
|
"value": "2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "username",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "roleId",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "realname",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "phoneNumber",
|
||||||
|
"value": "11"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "idNumber",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "buildingId",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "doorplate",
|
||||||
|
"value": ""
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -327,6 +435,50 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"response": []
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "[线上] 门禁端 获取大门列表",
|
||||||
|
"request": {
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": {
|
||||||
|
"raw": "https://epp.only4.work/access/gate/guard-client/getGateList",
|
||||||
|
"protocol": "https",
|
||||||
|
"host": [
|
||||||
|
"epp",
|
||||||
|
"only4",
|
||||||
|
"work"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"access",
|
||||||
|
"gate",
|
||||||
|
"guard-client",
|
||||||
|
"getGateList"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "[线上] 小程序端 获取大门详情",
|
||||||
|
"request": {
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": {
|
||||||
|
"raw": "https://epp.only4.work/guard-client/getGateList",
|
||||||
|
"protocol": "https",
|
||||||
|
"host": [
|
||||||
|
"epp",
|
||||||
|
"only4",
|
||||||
|
"work"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"guard-client",
|
||||||
|
"getGateList"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -352,6 +504,45 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"response": []
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "http://localhost:80/test",
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"url": {
|
||||||
|
"raw": "http://localhost:80/test/test",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"localhost"
|
||||||
|
],
|
||||||
|
"port": "80",
|
||||||
|
"path": [
|
||||||
|
"test",
|
||||||
|
"test"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "http://localhost:8011/test",
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"url": {
|
||||||
|
"raw": "http://localhost:8011/test",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"localhost"
|
||||||
|
],
|
||||||
|
"port": "8011",
|
||||||
|
"path": [
|
||||||
|
"test"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -667,6 +858,176 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"response": []
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "https://epp.only4.work/shop/good/manage/editGood",
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "authority",
|
||||||
|
"value": "epp.only4.work"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "accept",
|
||||||
|
"value": "application/json, text/plain, */*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "accept-language",
|
||||||
|
"value": "zh-CN,zh;q=0.9,en;q=0.8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "content-type",
|
||||||
|
"value": "application/x-www-form-urlencoded"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "origin",
|
||||||
|
"value": "http://localhost:5174"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "referer",
|
||||||
|
"value": "http://localhost:5174/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sec-ch-ua",
|
||||||
|
"value": "\"Google Chrome\";v=\"111\", \"Not(A:Brand\";v=\"8\", \"Chromium\";v=\"111\""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sec-ch-ua-mobile",
|
||||||
|
"value": "?0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sec-ch-ua-platform",
|
||||||
|
"value": "\"Windows\""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sec-fetch-dest",
|
||||||
|
"value": "empty"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sec-fetch-mode",
|
||||||
|
"value": "cors"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sec-fetch-site",
|
||||||
|
"value": "cross-site"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "user-agent",
|
||||||
|
"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "urlencoded",
|
||||||
|
"urlencoded": [
|
||||||
|
{
|
||||||
|
"key": "id",
|
||||||
|
"value": "-1",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "picUrl",
|
||||||
|
"value": "qfbcdboiwxn",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "goodsName",
|
||||||
|
"value": "syihtraudeuueqrmqe",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "categoryId",
|
||||||
|
"value": "2",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "brand",
|
||||||
|
"value": "vfadnwkwvxnp",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "brief",
|
||||||
|
"value": "swxypuwotn",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "isOnSale",
|
||||||
|
"value": "1",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "sortOrder",
|
||||||
|
"value": "797",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "unit",
|
||||||
|
"value": "oyu",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "counterPrice",
|
||||||
|
"value": "133.5214",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "retailPrice",
|
||||||
|
"value": "2701338743",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "detail",
|
||||||
|
"value": "hpfowwfaewhclntoyddefpyroqmwkkqgsyuvmktwwkwbrqtocrygeusevgvwbplvnectvdrkwfybilhspgqpzmgmhsiadkdsvwj",
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "https://epp.only4.work/shop/good/manage/editGood",
|
||||||
|
"protocol": "https",
|
||||||
|
"host": [
|
||||||
|
"epp",
|
||||||
|
"only4",
|
||||||
|
"work"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"shop",
|
||||||
|
"good",
|
||||||
|
"manage",
|
||||||
|
"editGood"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "[微服务] getTmpCosCredential",
|
||||||
|
"request": {
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": {
|
||||||
|
"raw": "http://localhost:8003/shop/good/manage/imageUpload/getTmpCosCredential?ext=1",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"localhost"
|
||||||
|
],
|
||||||
|
"port": "8003",
|
||||||
|
"path": [
|
||||||
|
"shop",
|
||||||
|
"good",
|
||||||
|
"manage",
|
||||||
|
"imageUpload",
|
||||||
|
"getTmpCosCredential"
|
||||||
|
],
|
||||||
|
"query": [
|
||||||
|
{
|
||||||
|
"key": "ext",
|
||||||
|
"value": "1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
1
weixin-miniprogram/image/icon/gate-background.svg
Normal file
1
weixin-miniprogram/image/icon/gate-background.svg
Normal file
@@ -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 viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M768 149.333333a21.333333 21.333333 0 0 1 21.333333-21.333333h64v-21.333333a21.333333 21.333333 0 0 1 42.666667 0v21.333333h64a21.333333 21.333333 0 0 1 0 42.666667h-170.666667a21.333333 21.333333 0 0 1-21.333333-21.333334zM64 170.666667h170.666667a21.333333 21.333333 0 0 0 0-42.666667h-64v-21.333333a21.333333 21.333333 0 0 0-42.666667 0v21.333333H64a21.333333 21.333333 0 0 0 0 42.666667z m917.333333 64v640a21.333333 21.333333 0 0 1-21.333333 21.333333h-170.666667a21.333333 21.333333 0 0 1-21.333333-21.333333v-21.333334H256v21.333334a21.333333 21.333333 0 0 1-21.333333 21.333333H64a21.333333 21.333333 0 0 1-21.333333-21.333333V234.666667a21.333333 21.333333 0 0 1 21.333333-21.333334h170.666667a21.333333 21.333333 0 0 1 21.333333 21.333334v106.666666h42.666667v-64a21.333333 21.333333 0 0 1 42.666666 0v490.666667h85.333334V597.333333h-21.333334a21.333333 21.333333 0 0 1-21.333333-21.333333V490.666667a21.333333 21.333333 0 0 1 21.333333-21.333334h21.333334V384h-21.333334a21.333333 21.333333 0 0 1 0-42.666667h21.333334V192a21.333333 21.333333 0 0 1 42.666666 0v149.333333h85.333334V192a21.333333 21.333333 0 0 1 42.666666 0v149.333333h85.333334v-64a21.333333 21.333333 0 0 1 42.666666 0v64h42.666667V234.666667a21.333333 21.333333 0 0 1 21.333333-21.333334h170.666667a21.333333 21.333333 0 0 1 21.333333 21.333334zM298.666667 384h-42.666667v384h42.666667z m256 213.333333H469.333333v170.666667h85.333334z m0-213.333333H469.333333v85.333333h85.333334z m128 0H597.333333v85.333333h21.333334a21.333333 21.333333 0 0 1 21.333333 21.333334v85.333333a21.333333 21.333333 0 0 1-21.333333 21.333333h-21.333334v170.666667h42.666667v42.666667h42.666667z m85.333333 0h-42.666667v384h42.666667z" fill="#5C5C66"></path></svg>
|
After Width: | Height: | Size: 2.0 KiB |
@@ -46,10 +46,11 @@ Page({
|
|||||||
//判断用户是否是通过扫小程序码进来的
|
//判断用户是否是通过扫小程序码进来的
|
||||||
if (options && options.scene) {
|
if (options && options.scene) {
|
||||||
// 扫门禁的小程序码
|
// 扫门禁的小程序码
|
||||||
if (options.scene.split('%')[0] == "guard") {
|
let scene = options.scene
|
||||||
options.scene = null
|
if (scene.startsWith("guard%")) { // scene.split('%')[0] == "guard"
|
||||||
|
options.scene = null // 清掉参数 避免重复触发
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: "/pages/scan/entrance"
|
url: "/pages/scan/entrance?scene=" + scene
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@@ -1,11 +1,24 @@
|
|||||||
// pages/scan/entrance.js
|
// pages/scan/entrance.js
|
||||||
|
|
||||||
|
const gateService = require("../../services/gate")
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
options: {},
|
// 传入参数
|
||||||
|
gateId: "",
|
||||||
|
|
||||||
|
// 接口返回数据
|
||||||
|
gateDetail: "",
|
||||||
|
|
||||||
|
// UI显示用
|
||||||
|
gateName: "未知",
|
||||||
|
open: false,
|
||||||
|
|
||||||
|
currentTime: "",
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,9 +26,23 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
console.log(options)
|
console.log(options)
|
||||||
|
let scene = options.scene
|
||||||
|
if (!scene) {
|
||||||
|
wx.navigateBack()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
scene = decodeURIComponent(scene) // %26 == &
|
||||||
|
if (scene.indexOf('&') == -1) {
|
||||||
|
wx.navigateBack()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let gateId = scene.split('&')[1]
|
||||||
this.setData({
|
this.setData({
|
||||||
options: JSON.stringify(options),
|
gateId: gateId,
|
||||||
})
|
});
|
||||||
|
|
||||||
|
this.loadPageData()
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,7 +77,7 @@ Page({
|
|||||||
* 页面相关事件处理函数--监听用户下拉动作
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
*/
|
*/
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
this.loadPageData()
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,5 +92,24 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
loadPageData() {
|
||||||
|
let gateId = this.data.gateId;
|
||||||
|
(async () => {
|
||||||
|
let gateDetail = await gateService.getGateDetail(gateId)
|
||||||
|
console.log("gateDetail", gateDetail)
|
||||||
|
this.setData({
|
||||||
|
gateDetail: JSON.stringify(gateDetail),
|
||||||
|
gateName: gateDetail.name,
|
||||||
|
open: gateDetail.open,
|
||||||
|
currentTime: new Date(Date.now() + 8 * 3600 * 1000).toISOString().replace('T', ' ').substring(0, 19)
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
},
|
||||||
|
|
||||||
|
navigateBack: function () {
|
||||||
|
wx.navigateBack()
|
||||||
}
|
}
|
||||||
})
|
})
|
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {},
|
"usingComponents": {},
|
||||||
"navigationBarTitleText": "进入社区"
|
"navigationBarTitleText": "进入社区",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
@@ -1,5 +1,30 @@
|
|||||||
<!--pages/scan/entrance.wxml-->
|
<!--pages/scan/entrance.wxml-->
|
||||||
<view>
|
<view style="text-align: center;">
|
||||||
您将要进入社区:未知
|
<view style="margin-top: 10vh;">
|
||||||
{{ options }}
|
<image src="../../image/icon/gate-background.svg" style="height: 40vh;"></image>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="margin-top: 2vh;">
|
||||||
|
<text>您将要进入社区</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="margin-top: 10px;">
|
||||||
|
<text style="font-size: 1.5em; font-weight: bold; color: {{ open ? '#0ee919' : 'red' }};">{{ gateName }}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="margin-top: 2vh;">
|
||||||
|
<view wx:if="{{ !open }}">当前大门暂不允许通行</view>
|
||||||
|
<view>当前时间:{{ currentTime }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="btnView">
|
||||||
|
<!--按钮-->
|
||||||
|
<button disabled="{{ !open }}" class="btn" type="primary" bindtap="enterGate">确认进入</button>
|
||||||
|
<button class="btn" type="warn" bindtap="navigateBack">不进入</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="font-size: 0.6em; color: #c5c5c5; position: absolute; bottom: 16px; width: 100%; text-align: center;">
|
||||||
|
大门id: {{ gateId }}
|
||||||
</view>
|
</view>
|
@@ -1 +1,8 @@
|
|||||||
/* pages/scan/entrance.wxss */
|
/* pages/scan/entrance.wxss */
|
||||||
|
.btnView {
|
||||||
|
margin-top: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
@@ -2,17 +2,17 @@
|
|||||||
<view class="good-wapper">
|
<view class="good-wapper">
|
||||||
<image class="good-image" src="{{goodinfo.picUrl}}" />
|
<image class="good-image" src="{{goodinfo.picUrl}}" />
|
||||||
<view class="good-detail">
|
<view class="good-detail">
|
||||||
<view class="good-price good-price-counter">
|
|
||||||
<!-- 原价 -->
|
|
||||||
<view class="good-price-symbol">¥</view>
|
|
||||||
<view class="good-price-number">{{ goodinfo.counterPrice }}</view>
|
|
||||||
</view>
|
|
||||||
<view class="good-price good-price-retail">
|
<view class="good-price good-price-retail">
|
||||||
<!-- 售价 -->
|
<!-- 售价 -->
|
||||||
<view style="height:0.12em;" class="good-price-line"></view>
|
|
||||||
<view class="good-price-symbol">¥</view>
|
<view class="good-price-symbol">¥</view>
|
||||||
<view class="good-price-number">{{ goodinfo.retailPrice }}</view>
|
<view class="good-price-number">{{ goodinfo.retailPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="good-price good-price-counter">
|
||||||
|
<!-- 原价 -->
|
||||||
|
<view style="height:0.12em;" class="good-price-line"></view>
|
||||||
|
<view class="good-price-symbol">¥</view>
|
||||||
|
<view class="good-price-number">{{ goodinfo.counterPrice }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 商品标题 -->
|
<!-- 商品标题 -->
|
||||||
<view class="good-title line-wrap">
|
<view class="good-title line-wrap">
|
||||||
|
@@ -24,12 +24,12 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.good-price-counter {
|
.good-price-retail {
|
||||||
color: #fa4126;
|
color: #fa4126;
|
||||||
font-size: 72rpx;
|
font-size: 72rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.good-price-retail {
|
.good-price-counter {
|
||||||
color: #bbbbbb;
|
color: #bbbbbb;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
margin: 0 0 0 18rpx;
|
margin: 0 0 0 18rpx;
|
||||||
|
15
weixin-miniprogram/services/gate.js
Normal file
15
weixin-miniprogram/services/gate.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/* eslint-disable no-param-reassign */
|
||||||
|
|
||||||
|
const send_request = require('../utils/sendRequest')
|
||||||
|
|
||||||
|
/** 获取门禁详情 */
|
||||||
|
export function getGateDetail(id) {
|
||||||
|
console.log("gateId", id)
|
||||||
|
return send_request({
|
||||||
|
url: '/access/gate/miniprogram/detail',
|
||||||
|
method: "GET",
|
||||||
|
data: {
|
||||||
|
id: id,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@@ -1,19 +1,21 @@
|
|||||||
function scanQRCode(Taro) {
|
function scanQRCode(wx) {
|
||||||
// 只允许从相机扫码
|
// 只允许从相机扫码
|
||||||
Taro.scanCode({
|
wx.scanCode({
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.scanType == "WX_CODE" && res.path) {
|
if (res.scanType == "WX_CODE" && res.path) {
|
||||||
let searchParams = res.path.split('?');
|
let searchParams = res.path.split('?');
|
||||||
if (searchParams.length > 1 && searchParams[1].startsWith('scene=guard')) {
|
if (searchParams.length > 1 && searchParams[1].startsWith('scene=guard')) {
|
||||||
Taro.navigateTo({
|
// let scene = searchParams[1].substring(searchParams[1].indexOf('='))
|
||||||
url: "/pages/scan/entrance"
|
console.log("searchParams", searchParams)
|
||||||
|
wx.navigateTo({
|
||||||
|
url: "/pages/scan/entrance?" + searchParams[1]
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Taro.showToast({
|
wx.showToast({
|
||||||
title: "您扫描的不是门禁码",
|
title: "您扫描的不是门禁码",
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
|
Reference in New Issue
Block a user