Browse Source

Merge branch 'release' of 192.168.3.17:zhanghongbo/qfw into release

wangshan 9 năm trước cách đây
mục cha
commit
614e8b269b

+ 2 - 1
core/src/config.json

@@ -27,5 +27,6 @@
     "httpCache": false,
     "mailFailureTime": 3,
     "chatServer": "127.0.0.1:83",
-    "chatRpc": "127.0.0.1:88"
+    "chatRpc": "127.0.0.1:88",
+	"domainName":"test.qimingxing.info"
 }

+ 1 - 0
core/src/qfw/coreconfig/SysConfig.go

@@ -23,6 +23,7 @@ type config struct {
 	ChatServer      string      `json:"chatServer"`
 	ChatRpc         string      `json:"chatRpc"`
 	ElasticPoolSize int         `json:"elasticPoolSize"`
+	DomainName      string      `json:"domainName"`
 }
 type smtp struct {
 	Addr     string `json:"addr"`

+ 19 - 5
core/src/qfw/mobile/wxmenu.go

@@ -5,24 +5,24 @@ import (
 	"fmt"
 	"log"
 	"math/rand"
+	"qfw/coreconfig"
 	"qfw/coreutil"
 	"qfw/util"
 	"qfw/util/consts"
 	"qfw/util/mongodb"
+	"qfw/util/redis"
 	"runtime"
 	"time"
 )
 
 var se util.SimpleEncrypt
 
-const ShareUrl string = "http://www.qimingxing.info/swordfish/share"
-
 func init() {
 	se = util.SimpleEncrypt{Key: "topnet"}
 }
 
 func (m *Mobile) Guide() error {
-	m.T["shareData"] = coreutil.GetJSInterfaceParam(ShareUrl)
+	m.T["shareData"] = getShareData(m.Url())
 	return m.Render("/swordfish/wxindex.html")
 }
 func (m *Mobile) Share() error {
@@ -71,7 +71,7 @@ func (m *Mobile) Wxrssset() error {
 			}
 		}
 		//m.T["mid"] = openid
-		m.T["shareData"] = coreutil.GetJSInterfaceParam(ShareUrl)
+		m.T["shareData"] = getShareData(m.Url())
 		return m.Render("/swordfish/wxrssset.html", &m.T)
 	} else {
 		return m.Render("_err.html")
@@ -243,7 +243,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"] = coreutil.GetJSInterfaceParam(ShareUrl)
+	m.T["shareData"] = getShareData(m.Url())
 	return m.Render("/swordfish/wxpush.html", &m.T)
 }
 
@@ -254,3 +254,17 @@ func (m *Mobile) WxpushAjaxReq() error {
 	}, false, false)
 	return nil
 }
+func getShareData(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)
+		}
+	} else {
+		shareData = coreutil.GetJSInterfaceParam(url)
+		redis.Put("other", "signature-"+url, shareData, 60*1000)
+	}
+	return shareData
+}

+ 3 - 3
core/src/web/staticres/css/swordfish.css

@@ -3,7 +3,7 @@ body{
 	background-color: #F0F0F0;
 }
 .logo{
-	width: 156px;
+	width: 187px;
 	height: 66px;
 }
 a:focus, a:hover{
@@ -156,7 +156,7 @@ a:focus, a:hover{
 	top: 2px;
 }
 .swordfish-i-a{
-	background-color: #37C6DA !important;
+	background-color: #35C5DA !important;
 }
 .swordfish-nva{
 	border-top: 3px solid #37C6DA;
@@ -169,7 +169,7 @@ a:focus, a:hover{
 	margin: auto;
 }
 .swordfish-nva-l{
-	padding-right: 20px;
+	padding-right: 40px;
 }
 .swordfish-nva-c{
 	width: 100px;

BIN
core/src/web/staticres/images/logo.png


BIN
core/src/web/staticres/wxswordfish/images/guide-1.png


BIN
core/src/web/staticres/wxswordfish/images/guide-2.png


BIN
core/src/web/staticres/wxswordfish/images/guide-3.png


BIN
core/src/web/staticres/wxswordfish/images/guide-4.png


BIN
core/src/web/staticres/wxswordfish/images/guide-5.png


BIN
core/src/web/staticres/wxswordfish/images/guide-6.png


BIN
core/src/web/staticres/wxswordfish/images/guide-share.png


BIN
core/src/web/staticres/wxswordfish/images/jump.png


BIN
core/src/web/staticres/wxswordfish/images/share.png


BIN
core/src/web/staticres/wxswordfish/images/up.png


+ 16 - 12
core/src/web/staticres/wxswordfish/style.css

@@ -137,6 +137,7 @@ img{
 	top: 0px;
 	background-color: rgba(0,0,1,.5);
 	display: none;
+	z-index: 11;
 }
 .dialog-main{
 	position: absolute;
@@ -369,7 +370,10 @@ img{
 	height: 100%;
 }
 .swiper-pagination-bullet-active{
-	background-color: #37C6DA;
+	background-color: #35c5da !important;
+}
+..swiper-pagination-bullet{
+	opacity: .1;
 }
 .guide-bottom{
 	position: absolute;
@@ -378,9 +382,9 @@ img{
 	width: 100%;
 	z-index: 99999;
 }
-.guide-bottom img{
-	width: 25px;
-	height: 15px;
+.guide-bottom .arrow-up{
+	width: 30px;
+	height: 20px;
 	position: absolute;
 	left: 50%;
 	margin-left: -12.5px;
@@ -419,7 +423,7 @@ img{
 	}
 	100% {
 		opacity:0;
-		bottom: 25px;
+		bottom: 40px;
 	}
 }
 @-moz-keyframes start {
@@ -432,7 +436,7 @@ img{
 	}
 	100% {
 		opacity:0;
-		bottom: 25px;
+		bottom: 40px;
 	}
 }
 @keyframes start {
@@ -445,22 +449,22 @@ img{
 	}
 	100% {
 		opacity:0;
-		bottom: 25px;
+		bottom: 40px;
 	}
 }
-.guide-bottom >span{
+.guide-bottom .jumpGuide ,.guide-bottom .goToShare{
 	color: #D7D7D7;
 	position: absolute;
 	bottom: 10px;
 	display: block;
+	width: 50px;
+	height: 50px;
 }
 .guide-bottom .jumpGuide{
-	left: 25%;
-	margin-left: -43.5px;
+	left: 20px;
 }
 .guide-bottom .goToShare{
-	right: 25%;
-	margin-right: -16px;
+	right: 20px;
 }
 .share-dialog{
 	z-index: 10;

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

@@ -26,13 +26,16 @@
 		<div class="swiper-slide">
 			<img src="/wxswordfish/images/guide-5.png">
 		</div>
+		<div class="swiper-slide">
+			<img src="/wxswordfish/images/guide-6.png">
+		</div>
     </div>
     <!-- 如果需要分页器 -->
    	<div class="swiper-pagination"></div>
 	<div class="guide-bottom">
-		<img src="/wxswordfish/images/up.png">
-		<span class="jumpGuide" onclick="{{if session "userid"}}window.location.href='/swordfish/page'{{else}}history.go(-1);{{end}}">跳过引导>></span>
-		<span class="goToShare" id="goToShare">分享</span>
+		<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}}">
+		<img class="goToShare" id="goToShare" src="/wxswordfish/images/guide-share.png">
 	</div>
 </div>
 {{include "/swordfish/wxtoolbar.html"}}
@@ -61,9 +64,11 @@ $(function(){
 			});
 		},
 		onSliderMove: function(swiper, event){
+			{{if session "userid"}}
 			if(swiper.isEnd && (swiper.touches.currentX - swiper.touches.startX) > 20) {
 				window.location.href = "/swordfish/page";
 			}
+			{{end}}
 		}
     });
 	/*

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

@@ -56,9 +56,11 @@ $(function(){
 	});
 	$("#goToShare").click(function(){
 		$(".share-dialog").show();
+		$("html,body").addClass("overflow-hidden");
 	});
 	$("#share-dialog-back").click(function(){
 		$(".share-dialog").hide();
+		$("html,body").removeClass("overflow-hidden");
 	});
 	//弹出框消失
 	$(".dialog").click(function(e){