Commit 3148b44c authored by gaodapeng's avatar gaodapeng

修改支付为真实价格

parent fdc651fe
......@@ -98,13 +98,6 @@ Page({
},
onReady() {
if (my.canIUse('hideBackHome')) {
my.hideBackHome();
}
},
onShow() {
my.ix.onBuddyMessage({
success: (res) => {
......@@ -138,7 +131,7 @@ Page({
//获取order
var payAmount = payUtils.yuan2Fen(this.data.payPrice);
payUtils.getOrder(/*payAmount*/1, this.data.list, function (res) {
payUtils.getOrder(payAmount, this.data.list, function (res) {
if (res != null) {
console.log("callback调用,res=" + JSON.stringify(res));
......@@ -227,7 +220,7 @@ Page({
this.setData({ isPaying: true });
//使用barCode来当面付
var payAmount = payUtils.yuan2Fen(this.data.payPrice);
payUtils.startPay(orderNo, payCode, /*payAmount*/1, this.data.list, function (res) {
payUtils.startPay(orderNo, payCode, payAmount, this.data.list, function (res) {
my.hideLoading();
console.log("支付回调 ===>" + JSON.stringify(res));
this.setData({ isPaying: false });
......@@ -251,7 +244,7 @@ Page({
my.ix.offCashierEventReceive();
this.saveData(this.data.list, res.data);
my.redirectTo({
url: '/pages/paysuccess/paysuccess',
url: '/pages/paysuccess/paysuccess?totalGoodsNum=' + this.data.goodsNum,
});
//发送支付成功到后屏
......
......@@ -9,11 +9,11 @@ export default class scan {
if (!page._keyEventListener) {
//摄像头
my.ix.onCodeScan((r) => {
if (r.success){
let cur = getCurrentPages().slice(-1)[0];
cur.onKeyPress.call(cur, code);
if (r.success) {
let cur = getCurrentPages().slice(-1)[0];
cur.onKeyPress.call(cur, code);
}
console.log('code: ' + r.code);
console.log('code: ' + r.code);
});
//物理扫码枪
......@@ -27,7 +27,7 @@ export default class scan {
//兼容扫描枪
cur.onKeyPress.call(cur, code);
isScaning = false
}, 700);
}, 1000);
} else {
//特殊处理 keycode需要减7
if (r.keyCode >= 7 && r.keyCode <= 16) {
......
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