|
@@ -70,7 +70,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="subscribe-tip">
|
|
|
- 前往<span @click="toSubSetting">推送设置</span>,设置订阅信息推送渠道和推送时间
|
|
|
+ 前往<span @click="toSubSetting">推送设置</span
|
|
|
+ >,设置订阅信息推送渠道和推送时间
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="j-button-group height40">
|
|
@@ -78,6 +79,7 @@
|
|
|
class="j-button-confirm"
|
|
|
:disabled="disabledConfirm"
|
|
|
@click="subConfirmEvent"
|
|
|
+ v-bound-phone="bindPhoneSubConfirm()"
|
|
|
>
|
|
|
完成订阅,立即免费查看信息
|
|
|
</van-button>
|
|
@@ -104,11 +106,22 @@
|
|
|
<div class="count-row">
|
|
|
<span>可选:</span>
|
|
|
<strong v-if="subInfo.productType === 'member'">全国</strong>
|
|
|
- <strong v-else-if="subInfo.productType === 'vip' && areaInfo.buyAreaCount === -1">全国</strong>
|
|
|
- <span v-else><strong>{{ areaInfo.buyAreaCount }}</strong>个省</span>,
|
|
|
+ <strong
|
|
|
+ v-else-if="
|
|
|
+ subInfo.productType === 'vip' && areaInfo.buyAreaCount === -1
|
|
|
+ "
|
|
|
+ >全国</strong
|
|
|
+ >
|
|
|
+ <span v-else
|
|
|
+ ><strong>{{ areaInfo.buyAreaCount }}</strong
|
|
|
+ >个省</span
|
|
|
+ >,
|
|
|
<span>已选:</span>
|
|
|
<strong v-if="selectedCount === -1">全国</strong>
|
|
|
- <span v-else><strong>{{ selectedCount }}</strong>个省</span>
|
|
|
+ <span v-else
|
|
|
+ ><strong>{{ selectedCount }}</strong
|
|
|
+ >个省</span
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
<AreaCitySidebar
|
|
@@ -122,8 +135,22 @@
|
|
|
@change="onAreaChanged"
|
|
|
@onDisabledCityClick="onNoPower"
|
|
|
/>
|
|
|
- <van-dialog v-model="showVipLimit" overlay-class="vip-limit-dialog-overlay" class="vip-limit-dialog" confirm-button-color="#2ABED1" confirm-button-text="去升级" title="超出可选省份数量" show-cancel-button @confirm="goUpgrade" @cancel="showVipLimit = false">
|
|
|
- <div>可选:<span style="color: #2ABED1;">{{ areaInfo.buyAreaCount }}个省</span>,如需增加省份数量,您可前往升级超级订阅。</div>
|
|
|
+ <van-dialog
|
|
|
+ v-model="showVipLimit"
|
|
|
+ overlay-class="vip-limit-dialog-overlay"
|
|
|
+ class="vip-limit-dialog"
|
|
|
+ confirm-button-color="#2ABED1"
|
|
|
+ confirm-button-text="去升级"
|
|
|
+ title="超出可选省份数量"
|
|
|
+ show-cancel-button
|
|
|
+ @confirm="goUpgrade"
|
|
|
+ @cancel="showVipLimit = false"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ 可选:<span style="color: #2abed1"
|
|
|
+ >{{ areaInfo.buyAreaCount }}个省</span
|
|
|
+ >,如需增加省份数量,您可前往升级超级订阅。
|
|
|
+ </div>
|
|
|
</van-dialog>
|
|
|
</DropdownLayout>
|
|
|
</van-popup>
|
|
@@ -150,9 +177,7 @@
|
|
|
<button class="j-button-cancel" @click="areaPickerShow = false">
|
|
|
取消
|
|
|
</button>
|
|
|
- <button class="j-button-confirm" @click="popupConfirm">
|
|
|
- 确定
|
|
|
- </button>
|
|
|
+ <button class="j-button-confirm" @click="popupConfirm">确定</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</PopupLayout>
|
|
@@ -247,14 +272,13 @@ export default {
|
|
|
noLoginOrFree() {
|
|
|
if (this.isLogin) {
|
|
|
return this.isFree
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
return true
|
|
|
}
|
|
|
},
|
|
|
selectedCount() {
|
|
|
return Object.keys(this.cacheMoreFilters.area).length || -1
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
value: {
|
|
@@ -273,8 +297,7 @@ export default {
|
|
|
this.areaSelected = Object.keys(freeSelectArea)[0]
|
|
|
console.log('freeSelectArea', freeSelectArea, this.areaSelected)
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
this.getVipUserInfo()
|
|
|
}
|
|
|
setTimeout(() => {
|
|
@@ -283,7 +306,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
immediate: true
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
this.initArea(provinceListMapExp)
|
|
@@ -298,8 +321,7 @@ export default {
|
|
|
for (const key in map) {
|
|
|
if (key === '#') {
|
|
|
continue
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
if (Array.isArray(map[key])) {
|
|
|
list = list.concat(map[key])
|
|
|
}
|
|
@@ -315,8 +337,7 @@ export default {
|
|
|
this.subUserInfo = data
|
|
|
if (productType === 'vip') {
|
|
|
this.areaInfo.buyAreaCount = data?.buyset?.areacount || -1
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
this.areaInfo.buyAreaCount = -1
|
|
|
}
|
|
|
}
|
|
@@ -339,35 +360,31 @@ export default {
|
|
|
// 全国(无限制)
|
|
|
if (buyAreaCount < 0) {
|
|
|
return true
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
// 非全国(省份有限制)
|
|
|
if (parent.parentName && parent.parentName === '全国') {
|
|
|
this.showVipLimit = true
|
|
|
return false
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
if (this.selectedCount >= buyAreaCount) {
|
|
|
// 已选择过的省份列表
|
|
|
const selectedProvinceList = []
|
|
|
- const sourceFirstCount
|
|
|
- = this.$refs.areaSelector.sourceFirstCount || []
|
|
|
+ const sourceFirstCount =
|
|
|
+ this.$refs.areaSelector.sourceFirstCount || []
|
|
|
for (const key in sourceFirstCount) {
|
|
|
selectedProvinceList.push(key)
|
|
|
}
|
|
|
// 已经选中过的可勾选掉
|
|
|
if (
|
|
|
- parent.parentName
|
|
|
- && selectedProvinceList.includes(parent.parentName)
|
|
|
+ parent.parentName &&
|
|
|
+ selectedProvinceList.includes(parent.parentName)
|
|
|
) {
|
|
|
return true
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
this.showVipLimit = true
|
|
|
return false
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
return true
|
|
|
}
|
|
|
}
|
|
@@ -385,8 +402,7 @@ export default {
|
|
|
}
|
|
|
this.cacheMoreFilters.area = freeArea
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
if (area && Object.keys(area).length) {
|
|
|
this.areaSelected = this.getLastLevelNames(area)
|
|
|
this.$refs.areaSelector.setState(area)
|
|
@@ -429,8 +445,8 @@ export default {
|
|
|
for (const city in areaObj[province]) {
|
|
|
// 如果城市有区域信息,则存储
|
|
|
if (
|
|
|
- Array.isArray(areaObj[province][city])
|
|
|
- && areaObj[province][city].length > 0
|
|
|
+ Array.isArray(areaObj[province][city]) &&
|
|
|
+ areaObj[province][city].length > 0
|
|
|
) {
|
|
|
cityDistricts[city] = areaObj[province][city]
|
|
|
}
|
|
@@ -458,8 +474,7 @@ export default {
|
|
|
items,
|
|
|
iSwitch: 1
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
params = {
|
|
|
area: this.cacheMoreFilters.area,
|
|
|
items,
|
|
@@ -470,7 +485,7 @@ export default {
|
|
|
},
|
|
|
// 设置关键词格式
|
|
|
formatKeywords(arr) {
|
|
|
- const aKeyItems = arr.map(item => ({
|
|
|
+ const aKeyItems = arr.map((item) => ({
|
|
|
appendkey: [],
|
|
|
key: [item],
|
|
|
matchway: 1,
|
|
@@ -500,8 +515,7 @@ export default {
|
|
|
// sessionStorage.setItem('JY-MOBILE-bidding-subscribe', JSON.stringify(this.$data))
|
|
|
// location.href = link
|
|
|
this.areaPickerShow = true
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
this.areaCascaderPickerShow = true
|
|
|
setTimeout(() => {
|
|
|
this.$refs.areaSelector.setState(this.cacheMoreFilters.area)
|
|
@@ -510,8 +524,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onAddKey() {
|
|
|
- if (!this.productSelected)
|
|
|
- return
|
|
|
+ if (!this.productSelected) return
|
|
|
this.setKeyListFun(this.productSelected)
|
|
|
},
|
|
|
setKeyListFun(value) {
|
|
@@ -535,13 +548,11 @@ export default {
|
|
|
|
|
|
// 添加新关键词
|
|
|
this.keyList = [...this.keyList, ...keysToAdd]
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
this.keyList.push(value)
|
|
|
}
|
|
|
this.productSelected = ''
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
if (this.keyList.length > 300) {
|
|
|
this.$toast('关键词数量不能超过300个')
|
|
|
this.productSelected = ''
|
|
@@ -568,16 +579,14 @@ export default {
|
|
|
// 如果省下面直接是空对象,说明只有省
|
|
|
if (!Object.keys(provinceInfo).length) {
|
|
|
names.push(province)
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
// 如果省下面有市
|
|
|
for (const city in provinceInfo) {
|
|
|
const cityInfo = provinceInfo[city]
|
|
|
// 如果市下面直接是空数组或空对象,说明只有市
|
|
|
- if ((Array.isArray(cityInfo) && cityInfo.length === 0)) {
|
|
|
+ if (Array.isArray(cityInfo) && cityInfo.length === 0) {
|
|
|
names.push(city)
|
|
|
- }
|
|
|
- else if (Array.isArray(cityInfo)) {
|
|
|
+ } else if (Array.isArray(cityInfo)) {
|
|
|
// 如果市下面有区
|
|
|
cityInfo.forEach((district) => {
|
|
|
if (typeof district === 'string') {
|
|
@@ -604,13 +613,11 @@ export default {
|
|
|
const districtArr = data[item][city]
|
|
|
if (districtArr.length) {
|
|
|
areaData = areaData.concat(districtArr)
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
areaData.push(city)
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
areaData.push(item)
|
|
|
}
|
|
|
})
|
|
@@ -638,14 +645,12 @@ export default {
|
|
|
if (action === 'confirm') {
|
|
|
if (this.disabledConfirm) {
|
|
|
return done(false)
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
// 一键订阅
|
|
|
await this.oneKeySub(true)
|
|
|
done()
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
// 暂不订阅
|
|
|
await this.oneKeySub(false)
|
|
|
done()
|
|
@@ -655,16 +660,14 @@ export default {
|
|
|
async oneKeySub(type = false) {
|
|
|
const params = {}
|
|
|
if (type) {
|
|
|
- if (!this.keywords)
|
|
|
- return this.$toast('订阅关键词不能为空')
|
|
|
+ if (!this.keywords) return this.$toast('订阅关键词不能为空')
|
|
|
Object.assign(params, {
|
|
|
isNoSubscribe: 'Y', // 一键订阅
|
|
|
subsequentPrompt: this.remindChecked ? 'Y' : 'N',
|
|
|
key: this.keywords.replace(/\s+/g, ''),
|
|
|
area: this.areaSelected
|
|
|
})
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
Object.assign(params, {
|
|
|
isNoSubscribe: 'N', // 暂不订阅
|
|
|
subsequentPrompt: this.remindChecked ? 'Y' : 'N'
|
|
@@ -683,18 +686,26 @@ export default {
|
|
|
this.onClose(false)
|
|
|
this.$toast('订阅关键词成功')
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
// 一键订阅失败
|
|
|
this.onClose(false)
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
if (msg) {
|
|
|
this.$toast(msg)
|
|
|
}
|
|
|
}
|
|
|
return data.status
|
|
|
+ },
|
|
|
+ bindPhoneSubConfirm() {
|
|
|
+ return {
|
|
|
+ props: {
|
|
|
+ name: '完成订阅,立即免费查看信息'
|
|
|
+ },
|
|
|
+ next: () => {
|
|
|
+ this.subConfirmEvent()
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -866,7 +877,7 @@ export default {
|
|
|
}
|
|
|
.van-dialog__content {
|
|
|
padding: 16px;
|
|
|
- color: #5F5E64;
|
|
|
+ color: #5f5e64;
|
|
|
line-height: 22px;
|
|
|
font-size: 15px;
|
|
|
}
|