小程序端扫门禁码跳转;门禁端调整;bugfix小程序端商品售价和划线价反了
This commit is contained in:
@@ -1,11 +1,24 @@
|
||||
// pages/scan/entrance.js
|
||||
|
||||
const gateService = require("../../services/gate")
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
options: {},
|
||||
// 传入参数
|
||||
gateId: "",
|
||||
|
||||
// 接口返回数据
|
||||
gateDetail: "",
|
||||
|
||||
// UI显示用
|
||||
gateName: "未知",
|
||||
open: false,
|
||||
|
||||
currentTime: "",
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -13,9 +26,23 @@ Page({
|
||||
*/
|
||||
onLoad(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({
|
||||
options: JSON.stringify(options),
|
||||
})
|
||||
gateId: gateId,
|
||||
});
|
||||
|
||||
this.loadPageData()
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -50,7 +77,7 @@ Page({
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
this.loadPageData()
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -65,5 +92,24 @@ Page({
|
||||
*/
|
||||
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()
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user