wangchuanjin 9 лет назад
Родитель
Сommit
b4236caa3b

+ 7 - 1
core/src/qfw/mobile/wxmenu.go

@@ -23,6 +23,9 @@ func init() {
 	se = util.SimpleEncrypt{Key: "topnet"}
 }
 func (m *Mobile) Guide(sign string) error {
+	if m.Session().Get("s_m_openid") == nil {
+		return m.Redirect("/swordfish/share/-1")
+	}
 	m.T["signature"] = GetSignature(m.Url())
 	m.T["shareid"] = cutil.FindMyShareId("topjy", m.Session().Get("s_m_openid").(string))
 	m.T["sign"] = sign
@@ -88,7 +91,7 @@ func (m *Mobile) Wxrssset() error {
 
 		return m.Render("/swordfish/wxrssset.html", &m.T)
 	} else {
-		return m.Render("_err.html")
+		return m.Redirect("/swordfish/share/-1")
 	}
 }
 
@@ -341,6 +344,9 @@ func (m *Mobile) WxpushListInfo(_id string) error {
 		mongodb.Update("message", `{"_id":"`+msgid+`"}`, `{"$set":{"i_status":1}}`, false, false)
 	}()
 	**/
+	if m.Session().Get("s_m_openid") == nil {
+		return m.Redirect("/swordfish/share/-1")
+	}
 	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["signature"] = GetSignature(m.Url())

+ 3 - 0
core/src/web/templates/swordfish/wxindex.html

@@ -8,6 +8,9 @@
 <script src="/js/jquery.js"></script>
 <script src="/wxswordfish/share.js"></script>
 <script src="/swiper/swiper.min.js"></script>
+<script>
+	initShare({{.T.signature}},{{.T.shareid}});
+</script>
 </head>
 <body>
 <div class="swiper-container">

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

@@ -7,6 +7,7 @@
 <script src="/js/jquery.js"></script>
 <script src="/wxswordfish/share.js"></script>
 <script>
+initShare({{.T.signature}},{{.T.shareid}});
 $(function(){
 	var hm = document.createElement("script");
 	hm.src = "//hm.baidu.com/hm.js?ed198b177e527bb53684db20bb390e77";

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

@@ -11,6 +11,7 @@
 <script src="/wxswordfish/main.js"></script>
 <script>
 	var msgset= {{.T.msgset}};
+	initShare({{.T.signature}},{{.T.shareid}});
 </script>
 </head>
 <body>

+ 28 - 8
core/src/web/templates/swordfish/wxshareguide.html

@@ -8,12 +8,16 @@
 <script src="/js/jquery.js"></script>
 <script src="/wxswordfish/share.js"></script>
 <script src="/swiper/swiper.min.js"></script>
+<script>
+	initShare({{.T.signature}},{{.T.shareid}});
+</script>
 </head>
 <body>
 <div class="swiper-container">
     <div class="swiper-wrapper">
         <div class="swiper-slide">
 			<img src="/wxswordfish/images/share-cj.jpg" alt="Cinque Terre">
+			<img id="QRcode" style="position:absolute;z-index: 2;" src="/front/weixinshare/{{.T.shareid}}" >
 		</div>
        	<div class="swiper-slide">
 			<img src="/wxswordfish/images/guide-2.png">
@@ -35,30 +39,30 @@
    	<div class="swiper-pagination"></div>
 	<div class="guide-bottom">
 		<img class="arrow-up" src="/wxswordfish/images/up.png">
-		<img src="/wxswordfish/images/index.png" class="jumpGuide" onclick="history.go(-1);">
+		<img src="/wxswordfish/images/index.png" class="jumpGuide" onclick="backToIndex()">
 	</div>
 </div>
-<img id="QRcode" style="position:absolute;z-index: 2;" src="/front/weixinshare/{{.T.shareid}}" >
 <script type="text/javascript">
+var mySwiper = null;
+var currentIndex = 0;
 $(function(){
 	initShare({{.T.signature}},{{.T.shareid}});
 	var width = $(window).width();
 	var height = $(window).height();
-	var defaultHeight = 480;
+	var defaultHeight = 416;
 	var max = 750;
 	if(width > max){
 		width = max;
 	}
 	width = width*0.48;
-	var top = 380;
+	var top = 330;
 	if(height > defaultHeight){
-		top = 380 / defaultHeight * height;
+		top = top / defaultHeight * height;
 	}
-	$("#QRcode").css({"width":width,"top": top-width,"left":"50%","margin-left": -(width/2)});
+	$("#QRcode").css({"width":width,"height":width,"top": top-width,"left":"50%","margin-left": -(width/2)});
 	$(".bottom-toolbar,.feedback-dialog").remove();
-	var currentIndex = 0;
 	var flag = true;
-	var mySwiper = new Swiper('.swiper-container', {
+	mySwiper = new Swiper('.swiper-container', {
 		loop: true,
         pagination: '.swiper-pagination',
         paginationClickable: false,
@@ -112,6 +116,22 @@ $(function(){
 		$(".swiper-slide img").css({width: height / imgHeight * imgWidth,height: height,marginTop: -(height / 2)});
 	}*/
 });
+function backToIndex(){
+	if(mySwiper == null || mySwiper.activeIndex == 1){
+		return;
+	}
+	currentIndex = 1;
+	var prevSlide = $(mySwiper.slides[mySwiper.activeIndex]);
+	prevSlide.addClass("slide-active");
+	var activeSlide = $(mySwiper.slides[1]);
+	activeSlide.addClass("slide-down");
+	activeSlide.one("webkitAnimationEnd",function(){
+		$(this).removeClass("slide-up").removeClass("slide-down");
+		prevSlide.removeClass("slide-active");
+		mySwiper.slideTo(1, 1000, false);
+		$("#QRcode").show();
+	});
+}
 </script>
 </body>
 </html>

+ 0 - 2
core/src/web/templates/swordfish/wxtoolbar.html

@@ -102,8 +102,6 @@ $(function(){
 			$("html,body").removeClass("overflow-hidden");
 		}
 	});
-	//
-	initShare({{.T.signature}},{{.T.shareid}});
 });
 //意见反馈
 function Feedback(){