Browse Source

剑鱼修改

wangchuanjin 9 years ago
parent
commit
1cb4be785a
37 changed files with 364 additions and 179 deletions
  1. 15 0
      core/src/qfw/coreutil/weixinrpc.go
  2. 2 6
      core/src/qfw/coreutil/weixinrpc_test.go
  3. 0 1
      core/src/qfw/front/front.go
  4. 0 35
      core/src/qfw/front/wxpush.go
  5. 6 0
      core/src/qfw/manage/seo.go
  6. 13 10
      core/src/qfw/mobile/mobile.go
  7. 29 0
      core/src/qfw/mobile/wxmenu.go
  8. 1 1
      core/src/qfw/swordfish/swordfish.go
  9. 1 1
      core/src/qfw/swordfish/swordfishmanage.go
  10. 5 0
      core/src/seo.json
  11. BIN
      core/src/web/staticres/wxswordfish/images/4 .png
  12. 0 0
      core/src/web/staticres/wxswordfish/images/delete.png
  13. BIN
      core/src/web/staticres/wxswordfish/images/demo.png
  14. 0 0
      core/src/web/staticres/wxswordfish/images/fankui.png
  15. 0 0
      core/src/web/staticres/wxswordfish/images/guide-1.png
  16. 0 0
      core/src/web/staticres/wxswordfish/images/guide-2.png
  17. 0 0
      core/src/web/staticres/wxswordfish/images/guide-3.png
  18. 0 0
      core/src/web/staticres/wxswordfish/images/guide-4.png
  19. 0 0
      core/src/web/staticres/wxswordfish/images/guide-5.png
  20. 0 0
      core/src/web/staticres/wxswordfish/images/off.png
  21. 0 0
      core/src/web/staticres/wxswordfish/images/on.png
  22. 0 0
      core/src/web/staticres/wxswordfish/images/qingbao.png
  23. 0 0
      core/src/web/staticres/wxswordfish/images/right.png
  24. BIN
      core/src/web/staticres/wxswordfish/images/share-page.png
  25. BIN
      core/src/web/staticres/wxswordfish/images/share.png
  26. 0 0
      core/src/web/staticres/wxswordfish/images/up.png
  27. 0 0
      core/src/web/staticres/wxswordfish/images/zhaobiao.png
  28. 0 0
      core/src/web/staticres/wxswordfish/images/zhongbiao.png
  29. 1 67
      core/src/web/staticres/wxswordfish/main.js
  30. 57 9
      core/src/web/staticres/wxswordfish/style.css
  31. 26 0
      core/src/web/templates/manage/updateseo.html
  32. 3 1
      core/src/web/templates/swordfish/index.html
  33. 14 10
      core/src/web/templates/swordfish/wxindex.html
  34. 8 6
      core/src/web/templates/swordfish/wxpush.html
  35. 13 32
      core/src/web/templates/swordfish/wxrssset.html
  36. 9 0
      core/src/web/templates/swordfish/wxshare.html
  37. 161 0
      core/src/web/templates/swordfish/wxtoolbar.html

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

@@ -62,3 +62,18 @@ func PayBonus(p *qrpc.BonusMsg) bool {
 	}
 	return repl == "SUCCESS"
 }
+
+//取得JS接口参数
+func GetJSInterfaceParam(url string) []string {
+	var ret []string
+	client, err := rpc.DialHTTP("tcp", "127.0.0.1:83")
+	if err != nil {
+		log.Println(err.Error())
+		return ret
+	}
+	err = client.Call("WeiXinRpc.GetJSInterfaceParam", url, &ret)
+	if err != nil {
+		log.Println(err.Error())
+	}
+	return ret
+}

+ 2 - 6
core/src/qfw/coreutil/weixinrpc_test.go

@@ -7,7 +7,6 @@ import (
 	"io/ioutil"
 	"log"
 	"net/http"
-	"qfw/coreconfig"
 	qrpc "qfw/util/rpc"
 	"testing"
 	"time"
@@ -99,9 +98,6 @@ func TestSay(t *testing.T) {
 	log.Println(string(bs))
 
 }
-func Test_3(t *testing.T) {
-	title := coreconfig.RedPackage.Weixin["successtitle"].(string)
-	remark := coreconfig.RedPackage.Weixin["successremark"].(string)
-	detail := coreconfig.RedPackage.Weixin["sendname"].(string)
-	SendManagerNotifyMsg(&qrpc.NotifyMsg{Openid: "obEpLuDb5eXrbRni239Lw_Ff4b8A", Title: title, Detail: detail, Remark: remark})
+func Test_GetJSInterfaceParam(t *testing.T) {
+	fmt.Println(GetJSInterfaceParam("www.baidu.com"))
 }

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

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

+ 0 - 35
core/src/qfw/front/wxpush.go

@@ -1,35 +0,0 @@
-/*推送列表
- *@Author 王传进
- */
-package front
-
-import (
-	"github.com/go-xweb/xweb"
-	mongodb "qfw/util/mongodb"
-)
-
-type Wxpush struct {
-	*xweb.Action
-	wxpushList xweb.Mapper `xweb:"/wxpush/bid/(.*)/(.*)/(.*)"` //推送列表
-	ajaxReq    xweb.Mapper `xweb:"/wxpush/bid/ajaxReq"`
-}
-
-//推送列表
-func (w *Wxpush) WxpushList(s_m_openid string, _id string, msgid string) error {
-	/**
-	go func() {
-		mongodb.Update("message", `{"_id":"`+msgid+`"}`, `{"$set":{"i_status":1}}`, false, false)
-	}()
-	**/
-	w.T["data"] = *mongodb.FindById("wxpush", _id, `{"s_content":1,"s_words":1,"a_visitedindex":1,"a_publishtime":1,"s_type":1}`)
-	w.T["_id"] = _id
-	return w.Render("/wxpush/index.html", &w.T)
-}
-
-func (w *Wxpush) AjaxReq() error {
-	index, _ := w.GetInteger("index")
-	mongodb.Update("wxpush", `{"_id":"`+w.GetString("_id")+`"}`, map[string]interface{}{
-		"$push": map[string]interface{}{"a_visitedindex": index},
-	}, false, false)
-	return nil
-}

+ 6 - 0
core/src/qfw/manage/seo.go

@@ -41,6 +41,9 @@ func (s *SystemManage) Seo() error {
 			s.T["wsite_title"] = util.GetPropertie("qfw.wsite.title", coreconfig.SeoConfig).(string)
 			s.T["wsite_key"] = util.GetPropertie("qfw.wsite.key", coreconfig.SeoConfig).(string)
 			s.T["wsite_description"] = util.GetPropertie("qfw.wsite.description", coreconfig.SeoConfig).(string)
+			s.T["swordfish_title"] = util.GetPropertie("qfw.swordfish.title", coreconfig.SeoConfig).(string)
+			s.T["swordfish_key"] = util.GetPropertie("qfw.swordfish.key", coreconfig.SeoConfig).(string)
+			s.T["swordfish_description"] = util.GetPropertie("qfw.swordfish.description", coreconfig.SeoConfig).(string)
 			return s.Render("/manage/updateseo.html")
 		} else {
 			return s.Redirect("/")
@@ -76,6 +79,9 @@ func (s *SystemManage) Updateseo() error {
 		util.SetPropertie("qfw.wsite.title", s.GetString("wsite_title"), coreconfig.SeoConfig)
 		util.SetPropertie("qfw.wsite.key", s.GetString("wsite_key"), coreconfig.SeoConfig)
 		util.SetPropertie("qfw.wsite.description", s.GetString("wsite_description"), coreconfig.SeoConfig)
+		util.SetPropertie("qfw.swordfish.title", s.GetString("swordfish_title"), coreconfig.SeoConfig)
+		util.SetPropertie("qfw.swordfish.key", s.GetString("swordfish_key"), coreconfig.SeoConfig)
+		util.SetPropertie("qfw.swordfish.description", s.GetString("swordfish_description"), coreconfig.SeoConfig)
 		util.WriteSysConfig("./seo.json", &coreconfig.SeoConfig)
 		flag = "true"
 		msg = "修改成功!"

+ 13 - 10
core/src/qfw/mobile/mobile.go

@@ -6,16 +6,19 @@ import (
 
 type Mobile struct {
 	*xweb.Action
-	index      xweb.Mapper `xweb:"/ent/(.*)/index"`
-	search     xweb.Mapper `xweb:"/ent/(.*)/search"`
-	detail     xweb.Mapper `xweb:"/ent/(.*)/detail/(.*)/(.*)"`
-	pageerror  xweb.Mapper `xweb:"/ent/(.*)/505"`
-	guide      xweb.Mapper `xweb:"/swordfish/guide"`
-	wxrssset   xweb.Mapper `xweb:"/swordfish/page"`
-	msgSet     xweb.Mapper `xweb:"/swordfish/msgpushsetting/msgset"`
-	ajaxReq    xweb.Mapper `xweb:"/swordfish/ajaxReq"`
-	advise     xweb.Mapper `xweb:"/mobile/advise"`
-	adviseSave xweb.Mapper `xweb:"/mobile/advisesave"`
+	index         xweb.Mapper `xweb:"/ent/(.*)/index"`
+	search        xweb.Mapper `xweb:"/ent/(.*)/search"`
+	detail        xweb.Mapper `xweb:"/ent/(.*)/detail/(.*)/(.*)"`
+	pageerror     xweb.Mapper `xweb:"/ent/(.*)/505"`
+	guide         xweb.Mapper `xweb:"/swordfish/guide"`
+	share         xweb.Mapper `xweb:"/swordfish/share"`
+	wxrssset      xweb.Mapper `xweb:"/swordfish/page"`
+	msgSet        xweb.Mapper `xweb:"/swordfish/msgpushsetting/msgset"`
+	ajaxReq       xweb.Mapper `xweb:"/swordfish/ajaxReq"`
+	advise        xweb.Mapper `xweb:"/mobile/advise"`
+	adviseSave    xweb.Mapper `xweb:"/mobile/advisesave"`
+	wxpushList    xweb.Mapper `xweb:"/wxpush/bid/(.*)/(.*)/(.*)"` //推送列表
+	wxpushAjaxReq xweb.Mapper `xweb:"/wxpush/bid/ajaxReq"`
 }
 
 func init() {

+ 29 - 0
core/src/qfw/mobile/wxmenu.go

@@ -5,6 +5,7 @@ import (
 	"fmt"
 	"log"
 	"math/rand"
+	"qfw/coreutil"
 	"qfw/util"
 	"qfw/util/consts"
 	"qfw/util/mongodb"
@@ -14,13 +15,19 @@ import (
 
 var se util.SimpleEncrypt
 
+const ShareUrl string = "http://www.qimingxing.info/swordfish/share"
+
 func init() {
 	se = util.SimpleEncrypt{Key: "topnet"}
 }
 
 func (m *Mobile) Guide() error {
+	m.T["shareData"] = coreutil.GetJSInterfaceParam(ShareUrl)
 	return m.Render("/swordfish/wxindex.html")
 }
+func (m *Mobile) Share() error {
+	return m.Render("/swordfish/wxshare.html")
+}
 
 func (m *Mobile) Wxrssset() error {
 	defer func() {
@@ -64,6 +71,7 @@ func (m *Mobile) Wxrssset() error {
 			}
 		}
 		//m.T["mid"] = openid
+		m.T["shareData"] = coreutil.GetJSInterfaceParam(ShareUrl)
 		return m.Render("/swordfish/wxrssset.html", &m.T)
 	} else {
 		return m.Render("_err.html")
@@ -225,3 +233,24 @@ func (m *Mobile) AjaxReq() error {
 	})
 	return nil
 }
+
+//推送列表
+func (m *Mobile) WxpushList(s_m_openid string, _id string, msgid string) error {
+	/**
+	go func() {
+		mongodb.Update("message", `{"_id":"`+msgid+`"}`, `{"$set":{"i_status":1}}`, false, false)
+	}()
+	**/
+	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"] = coreutil.GetJSInterfaceParam(ShareUrl)
+	return m.Render("/swordfish/wxpush.html", &m.T)
+}
+
+func (m *Mobile) WxpushAjaxReq() error {
+	index, _ := m.GetInteger("index")
+	mongodb.Update("wxpush", `{"_id":"`+m.GetString("_id")+`"}`, map[string]interface{}{
+		"$push": map[string]interface{}{"a_visitedindex": index},
+	}, false, false)
+	return nil
+}

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

@@ -10,7 +10,7 @@ import (
 type SwordFish struct {
 	*xweb.Action
 	swordfish     xweb.Mapper `xweb:"/front/swordfish"`                 //剑鱼
-	ajaxReq       xweb.Mapper `xweb:"/member/swordfish/rssset/ajaxReq"` //订阅消息设置ajax请求
+	rsssetAjaxReq xweb.Mapper `xweb:"/member/swordfish/rssset/ajaxReq"` //订阅消息设置ajax请求
 	rssSet        xweb.Mapper `xweb:"/member/swordfish/rssset"`         //订阅消息设置
 	infolist      xweb.Mapper `xweb:"/member/swordfish/infolist"`       //剑鱼
 	swordfishlist xweb.Mapper `xweb:"/member/swordfish/swordfishlist"`  //剑鱼列表

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

@@ -30,7 +30,7 @@ func (s *SwordFish) RssSet() error {
 	s.T["msgset"] = (*u)["o_msgset"]
 	return s.Render("/swordfish/rssset.html", &s.T)
 }
-func (s *SwordFish) AjaxReq() error {
+func (s *SwordFish) RsssetAjaxReq() error {
 	var flag = "n"
 	msgset := make(map[string]interface{})
 	//投标公告

+ 5 - 0
core/src/seo.json

@@ -29,6 +29,11 @@
             "description": "微官网_企明星",
             "key": "微官网_企明星",
             "title": "微官网_企明星"
+        },
+        "swordfish": {
+            "description": "剑鱼招标订阅是一款专为销售人员量身定制的招标信息订阅工具。只需微信关注企明星,点击“剑鱼”,即可随时免费收取招标信息推送。",
+            "key": "剑鱼招标订阅 剑鱼招标 剑鱼订阅 招标订阅 销售神器 销售必备",
+            "title": "剑鱼招标订阅,招标信息早知道!"
         }
     }
 }

BIN
core/src/web/staticres/wxswordfish/images/4 .png


+ 0 - 0
core/src/web/staticres/wxrssset/images/delete.png → core/src/web/staticres/wxswordfish/images/delete.png


BIN
core/src/web/staticres/wxswordfish/images/demo.png


+ 0 - 0
core/src/web/staticres/wxrssset/images/fankui.png → core/src/web/staticres/wxswordfish/images/fankui.png


+ 0 - 0
core/src/web/staticres/wxrssset/images/guide-1.png → core/src/web/staticres/wxswordfish/images/guide-1.png


+ 0 - 0
core/src/web/staticres/wxrssset/images/guide-2.png → core/src/web/staticres/wxswordfish/images/guide-2.png


+ 0 - 0
core/src/web/staticres/wxrssset/images/guide-3.png → core/src/web/staticres/wxswordfish/images/guide-3.png


+ 0 - 0
core/src/web/staticres/wxrssset/images/guide-4.png → core/src/web/staticres/wxswordfish/images/guide-4.png


+ 0 - 0
core/src/web/staticres/wxrssset/images/guide-5.png → core/src/web/staticres/wxswordfish/images/guide-5.png


+ 0 - 0
core/src/web/staticres/wxrssset/images/off.png → core/src/web/staticres/wxswordfish/images/off.png


+ 0 - 0
core/src/web/staticres/wxrssset/images/on.png → core/src/web/staticres/wxswordfish/images/on.png


+ 0 - 0
core/src/web/staticres/wxrssset/images/qingbao.png → core/src/web/staticres/wxswordfish/images/qingbao.png


+ 0 - 0
core/src/web/staticres/wxrssset/images/right.png → core/src/web/staticres/wxswordfish/images/right.png


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


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


+ 0 - 0
core/src/web/staticres/wxrssset/images/up.png → core/src/web/staticres/wxswordfish/images/up.png


+ 0 - 0
core/src/web/staticres/wxrssset/images/zhaobiao.png → core/src/web/staticres/wxswordfish/images/zhaobiao.png


+ 0 - 0
core/src/web/staticres/wxrssset/images/zhongbiao.png → core/src/web/staticres/wxswordfish/images/zhongbiao.png


+ 1 - 67
core/src/web/staticres/wxrssset/main.js → core/src/web/staticres/wxswordfish/main.js

@@ -1,5 +1,3 @@
-//意见反馈
-var feedback = null;
 //招标公告
 var Tender = {
 	keyWordDialog: null,
@@ -73,7 +71,7 @@ KeyWordDialog.AppendNode = function(dialogObj,value){
 		return '<div class="keyWordGroup">'
 					+'<lable>关键词<font>'+index+'</font></lable>'
 					+'<div><input type="text" value="'+(value?value:"")+'" placeholder="示例:综合布线 电话线 网线" maxlength="100"></div>'
-					+'<div><img src="/wxrssset/images/delete.png" class="delete"></div>'
+					+'<div><img src="/wxswordfish/images/delete.png" class="delete"></div>'
 				+'</div>';
 	}
 	var count = dialogObj.find(".keyWordGroup").length;
@@ -126,56 +124,6 @@ function ScopeDialog(type,clickLi){
 		commonAjaxReq(thisClass);
 	});
 }
-//意见反馈
-function Feedback(){
-	this.show = function(){
-		$(".feedback-dialog").show();
-		$("html,body").addClass("overflow-hidden");
-	};
-	this.setCount = function(count){
-		$(".feedback-dialog .statistics>span").text(count);
-	};
-	var thisClass = this;
-	$("#feedback-textarea").on("input propertychange",function(){
-		var count = $.trim(this.value).length;
-		if(count > 0){
-			$(this).parent().removeClass("red-border");
-		}
-		if(count > 200){
-			this.value = this.value.substring(0,200);
-			return;
-		}
-		thisClass.setCount(count);
-	});
-	$("#feedback-submit").click(function(){
-		var value = $("#feedback-textarea").val();
-		if($.trim(value) == ""){
-			$("#feedback-textarea").focus().parent().addClass("red-border");
-			return;
-		}
-		var obj = {reqType:"feedback"};
-		$.ajax({
-			type: "POST",
-			url: "/swordfish/ajaxReq",
-			data:{reqType:"feedback",value:value,title:"剑鱼-意见反馈"},
-			dataType: "json",
-			success: function(r){
-				if(r.flag == "y"){
-					$(".feedback-dialog").hide();
-					$("html,body").removeClass("overflow-hidden");
-					$("#feedback-textarea").val("");
-					thisClass.setCount(0);
-					alert("您的意见我们已经收到,谢谢!");
-				}else{
-					alert("提交失败!");
-				}
-			},
-			error: function(){
-				alert("网络连接错误!");
-			}
-		});
-	});
-}
 function commonAjaxReq(object){
 	var dataObj = {
 		reqType: "other",
@@ -366,18 +314,4 @@ $(function(){
 				break;
 		}
 	});
-	//弹出框消失
-	$(".dialog").click(function(e){
-		if($(e.target).hasClass("dialog")){
-			$(this).hide();
-			$("html,body").removeClass("overflow-hidden");
-		}
-	});
-	$("#feedback").click(function(){
-		if(feedback == null){
-			feedback = new Feedback();
-		}
-		feedback.show();
-		$("#feedback-textarea").focus().parent().removeClass("red-border");
-	});
 });

+ 57 - 9
core/src/web/staticres/wxrssset/style.css → core/src/web/staticres/wxswordfish/style.css

@@ -59,6 +59,7 @@ img{
 /**************/
 .operation{
 	background-color: #F8F8F8;
+	margin-bottom: 50px;
 }
 .operation>.parent-node{
 	width: 100%;
@@ -70,8 +71,9 @@ img{
 }
 .operation>.parent-node>img{
 	margin-left: 10px;
-	width: 20px;
-	height: 20px;
+	margin-right: 10px;
+	width: 18px;
+	height: 18px;
 }
 .operation>.parent-node>span img{
 	position: absolute;
@@ -91,11 +93,11 @@ img{
 	margin-top: -23px;
 }
 .operation>.parent-node>.on-off{
-	background-image: url("/wxrssset/images/off.png");
+	background-image: url("/wxswordfish/images/off.png");
 	background-size: 100% 100%;
 }
 .operation .on-off.open{
-	background-image: url("/wxrssset/images/on.png");
+	background-image: url("/wxswordfish/images/on.png");
 }
 .operation .btn-right img{
 	width: 15px;
@@ -359,9 +361,12 @@ img{
 	}
 }
 .swiper-slide img{
-	position: relative;
+	/*position: relative;
 	top: 50%;
 	margin-top: -302px;
+	*/
+	width: 100%;
+	height: 100%;
 }
 .swiper-pagination-bullet-active{
 	background-color: #37C6DA;
@@ -443,9 +448,52 @@ img{
 		bottom: 25px;
 	}
 }
-.guide-bottom span{
-	float: right;
-	display: block;
+.guide-bottom >span{
 	color: #D7D7D7;
-	margin-right: 10px;
+	position: absolute;
+	bottom: 10px;
+	display: block;
+}
+.guide-bottom .jumpGuide{
+	left: 25%;
+	margin-left: -43.5px;
+}
+.guide-bottom .goToShare{
+	right: 25%;
+	margin-right: -16px;
+}
+.share-dialog{
+	z-index: 10;
+}
+.share-dialog .dialog-content{
+	padding-top: 20px;
+	padding-bottom: 40px;
+}
+/**底部工具**/
+.bottom-toolbar{
+	display: table;
+	position: fixed;
+	left: 0px;
+	right: 0px;
+	bottom: 0px;
+	height: 50px;
+	width: 100%;
+	border-top: 1px solid #CCCCCC;
+	background-color: #F8F8F8;
+}
+.bottom-toolbar>li{
+	display: table-cell;
+	width: 33%;
+	height: 50px;
+	line-height: 50px;
+	text-align: center;
+}
+.bottom-toolbar>li img{
+	width: 18px;
+	height: 18px;
+}
+.bottom-toolbar>li:nth-child(2){
+	width: 34%;
+	border-left: 1px solid #CCCCCC;
+	border-right: 1px solid #CCCCCC;
 }

+ 26 - 0
core/src/web/templates/manage/updateseo.html

@@ -197,6 +197,32 @@ background-color:#FFFFFF;
 		</div>
 		</div>
 		
+		<h4><p style="font-weight:bold; border-bottom:1px solid #98D6DC; padding-bottom:10px; margin-top:30px;" class="text-left">  剑鱼</p></h4>
+		<div class="form-group">
+        <label id="col-sm-2" class="col-sm-2 control-label" for="name">标题:</label>
+	    <div class="col-sm-4">
+        <input  type="text" name="swordfish_title" value="{{.T.swordfish_title}}" class="form-control" placeholder="请输入剑鱼title">
+		</div>
+		<div class="col-sm-4">
+		</div>
+		</div>
+        <div class="form-group">
+        <label id="col-sm-2" class="col-sm-2 control-label" for="name">关键词:</label>
+	    <div class="col-sm-6">
+        <input  type="text" name="swordfish_key" value="{{.T.swordfish_key}}" class="form-control" placeholder="请输入剑鱼关键词(关键词用空格隔开)">
+		</div>
+		<div class="col-sm-4">
+		</div>
+		</div>
+        <div class="form-group">
+        <label id="col-sm-2" class="col-sm-2 control-label" for="name">描述:</label>
+	    <div class="col-sm-8">
+		<textarea  type="text" name="swordfish_description" value="{{.T.swordfish_description}}" class="form-control" maxlength="200" placeholder="请输入剑鱼描述">{{.T.swordfish_description}}</textarea>
+		</div>
+		<div class="col-sm-2">
+		</div>
+		</div>
+		
         
         <div class="form-group">
         <label id="col-sm-2" class="col-sm-2 control-label"></label>

+ 3 - 1
core/src/web/templates/swordfish/index.html

@@ -1,6 +1,8 @@
 <html>
 <head>
-<title>剑鱼</title>
+<title>{{Msg "seo" "qfw.swordfish.title"}}</title>
+<meta name="Keywords" content="{{Msg "seo" "qfw.swordfish.key"}}"/>
+<meta name="Description" content="{{Msg "seo" "qfw.swordfish.description"}}"/>
 {{include "/common/inc.html"}}
 </head>
 <body>

+ 14 - 10
core/src/web/templates/swordfish/wxindex.html

@@ -1,9 +1,10 @@
 <html>
 <head>
-<title>剑鱼</title>
+<title>企明星-剑鱼-演示</title>
 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
-<link href="/wxrssset/style.css" rel="stylesheet">
+<link href="/wxswordfish/style.css" rel="stylesheet">
 <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="/swiper/swiper.min.js"></script>
 </head>
@@ -11,28 +12,30 @@
 <div class="swiper-container">
     <div class="swiper-wrapper">
         <div class="swiper-slide">
-				<img id="guide-firstImg" src="/wxrssset/images/guide-1.png">
+			<img id="guide-firstImg" src="/wxswordfish/images/guide-1.png">
 		</div>
        	<div class="swiper-slide">
-				<img src="/wxrssset/images/guide-2.png">
+			<img src="/wxswordfish/images/guide-2.png">
 		</div>
        	<div class="swiper-slide">
-				<img src="/wxrssset/images/guide-3.png">
+			<img src="/wxswordfish/images/guide-3.png">
 		</div>
 		<div class="swiper-slide">
-				<img src="/wxrssset/images/guide-4.png">
+			<img src="/wxswordfish/images/guide-4.png">
 		</div>
 		<div class="swiper-slide">
-				<img src="/wxrssset/images/guide-5.png">
+			<img src="/wxswordfish/images/guide-5.png">
 		</div>
     </div>
     <!-- 如果需要分页器 -->
    	<div class="swiper-pagination"></div>
 	<div class="guide-bottom">
-		<img src="/wxrssset/images/up.png">
-		<span onclick="window.location.href='/swordfish/page'">跳过引导>></span>
+		<img src="/wxswordfish/images/up.png">
+		<span class="jumpGuide" onclick="{{if session "userid"}}window.location.href='/swordfish/page'{{else}}history.go(-1);{{end}}">跳过引导>></span>
+		<span class="goToShare" id="goToShare">分享</span>
 	</div>
 </div>
+{{include "/swordfish/wxtoolbar.html"}}
 <script type="text/javascript">
 $(function(){
 	var currentIndex = 0;
@@ -63,6 +66,7 @@ $(function(){
 			}
 		}
     });
+	/*
 	var imgHeight = 1159;
 	var imgWidth = 750;
 	var width = document.body.clientWidth;
@@ -72,7 +76,7 @@ $(function(){
 		$(".swiper-slide img").css({width: width,height: h,marginTop: -(h / 2)});
 	}else if(imgHeight > height){
 		$(".swiper-slide img").css({width: height / imgHeight * imgWidth,height: height,marginTop: -(height / 2)});
-	}
+	}*/
 });
 </script>
 </body>

+ 8 - 6
core/src/web/templates/wxpush/index.html → core/src/web/templates/swordfish/wxpush.html

@@ -1,7 +1,9 @@
 <html>
 <head>
 <meta name="viewport" content="width=device-width,initial-scale=1.0">
-<title>消息推送</title>
+<title>企明星-剑鱼-信息推送</title>
+<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>
 $(function(){
@@ -14,7 +16,7 @@ $(function(){
 	var a_visitedindex = {{.T.data.a_visitedindex}};
 	var s_type = {{.T.data.s_type}};
 	var a_publishtime = {{.T.data.a_publishtime}};
-	$("body").html({{.T.data.s_content}});
+	$("body").prepend({{.T.data.s_content}});
 	if(typeof(s_words) != "undefined" && s_words.length > 0){
 		$("body>div:first").html('根据你设置的'+(s_type=="tender"?"招标公告":s_type=="bid"?"中标公告":"")+'关键词(<font class="keyword">'+s_words.join(" ; ").replace(/\+/gm," ")+'</font>)为你推送以下信息:');
 	}else{
@@ -120,10 +122,8 @@ function setVisitedIndex(obj){
 </script>
 <style type="text/css">
 body{
-	margin: 0px;
-	font-family: tahoma, arial, 'Hiragino Sans GB', 'Microsoft YaHei', 宋体, sans-serif;
-	-webkit-tap-highlight-color: transparent;
 	color: #333;
+	padding-bottom: 50px;
 }
 body>div:first-child{
 	background-color: #F8F8F8;
@@ -160,5 +160,7 @@ a{
 }
 </style>
 </head>
-<body></body>
+<body>
+{{include "/swordfish/wxtoolbar.html"}}
+</body>
 </html>

+ 13 - 32
core/src/web/templates/swordfish/wxrssset.html

@@ -1,61 +1,56 @@
 <html>
 <head>
-<title>企明星-信息订阅</title>
+<title>企明星-剑鱼-信息订阅设置</title>
 <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <meta name="renderer" content="webkit">
-<link href="/wxrssset/style.css" rel="stylesheet">
+<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>
 	var msgset= {{.T.msgset}};
 </script>
-<script src="/wxrssset/main.js"></script>
+<script src="/wxswordfish/main.js"></script>
 </head>
 <body>
 	<ul class="operation">
 		<li class="parent-node">
-			<img src="/wxrssset/images/zhaobiao.png">
+			<img src="/wxswordfish/images/zhaobiao.png">
 			招标公告
 			<span class="on-off" id="tender-on-off"></span>
 		</li>
 		<li class="child-node">
 			<ul id="tender-content">
 				<li>
-					<div>订阅关键词<img src="/wxrssset/images/right.png"></div>
+					<div>订阅关键词<img src="/wxswordfish/images/right.png"></div>
 				</li>
 				<li>
-					<div>信息范围<img src="/wxrssset/images/right.png"></div>
+					<div>信息范围<img src="/wxswordfish/images/right.png"></div>
 				</li>
 			</ul>
 		</li>
 		<li class="parent-node">
-			<img src="/wxrssset/images/zhongbiao.png">
+			<img src="/wxswordfish/images/zhongbiao.png">
 			中标公告
 			<span class="on-off" id="bid-on-off"></span>
 		</li>
 		<li class="child-node">
 			<ul id="bid-content">
 				<li>
-					<div>订阅关键词<img src="/wxrssset/images/right.png"></div>
+					<div>订阅关键词<img src="/wxswordfish/images/right.png"></div>
 				</li>
 				<li>
-					<div>信息范围<img src="/wxrssset/images/right.png"></div>
+					<div>信息范围<img src="/wxswordfish/images/right.png"></div>
 				</li>
 			</ul>
 		</li>
 		<li class="parent-node">
-			<img src="/wxrssset/images/qingbao.png">
+			<img src="/wxswordfish/images/qingbao.png">
 			企业情报
 			<span class="on-off" id="intelligence-on-off"></span>
 		</li>
-		<li class="parent-node" id="feedback">
-			<img src="/wxrssset/images/fankui.png">
-			意见反馈
-			<span class="btn-right">
-				<img src="/wxrssset/images/right.png">
-			</span>
-		</li>
 	</ul>
+	
 	<!--关键词-->
 	<div class="dialog keyword-dialog" id="tender-keyword">
 		<div class="dialog-main">
@@ -143,20 +138,6 @@
 			</div>
 		</div>
 	</div>
-	<!--意见反馈-->
-	<div class="dialog feedback-dialog">
-		<div class="dialog-main">
-			<div class="dialog-head">
-				<div>意见反馈</div>
-				<div><span id="feedback-submit">提交</span></div>
-			</div>
-			<div class="dialog-content">
-				<div>
-					<textarea placeholder="请简要描述你的问题和意见" id="feedback-textarea"></textarea>
-					<div class="statistics"><span>0</span>/200字</div>
-				</div>
-			</div>
-		</div>
-	</div>
+	{{include "/swordfish/wxtoolbar.html"}}
 </body>
 </html>

+ 9 - 0
core/src/web/templates/swordfish/wxshare.html

@@ -0,0 +1,9 @@
+<html>
+<head>
+<title>企明星-剑鱼</title>
+<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+</head>
+<body style="margin: 0px;">
+<img src="/wxswordfish/images/share-page.png" width="100%" height="100%">
+</body>
+</html>

+ 161 - 0
core/src/web/templates/swordfish/wxtoolbar.html

@@ -0,0 +1,161 @@
+<ul class="bottom-toolbar">
+	<li class="parent-node" id="goToGuide">
+		<img src="/wxswordfish/images/demo.png">
+		查看演示
+	</li>
+	<li class="parent-node" id="feedback">
+		<img src="/wxswordfish/images/fankui.png">
+		意见反馈
+	</li>
+	<li class="parent-node" id="goToShare">
+		<img src="/wxswordfish/images/share.png">
+		分享
+	</li>
+</ul>
+<div class="dialog share-dialog">
+	<div class="dialog-main">
+		<div class="dialog-head">
+			<div>分享</div>
+			<div><span id="share-dialog-back">返回</span></div>
+		</div>
+		<div class="dialog-content">
+			<div>
+				点击右上角…按钮,选择发送给朋友,或分享到朋友圈,即可完成分享!
+			</div>
+		</div>
+	</div>
+</div>
+<!--意见反馈-->
+<div class="dialog feedback-dialog">
+	<div class="dialog-main">
+		<div class="dialog-head">
+			<div>意见反馈</div>
+			<div><span id="feedback-submit">提交</span></div>
+		</div>
+		<div class="dialog-content">
+			<div>
+				<textarea placeholder="请简要描述你的问题和意见" id="feedback-textarea"></textarea>
+				<div class="statistics"><span>0</span>/200字</div>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+//意见反馈
+var feedback = null;
+$(function(){
+	$("#goToGuide").click(function(){
+		window.location.href = "/swordfish/guide";
+	});
+	$("#feedback").click(function(){
+		if(feedback == null){
+			feedback = new Feedback();
+		}
+		feedback.show();
+		$("#feedback-textarea").focus().parent().removeClass("red-border");
+	});
+	$("#goToShare").click(function(){
+		$(".share-dialog").show();
+	});
+	$("#share-dialog-back").click(function(){
+		$(".share-dialog").hide();
+	});
+	//弹出框消失
+	$(".dialog").click(function(e){
+		if($(e.target).hasClass("dialog")){
+			$(this).hide();
+			$("html,body").removeClass("overflow-hidden");
+		}
+	});
+	//
+	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: '', // 分享图标
+			    success: function () { 
+			       //alert('分享成功');
+			    },
+			    cancel: function () { 
+			       //alert('分享失败,或用户取消了');
+			    }
+			});
+			
+			wx.onMenuShareAppMessage({
+			    title: '剑鱼-招标订阅,招标信息早知道!', // 分享标题
+			    desc: '关注微信并设置剑鱼关键词,全国招标信息统统推送给您!', // 分享描述
+			    link: 'http://www.qimingxing.info/swordfish/share', // 分享链接
+			    imgUrl: '', // 分享图标
+			    type: 'link', // 分享类型,music、video或link,不填默认为link
+			    dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
+			    success: function () { 
+			        //alert('分享成功');
+			    },
+			    cancel: function () { 
+					//alert('分享失败,或用户取消了');
+			    }
+			});
+	    });
+	}
+});
+//意见反馈
+function Feedback(){
+	this.show = function(){
+		$(".feedback-dialog").show();
+		$("html,body").addClass("overflow-hidden");
+	};
+	this.setCount = function(count){
+		$(".feedback-dialog .statistics>span").text(count);
+	};
+	var thisClass = this;
+	$("#feedback-textarea").on("input propertychange",function(){
+		var count = $.trim(this.value).length;
+		if(count > 0){
+			$(this).parent().removeClass("red-border");
+		}
+		if(count > 200){
+			this.value = this.value.substring(0,200);
+			return;
+		}
+		thisClass.setCount(count);
+	});
+	$("#feedback-submit").click(function(){
+		var value = $("#feedback-textarea").val();
+		if($.trim(value) == ""){
+			$("#feedback-textarea").focus().parent().addClass("red-border");
+			return;
+		}
+		var obj = {reqType:"feedback"};
+		$.ajax({
+			type: "POST",
+			url: "/swordfish/ajaxReq",
+			data:{reqType:"feedback",value:value,title:"剑鱼-意见反馈"},
+			dataType: "json",
+			success: function(r){
+				if(r.flag == "y"){
+					$(".feedback-dialog").hide();
+					$("html,body").removeClass("overflow-hidden");
+					$("#feedback-textarea").val("");
+					thisClass.setCount(0);
+					alert("您的意见我们已经收到,谢谢!");
+				}else{
+					alert("提交失败!");
+				}
+			},
+			error: function(){
+				alert("网络连接错误!");
+			}
+		});
+	});
+}
+</script>