|
@@ -59,6 +59,8 @@ var vm = new Vue({
|
|
|
return '/bigmember/use/info'
|
|
|
} else if (this.vSwitch === 'v') {
|
|
|
return '/subscribepay/afterPay/getUserInfo'
|
|
|
+ } else if (this.vSwitch === 's') {
|
|
|
+ return '/entnicheNew/subscribe/key/get'
|
|
|
} else {
|
|
|
return '/publicapply/free/subscribe'
|
|
|
}
|
|
@@ -217,7 +219,7 @@ var vm = new Vue({
|
|
|
}
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
- url: this.getInfoUrl + '?t=' + Date.now(),
|
|
|
+ url: _this.getInfoUrl + '?t=' + Date.now(),
|
|
|
async: defaultOptions.async,
|
|
|
success: function (res) {
|
|
|
if (defaultOptions.needLoading) {
|
|
@@ -238,7 +240,15 @@ var vm = new Vue({
|
|
|
if (res.userData && res.userData.o_vipjy) {
|
|
|
kList = res.userData.o_vipjy.a_items || []
|
|
|
}
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ // else if (_this.vSwitch === 's') {
|
|
|
+ // _this.userData = res.data
|
|
|
+ // // 关键词赋值
|
|
|
+ // if (res.data && res.data.data) {
|
|
|
+ // kList = res.data.data || []
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ else {
|
|
|
// 免费用户
|
|
|
_this.conf.keywordMax = 10
|
|
|
_this.userData = res.data
|
|
@@ -260,6 +270,11 @@ var vm = new Vue({
|
|
|
}
|
|
|
|
|
|
if (kList.length) {
|
|
|
+ // if(this.vSwitch === 's') {
|
|
|
+
|
|
|
+ // } else {
|
|
|
+
|
|
|
+ // }
|
|
|
// 整理数据
|
|
|
var groupList = _this.addInfoToKeyItem(kList)
|
|
|
var groupNameList = _this.getGroupNameList(groupList)
|
|
@@ -557,33 +572,79 @@ var vm = new Vue({
|
|
|
}
|
|
|
|
|
|
var loading = this.showLoading()
|
|
|
-
|
|
|
+ var upUrl = '/publicapply/subscribe/setUserInfo'
|
|
|
+ // if(this.vSwitch == 's') {
|
|
|
+ // console.log(this.userData)
|
|
|
+ // this.userData.data.map((item) => {
|
|
|
+ // console.log(item)
|
|
|
+ // if(item.groupIndex == utils.getParam('gIndex')) {
|
|
|
+ // console.log(_this.keyInfo.key.trim().replace(/\s+/g, ' '))
|
|
|
+ // var keylist = _this.keyInfo.key.trim().replace(/\s+/g, ' ')
|
|
|
+ // if(keylist) {
|
|
|
+ // keylist = _this.keyInfo.key.trim().replace(/\s+/g, ' ').split(' ')
|
|
|
+ // for(var i=0;i<keylist.length;i++){
|
|
|
+ // if (keylist[i]==keylist[i+1]){
|
|
|
+ // _this.showDialog({
|
|
|
+ // title: '',
|
|
|
+ // message: '该组关键词已存在,请勿重复添加',
|
|
|
+ // className: 'j-confirm-dialog text-center',
|
|
|
+ // showConfirmButton: true,
|
|
|
+ // showCancelButton: false,
|
|
|
+ // confirmButtonText: '我知道了'
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // item.a_key[0].key[0] = _this.keyInfo.key.trim().replace(/\s+/g, ' ')
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // params = {
|
|
|
+ // a_items: this.userData.data
|
|
|
+ // }
|
|
|
+ // params = JSON.stringify(params)
|
|
|
+ // upUrl = '/entnicheNew/subscribe/key/update'
|
|
|
+ // }
|
|
|
$.ajax({
|
|
|
- url: '/publicapply/subscribe/setUserInfo',
|
|
|
+ url: upUrl,
|
|
|
type: 'POST',
|
|
|
traditional: true,
|
|
|
+ // contentType: 'application/json',
|
|
|
data: params,
|
|
|
success: function (res) {
|
|
|
loading && loading.clear()
|
|
|
- if (res.flag) {
|
|
|
- _this.showToast('保存成功')
|
|
|
- setTimeout(function () {
|
|
|
- history.back()
|
|
|
- }, 1500)
|
|
|
- } else {
|
|
|
- if (res.msg.indexOf('存在') !== -1) {
|
|
|
- _this.showDialog({
|
|
|
- title: '',
|
|
|
- message: '该组关键词已存在,请勿重复添加',
|
|
|
- className: 'j-confirm-dialog text-center',
|
|
|
- showConfirmButton: true,
|
|
|
- showCancelButton: false,
|
|
|
- confirmButtonText: '我知道了'
|
|
|
- })
|
|
|
+ // if(_this.vSwitch == 's') {
|
|
|
+ // if(res.error_code === 0) {
|
|
|
+ // if(res.data.status == 1) {
|
|
|
+ // _this.showToast('保存成功')
|
|
|
+ // setTimeout(function () {
|
|
|
+ // history.back()
|
|
|
+ // }, 1500)
|
|
|
+ // } else {
|
|
|
+
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ if (res.flag) {
|
|
|
+ _this.showToast('保存成功')
|
|
|
+ setTimeout(function () {
|
|
|
+ history.back()
|
|
|
+ }, 1500)
|
|
|
} else {
|
|
|
- _this.showToast(res.msg ? res.msg : '保存失败')
|
|
|
+ if (res.msg.indexOf('存在') !== -1) {
|
|
|
+ _this.showDialog({
|
|
|
+ title: '',
|
|
|
+ message: '该组关键词已存在,请勿重复添加',
|
|
|
+ className: 'j-confirm-dialog text-center',
|
|
|
+ showConfirmButton: true,
|
|
|
+ showCancelButton: false,
|
|
|
+ confirmButtonText: '我知道了'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ _this.showToast(res.msg ? res.msg : '保存失败')
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ // }
|
|
|
},
|
|
|
error: function () {
|
|
|
loading && loading.clear()
|
|
@@ -646,8 +707,12 @@ var vm = new Vue({
|
|
|
count: 20, // 最少需要多少条数据
|
|
|
value: utils.unique(keysArr).join(' ')
|
|
|
}
|
|
|
+ var kurl = '/jyapp/member/getRecomKWs'
|
|
|
+ // if(this.vSwitch == 's') {
|
|
|
+ // kurl = '/entnicheNew/customer/getRecomKWs'
|
|
|
+ // }
|
|
|
$.ajax({
|
|
|
- url: '/jyapp/member/getRecomKWs',
|
|
|
+ url: kurl,
|
|
|
type: 'POST',
|
|
|
data: fetchData,
|
|
|
success: function (r) {
|