wangshan пре 9 година
родитељ
комит
0ffc39d88a

+ 1 - 1
common/src/qfw/util/redis/redisutil_test.go

@@ -59,5 +59,5 @@ func Test_other(t *testing.T) {
 
 func TestIncr(t *testing.T) {
 	InitRedis("sso=192.168.3.14:1379")
-	log.Println(Incr("sso", "user"))
+	log.Println(GetBytes("sso", "p_share_3200000006"))
 }

+ 4 - 0
core/src/qfw/active/activemanage.go

@@ -26,6 +26,10 @@ type Activemanage struct {
 
 //进入抽奖页面
 func (a *Activemanage) Luckdraw(activecode, id string) error {
+	userInfo := a.GetSession("userInfo").(*map[string]interface{})
+	openid := (*userInfo)["s_m_openid"].(string)
+	a.T["shareid"] = coreutil.FindMyShareId(openid)
+	//
 	if activecode == "topcj" {
 		se := SimpleEncrypt{Key: "topnet2015topnet2015"}
 		openid := se.DecodeString(id)

+ 7 - 0
core/src/qfw/coreutil/coreutil.go

@@ -0,0 +1,7 @@
+package coreutil
+
+import (
+	"qfw/util"
+)
+
+var se *util.SimpleEncrypt = &util.SimpleEncrypt{Key: "topnet2015topnet2015"}

+ 22 - 0
core/src/qfw/coreutil/share.go

@@ -0,0 +1,22 @@
+package coreutil
+
+import (
+	"fmt"
+	"qfw/util/mongodb"
+)
+
+//取到分享者的shareid
+func FindMyShareId(openid string) string {
+	//userInfo := a.GetSession("userInfo").(*map[string]interface{})
+	//openid := (*userInfo)["s_m_openid"].(string)
+	ret := mongodb.FindOne("person_share", "{'s_openid':'"+openid+"'}")
+	var shareid string
+	if (*ret)["i_shareid"] == nil {
+		id := GetShareId(TYPE_INVITE)
+		GetShareQR(id)
+		shareid = fmt.Sprintf("%d", id)
+	} else {
+		shareid = (*ret)["i_shareid"].(string)
+	}
+	return se.EncodeString(shareid)
+}

+ 20 - 13
core/src/qfw/front/webcentent.go

@@ -43,23 +43,30 @@ type Newscont struct {
 	getJsonList xweb.Mapper `xweb:"POST /front/(\\w+)list/list"`
 	//微信端使用通用信息展示页
 	weixincontent xweb.Mapper `xweb:"GET /front/weixincontent/(\\w+)"`
-	//微信分享内容
-	weixinshare xweb.Mapper `xweb:"GET /front/weixinshare"`
+	//取微信分享图片
+	weixinshare xweb.Mapper `xweb:"GET /front/weixinshare/([^.]*)"`
 }
 
-//微信分享内容
+//取微信分享图片
 
-func (e *Newscont) Weixinshare() error {
-	id := coreutil.GetShareId(coreutil.TYPE_INVITE)
-	var pngdata = ""
-	if ret := redis.Get("sso", fmt.Sprintf("p_share_%d", id)); ret != nil {
-		return e.SetBody([]byte(ret.(string)))
+func (e *Newscont) Weixinshare(pid string) error {
+	var pngdata = []byte{}
+	if ret, _ := redis.GetBytes("sso", fmt.Sprintf("p_share_%s", pid)); ret != nil {
+		pngdata = *ret
 	} else {
-		pngdata = coreutil.GetShareQR(id)
-	}
-	e.T["pngdata"] = pngdata
-	fmt.Println("pngdata:", pngdata, "000000:", fmt.Sprintf("p_share_%d", id))
-	return e.Render("/manage/web_weixinshare.html", &e.T)
+		id := coreutil.GetShareId(coreutil.TYPE_INVITE)
+		coreutil.GetShareQR(id)
+		tmp, _ := redis.GetBytes("sso", fmt.Sprintf("p_share_%d", id))
+		pngdata = *tmp
+	}
+	w := e.ResponseWriter
+	w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
+	w.Header().Set("Pragma", "no-cache")
+	w.Header().Set("Expires", "0")
+	w.Header().Set("Content-Type", "image/png")
+	w.Write(pngdata)
+	return nil
+
 }
 
 //文章点赞

+ 14 - 0
core/src/qfw/manage/feedback.go

@@ -7,9 +7,11 @@ package manage
 import (
 	"fmt"
 	. "gopkg.in/mgo.v2/bson"
+	"qfw/coreutil"
 	"qfw/util"
 	. "qfw/util/mongodb"
 	. "qfw/util/msg"
+	qrpc "qfw/util/rpc"
 	"strings"
 )
 
@@ -139,6 +141,18 @@ func (s *SystemManage) Updateback() error {
 		if Update("interaction", "{'_id':'"+_id+"'}", &data2, false, false) {
 			flag = "true"
 			msg = "修改成功!"
+			//
+			f := FindOne("user", "{'_id':'"+s_submitid+"'}")
+			if (*f)["s_m_openid"] != nil {
+				openid := (*f)["s_m_openid"].(string)
+				s_result := "意见反馈处理结果"
+				s_detail := s.GetString("s_opinion")
+				s_remark := s.GetString("s_record")
+				go func() {
+					coreutil.SendManagerNotifyMsg(&qrpc.NotifyMsg{Openid: openid, Title: s_result, Detail: s_detail, Remark: s_remark})
+				}()
+			}
+
 		} else {
 			flag = "false"
 			msg = "修改失败!"

+ 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-19 09:51:19"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-19 09:51:19"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-20 08:18:24"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-20 08:18:24"}},"marketisstart":true,"marketrate":300}

+ 4 - 4
core/src/web/staticres/wxswordfish/share.js

@@ -1,4 +1,4 @@
-function initShare(signature){
+function initShare(signature,shareid){
 	if(typeof(signature) != "undefined" && signature != null && signature.length == 4){
 		wx.config({
 		    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
@@ -11,7 +11,7 @@ function initShare(signature){
 		wx.ready(function () {
 	        wx.onMenuShareTimeline({
 			    title: '剑鱼招标订阅免费用,关注即可抽取iPad mini。', // 分享标题
-			    link: 'http://www.qimingxing.info/swordfish/share', // 分享链接
+			    link: 'http://www.qimingxing.info/front/weixinshare/'+shareid, // 分享链接
 			    imgUrl: 'http://www.qimingxing.info/wxswordfish/images/share-icon.png', // 分享图标
 			    success: function () { 
 			       //alert('分享成功');
@@ -24,9 +24,9 @@ function initShare(signature){
 			wx.onMenuShareAppMessage({
 			    title: '剑鱼招标订阅免费用,关注即可抽取iPad mini。', // 分享标题
 			    desc: '关注微信并设置剑鱼关键词,全国招标信息统统推送给您!', // 分享描述
-			    link: 'http://www.qimingxing.info/swordfish/share', // 分享链接
+			    link: 'http://www.qimingxing.info/front/weixinshare/'+shareid, // 分享链接
 			    imgUrl: 'http://www.qimingxing.info/wxswordfish/images/share-icon.png', // 分享图标
-			    type: 'link', // 分享类型,music、video或link,不填默认为link
+			    type: 'link', // 分享类型,music、video或link,不填默认为link'
 			    dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
 			    success: function () { 
 			        //alert('分享成功');

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

@@ -14,7 +14,7 @@
 <script src="/wxswordfish/share.js"></script>
 <script src="/js/bootstrap.min.js"></script>
 <script>
-	initShare({{.T.signature}});
+	initShare({{.T.signature}},{{.T.shareid}});
 </script>
 <style>
 *{padding:0; margin:0;}