0.7.1 支付完成后清空购物车

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

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

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

Loading…
Cancel
Save