feat: 新增支付宝H5领取逻辑

This commit is contained in:
wangsongsole 2023-11-17 18:02:54 +08:00
parent 66f3694277
commit 253878afba
2 changed files with 33 additions and 19 deletions

View File

@ -165,6 +165,11 @@
return this.popFunction({ title: '温馨提示', text: '立减金领取过期', status: 2, b_text: '我知道了', show: true });
}
if (item.channel == 1) {
if (item.goods.entity.receive_mode === 2) { /* H5 领取 */
item.goods.available = 1;
sessionStorage.setItem('goodsInfo', JSON.stringify(item.goods));
location.href = './zfb-reduce.html';
} else {
let bankLink = encodeURIComponent(
window.location.origin +
"/alipay.html?orderNumber=" + data.order_number
@ -180,6 +185,7 @@
window.location.replace(link);
}
}
}
if (item.channel == 2) {
if (ua.indexOf("windows") > -1) {
@ -194,6 +200,11 @@
/* 红包领取 */
if (item.type === 3) {
if (item.channel === 1) {
if (item.goods.entity.receive_mode === 2) { /* H5 领取 */
item.goods.available = 1;
sessionStorage.setItem('goodsInfo', JSON.stringify(item.goods));
location.href = './zfb-redPackets.html';
} else {
const aliPaysUrl = `alipays://platformapi/startapp?appId=2021004100663111&page=pages/index/index?order_number=${encodeURIComponent(window.btoa(data.order_number))}`;
if (isWx() || (ua.indexOf("android") > -1 && ua.indexOf("baiduboxapp") > -1) || ua.indexOf("windows") > -1) {
this.href = aliPaysUrl;
@ -202,6 +213,7 @@
location.replace(aliPaysUrl);
}
}
}
if (item.channel === 2) {
if (ua.indexOf("windows") > -1) {
@ -365,6 +377,7 @@
const channel = product.entity.channel;
newItem['product_name'] = product.entity.batch_goods_name;
newItem['channel'] = channel;
newItem['goods'] = product;
if (channel === 1) {
newItem['src'] = 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/zfbreduce.png';
}
@ -379,6 +392,7 @@
const channels = product.entity.channel;
newItem['product_name'] = product.entity.batch_goods_name;
newItem['channel'] = channels;
newItem['goods'] = product;
if (channels === 1) {
newItem['src'] = 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/redPacktes/alipay_icon.png';
}

View File

@ -162,7 +162,7 @@
.then(({ code, data, message }) => {
if (code == 200) {
this.loading = false;
this.judgeEnvironment(data.order_number);
this.judgeEnvironment(data.original_order_number);
} else {
this.loading = false;
this.tip(message, 2, '关闭');
@ -175,7 +175,7 @@
req.axiosPost(`/alipay/cash/receive/${order_number}`, this.form)
.then(({ code, data, message }) => {
if (code == 200) {
this.tip(message, 1, '关闭');
} else {
if (code == 403) {
if (this.backAble) {