浏览代码

fix:画像优化数据导出请求地址及跳转更改。移动端画像筛选更改

wangkaiyue 3 年之前
父节点
当前提交
bdfa5c4dee

+ 9 - 10
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/ent_portrait.js

@@ -169,9 +169,6 @@ var vNode = {
       sessionStorage.removeItem('winner_high_eid')
       sessionStorage.removeItem('is-click-set')
     }
-    setTimeout(()=>{
-      this.getIsSc()
-    },1000)
   },
   mounted: function () {
     var _this = this
@@ -509,19 +506,17 @@ var vNode = {
         pageNum: 1,
         pageSize: this.topProject.pageSize
       }
-      var reqSign = url.indexOf('subVipPortrait') === -1 ? 'bigmember' : 'svip'
+      let requestUrl = '/bigmember/portrait/winner/winnerNewMsgExport'
+      if (_this.powerInfo.memberStatus<=0){
+        requestUrl = '/bigmember/portrait/subVipPortrait/winnerNewMsgExport'
+      }
       $.ajax({
         type:'POST',
-        url: '/bigmember/portrait/' + (reqSign === 'svip' ? 'subVipPortrait' : 'winner') + '/winnerNewMsgExport',
+        url: requestUrl,
         data: storageSet ? Object.assign(data, storageSet) : data,
         timeout: 8000,
         success:function(res) {
           window.location.href = "/jyapp/front/dataExport/toCreateOrderPage?id=" + res.data
-          // /jyapp/front/dataExport/toCreateOrderPage
-          // if(res.error_code == 0) {
-          // } else {
-          //     console.log(res.error_code)
-          // }
         },
         error:function(err) {
           console.log(err)
@@ -619,6 +614,10 @@ var vNode = {
               _this.topProject.list.forEach((val)=>{
                 _this.list.push(val.id)
               })
+              //查询是否收藏
+              if(_this.list.length>0){
+                _this.getIsSc()
+              }
             }
           } else {
             _this.$toast(res.error_msg)

文件差异内容过多而无法显示
+ 1585 - 1568
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/unit_portrayal.js


+ 5 - 1
src/web/staticres/common-module/big-member/js/buyer_project_news.js

@@ -170,9 +170,13 @@ var vConfig = {
             buyer: decodeURIComponent(utils.getParam('entName')),
             pageNum: 1
           }
+          let requestUrl = '/bigmember/portrait/buyer/getNewMsgExport'
+          if (this.info.bigStatus<=0){
+            requestUrl = '/bigmember/subVipPortrait/buyer/getNewMsgExport'
+          }
           $.ajax({
             type:'POST',
-            url: '/bigmember/portrait/buyer/getNewMsgExport' ,
+            url: requestUrl ,
             data: storageSet ? Object.assign(data, storageSet) : data,
             timeout: 8000,
             success:function(res) {

+ 2 - 1
src/web/staticres/common-module/big-member/js/ent_project_news.js

@@ -269,7 +269,8 @@ var vConfig = {
             data: storageSet ? Object.assign(data, storageSet) : data,
             timeout: 8000,
             success:function(res) {
-              window.location.href = "/jyapp/front/dataExport/toCreateOrderPage?id=" + res.data
+              var isWeiXinBrowser = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
+              window.location.href = (isWeiXinBrowser ? '/front/wx_dataExport/submitOrder' : '/jyapp/front/dataExport/toCreateOrderPage') + "?id=" + res.data
             },
             error:function(err) {
               console.log(err)

+ 63 - 67
src/web/staticres/common-module/big-member/js/high_set.js

@@ -42,7 +42,7 @@ var highSet = new Vue({
     dateComponent: dateComponent,
     yearsComponent: yearsComponent
   },
-  data () {
+  data() {
     return {
       conf: {
         keywords: '',
@@ -74,12 +74,12 @@ var highSet = new Vue({
       startRange: [],
       endRange: [],
       bigStatus: 0,
-      power:[]
+      power: []
     }
   },
   watch: {
     // 监听初始时间 如果结束时间小于初始时间 则两个调换位置
-    'conf.start': function(newVal) {
+    'conf.start': function (newVal) {
       // console.log(this.conf.end, newVal)
       if (this.conf.end < newVal) {
         this.conf.start = this.conf.end
@@ -105,31 +105,27 @@ var highSet = new Vue({
       var end = this.conf.end
       return !(key || scope || area || industry || start || end)
     },
-    hasSpace () {
+    hasSpace() {
       var key = this.conf.keywords
-      return key && key.replace(/^\s\s*/,'').indexOf(' ') > -1
+      return key && key.replace(/^\s\s*/, '').indexOf(' ') > -1
     },
     filterInfoUrl: function () {
-      var path = ''
-      if (this.entInfo.eid) {
-        path = 'winner/selects'
-      } else if (this.entInfo.entName) {
-        path = 'buyer/selects'
-      }
       var urlMap = {
-          bigmember: '/bigmember/portrait/' + path, // 大会员
-          svip: '/bigmember/subVipPortrait/' + path // 超级订阅
+        'isMember': {
+          'winner': '/portrait/winner/selects',
+          'buyer': '/portrait/buyer/selects'
+        },
+        'isNotMember': {
+          'winner': '/portrait/subVipPortrait/selects',
+          'buyer': '/subVipPortrait/buyer/selects'
+        }
       }
-      console.log(this.bigStatus, this.power)
-      var isMember = this.bigStatus > 0 && this.power.indexOf(5) > -1
-      var url = isMember ? urlMap.bigmember : urlMap.svip
-      // if (urlMap[this.reqSign]) {
-      //     url = urlMap[this.reqSign]
-      // }
-      return url
+      var isMember = this.bigStatus > 0 && this.power.indexOf(5) > -1 ? 'isMember' : 'isNotMember'
+      let isWinner = this.entInfo.eid !== '' ? 'winner' : 'buyer'
+      return '/bigmember' + urlMap[isMember][isWinner]
     }
   },
-  created () {
+  created() {
     var eid = utils.getParam('eid')
     var reqSign = utils.getParam('reqSign')
     var entName = decodeURIComponent(utils.getParam('entName'))
@@ -152,10 +148,10 @@ var highSet = new Vue({
     }
     this.getUserInfo()
   },
-  mounted () {
+  mounted() {
     var header = decodeURIComponent(utils.getParam('header'))
     this.setHeaderTitle(header)
-    
+
     if (this.conf.area == '全国') {
       $('.area-class .van-cell__value span').html('全部')
     } else {
@@ -164,10 +160,10 @@ var highSet = new Vue({
   },
   methods: {
     // 设置title
-    setHeaderTitle: function setHeaderTitle (header) {
+    setHeaderTitle: function setHeaderTitle(header) {
       document.title = header || document.title
     },
-    getUserInfo: function() {
+    getUserInfo: function () {
       var _this = this
       $.ajax({
         type: 'POST',
@@ -184,16 +180,16 @@ var highSet = new Vue({
         error: function (error) {
           console.log(error)
         }
-    })
+      })
     },
     // 将缓存中的项目搜索范围英文字段转换为中文用于在输入框展示
-    formatterLabel: function(data) {
+    formatterLabel: function (data) {
       var arr = []
       var list = this.matchTypeList
       var sArr = data.split(',')
-      list.forEach(function(item){
-        sArr.forEach(function(v){
-          if(item.value == v) {
+      list.forEach(function (item) {
+        sArr.forEach(function (v) {
+          if (item.value == v) {
             arr.push(item.label)
           }
         })
@@ -219,7 +215,7 @@ var highSet = new Vue({
       var endYear = new Date().getFullYear()
       var startYear = endYear - 4
       var years = []
-      for(var i = startYear ; i <= endYear; i ++) {
+      for (var i = startYear; i <= endYear; i++) {
         years.push(i + '年')
       }
       return years
@@ -234,15 +230,15 @@ var highSet = new Vue({
           return v.replace('年', '') >= start.replace('年', '')
         })
       } else {
-        endArr =years
+        endArr = years
       }
       return endArr
     },
     showToast: function (message) {
       this.$toast({
-          duration: 1500,
-          forbidClick: true,
-          message: message,
+        duration: 1500,
+        forbidClick: true,
+        message: message,
       })
     },
     showLoading: function () {
@@ -254,7 +250,7 @@ var highSet = new Vue({
       return loading
     },
     // 获取筛选条件
-    getFilterApi () {
+    getFilterApi() {
       var _this = this
       var loading = this.showLoading()
       var data = this.entInfo.eid ? {
@@ -263,23 +259,23 @@ var highSet = new Vue({
         buyer: _this.entInfo.entName
       }
       $.ajax({
-          type: 'POST',
-          url: this.filterInfoUrl,
-          data: data,
-          success: function (res) {
-            if (res.error_code == 0) {
-              loading.clear()
-              _this.filterInitData.areaArr = res.data.areaArr || []
-              _this.filterInitData.scopeArr = res.data.scopeArr || []
-              // _this.initSelector(res.data)
-            } else {
-              _this.showToast(res.error_msg)
-            }
-          },
-          error: function (error) {
+        type: 'POST',
+        url: this.filterInfoUrl,
+        data: data,
+        success: function (res) {
+          if (res.error_code == 0) {
             loading.clear()
-            console.log(error)
+            _this.filterInitData.areaArr = res.data.areaArr || []
+            _this.filterInitData.scopeArr = res.data.scopeArr || []
+            // _this.initSelector(res.data)
+          } else {
+            _this.showToast(res.error_msg)
           }
+        },
+        error: function (error) {
+          loading.clear()
+          console.log(error)
+        }
       })
     },
     // 选择器
@@ -315,7 +311,7 @@ var highSet = new Vue({
     },
     initSelector: function (data) {
       var _this = this
-      this.$nextTick(function() {
+      this.$nextTick(function () {
         switch (_this.popInfo.type) {
           case 'scope':
             _this.initMatchTypeSelector()
@@ -362,8 +358,8 @@ var highSet = new Vue({
       }
       this.$refs.projectAreaSelector.arrangeListMap(map)
       this.$refs.projectAreaSelector.setState(this.selectAreaList)
-      $('.area-card-item').each(function(){
-        if($(this).html() == '全国') {
+      $('.area-card-item').each(function () {
+        if ($(this).html() == '全国') {
           $(this).html('全部')
         }
       })
@@ -371,7 +367,7 @@ var highSet = new Vue({
     // 过滤行业数据
     initProjectIndustrySelector: function (data) {
       var arr = []
-      data.forEach(function(s) {
+      data.forEach(function (s) {
         var key = s.substring(0, s.indexOf('_'))
         var value = s.substring(s.indexOf('_') + 1)
         arr.push({
@@ -380,8 +376,8 @@ var highSet = new Vue({
         })
       })
       var newArr = []
-      arr.forEach(function(item, index) {
-        let newItem = newArr.find(function(i) {
+      arr.forEach(function (item, index) {
+        let newItem = newArr.find(function (i) {
           return i.name == item.name
         })
         if (!newItem) {
@@ -394,7 +390,7 @@ var highSet = new Vue({
         }
       })
       var resArr = []
-      newArr.forEach(function(s) {
+      newArr.forEach(function (s) {
         var obj = {}
         obj[s.name] = s.value
         resArr.push(obj)
@@ -410,7 +406,7 @@ var highSet = new Vue({
     },
     onKeywords: function (val) {
       // 过滤首个空格
-      this.conf.keywords = val.replace(/^\s\s*/,'').replace(/(\r\n)|(\n)/g, '')
+      this.conf.keywords = val.replace(/^\s\s*/, '').replace(/(\r\n)|(\n)/g, '')
     },
     onCancel: function (data) {
       if (!data) {
@@ -422,7 +418,7 @@ var highSet = new Vue({
         this.$refs.industryCom.setState([])
         this.$refs.industryCom.canClick = false
       } else if (data.name == 'dateItem') {
-        
+
       }
     },
     onConfirm: function (data) {
@@ -439,7 +435,7 @@ var highSet = new Vue({
         if (data.data.length === 0) {
           this.conf.scope = ''
         } else {
-          this.conf.scope = data.checkedList.map(function(v) {
+          this.conf.scope = data.checkedList.map(function (v) {
             return v.label
           }).join(',')
           this.selectScopeList = data.data
@@ -463,18 +459,18 @@ var highSet = new Vue({
       }
       this.setToggle()
     },
-    setToggle: function() {
+    setToggle: function () {
       this.popInfo.show = false
     },
     // 开始分析
-    startStatistic: function() {
+    startStatistic: function () {
       var conf = this.conf
       var list = this.matchTypeList
       var arr = []
       var sArr = conf.scope.split(',')
-      list.forEach(function(item){
-        sArr.forEach(function(v){
-          if(item.label == v) {
+      list.forEach(function (item) {
+        sArr.forEach(function (v) {
+          if (item.label == v) {
             arr.push(item.value)
           }
         })
@@ -511,4 +507,4 @@ var highSet = new Vue({
       this.selectScopeList = ['purchasing']
     }
   }
-})
+})

+ 9 - 10
src/web/staticres/common-module/collection/js/ent_portrait.js

@@ -166,9 +166,6 @@ var vNode = {
       sessionStorage.removeItem('winner_high_eid')
       sessionStorage.removeItem('is-click-set')
     }
-    setTimeout(()=>{
-      this.getIsSc()
-    },1000)
   },
   mounted: function () {
     var _this = this
@@ -527,20 +524,18 @@ var vNode = {
         pageNum: 1,
         pageSize: this.topProject.pageSize
       }
-      var reqSign = url.indexOf('subVipPortrait') === -1 ? 'bigmember' : 'svip'
+      let requestUrl = '/bigmember/portrait/winner/winnerNewMsgExport'
+      if (_this.powerInfo.memberStatus<=0){
+        requestUrl = '/bigmember/portrait/subVipPortrait/winnerNewMsgExport'
+      }
       $.ajax({
         type:'POST',
-        url: '/bigmember/portrait/' + (reqSign === 'svip' ? 'subVipPortrait' : 'winner') + '/winnerNewMsgExport',
+        url: requestUrl,
         data: storageSet ? Object.assign(data, storageSet) : data,
         timeout: 8000,
         success:function(res) {
           var isWeiXinBrowser = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
           window.location.href = (isWeiXinBrowser ? '/front/wx_dataExport/submitOrder' : '/jyapp/front/dataExport/toCreateOrderPage') + "?id=" + res.data
-          // /jyapp/front/dataExport/toCreateOrderPage
-          // if(res.error_code == 0) {
-          // } else {
-          //     console.log(res.error_code)
-          // }
         },
         error:function(err) {
           console.log(err)
@@ -614,6 +609,10 @@ var vNode = {
               _this.topProject.list.forEach((val)=>{
                 _this.list.push(val.id)
               })
+              //查询是否收藏
+              if(_this.list.length>0){
+                _this.getIsSc()
+              }
             }
           } else {
             _this.$toast(res.error_msg)

部分文件因为文件数量过多而无法显示