|
@@ -20,6 +20,7 @@ function delUrlParam (name){
|
|
|
|
|
|
var subScribeTemplate = `
|
|
|
<div class="sub-scribe" id="sub-scribe">
|
|
|
+<div v-if="initdata.switch == 0" @click="OpenSubSwitch" class="sub-mask"></div>
|
|
|
<ul style="border-radius:.16rem;overflow:hidden">
|
|
|
<li class="body-item area" :class="{ blink: activity.blink === 1 }">
|
|
|
<a class="item-container" :href="linkobj.area" @click="userNumOver">
|
|
@@ -109,6 +110,21 @@ var subScribeTemplate = `
|
|
|
</div>
|
|
|
</a>
|
|
|
</li>
|
|
|
+ <li class="body-item amount-range">
|
|
|
+ <a class="item-container" href="javascript:;" @click="openAmountDialog($event)">
|
|
|
+ <div class="item">
|
|
|
+ <span class="item-l">
|
|
|
+ <span class="leading jy-icon-amount"></span>
|
|
|
+ <span class="item-label">金额区间</span>
|
|
|
+ <span class="openVip" v-show="vSwitch === 'f'">开通</span>
|
|
|
+ </span>
|
|
|
+ <span class="item-r">
|
|
|
+ <span class="item-r-text info-type-text ellipsis">{{info.amountRange}}</span>
|
|
|
+ <span class="iconfont icon-arrow"></span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </a>
|
|
|
+ </li>
|
|
|
<li class="body-item project-match">
|
|
|
<a class="item-container" href="javascript:;">
|
|
|
<div class="item">
|
|
@@ -162,28 +178,6 @@ var subScribeTemplate = `
|
|
|
</a>
|
|
|
</li>
|
|
|
</ul>
|
|
|
- <!-- 匹配方式 -->
|
|
|
- <div class="match-keywords-actionsheet">
|
|
|
- <div class="weui-mask" id="iosMask" @click="iosMask" style="opacity: 1;display: none;"></div>
|
|
|
- <div class="weui-actionsheet" id="iosActionsheet">
|
|
|
- <div class="weui-actionsheet__title" style="display:none">
|
|
|
- <p class="weui-actionsheet__title-text">关键词匹配方式</p>
|
|
|
- <i class="weui-icon-clear" id="iosActionsheetCancel" @click="iosActionsheetCancel"></i>
|
|
|
- </div>
|
|
|
- <div class="weui-actionsheet__menu">
|
|
|
- <div class="weui-actionsheet__cell titleMacth" :class="{active:active==1}" @click="actionSheet('按标题匹配', 1)">
|
|
|
- <p class="cell_title">按标题匹配</p>
|
|
|
- </div>
|
|
|
- <div class="weui-actionsheet__cell allMacth" :class="{active:active==2}" @click="actionSheet('按全文匹配', 2)">
|
|
|
- <p class="cell_title">按全文匹配<span class="openVip-keywords" v-show="vSwitch === 'f'">开通</span></p>
|
|
|
- <p class="small-title">会产生无效信息,请根据需要选择</p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- <div class="weui-actionsheet__action">
|
|
|
- <div class="weui-actionsheet__cell" id="iosActionsheetCancel" @click="iosActionsheetCancel">取消</div>
|
|
|
- </div> -->
|
|
|
- </div>
|
|
|
- </div>
|
|
|
<!-- 信息类型 -->
|
|
|
<div class="menu-infoType-wrap" v-show="infoTypeMenu">
|
|
|
<div class="infoType-content">
|
|
@@ -267,6 +261,132 @@ var subScribeTemplate = `
|
|
|
</div>
|
|
|
</div>
|
|
|
</van-popup>
|
|
|
+ <van-popup
|
|
|
+ class="common-selector-popup"
|
|
|
+ v-model="amountSelectorShow"
|
|
|
+ :getContainer="getContainer"
|
|
|
+ position="bottom"
|
|
|
+ :overlay="true"
|
|
|
+ :lock-scroll="true"
|
|
|
+ >
|
|
|
+ <div class="common-selector-layout">
|
|
|
+ <div class="j-container">
|
|
|
+ <div class="j-header">
|
|
|
+ <div class="title-row">
|
|
|
+ <span>请选择金额区间</span>
|
|
|
+ <img @click="amountSelectorShow = false" class="dialog-close" src="/jyapp/vipsubscribe/image/dialog-close.png" alt="" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="j-main" style="margin-top: 4px;">
|
|
|
+ <button :class='{"active": moneyList[0].active }' :disabled="moneyList[0].disabled" @click="changeAmount('all')" class="btn-item">{{ moneyList[0].title }}</button>
|
|
|
+ <div class="btn-list">
|
|
|
+ <button :class='{"active": item.active }' :disabled="item.disabled" class="btn-item" v-for="(item, index) in setMoneyList" :key="index" @click="changeAmount(item)">{{item.title}}</button>
|
|
|
+ </div>
|
|
|
+ <div class="custom-title">自定义金额</div>
|
|
|
+ <div class="custom-input">
|
|
|
+ <van-field
|
|
|
+ maxlength="9"
|
|
|
+ type="number"
|
|
|
+ class="custom-inout-item"
|
|
|
+ v-model="customMoney.min"
|
|
|
+ center
|
|
|
+ placeholder="请输入金额"
|
|
|
+ >
|
|
|
+ <template #extra>
|
|
|
+ <span style="padding-left:4px; color: #5F5E64">万</span>
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ <div class="custom-input-line"></div>
|
|
|
+ <van-field
|
|
|
+ maxlength="9"
|
|
|
+ type="number"
|
|
|
+ class="custom-inout-item"
|
|
|
+ v-model="customMoney.max"
|
|
|
+ center
|
|
|
+ placeholder="请输入金额"
|
|
|
+ >
|
|
|
+ <template #extra>
|
|
|
+ <span style="padding-left:4px; color: #5F5E64">万</span>
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="j-footer">
|
|
|
+ <slot name="footer">
|
|
|
+ <button class="j-button-cancel" :class="{'disabled': resetButtonDisabled }" @click="amountCancelHandle">重置</button>
|
|
|
+ <button class="j-button-confirm" @click="amountConfirmHandle">确认</button>
|
|
|
+ </slot>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
+ <van-popup
|
|
|
+ class="common-selector-popup keymate-selector-popup"
|
|
|
+ v-model="keymateSelectorShow"
|
|
|
+ :getContainer="getContainer"
|
|
|
+ position="bottom"
|
|
|
+ :overlay="true"
|
|
|
+ :lock-scroll="true"
|
|
|
+ >
|
|
|
+ <div class="common-selector-layout">
|
|
|
+ <div class="j-container">
|
|
|
+ <div class="j-header">
|
|
|
+ <div class="title-row">
|
|
|
+ <span>请选择关键词匹配方式</span>
|
|
|
+ <img @click="keymateSelectorShow = false" class="dialog-close" src="/jyapp/vipsubscribe/image/dialog-close.png" alt="" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="j-main">
|
|
|
+ <van-checkbox-group v-model="keymate.checked">
|
|
|
+ <van-cell-group inset>
|
|
|
+ <van-cell
|
|
|
+ v-for="(item, index) in keymate.list"
|
|
|
+ clickable
|
|
|
+ :key="item"
|
|
|
+ :class="{'ischecked': item.active}"
|
|
|
+ @click="setKeyToggle(index)"
|
|
|
+ >
|
|
|
+ <template #title>
|
|
|
+ <span>{{item.title}}</span>
|
|
|
+ <span style="display: inline-block;" v-if="vSwitch=='f' && item.title !== '标题'" class="openVip">开通</span>
|
|
|
+ </template>
|
|
|
+ <template #right-icon>
|
|
|
+ <van-checkbox
|
|
|
+ v-model="item.active"
|
|
|
+ ref="checkbox0"
|
|
|
+ :name="item.title"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ </van-cell-group>
|
|
|
+ </van-checkbox-group>
|
|
|
+ </div>
|
|
|
+ <div class="j-footer">
|
|
|
+ <slot name="footer">
|
|
|
+ <button :disabled="!keymate.checked.length" class="j-button-confirm" @click="actionSheet">确认</button>
|
|
|
+ </slot>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
+ <van-dialog
|
|
|
+ getContainer="body"
|
|
|
+ class-name="sub-dialog-confirm"
|
|
|
+ v-model="showSubDialog"
|
|
|
+ width="303px"
|
|
|
+ title="开启订阅"
|
|
|
+ show-cancel-button
|
|
|
+ confirm-button-text="立即开启"
|
|
|
+ confirm-button-color="#2ABED1"
|
|
|
+ cancel-button-text="暂不开启"
|
|
|
+ cancel-button-color="#1d1d1d"
|
|
|
+ @confirm="setSubStatus"
|
|
|
+ @cancel="showSubDialog = false"
|
|
|
+ >
|
|
|
+ <div class="sub-dialog-content">
|
|
|
+ 当前订阅状态为关闭状态,不支持修改,请开启订阅
|
|
|
+ </div>
|
|
|
+ </van-dialog>
|
|
|
</div>
|
|
|
`
|
|
|
|
|
@@ -311,7 +431,8 @@ var subComponent = {
|
|
|
info: {
|
|
|
area: '请选择区域',
|
|
|
industry: '请选择采购单位行业',
|
|
|
- infoType: '请选择信息类型'
|
|
|
+ infoType: '请选择信息类型',
|
|
|
+ amountRange: '全部金额'
|
|
|
},
|
|
|
// 信息类型数据
|
|
|
infoTypeList: [
|
|
@@ -348,6 +469,40 @@ var subComponent = {
|
|
|
],
|
|
|
// 匹配方式
|
|
|
active: 1,
|
|
|
+ checkboxRefs: [
|
|
|
+ 'checkbox0',
|
|
|
+ 'checkbox1',
|
|
|
+ 'checkbox2',
|
|
|
+ 'checkbox3',
|
|
|
+ ],
|
|
|
+ keymate: {
|
|
|
+ checked: [],
|
|
|
+ list: [
|
|
|
+ {
|
|
|
+ title: '标题',
|
|
|
+ value: 'title',
|
|
|
+ active: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '正文',
|
|
|
+ value: 'detail',
|
|
|
+ active: false,
|
|
|
+ showVip: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '附件',
|
|
|
+ value: 'filetext',
|
|
|
+ active: false,
|
|
|
+ showVip: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '项目名称/标的物',
|
|
|
+ value: 'projectname/purchasing',
|
|
|
+ active: false,
|
|
|
+ showVip: false
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
pushsetShow: true,
|
|
|
resultTime: '',
|
|
|
checkedflag: false,
|
|
@@ -371,6 +526,8 @@ var subComponent = {
|
|
|
},
|
|
|
cansetarea_s:true,
|
|
|
areaSelectorShow: false,
|
|
|
+ amountSelectorShow: false,
|
|
|
+ keymateSelectorShow: false,
|
|
|
// 提交信息
|
|
|
// bindInfo: {
|
|
|
// area: {}
|
|
@@ -381,7 +538,69 @@ var subComponent = {
|
|
|
// 已选省份
|
|
|
selectedCount: 0,
|
|
|
buyAreaCount: -1
|
|
|
- }
|
|
|
+ },
|
|
|
+ moneyList: [
|
|
|
+ {
|
|
|
+ title: '全部金额',
|
|
|
+ value: '',
|
|
|
+ active: true,
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '0-10万',
|
|
|
+ value: '0-10',
|
|
|
+ active: false,
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '10-20万',
|
|
|
+ value: '10-20',
|
|
|
+ active: false,
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '20-50万',
|
|
|
+ value: '20-50',
|
|
|
+ active: false,
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '50-100万',
|
|
|
+ value: '50-100',
|
|
|
+ active: false,
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '100-200万',
|
|
|
+ value: '100-200',
|
|
|
+ active: false,
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '200-500万',
|
|
|
+ value: '200-500',
|
|
|
+ active: false,
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '500-1000万',
|
|
|
+ value: '500-1000',
|
|
|
+ active: false,
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '1000万以上',
|
|
|
+ value: '1000-',
|
|
|
+ active: false,
|
|
|
+ disabled: false
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ customMoney: {
|
|
|
+ min: '',
|
|
|
+ max: ''
|
|
|
+ },
|
|
|
+ showSubDialog: false,
|
|
|
+ subSwitch: false
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
@@ -403,17 +622,23 @@ var subComponent = {
|
|
|
resetButtonDisabled: function () {
|
|
|
var isSame = utils.deepCompare(this.initdata.oldArea, this.bindArea)
|
|
|
return isSame
|
|
|
- }
|
|
|
+ },
|
|
|
+ setMoneyList: function () {
|
|
|
+ return this.moneyList.filter((item, i) => i !== 0)
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
- initdata: function(newVal, oldVal) {
|
|
|
- if(newVal) {
|
|
|
- this.getResultView()
|
|
|
- this.getData()
|
|
|
- if (this.vSwitch !== 'f') {
|
|
|
- this.setIosData()
|
|
|
+ initdata: {
|
|
|
+ handler: function(newVal, oldVal) {
|
|
|
+ if(newVal) {
|
|
|
+ this.getResultView()
|
|
|
+ this.getData()
|
|
|
+ if (this.vSwitch !== 'f') {
|
|
|
+ this.setIosData()
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
},
|
|
|
vSwitch: function (val) {
|
|
|
if(val == 'm') {
|
|
@@ -431,9 +656,142 @@ var subComponent = {
|
|
|
this.areaInfo.selectedCount = Object.keys(newVal).length || -1
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ 'customMoney.min': {
|
|
|
+ handler (newval) {
|
|
|
+ if (newval) {
|
|
|
+ this.moneyList.forEach(v => {
|
|
|
+ v.active = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ const hasActive = this.moneyList.filter((v) => v.active)
|
|
|
+ if(!this.customMoney.max) {
|
|
|
+ this.moneyList[0].active = !hasActive.length
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ 'customMoney.max': {
|
|
|
+ handler (newval) {
|
|
|
+ if (newval) {
|
|
|
+ this.moneyList.forEach(v => {
|
|
|
+ v.active = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ const hasActive = this.moneyList.filter((v) => v.active)
|
|
|
+ if(!this.customMoney.min) {
|
|
|
+ this.moneyList[0].active = !hasActive.length
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 开启订阅开关
|
|
|
+ setSubStatus: function () {
|
|
|
+ const params = {
|
|
|
+ pageType: 'i_switch',
|
|
|
+ matchtype: 1,
|
|
|
+ vSwitch: this.vSwitch
|
|
|
+ }
|
|
|
+ this.saveUserInfoApi(params, () => {
|
|
|
+ this.showSubDialog = false
|
|
|
+ this.initdata.switch = 1
|
|
|
+ weui.toast('开启成功', {
|
|
|
+ duration: 1500,
|
|
|
+ className: 'jy-toast',
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 判断是否有修改订阅条件权限,是否开启订阅开关
|
|
|
+ OpenSubSwitch: function () {
|
|
|
+ this.showSubDialog = true
|
|
|
+ },
|
|
|
+ // 选择关键词匹配方式
|
|
|
+ setKeyToggle (index) {
|
|
|
+ if(this.vSwitch === 'f' && index !== 0) {
|
|
|
+ this.hideActionSheet()
|
|
|
+ this.toBuyVipSub()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const data = this.keymate.list[index]
|
|
|
+ if(data.active) {
|
|
|
+ data.active = false
|
|
|
+ this.keymate.checked.forEach((v, i) => {
|
|
|
+ if(v === data.title) {
|
|
|
+ this.keymate.checked.splice(i, 1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.keymate.checked.push(this.keymate.list[index].title)
|
|
|
+ console.log(this.keymate.checked)
|
|
|
+ this.keymate.list[index].active = true
|
|
|
+ }
|
|
|
+ // this.keymate.checked = [...new Set(this.keymate.checked)]
|
|
|
+ },
|
|
|
+ // 选择金额
|
|
|
+ changeAmount: function (item) {
|
|
|
+ this.setMoneyList.forEach((v, i) => {
|
|
|
+ v.active = false
|
|
|
+ })
|
|
|
+ this.setMoneyList.forEach((v, i) => {
|
|
|
+ if(item === 'all') {
|
|
|
+ this.moneyList[0].active = true
|
|
|
+ } else {
|
|
|
+ if(item.title === v.title) {
|
|
|
+ this.moneyList[0].active = false
|
|
|
+ v.active = !v.active
|
|
|
+ } else {
|
|
|
+ v.active = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.customMoney.min = ''
|
|
|
+ this.customMoney.max = ''
|
|
|
+ },
|
|
|
+ // 确认金额区间
|
|
|
+ amountConfirmHandle: function () {
|
|
|
+ let val = this.moneyList.filter(v => v.active == true)
|
|
|
+ if(!val.length) {
|
|
|
+ const { min, max } = this.setAmountPostion(this.customMoney.min, this.customMoney.max)
|
|
|
+ val = [{
|
|
|
+ value: min + '-' + max,
|
|
|
+ title: max ? min + '-' + max + '万' : min + '万元以上'
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ this.amountSelectorShow = false
|
|
|
+ const params = {
|
|
|
+ pageType: 'amount',
|
|
|
+ matchtype: val[0].value,
|
|
|
+ vSwitch: this.vSwitch
|
|
|
+ }
|
|
|
+ this.saveUserInfoApi(params, (res) => {
|
|
|
+ if(res && res.flag) {
|
|
|
+ console.log(res)
|
|
|
+ this.info.amountRange = val[0].title
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ amountCancelHandle: function () {
|
|
|
+ this.setMoneyList = this.setMoneyList.forEach((v, i) => {
|
|
|
+ v.active = false
|
|
|
+ })
|
|
|
+ this.moneyList[0].active = true
|
|
|
+ this.customMoney.min = this.customMoney.max = ''
|
|
|
+ this.amountSelectorShow = false
|
|
|
+ const params = {
|
|
|
+ pageType: 'amount',
|
|
|
+ matchtype: '',
|
|
|
+ vSwitch: this.vSwitch
|
|
|
+ }
|
|
|
+ this.saveUserInfoApi(params, (res) => {
|
|
|
+ if(res && res.flag) {
|
|
|
+ this.info.amountRange = '全部金额'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
goToActive: function () {
|
|
|
if (location.href.indexOf('front') !== -1) {
|
|
|
var href = '/weixin/frontPage/activity/sess/task'
|
|
@@ -533,6 +891,7 @@ var subComponent = {
|
|
|
this.setKeyword()
|
|
|
this.getActionDefault()
|
|
|
this.getIndustryType()
|
|
|
+ this.getAmountRange()
|
|
|
this.getProjectMatch()
|
|
|
this.iosBackRefresh()
|
|
|
// 大会员、超级订阅,弹窗选择地区
|
|
@@ -674,6 +1033,48 @@ var subComponent = {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 获取金额区间回显
|
|
|
+ getAmountRange: function() {
|
|
|
+ console.log(this.initdata)
|
|
|
+ if(this.initdata.amount) {
|
|
|
+ let hasCustom = false
|
|
|
+ this.moneyList.forEach((v, index) => {
|
|
|
+ v.active = false
|
|
|
+ if(v.value == this.initdata.amount) {
|
|
|
+ hasCustom = true
|
|
|
+ v.active = true
|
|
|
+ this.info.amountRange = v.title
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 自定义金额
|
|
|
+ if(!hasCustom) {
|
|
|
+ const minAndMax = this.initdata.amount.split('-')
|
|
|
+ const { min, max } = this.setAmountPostion(minAndMax[0], minAndMax[1])
|
|
|
+ this.customMoney.min = min
|
|
|
+ this.customMoney.max = max
|
|
|
+ if(!max) {
|
|
|
+ this.customMoney.max = ''
|
|
|
+ this.info.amountRange = min + '万以上'
|
|
|
+ } else {
|
|
|
+ this.info.amountRange = min + '-' + max + '万'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.info.amountRange = '全部金额'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 判断金额大小,交换位置
|
|
|
+ setAmountPostion (oldmin, oldmax) {
|
|
|
+ if(!oldmin) oldmin = 0
|
|
|
+ if(!oldmax) oldmax = 0
|
|
|
+ let min = parseFloat(oldmin)
|
|
|
+ let max = parseFloat(oldmax)
|
|
|
+ if(min > max && max) {
|
|
|
+ max = min
|
|
|
+ min = parseFloat(oldmax)
|
|
|
+ }
|
|
|
+ return { min, max }
|
|
|
+ },
|
|
|
// 项目匹配
|
|
|
getProjectMatch: function() {
|
|
|
if (this.initdata.projectmatch == 1) {
|
|
@@ -729,21 +1130,26 @@ var subComponent = {
|
|
|
},
|
|
|
// 关键词匹配方式
|
|
|
getActionDefault: function() {
|
|
|
- let _this = this
|
|
|
- let defaultTitle = ''
|
|
|
- if(this.initdata.matchway == 1 || !this.initdata.matchway) {
|
|
|
- $('.match-way-value').text('按标题匹配')
|
|
|
- this.active = 1
|
|
|
- } else if(this.initdata.matchway == 2) {
|
|
|
- $('.match-way-value').text('按全文匹配')
|
|
|
- this.active = 2
|
|
|
+ if(this.initdata.matchmode && this.initdata.matchmode.length) {
|
|
|
+ this.keymate.list.forEach(v => {
|
|
|
+ v.active = false
|
|
|
+ })
|
|
|
+ this.keymate.checked = []
|
|
|
+ this.initdata.matchmode.forEach((item, index) => {
|
|
|
+ this.keymate.list.forEach(v => {
|
|
|
+ if(item === v.value) {
|
|
|
+ v.active = true
|
|
|
+ this.keymate.checked.push(v.title)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ const text = this.keymate.checked.join(',')
|
|
|
+ $('.match-way-value').text(text)
|
|
|
+ } else {
|
|
|
+ $('.match-way-value').text('标题')
|
|
|
+ this.keymate.checked = ['标题']
|
|
|
+ this.keymate.list[0].active = true
|
|
|
}
|
|
|
- // $('#iosActionsheet .weui-actionsheet__cell').each(function (index, item) {
|
|
|
- // var t = $(item).children().text().trim();
|
|
|
- // if (t == defaultTitle) {
|
|
|
- // $(this).addClass('active')
|
|
|
- // }
|
|
|
- // })
|
|
|
},
|
|
|
hideActionSheet: function() {
|
|
|
var $iosMask = $('#iosMask');
|
|
@@ -766,13 +1172,14 @@ var subComponent = {
|
|
|
this.hideActionSheet()
|
|
|
},
|
|
|
matchWay: function() {
|
|
|
- var $iosMask = $('#iosMask');
|
|
|
- var $iosActionsheet = $('#iosActionsheet');
|
|
|
- $iosActionsheet.addClass('weui-actionsheet_toggle');
|
|
|
- $('.match-keywords-actionsheet').show()
|
|
|
- $iosMask.fadeIn(200);
|
|
|
- this.checkUpdateRenewShow()
|
|
|
- this.$emit('footershow', 'true')
|
|
|
+ // var $iosMask = $('#iosMask');
|
|
|
+ // var $iosActionsheet = $('#iosActionsheet');
|
|
|
+ // $iosActionsheet.addClass('weui-actionsheet_toggle');
|
|
|
+ // $('.match-keywords-actionsheet').show()
|
|
|
+ // $iosMask.fadeIn(200);
|
|
|
+ // this.checkUpdateRenewShow()
|
|
|
+ // this.$emit('footershow', 'true')
|
|
|
+ this.keymateSelectorShow = true
|
|
|
},
|
|
|
checkUpdateRenewShow: function () {
|
|
|
// 老用户只显示升级,不显示续费
|
|
@@ -793,73 +1200,50 @@ var subComponent = {
|
|
|
update_renew.hide()
|
|
|
}
|
|
|
},
|
|
|
- actionSheet: function(title, index) {
|
|
|
+ // 设置关键词匹配方式
|
|
|
+ actionSheet: function() {
|
|
|
let _this = this
|
|
|
let vswitch = 'v'
|
|
|
var href = ''
|
|
|
- if (index === 2 && this.vSwitch === 'f') {
|
|
|
- this.toBuyVipSub()
|
|
|
- } else {
|
|
|
-
|
|
|
- if (this.vSwitch === 'f') {
|
|
|
- return this.hideActionSheet()
|
|
|
- }
|
|
|
-
|
|
|
- if(_this.accStatus == 2) {
|
|
|
- vswitch = 'm'
|
|
|
- } else if(_this.accStatus == 1) {
|
|
|
- vswitch = 'v'
|
|
|
- }
|
|
|
- $.post("/publicapply/subscribe/setUserInfo", {pageType: "saveSeniorset", matchtype: index, vSwitch: vswitch}, function (r) {
|
|
|
- if (r.flag) {
|
|
|
- var subVipState = sessionStorage.getItem('sub_vip_state');
|
|
|
- var reqData = JSON.parse(subVipState);
|
|
|
- _this.active = index
|
|
|
- var $iosMask = $('#iosMask');
|
|
|
- var $iosActionsheet = $('#iosActionsheet');
|
|
|
- $iosActionsheet.removeClass('weui-actionsheet_toggle');
|
|
|
- $('.match-keywords-actionsheet').hide()
|
|
|
- $iosMask.fadeOut(200);
|
|
|
- _this.checkUpdateRenewShow()
|
|
|
- _this.$emit('footershow', 'false')
|
|
|
- $('.match-way-value').text(title)
|
|
|
- if(index == 1) {
|
|
|
- $('.titleMacth').addClass('active')
|
|
|
- $('.allMacth').removeClass('active')
|
|
|
- } else {
|
|
|
- $('.titleMacth').removeClass('active')
|
|
|
- $('.allMacth').addClass('active')
|
|
|
- }
|
|
|
- reqData.matchway = index;
|
|
|
- sessionStorage.setItem('sub_vip_state', JSON.stringify(reqData))
|
|
|
- } else {
|
|
|
- weui.toast('关键词匹配方式修改失败', {
|
|
|
- duration: 1500,
|
|
|
- className: 'jy-toast',
|
|
|
- callback: function () {
|
|
|
- console.log('close')
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ const keymateSelect = []
|
|
|
+ this.keymate.list.forEach(v => {
|
|
|
+ this.keymate.checked.forEach((c) => {
|
|
|
+ if(c === v.title) {
|
|
|
+ keymateSelect.push(v.value)
|
|
|
+ }
|
|
|
})
|
|
|
- // var nowMode = title
|
|
|
- // var ModeArr = ['按标题匹配', '按全文匹配']
|
|
|
- // var nowIndex = ModeArr.indexOf(nowMode)
|
|
|
- // if (nowIndex !== -1) {
|
|
|
- // this.setMatchway(ModeArr.indexOf(nowMode) + 1)
|
|
|
- // } else {
|
|
|
- // // $(this).removeClass('active').siblings().addClass('active');
|
|
|
- // $('.match-way-value').text($(this).siblings().children('.cell_title').text())
|
|
|
- // weui.toast('关键词匹配方式修改失败', {
|
|
|
- // duration: 1500,
|
|
|
- // className: 'jy-toast',
|
|
|
- // callback: function () {
|
|
|
- // console.log('close')
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
- this.getResultView()
|
|
|
+ })
|
|
|
+ if (this.vSwitch === 'f') {
|
|
|
+ this.keymateSelectorShow = false
|
|
|
+ return this.hideActionSheet()
|
|
|
+ }
|
|
|
+
|
|
|
+ if(_this.accStatus == 2) {
|
|
|
+ vswitch = 'm'
|
|
|
+ } else if(_this.accStatus == 1) {
|
|
|
+ vswitch = 'v'
|
|
|
}
|
|
|
+ $.post("/publicapply/subscribe/setUserInfo", {pageType: "saveSeniorset", matchtype: keymateSelect.join(','), vSwitch: vswitch}, function (r) {
|
|
|
+ if (r.flag) {
|
|
|
+ var subVipState = sessionStorage.getItem('sub_vip_state');
|
|
|
+ var reqData = JSON.parse(subVipState);
|
|
|
+ _this.checkUpdateRenewShow()
|
|
|
+ _this.$emit('footershow', 'false')
|
|
|
+ _this.keymateSelectorShow = false
|
|
|
+ $('.match-way-value').text(_this.keymate.checked.join(','))
|
|
|
+ reqData.matchway = keymateSelect;
|
|
|
+ sessionStorage.setItem('sub_vip_state', JSON.stringify(reqData))
|
|
|
+ } else {
|
|
|
+ weui.toast('关键词匹配方式修改失败', {
|
|
|
+ duration: 1500,
|
|
|
+ className: 'jy-toast',
|
|
|
+ callback: function () {
|
|
|
+ console.log('close')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.getResultView()
|
|
|
},
|
|
|
// 项目匹配问号点击事件
|
|
|
projectNotice: function () {
|
|
@@ -1160,6 +1544,25 @@ var subComponent = {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // setUserInfo接口封装
|
|
|
+ saveUserInfoApi: function (params, callback) {
|
|
|
+ $.ajax({
|
|
|
+ type:'POST',
|
|
|
+ url: '/publicapply/subscribe/setUserInfo',
|
|
|
+ data: params,
|
|
|
+ success:function(res){
|
|
|
+ callback && callback(res)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 金额区间
|
|
|
+ openAmountDialog: function () {
|
|
|
+ if (this.vSwitch === 'f') {
|
|
|
+ location.href = '/jy_mobile/common/order/create/svip?type=buy'
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.amountSelectorShow = true
|
|
|
+ },
|
|
|
/***地区选择框相关end**/
|
|
|
// 打开信息类型
|
|
|
openInfoType: function (e) {
|