Эх сурвалжийг харах

Merge branch 'master' into feature/v4.7.59

lianbingjie 2 жил өмнө
parent
commit
dc6942904a

+ 1 - 1
src/jfw/modules/app/src/web/templates/frontRouter/messageCenter/sess/index.html

@@ -57,7 +57,7 @@
                       <span>{imgSrcs[ite.type - 1].title}</span>
                       <span v-if="ite.newMsg">{dateMatter(ite.newMsg.createtime, 'out')}</span>
                   </div>
-                  <p class="p3" v-if="ite.newMsg">{ite.newMsg.content}</p>
+                  <p class="p3" v-if="ite.newMsg">{ite.newMsg.title}</p>
               </div>
             </div>
           </div>

+ 18 - 11
src/web/staticres/common-module/messageCenter/js/detail.js

@@ -64,7 +64,7 @@ var vm = new Vue({
           // try {
           //   JyObj.refreshAppointTab('search', 1)
           // } catch (error) {
-          //   console.log(error) 
+          //   console.log(error)
           // }
         }
       })
@@ -124,7 +124,7 @@ var vm = new Vue({
             } else {
               _this.tabsList.finished = true
             }
-    
+
             // _this.tabsList.loading = false
             if (_this.tabsList.total !== -1 && _this.tabsList.total <= _this.lists.length) {
               _this.tabsList.finished = true
@@ -145,19 +145,26 @@ var vm = new Vue({
           return
         }
       } else {
-        if (appType == 'android') {
-          if (url.androidUrl) {
-            location.href = url.androidUrl
-          } else {
-            return
+        let toLink = appType == 'android' ? url.androidUrl : url.iosUrl
+        if (toLink) {
+          if (toLink[0] !== '/') {
+            toLink = '/' + toLink
           }
-        } else {
-          if (url.iosUrl) {
-            location.href = url.iosUrl
+          // 检查是否 tabbar 页面
+          const tabbarKey = utils.checkNowInAppTabbarPage(toLink)
+          if (tabbarKey) {
+            try {
+              // 刷新对应 tabbar 并切换
+              JyObj.refreshAppointTab(tabbarKey,1)
+              JyObj.skipAppointTab(tabbarKey)
+            } catch (e) {
+              console.warn(e)
+            }
           } else {
-            return
+            location.href = toLink
           }
         }
+        return
       }
     }
   }

+ 26 - 14
src/web/staticres/common-module/messageCenter/js/index.js

@@ -108,7 +108,7 @@ var vm = new Vue({
               //链接中如果是www.jianyu360.cn域名,微信中会唤起app,该用window.open
               window.open(url)
             } else {
-              location.href = url
+              _this.goLinkAndCheckTabbar(url)
             }
           }
         }
@@ -134,6 +134,22 @@ var vm = new Vue({
         success:function () {}
       })
     },
+    // 检查 tabbar 跳转
+    goLinkAndCheckTabbar (toLink) {
+      // 检查是否 tabbar 页面
+      const tabbarKey = utils.checkNowInAppTabbarPage(toLink)
+      if (tabbarKey) {
+        try {
+          // 刷新对应 tabbar 并切换
+          JyObj.refreshAppointTab(tabbarKey,1)
+          JyObj.skipAppointTab(tabbarKey)
+        } catch (e) {
+          console.warn(e)
+        }
+      } else {
+        location.href = toLink
+      }
+    },
     // 置顶消息跳转
     msgClick(url, num, ids, type, logid) {
       this.clickMesg(logid)
@@ -150,23 +166,19 @@ var vm = new Vue({
           }
         }
       } else {
-        if (appType == 'android') {
-          if (!num) {
-            this.topRead(ids, url.androidUrl, type, wxType)
-          } else {
-            if (url.androidUrl) {
-              location.href = url.androidUrl
-            }
+
+        let toLink = appType == 'android' ? url.androidUrl : url.iosUrl
+        if (toLink) {
+          if (toLink[0] !== '/') {
+            toLink = '/' + toLink
           }
-        } else {
           if (!num) {
-            this.topRead(ids, url.iosUrl, type, wxType)
-          } else {
-            if (url.iosUrl) {
-              location.href = url.iosUrl
-            }
+            this.topRead(ids, toLink, type, wxType)
+            return
           }
+          this.goLinkAndCheckTabbar(toLink)
         }
+        return
       }
     },
     // 置顶消息展开,收起

+ 28 - 1
src/web/staticres/common-module/public/js/utils.js

@@ -94,12 +94,13 @@ var versionChangeLog = {
   '0.0.1': ['init'],
   '0.0.2': ['utils.dateFromNow 函数逻辑修改,具体修改内容查看函数注释'],
   '0.0.3': ['utils.formatMoney 新增不使用,分割返回值的选项'],
+  '0.0.4': ['utils.checkNowInAppTabbarPage 判断是否app tabbar 页面,返回对应的key'],
 }
 
 
 var utils = {
   // utils版本号
-  version: '0.0.3',
+  version: '0.0.4',
   isWeiXinBrowser: navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1,
   isAndroid: navigator.userAgent.toLowerCase().indexOf('android') !== -1,
   isIos: /iphone|ipod|ipad|ios/.test(navigator.userAgent.toLowerCase()),
@@ -768,5 +769,31 @@ var utils = {
         },delay);
       }
     }
+  },
+  /**
+   * 检查是否 app tabbar页面,并返回对应的key || ''
+   * @param link - 需要检查的地址 || location.href
+   * @returns {string} - 对应的key
+   */
+  checkNowInAppTabbarPage: function (link) {
+    const appTabbars = {
+      search: ['/jyapp/jylab/mainSearch', '/jy_mobile/tabbar/home'],
+      subscribe: ['/jyapp/swordfish/historypush', '/jy_mobile/tabbar/subscribe'],
+      message: ['/jyapp/frontPage/messageCenter/sess/index'],
+      box: ['/jyapp/jylab/index', '/jy_mobile/tabbar/box'],
+      me: ['/jyapp/free/me']
+    }
+
+    let appTabbarName = ''
+    for (const appTabbarsKey in appTabbars) {
+      const hasTabbar = appTabbars[appTabbarsKey].some(function (v) {
+        return (link || location.href).indexOf(v) > -1
+      })
+      if (hasTabbar) {
+        appTabbarName = appTabbarsKey
+        break
+      }
+    }
+    return appTabbarName
   }
 }

+ 6 - 4
src/web/staticres/css/pc.css

@@ -1948,6 +1948,7 @@ form{
 }
 .jy_friendlink_title{
 	margin-right: 40px;
+  word-break: keep-all;
 }
 .jy_friendlink_content ul li img{
 	height: 28px;
@@ -2023,7 +2024,7 @@ form{
 	padding-left: 25px;
 	background: url(/images/pc/phone-grey.png) no-repeat left center;
 	background-size: 20px;
-	margin-left: 26px;
+	margin-left: 20px;
 }
 .jy_classify_list ul{
 	margin-top: 26px;
@@ -2137,7 +2138,7 @@ form{
 	 height: 40px;
 	 line-height: 40px;
 	 background: #000;
-
+   box-sizing: content-box;
 }
 .jy_renzheng div a{
   display: inline-block;
@@ -2172,9 +2173,10 @@ form{
     margin-bottom: 10px;
 }
 .j-bottom{
-	height:438px;
+	/*height:438px;*/
 	line-height:22px;
 	position: relative;
+  padding-bottom: 65px;
 }
 .userstatus{
 	position: absolute;
@@ -5140,4 +5142,4 @@ h6 {
 
 .login-dig-footer-box p.passTip{
   margin-top: 100px;
-}
+}

+ 1 - 1
src/web/templates/frontRouter/wx/messageCenter/sess/index.html

@@ -65,7 +65,7 @@
                       <span>{imgSrcs[ite.type - 1].title}</span>
                       <span v-if="ite.newMsg">{dateMatter(ite.newMsg.createtime, 'out')}</span>
                   </div>
-                  <p class="p3" v-if="ite.newMsg">{ite.newMsg.content}</p>
+                  <p class="p3" v-if="ite.newMsg">{ite.newMsg.title}</p>
               </div>
             </div>
           </div>

+ 16 - 0
src/web/templates/pc/index.html

@@ -680,6 +680,7 @@
           if (window.memberStatus > 0) {
             // 首页底部广告位隐藏
             $('.pc-index-bottom').hide()
+            fixBottomADHeight(false)
           } else {
             var top1 = 0;
             var top2 = 0;
@@ -856,6 +857,21 @@
   // console.log({{$bottom}})
   var bottom_img = ({{$bottom}})
 
+  // 首页底部样式调整,适配广告位
+  function fixBottomADHeight (type) {
+    var adHeight = $('.pc-index-bottom').height()
+    if (type) {
+      $(".jy_renzheng").css('padding-bottom', adHeight)
+      $(".j-bottom").attr('data-padding-bottom', Number($(".j-bottom").css('padding-bottom').replace('px', '')))
+      $(".j-bottom").css('padding-bottom', Number($(".j-bottom").css('padding-bottom').replace('px', '')) + adHeight)
+    } else {
+      $(".jy_renzheng").css('padding-bottom', 0)
+      $(".j-bottom").css('padding-bottom', Number($(".j-bottom").attr('data-padding-bottom')))
+    }
+  }
+  $('.pc-index-bottom .bottom-member-ad').on('load', function () {
+    fixBottomADHeight(true)
+  })
   $('.pc-index-bottom .bottom-member-ad').attr('src', bottom_img[0].s_pic)
   $('.pc-index-bottom .bottom-member-ad').unbind('click').click(function () {
     window.open(bottom_img[0].s_link)