Prechádzať zdrojové kódy

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

wangchuanjin 9 rokov pred
rodič
commit
f6cbb2f52c

+ 2 - 0
core/src/qfw/swordfish/swordfish.go

@@ -15,6 +15,8 @@ type SwordFish struct {
 	swordfishlist xweb.Mapper `xweb:"/member/swordfish/swordfishlist"` //剑鱼列表
 	setVisited    xweb.Mapper `xweb:"/member/swordfish/setVisited"`    //已经访问过的列表
 	visitRedirect xweb.Mapper `xweb:"/visit/redirect"`                 //剑鱼跳转访问请求,后续统计
+	protocol      xweb.Mapper `xweb:"/member/swordfish/protocol"`      //剑鱼协议
+	wxprotocol    xweb.Mapper `xweb:"/member/swordfish/wxprotocol"`    //微信剑鱼协议
 }
 
 func init() {

+ 32 - 13
core/src/qfw/swordfish/swordfishmanage.go

@@ -21,7 +21,7 @@ func (s *SwordFish) Swordfish() error {
 			s.T["data"] = r
 		}
 		content, _ := s.Render4Cache("/swordfish/index.html", &s.T)
-		redis.Put("other", "swordfish", string(content), 1000) //缓存半个小时
+		redis.Put("other", "swordfish", string(content), 30*60*1000) //缓存半个小时
 		return s.SetBody(content)
 	}
 }
@@ -49,22 +49,24 @@ func (s *SwordFish) RssSet() error {
 			}
 		}
 	}
-	//list := mongodb.Find("bidding", nil, `{"comeintime":-1}`, `{"title":1,"href":1,"publishtime":1}`, false, 0, 10)
-	if ret := redis.Get("other", "swordfish_rsset"); ret != nil {
-		s.T["list"] = ret.([]interface{})
-	} else {
-		now := time.Now()
-		unix := time.Date(now.Year(), now.Month(), now.Day(), now.Hour()-2, now.Minute(), now.Second(), now.Nanosecond(), time.Local).Unix()
-		r := mongodb.Find("bidding", bson.M{"comeintime": bson.M{"$lte": unix}}, `{"comeintime":-1}`, `{"title":1,"href":1,"publishtime":1}`, false, 0, 5)
-		if r != nil {
-			s.T["list"] = *r
-		}
-		redis.Put("other", "swordfish_rsset", *r, 1000) //缓存半个小时
-	}
+	list := getNewest()
+	s.T["list"] = list
 	s.T["msgset"] = msgset
 	return s.Render("/swordfish/rssset.html", &s.T)
 }
 
+//剑鱼用户协议
+func (s *SwordFish) Protocol() error {
+	data := getNewest()
+	s.T["data"] = data
+	return s.Render("/swordfish/protocol.html", &s.T)
+}
+
+//剑鱼用户协议
+func (s *SwordFish) Wxprotocol() error {
+	return s.Render("/swordfish/protocoltxt.html")
+}
+
 //跳转到用户中心剑鱼信息列表
 func (s *SwordFish) Infolist() error {
 	ms := mongodb.FindById("user", s.GetSession("userId").(string), `{"o_msgset":1}`)
@@ -146,3 +148,20 @@ func (s *SwordFish) VisitRedirect() {
 		s.Redirect(surl)
 	}
 }
+
+//剑鱼最新信息列表
+func getNewest() (list []interface{}) {
+	if ret := redis.Get("other", "swordfish_newest_list"); ret != nil {
+		list = ret.([]interface{})
+		return list
+	} else {
+		now := time.Now()
+		unix := time.Date(now.Year(), now.Month(), now.Day(), now.Hour()-2, now.Minute(), now.Second(), now.Nanosecond(), time.Local).Unix()
+		r := mongodb.Find("bidding", bson.M{"comeintime": bson.M{"$lte": unix}}, `{"comeintime":-1}`, `{"title":1,"href":1,"publishtime":1}`, false, 0, 5)
+		redis.Put("other", "swordfish_newest_list", *r, 30*60*1000) //缓存半个小时
+		for _, v := range *r {
+			list = append(list, v)
+		}
+		return list
+	}
+}

+ 41 - 0
core/src/web/templates/swordfish/protocol.html

@@ -0,0 +1,41 @@
+<html>
+<head>
+<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>
+<!-- 头部 -->
+{{include "/common/swordfishhead.html"}}
+<!-- 中间 -->
+<div class="b-content container-fluid swordfish-index">
+	{{include "/swordfish/protocoltxt.html"}}
+	<div class="b-right">
+		<div class="swordfish-right-title">
+			剑鱼最新消息
+		</div>
+		<div id="list"></div>
+	</div>
+</div>
+<!-- 底部 -->
+{{include "/common/bottom.html"}}
+<script type="text/javascript">
+$(function(){
+	var data = {{.T.data}};
+	if(data && data != "" && data.length > 0){
+		var html = '';
+		for(var i=0;i<data.length;i++){
+			html += '<div class="tslist"><div class="time"><img src="/images/swordfish/circle.png">'
+					+new Date(Number(data[i].publishtime+"000")).Format("yyyy-MM-dd hh:mm:ss")
+					+'</div><a class="bt" onclick="open_window(\''+data[i].href+'\')">'
+					+data[i].title+'</a></div>';
+		}
+		$("#list").html(html);
+	}else{
+		$(".swordfish-index").find(".b-right").remove();
+	}
+});
+</script>
+</body>
+</html>

+ 20 - 0
core/src/web/templates/swordfish/protocoltxt.html

@@ -0,0 +1,20 @@
+<style>
+.pinden{
+	padding: 0px 0px 0px 25px;
+}
+</style>
+<div class="b-left" style="line-height:30px">
+	<p>一,您以任何方式(包括但不限于企明星网站www.qmx.top、www.qimingxing.info、微信公众号qmx-cn)使用剑鱼服务即表示您已充分阅读、理解并同意接受本规则的条款和条件。</p>
+	<p>二,企明星有权根据业务发展的需要修订本规则,在本规则更新时不再单独通知您。经修订的规则一经在企明星公布,即产生效力,您继续使用剑鱼,则视为您已接受修订的规则。当使用过程中发生争议时,应以最新的规则为准。</p>
+	<p>三,服务条件</p>
+	<p class="pinden">1,您使用剑鱼,需要自行确保具备以下条件:(1),关注企明星微信公众号,(2),您的企明星积分余额足以兑换您申请开通的剑鱼订阅服务。</p>
+	<p class="pinden">2,企明星按照一定的周期(比如一个月)扣除服务所需的积分。企明星的服务积分兑换标准和积分管理规则以企明星的相关公告为准。</p>
+	<p class="pinden">3,您需要为您订阅的剑鱼服务指定相应的订阅条件,企明星将按照此条件向您推送相应的信息。</p>
+	<p class="pinden">4,如果您订阅的某项服务有效期已过期,而您的积分余额不足以兑换下一个周期的服务,企明星将停止您的此项服务。</p>
+	<p class="pinden">5,如果您订阅的某项服务有效期未过期,而此时您主动取消了此项服务,企明星将不会向您退还此周期剩余时间折合的积分;在同一周期内,您重新开通了此项服务,企明星将此情形视为原有效期未过期,不会立即扣除积分,直到原有效期过期为止。</p>
+	<p>四,服务质量</p>
+	<p class="pinden">1,剑鱼推送信息全部来源于互联网,其真实性、合法性由企明星抓取的原始网站保证,您负责自行辨别。企明星会提供原始网页链接以供您查看。由于您收到剑鱼推送信息的真实性、合法性问题造成的任何结果,企明星不承担责任。</p>
+	<p class="pinden">2,从原始信息发布到您收到剑鱼推送信息会经过一个复杂的技术处理和网络传输过程,企明星对您收到剑鱼推送信息的时间延迟指标不做承诺。由于您未能在某个时间内收到剑鱼推送信息而造成的任何结果,企明星不承担责任。</p>
+	<p class="pinden">3,企明星保证您收到的剑鱼推送信息符合您指定的订阅条件。企明星不保证您收到的剑鱼推送信息准确符合您的真实意图。</p>
+	<p class="pinden">4,您保证您使用剑鱼的设备以及微信App正常运行。如果由于您使用剑鱼的设备或微信App的问题造成您无法接收剑鱼推送信息,企明星不承担责任。</p>
+</div>

+ 1 - 24
core/src/web/templates/swordfish/rssset.html

@@ -13,7 +13,7 @@
 	<div class="b-left">
 		<div class="swordfish-page-title">
 			<i class="img-circle glyphicon jianyu"></i>订阅设置
-			<!--<span >继续使用表明你已经同意了<span><a onclick="$('#yhxyModal').modal('show')">剑鱼用户服务协议</a>-->
+			<span >继续使用表明你已经同意了<span><a href='/member/swordfish/protocol'>剑鱼用户服务协议</a>
 			<span style="float:right;width:190px">
 			<a id="ckys">查看演示&nbsp;&nbsp;</a>
 			<a id="sfbz" onclick="$('#sfbzModal').modal('show')">收费标准</a>
@@ -272,29 +272,6 @@
 	</div>
 </div>
 
-<!-- 用户协议 -->
-<div class="modal fade b-modal" id="yhxyModal" tabindex="-1" role="dialog" aria-labelledby="yhxyModalLabel">
-  	<div class="modal-dialog" role="document">
-		<div class="modal-content">
-		  	<div class="modal-header-jy">
-				<span data-dismiss="modal" aria-label="Close" class="close glyphicon guanbi1"></span>
-				<span class="modal-title" id="yhxyModalLabel">用户协议</span>
-			</div>
-			<div style="background-color: #FCF8E3;padding:10px;line-height:25px">
-				<div>
-					<p style="margin-left:5px">剑鱼用户协议:</p>
-					<p style="margin-left:15px">
-					 
-					</p>
-				</div>
-				<div style="text-align:center;padding:10px 0;">
-					<button class='btn btn-primary' onclick="$('#yhxyModal').modal('hide')">确定</button>
-				</div>
-			</div>
-		</div>
-	</div>
-</div>
-
 <!-- 收费标准 -->
 <div class="modal fade b-modal" id="sfbzModal" tabindex="-1" role="dialog" aria-labelledby="sfbzModalLabel">
   	<div class="modal-dialog" role="document">

+ 8 - 1
core/src/web/templates/swordfish/wxrssset.html

@@ -13,6 +13,9 @@
 	var msgset= {{.T.msgset}};
 	var shareid="{{.T.shareid}}";
 </script>
+<style>
+.xieyi{width:100%;height:80px;text-align:center;position:absolute;bottom:0px;}
+</style>
 </head>
 <body>
 <div class="credit-tip visible">
@@ -69,7 +72,11 @@
 			<span class="rule" id="rule"></span>
 		</li>
 	</ul>
-	
+	<!--剑鱼服务协议-->
+	<div class="xieyi">
+		<span style="color:#CCCCDD">继续使用表明你已经同意了<span>
+		<a style="color:#33ABFF" href='/member/swordfish/wxprotocol'>剑鱼用户服务协议</a>
+	</div>
 	<!--关键词-->
 	<div class="dialog keyword-dialog" id="tender-keyword">
 		<div class="dialog-main">