Commit ed48e552 authored by gaodapeng's avatar gaodapeng

增加退出的确认

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