Skip to content

Commit

Permalink
'支付部分处理'
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyecommerce committed Apr 28, 2021
1 parent 7fe6d9c commit 0a36494
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
12 changes: 11 additions & 1 deletion pages/pay-order/pay-order.js
Expand Up @@ -40,6 +40,7 @@ Page({
curBdIndex: 0
},
hideShopPopupCoupon: true,
isWalletyo: false,
},
onShow: function () {
//console.log(this.data.orderType)
Expand Down Expand Up @@ -165,6 +166,10 @@ Page({
})
} else if (res.data.code == '200') {
var resAddress = res.data.data.default_address
var walletyo = res.data.data.hasOwnProperty("walletyo") ? res.data.data.walletyo : false;
that.setData({ isWalletyo: walletyo });
console.log(walletyo);

if (resAddress.street1 && resAddress.telephone) {
var curAddressData = {
address: resAddress.street1,
Expand Down Expand Up @@ -513,8 +518,13 @@ Page({
var orderIncrementId = res.data.data.increment_id;
var grand_total = res.data.data.grand_total;
var symbol = res.data.data.symbol;
var isWalletyo = that.data.isWalletyo ? 1 : 2;
console.log("isWalletyo:");
console.log(isWalletyo);

wx.navigateTo({
url: "/pages/success/success?order=" + orderIncrementId + "&money=" + grand_total + "&symbol=" + symbol + "&id=" + orderIncrementId
url: "/pages/success/success?order=" + orderIncrementId + "&money=" + grand_total + "&symbol=" + symbol + "&id=" + orderIncrementId + "&walletyo=" + isWalletyo

})

// "/pages/success/success?order=" + res.data.data.orderNumber + "&money=" + res.data.data.amountReal + "&id=" + res.data.data.id
Expand Down
10 changes: 9 additions & 1 deletion pages/success/success.js
Expand Up @@ -11,6 +11,7 @@ Page({
walletActive: false,
customerBaseWallet: 0,
walletIsShow: false,
isWalletyo:false,
customerCurrWallet: 0
},

Expand All @@ -33,16 +34,23 @@ Page({
//this.initCartInfo()
},
onShow: function () {
this.initPayment();
if (this.data.isWalletyo) {
this.initPayment();
}
},
onLoad: function (e) {
var that = this;
if (app.globalData.iphone == true) { that.setData({ iphone: 'iphone' }) }
if (e) {
var isWalletyo = e.walletyo == 1 ? true : false;
console.log("isWalletyo:");
console.log(isWalletyo);
console.log(isWalletyo)
that.setData({
money: e.money,
symbol: e.symbol,
order: e.order,
isWalletyo: isWalletyo,
id: e.id
});
}
Expand Down
2 changes: 1 addition & 1 deletion project.config.json
Expand Up @@ -4,7 +4,7 @@
"ignore": []
},
"setting": {
"urlCheck": true,
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
Expand Down

0 comments on commit 0a36494

Please sign in to comment.