订单进度消息订阅授权,及问题修复

This commit is contained in:
donqi 2023-03-27 01:53:59 +08:00
parent 13d13f903d
commit 617a10bb6f
5 changed files with 92 additions and 6 deletions

View File

@ -0,0 +1,49 @@
<template>
<view>
<!-- 模态框 -->
<view class="cu-modal" :class="isShow?'show':''">
<view class="cu-dialog">
<view class="padding-xl text-left">
<view>前往确认是否授权订单进度消息提醒</view>
</view>
<view class="cu-bar bg-white">
<navigator class="modal-bottom-oper margin-0 flex-sub text-black" @tap="hideModal" target="miniProgram">取消
</navigator>
<view class="modal-bottom-oper margin-0 flex-sub text-main-color solid-left" @tap="confirm">确定</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'vertify-subscribe',
data() {
return {
isShow: false
}
},
methods: {
showModal(e) {
this.isShow = true
},
hideModal(e) {
this.isShow = false;
},
confirm(e) {
this.hideModal();
//
uni.requestSubscribeMessage({
tmplIds: ['JtsGFPDjYhL2GbHfKxvTJaR_lLp8xLyw8VeR01Y0JHM'],
complete(res) {
console.log(res)
}
})
}
}
}
</script>
<style>
</style>

View File

@ -10,12 +10,14 @@ import request from './common/js/request.js';
import dateUtil from './common/js/dateUtil.js'; import dateUtil from './common/js/dateUtil.js';
import globalData from './common/js/globalData.js'; import globalData from './common/js/globalData.js';
import vertifyLogin from '@/components/vertify/vertify-login.vue'; import vertifyLogin from '@/components/vertify/vertify-login.vue';
import vertifyPhone from '@/components/vertify/vertify-phone.vue'; import vertifyPhone from '@/components/vertify/vertify-phone.vue';
import vertifySubscribe from '@/components/vertify/vertify-subscribe.vue';
Vue.component('cu-custom', CuCustom) Vue.component('cu-custom', CuCustom)
Vue.component('confirm-modal', ConfirmModal); Vue.component('confirm-modal', ConfirmModal);
Vue.component('vertify-login', vertifyLogin); Vue.component('vertify-login', vertifyLogin);
Vue.component('vertify-phone', vertifyPhone); Vue.component('vertify-phone', vertifyPhone);
Vue.component('vertify-subscribe', vertifySubscribe);
const data = type => { const data = type => {
//模拟异步请求数据 //模拟异步请求数据

View File

@ -9,7 +9,9 @@
<!-- 登录校验弹窗 --> <!-- 登录校验弹窗 -->
<vertify-login ref="vertifyLogin" @reload="reloadForwardPage"></vertify-login> <vertify-login ref="vertifyLogin" @reload="reloadForwardPage"></vertify-login>
<vertify-phone ref="vertifyPhone" @reload="reloadForwardPage"></vertify-phone> <vertify-phone ref="vertifyPhone" @reload="reloadForwardPage"></vertify-phone>
<!-- 订阅授权 -->
<vertify-subscribe ref="vertifySubscribe"></vertify-subscribe>
<!-- 发布 --> <!-- 发布 -->
<view class="cu-modal content-mask" :class="isShowPublish?'show':''"> <view class="cu-modal content-mask" :class="isShowPublish?'show':''">
@ -156,7 +158,20 @@
if (res && res.code === 0) { if (res && res.code === 0) {
this.inParam = null; this.inParam = null;
} }
} }
let _this = this;
wx.getSetting({
withSubscriptions: true,
success(res) {
console.log(res.subscriptionsSetting)
if (!res.subscriptionsSetting.mainSwitch
|| !res.subscriptionsSetting.itemSettings
|| res.subscriptionsSetting.itemSettings['yqd3p4qsqn1RiyUb8kO4dPqoGKipRQg_y99nGw0jtLE'] !== 'accept') {
//
_this.$refs.vertifySubscribe.showModal();
}
}
})
}, },
changeCurPageCode(targetPageCode) { changeCurPageCode(targetPageCode) {
// #ifdef MP // #ifdef MP

View File

@ -15,8 +15,8 @@
</view> </view>
</view> </view>
</view> </view>
<uni-collapse v-model="openStatusArr[index]" ref="collapse" v-for="(billItem, index) in bill"> <uni-collapse ref="collapse">
<uni-collapse-item> <uni-collapse-item ref="collapseItem" :showArrow="false" v-for="(billItem, index) in bill" :open="openStatusArr[index] === '0' ? true : false" >
<template v-slot:title> <template v-slot:title>
<view class="padding bg-white" :data-index="index" @click="showStatement"> <view class="padding bg-white" :data-index="index" @click="showStatement">
<view class="margin-bottom-xs">{{billItem.createTime}}</view> <view class="margin-bottom-xs">{{billItem.createTime}}</view>
@ -89,7 +89,13 @@
this.openStatusArr = []; this.openStatusArr = [];
for (let i = 0; i < this.bill.length; i++) { for (let i = 0; i < this.bill.length; i++) {
this.openStatusArr.push('1'); this.openStatusArr.push('1');
this.$nextTick(() => {
this.$refs.collapseItem[i].onClick(false, 'init');
})
} }
this.$nextTick(() => {
this.$refs.collapse.resize();
})
}, },
async showStatement(e) { async showStatement(e) {
let curIndex = e.currentTarget.dataset.index; let curIndex = e.currentTarget.dataset.index;
@ -119,7 +125,7 @@
this.bill = newBill; this.bill = newBill;
// #ifdef MP // #ifdef MP
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.collapse[curIndex].resize(); this.$refs.collapse.resize();
uni.hideLoading(); uni.hideLoading();
}) })
// #endif // #endif

View File

@ -511,6 +511,20 @@
}, },
editAddress(addressInfo) { editAddress(addressInfo) {
console.log(addressInfo) console.log(addressInfo)
// let res = await this.$request.updateOrder({
// id: order.orderMasterId,
// orderStatus: status
// });
// if (res && res.code === 0) {
// this.reload();
// if (ifRollback) {
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 3000
// })
// }
// }
}, },
makePhoneCall(phoneNum) { makePhoneCall(phoneNum) {
uni.makePhoneCall({ uni.makePhoneCall({