| | |
| | | // 支付 |
| | | payment() { |
| | | var that = this; |
| | | if (that.receiveType === 0 && !that.addr) return uni.showToast({ |
| | | title: '请选择收货地址', |
| | | icon: 'none' |
| | | }) |
| | | if (that.receiveType === 1 && !that.shopId) return uni.showToast({ |
| | | title: '请选择门店', |
| | | icon: 'none' |
| | | }) |
| | | this.$u.api.orderPay({ |
| | | addressId: this.addr ? this.addr.id : null, |
| | | couponId: this.couponId, |
| | |
| | | if (res.code === 200) { |
| | | // 积分抵扣 |
| | | if (res.data.payType === 1) { |
| | | // if (this.receiveType === 0) { |
| | | uni.redirectTo({ |
| | | url: `/pagesA/pages/order-details/order-details?id=${res.data.orderId}&userType=0` |
| | | }) |
| | | // } else { |
| | | // uni.reLaunch({ |
| | | // url: `/pages/payment-successful/payment-successful?id=${res.data.orderId}&userType=0` |
| | | // }) |
| | | // } |
| | | uni.redirectTo({ |
| | | url: `/pagesA/pages/order-details/order-details?id=${res.data.orderId}&userType=0` |
| | | }) |
| | | } else { |
| | | wx.requestPayment({ |
| | | timeStamp: res.data.response.timeStamp, |
| | |
| | | paySign: res.data.response.paySign, |
| | | success (pay) { |
| | | if (pay.errMsg === "requestPayment:ok") { |
| | | // if (that.receiveType === 0) { |
| | | uni.redirectTo({ |
| | | url: `/pagesA/pages/order-details/order-details?id=${res.data.orderId}&userType=0` |
| | | }) |
| | | // } else { |
| | | // uni.reLaunch({ |
| | | // url: `/pages/payment-successful/payment-successful?id=${res.data.orderId}&userType=0` |
| | | // }) |
| | | // } |
| | | uni.redirectTo({ |
| | | url: `/pagesA/pages/order-details/order-details?id=${res.data.orderId}&userType=0` |
| | | }) |
| | | } else { |
| | | uni.showToast({ title: '订单取消支付', icon: 'none' }) |
| | | } |
| | |
| | | height: 144rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20rpx; |
| | | &:last-child { |
| | | margin: 0 !important; |
| | | } |
| | | .item-image { |
| | | flex-shrink: 0; |
| | | width: 144rpx; |