checkSet.vue
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!-- 权益订单 -->
<template>
<div class="equity">
<open v-if="status == 1"></open>
<not-open v-if="status == 2"></not-open>
</div>
</template>
<script>
import equityList from './equityList.vue'
import introduct from './introduct.vue'
export default {
name: 'index',
components: {
open: equityList,
'not-open': introduct
},
data() {
return {
activeName: 'equityList',
status: 0
}
},
created() {
this.isOpenSettin()
// this.$router.push('/beforeSale/equityList')
},
mounted() {},
methods: {
// 判断是否开通
isOpenSettin() {
localStorage.removeItem('preSetStatus')
console.log(this.$route.query.merchantId, 'this.$route')
const { merchantId } = this.$route.query || ''
this.$apis.beforeSale.judgeSetting({ merchantId }).then(res => {
console.log(res, 'res')
// data != null 且data.openFlag == 1 为开通,其他的都是未开通
const { code, data } = res
if (code == 0 && data != null && data.openFlag == 1) {
this.status = 1
} else {
this.status = 2
}
localStorage.setItem('preSetStatus', this.status)
})
}
}
}
</script>
<style>
</style>