Commit ed48e552 authored by gaodapeng's avatar gaodapeng

增加退出的确认

parent 194b3a14
......@@ -79,3 +79,6 @@ export const ACTION_VERIFY_SUCCESS = "ACTION_VERIFY_SUCCESS";
//核验失败
export const ACTION_VERIFY_FAILED = "ACTION_VERIFY_FAILED";
//退出事件
export const ACTION_QUIT = "ACTION_QUIT";
\ No newline at end of file
......@@ -10,7 +10,8 @@ import {
ACTION_GO_HOME, ACTION_REFUND, ACTION_REFUND_FAILED,
ACTION_REFUND_SUCCESS, ACTION_PRINT_LAST_ORDER,
ACTION_SYSTEM_SETTING, ACTION_VERIFY, ACTION_VERIFY_SUCCESS,
ACTION_VERIFY_FAILED,ACTION_DAY_CHECK,ACTION_PICK_UP_GOODS
ACTION_VERIFY_FAILED, ACTION_DAY_CHECK, ACTION_PICK_UP_GOODS,
ACTION_QUIT,
} from '../../const/actioncmd'
......@@ -35,15 +36,15 @@ Page({
onLoad() {
let pickgoodsTemp = []
for(var i = 0;i < 3;i++){
var good = {};
good.name = "SK-II R.N.A.超肌能紧致弹力精华"
good.price = "1098"
good.quantity = 1
pickgoodsTemp.push(good)
}
this.setData({pickGoods:pickgoodsTemp})
let pickgoodsTemp = []
for (var i = 0; i < 3; i++) {
var good = {};
good.name = "SK-II R.N.A.超肌能紧致弹力精华"
good.price = "1098"
good.quantity = 1
pickgoodsTemp.push(good)
}
this.setData({ pickGoods: pickgoodsTemp })
},
......@@ -184,11 +185,17 @@ Page({
console.log("启动系统设置");
my.ix.startApp({
appName: 'settings',
success: (res) => {
console.log("启动系统设置成功 success==>" + JSON.stringify(res));
}, fail: (res) => {
console.log("启动系统设置失败 failed==>" + JSON.stringify(res));
}
});
context.setData({
toSetting: true,
})
}else if(res.action == ACTION_PICK_UP_GOODS){
} else if (res.action == ACTION_PICK_UP_GOODS) {
//提货
context.setData({
scanDialogDisplay: res.data,
......@@ -209,13 +216,13 @@ Page({
}
});
}
//隐藏提货页面
if(res.data == 0){
context.setData({
pickGoodsState:0,
pickGoods:[]
})
if (res.data == 0) {
context.setData({
pickGoodsState: 0,
pickGoods: []
})
}
} else if (res.action == ACTION_DAY_CHECK) {
//本地先写死数据
......@@ -239,6 +246,17 @@ Page({
speak: true,
success: (r) => { }
});
} else if (res.action == ACTION_QUIT) {
console.log("退出事件")
my.removeStorageSync({
key: 'localAccountInfo',
});
my.removeStorageSync({
key: 'localLoginInfo',
})
my.reLaunch({
url: "/pages/login/login",
});
}
}
});
......@@ -278,7 +296,7 @@ Page({
//打印日期
printer.printNowDate(),
//门店号
printer.printText("门店号:"+getApp().globalData.localAccountInfo.storeName),
printer.printText("门店号:" + getApp().globalData.localAccountInfo.storeName),
//收款总额
printer.printText('收款总额:10.00元'),
printer.feedPaper(),
......@@ -419,7 +437,7 @@ Page({
} else if (this.data.dialogShowType == "coupon") {
// 兑换券
this.verifyCoupon(r);
}else if (this.data.dialogShowType == "pickgoods") {
} else if (this.data.dialogShowType == "pickgoods") {
// 提货
this.pickGoods(r);
} else if (this.data.dialogShowType == "verify") {
......@@ -620,23 +638,23 @@ Page({
},
//提货商品
//提货商品
pickGoods(code) {
let context = this;
this.setData({ scanDialogDisplay: 2 })
setTimeout(() => {
//模拟提货数据
let pickgoodsTemp = []
for(var i = 0;i < 3;i++){
var good = {};
good.name = "SK-II R.N.A.超肌能紧致弹力精华"
good.price = "1098"
good.quantity = 1
pickgoodsTemp.push(good)
}
//模拟提货数据
let pickgoodsTemp = []
for (var i = 0; i < 3; i++) {
var good = {};
good.name = "SK-II R.N.A.超肌能紧致弹力精华"
good.price = "1098"
good.quantity = 1
pickgoodsTemp.push(good)
}
let pickGoodsReq = {}
pickGoodsReq.pickGoodsState=3;
pickGoodsReq.pickGoodsState = 3;
pickGoodsReq.pickGoods = pickgoodsTemp;
my.ix.sendBuddyMessage({
target: getApp().globalData.backScreenAppId,
......@@ -645,13 +663,13 @@ Page({
data: pickGoodsReq
},
success: (sres) => {
context.setData({pickGoods:pickgoodsTemp,pickGoodsState:3,scanDialogDisplay:0})
context.setData({ pickGoods: pickgoodsTemp, pickGoodsState: 3, scanDialogDisplay: 0 })
},
fail: (fres) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
}
});
}, 700);
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment