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

feat:搜索详情页未登录状态页面展示、
h5环境下登录注册问题修改、我的页面添加底部导航

tsz пре 2 година
родитељ
комит
6ee57c9c89

+ 9 - 1
src/jfw/modules/app/src/web/staticres/jyapp/css/wxinfocontent.css

@@ -103,7 +103,7 @@ pre {
 
 .content {
     line-height: 18px;
-    padding: 5px 10px 25px 10px;
+    padding: 5px 10px 10px 10px;
 }
 
 .abs {
@@ -1336,4 +1336,12 @@ ul {
   margin-right: 4px;
   width: 18px;
   height: 18px;
+}
+.login-guide{
+  width: 100%;
+  height: 1.44rem;
+}
+.login-guide img {
+  width: 100%;
+  height: 100%;
 }

BIN
src/jfw/modules/app/src/web/staticres/jyapp/images/adbottom.png


+ 3 - 0
src/jfw/modules/app/src/web/staticres/jyapp/me/css/mine.css

@@ -198,6 +198,9 @@
 .list {
     padding: 0 .32rem 0.32rem;
 }
+.list.show-tabbar{
+  padding: 0 .32rem 1.32rem;
+}
 
 .list .menu {
     margin-top: .2rem;

+ 17 - 1
src/jfw/modules/app/src/web/staticres/jyapp/me/js/mine.js

@@ -4,7 +4,8 @@ var mine = {
     powerInfo: {},
     init: function () {
         this.iosBackInvoke()
-
+        // 判断当前环境,显示/隐藏底部导航
+        this.getPlatform()
         // 设置用户头像
         this.setUserImg()
         this.getUserInfo()
@@ -45,6 +46,15 @@ var mine = {
             isPageHide = true;
         });
     },
+    getPlatform: function () {
+      if (utils.$envs.inH5) {
+        $('.j-body .list').addClass('show-tabbar')
+        $('#tabMesg').show()
+      } else {
+        $('.j-body .list').removeClass('show-tabbar')
+        $('#tabMesg').hide()
+      }
+    },
     getEntNicheRoot: function() {
       var _this = this
       $.ajax({
@@ -233,11 +243,17 @@ var mine = {
         $(".trigger-div-notice").on('click', function () {
             setLiActive(this);
             autoLogin('/jyapp/free/notice');
+            if(utils.$envs.inH5) {
+              location.href = '/jyapp/free/notice'
+            }
         });
         // 设置
         $(".trigger-div-setting").click(function () {
             setLiActive(this);
             autoLogin('/jyapp/free/set');
+            if(utils.$envs.inH5) {
+              location.href = '/jyapp/free/set'
+            }
         });
         // 安全退出
         $('.safe-quit').click(function () {

+ 3 - 1
src/jfw/modules/app/src/web/templates/me/login.html

@@ -186,6 +186,7 @@
     </div>
   </div>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/ad/js/index.js?v={{Msg "seo" "version"}}'></script>
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/js/utils.js?v={{Msg "seo" "version"}}'></script>
   <script>
     var Activedatastring = `register`
     var ActivedataType = `jy-app-${Activedatastring}-login`
@@ -210,8 +211,9 @@
     var disWord = getParam("disWord");
     var hideNum = 0
     var timer = null
+    var platform = utils.$envs
     // s-- h5状态下隐藏微信登录 --s
-    if (inment_H5) {
+    if (platform.inH5) {
       $('.wx').hide()
     }
     // e-- h5状态下隐藏微信登录 -- e

+ 3 - 0
src/jfw/modules/app/src/web/templates/me/mine.html

@@ -305,6 +305,9 @@
       </div>
       <!--E 功能搬家提醒弹窗-->
     </div>
+    <!-- 底部导航 -->
+    {{include "/weixin/tabbar.html"}}
+    <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/js/utils.js'></script>
     <script src='https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js'></script>
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/weui.min.js'></script>
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/fastclick.min.js'></script>

+ 29 - 3
src/jfw/modules/app/src/web/templates/me/setpwd.html

@@ -9,7 +9,8 @@
 		<link rel="stylesheet" type="text/css" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/me/css/setPwd.css?v={{Msg "seo" "version"}}" />
 		<link rel="stylesheet" type="text/css" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/me/css/header.css?v={{Msg "seo" "version"}}1"/>
 		<script src="https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js" type="text/javascript" charset="utf-8"></script>
-		<script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/js/utils.js" type="text/javascript" charset="utf-8"></script>
+		<!-- <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/js/utils.js" type="text/javascript" charset="utf-8"></script> -->
+		<script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/js/utils.js" type="text/javascript" charset="utf-8"></script>
 		{{include "/common/js.html"}}
 
 		<title>设置密码</title>
@@ -45,6 +46,7 @@
 			var isIos = mySysIsIos();
 			var pwdfocusindex = -1;
       var disWord = getParam("disWord");
+      var platform = utils.$envs
 			$(function() {
 				//点击返回上一页
 				$("#header a").on("tap",function(){
@@ -104,7 +106,7 @@
 					}
 				});
 				$("#btn").on("tap",function(){
-					var entname = decodeURIComponent(utils.getParam('entname'))
+					var entname = decodeURIComponent(getParam('entname'))
 					console.log(entname)
 					if($(this).hasClass("disabled")){
 						return;
@@ -114,10 +116,34 @@
 						return;
 					}
           $(this).addClass("disabled");
+          let params = {
+            reqType:"save",
+            password:$(".onePass input").val(),
+            rid:JyObj.getPushRid(),
+            oid:getOtherPushId(),
+            phoneType:getPhoneType(),
+            channel:getChannel(),
+            deviceId:getDeviceId(),
+            s_entname:entname,
+            disWord:disWord
+          }
+          if (platform.inH5) {
+            params = {
+              reqType:"save",
+              password:$(".onePass input").val(),
+              rid:'',
+              oid:'',
+              phoneType:'',
+              channel:'',
+              deviceId:'',
+              s_entname:entname,
+              disWord:disWord
+            }
+          }
           $.ajax({
     				url: "/jyapp/free/register",
     				type: "post",
-    				data: {reqType:"save",password:$(".onePass input").val(),rid:JyObj.getPushRid(),oid:getOtherPushId(),phoneType:getPhoneType(),channel:getChannel(),deviceId:getDeviceId(),s_entname:entname,disWord:disWord},
+    				data: params,
     				dataType: "json",
     				success: function(r){
   						var url = null;

+ 148 - 0
src/jfw/modules/app/src/web/templates/weixin/tabbar.html

@@ -0,0 +1,148 @@
+
+<link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+<style>
+  [v-cloak] {
+      display: none !important;
+  }
+  #tabMesg .van-tabbar-item__icon img {
+    width: .48rem;
+    height: .48rem;
+  }
+  #tabMesg .van-tabbar-item .van-tabbar-item__icon .van-info {
+    margin-top: .12rem;
+    background: #FB483D;
+  }
+  #tabMesg .a-badge .van-tabbar-item__icon .van-info{
+    display: none;
+  }
+</style>
+
+<div id="tabMesg" v-cloak>
+  <van-tabbar v-model="tabActive" active-color="#2ABED1" inactive-color="#171826">
+    <van-tabbar-item @click="routeHref(index)" v-for="(item, index) in tabList" :key="index" :badge="index === 2 ? getMsgCount : ''">
+      <span>{item.label}</span>
+      <template #icon="props">
+        <img v-show="!props.active" :src="'/images/tabbar/' + item.icon + '.png'" />
+        <img v-show="props.active" :src="'/images/tabbar/' + item.icon + '_active.png'" />
+      </template>
+    </van-tabbar-item>
+  </van-tabbar>
+</div>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
+<script src='{{Msg "seo" "cdn"}}/common-module/messageCenter/js/func.js?v={{Msg "seo" "version"}}'></script>
+<script>
+new Vue({
+  el: '#tabMesg',
+  delimiters: ['{', '}'],
+  data: function () {
+    return {
+			tabActive: 0,
+			counts: 0,
+      tabList: [
+        {
+          label: '首页',
+          icon: 'home',
+          url: '/jy_mobile/tabbar/home',
+          index: 0
+        },
+        {
+          label: '订阅',
+          icon: 'book',
+          url: '/jy_mobile/tabbar/subscribe',
+          index: 1
+        },
+        {
+          label: '消息',
+          icon: 'mesg',
+          url: '/jyapp/frontPage/messageCenter/sess/index',
+          index: 2
+        },
+        {
+          label: '百宝箱',
+          icon: 'box',
+          url: '/page_treasurebox/index.html',
+          index: 3
+        },
+        {
+          label: '我的',
+          icon: 'mine',
+          url: '/jyapp/free/me',
+          index: 4
+        },
+      ]
+		}
+	},
+
+	mounted() {
+    Object.assign(this.$data, this.$options.data())
+    var uMsg = Number(this.getQueryString('msg') || this.getURLIndex())
+    this.tabActive = uMsg
+		this.tabsCount()
+	},
+  computed: {
+    getMsgCount: function () {
+      return this.counts ? (this.counts > 99 ? '99+' : this.counts) : ''
+    }
+  },
+	methods: {
+    //获取url中"?"符后的字符串并正则匹配
+    getQueryString(name) {
+      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+      var r = window.location.search.substr(1).match(reg);
+      var context = "";
+      if (r != null)
+          context = r[2];
+      reg = null;
+      r = null;
+      return context == null || context == "" || context == "undefined" ? "" : context;
+    },
+    getURLIndex: function () {
+      try {
+        var tempUrl = this.findMapsForUrl(this.tabList, location.pathname)
+        if (tempUrl.length) {
+          return tempUrl[0].index
+        } else if (location.pathname.indexOf('/swordfish/historypush') !== -1) {
+          return 1
+        } else {
+          return ''
+        }
+      } catch (e) {
+        return ''
+      }
+    },
+    findMapsForUrl: function (arr, url) {
+      var tempReuslt = []
+      arr.forEach(function (v) {
+        if (url.indexOf(v.url) !== -1) {
+          tempReuslt.push(v)
+        }
+      })
+      return tempReuslt.sort(function(a,b) {
+        return b.url.length - a.url.length
+      })
+    },
+		tabsCount() {
+      const _this = this
+      $.ajax({
+        type:'GET',
+        url:'/jymessageCenter/getCount?t=' + Date.now(),
+        success:function (res) {
+          if (res && res.status == 1 && res.data && res.data.count) {
+            _this.counts = res.data.count
+          }
+        }
+      })
+    },
+		routeHref(index) {
+      var goHref = this.tabList[index].url + '?msg=' + index
+      if (index === this.tabActive) {
+        location.replace(goHref)
+      } else {
+        location.href = goHref
+      }
+		}
+	}
+})
+</script>

+ 18 - 1
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -819,6 +819,11 @@
         <!--S-- NPS评分 --S-->
         <div id="nps-container"></div>
         <!--E-- NPS评分 --E-->
+        <!--S 登录引导置底 S-->
+        <div class="login-guide">
+          <img src="/jyapp/images/adbottom.png" alt="">
+        </div>
+        <!--E 登录引导置底 E-->
         {{if and (not .T.isIosExam) (not .T.isIosExamPhone)}}
             <div class="adv">
                 {{$s:=(Ad "jyapp-wxcontent-bottom" -1 .Host)}}
@@ -998,6 +1003,10 @@
       $('.share-gift').hide()
       $('.bid-dec-in').hide()
       $('.bigvip_drain').hide()
+      $('.abs').hide()
+      $('.login-guide').show()
+    } else {
+      $('.login-guide').hide()
     }
 
     if(!industry){
@@ -1736,7 +1745,11 @@
                         }
                       }
                     })
-                    $('.atta-list').show()
+                    if(userId) {
+                      $('.atta-list').show()
+                    } else {
+                      $('.atta-list').hide()
+                    }
                 }else{
                     $('.atta-list').hide()
                     $('.atta-download-have').hide()
@@ -2327,6 +2340,10 @@
         }
 
       })
+      // 未登录底部引导点击跳转
+      $('.login-guide').click(function() {
+        location.href = '/jyapp/free/login?back=index&to=back'
+      })
       // 中标单位跳转
       $('.zhongbiaounit').on('click',function(){
         if (rerwinner!=""&&rerwinner!=null){