下单页面增加生日有礼弹窗,关注公众号弹窗,订单结算增加满减活动,修改霸王餐,增加结算成功私域引流和公众号弹窗
This commit is contained in:
@@ -295,6 +295,7 @@ export function calcDiscountGoodsArrPrice(discountGoodsArr, discountNum, user, s
|
||||
* @param shopInfo 店铺信息
|
||||
*/
|
||||
export function returnCouponDiscount(arr, coupon, user, goodsOrderPrice, selCoupon, shopInfo) {
|
||||
arr = returnCanDikouGoods(arr, user, shopInfo);
|
||||
const canDikouGoodsArr = returnCanDikouGoodsArr(arr, selCoupon, user);
|
||||
if (coupon.type == 2) {
|
||||
return returnCouponProductDiscount(canDikouGoodsArr, coupon, user, shopInfo);
|
||||
@@ -423,7 +424,6 @@ function returnCouponBuyOneGiveOneDiscount(canDikouGoodsArr, coupon, user, shopI
|
||||
}
|
||||
let discountPrice = 0;
|
||||
let hasDiscountGoodsArr = [];
|
||||
console.log("returnCouponBuyOneGiveOneDiscount:discountGoods", discountGoods);
|
||||
if (discountGoods) {
|
||||
discountPrice = returnGoodsPrice(discountGoods, user, shopInfo);
|
||||
hasDiscountGoodsArr = [discountGoods];
|
||||
|
||||
1374
utils/goods.ts
Normal file
1374
utils/goods.ts
Normal file
File diff suppressed because it is too large
Load Diff
112
utils/pay.js
112
utils/pay.js
@@ -1,57 +1,57 @@
|
||||
export const pay = (res) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.showLoading({
|
||||
title: '支付中...',
|
||||
mask: true
|
||||
})
|
||||
uni.requestPayment({
|
||||
// #ifdef MP-WEIXIN
|
||||
provider: 'wxpay', //支付类型-固定值
|
||||
partnerid: res.appId, // 微信支付商户号
|
||||
timeStamp: res.timeStamp, // 时间戳(单位:秒)
|
||||
nonceStr: res.nonceStr, // 随机字符串
|
||||
package: res.package, // 固定值
|
||||
signType: res.signType, //固定值
|
||||
paySign: res.paySign, //签名
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
provider: 'alipay', //支付类型-固定值
|
||||
orderInfo: res.tradeNo, // 微信支付商户号
|
||||
// #endif
|
||||
success: (res) => {
|
||||
console.log('pay');
|
||||
console.log(res);
|
||||
uni.hideLoading()
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.showToast({
|
||||
title: "支付成功",
|
||||
icon:'none'
|
||||
})
|
||||
console.log('支付成功')
|
||||
resolve(res)
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
if (res.resultCode == '9000') {
|
||||
uni.showToast({
|
||||
title: "支付成功",
|
||||
icon:'none'
|
||||
})
|
||||
resolve(res)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "支付失败",
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
fail: (res) => {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
}, 1000)
|
||||
reject(false)
|
||||
},
|
||||
|
||||
});
|
||||
})
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.showLoading({
|
||||
title: "支付中...",
|
||||
mask: true,
|
||||
});
|
||||
uni.requestPayment({
|
||||
// #ifdef MP-WEIXIN
|
||||
provider: "wxpay", //支付类型-固定值
|
||||
partnerid: res.appId, // 微信支付商户号
|
||||
timeStamp: res.timeStamp, // 时间戳(单位:秒)
|
||||
nonceStr: res.nonceStr, // 随机字符串
|
||||
package: res.package, // 固定值
|
||||
signType: res.signType, //固定值
|
||||
paySign: res.paySign, //签名
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
provider: "alipay", //支付类型-固定值
|
||||
orderInfo: res.tradeNo, // 微信支付商户号
|
||||
// #endif
|
||||
success: (res) => {
|
||||
console.log("pay");
|
||||
console.log(res);
|
||||
uni.hideLoading();
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.showToast({
|
||||
title: "支付成功",
|
||||
icon: "none",
|
||||
});
|
||||
console.log("支付成功");
|
||||
resolve(true);
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
if (res.resultCode == "9000") {
|
||||
uni.showToast({
|
||||
title: "支付成功",
|
||||
icon: "none",
|
||||
});
|
||||
resolve(true);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "支付失败",
|
||||
icon: "none",
|
||||
});
|
||||
reject(false);
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
fail: (res) => {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
}, 1000);
|
||||
reject(false);
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user