🦀️ fix: 修复bug

This commit is contained in:
wangsongsole 2024-03-15 15:01:27 +08:00
parent 97e776f5c5
commit cb0c4114bd
2 changed files with 32 additions and 29 deletions

View File

@ -355,7 +355,7 @@
if (res.goods.channel == 2) { if (res.goods.channel == 2) {
if (res.goods.is_webview == 1) { if (res.goods.is_webview == 1) {
/* 公众号 */ /* 公众号 */
this.publicCollection(res.code_batch_id); this.publicCollection(res.order_number);
} else if (ua.indexOf("dingtalk") > -1) { } else if (ua.indexOf("dingtalk") > -1) {
//在钉钉内置环境打开,不能唤起微信小程序 //在钉钉内置环境打开,不能唤起微信小程序
window.location.href = res.wechat_redirect_url; window.location.href = res.wechat_redirect_url;
@ -367,24 +367,22 @@
}, },
/* 公众号领取 */ /* 公众号领取 */
publicCollection (code_batch_id) { publicCollection (order_number) {
let params = { let params = {
token: localStorage.getItem('token'), order_number,
code_batch_id: code_batch_id, channel: 2,
channel_user_id: this.openId, channel_user_id: this.openId,
is_webview: 1 is_webview: 1
}; };
req.axiosPost("/voucher/groupVoucherGrant", params) req.axiosPost("/voucher/grant", params)
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.message = '领取成功'; this.popFunction({ title: '温馨提示', text: '领取成功', status: 1, b_text: '我知道了', show: true });
this.getProductDetail(); this.getOrderList();
} else { } else {
this.axiosErrorFun(res.code, res.message); this.popFunction({ title: '温馨提示', text: res.message, status: 3, b_text: '我知道了', show: true });
} }
}) });
.catch((err) => { this.loading = false; });
;
}, },
// 单条弹框 // 单条弹框

View File

@ -47,7 +47,7 @@
<script> <script>
new Vue({ new Vue({
el: "#app", el: "#app",
data() { data () {
return { return {
orderNumber: '', orderNumber: '',
orderInfo: { type: 3 }, orderInfo: { type: 3 },
@ -72,7 +72,7 @@
components: { modelPop }, components: { modelPop },
created() { created () {
let orderNumber = this.getQueryString( let orderNumber = this.getQueryString(
window.location.search, window.location.search,
"order_number" "order_number"
@ -82,7 +82,7 @@
localStorage.setItem('token', this.getQueryString(window.location.search, "token")); localStorage.setItem('token', this.getQueryString(window.location.search, "token"));
}, },
methods: { methods: {
getQueryString(path, name) { getQueryString (path, name) {
//获取浏览器地址栏的参数 //获取浏览器地址栏的参数
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = path.substr(1).match(reg); var r = path.substr(1).match(reg);
@ -90,15 +90,15 @@
return null; return null;
}, },
//返回订单页面 //返回订单页面
orderPageFn() { orderPageFn () {
window.location.replace('./coupon/myOrder.html'); window.location.replace('./coupon/myOrder.html');
}, },
//卡密返回卡密详情页面 //卡密返回卡密详情页面
cardPwdPageFn() { cardPwdPageFn () {
window.location.replace('./coupon/myOrder.html'); window.location.replace('./coupon/myOrder.html');
}, },
/* 倒计时 */ /* 倒计时 */
countdownFn() { countdownFn () {
let time = 3; let time = 3;
let stopTimer = setInterval(() => { let stopTimer = setInterval(() => {
time--; time--;
@ -112,7 +112,7 @@
}, 1000); }, 1000);
}, },
//获取订单详情 //获取订单详情
getOrderDetail(id) { getOrderDetail (id) {
req.axiosGet("/key/order/detail/" + id).then((res) => { req.axiosGet("/key/order/detail/" + id).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.orderInfo = res.data; this.orderInfo = res.data;
@ -133,11 +133,11 @@
}, },
//弹出框提示 //弹出框提示
openTipDialog(popUpAttr) { openTipDialog (popUpAttr) {
this.popAttr = popUpAttr; this.popAttr = popUpAttr;
}, },
/* 弹窗回调 */ /* 弹窗回调 */
backFunctionPop(type) { backFunctionPop (type) {
if (this.popAttr.bottomText === '点击复制' && type) { if (this.popAttr.bottomText === '点击复制' && type) {
var aux = document.createElement("input"); var aux = document.createElement("input");
aux.setAttribute("value", this.copyLink); aux.setAttribute("value", this.copyLink);
@ -157,7 +157,7 @@
this.delayedOut(); this.delayedOut();
} }
}, },
toLinkAlipay() { toLinkAlipay () {
//支付宝H5跳转 //支付宝H5跳转
let self = this; let self = this;
let banklink = encodeURIComponent( let banklink = encodeURIComponent(
@ -176,13 +176,13 @@
window.location.replace(link); window.location.replace(link);
} }
}, },
openErrorDialog(tip, bottomText) { openErrorDialog (tip, bottomText) {
this.popAttr.text = tip; this.popAttr.text = tip;
this.popAttr.show = true; this.popAttr.show = true;
this.popAttr.bottomText = bottomText; this.popAttr.bottomText = bottomText;
}, },
//领取立减金 //领取立减金
receiveFn() { receiveFn () {
if (this.payStatus != 2) { if (this.payStatus != 2) {
this.openTipDialog({ this.openTipDialog({
show: true, show: true,
@ -210,18 +210,23 @@
}, },
/* 公众号领取 */ /* 公众号领取 */
publicCollection() { publicCollection () {
let params = { let params = {
token: localStorage.getItem('token'), order_number: this.orderId,
code_batch_id: this.code_batch_id, channel: 2,
channel_user_id: this.openId, channel_user_id: this.openId,
is_webview: 1 is_webview: 1
}; };
req.axiosPost("/voucher/groupVoucherGrant", params)
req.axiosPost("/voucher/grant", params)
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.message = '领取成功'; this.openTipDialog({
this.getProductDetail(); show: true,
title: '温馨提示',
status: 1,/*1 成功 2提示 3失败 */
text: '领取成功'
});
} else { } else {
this.openTipDialog({ this.openTipDialog({
show: true, show: true,