先下单后支付优惠券相关调试
This commit is contained in:
@@ -387,12 +387,16 @@
|
||||
orderInfo: res.data.tradeNo, // 微信支付商户号
|
||||
// #endif
|
||||
success: (res) => {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
// resultCode 9000
|
||||
console.log(res)
|
||||
console.log(2)
|
||||
|
||||
uni.hideLoading()
|
||||
let pages = getCurrentPages()
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds:["AV-KybUHaK3KtFVLqpy6PHccHBS7XeX__mOM4RbufnQ"],
|
||||
complete() {
|
||||
@@ -414,6 +418,16 @@
|
||||
})
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
if ( res.resultCode == '9000') {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "支付失败"
|
||||
})
|
||||
}
|
||||
|
||||
if ( _this.type && _this.type == "topUpActivity") {
|
||||
uni.pro.navigateBack()
|
||||
} else {
|
||||
|
||||
@@ -662,7 +662,7 @@
|
||||
if (b == '单规格') { //没有规格为空
|
||||
this.skuidname = []
|
||||
}
|
||||
if ( a == "+" && item.isVip == 1 && item.cartNumber >= item.limitNumber){
|
||||
if ( a == "+" && item.cartNumber >= item.limitNumber){
|
||||
uni.showToast({
|
||||
title: '当前商品已达到最大赠送数量',
|
||||
icon: 'none'
|
||||
@@ -685,7 +685,7 @@
|
||||
*/
|
||||
shopAdd(item, index, index1, a, b) {
|
||||
if (a == "+") {
|
||||
if ( item.isVip == 1 && this.amountcartNumber >= item.limitNumber){
|
||||
if ( this.amountcartNumber >= item.limitNumber){
|
||||
uni.showToast({
|
||||
title: '当前商品已达到最大赠送数量',
|
||||
icon: 'none'
|
||||
@@ -717,7 +717,7 @@
|
||||
return;
|
||||
}
|
||||
let num = 0;
|
||||
if ( item.isVip == 1 && item.cartNumber >= item.limitNumber){
|
||||
if (item.cartNumber >= item.limitNumber){
|
||||
uni.showToast({
|
||||
title: '当前商品已达到最大赠送数量',
|
||||
icon: 'none'
|
||||
@@ -733,7 +733,6 @@
|
||||
"skuId": this.skuId,
|
||||
"num": num, //数量
|
||||
"type": a == '+' ? 1 : 0,
|
||||
"isVip": item.isVip,
|
||||
"productId": item.id, //商品id
|
||||
"shopId": this.shopId,
|
||||
"note": item.note,
|
||||
@@ -775,7 +774,7 @@
|
||||
setNumber() {
|
||||
// 处理购物车相同id的情况下 数量相加
|
||||
var summedArray = this.cartLists.data.reduce((acc, current) => {
|
||||
const existing = acc.find(item => item.productId === current.productId && item.isVip === current.isVip);
|
||||
const existing = acc.find(item => item.productId === current.productId);
|
||||
if (existing) {
|
||||
existing.number += current.number;
|
||||
} else {
|
||||
@@ -790,7 +789,7 @@
|
||||
return item.products.filter(e => {
|
||||
e.cartNumber = 0;
|
||||
return summedArray.find(i => {
|
||||
if (e.id == i.productId && e.isVip == i.isVip) {
|
||||
if (e.id == i.productId) {
|
||||
e.cartNumber = i.number
|
||||
}
|
||||
})
|
||||
@@ -986,7 +985,6 @@
|
||||
code: this.tableCode,
|
||||
shopId: this.shopId,
|
||||
productId: item.id, //商品id
|
||||
isVip: item.isVip, //商品id
|
||||
spec_tag: this.skuidname.join(","),
|
||||
})
|
||||
this.salePrice = res.data.salePrice // 价格
|
||||
@@ -997,7 +995,6 @@
|
||||
"num": num, //数量
|
||||
"type": c == '+' ? 1 : 0,
|
||||
"productId": item.id, //商品id
|
||||
"isVip": item.isVip,
|
||||
"note": item.note,
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
|
||||
Reference in New Issue
Block a user