wangshan 9 жил өмнө
parent
commit
026a7cca3d

+ 7 - 7
core/src/luckdraw.json

@@ -8,31 +8,31 @@
 	},{
 		"min":50,
 		"max":85,
-		"proportion":24.2
+		"proportion":37.21
 	},{
 		"min":95,
 		"max":130,
-		"proportion":1
+		"proportion":0.5
 	},{
 		"min":140,
 		"max":175,
-		"proportion":24.2
+		"proportion":20
 	},{
 		"min":185,
 		"max":220,
-		"proportion":2
+		"proportion":1
 	},{
 		"min":230,
 		"max":265,
-		"proportion":24.2
+		"proportion":37.21
 	},{
 		"min":275,
 		"max":310,
-		"proportion":0.3
+		"proportion":0.08
 	},{
 		"min":320,
 		"max":355,
-		"proportion":24.1
+		"proportion":4
 	}],
 	"promotioncode":"2001001501",
 	"weixin":{

+ 49 - 17
core/src/qfw/active/activemanage.go

@@ -12,6 +12,7 @@ import (
 	"qfw/coreutil"
 	mob "qfw/mobile"
 	. "qfw/util"
+	"qfw/util/credit"
 	. "qfw/util/mongodb"
 	"qfw/util/redis"
 	qrpc "qfw/util/rpc"
@@ -50,7 +51,6 @@ func (a *Activemanage) Luckdraw(activecode, id string) error {
 	a.T["shareid"] = coreutil.FindMyShareId(activecode, openid)
 	//
 	if activecode == "topcj" {
-
 		f := FindOne("user", "{'s_m_openid':'"+openid+"'}")
 		username := (*f)["s_bindweixin"]
 		userid := (*f)["_id"]
@@ -66,7 +66,12 @@ func (a *Activemanage) Luckdraw(activecode, id string) error {
 				//a.T = *u
 				fmt.Println("ret:::::::::", ret, "33333333333", time.Now().Format("2006_01_02"))
 				a.T["flog"] = "A"
-				a.T["msg"] = "小主莫贪心,每人每天只有一次抽奖机会呦!分享后明天再来吧!<br/><br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
+				Tm := time.Now().AddDate(0, 0, 1)
+				if ret := redis.Get("other", "cj_"+openid+"_"+Tm.Format("2006_01_02")); ret == nil {
+					a.T["msg"] = "小主,快分享朋友圈或好友即获得明天的抽奖资格吧!千万不要再忘记了,大奖可能就在明天~"
+				} else {
+					a.T["msg"] = "小主莫贪心,每人每天只有一次抽奖机会呦!分享后明天再来吧!<br/><br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
+				}
 				return a.Render("/active/luckdraw.html", &a.T)
 			}
 		}
@@ -99,7 +104,7 @@ func (a *Activemanage) Getluckdraw() error {
 				//a.T = *u
 				fmt.Println("ret22:::::::::", ret)
 				a.T["flog"] = "A"
-				a.T["msg"] = "小主莫贪心,每人每天只有一次抽奖机会呦!分享后明天再来吧!<br/><br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
+				a.T["msg"] = "小主莫贪心,每天只有一次抽奖机会呦!分享至朋友圈或好友即可以获得明天抽奖资格呦!乖,快去分享吧!大奖可能就在明天~~"
 				return a.Write(`{"flog":"` + flog + `","msg":"` + msg + `"}`)
 			}
 			redis.Del("other", "cj_"+openid+"_"+time.Now().Format("2006_01_02"))
@@ -121,6 +126,7 @@ func (a *Activemanage) Getluckdraw() error {
 	if len(id) > 0 {
 		flog = "T"
 	}
+	//红包
 	if (i > 185 && i < 220) || (i > 320 && i < 355) {
 		var amount int //红包金额以“元”为单位,微信红包以“分”为单位
 		if i > 185 && i < 220 {
@@ -153,22 +159,28 @@ func (a *Activemanage) Getluckdraw() error {
 			redpackage["s_actcode"] = s_actcode
 			Save("redpackage", redpackage)
 		}
-	}
-	if i > 185 && i < 220 {
-		msg = "  小主是真真的好运气,五元现金红包落入您囊中!<br/><br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
-	} else if (i > 275 && i < 310) || (i > 95 && i < 130) || (i > 140 && i < 175) || (i > 320 && i < 355) {
-		//时间判断,提醒不同
-		now := time.Now()
-		//不在工作时间
-		if now.Weekday() == 6 || now.Weekday() == 0 || (now.Hour() > 18 || now.Hour() < 9) {
+		msg = "  小主是真真的好运气," + s_prize + "落入您囊中。红包将由系统自动发放到您的微信,请注意查收。<br/><br/>分享至朋友圈或好友即可以获得明天抽奖资格呦!乖,快去分享吧!大奖可能就在明天~~"
+	} else if (i > 275 && i < 310) || (i > 95 && i < 130) {
+		id := a.GetSession("userid").(string)
+		b := credit.UpuserCreditSession(id, "b6", "B", nil, a.Action)
+		if b == true {
+			//时间判断,提醒不同
+			//now := time.Now()
+			//不在工作时间
+			//if now.Weekday() == 6 || now.Weekday() == 0 || (now.Hour() > 18 || now.Hour() < 9) {
 			//
-			msg = "  小主是真真的好运气," + s_prize + "落入您囊中!<br/>  请在微信留下您的联系方式(手机号或qq号),企明星客服会在下一个工作日9:00-17:00给小主回复哦!<br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
-		} else { //在工作时间
-			msg = "  小主是真真的好运气," + s_prize + "落入您囊中,请速速微信联系企明星确认领奖事宜!<br/><br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
+			//	msg = "  小主是真真的好运气," + s_prize + "落入您囊中!<br/>  请在微信留下您的联系方式(手机号或qq号),企明星客服会在下一个工作日9:00-17:00给小主回复哦!<br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
+			//} else { //在工作时间
+			msg = "  小主是真真的好运气," + s_prize + "落入您囊中。请将您的联系方式和邮寄地址留言给企明星。我们会在活动截止后尽快为您发出。<br/><br/>分享至朋友圈或好友即可以获得明天抽奖资格呦!乖,快去分享吧!大奖可能就在明天~~"
+			//}
+		} else {
+			msg = "  抽奖出错!小主不要桑心,联系企明星管理员,200积分还是您的!"
 		}
 
+	} else if i > 140 && i < 175 {
+		msg = "  小主是真真的好运气,200积分落入您囊中。积分将由系统自动发放到您的企明星账户,请登录www.qmx.top查看。<br/><br/>分享至朋友圈或好友即可以获得明天抽奖资格呦!乖,快去分享吧!大奖可能就在明天~~"
 	} else { //不中奖
-		msg = "  小主不要桑心,这次没有中奖不代表什么,猴年依然会好运气爆棚滴~~<br/><br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
+		msg = "  小主不要桑心,这次没有中奖哦,明天记得要来拼运气啊!<br/><br/>分享至朋友圈或好友即可以获得明天抽奖资格呦!乖,快去分享吧!大奖可能就在明天~~"
 	}
 	return a.Write(`{"flog":"` + flog + `","msg":"` + msg + `","rotate":` + strconv.Itoa(int(i)) + `}`)
 
@@ -189,6 +201,26 @@ func getLuckDraw() int {
 		amount := min + rand.New(rand.NewSource(time.Now().UnixNano())).Intn(max-min)
 		if amount <= 0 {
 			return 1
+		} else if amount > 275 && amount < 310 {
+			count := Count("winningrecord", "{'s_prize':'《牛奶可乐经济学》'}")
+			if count > 6 {
+				amount = 240
+			}
+		} else if amount > 95 && amount < 130 {
+			count := Count("winningrecord", "{'s_prize':'限量版U盘'}")
+			if count > 100 {
+				amount = 260
+			}
+		} else if amount > 185 && amount < 220 {
+			count := Count("winningrecord", "{'s_prize':'五元现金红包'}")
+			if count > 200 {
+				amount = 60
+			}
+		} else if amount > 320 && amount < 355 {
+			count := Count("winningrecord", "{'s_prize':'一元现金红包'}")
+			if count > 1500 {
+				amount = 80
+			}
 		}
 		return amount
 	}
@@ -221,7 +253,7 @@ func getPrize(i int) string {
 			prize = "限量版U盘"
 
 		} else if 140 <= i && i < 175 {
-			prize = "《牛奶可乐经济学》"
+			prize = "200积分"
 
 		} else if 181 <= i && i < 226 {
 			prize = "五元现金红包"
@@ -230,7 +262,7 @@ func getPrize(i int) string {
 			prize = "《牛奶可乐经济学》"
 
 		} else if 320 <= i && i < 355 {
-			prize = "《牛奶可乐经济学》"
+			prize = "一元现金红包"
 
 		} else {
 			prize = "谢谢参与"

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

@@ -25,6 +25,7 @@ func init() {
 
 func (m *Mobile) Guide() error {
 	m.T["signature"] = GetSignature(m.Url())
+	m.T["shareid"] = cutil.FindMyShareId("topjy", m.Session().Get("s_m_openid").(string))
 	return m.Render("/swordfish/wxindex.html", &m.T)
 }
 func (m *Mobile) Share(shareid string) error {
@@ -78,7 +79,7 @@ func (m *Mobile) Wxrssset() error {
 			}
 			m.T["msgset"] = (*userInfo)["o_msgset"]
 			//取Shareid
-			m.T["shareid"] = cutil.FindMyShareId("topcj", m.Session().Get("s_m_openid").(string))
+			m.T["shareid"] = cutil.FindMyShareId("topjy", m.Session().Get("s_m_openid").(string))
 		}
 
 		return m.Render("/swordfish/wxrssset.html", &m.T)
@@ -331,6 +332,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["signature"] = GetSignature(m.Url())
+	m.T["shareid"] = cutil.FindMyShareId("topjy", m.Session().Get("s_m_openid").(string))
 	return m.Render("/swordfish/wxpush.html", &m.T)
 }
 

+ 1 - 1
core/src/timetask.json

@@ -1 +1 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-25 14:51:32"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-25 14:51:32"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-26 08:07:36"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-26 08:07:48"}},"marketisstart":true,"marketrate":300}

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


+ 1 - 1
core/src/web/templates/active/luckdraw.html

@@ -19,7 +19,7 @@
 <style>
 *{padding:0; margin:0;}
 .lotteryMain{ width:100%;}
-.lotteryBg{ width:100%; height:603px; margin:0 auto; background:url(/images/activeimages/lotteryBg.jpg) no-repeat center center; position:relative; overflow:hidden;background-size: 375px 603px;}
+.lotteryBg{ width:100%; height:100%; margin:0 auto; background:url(/images/activeimages/lotteryBg.jpg) no-repeat center center; position:relative; overflow:hidden;background-size: 375px 603px;}
 #run{ width:145px; height:145px; position:absolute; left:50%; top:50%;  margin-left:-73px; margin-top:-53px; z-index:1; transform:rotate(0deg); -ms-transform:rotate(0deg); }
 #btn_run{ width:80px; height:80px; background:url(/images/activeimages/btn_start.png) no-repeat; border:none; outline:none; position:absolute; left:50%; top:50%; margin-left:-40px; margin-top:-22px; z-index:2;cursor:pointer;background-position:0px 0px;background-size: 100% 100%;}
 </style>

+ 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>
+	var shareid="{{.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>
+	var shareid="{{.T.shareid}}";
 $(function(){
 	var hm = document.createElement("script");
 	hm.src = "//hm.baidu.com/hm.js?ed198b177e527bb53684db20bb390e77";

+ 17 - 8
core/src/web/templates/swordfish/wxshare.html

@@ -5,21 +5,30 @@
 <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
 <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0" user-scalable="no" />
 <meta name="renderer" content="webkit">
+<link href="/css/bootstrap.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="/js/bootstrap.min.js"></script>
+
 <script src="/wxswordfish/share.js"></script>
 <script>
 	initShare({{.T.signature}},{{.T.shareid}});
 </script>
-<style>
-.lotteryBg{ width:100%; height:100%; margin:0 auto; background:url(/images/activeimages/lotteryBg.jpg) no-repeat center center; position:relative; overflow:hidden;background-size: 375px 603px;}
-#run{ width:178px; height:178px; position:absolute; left:50%; top:50%;  margin-left:-90px; margin-top:-8px; z-index:1; transform:rotate(0deg); -ms-transform:rotate(0deg); }
-</style>
 </head>
 <body style="margin:0px; background-color:#C5F7FE;">
-<div class="lotteryBg" style="width: 100%;height: 603px; margin: 0 auto;background: url(/wxswordfish/images/share-cj.png) no-repeat center center; position:relative; overflow: hidden;background-size: 375px 603px">
-
-    	<img id="run" src="/front/weixinshare/{{.T.shareid}}" />
-</div>
+<img src="/wxswordfish/images/share-cj.png" class="img-responsive" alt="Cinque Terre">
+<img id="img2" style="position:absolute;" class="img-responsive" src="/front/weixinshare/{{.T.shareid}}" >
 </body>
+<script>
+$(function(){
+	var width=$(window).width();
+	var max=750
+	if(width>max){
+		width=max
+	}
+	$("#img2").css({"width":width*0.48,"top":width*0.78,"left":width*0.26})
+	
+})
+</script>
 </html>

+ 3 - 1
credit/src/config.json

@@ -36,6 +36,7 @@
         "b4_n": 3,
         "b5": 20,
         "b5_n": 2,
+        "b6": 200,
         "c1": 100,
         "c2": 80,
         "c3": 150,
@@ -67,13 +68,14 @@
         "txt_a13": "首次分享服务",
         "txt_a14": "完成首次交易",
         "txt_a15": "完成首次交易评价",
-		"txt_a61": "剑鱼首次推送",
+        "txt_a61": "剑鱼首次推送",
         "txt_a62": "完成一次性所有任务",
         "txt_b1": "签到",
         "txt_b2": "企业查询",
         "txt_b3": "发服务",
         "txt_b4": "发需求",
         "txt_b5": "分享服务/需求",
+		"txt_b6": "抽奖",
         "txt_c1": "交易",
         "txt_c2": "评价",
         "txt_c3": "邀请用户",