瀏覽代碼

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

renzheng 9 年之前
父節點
當前提交
a69ed187b6

+ 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
+	}
+}

+ 127 - 2
core/src/web/staticres/js/qfw.js

@@ -44,7 +44,132 @@ var ValidDatatype = {
 		return true;
 	}
 }
-Date.prototype.Format = function (fmt) { //author: meizz 
+/*
+ * Date Format 1.2.3
+ * (c) 2007-2009 Steven Levithan <stevenlevithan.com>
+ * MIT license
+ *
+ * Includes enhancements by Scott Trenda <scott.trenda.net>
+ * and Kris Kowal <cixar.com/~kris.kowal/>
+ *
+ * Accepts a date, a mask, or a date and a mask.
+ * Returns a formatted version of the given date.
+ * The date defaults to the current date/time.
+ * The mask defaults to dateFormat.masks.default.
+ */
+
+var dateFormat = function () {
+	var	token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
+		timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
+		timezoneClip = /[^-+\dA-Z]/g,
+		pad = function (val, len) {
+			val = String(val);
+			len = len || 2;
+			while (val.length < len) val = "0" + val;
+			return val;
+		};
+
+	// Regexes and supporting functions are cached through closure
+	return function (date, mask, utc) {
+		var dF = dateFormat;
+
+		// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
+		if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
+			mask = date;
+			date = undefined;
+		}
+
+		// Passing date through Date applies Date.parse, if necessary
+		date = date ? new Date(date) : new Date;
+		if (isNaN(date)) throw SyntaxError("invalid date");
+
+		mask = String(dF.masks[mask] || mask || dF.masks["default"]);
+
+		// Allow setting the utc argument via the mask
+		if (mask.slice(0, 4) == "UTC:") {
+			mask = mask.slice(4);
+			utc = true;
+		}
+
+		var	_ = utc ? "getUTC" : "get",
+			d = date[_ + "Date"](),
+			D = date[_ + "Day"](),
+			m = date[_ + "Month"](),
+			y = date[_ + "FullYear"](),
+			H = date[_ + "Hours"](),
+			M = date[_ + "Minutes"](),
+			s = date[_ + "Seconds"](),
+			L = date[_ + "Milliseconds"](),
+			o = utc ? 0 : date.getTimezoneOffset(),
+			flags = {
+				d:    d,
+				dd:   pad(d),
+				ddd:  dF.i18n.dayNames[D],
+				dddd: dF.i18n.dayNames[D + 7],
+				m:    m + 1,
+				mm:   pad(m + 1),
+				mmm:  dF.i18n.monthNames[m],
+				mmmm: dF.i18n.monthNames[m + 12],
+				yy:   String(y).slice(2),
+				yyyy: y,
+				h:    H % 12 || 12,
+				hh:   pad(H % 12 || 12),
+				H:    H,
+				HH:   pad(H),
+				M:    M,
+				MM:   pad(M),
+				s:    s,
+				ss:   pad(s),
+				l:    pad(L, 3),
+				L:    pad(L > 99 ? Math.round(L / 10) : L),
+				t:    H < 12 ? "a"  : "p",
+				tt:   H < 12 ? "am" : "pm",
+				T:    H < 12 ? "A"  : "P",
+				TT:   H < 12 ? "AM" : "PM",
+				Z:    utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
+				o:    (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
+				S:    ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
+			};
+
+		return mask.replace(token, function ($0) {
+			return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
+		});
+	};
+}();
+
+// Some common format strings
+dateFormat.masks = {
+	"default":      "ddd mmm dd yyyy HH:MM:ss",
+	shortDate:      "m/d/yy",
+	mediumDate:     "mmm d, yyyy",
+	longDate:       "mmmm d, yyyy",
+	fullDate:       "dddd, mmmm d, yyyy",
+	shortTime:      "h:MM TT",
+	mediumTime:     "h:MM:ss TT",
+	longTime:       "h:MM:ss TT Z",
+	isoDate:        "yyyy-mm-dd",
+	isoTime:        "HH:MM:ss",
+	isoDateTime:    "yyyy-mm-dd'T'HH:MM:ss",
+	isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
+};
+
+// Internationalization strings
+dateFormat.i18n = {
+	dayNames: [
+		"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
+		"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
+	],
+	monthNames: [
+		"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+	]
+};
+
+// For convenience...
+Date.prototype.Format = function (mask, utc) {
+	return dateFormat(this, mask, utc);
+};
+/*Date.prototype.Format = function (fmt) { //author: meizz 
     var o = {
         "M+": this.getMonth() + 1, //月份 
         "d+": this.getDate(), //日 
@@ -58,7 +183,7 @@ Date.prototype.Format = function (fmt) { //author: meizz
     for (var k in o)
     if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
     return fmt;
-}
+}*/
 //浏览器窗口大小变化重新加载
 window.onresize=webSiteInit;
 serializeObject = function(form) {

+ 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 style="right:0"><img src="/wxswordfish/images/right.png" style="width: 10px;height: 17px;float: right;"></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">

+ 2 - 2
core/src/web/templates/yellowpage/enterpriseinfo.html

@@ -326,13 +326,13 @@
 					{{range $k,$v := .T.res.alterInfo}}
 						<li>
 							<div>
-								<div><script>document.write(new Date(Number({{$v.AltDate}})).Format("yyyy-MM-dd hh:mm:ss"));</script></div>
+								<div><script>document.write(new Date({{$v.AltDate}}).Format("yyyy-MM-dd hh:mm:ss"));</script></div>
 								<div>{{$v.AltItemName}}</div>
 								<div>变更前:{{$v.AltBe}}<br>变更后:{{$v.AltAf}}</div>
 								<a></a>
 							</div>
 							<div>
-								<div><script>document.write(new Date(Number({{$v.AltDate}})).Format("yyyy-MM-dd hh:mm:ss"));</script></div>
+								<div><script>document.write(new Date({{$v.AltDate}}).Format("yyyy-MM-dd hh:mm:ss"));</script></div>
 								<div>{{$v.AltItemName}}</div>
 								<div>变更前:{{$v.AltBe}}<br>变更后:{{$v.AltAf}}</div>
 								<a></a>