import uni from '@/static/static/js/uni.webview.1.5.2'; export default { data() { return { packageList: [], // 邀请人被邀请人选择的套餐 visible: false, currentLoading: false } }, mounted() { }, methods: { // 获取套餐 personnelMealType 获取方: 1: 邀请人 2: 被邀请人 getActivitySortRuleAndActivityMealList(obj) { this.$toast.loading({ message: '加载中...', forbidClick: true, duration: 0 }) const operateActivityId = +localStorage.getItem('auth.operateActivityId') const data = { operateActivityId } Object.assign(data, obj) this.$axios.$post('activity/v5/assist/bargaining/getActivitySortRuleAndActivityMealList', data).then(res => { console.log(res) if (res.success) { if (obj.userCardId && !res.data[0]?.mealList?.length) { this.visible = true return } let index = 0 for (let i of res.data) { if (!i?.mealList?.length) { index++ } } if(index === res.data.length) { this.visible = true this.currentLoading = false return } this.packageList = res.data || [] this.currentLoading = true } }).finally(() => { this.$toast.clear(); }) }, // 获取服务器的当前时间 getSystemTime() { return this.$axios.$get('pay/v1/order/getSystemTime') }, // 退出相关逻辑 leaveFun() { const isApp = this.$userAgent.isSzx || this.$userAgent.isSzxBrowser; const isAndroid = this.$userAgent.isAndroid; const isWx = this.$userAgent.isWx; if (isApp) { if (isAndroid) { window.native.backClick && window.native.backClick(); } else { window.webkit.messageHandlers.appGoBack && window.webkit.messageHandlers.appGoBack.postMessage({}) } } else { if (isWx) { this.$wx.miniProgram.navigateBack({ data: 1 }) return } uni.reLaunch({ url: '/pages/index/index' }); } }, // 拦截微信原生返回相关方法 wxIntercept(handlePopstate) { window.removeEventListener('popstate', handlePopstate) history.pushState(null, null, document.URL) window.addEventListener('popstate', handlePopstate) } } }