Эх сурвалжийг харах

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

wangshan 9 жил өмнө
parent
commit
7586fceeed
37 өөрчлөгдсөн 174 нэмэгдсэн , 110 устгасан
  1. 3 2
      core/src/qfw/member/membermanager.go
  2. 17 15
      core/src/qfw/mobile/wxmenu.go
  3. 1 1
      core/src/qfw/swordfish/swordfishmanage.go
  4. 4 1
      core/src/web/staticres/css/dev-qfw.css
  5. 1 1
      core/src/web/staticres/css/swordfish.css
  6. BIN
      core/src/web/staticres/images/bottom-backTop-a.png
  7. BIN
      core/src/web/staticres/images/bottom-backTop.png
  8. BIN
      core/src/web/staticres/images/bottom-qq-a.png
  9. BIN
      core/src/web/staticres/images/bottom-qq.png
  10. BIN
      core/src/web/staticres/images/bottom-weixin-a.png
  11. BIN
      core/src/web/staticres/images/bottom-weixin.png
  12. BIN
      core/src/web/staticres/images/bottom-yjfk-a.png
  13. BIN
      core/src/web/staticres/images/bottom-yjfk.png
  14. BIN
      core/src/web/staticres/images/swordfish/guide-4.png
  15. 0 2
      core/src/web/staticres/js/qfw.js
  16. BIN
      core/src/web/staticres/wxswordfish/images/guide-3.png
  17. BIN
      core/src/web/staticres/wxswordfish/images/guide-5.png
  18. BIN
      core/src/web/staticres/wxswordfish/images/guide-6.png
  19. BIN
      core/src/web/staticres/wxswordfish/images/share-icon.jpg
  20. BIN
      core/src/web/staticres/wxswordfish/images/share-icon.png
  21. BIN
      core/src/web/staticres/wxswordfish/images/share-page.png
  22. 40 0
      core/src/web/staticres/wxswordfish/share.js
  23. 21 9
      core/src/web/staticres/wxswordfish/style.css
  24. 5 5
      core/src/web/templates/common/login.html
  25. 1 5
      core/src/web/templates/member/microwebsite.html
  26. 26 22
      core/src/web/templates/swordfish/infolist.html
  27. 1 1
      core/src/web/templates/swordfish/rssset.html
  28. 19 4
      core/src/web/templates/swordfish/wxindex.html
  29. 1 0
      core/src/web/templates/swordfish/wxpush.html
  30. 1 0
      core/src/web/templates/swordfish/wxrssset.html
  31. 6 0
      core/src/web/templates/swordfish/wxshare.html
  32. 3 41
      core/src/web/templates/swordfish/wxtoolbar.html
  33. 5 0
      weixin/src/config.json
  34. 1 1
      weixin/src/qfw/weixin/clickhandler.go
  35. 6 0
      weixin/src/qfw/weixin/dao/logsdao.go
  36. 11 0
      weixin/src/qfw/weixin/msgtxtchandler.go
  37. 1 0
      weixin/src/qfw/weixinconfig/weixinconfig.go

+ 3 - 2
core/src/qfw/member/membermanager.go

@@ -427,7 +427,7 @@ func (m *Member) RegisterComplete() error {
 //登录
 func (m *Member) Login() {
 	var status string = "n"
-	var info, freeze string
+	var info, freeze, code string
 	s_pwd := m.GetString("s_pwd") //密码
 	if s_pwd != "" {              //密码为空不可登录
 		var loginType string            //登录类型
@@ -448,6 +448,7 @@ func (m *Member) Login() {
 			} else {
 				//获取绑定企业信息
 				if r["s_enterpriseid"] != nil && r["s_enterpriseid"].(string) != "" {
+					code = r["s_enterpriseid"].(string)
 					//enter := *FindOne("enterprise", `M{"_id":"`+r["s_enterpriseid"].(string)+`"}`)
 					enter := *FindById("enterprise", r["s_enterpriseid"].(string), nil)
 					if enter != nil && enter["OpLocDistrict"] != nil {
@@ -472,7 +473,7 @@ func (m *Member) Login() {
 	} else {
 		info = "p_error" //密码错误
 	}
-	m.Write("{\"info\":\"" + info + "\",\"status\":\"" + status + "\",\"freeze\":\"" + freeze + "\"}")
+	m.Write("{\"info\":\"" + info + "\",\"status\":\"" + status + "\",\"freeze\":\"" + freeze + "\",\"code\":\"" + code + "\"}")
 }
 
 //找回密码之后直接登录

+ 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
 }

+ 1 - 1
core/src/qfw/swordfish/swordfishmanage.go

@@ -60,7 +60,7 @@ func (s *SwordFish) RsssetAjaxReq() error {
 
 //跳转到用户中心剑鱼信息列表
 func (s *SwordFish) Infolist() error {
-	ms := mongodb.FindById("user", s.GetSession("userId").(string), `{"o_msgset:1"}`)
+	ms := mongodb.FindById("user", s.GetSession("userId").(string), `{"o_msgset":1}`)
 	s.T["msgset"] = ms
 	return s.Render("/swordfish/infolist.html", &s.T)
 }

+ 4 - 1
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;
 }
@@ -2145,7 +2148,7 @@ style="color:#D03102;margin-right:5px;"
 	border-right: 1px solid #ffffff;
 	float: right;
 }
-.b-nav-other a:hover{
+.b-nav-other>a:hover,.b-nav-active>a{
 	font-weight: bold;
 }
 .b-head .headimg{

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

@@ -21,7 +21,7 @@ a:focus, a:hover{
 .b-nav-main{
 	background-color: #37C6DA;
 }
-.b-nav-other a:hover{
+.b-nav-other>a:hover,.b-nav-active>a{
 	color: #37C6DA !important;
 }
 .b-head .head-hideMenu i{

BIN
core/src/web/staticres/images/bottom-backTop-a.png


BIN
core/src/web/staticres/images/bottom-backTop.png


BIN
core/src/web/staticres/images/bottom-qq-a.png


BIN
core/src/web/staticres/images/bottom-qq.png


BIN
core/src/web/staticres/images/bottom-weixin-a.png


BIN
core/src/web/staticres/images/bottom-weixin.png


BIN
core/src/web/staticres/images/bottom-yjfk-a.png


BIN
core/src/web/staticres/images/bottom-yjfk.png


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


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

@@ -577,8 +577,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);

BIN
core/src/web/staticres/wxswordfish/images/guide-3.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/share-icon.jpg


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


BIN
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('分享失败,或用户取消了');
+			    }
+			});
+	    });
+	}
+}	

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

@@ -322,6 +322,11 @@ img{
 	-o-animation-timing-function:ease-in;
 	-o-animation-iteration-count:1;
 	-o-animation-play-state:running;
+	webkit-transform: translateZ(0);
+	-moz-transform: translateZ(0);
+	-ms-transform: translateZ(0);
+	-o-transform: translateZ(0);
+	transform: translateZ(0);
 }
 @-webkit-keyframes slidedown {
 	0%{
@@ -351,6 +356,11 @@ img{
 	-o-animation-timing-function:ease-in;
 	-o-animation-iteration-count:1;
 	-o-animation-play-state:running;
+	webkit-transform: translateZ(0);
+	-moz-transform: translateZ(0);
+	-ms-transform: translateZ(0);
+	-o-transform: translateZ(0);
+	transform: translateZ(0);
 }
 
 @-webkit-keyframes slideup {
@@ -385,9 +395,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 +423,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;

+ 5 - 5
core/src/web/templates/common/login.html

@@ -139,7 +139,7 @@ function setTimes(num,n){
 						//登陆成功
 						clearInterval(t);
 						compulsoryreRresh = true;
-						afterLoginSkip();
+						afterLoginSkip(data);
 						$("img.login-logo").css("marginLeft",180);
 						$("div.modal-content").animate({
 						    width:'550px'
@@ -216,7 +216,7 @@ $(function (){
 			}else{
 				//注册页面登录之后
 				$("#loginStatus").trigger("login");
-				afterLoginSkip();
+				afterLoginSkip(data);
 			}
 			//
 			if($("#loginModal [name='rememberMe']").is(':checked')==true){
@@ -241,7 +241,7 @@ $(function (){
 		
 	});
 });
-function afterLoginSkip(){
+function afterLoginSkip(data){
 	switch(loginBackType){
 		case -1:
 			window.location.href = window.location.href;
@@ -265,14 +265,14 @@ function afterLoginSkip(){
 			window.location.href = "/member/show/memberindex";
 			break;
 		case 8://录入产品服务信息
-			if(data.code==null){
+			if(data.code==null || data.code == ""){
 				window.location.href = '/member/show/memberindex';
 			}else{
 				window.location.href = '/member/yellowpage/show/showService/'+data.code;
 			}
 			break;
 		case 9://录入企业信息
-			if(data.code==null){
+			if(data.code==null || data.code == ""){
 				window.location.href = '/member/show/memberindex';
 			}else{
 				window.location.href = '/member/yellowpage/edit/enterprise/'+data.code;

+ 1 - 5
core/src/web/templates/member/microwebsite.html

@@ -127,11 +127,7 @@ $(function(){
 	});
 	$(".step-1 span").click(function(){
 		if(isPreview){
-			if(this.id == "editService"){
-				loginModalShow(8);
-			}else{
-				loginModalShow(9);
-			}
+			loginModalShow();
 			return;
 		}
 		$(".step-1 span").removeClass("selected");

+ 26 - 22
core/src/web/templates/swordfish/infolist.html

@@ -7,7 +7,31 @@
 <script type="text/javascript">
 	var lasttime=1,s_words,a_visitedindex,a_publishtime,le,f_id,a_interest;
 $(function(){
-	$(".swordfish-nav>ul>li:eq(3)").addClass("swordfish-nav-active");
+	$(".b-nav>ul>li:eq(3)").addClass("b-nav-active");
+	var s_words = [];
+	var a_interest = [];
+	if({{.T.msgset.o_msgset.bid.a_key}}){
+		s_words={{.T.msgset.o_msgset.bid.a_key}};
+	}
+	if({{.T.msgset.o_msgset.tender.a_key}}){
+		a_interest={{.T.msgset.o_msgset.tender.a_key}};
+	}
+	if(s_words.length!=0){
+		$("#okeywords").append(s_words.join(" ; ").replace(/\+/gm," "));
+	}else{
+		$("#zhaob").addClass("hide");
+	}
+	if(a_interest.length!=0){
+		$("#ointerest").append(a_interest.join(" ; ").replace(/\+/gm," "));
+	}else{
+		$("#zhongb").addClass("hide");
+	}
+	if(s_words.length==0 && a_interest.length==0){
+		$("#zhongb").before("关键词");
+	}
+	if(s_words.length!=0 && a_interest.length!=0){
+		$("#zhongb").append(",");
+	}
 	//
 	$.ajax({    
 		type:'post',        
@@ -38,27 +62,7 @@ $(function(){
 				a_publishtime=temp["a_publishtime"];
 				f_id=temp["_id"];
 			}
-			if({{.T.msgset.o_msgset.bid.a_key}}){
-				s_words={{.T.msgset.o_msgset.bid.a_key}};
-			}
-			if({{.T.msgset.o_msgset.tender.a_key}}){
-				a_interest={{.T.msgset.o_msgset.tender.a_key}};
-			}
-			$("#conlist").append('<div id="ycwords">'+str+'</div>');
-			if(s_words.length!=0){
-				$("#okeywords").append(s_words.join(" ; ").replace(/\+/gm," "));
-			}else{
-				$("#zhaob").addClass("hide");
-			}
-			if(a_interest.length!=0){
-				$("#ointerest").append(a_interest.join(" ; ").replace(/\+/gm," "));
-			}else{
-				$("#zhongb").addClass("hide");
-			}
-			if(s_words.length!=0 && a_interest.length!=0){
-				$("#zhongb").append(",");
-			}
-			
+			$("#conlist").append('<div id="ycwords">'+str+'</div>');			
 			//信息条总数
 			le=$(".tslist").length;
 			//

+ 1 - 1
core/src/web/templates/swordfish/rssset.html

@@ -272,7 +272,7 @@ $(function(){
 			selectKeyword("bid",msgset.bid.a_key);
 		}
 	}
-	$(".swordfish-nav>ul>li:eq(2)").addClass("swordfish-nav-active");
+	$(".b-nav>ul>li:eq(2)").addClass("b-nav-active");
 	$("#yjfk").click(function(){
 		$("body").append('<form id="feedbackForm" action="/front/web_feedbacklist.html" method="post" class="hide"><input type="hidden" name="url" value="'+window.location.href+'"></form>');
 		$("#feedbackForm").submit();

+ 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(){

+ 5 - 0
weixin/src/config.json

@@ -29,5 +29,10 @@
 		"offLinemsgtplid":"ExIeyFfoDNVJXhRDq09JbsjH_zbEJCB6gw6rxcV7atw",
 		"msgnotifytplid":"fcke7PqteAtclzHV3ScdiePH48vxaH6M5aJF0O_7by8",
 		"managernotirytplid":"dplgu5Q644vzPdqcPXY7RqgItS3eXACmU1XDl27CvTA"
+	},
+	"activity":{
+		"activitycode":"topcj",
+		"title":"新用户抽奖",
+		"picurl":"http://www.qimingxing.info/images/logo.png"
 	}
 }

+ 1 - 1
weixin/src/qfw/weixin/clickhandler.go

@@ -21,7 +21,7 @@ func ClickHandler(w ResponseWriter, r *Request) {
 					w.ReplyText("您已经提交认证信息,正在审核中,请耐心等待")
 				} else if state == 1 {
 					//w.ReplyText("身份验证通过。\n请点击<a href='http://" + wf.SysConfig.Domain + "/ent/wsite/edit/" + r.FromUserName + "'>进入微官网</a>")
-					urlstr := "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + wf.SysConfig.Appid + "&redirect_uri=http://" + wf.SysConfig.Domain + "/weixinoauth?action=msiteaction&response_type=code&scope=snsapi_base&state=1#wechat_redirect"
+					urlstr := "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + wf.SysConfig.Appid + "&redirect_uri=http://" + wf.SysConfig.Domain + "/weixinoauth/action/msiteaction&response_type=code&scope=snsapi_base&state=1#wechat_redirect"
 					w.ReplyText("身份验证通过,\n请点击<a href='" + urlstr + "'>进入微官网</a>")
 				} else if err == nil && state == -1 {
 					w.ReplyText("您提交的认证信息审核未通过,请重新提交认证信息")

+ 6 - 0
weixin/src/qfw/weixin/dao/logsdao.go

@@ -45,3 +45,9 @@ func SavePayBonusLogs(openid, billno, actname string, amount int) bool {
 		return false
 	}
 }
+
+//查找指定活动的中奖记录
+func FindWinningRecord(openid, activitycode string) bool {
+	ret := mongodb.FindOne("winningrecord", M{"s_openid": openid, "s_actcode": activitycode})
+	return ret != nil && len(*ret) > 0
+}

+ 11 - 0
weixin/src/qfw/weixin/msgtxtchandler.go

@@ -4,10 +4,12 @@ import (
 	"encoding/json"
 	"fmt"
 	"io/ioutil"
+	"log"
 	"math/rand"
 	"net"
 	"net/http"
 	"qfw/weixin/dao"
+	wf "qfw/weixinconfig"
 	"strconv"
 	"time"
 )
@@ -60,6 +62,15 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 		UserSession[r.FromUserName] = NewUserSession("robot")
 		w.ReplyText("嗨,小星来陪你解闷。有什么开心的,不开心的说说来,大伙乐呵乐呵。\n输入q或Q离开。")
 		return
+	} else if r.Content == "抽奖" { //进入抽奖环节
+		//查改用户是否已经抽过奖
+		if dao.FindWinningRecord(r.FromUserName, wf.SysConfig.Activity["activitycode"]) {
+			w.ReplyText("您已经参与过新用户抽奖活动,请关注我们的其他活动")
+		} else {
+			targeturl := fmt.Sprintf("http://%s/activity/%s/%s", wf.SysConfig.Domain, wf.SysConfig.Activity["activitycode"], se.EncodeString(r.FromUserName))
+			log.Println("choujiang url:", targeturl)
+			w.ReplyNews([]Article{Article{PicUrl: wf.SysConfig.Activity["picurl"], Title: wf.SysConfig.Activity["title"], Url: targeturl}})
+		}
 	} else {
 		//属于在线咨询,暂时直接中转到微信客服系统
 		w.Reply2CustomerService()

+ 1 - 0
weixin/src/qfw/weixinconfig/weixinconfig.go

@@ -28,6 +28,7 @@ type wxconfig struct {
 	OWelcomeTip     string            `json:"oWelcomeTip"`
 	LoginTip        string            `json:"loginTip"`
 	FreezeTip       string            `json:"freezeTip"`
+	Activity        map[string]string `json:"activity"` //活动配置
 }
 
 //系统配置