zhengwei il y a 5 ans
Parent
commit
dcb1a1beda
2 fichiers modifiés avec 33 ajouts et 8 suppressions
  1. 4 1
      WebContent/mnit/index.jsp
  2. 29 7
      WebContent/static/mobile/js/common.js

+ 4 - 1
WebContent/mnit/index.jsp

@@ -83,7 +83,6 @@
     .c-title {
         padding: 0.2rem 0 0.2rem 0.3rem;
         position: relative;
-        border-bottom: 1px solid #f2f2f2;
         background-color: #fff;
         margin-top: .2rem;
     }
@@ -241,6 +240,10 @@
 <script>
     mui.init();
     mui.ready(function () {
+        share={"title":"新零售解决方案提供商",
+            "link":"http://www.3water.cn/buying/mnit/index.jsp",
+            "imgUrl":"http://www.3water.cn/buying/static/mnit/image/banner1.jpg",
+            "desc":"助力企业快速搭建新零售微信商城"};
         var mySwiper = new Swiper('.swiper-container', {
             loop: true,
             autoplay: 3000,//可选选项,自动滑动

+ 29 - 7
WebContent/static/mobile/js/common.js

@@ -21,6 +21,26 @@ function pushHistory() {
     };
     window.history.replaceState(state, "", "#");
 };
+(function() {
+    if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
+        handleFontSize();
+    } else {
+        if (document.addEventListener) {
+            document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
+        } else if (document.attachEvent) {
+            //IE浏览器,非W3C规范
+            document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
+        }
+    }
+    function handleFontSize() {
+        // 设置网页字体为默认大小
+        WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : 0 });
+        // 重写设置网页字体大小的事件
+        WeixinJSBridge.on('menu:setfont', function() {
+            WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : 0 });
+        });
+    }
+})();
 $(document).ready(function () {
 	if(window.history.length<2){
 		//$(".mui-action-back").hide();
@@ -45,15 +65,17 @@ function addLog(){
 		shareUser = sessionStorage.getItem("shareUser");
 	}
 	var url = location.href.replace('#','');
-	if(url.indexOf("?")!=-1){
-		if(url.indexOf("shareUser")!=-1){
-			url = mobile.changeUrlParam(url,"shareUser",user.openid);
+	if (user){
+		if(url.indexOf("?")!=-1){
+			if(url.indexOf("shareUser")!=-1){
+				url = mobile.changeUrlParam(url,"shareUser",user.openid);
+			}else{
+				url+="&shareUser="+user.openid;
+			}
 		}else{
-			url+="&shareUser="+user.openid;
+			url+="?shareUser="+user.openid;
 		}
-	}else{
-		url+="?shareUser="+user.openid;
-	}
+    }
 	if(company){
 		if(url.indexOf("?")!=-1){
 			url+="&company="+company;