0.7.1 支付完成后清空购物车

wechat_user_type
Ge Hao 8 years ago
parent 8d8ebf960d
commit 2d5653e550
  1. 6
      pages/cart/cart.js
  2. 4
      utils/pay.js

@ -84,6 +84,7 @@ Page({
},
bindBilling: function () {
var that = this
var cartItems = wx.getStorageSync('cartItems')
if (cartItems) {
var order_items_attributes = cartItems.map(function(obj){
@ -106,14 +107,15 @@ Page({
success: function(res) {
wx.showModal({
title: '提示',
content: '你已成功购买,如需查看订单,可下载‘巴爷供销社’APP',
content: '你已成功购买,如需查看订单,可下载 ‘巴爷供销社’ APP',
showCancel: false,
success: function(res) {
if (res.confirm) {
that.setData({cartItems: []})
}
}
})
}
}
})
})
})

@ -12,7 +12,7 @@ function pay(hash, successCallback) {
})
}
module.exports = {
pay (hash) {
return pay(hash)
pay (hash, successCallback) {
return pay(hash, successCallback)
}
}

Loading…
Cancel
Save