|
@@ -747,7 +747,11 @@ var subComponent = {
|
|
|
},
|
|
|
success:function(res){
|
|
|
if(res.flag) {
|
|
|
- location.reload()
|
|
|
+ if (_this.infoTypeData.length) {
|
|
|
+ _this.info.infoType = _this.infoTypeData.join('、')
|
|
|
+ } else {
|
|
|
+ _this.info.infoType = '全部类型'
|
|
|
+ }
|
|
|
} else {
|
|
|
_this.$toast(res.data.error_msg)
|
|
|
}
|
|
@@ -783,52 +787,31 @@ var subComponent = {
|
|
|
getUserSubscribe: function () {
|
|
|
let _this = this
|
|
|
$.ajax({
|
|
|
- url: '/publicapply/free/subscribe',
|
|
|
- type: 'POST',
|
|
|
- success: function (res) {
|
|
|
- let freeArea = JSON.stringify(res.data)
|
|
|
- sessionStorage.setItem('sub_free_state', freeArea)
|
|
|
- _this.UserSubscribe = res
|
|
|
- _this.info.area = res.data.area
|
|
|
- _this.userAreaNum = res.data.areanum
|
|
|
- _this.userType = res.data.provincenum === 0 ? false : true
|
|
|
- _this.userAreaAllNum = res.data.provincenum
|
|
|
- _this.initdata.infotype = res.data.infotype || []
|
|
|
- _this.infoTypeData = res.data.infotype || []
|
|
|
- _this.info.infoType = _this.infoTypeData.length === 0 ? '全部类型' : _this.infoTypeData.join('、')
|
|
|
-
|
|
|
- // let proStr = ''
|
|
|
- // Object.keys(res.data.area).forEach(function(item,index) {
|
|
|
- // if(res.data.area[item].length == 0) {
|
|
|
- // proStr += item + '、'
|
|
|
- // } else {
|
|
|
- // let cityStr = ''
|
|
|
- // res.data.area[item].forEach(function(data, i) {
|
|
|
- // cityStr += data + '、'
|
|
|
- // })
|
|
|
- // if (cityStr.length > 0) {
|
|
|
- // cityStr = cityStr.substr(0,cityStr.length - 1);
|
|
|
- // }
|
|
|
- // proStr += item+ '(' + cityStr + ')' + '、'
|
|
|
- // }
|
|
|
- // })
|
|
|
- // if(proStr[proStr.length - 1] == '、') {
|
|
|
- // proStr = proStr.substr(0,proStr.length - 1);
|
|
|
- // }
|
|
|
- // _this.info.area = '已选:' + proStr
|
|
|
+ url: '/publicapply/free/subscribe',
|
|
|
+ type: 'POST',
|
|
|
+ success: function (res) {
|
|
|
+ _this.UserSubscribe = res
|
|
|
+ if (res.data) {
|
|
|
+ _this.info.area = res.data.area
|
|
|
+ _this.userAreaNum = res.data.areanum
|
|
|
+ _this.userType = res.data.provincenum === 0 ? false : true
|
|
|
+ _this.userAreaAllNum = res.data.provincenum
|
|
|
+ _this.initdata.infotype = res.data.infotype || []
|
|
|
+ _this.infoTypeData = res.data.infotype || []
|
|
|
|
|
|
- let areaArr = []
|
|
|
- if (res.data) {
|
|
|
- if (!res.data.area) {
|
|
|
- _this.noAreaFreeType = true
|
|
|
- } else {
|
|
|
- for (const key in res.data.area) {
|
|
|
+ _this.info.infoType = _this.infoTypeData.length === 0 ? '全部类型' : _this.infoTypeData.join('、')
|
|
|
+ let areaArr = []
|
|
|
+ if (!res.data.area) {
|
|
|
+ _this.noAreaFreeType = true
|
|
|
+ _this.info.area = '请选择区域'
|
|
|
+ } else {
|
|
|
+ for (const key in res.data.area) {
|
|
|
areaArr.push(key)
|
|
|
- }
|
|
|
}
|
|
|
- }
|
|
|
- $('#menuArea').text('已选:'+ areaArr.join('、'))
|
|
|
+ _this.info.area = '已选:' + (areaArr.length === 0 ? '全国': areaArr.join('、'))
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
// 关闭未选择地区提示
|