12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- import uni from '@/static/static/js/uni.webview.1.5.2';
- export default {
- data() {
- return {
- operateActivityId: null, // 活动id
- packageList: [], // 邀请人被邀请人选择的套餐
- }
- },
- mounted() {
- const { operateActivityId } = this.$route.query
- if (sessionStorage.getItem('operateActivityId')) {
- // 如果对比本地的不一致就更新
- if (operateActivityId && operateActivityId !== this.operateActivityId) {
- this.operateActivityId = operateActivityId
- sessionStorage.setItem('operateActivityId', operateActivityId)
- }
- this.operateActivityId = sessionStorage.getItem('operateActivityId')
- } else {
- sessionStorage.setItem('operateActivityId', operateActivityId)
- }
- },
- methods: {
- // 获取套餐 personnelMealType 获取方: 1: 邀请人 2: 被邀请人
- getActivitySortRuleAndActivityMealList(obj) {
- this.$toast.loading({
- message: '加载中...',
- forbidClick: true,
- duration: 0
- })
- const data = { operateActivityId: this.operateActivityId }
- Object.assign(data, obj)
- this.$axios.$post('activity/v5/assist/bargaining/getActivitySortRuleAndActivityMealList', data, { headers: this.headers }).then(res => {
- console.log(res)
- if (res.success) {
- this.packageList = res.data
- }
- }).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();
- } else {
- 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)
- }
- }
- }
|