瀏覽代碼

剑鱼修改

wangchuanjin 9 年之前
父節點
當前提交
9f10284416
共有 25 個文件被更改,包括 101 次插入71 次删除
  1. 17 15
      core/src/qfw/mobile/wxmenu.go
  2. 3 0
      core/src/web/staticres/css/dev-qfw.css
  3. 二進制
      core/src/web/staticres/images/bottom-backTop-a.png
  4. 二進制
      core/src/web/staticres/images/bottom-backTop.png
  5. 二進制
      core/src/web/staticres/images/bottom-qq-a.png
  6. 二進制
      core/src/web/staticres/images/bottom-qq.png
  7. 二進制
      core/src/web/staticres/images/bottom-weixin-a.png
  8. 二進制
      core/src/web/staticres/images/bottom-weixin.png
  9. 二進制
      core/src/web/staticres/images/bottom-yjfk-a.png
  10. 二進制
      core/src/web/staticres/images/bottom-yjfk.png
  11. 二進制
      core/src/web/staticres/images/swordfish/guide-4.png
  12. 0 2
      core/src/web/staticres/js/qfw.js
  13. 二進制
      core/src/web/staticres/wxswordfish/images/guide-3.png
  14. 二進制
      core/src/web/staticres/wxswordfish/images/guide-5.png
  15. 二進制
      core/src/web/staticres/wxswordfish/images/guide-6.png
  16. 二進制
      core/src/web/staticres/wxswordfish/images/share-icon.jpg
  17. 二進制
      core/src/web/staticres/wxswordfish/images/share-icon.png
  18. 二進制
      core/src/web/staticres/wxswordfish/images/share-page.png
  19. 40 0
      core/src/web/staticres/wxswordfish/share.js
  20. 11 9
      core/src/web/staticres/wxswordfish/style.css
  21. 19 4
      core/src/web/templates/swordfish/wxindex.html
  22. 1 0
      core/src/web/templates/swordfish/wxpush.html
  23. 1 0
      core/src/web/templates/swordfish/wxrssset.html
  24. 6 0
      core/src/web/templates/swordfish/wxshare.html
  25. 3 41
      core/src/web/templates/swordfish/wxtoolbar.html

+ 17 - 15
core/src/qfw/mobile/wxmenu.go

@@ -22,11 +22,12 @@ func init() {
 }
 
 func (m *Mobile) Guide() error {
-	m.T["shareData"] = getShareData(m.Url())
-	return m.Render("/swordfish/wxindex.html")
+	m.T["signature"] = getSignature(m.Url())
+	return m.Render("/swordfish/wxindex.html", &m.T)
 }
 func (m *Mobile) Share() error {
-	return m.Render("/swordfish/wxshare.html")
+	m.T["signature"] = getSignature(m.Url())
+	return m.Render("/swordfish/wxshare.html", &m.T)
 }
 
 func (m *Mobile) Wxrssset() error {
@@ -43,6 +44,7 @@ func (m *Mobile) Wxrssset() error {
 		}
 	}()
 	if m.Session().Get("userId") != nil {
+		m.T["signature"] = getSignature(m.Url())
 		userInfo := mongodb.FindById("user", m.GetSession("userId").(string), nil)
 		if i_m_guide := (*userInfo)["i_m_guide"]; util.IntAll(i_m_guide) == 0 {
 			mongodb.Update("user", `{"_id":"`+m.GetSession("userId").(string)+`"}`, map[string]interface{}{
@@ -71,7 +73,6 @@ func (m *Mobile) Wxrssset() error {
 			}
 		}
 		//m.T["mid"] = openid
-		m.T["shareData"] = getShareData(m.Url())
 		return m.Render("/swordfish/wxrssset.html", &m.T)
 	} else {
 		return m.Render("_err.html")
@@ -243,7 +244,7 @@ func (m *Mobile) WxpushList(s_m_openid string, _id string, msgid string) error {
 	**/
 	m.T["data"] = *mongodb.FindById("wxpush", _id, `{"s_content":1,"s_words":1,"a_visitedindex":1,"a_publishtime":1,"s_type":1}`)
 	m.T["_id"] = _id
-	m.T["shareData"] = getShareData(m.Url())
+	m.T["signature"] = getSignature(m.Url())
 	return m.Render("/swordfish/wxpush.html", &m.T)
 }
 
@@ -254,17 +255,18 @@ func (m *Mobile) WxpushAjaxReq() error {
 	}, false, false)
 	return nil
 }
-func getShareData(action string) []string {
+func getSignature(action string) []string {
 	url := coreconfig.SysConfig.DomainName + action
-	log.Println(url)
-	var shareData []string
-	if ret := redis.Get("other", "signature-"+url); ret != nil {
-		if d, err := json.Marshal(ret); err != nil || json.Unmarshal(d, &shareData) != nil {
-			shareData = coreutil.GetJSInterfaceParam(url)
+	var signature []string
+	if ret := redis.Get("other", "wxshare-"+url); ret != nil {
+		if d, err := json.Marshal(ret); err == nil {
+			json.Unmarshal(d, &signature)
 		}
-	} else {
-		shareData = coreutil.GetJSInterfaceParam(url)
-		redis.Put("other", "signature-"+url, shareData, 60*1000)
 	}
-	return shareData
+	if len(signature) == 0 {
+		signature = coreutil.GetJSInterfaceParam(url)
+		redis.Put("other", "wxshare-"+url, signature, 60*1000)
+	}
+	log.Println(url, "------", signature)
+	return signature
 }

+ 3 - 0
core/src/web/staticres/css/dev-qfw.css

@@ -2079,6 +2079,9 @@ style="color:#D03102;margin-right:5px;"
 .b-top li{
 	padding-left: 20px;
 }
+.b-top li a{
+	white-space: nowrap;
+}
 .b-top a{
 	color: #A0A0A0;
 }

二進制
core/src/web/staticres/images/bottom-backTop-a.png


二進制
core/src/web/staticres/images/bottom-backTop.png


二進制
core/src/web/staticres/images/bottom-qq-a.png


二進制
core/src/web/staticres/images/bottom-qq.png


二進制
core/src/web/staticres/images/bottom-weixin-a.png


二進制
core/src/web/staticres/images/bottom-weixin.png


二進制
core/src/web/staticres/images/bottom-yjfk-a.png


二進制
core/src/web/staticres/images/bottom-yjfk.png


二進制
core/src/web/staticres/images/swordfish/guide-4.png


+ 0 - 2
core/src/web/staticres/js/qfw.js

@@ -572,8 +572,6 @@ function b_loadTop(){
 				var html = '<a onclick="loginModalShow();">登录/注册</a>';
 				$("#b-loginStatus").html(html);
 				$("#bottom-bar>li").removeClass("invisible");
-				//登录
-				$("body").append('{{include "/common/login.html"}}');
 			}
 			try{
 				b_loadTopCallBack(result);

二進制
core/src/web/staticres/wxswordfish/images/guide-3.png


二進制
core/src/web/staticres/wxswordfish/images/guide-5.png


二進制
core/src/web/staticres/wxswordfish/images/guide-6.png


二進制
core/src/web/staticres/wxswordfish/images/share-icon.jpg


二進制
core/src/web/staticres/wxswordfish/images/share-icon.png


二進制
core/src/web/staticres/wxswordfish/images/share-page.png


+ 40 - 0
core/src/web/staticres/wxswordfish/share.js

@@ -0,0 +1,40 @@
+function initShare(signature){
+	if(typeof(signature) != "undefined" && signature != null && signature.length == 4){
+		wx.config({
+		    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+		    appId: signature[0], // 必填,公众号的唯一标识
+		    timestamp:signature[1], // 必填,生成签名的时间戳
+		    nonceStr: signature[2], // 必填,生成签名的随机串
+		    signature: signature[3],// 必填,签名,见附录1
+		    jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
+		});
+		wx.ready(function () {
+	        wx.onMenuShareTimeline({
+			    title: '剑鱼-招标订阅,招标信息早知道!', // 分享标题
+			    link: 'http://www.qimingxing.info/swordfish/share', // 分享链接
+			    imgUrl: 'http://www.qimingxing.info/wxswordfish/images/share-icon.png', // 分享图标
+			    success: function () { 
+			       //alert('分享成功');
+			    },
+			    cancel: function () { 
+			       //alert('分享失败,或用户取消了');
+			    }
+			});
+			
+			wx.onMenuShareAppMessage({
+			    title: '剑鱼-招标订阅,招标信息早知道!', // 分享标题
+			    desc: '关注微信并设置剑鱼关键词,全国招标信息统统推送给您!', // 分享描述
+			    link: 'http://www.qimingxing.info/swordfish/share', // 分享链接
+			    imgUrl: 'http://www.qimingxing.info/wxswordfish/images/share-icon.png', // 分享图标
+			    type: 'link', // 分享类型,music、video或link,不填默认为link
+			    dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
+			    success: function () { 
+			        //alert('分享成功');
+			    },
+			    cancel: function () { 
+					//alert('分享失败,或用户取消了');
+			    }
+			});
+	    });
+	}
+}	

+ 11 - 9
core/src/web/staticres/wxswordfish/style.css

@@ -385,9 +385,6 @@ img{
 .guide-bottom .arrow-up{
 	width: 30px;
 	height: 20px;
-	position: absolute;
-	left: 50%;
-	margin-left: -12.5px;
 	animation-name:start;
 	animation-duration:2s;
 	animation-timing-function:ease-in-out;
@@ -416,42 +413,47 @@ img{
 @-webkit-keyframes start {
 	0%{
 		opacity:0;
-		bottom: 0px;
+		margin-bottom: 0px;
 	}
 	60% {
 		opacity:1;
 	}
 	100% {
 		opacity:0;
-		bottom: 40px;
+		margin-bottom: 40px;
 	}
 }
 @-moz-keyframes start {
 	0%{
 		opacity:0;
-		bottom: 0px;
+		margin-bottom: 0px;
 	}
 	60% {
 		opacity:1;
 	}
 	100% {
 		opacity:0;
-		bottom: 40px;
+		margin-bottom: 40px;
 	}
 }
 @keyframes start {
 		0% {
 		opacity:0;
-		bottom: 0px;
+		margin-bottom: 0px;
 	}
 	60% {
 		opacity:1;
 	}
 	100% {
 		opacity:0;
-		bottom: 40px;
+		margin-bottom: 40px;
 	}
 }
+.guide-bottom .experience{
+	padding: 4px 8px;
+	margin-bottom: 20px;
+	display: none;
+}
 .guide-bottom .jumpGuide ,.guide-bottom .goToShare{
 	color: #D7D7D7;
 	position: absolute;

+ 19 - 4
core/src/web/templates/swordfish/wxindex.html

@@ -6,6 +6,7 @@
 <link href="/swiper/swiper.min.css" rel="stylesheet">
 <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
 <script src="/js/jquery.js"></script>
+<script src="/wxswordfish/share.js"></script>
 <script src="/swiper/swiper.min.js"></script>
 </head>
 <body>
@@ -34,7 +35,8 @@
    	<div class="swiper-pagination"></div>
 	<div class="guide-bottom">
 		<img class="arrow-up" src="/wxswordfish/images/up.png">
-		<img src="/wxswordfish/images/jump.png" class="jumpGuide" onclick="{{if session "userid"}}window.location.href='/swordfish/page'{{else}}history.go(-1);{{end}}">
+		<button class="btn experience" onclick="pageJump();">立即体验</button>
+		<img src="/wxswordfish/images/jump.png" class="jumpGuide" onclick="pageJump();">
 		<img class="goToShare" id="goToShare" src="/wxswordfish/images/guide-share.png">
 	</div>
 </div>
@@ -50,6 +52,7 @@ $(function(){
 		touchMoveStopPropagation: false,
 		virtualTranslate: true,
 		onSlideChangeStart: function(swiper){
+			console.info();
 			var prevSlide = $(swiper.slides[swiper.previousIndex]);
 			prevSlide.addClass("slide-active");
 			var activeSlide = $(swiper.slides[swiper.activeIndex]);
@@ -62,14 +65,19 @@ $(function(){
 			activeSlide.one("webkitAnimationEnd",function(){
 				$(this).removeClass("slide-up").removeClass("slide-down");
 				prevSlide.removeClass("slide-active");
+				if(swiper.activeIndex == 5){
+					$(".arrow-up").hide();
+					$(".experience").show();
+				}else{
+					$(".experience").hide();
+					$(".arrow-up").show();
+				}
 			});
 		},
 		onSliderMove: function(swiper, event){
-			{{if session "userid"}}
 			if(swiper.isEnd && (swiper.touches.currentX - swiper.touches.startX) > 20) {
-				window.location.href = "/swordfish/page";
+				pageJump();
 			}
-			{{end}}
 		}
     });
 	/*
@@ -84,6 +92,13 @@ $(function(){
 		$(".swiper-slide img").css({width: height / imgHeight * imgWidth,height: height,marginTop: -(height / 2)});
 	}*/
 });
+function pageJump(){
+	{{if session "userid"}}
+		window.location.href = '/swordfish/page';
+	{{else}}
+		history.go(-1);
+	{{end}}
+}
 </script>
 </body>
 </html>

+ 1 - 0
core/src/web/templates/swordfish/wxpush.html

@@ -5,6 +5,7 @@
 <link href="/wxswordfish/style.css" rel="stylesheet">
 <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
 <script src="/js/jquery.js"></script>
+<script src="/wxswordfish/share.js"></script>
 <script>
 $(function(){
 	var hm = document.createElement("script");

+ 1 - 0
core/src/web/templates/swordfish/wxrssset.html

@@ -7,6 +7,7 @@
 <link href="/wxswordfish/style.css" rel="stylesheet">
 <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
 <script src="/js/jquery.js"></script>
+<script src="/wxswordfish/share.js"></script>
 <script>
 	var msgset= {{.T.msgset}};
 </script>

+ 6 - 0
core/src/web/templates/swordfish/wxshare.html

@@ -2,6 +2,12 @@
 <head>
 <title>企明星-剑鱼</title>
 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
+<script src="/js/jquery.js"></script>
+<script src="/wxswordfish/share.js"></script>
+<script>
+	initShare({{.T.signature}});
+</script>
 </head>
 <body style="margin: 0px;">
 <img src="/wxswordfish/images/share-page.png" width="100%" height="100%">

+ 3 - 41
core/src/web/templates/swordfish/wxtoolbar.html

@@ -15,12 +15,12 @@
 <div class="dialog share-dialog">
 	<div class="dialog-main">
 		<div class="dialog-head">
-			<div>分享</div>
+			<div>如何分享</div>
 			<div><span id="share-dialog-back">返回</span></div>
 		</div>
 		<div class="dialog-content">
 			<div>
-				点击右上角…按钮,选择发送给朋友,或分享到朋友圈,即可完成分享!
+				点击右上角…按钮,选择发送给朋友,或分享到朋友圈,即可完成分享!(对方收到邀请后看到的是剑鱼的宣传页面,不会看到您的设置信息,请放心)
 			</div>
 		</div>
 	</div>
@@ -70,45 +70,7 @@ $(function(){
 		}
 	});
 	//
-	var shareData = {{.T.shareData}};
-	if(typeof(shareData) != "undefined" && shareData != null && shareData.length == 4){
-		wx.config({
-		    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-		    appId: shareData[0], // 必填,公众号的唯一标识
-		    timestamp:shareData[1], // 必填,生成签名的时间戳
-		    nonceStr: shareData[2], // 必填,生成签名的随机串
-		    signature: shareData[3],// 必填,签名,见附录1
-		    jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
-		});
-		 wx.ready(function () {
-	        wx.onMenuShareTimeline({
-			    title: '剑鱼-招标订阅,招标信息早知道!', // 分享标题
-			    link: 'http://www.qimingxing.info/swordfish/share', // 分享链接
-			    imgUrl: 'http://www.qimingxing.info/wxswordfish/images/share-icon.jpg', // 分享图标
-			    success: function () { 
-			       //alert('分享成功');
-			    },
-			    cancel: function () { 
-			       //alert('分享失败,或用户取消了');
-			    }
-			});
-			
-			wx.onMenuShareAppMessage({
-			    title: '剑鱼-招标订阅,招标信息早知道!', // 分享标题
-			    desc: '关注微信并设置剑鱼关键词,全国招标信息统统推送给您!', // 分享描述
-			    link: 'http://www.qimingxing.info/swordfish/share', // 分享链接
-			    imgUrl: 'http://www.qimingxing.info/wxswordfish/images/share-icon.jpg', // 分享图标
-			    type: 'link', // 分享类型,music、video或link,不填默认为link
-			    dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
-			    success: function () { 
-			        //alert('分享成功');
-			    },
-			    cancel: function () { 
-					//alert('分享失败,或用户取消了');
-			    }
-			});
-	    });
-	}
+	initShare({{.T.signature}});
 });
 //意见反馈
 function Feedback(){