瀏覽代碼

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

wangshan 9 年之前
父節點
當前提交
0a213f160c

+ 1 - 0
core/src/message.json

@@ -6,6 +6,7 @@
 	"lawsearchaction":"/law/qfw/index",
 	"msiteaction":"/ent/wsite/edit",
 	"wxpushlist":"/wxpush/bidinfo/%s",
+	"turncards":"/active/flop/in/in",
 	"indentify":{
 		"success":{
 			"result":"企业认证",

+ 1 - 1
core/src/qfw/active/active.go

@@ -10,7 +10,7 @@ var se util.SimpleEncrypt = util.SimpleEncrypt{Key: "topnet2015topnet2015"}
 
 type Active struct {
 	*xweb.Action
-	flop     xweb.Mapper `xweb:"/active/flop/(.*)"`
+	flop     xweb.Mapper `xweb:"/active/flop/(.*)/(.*)"`
 	flopAjax xweb.Mapper `xweb:"/active/flopAjax"`
 }
 

+ 57 - 54
core/src/qfw/active/flop.go

@@ -30,48 +30,51 @@ func (a *Active) FlopAjax() error {
 }
 
 //进入翻牌
-func (a *Active) Flop(encryptOpenid string) error {
-	//判断活动是否结束
-	if coreconfig.Flop.IsOver {
-		a.T["IsOver"] = true
-	} else {
-		a.T["IsOver"] = false
-		openid := flopEncrypt.DecodeString(encryptOpenid)
-		var flag int = 3             //标识
-		var cardType int = 1         //翻牌的类型
-		var multiple int = 2         //倍数
-		var nickName, words string   //昵称、牌上的文字
-		var oldCredit, newCredit int //新、老积分
-		var getFlopData = func() {
-			if data := mongodb.FindOne("flop", bson.M{"s_openid": openid}); data != nil && len(*data) > 0 {
-				nickName = (*data)["s_nickname"].(string)
-				oldCredit = util.IntAll((*data)["i_oldcredit"])
-				newCredit = util.IntAll((*data)["i_newcredit"])
-				cardType = util.IntAll((*data)["i_type"])
-				words = (*data)["s_words"].(string)
-				nickName = (*data)["s_nickname"].(string)
-				multiple = util.IntAll((*data)["i_multiple"])
-			}
+func (a *Active) Flop(reqType string, encryptOpenid string) error {
+	if reqType == "in" && a.GetSession("s_m_openid") != nil {
+		return a.Redirect("/active/flop/flop/" + flopEncrypt.EncodeString(a.GetSession("s_m_openid").(string)))
+	}
+	var flag int = 3             //标识
+	var cardType int = 1         //翻牌的类型
+	var multiple int = 2         //倍数
+	var nickName, words string   //昵称、牌上的文字
+	var oldCredit, newCredit int //新、老积分
+	openid := flopEncrypt.DecodeString(encryptOpenid)
+	var getFlopData = func() {
+		if data := mongodb.FindOne("flop", bson.M{"s_openid": openid}); data != nil && len(*data) > 0 {
+			nickName = (*data)["s_nickname"].(string)
+			oldCredit = util.IntAll((*data)["i_oldcredit"])
+			newCredit = util.IntAll((*data)["i_newcredit"])
+			cardType = util.IntAll((*data)["i_type"])
+			words = (*data)["s_words"].(string)
+			nickName = (*data)["s_nickname"].(string)
+			multiple = util.IntAll((*data)["i_multiple"])
 		}
-		//分享出去
-		if a.GetSession("userId") == nil || a.GetSession("s_m_openid") == nil || a.GetSession("i_credit") == nil {
-			getFlopData()
-			a.T["shareid"] = coreutil.FindMyShareId("topflop", openid)
-		} else { //可以翻牌
-			s_openid := a.GetSession("s_m_openid").(string)
-			encryptOpenid = flopEncrypt.EncodeString(s_openid)
-			if a.GetSession("nickName") != nil {
-				nickName = a.GetSession("nickName").(string)
-			}
-			data := mongodb.FindOne("flop", bson.M{"s_openid": s_openid})
-			if data == nil || len(*data) == 0 {
-				oldCredit = a.GetSession("i_credit").(int)
-				multiple = getMultiple()
-				newCredit = oldCredit * multiple
-				//翻牌类型
-				card := coreconfig.Flop.Cards[rand.New(rand.NewSource(time.Now().UnixNano())).Intn(6)]
-				cardType = util.IntAll(card["type"])
-				words = card["words"].(string)
+	}
+	//分享出去
+	if reqType == "share" || a.GetSession("userId") == nil || a.GetSession("s_m_openid") == nil || a.GetSession("i_credit") == nil {
+		getFlopData()
+		a.T["shareid"] = coreutil.FindMyShareId("topflop", openid)
+	} else { //可以翻牌
+		s_openid := a.GetSession("s_m_openid").(string)
+		encryptOpenid = flopEncrypt.EncodeString(s_openid)
+		if a.GetSession("nickName") != nil {
+			nickName = a.GetSession("nickName").(string)
+		}
+		data := mongodb.FindOne("flop", bson.M{"s_openid": s_openid})
+		if data == nil || len(*data) == 0 {
+			oldCredit = a.GetSession("i_credit").(int)
+			multiple = getMultiple()
+			newCredit = oldCredit * multiple
+			//翻牌类型
+			card := coreconfig.Flop.Cards[rand.New(rand.NewSource(time.Now().UnixNano())).Intn(6)]
+			cardType = util.IntAll(card["type"])
+			words = card["words"].(string)
+			//判断活动是否结束
+			if coreconfig.Flop.IsOver {
+				a.T["IsOver"] = true
+			} else {
+				a.T["IsOver"] = false
 				a.SetSession("flopData", bson.M{
 					"s_userid":     a.GetSession("userId").(string),
 					"s_openid":     s_openid,
@@ -83,22 +86,22 @@ func (a *Active) Flop(encryptOpenid string) error {
 					"s_nickname":   nickName,
 					"i_multiple":   multiple,
 				})
-				flag = 1
-			} else {
-				getFlopData()
-				flag = 2
 			}
+			flag = 1
+		} else {
+			getFlopData()
+			flag = 2
 		}
-		a.T["openid"] = encryptOpenid
-		a.T["cardType"] = cardType
-		a.T["oldCredit"] = oldCredit
-		a.T["newCredit"] = newCredit
-		a.T["words"] = words
-		a.T["nickName"] = nickName
-		a.T["flag"] = flag
-		a.T["multiple"] = multiple
-		a.T["signature"] = mobile.GetSignature(a.Url())
 	}
+	a.T["signature"] = mobile.GetSignature(a.Url())
+	a.T["openid"] = encryptOpenid
+	a.T["cardType"] = cardType
+	a.T["oldCredit"] = oldCredit
+	a.T["newCredit"] = newCredit
+	a.T["words"] = words
+	a.T["nickName"] = nickName
+	a.T["flag"] = flag
+	a.T["multiple"] = multiple
 	return a.Render("/active/flop.html", &a.T)
 }
 

二進制
core/src/web/staticres/images/flop/bubble.png


+ 133 - 125
core/src/web/templates/active/flop.html

@@ -2,12 +2,13 @@
 <head>
 <title>猴年翻福牌,翻来好运气</title>
 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+<meta content="telephone=no" name="format-detection" />
 <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="{{Msg "seo" "cdn"}}/js/jquery.js"></script>
 <script>
 var signature = {{.T.signature}};
 var shareTitle = "{{.T.nickName}}在2016年{{.T.words}}";
-var shareLink = "http://www.qimingxing.info/active/flop/{{.T.openid}}";
+var shareLink = "http://www.qimingxing.info/active/flop/share/{{.T.openid}}";
 var shareIcon = "http://www.qimingxing.info/images/flop/blessing.png";
 if(typeof(signature) != "undefined" && signature != null && signature.length == 4){
 	wx.config({
@@ -55,15 +56,17 @@ body{
 	-webkit-tap-highlight-color: transparent;
 	background-color: #B63845;
 	font-size: 100%;
-	text-align: center;
+}
+.page{
+	margin: 0px auto;
+	max-width: 750px;
+	position: relative;
+	background-size: 100% 100%;
+	height: 100%;
 }
 img{
 	vertical-align: sub;
 }
-.body-bg{
-	width: 100%;
-	height: 100%;
-}
 .btn{
 	width: 180px;
 	height: 43px;
@@ -78,7 +81,7 @@ img{
 	top: 0px;
 	width: 97.5px;
 	height: 53px;
-	display: none;
+	z-index: 1;
 }
 .cards{
 	position: absolute;
@@ -88,12 +91,12 @@ img{
 	display: none;
 }
 .cards>img{
-	width: 250px;
-	height: 282.4px;
+	width: 212.5px;
+	height: 240px;
 }
 .flop-tip{
 	color: #a52f2e;
-	background-image: url("/images/flop/tip-bg.png");
+	background-image: url("{{Msg "seo" "cdn"}}/images/flop/tip-bg.png");
 	background-size: 100% 100%;
 	position: absolute;
 	width: 280px;
@@ -116,10 +119,10 @@ img{
 	font-weight: normal;
 }
 .multiple{
-	font-size: 1.375em;
+	font-size: 1.75em;
 	text-align: center;
 	position: relative;
-	width: 15px;
+	width: 20px;
 	display: inline-block;
 	vertical-align: top;
 	overflow: hidden;
@@ -127,7 +130,7 @@ img{
 }
 .flop-notice{
 	color: #ffa461;
-	background-image: url("/images/flop/flop-notice.png");
+	background-image: url("{{Msg "seo" "cdn"}}/images/flop/flop-notice.png");
 	background-size: 100% 100%;
 	position: absolute;
 	top: 30px;
@@ -185,130 +188,135 @@ ul{
 .random li{
 	height: 25px;
 }
+.page-before{
+	background-image: url("{{Msg "seo" "cdn"}}/images/flop/bg-1.png");
+}
+.page-after{
+	background-image: url("{{Msg "seo" "cdn"}}/images/flop/bg-2.png");
+}
 </style>
 </head>
 <body>
-<img src="/images/flop/bubble.png" class="bubble">
-{{if eq .T.flag 1}}
-<img src="/images/flop/bg-1.png" class="body-bg" id="flop-before">
-{{end}}
-<img src="/images/flop/bg-2.png" class="body-bg" id="flop-after"{{if eq .T.flag 1}} style="display: none;"{{end}}>
-<div class="flop-notice">
-	<span>{{.T.nickName}}</span>,您的猴年福牌是:
-</div>
-<div class="cards">
-	{{if eq .T.flag 1}}<img src="/images/flop/card.png">{{end}}
-	<img src="/images/flop/card-{{.T.cardType}}.png"{{if eq .T.flag 1}} style="display: none;"{{end}}>
-</div>
-{{if eq .T.flag 1}}
-<img src="/images/flop/btn.png" class="btn">
-{{else if eq .T.flag 3}}
-<div class="flop-share">
-	<img src="/front/weixinshare/{{.T.shareid}}">
-	<div>
-		长按图片识别二维码<br>
-		您也可以测福牌
+<img src="{{Msg "seo" "cdn"}}/images/flop/bubble.png" class="bubble"{{if eq .T.flag 1}} style="display: none;"{{end}}>
+<div class="page{{if eq .T.flag 1}} page-before{{else}} page-after{{end}}">
+	<div class="flop-notice">
+		<span>{{.T.nickName}}</span>,您的猴年福牌是:
+	</div>
+	<div class="cards">
+		{{if eq .T.flag 1}}<img src="{{Msg "seo" "cdn"}}/images/flop/card.png">{{end}}
+		<img src="{{Msg "seo" "cdn"}}/images/flop/card-{{.T.cardType}}.png"{{if eq .T.flag 1}} style="display: none;"{{end}}>
 	</div>
-</div>
-{{end}}
-<div class="flop-tip">
-	恭喜!你的企明星积分翻
-	<span class="multiple">
 	{{if eq .T.flag 1}}
-	<ul class="random">
-		<li>7</li>
-		<li>3</li>
-		<li>6</li>
-		<li>8</li>
-		<li>5</li>
-		<li>9</li>
-		<li>2</li>
-	</ul>
-	{{else if eq .T.flag 2}}
-	{{.T.multiple}}
+	<img src="{{Msg "seo" "cdn"}}/images/flop/btn.png" class="btn">
+	{{else if eq .T.flag 3}}
+	<div class="flop-share">
+		<img src="/front/weixinshare/{{.T.shareid}}">
+		<div>
+			长按图片识别二维码<br>
+			您也可以测福牌
+		</div>
+	</div>
 	{{end}}
-	</span>倍!<br>
-	您的积分已从{{.T.oldCredit}}分涨到{{.T.newCredit}}分。<br>
-	<font>积分明细请到企明星(www.qmx.top)查询!</font>
+	<div class="flop-tip">
+		恭喜!你的企明星积分翻
+		<span class="multiple">
+		{{if eq .T.flag 1}}
+		<ul class="random">
+			<li>7</li>
+			<li>3</li>
+			<li>6</li>
+			<li>8</li>
+			<li>5</li>
+			<li>9</li>
+			<li>2</li>
+		</ul>
+		{{else if eq .T.flag 2}}
+		{{.T.multiple}}
+		{{end}}
+		</span>倍!<br>
+		您的积分已从{{.T.oldCredit}}分涨到{{.T.newCredit}}分。<br>
+		<font>积分明细请到企明星(www.qmx.top)查询!</font>
+	</div>
 </div>
 <script type="text/javascript">
 if({{.T.IsOver}}){
 	alert("活动已经结束!");
-}else{
-	$(function(){
-		var windowWidth = $(window).width();
-		var windowHeight = $(window).height();
-		var defaultWidth = 320;
-		var defaultHeight = 416;
-		var width = 250;
-		var height = 282.4;
-		var cardTop = 120;
-		var noticeTop = 80;
-		if(windowWidth > 750){
-			$(".body-bg").css({width: 750,height: windowHeight});
-		}
-		if(windowHeight > defaultHeight){
-			cardTop = cardTop / defaultHeight * windowHeight;
-			noticeTop = noticeTop / defaultHeight * windowHeight;
+}
+$(function(){
+	var windowWidth = $(window).width();
+	var windowHeight = $(window).height();
+	var defaultWidth = 320;
+	var defaultHeight = 416;
+	var width = 212.5;
+	var height = 240;
+	var cardTop = 110;
+	var noticeTop = 70;
+	if(windowHeight > defaultHeight){
+		cardTop = cardTop / defaultHeight * windowHeight;
+		noticeTop = noticeTop / defaultHeight * windowHeight;
+	}
+	if(windowWidth > defaultWidth && windowHeight > defaultHeight){
+		width = width / defaultWidth * windowWidth;
+		if(width > 350){//最大宽度350
+			width = 350
 		}
-		if(windowWidth > defaultWidth && windowHeight > defaultHeight){
-			width = width / defaultWidth * windowWidth;
-			if(width > 350){//最大宽度350
-				width = 350
+		height = width / 625 * 706;
+		$(".cards>img").css({width: width,height: height});
+	}
+	$(".cards").css({top: cardTop}).show();
+	$(".flop-notice").css({top: noticeTop});
+	var flopTipTop = windowHeight - $(".cards").height()  - cardTop - $(".flop-tip").height();
+	if(flopTipTop > 30 && flopTipTop < 40){
+		$(".flop-tip").css({"line-height": "30px",top: $(".cards").height() + cardTop - 20});
+	}else if(flopTipTop > 40){
+		$(".flop-tip").css({"line-height": "30px",top: $(".cards").height() + cardTop - 10});
+	}else{
+		$(".flop-tip").css({top: $(".cards").height()+cardTop-20});
+	}
+	//
+	{{if eq .T.flag 1}}
+		$(".btn").css({top: $(".cards").height()+cardTop}).show();
+		$(".btn").one("click",function(){
+			if({{.T.IsOver}}){
+				alert("活动已经结束!");
+				return;
 			}
-			height = width / 625 * 706;
-			$(".cards>img").css({width: width,height: height});
-		}
-		$(".cards").css({top: cardTop}).show();
-		$(".flop-notice").css({top: noticeTop});
-		var flopTipTop = windowHeight - $(".cards").height()  - cardTop - $(".flop-tip").height();
-		if(flopTipTop > 30 && flopTipTop < 40){
-			$(".flop-tip").css({"line-height": "30px",top: $(".cards").height() + cardTop - 20});
-		}else if(flopTipTop > 40){
-			$(".flop-tip").css({"line-height": "30px",top: $(".cards").height() + cardTop - 10});
-		}else{
-			$(".flop-tip").css({top: $(".cards").height()+cardTop-30});
-		}
-		//
-		{{if eq .T.flag 1}}
-			$(".btn").css({top: $(".cards").height()+cardTop}).show();
-			$(".btn").one("click",function(){
-				//
-				$.post("/active/flopAjax",null,null);
-				$("#flop-before,.btn").hide();
-				$("#flop-after,.flop-tip,.flop-notice").show();
-				var randomInterval = setInterval(function(){
-					$(".random").css({top : "-27px"});
-					$(".random").append($(".random li:first"));
-				},20);
-				setTimeout(function(){
-					clearInterval(randomInterval);
-					$(".multiple").html({{.T.multiple}});
-				},1000);
-				setTimeout(function(){
-					$(".bubble").fadeIn();
-				},3000);
-				$('.cards').children('img:first').stop().animate({'width':0},100,function(){
-					$(this).hide().next().show();
-					$(this).next().animate({'width':width+'px'},500);
-				});
+			//
+			$.post("/active/flopAjax",null,null);
+			$(".page").addClass("page-after").removeClass("page-before");
+			$(".btn").hide();
+			$(".flop-tip,.flop-notice").show();
+			var randomInterval = setInterval(function(){
+				$(".random").css({top : "-24px"});
+				$(".random").append($(".random li:first"));
+			},20);
+			setTimeout(function(){
+				clearInterval(randomInterval);
+				$(".multiple").html({{.T.multiple}});
+			},1000);
+			setTimeout(function(){
+				$(".bubble").fadeIn();
+			},3000);
+			$('.cards').children('img:first').stop().animate({'width':0},500,function(){
+				$(this).hide().next().show();
+				$(this).next().animate({'width':width+'px'},200);
 			});
-		{{else}}
-			$(".flop-notice").show();
-		{{end}}
-		{{if eq .T.flag 2}}
-			$(".flop-tip").show();
-		{{end}}
-		{{if eq .T.flag 3}}
-			var shareHeight = windowHeight - cardTop - height + 30;
-			if(shareHeight > 110){
-				shareHeight = 110;
-			}
-			$(".flop-share").css({height: shareHeight});
-			$(".flop-share>img").css({width: shareHeight-20,height: shareHeight-20});
-		{{end}}
-	});
-}
+		});
+	{{else}}
+		$(".flop-notice").show();
+	{{end}}
+	{{if eq .T.flag 2}}
+		$(".flop-tip").show();
+	{{end}}
+	{{if eq .T.flag 3}}
+		var shareHeight = windowHeight - cardTop - height + 30;
+		if(shareHeight > 110){
+			shareHeight = 110;
+		}
+		$(".flop-share").css({height: shareHeight});
+		$(".flop-share>img").css({width: shareHeight-20,height: shareHeight-20});
+	{{end}}
+});
 </script>
 </body>
 </html>

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

@@ -36,7 +36,7 @@
 				{{if .T.msgset}}
 					{{if .T.msgset.tender}}
 						{{if .T.msgset.tender.day}}
-							{{if gt 6 .T.msgset.tender.day}}
+							{{if and (gt 6 .T.msgset.tender.day) (gt .T.msgset.tender.day 0)}}
 							本栏目推送服务期还剩<span style="color:red"> {{.T.msgset.tender.day}} </span>天。想要服务不间断,请确保积分充足。 <a href="/member/credit/myCredit">去做任务赚积分</a>
 							{{end}}
 						{{end}}
@@ -72,7 +72,7 @@
 				{{if .T.msgset}}
 					{{if .T.msgset.bid}}
 						{{if .T.msgset.bid.day}}
-							{{if gt 6 .T.msgset.bid.day}}
+							{{if and (gt 6 .T.msgset.bid.day) (gt .T.msgset.bid.day 0)}}
 							本栏目推送服务期还剩<span style="color:red"> {{.T.msgset.bid.day}} </span>天。想要服务不间断,请确保积分充足。 <a href="/member/credit/myCredit">去做任务赚积分</a>
 							{{end}}
 						{{end}}

+ 2 - 1
weixin/src/config.json

@@ -32,7 +32,8 @@
 	"activity":{
 		"activitycode":"topcj",
 		"title":"企明星新年抽奖活动进行中",
-		"picurl":"http://www.qimingxing.info/images/choujiang2.png"
+		"picurl":"http://www.qimingxing.info/images/choujiang2.png",
+		"tuenCards":"小主,来抢新年福牌了!\n剑鱼君派送神秘福牌!\n<a href='%s'>小主快快点这里翻福牌!</a>",
 	},"weixinautorpl":"小主的吩咐我们已经收到了,请留下您的联系方式(手机号或qq号),企明星客服会在下一个工作日9:00-17:00给小主回复哦!",
 	"creditRpc":"127.0.0.1:8765",
 	"subscribemonitorcyc":3,

+ 12 - 3
weixin/src/qfw/weixin/msgtxtchandler.go

@@ -22,7 +22,12 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 			if us.Type == "robot" {
 				w.ReplyText("再见了小主人,记得想我呦。")
 			} else {
-				w.ReplyText("您已经退出企明星会员认证程序。")
+				if us.Type == "wxadmin" {
+					w.ReplyText("您已经退出微信管理。")
+
+				} else {
+					w.ReplyText("您已经退出企明星会员认证程序。")
+				}
 			}
 			delete(UserSession, r.FromUserName)
 		}
@@ -37,16 +42,20 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 		}
 	} else if r.Content == "微信管理" && mids[openid] {
 		UserSession[r.FromUserName] = NewUserSession("wxadmin")
-		w.ReplyText("您已进入微信管理,请输入指令操作:\n1.查看抽奖模式(指令:f0)\n2.切换抽奖模式(指令:c*,*为数字。如c0(自动模式),c1(手动模式1),c2(手动模式2),c3(手动模式3))\n3.统计抽奖结果(tjr*,tjr120(最近两分钟),tjr120-1200(最近两分钟至最近20分钟之间的))\n4.统计新用户数(tju*)\n5.服务器情况监测(ser0)\n6服务管理(man*,man1重启主程序(man11关闭),man2重启微信,man3重启积分(man33关闭),man4重启微信认证(man44关闭))。\n输入q或Q离开。")
+		w.ReplyText("您已进入微信管理,请输入指令操作:\n1.查看抽奖模式(指令:f0)\n2.切换抽奖模式(指令:c*,*为数字。如c0(自动模式),c1(手动模式1),c2(手动模式2),c3(手动模式3))\n3.统计抽奖结果(tjr*,tjr120(最近两分钟),tjr120-1200(最近两分钟至最近20分钟之间的))\n4.统计新用户数(tju*)\n5.服务器情况监测(ser0)\n6服务管理(man*,man1重启主程序(man11关闭),man3重启积分(man33关闭),man4重启微信认证(man44关闭))。\n输入q或Q离开。")
 		return
 	} else if r.Content == "抽奖" { //进入抽奖环节
-		if time.Now().Unix() > 1455465600 { //活动过期 ,过期后,这段代码要删除
+		if time.Now().Unix() > 1455552000 { //活动过期 ,过期后,这段代码要删除
 			//TODO
 			w.ReplyText("抱歉,活动已结束!敬请期待下一次抽奖活动,注意看预告哟……")
 		} else {
 			targeturl := fmt.Sprintf("http://%s/activity/%s/%s", wf.SysConfig.Domain, wf.SysConfig.Activity["activitycode"], se.EncodeString(r.FromUserName))
 			w.ReplyNews([]Article{Article{PicUrl: wf.SysConfig.Activity["picurl"], Title: wf.SysConfig.Activity["title"], Url: targeturl}})
 		}
+	} else if r.Content == "翻牌" { //进入抽奖环节
+		targeturl := fmt.Sprintf("https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=http://%s/weixinoauth/action/%s&response_type=code&scope=snsapi_base&state=1#wechat_redirect", wf.SysConfig.Appid, wf.SysConfig.Domain, "turncards")
+		//w.ReplyNews([]Article{Article{Title: wf.SysConfig.Activity["tuenCards"], Url: targeturl,Description:}})
+		w.ReplyText(fmt.Sprintf(wf.SysConfig.Activity["tuenCards"], targeturl))
 	} else if strings.HasPrefix(r.Content, "内部报名") { //绑定拓普员工姓名
 		tmp := strings.Fields(r.Content)
 		//log.Println(tmp, len(tmp))

+ 7 - 6
weixin/src/qfw/weixin/wxadmin.go

@@ -16,11 +16,10 @@ import (
 
 func processWxAdmin(openid, content string, w ResponseWriter, r *Request) {
 	util.Try(func() {
-
 		if openid != "" {
 			b, cmd, qleng, unit, var1, var2 := checkContent(content)
 			if b {
-				resStr := "结果"
+				resStr := "结果:"
 				switch cmd {
 				case "f":
 					//查看抽奖模式
@@ -39,7 +38,7 @@ func processWxAdmin(openid, content string, w ResponseWriter, r *Request) {
 					qu1 := M{"$gte": var1}
 					if qleng == 2 { //取区间
 						qu1 = M{"$gte": var2, "$lte": var1}
-					} else {
+					} else if qleng != 1 {
 						w.ReplyText("指令异常,请重新输入。")
 						return
 					}
@@ -64,7 +63,7 @@ func processWxAdmin(openid, content string, w ResponseWriter, r *Request) {
 					qu1 := M{"$gte": var1}
 					if qleng == 2 { //取区间
 						qu1 = M{"$gte": var2, "$lte": var1}
-					} else {
+					} else if qleng != 1 {
 						w.ReplyText("指令异常,请重新输入。")
 						return
 					}
@@ -77,7 +76,7 @@ func processWxAdmin(openid, content string, w ResponseWriter, r *Request) {
 						if res != nil && len(res) > 0 {
 							sum := 0
 							for _, v := range res {
-								resStr += "\n" + util.If(v["_id"] == nil, "黑名单用户", "正常用户").(string) + ":" + fmt.Sprintf("%x", v["count"])
+								resStr += "\n" + util.If(v["_id"] == nil, "正常用户", "黑名单用户").(string) + ":" + fmt.Sprintf("%d", v["count"].(int))
 								sum += v["count"].(int)
 							}
 							resStr += "\n" + "总数:" + fmt.Sprintf("%d", sum)
@@ -106,11 +105,13 @@ func processWxAdmin(openid, content string, w ResponseWriter, r *Request) {
 						resStr = "关闭主程序完成"
 					case 2:
 						//重启weixin
+						/**
 						cmdstr := getNewCmd(DIR+"/weixin", "weixin")
 						if len(cmdstr) > 0 {
 							execCmd(DIR+"/weixin", "weixin", cmdstr, true)
 						}
-						resStr = "重启微信程序完成"
+						**/
+						resStr = "不支持重启微信"
 					case 22:
 						//不能关闭微信
 						break