Pārlūkot izejas kodu

feat:首页未读消息滚动时间间隔获取处理

zhangsiya 2 gadi atpakaļ
vecāks
revīzija
06ee20ede3

+ 4 - 1
src/web/staticres/js/pc-message-new.js

@@ -7,7 +7,9 @@ var vmMesg = new Vue({
       imgArrs:  ['quanbu', 'huodong', 'fuwu', 'dingyue', 'xiangmu', 'qiye', 'fenxi', 'xitong'],
       lists: [],
       timer: null,
-      totalNum: 0
+      totalNum: 0,
+      // 轮播时间间隔
+      rollingTiming: 10000,
     }
   },
   computed: {
@@ -37,6 +39,7 @@ var vmMesg = new Vue({
           if (res.data) {
             var resList = res.data || []
             _this.totalNum = res.unread || 0
+            _this.rollingTiming = res.rollingTiming ?  res.rollingTiming * 1000 : 10000
             resList.forEach(function(v) {
               v.msg_type_text = _this.msgType(v.msg_type)
               v.createtime = dateTime(v.createtime, 'hh:mm')

+ 1 - 1
src/web/templates/pc/index.html

@@ -76,7 +76,7 @@
         <div id="vue-message-index-pc" v-cloak>
             <div class="list-msg" v-if="lists.length > 0">
                 <div class="no-read-count" v-if="totalNum > 0">${totalNum > 99 ? '99+' : totalNum }条未读</div>
-                <el-carousel :interval="10000" arrow="never" :autoplay="lists.length > 1" indicator-position="none">
+                <el-carousel :interval="rollingTiming" arrow="never" :autoplay="lists.length > 1" indicator-position="none">
                     <el-carousel-item class="l-msg" v-for="(tempList, index) in lists" :key="'msg_' + index">
                         <div class="words" v-for="item in tempList" :key="item.id">
                             <img class="icon_voice" src="/images/pc/icon_voice.png"  />