Commit 0c9d686c authored by jiangjiantao's avatar jiangjiantao

支付bugfix&支付背景&数据存储

parent c2b59d6f
...@@ -6,6 +6,8 @@ page{ ...@@ -6,6 +6,8 @@ page{
height: 100%; height: 100%;
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
background: url(/images/bg_balance.png) no-repeat fixed top;
background-size:100% 504rpx;
} }
.goodsRemind{ .goodsRemind{
......
...@@ -32,6 +32,23 @@ Page({ ...@@ -32,6 +32,23 @@ Page({
}) })
} }
//商品数据
let context = this;
my.getStorage({
key: 'goods',
success: function (res) {
console.log("商品信息 ===》 " + JSON.stringify(res));
context.setData({
list:res.data
})
},
fail: function (res) {
console.log("商品信息 ===》 " + JSON.stringify(res));
}
});
}, },
...@@ -89,6 +106,7 @@ Page({ ...@@ -89,6 +106,7 @@ Page({
return; return;
} }
if(res.resultCode == 1){ if(res.resultCode == 1){
//成功 //成功
console.log("支付回调成功,跳转 " ); console.log("支付回调成功,跳转 " );
// if(data.isCashierClosed == true){ // if(data.isCashierClosed == true){
...@@ -195,7 +213,7 @@ Page({ ...@@ -195,7 +213,7 @@ Page({
console.log("支付回调成功,跳转 " ); console.log("支付回调成功,跳转 " );
// if(data.isCashierClosed == true){ // if(data.isCashierClosed == true){
my.ix.offCashierEventReceive(); my.ix.offCashierEventReceive();
saveData(this.data.list, res); this.saveData(this.data.list, res);
my.redirectTo({ my.redirectTo({
url: '/pages/paysuccess/paysuccess?orderPrice=' + this.data.totalPrice + "&couponPrice=" + this.data.couponPrice + "&payPrice=" + this.data.payPrice+"&totalCount="+this.data.totalCount, url: '/pages/paysuccess/paysuccess?orderPrice=' + this.data.totalPrice + "&couponPrice=" + this.data.couponPrice + "&payPrice=" + this.data.payPrice+"&totalCount="+this.data.totalCount,
}); });
...@@ -205,7 +223,7 @@ Page({ ...@@ -205,7 +223,7 @@ Page({
my.ix.offCashierEventReceive(); my.ix.offCashierEventReceive();
my.showToast({ my.showToast({
type: 'fail', type: 'fail',
content: res.data, content: res.message,
duration: 2000 duration: 2000
}); });
} }
......
...@@ -36,11 +36,6 @@ Page({ ...@@ -36,11 +36,6 @@ Page({
var scanGoodRequest = api.createCommonRequest(); var scanGoodRequest = api.createCommonRequest();
scanGoodRequest.goodsId = barcode; scanGoodRequest.goodsId = barcode;
//管理员需要额外传一个storeid 但是目前这个设备是没有 //管理员需要额外传一个storeid 但是目前这个设备是没有
// let storeId = getApp().globalData.localAccountInfo.storeId
// let actType = getApp().globalData.localAccountInfo.actType
// if (storeId != null && actType == 1) {
// scanGoodRequest = storeId
// }
console.log("扫商品的请求 ==>" + JSON.stringify(scanGoodRequest)); console.log("扫商品的请求 ==>" + JSON.stringify(scanGoodRequest));
my.request({ my.request({
url: getApp().globalData.BASE_URL + API_SCAN, url: getApp().globalData.BASE_URL + API_SCAN,
...@@ -144,9 +139,15 @@ Page({ ...@@ -144,9 +139,15 @@ Page({
//跳转结算页面 //跳转结算页面
goBalance() { goBalance() {
my.navigateTo({ my.navigateTo({
url: "/pages/balance/balance?totalPrice=0.01" +"&totalQuantity="+this.data.totalQuantity+"&totalDisc="+this.data.totalDisc, url: "/pages/balance/balance?totalPrice=" + this.data.totalPrice + "&totalQuantity=" + this.data.totalQuantity + "&totalDisc=" + this.data.totalDisc,
});
// url: "/pages/balance/balance?totalPrice=" + this.data.totalPrice+"&totalQuantity="+this.data.totalQuantity+"&totalDisc="+this.data.totalDisc, // 存商品信息数据
my.setStorage({
key: 'goods',
data: this.data.goods,
success: function () {
console.log("商品数据写入成功");
}
}); });
}, },
......
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