|
@@ -108,9 +108,9 @@ export default {
|
|
|
default: ''
|
|
|
},
|
|
|
area: {
|
|
|
- type: Array,
|
|
|
+ type: Object,
|
|
|
default() {
|
|
|
- return []
|
|
|
+ return {}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -136,7 +136,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters('subscribe', ['subscribeArea']),
|
|
|
+ ...mapGetters('subscribe', ['subscribeArea', 'isPay', 'canSelectAreaCount']),
|
|
|
showLoadingTips() {
|
|
|
const t = this.listState.hasNextPage && !this.listState.finished
|
|
|
return t
|
|
@@ -159,39 +159,29 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions('subscribe', ['getSubscribeInfo']),
|
|
|
- doSetArea (a = []) {
|
|
|
- if (!Array.isArray(a)) {
|
|
|
+ doSetArea (a = {}) {
|
|
|
+ if (!a) {
|
|
|
return
|
|
|
}
|
|
|
- if (a.length <= 0) {
|
|
|
- return
|
|
|
- }
|
|
|
- const areaMap = {}
|
|
|
- if (a.includes('全国')) {
|
|
|
- // do nothing
|
|
|
- } else {
|
|
|
- a.forEach(item => {
|
|
|
- areaMap[item] = []
|
|
|
- })
|
|
|
- }
|
|
|
+ const areaMap = a
|
|
|
this.filters.area = areaMap
|
|
|
this.$refs.filters.setDefaultFilters({
|
|
|
area: areaMap
|
|
|
})
|
|
|
},
|
|
|
beforeAreaChange(parent, child) {
|
|
|
- // console.log(parent, child)
|
|
|
let selectSubscribeArea = true
|
|
|
- if (parent.value) {
|
|
|
- // 非全国
|
|
|
- selectSubscribeArea = this.subscribeArea.includes(parent.value)
|
|
|
- // (已登陆)点击非订阅区域展示提示弹窗
|
|
|
- if (!selectSubscribeArea) {
|
|
|
- this.dialog.freeTip = true
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 全国
|
|
|
- selectSubscribeArea = this.subscribeArea.includes('全国')
|
|
|
+ // console.log(parent, child)
|
|
|
+ if (this.isPay && this.canSelectAreaCount < 0) {
|
|
|
+ return selectSubscribeArea
|
|
|
+ }
|
|
|
+ const subscribeAreaList = Object.keys(this.subscribeArea)
|
|
|
+ const areaName = child.topName
|
|
|
+
|
|
|
+ selectSubscribeArea = subscribeAreaList.includes(areaName)
|
|
|
+ // (已登陆)点击非订阅区域展示提示弹窗
|
|
|
+ if (!selectSubscribeArea) {
|
|
|
+ this.dialog.freeTip = true
|
|
|
}
|
|
|
return selectSubscribeArea
|
|
|
},
|