Преглед изворни кода

fix:消息列表接口参数修改

zhangsiya пре 2 година
родитељ
комит
abd54fb277

+ 37 - 29
src/web/staticres/frontRouter/pc/mesgCenter/js/index-pc.js

@@ -30,15 +30,16 @@ var vm = new Vue({
   },
   created() {
     this.getList()
-    this.kfContacts()
-    this.kfData()
+    // this.kfContacts()
+    // this.kfData()
   },
   methods: {
+    // 获取所有栏目列表数据(包括未读数量)
     getList (msgType) {
       var _this = this
       var type = msgType !== null && msgType !== undefined ? Number(msgType) : -1
       var params =  {
-        isColumn: true,
+        isColumn: type === -1,
         isColumnNewMsg: false,
         isMsgList: true,
         msgType: type,
@@ -58,7 +59,9 @@ var vm = new Vue({
             _this.loading = false
           }, 300)
            if(res.code === 0) {
-             _this.counts = res.column || []
+             if(_this.counts.length ===0 && res.column.length > 0){
+               _this.counts = res.column || []
+             }
              _this.tabsList.lists = []
              _this.tabsList.lasts = $.isEmptyObject(res.last) ? false : res.last
              _this.tabsList.lists = $.isEmptyObject(res.data) ? false : res.data
@@ -70,31 +73,31 @@ var vm = new Vue({
       })
     },
     // 私信显示、隐藏
-    kfContacts() {
-      const _this = this
-      $.post({
-        url: '/jyapi/social/obtainShunt',// 分流
-        type: 'POST',
-        data: JSON.stringify({type: 'PC', isFind: true}),
-        contentType: 'application/json',
-        success: function (res) {
-          _this.shuntData = res.data
-        }
-      })
-    },
+    // kfContacts() {
+    //   const _this = this
+    //   $.post({
+    //     url: '/jyapi/social/obtainShunt',// 分流
+    //     type: 'POST',
+    //     data: JSON.stringify({type: 'PC', isFind: true}),
+    //     contentType: 'application/json',
+    //     success: function (res) {
+    //       _this.shuntData = res.data
+    //     }
+    //   })
+    // },
     // 私信数量
-    kfData() {
-      const _this = this
-      $.ajax({
-        type: 'POST',
-        url: '/jyapi/message/messageCount',
-        data: JSON.stringify({userType: 2}),
-        contentType: 'application/json',
-        success: function (res) {
-          _this.kfCount = res.count
-        }
-      })
-    },
+    // kfData() {
+    //   const _this = this
+    //   $.ajax({
+    //     type: 'POST',
+    //     url: '/jyapi/message/messageCount',
+    //     data: JSON.stringify({userType: 2}),
+    //     contentType: 'application/json',
+    //     success: function (res) {
+    //       _this.kfCount = res.count
+    //     }
+    //   })
+    // },
     kfHref() {
       // 跳转到会话列表(不传userId右侧展示为缺省页)
       location.href = '/page_pc_social/customer?mini=1'
@@ -105,7 +108,12 @@ var vm = new Vue({
     },
     tabClick(val) {
       this.tabsList.offset = 1
-      this.getList(val.name)
+      if(val.name !== '999'){
+        this.getList(val.name)
+      } else {
+        this.kfHref()
+      }
+
     },
     onPageChange(page) {
       this.tabsList.offset = page

BIN
src/web/staticres/images/msgCenter/sjqb.png


+ 5 - 4
src/web/templates/common/pchead.html

@@ -163,11 +163,12 @@
     this.getMessageList = function () {
 
       var params =  {
-        isColumn: false,
+        isColumn: false, // 是否需要栏目(消息中心需要)
         isColumnNewMsg: false,
-        isMsgList: false,
-        msgType: -1,
-        isRead: 0,
+        isMsgList: false, // 是否需要列表数据
+        isContainLetter: false, // 是否包含私信数
+        msgType: -1, // 消息类型,-1为全部
+        isRead: 0, // 是否已读
         offset: 1,
         size: 0
       }