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

+ 13 - 0
common/src/qfw/util/credit/credit.go

@@ -30,6 +30,7 @@ const (
 	A_FXFWXQ = "a13" //分享服务
 	A_WCJY   = "a14" //完成交易
 	A_WCJYPJ = "a15" //完成交易评价
+	A_JYSCTS = "a63" //剑鱼首次推送
 
 	B_QD       = "b1" //签到
 	B_QD_T     = 7    //最高连续签到次数
@@ -81,6 +82,18 @@ func InCreditA(userId, code string, credit_a int) (bool, int, int, error) {
 	return result, credit_a, 0, nil
 }
 
+//剑鱼一次性任务
+func CheckSword(userId, code string, credit_a int, xb *xweb.Action) bool {
+	result := false
+	if !AIsHasDo(code, credit_a) {
+		result, credit_a = UpuserCreditA(code, userId, credit_a)
+		if result {
+			xb.Session().UpdateByCustomField("id", userId, "credit_a", credit_a)
+		}
+	}
+	return result
+}
+
 //日常任务积分
 func InCreditB(userId, code string, param map[string]interface{}) (bool, int, error) {
 	b := false

+ 1 - 1
common/src/qfw/util/encrypt_test.go

@@ -12,7 +12,7 @@ import (
 func TestEncrypt(t *testing.T) {
 	se := &SimpleEncrypt{Key: "topnet"}
 
-	log.Println(se.EncodeString("oJULtwzXo6EFV1Ah-XeyRBimXGM8,ff,ff,swordfishaction"))
+	log.Println(se.EncodeString("obEpLuH03fTYZ2e0xhJL3k7H6q48,ff,ff,swordfishaction"))
 }
 
 func Test_sim(t *testing.T) {

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

@@ -16,7 +16,7 @@ type Mobile struct {
 	getMyCredit   xweb.Mapper `xweb:"/member/credit/getcredit"`
 	swordfishPay  xweb.Mapper `xweb:"/member/credit/swordfishpay"`
 	msgSet        xweb.Mapper `xweb:"/swordfish/msgpushsetting/msgset"`
-	ajaxReq       xweb.Mapper `xweb:"/swordfish/ajaxReq"`
+	ajaxReq       xweb.Mapper `xweb:"/member/swordfish/ajaxReq"`
 	advise        xweb.Mapper `xweb:"/mobile/advise"`
 	adviseSave    xweb.Mapper `xweb:"/mobile/advisesave"`
 	wxpushList    xweb.Mapper `xweb:"/wxpush/bid/(.*)/(.*)/(.*)"` //推送列表

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

@@ -30,6 +30,8 @@ func (s *SwordFish) Swordfish() error {
 func (s *SwordFish) RssSet() error {
 	u := mongodb.FindById("user", s.GetSession("userId").(string), `{"o_msgset":1}`)
 	s.T["msgset"] = (*u)["o_msgset"]
+	//判断是否使用过剑鱼
+
 	return s.Render("/swordfish/rssset.html", &s.T)
 }
 func (s *SwordFish) RsssetAjaxReq() error {

+ 23 - 1
core/src/web/staticres/css/swordfish.css

@@ -47,6 +47,21 @@ a:focus, a:hover{
 	padding-left: 3px;
 	padding-top: 1px;
 }
+.swordfish-page-title span{
+	margin-right: 5px;
+	width: 25px;
+	height: 25px;
+	font-size: 14px;
+	color: #CCCCCC;
+	text-align: center;
+	padding-left: 3px;
+	padding-top: 1px;
+	font-weight: normal;
+}
+.swordfish-page-title a{
+	color: #37C6DA;
+	font-weight: normal;
+}
 /*剑鱼设置页面*/
 .swordfish-rssset .btn{
 	background-color: #37C6DA;
@@ -95,6 +110,13 @@ a:focus, a:hover{
 	font-size: 14px;
 	font-weight: normal;
 	margin-left: 10px;
+	color: #666666;
+}
+.swordfish-panel-t a{
+	font-size: 14px;
+	font-weight: normal;
+	margin-left: 10px;
+	color: #37C6DC;
 }
 .swordfish-panel-t img{
 	width: 15px;
@@ -160,7 +182,7 @@ a:focus, a:hover{
 }
 .swordfish-keywords lable{
 	display: inline-block;
-	width: 70px;
+	width: 75px;
 }
 .swordfish-keywords img{
 	width: 20px;

+ 2 - 1
core/src/web/staticres/wxswordfish/main.js

@@ -379,6 +379,7 @@ function commonAjaxReq(object,module){
 	}
 	dataObj[module+"_keys"] = this.setKeyWord(module);
 	dataObj[module+"_scope"] = this.setScope(module);
+
 	if(dataObj[module+"_keys"].length > 0 && dataObj[module+"_scope"] == ""){
 		dataObj[module+"_scope"] = "A";
 	}
@@ -387,7 +388,7 @@ function commonAjaxReq(object,module){
 	/*****************************************/
 	$.ajax({
 		type: "POST",
-		url: "/swordfish/ajaxReq",
+		url: "/member/swordfish/ajaxReq",
 		data: dataObj,
 		dataType: "json",
 		traditional: true,

+ 65 - 26
core/src/web/templates/swordfish/rssset.html

@@ -11,13 +11,18 @@
 	<div class="b-left">
 		<div class="swordfish-page-title">
 			<i class="img-circle glyphicon jianyu"></i>订阅设置
+			<span >继续使用表明你已经同意了<span><a>剑鱼用户服务协议</a>
+			<span style="float:right;width:190px">
+			<a id="ckys">查看演示&nbsp;&nbsp;</a>
+			<a id="sfbz">收费标准</a>
+			<a id="yjfk">去提意见</a>
+			</span>
 		</div>
-		<div class="swordfish-explain">
+		<div id="swordfish-tishi" class="swordfish-explain">
 			“剑鱼”是企明星的特色产品,它借助内置的互联网搜索引擎、大数据平台和自然语言分析系统,
 			为企业从互联网上自动抓取、分析、筛选并推送富有价值的信息情报,
 			比如本企业或其他企业的失信行为信息、受到行政处罚的信息、招标公告、中标公告等等。
 			您在输入了想要订阅的信息主题以后,网上一旦发布这些主题的信息,剑鱼就会第一时间将信息推送给您。
-			<br><span class="pull-right">信息类型太少?没有找到想要的?<a id="yjfk">去提意见</a></span>
 			<div class="clearfix"></div>
 		</div>
 		<div class="swordfish-panel" id="tender">
@@ -25,11 +30,12 @@
 				<img class="swordfish-uncheck" src="/images/swordfish/checkbox.png">
 				<img class="swordfish-checked" src="/images/swordfish/checkbox-a.png">
 				招标公告
+				<span id="tender-panel-info">本栏目推送服务期还剩3天。想要服务不间断,请确保积分充足。 <a href="/member/credit/myCredit">去做任务赚积分</a></span>
 			</div>
 			<div class="swordfish-panel-c">
 				<div>
 					<div class="swordfish-panel-c-t">
-						<span></span><div>订阅关键词<span>最多订阅5组关键词</span></div>
+						<span></span><div>订阅关键词<span>最多订阅10组关键词</span></div>
 					</div>
 					<div class="swordfish-panel-c-c swordfish-keywords" id="tender-keywords">
 						<button class="btn" id="tender-addkeyword"><span>+</span>添加关键词</button>
@@ -50,11 +56,12 @@
 				<img class="swordfish-uncheck" src="/images/swordfish/checkbox.png">
 				<img class="swordfish-checked" src="/images/swordfish/checkbox-a.png">
 				中标公告
+				<span id="bid-panel-info">本栏目推送服务期还剩3天。想要服务不间断,请确保积分充足。 <a href="/member/credit/myCredit">去做任务赚积分</a></span>
 			</div>
 			<div class="swordfish-panel-c">
 				<div>
 					<div class="swordfish-panel-c-t">
-						<span></span><div>订阅关键词<span>最多订阅5组关键词</span></div>
+						<span></span><div>订阅关键词<span>最多订阅10组关键词</span></div>
 					</div>
 					<div class="swordfish-panel-c-c swordfish-keywords" id="bid-keywords">
 						<button class="btn swordfish-addkeyword" id="bid-addkeyword"><span>+</span>添加关键词</button>
@@ -230,10 +237,11 @@
 <!-- 底部 -->
 {{include "/common/bottom.html"}}
 <script type="text/javascript">
+
 $(function(){
-	var selectKeyword = function(type,keyword){
+	var selectKeyword = function(type,keyword,i_switchstatus){
 		if(keyword == "" || typeof(keyword) == "undefined"){
-			autoChecked(type,false);
+			autoChecked(type,i_switchstatus==1?true:false,i_switchstatus);
 			return;
 		}
 		for(var i=0;i<keyword.length;i++){
@@ -265,14 +273,21 @@ $(function(){
 	if(msgset != ""){
 		if(typeof(msgset.tender) != "undefined"){
 			selectScope("tender",msgset.tender.s_scope);
-			selectKeyword("tender",msgset.tender.a_key);
+			var i_switchstatus=msgset.tender.i_switchstatus;
+			selectKeyword("tender",msgset.tender.a_key,i_switchstatus);
+			autoChecked("tender",i_switchstatus==1?true:false,i_switchstatus);
 		}
 		if(typeof(msgset.bid) != "undefined"){
 			selectScope("bid",msgset.bid.s_scope);
-			selectKeyword("bid",msgset.bid.a_key);
+			var i_switchstatus=msgset.bid.i_switchstatus
+			selectKeyword("bid",msgset.bid.a_key,i_switchstatus);
+			autoChecked("bid",i_switchstatus==1?true:false,i_switchstatus);
 		}
 	}
 	$(".b-nav>ul>li:eq(2)").addClass("b-nav-active");
+	$("#ckys").click(function(){
+		window.location.href="/front/swordfish";
+	});
 	$("#yjfk").click(function(){
 		$("body").append('<form id="feedbackForm" action="/front/web_feedbacklist.html" method="post" class="hide"><input type="hidden" name="url" value="'+window.location.href+'"></form>');
 		$("#feedbackForm").submit();
@@ -294,13 +309,16 @@ $(function(){
 	$(".swordfish-uncheck").click(function(){
 		$(this).next().show();
 		$(this).hide();
-		autoChecked($(this).parents(".swordfish-panel").attr("id"),true);
+		autoChecked($(this).parents(".swordfish-panel").attr("id"),true,1);
 	});
+	var arrinfo=["您选择了?个信息栏目,确认后系统将每月扣除?积分,您目前的积分余额是?积分,扣除后将剩余?积分。",
+				"ss"];
 	$(".swordfish-checked").click(function(){
 		$(this).parents(".swordfish-panel").removeClass("swordfish-panel-a");
 		$(this).prev().show();
 		$(this).hide();
-		ajaxReq();
+		$(this).next().css('display','none');
+		//ajaxReq();
 	});
 });
 function afterSelectScope(type,btn){
@@ -326,10 +344,10 @@ function afterSelectScope(type,btn){
 			}
 		});
 	}
-	autoChecked(type,true);
+	autoChecked(type,true,1);
 	ajaxReq();
 }
-function autoChecked(type,flag){
+function autoChecked(type,flag,i_switchstatus){
 	var obj = $("#"+type);
 	if(obj.find(".swordfish-scope").children(".btn").length == 0){
 		obj.find(".swordfish-scope").html('<button class="btn swordfish-btn-a swordfish-country">全国</button>');
@@ -338,9 +356,13 @@ function autoChecked(type,flag){
 	if(obj.hasClass("swordfish-panel-a")){
 		return;
 	}
-	obj.addClass("swordfish-panel-a");
-	obj.find(".swordfish-uncheck").hide();
-	obj.find(".swordfish-checked").show();
+	if(i_switchstatus==1){
+		obj.addClass("swordfish-panel-a");
+		obj.find(".swordfish-uncheck").hide();
+		obj.find(".swordfish-checked").show();
+		obj.find(".swordfish-checked").next().css('display','');
+	}
+	
 	if(obj.find(".swordfish-keywords").children(".swordfish-keyword").length == 0){
 		appendKeyWord(type,"",false);
 	}
@@ -350,18 +372,25 @@ function autoChecked(type,flag){
 }
 function appendKeyWord(type,value,isFocus){
 	this.getHtml = function(index,value){
-		return '<div class="swordfish-keyword">'
+		var html='<div class="swordfish-keyword">'
 					+'<lable>关键词<font>'+index+'</font>:</lable>'
 					+'<input type="text" class="form-control" value="'+(value?value:"")+'" placeholder="示例:综合布线 电话线 网线" maxlength="100">'
 					+'<img src="/images/swordfish/delete.png">'
 				+'</div>';
+		if (index==1){
+			html='<div class="swordfish-keyword">'
+					+'<lable>关键词<font>'+index+'</font>:</lable>'
+					+'<input type="text" class="form-control" value="'+(value?value:"")+'" placeholder="示例:综合布线 电话线 网线" maxlength="100">'
+				+'</div>';
+		}
+		return html;
 	}
 	var obj = $("#"+type+"-keywords");
 	var count = obj.children(".swordfish-keyword").length;
-	if(count >= 5){
+	if(count >= 10){
 		return;
 	}
-	if(count == 4){
+	if(count == 9){
 		$("#"+type+"-addkeyword").attr("disabled",true);
 	}
 	var node = $(getHtml(count+1,value));
@@ -372,24 +401,27 @@ function appendKeyWord(type,value,isFocus){
 		obj.find(".swordfish-keyword").each(function(i){
 			$(this).children("b").children("font").text(i+1);
 		});
-		autoChecked(type,false);
+		//autoChecked(type,false,i_switchstatus);
 		ajaxReq();
 	});
 	node.children("[type='text']").blur(function(){
-		autoChecked(type,false);
+		//autoChecked(type,false,i_switchstatus);
 		ajaxReq();
 	});
 	if(isFocus){
 		node.children("[type='text']").focus()
 	}
-	autoChecked(type,false);
+	//autoChecked(type,false,i_switchstatus);
 }
 function ajaxReq(){
 	var thisClass = this;
 	var dataObj = {
+		reqType: "other",
+		snopshot:false,
 		tender_flag: $("#tender").hasClass("swordfish-panel-a"),
 		bid_flag: $("#bid").hasClass("swordfish-panel-a")
 	};
+
 	//关键词
 	this.setKeyWord = function(type){
 		var tender_keys = [];
@@ -417,19 +449,26 @@ function ajaxReq(){
 		return tender_scope.join(",");
 	}
 	/*******************招标公告****************/
+	dataObj["tender_keys"] = this.setKeyWord("tender");
+	dataObj["tender_scope"] = this.setScope("tender");
 	if(dataObj.tender_flag){
-		dataObj["tender_keys"] = this.setKeyWord("tender");
-		dataObj["tender_scope"] = this.setScope("tender");
+		dataObj["tender_switchstatus"] = 1;
+	}else{
+		dataObj["tender_switchstatus"] = 0;
 	}
 	/*******************中标公告****************/
+	dataObj["bid_keys"] = this.setKeyWord("bid");
+	dataObj["bid_scope"] = this.setScope("bid");
 	if(dataObj.bid_flag){
-		dataObj["bid_keys"] = this.setKeyWord("bid");
-		dataObj["bid_scope"] = this.setScope("bid");
+		dataObj["bid_switchstatus"] = 1;	
+	}else{
+		dataObj["bid_switchstatus"] = 0;
 	}
 	/*****************************************/
 	$.ajax({
 		type: "POST",
-		url: "/member/swordfish/rssset/ajaxReq",
+		//url: "/member/swordfish/rssset/ajaxReq",
+		url: "/member/swordfish/ajaxReq",
 		data: dataObj,
 		dataType: "json",
 		traditional: true,

+ 1 - 0
credit/src/config.json

@@ -67,6 +67,7 @@
         "txt_a13": "分享服务",
         "txt_a14": "完成交易",
         "txt_a15": "完成交易评价",
+		"txt_a63": "剑鱼首次推送",
         "txt_a64": "完成一次性所有任务",
         "txt_b1": "签到",
         "txt_b2": "企业查询",