|
@@ -12,11 +12,13 @@ export const mixinNoOpenSetMessage = {
|
|
|
},
|
|
|
props: {},
|
|
|
watch: {
|
|
|
- setStatus(val) {
|
|
|
- console.log(val, 'setStatus')
|
|
|
- if (!val) {
|
|
|
- this.initSetPrompt()
|
|
|
- }
|
|
|
+ setStatus: {
|
|
|
+ handler(val) {
|
|
|
+ if (!val) {
|
|
|
+ this.initSetPrompt()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -25,9 +27,6 @@ export const mixinNoOpenSetMessage = {
|
|
|
clickLock: false
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.initSetPrompt()
|
|
|
- },
|
|
|
methods: {
|
|
|
initSetPrompt() {
|
|
|
this.$nextTick(() => {
|
|
@@ -76,8 +75,7 @@ export const mixinNoOpenSetMessage = {
|
|
|
if (action === 'confirm') {
|
|
|
console.log('开启订阅设置开关')
|
|
|
// 调用api打开
|
|
|
- this.setStatus = true
|
|
|
- this.$forceUpdate()
|
|
|
+ this.setSwitchCallback()
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -85,37 +83,36 @@ export const mixinNoOpenSetMessage = {
|
|
|
},
|
|
|
async closeSetPrompt () {
|
|
|
const h = this.$createElement
|
|
|
- return await MessageBox({
|
|
|
- title: '确定关闭订阅?',
|
|
|
- customClass: 'custom-message-box',
|
|
|
- confirmButtonText: '确定',
|
|
|
- confirmButtonClass: 'custom-confirm-btn',
|
|
|
- cancelButtonText: '取消',
|
|
|
- cancelButtonClass: 'custom-cancel-btn',
|
|
|
- message: h(
|
|
|
- 'div',
|
|
|
- {
|
|
|
- class: 'message-text',
|
|
|
- style: 'font-size: 14px;color: #686868;line-height: 24px;'
|
|
|
- },
|
|
|
- [
|
|
|
- h('span', null, '关闭订阅,将错过最新招标动态推送')
|
|
|
- ]
|
|
|
- ),
|
|
|
- showClose: false,
|
|
|
- showCancelButton: true,
|
|
|
- closeOnClickModal: false,
|
|
|
- center: true,
|
|
|
- callback: (action, instance) => {
|
|
|
- // console.log(action, instance)
|
|
|
- if (action === 'confirm') {
|
|
|
- console.log('关闭订阅设置开关')
|
|
|
- // 调用api关闭
|
|
|
- this.setStatus = false
|
|
|
- this.$forceUpdate()
|
|
|
- }
|
|
|
+ return await MessageBox({
|
|
|
+ title: '确定关闭订阅?',
|
|
|
+ customClass: 'custom-message-box',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ confirmButtonClass: 'custom-confirm-btn',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ cancelButtonClass: 'custom-cancel-btn',
|
|
|
+ message: h(
|
|
|
+ 'div',
|
|
|
+ {
|
|
|
+ class: 'message-text',
|
|
|
+ style: 'font-size: 14px;color: #686868;line-height: 24px;'
|
|
|
+ },
|
|
|
+ [
|
|
|
+ h('span', null, '关闭订阅,将错过最新招标动态推送')
|
|
|
+ ]
|
|
|
+ ),
|
|
|
+ showClose: false,
|
|
|
+ showCancelButton: true,
|
|
|
+ closeOnClickModal: false,
|
|
|
+ center: true,
|
|
|
+ callback: (action, instance) => {
|
|
|
+ // console.log(action, instance)
|
|
|
+ if (action === 'confirm') {
|
|
|
+ console.log('关闭订阅设置开关')
|
|
|
+ // 调用api关闭
|
|
|
+ this.setSwitchCallback()
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|