Browse Source

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

zhangjinkun@topnet.net.cn 9 years ago
parent
commit
f53f5a6f74

+ 2 - 2
core/src/qfw/active/activemanage.go

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

+ 0 - 2
core/src/qfw/coreutil/weixinrpc.go

@@ -1,7 +1,6 @@
 package coreutil
 
 import (
-	"fmt"
 	"log"
 	"net/rpc"
 	"qfw/coreconfig"
@@ -91,6 +90,5 @@ func GetShareQR(url uint32) string {
 	if err != nil {
 		log.Println(err.Error())
 	}
-	fmt.Println("ret:::::::::::", ret)
 	return ret
 }

+ 1 - 0
core/src/qfw/front/front.go

@@ -13,4 +13,5 @@ func init() {
 	xweb.AddAction(&CaptchaComponent{})
 	xweb.AddAction(&Newscont{})
 	xweb.AddAction(&Appointment{})
+	xweb.AddAction(&Weixinshare{})
 }

+ 0 - 25
core/src/qfw/front/webcentent.go

@@ -11,7 +11,6 @@ import (
 	"github.com/go-xweb/xweb"
 	"html/template"
 	"log"
-	"qfw/coreutil"
 	"qfw/util"
 	"qfw/util/elastic"
 	. "qfw/util/mongodb"
@@ -43,30 +42,6 @@ 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/([^.]*)"`
-}
-
-//取微信分享图片
-
-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 {
-		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
-
 }
 
 //文章点赞

+ 34 - 0
core/src/qfw/front/weixinshare.go

@@ -0,0 +1,34 @@
+package front
+
+import (
+	"fmt"
+	"github.com/go-xweb/xweb"
+	"qfw/coreutil"
+	"qfw/util/redis"
+)
+
+type Weixinshare struct {
+	*xweb.Action
+	weixinshare xweb.Mapper `xweb:"/front/weixinshare/([^.]*)"`
+}
+
+//取微信分享图片
+
+func (e *Weixinshare) Weixinshare(pid string) error {
+	var pngdata = []byte{}
+	if ret, _ := redis.GetBytes("sso", fmt.Sprintf("p_share_%s", pid)); ret != nil {
+		pngdata = *ret
+	} else {
+		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
+}

+ 5 - 2
core/src/qfw/manage/feedback.go

@@ -146,8 +146,11 @@ func (s *SystemManage) Updateback() error {
 			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")
+				if len(title) > 20 {
+					title = title[:20] + "..."
+				}
+				s_detail := "以下是对你提交“" + title + "”意见的回复内容"
+				s_remark := s.GetString("s_opinion")
 				go func() {
 					coreutil.SendManagerNotifyMsg(&qrpc.NotifyMsg{Openid: openid, Title: s_result, Detail: s_detail, Remark: s_remark})
 				}()

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

@@ -11,7 +11,7 @@ type Mobile struct {
 	detail        xweb.Mapper `xweb:"/ent/(.*)/detail/(.*)/(.*)"`
 	pageerror     xweb.Mapper `xweb:"/ent/(.*)/505"`
 	guide         xweb.Mapper `xweb:"/swordfish/guide"`
-	share         xweb.Mapper `xweb:"/swordfish/share"`
+	share         xweb.Mapper `xweb:"/swordfish/share/([^.]*)"`
 	wxrssset      xweb.Mapper `xweb:"/swordfish/page"`
 	getMyCredit   xweb.Mapper `xweb:"/member/credit/getcredit"`
 	swordfishPay  xweb.Mapper `xweb:"/member/credit/swordfishpay"`

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

@@ -7,7 +7,7 @@ import (
 	"math/rand"
 	"net/rpc"
 	"qfw/coreconfig"
-	"qfw/coreutil"
+	cutil "qfw/coreutil"
 	"qfw/util"
 	"qfw/util/credit"
 	"qfw/util/mongodb"
@@ -27,7 +27,8 @@ func (m *Mobile) Guide() error {
 	m.T["signature"] = GetSignature(m.Url())
 	return m.Render("/swordfish/wxindex.html", &m.T)
 }
-func (m *Mobile) Share() error {
+func (m *Mobile) Share(shareid string) error {
+	m.T["shareid"] = shareid
 	m.T["signature"] = GetSignature(m.Url())
 	return m.Render("/swordfish/wxshare.html", &m.T)
 }
@@ -326,7 +327,7 @@ func GetSignature(action string) []string {
 		}
 	}
 	if len(signature) == 0 {
-		signature = coreutil.GetJSInterfaceParam(url)
+		signature = cutil.GetJSInterfaceParam(url)
 		redis.Put("other", "wxshare-"+url, signature, 90*60) //一个半小时
 	}
 	log.Println(url, "------", signature)

+ 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-20 11:42:49"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-20 11:42:49"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-20 17:03:33"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-20 17:03:33"}},"marketisstart":true,"marketrate":300}

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


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

@@ -11,7 +11,7 @@ function initShare(signature,shareid){
 		wx.ready(function () {
 	        wx.onMenuShareTimeline({
 			    title: '剑鱼招标订阅免费用,关注即可抽取iPad mini。', // 分享标题
-			    link: 'http://www.qimingxing.info/front/weixinshare/'+shareid, // 分享链接
+			    link: 'http://www.qimingxing.info/swordfish/share/'+shareid, // 分享链接
 			    imgUrl: 'http://www.qimingxing.info/wxswordfish/images/share-icon.png', // 分享图标
 			    success: function () { 
 			       //alert('分享成功');
@@ -24,7 +24,7 @@ function initShare(signature,shareid){
 			wx.onMenuShareAppMessage({
 			    title: '剑鱼招标订阅免费用,关注即可抽取iPad mini。', // 分享标题
 			    desc: '关注微信并设置剑鱼关键词,全国招标信息统统推送给您!', // 分享描述
-			    link: 'http://www.qimingxing.info/front/weixinshare/'+shareid, // 分享链接
+			    link: 'http://www.qimingxing.info/swordfish/share/'+shareid, // 分享链接
 			    imgUrl: 'http://www.qimingxing.info/wxswordfish/images/share-icon.png', // 分享图标
 			    type: 'link', // 分享类型,music、video或link,不填默认为link'
 			    dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空

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

@@ -1,15 +1,27 @@
-<html>
+<html >
 <head>
 <title>企明星-剑鱼</title>
-<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+<meta charset="utf-8">
+<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">
 <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}});
+	initShare({{.T.signature}},{{.T.shareid}});
 </script>
 </head>
-<body style="margin: 0px;">
-<img src="/wxswordfish/images/share-page.png" width="100%" height="100%">
+<body style="margin:0px;">
+<div style="width: 100%;height: 603px; margin: 0 auto;background: url(/wxswordfish/images/share-cj.png) no-repeat top center;overflow: hidden;background-size: 375px 603px">
+</div>
+<div style="max-width:375px; margin:auto;">
+<div style="float:left;">
+<img src="/front/weixinshare/{{.T.shareid}}" style="width:80px; height:80px;vertical-align:middle;" />
+</div>
+<div style="float:left;line-height:30px;margin-top:10px;width:75%;">
+ 长按图片识别二维码<br/>回复“抽奖”,有机会抽取iPad mini
+</div>
+</div>
 </body>
 </html>