Commit 852f7ed3 authored by 罗超's avatar 罗超

1

parent 56449934
......@@ -297,7 +297,7 @@
<view class="big-title">
<text>{{ currentPriceInfo.startCityName }}出发</text>
</view>
<view class="jz_ReseQue" @click="subscribeMsgAli">
<view class="jz_ReseQue">
<img
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/zuanshi.png"
/>即时确认:本产品付款后可快速确认,放心期待您的旅行
......@@ -887,17 +887,6 @@ export default {
// #endif
// #ifdef MP-ALIPAY
//支付宝支付
subscribeMsgAli() {
let idsArr = uni.getStorageSync("basedata")?.mall?.alimessage ?? [];
let ids = [];
if (idsArr.length > 0) {
idsArr.map((e) => {
ids.push(e.MessageId);
});
}
console.log("ids", ids);
this.$utils.SubscribeMsgAli(ids, () => {});
},
querenAli(data) {
let that = this;
let url = "/api/WeChatPay/GetTravlePayInfo";
......@@ -915,7 +904,9 @@ export default {
(res) => {
this.orderInfo = JSON.parse(res.data);
if (res.data) {
that.PayAli(res.data, data);
that.$utils.SubscribeMsgAli(() => {
that.PayAli(res.data, data);
});
} else {
uni.showToast({
title: "获取交易号失败",
......
......@@ -40,13 +40,22 @@ function getretailer() {//判断是否是分销商
// #ifdef MP-ALIPAY
// 引入消息模板方法
const { requestSubscribeMessage } = requirePlugin("subscribeMsg");
function SubscribeMsgAli(ids, cb) {//支付宝小程序订阅消息
//支付宝小程序订阅消息
function SubscribeMsgAli(cb) {
let idsArr = uni.getStorageSync("basedata")?.mall?.alimessage ?? [];
let ids = [];
if (idsArr.length > 0) {
idsArr.map((e) => {
ids.push(e.MessageId);
});
}
if (ids.length === 0) {
my.showToast({
type: 'fail',
content: '请传入模板id',
duration: 3000,
});
cb();
return;
}
requestSubscribeMessage({ // 触发消息订阅弹框
......@@ -54,12 +63,16 @@ function SubscribeMsgAli(ids, cb) {//支付宝小程序订阅消息
callback(res) {
console.log('订阅回调', res);
if (res.success) {
uni.showToast({
title: "订阅成功",
duration: 1000,
});
cb();
} else {
switch (res.errorCode) {
case 11: {
my.call('toast', {
content: '用户未订阅关闭弹窗',
content: '用户取消订阅',
});
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment