Browse Source

feat:订阅修改

tsz 3 năm trước cách đây
mục cha
commit
5d27a50de5

+ 1 - 1
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/set_scope2.js

@@ -508,7 +508,7 @@ var vNode = {
                 value: utils.unique(keysArr).join(' ')
             }
             $.ajax({
-                url: '/entnicheNew/custome/getRecomKWs',
+                url: '/entnicheNew/customer/getRecomKWs',
                 type: 'POST',
                 data: fetchData,
                 success: function (r) {

+ 1 - 0
src/jfw/modules/app/src/web/staticres/jyapp/js/historypush.js

@@ -461,6 +461,7 @@ var vm = new Vue({
               $(".switch_right").addClass('right_zj')
               $('.user_pro').css('color', '#171826')
               $(".switch .switch_icon").addClass('icon_ent')
+              _this.protype = 'entniche'
               _this.selectPro = 3
             }
             if(switchProduct == 'bigmember' && _this.rootInfo.isSubCount) {

+ 87 - 22
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/keyword-info.js

@@ -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) {

+ 62 - 3
src/jfw/modules/app/src/web/templates/big-member/page_client_follow_detail.html

@@ -146,7 +146,7 @@
                           <span class="getproit">查看画像</span>
                         </div>
                         <span class="columnLine"></span>
-                        <div class="claim" @click="claimBtn($event)">
+                        <div class="claim" @click="claimBtn($event, this)">
                           <span class="j-icon icon-add-claim"></span>
                           <span class="icon-claim-text" style="color:#2ABED1;font-size: .26rem;">认领客户</span>
                         </div>
@@ -353,10 +353,68 @@
             viewEntPort: function () {
               location.href='/jyapp/big/page/client_portrayal?from=client&entName=' + this.$data.prolist.buyer
             },
+            // 是否认领和关注企业
+            getActionState () {
+              let _this = this
+              const params = {
+                names: this.$data.prolist.buyer
+              }
+              $.ajax({
+                type: 'POST',
+                url: '/entnicheNew/customer/claimcheck',
+                contentType: 'application/json',
+                data: JSON.stringify(params),
+                success: function(res) {
+                  console.log(res)
+                  if(res.data.iscoll) {
+                    if(res.data.names.length > 0) {
+                      $('.icon-claim-text').text('已认领')
+                    } else {
+                      $('.icon-claim-text').text('认领')
+                    }
+                  }
+                }
+              })
+            },
             // 认领
-            claimBtn: function(e) {
+            claimBtn: function(e, that) {
               e.stopPropagation()
-              $('.icon-claim-text').text('已认领')
+              let claim = $('.icon-claim-text').text()
+              if(claim == '已认领') {
+                this.$toast('不支持在该页面进行退回')
+                return
+              }
+              let _this = this
+              let params = {
+                "name": this.$data.prolist.buyer, //采购单位名称
+                "province": this.$data.prolist.area, //省份
+                "city": this.$data.prolist.city, //区域
+                "mold": 1, //1 认领;默认 0关注
+                "D": false, //true 取关;默认 false 关注
+              }
+              $.ajax({
+                type: 'POST',
+                url: '/entnicheNew/customer/attention',
+                contentType: 'application/json',
+                data: JSON.stringify(params),
+                success: function(res) {
+                  console.log(res)
+                  if(res.error_code == 0) {
+                    if(res.data) {
+                      if(params.mold == 0) {
+                        _this.follow = !_this.follow
+                      } else {
+                        _this.$toast('认领成功')
+                        $('.icon-claim-text').text('已认领')
+                      }
+                    } else {
+                      _this.$toast(res.error_msg)
+                    }
+                    // this.getActionState(utils.getParam('entName'), 'g')
+                    // this.getActionState(utils.getParam('entName'), 'r')
+                  }
+                }
+              })
             },
             // 获取项目详情
             getProDetail: function () {
@@ -436,6 +494,7 @@
 
                                 }
                             }
+                            _this.getActionState()
                         } else {
                             _this.$toast(res.error_msg)
                             setTimeout(function () {

+ 4 - 2
src/jfw/modules/app/src/web/templates/big-member/page_client_follow_list.html

@@ -120,7 +120,7 @@
         <div class="j-container" v-if="!foShow">
             <div class="pro-care-many">
               <div class="pro-care-center">
-                可关注500个项目,已关注${list.length}个
+                可关注${followMax}个项目,已关注${list.length}个
               </div>
             </div>
             <van-search v-model="carePro" @input="onSearch" class="clientsearch" placeholder="搜索关注的项目"></van-search>
@@ -216,7 +216,8 @@
               { text: '未认领客户的项目', value: 2 },
             ],
             initArea: [],
-            carePro: ''
+            carePro: '',
+            followMax: 0
         },
         created () {
             var recover = this.recover()
@@ -466,6 +467,7 @@
                         // res.data.List.length = 0
                         if (res.error_code == 0){
                             // res.data.List = []
+                            _this.followMax = res.data.followMax
                             if(res.data && res.data.List && $.isArray(res.data.List) && res.data.List !=0){
                                 _this.foShow = false
 			                          var timestamp = parseInt(new Date().getTime()/ 1000);

+ 4 - 3
src/jfw/modules/app/src/web/templates/big-member/page_client_list.html

@@ -41,7 +41,7 @@
         <div class="j-container" v-if="!foShow">
             <div class="pro-care-many">
               <div class="pro-care-center">
-                可关注500个客户,已关注${list.length}个
+                可关注${countMax}个客户,已关注${list.length}个
               </div>
             </div>
             <div class="search">
@@ -262,8 +262,8 @@
             inputVal: '',
             active: 0,
             havaClaimList: [], // 已认领列表
-            noClaimList: [] // 未认领列表
-
+            noClaimList: [], // 未认领列表
+            countMax: 0
         },
         created () {
             var recover = this.recover()
@@ -461,6 +461,7 @@
                     },
                     success:function(res) {
                         if (res.error_code == 0){
+                            _this.countMax = res.data.countMax
                             if(res.data && res.data.list && $.isArray(res.data.list) && res.data.list !=0){
                                 _this.foShow = false
                                 let nameArr = []

+ 23 - 3
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -815,7 +815,7 @@
             setSessionStorage();
             sessionStorage.setItem(vm.sessStorageKey, JSON.stringify(vm.$data))
             if(historyVt == 's') {
-              location.href = '/page_entniche/page/sub_management/sub_management_system.html'
+              location.href = '/page_entniche/page/subsetting/sub_entrance.html'
               return
             }
             let thisType = sessionStorage.getItem('userIsNew')
@@ -997,7 +997,7 @@
                             }
                             return
                         } else {
-                            if(vm.rootInfo.memberStatus > 0) {
+                            if(vm.rootInfo.memberStatus > 0 || myInfo.userType == 'entniche') {
                                 $('.header_header').hide()
                             } else {
                                 $('.header_header').show()
@@ -1080,6 +1080,18 @@
             extend(1);
         }else{
             if(vm.rootInfo.memberStatus <= 0) {
+              if(myInfo.userType == 'entniche') {
+                $('.header_header').hide()
+                $(".switch").addClass('switch_zj')
+                $(".switch_right").hide()
+                $(".switch .switch_icon").addClass('icon_zj')
+                $(".switch .user_pro").text("商机管理").css('margin-right','.08rem')
+                $(".switch").show()
+                thisClass.InitPersonal(r);
+                $(".switch").click(toEntNichePage);
+                extend(1)
+                return
+              }
                 setTimeout(function(){
                     if (scrollTop==0 && r.haskey){
                         $(".header_header").show();
@@ -1097,7 +1109,7 @@
                     if (listString) {
                         $('.header_header').show()
                     }
-                }
+                } 
                 $(".app-content").css("justify-content","flex-start");
                 $(".switch").addClass("only-personal");
                 $(".switch .user_pro").text("立即使用 超级订阅");
@@ -1819,6 +1831,8 @@ function hasNoData() {
     if(switchProduct) {
         if(switchProduct == 'bigmember') {
             window.location.href = '/jyapp/vipsubscribe/toSetKeyWordPage?vSwitch=m';
+        } else if(switchProduct == 'entniche') {
+          window.location.href = '/page_entniche/page/subsetting/keyWord.html'
         } else {
             if (isInTSguide) {
                 window.location.href = '/jyapp/wxkeyset/keyset/index';
@@ -1863,6 +1877,12 @@ function hasNoData() {
       window.location.href = "/jyapp/vipsubscribe/introducePage";
   }
 
+  //我的企业列表
+  function toEntNichePage() {
+      setSessionStorage();
+      window.location.href = "/page_entniche/home";
+  }
+
   //vip设置
   function tosetpage() {
       setSessionStorage();

+ 1 - 1
src/jfw/modules/publicapply/src/db.json

@@ -1,7 +1,7 @@
 {
 	"mongodb": {
 		"main": {
-			"address": "192.168.3.206:27080",
+			"address": "192.168.3.128:27080",
 			"size": 5,
 			"dbName": "qfw",
 			"replSet": ""

+ 3 - 2
src/web/staticres/common-module/collection/js/area-city-mobile.js

@@ -1,7 +1,7 @@
 var areaCityMobileComponentTemplate = `
 <div class="select-area-city-container  j-container">
     <div class="unitTab j-main">
-        <van-tabs type="card" class="unitType">
+        <van-tabs type="card" class="unitType" v-model="active">
             <van-tab v-for="(item, index) in tablist" :key="index">
                 <template #title>
                     <div class="tabtitle">
@@ -77,7 +77,8 @@ var areaCityMobileComponent = {
         X: ['西藏', '新疆', '香港'],
         Y: ['云南'],
         Z: ['浙江']
-      }
+      },
+      active: 1
     }
   },
   created () {

+ 35 - 0
src/web/staticres/common-module/collection/js/keyword-mobile.js

@@ -140,6 +140,8 @@ var keywordComponent = {
       let url = '/subscribepay/afterPay/getUserInfo?t=' + Date.now()
       if(_this.protype == 'bigmember') {
         url = '/bigmember/use/info?t=' + Date.now()
+      } else if(_this.protype == 'entniche') {
+        url = '/entnicheNew/subscribe/key/get'
       }
       $.ajax({
         url: url,
@@ -186,6 +188,39 @@ var keywordComponent = {
                 _this.setState()
               }
             }
+          } else  if(_this.protype == 'entniche') {
+            if(res.error_code == 0) {
+              if(res.data.data && res.data.data.length !== 0) {
+                let maxarr = []
+                res.data.data.forEach(function(item) {
+                  let minarr = []
+                  let keyname = item.s_item
+                  let eachArr = item.a_key
+                  eachArr.forEach(function(data, i){
+                    var textArr = data.key
+                    if (Array.isArray(data.appendkey)) {
+                      textArr = data.key.concat(data.appendkey)
+                    }
+                    data = {
+                      name: data.key[0],
+                      text: textArr.join(' '), // 展示在页面上的文字
+                      notkey: data.notkey ? data.notkey.join(' ') : '',
+                      // matchWayText: item.matchway == 1 ? '模糊' : '精准',
+                      // matchWayClass: item.matchway == 1 ? 'tag-orange' : 'tag-green'
+                      matchway: data.matchway,
+                      type: false
+                    }
+                    minarr.push(data)
+                  })
+                  let obj = {
+                    [keyname]: minarr,
+                    type: false
+                  }
+                  maxarr.push(obj)
+                })
+                _this.tablist = maxarr
+              }
+            }
           } else {
             if(res && res.userData) {
               let maxarr = []

+ 1 - 1
src/web/staticres/common-module/keep-tags/keep-ent-tags-template.js

@@ -389,7 +389,7 @@ Vue.component('keep-component', {
     },
     ajaxGetAllTags () {
       this.isGetTagsLoading = true
-      this.ajaxFn('/entniche/customer/getLabel', {} , function (r) {
+      this.ajaxFn('/entnicheNew/customer/getLabel', {} , function (r) {
         this.isGetTagsLoading = false
         if (r && r.error_msg === '' && r.data) {
           this.tags = r.data.map(function (v) {