zhanghongbo 9 年之前
父節點
當前提交
30b54dec36

+ 1 - 13
core/src/qfw/search/searchService.go

@@ -100,7 +100,7 @@ func (search *Search) FindServiceByEntId() error {
 		    }
 		  }}`
 		//需要查到的字段信息
-		fields = `"_id","s_name","s_introduction","s_images","s_enterpriseid","s_isshow","i_status","s_pricemy","i_comments","f_price"`
+		fields = `"_id","s_name","s_introduction","s_images","s_enterpriseid","s_isshow","i_status","s_pricemy","i_comments","f_price","i_sales"`
 		if currentPage == 1 {
 			count = elastic.Count("service", collection, query)
 		}
@@ -187,18 +187,6 @@ func (n *Search) GetEnterpriseList(reqType, param /*参数*/ string) error {
 //即时搜索
 func (n *Search) Sim() error {
 	keyword := n.GetString("words")
-	//查询送积分
-	userId := ObjToString(n.GetSession("userId"))
-	if len(userId) > 0 && len(keyword) > 0 {
-		credit_a := IntAll(n.GetSession("credit_a"))
-		if credit.AIsHasDo(credit.A_QYCX, credit_a) {
-			credit.UpuserCreditSession(userId, credit.B_QYCX, "B", nil, n.Action)
-		} else {
-			credit.UpuserCreditSession(userId, credit.A_QYCX, "A", nil, n.Action)
-			credit.UpuserCreditSession(userId, credit.B_QYCX, "B", nil, n.Action)
-		}
-	}
-
 	str := `{
 	          "match": {
 	            "enterprise.EntName": {

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

@@ -19,14 +19,15 @@ func (s *SwordFish) Swordfish() error {
 			s.T["data"] = r
 		}
 		content, _ := s.Render4Cache("/swordfish/index.html", &s.T)
-		redis.Put("other", "swordfish", string(content), 30*60*1000) //缓存半个小时
+		redis.Put("other", "swordfish", string(content), 1000) //缓存半个小时
 		return s.SetBody(content)
 	}
 }
 
 //跳转到订阅设置页面
 func (s *SwordFish) RssSet() error {
-	u := mongodb.FindById("user", s.GetSession("userId").(string), `{"o_msgset":1}`)
+	userId := s.GetSession("userId").(string)
+	u := mongodb.FindById("user", userId, `{"o_msgset":1}`)
 	msgset := (*u)["o_msgset"]
 	if msgset != nil {
 		if set, _ := msgset.(map[string]interface{}); set != nil {
@@ -48,7 +49,12 @@ func (s *SwordFish) RssSet() error {
 			}
 		}
 	}
+	_, list := getSwordFish(time.Now().Unix(), userId, nil, 10)
+	if len(*list) < 1 {
+		list = mongodb.Find("bidding", nil, `{"comeintime":-1}`, `{"title":1,"href":1,"publishtime":1}`, false, 0, 10)
+	}
 	s.T["msgset"] = msgset
+	s.T["list"] = *list
 	return s.Render("/swordfish/rssset.html", &s.T)
 }
 

+ 3 - 0
core/src/web/staticres/css/dev-qfw.css

@@ -301,6 +301,9 @@ a{
 .padding-t-10 {
 	padding-top: 10px !important;
 }
+.padding-r-10 {
+	padding-right: 10px !important;
+}
 .padding-15 {
 	padding: 15px !important;
 }

+ 2 - 0
core/src/web/staticres/css/entcommunity.css

@@ -651,6 +651,7 @@ a:focus, a:hover{
 .ent-table td{
 	padding: 15px 0px !important;
 	border-top: none !important;
+	white-space:nowrap;
 }
 .ent-table tr:first-child{
 	border-top: none !important;
@@ -663,4 +664,5 @@ a:focus, a:hover{
 	font-weight: bold;
 	word-wrap: break-word;
 	word-break: normal;
+	white-space: normal;
 }

+ 26 - 26
core/src/web/staticres/css/swordfish.css

@@ -62,6 +62,32 @@ a:focus, a:hover{
 	color: #37C6DA;
 	font-weight: normal;
 }
+.b-right>div{
+	padding-left: 10px;
+}
+.swordfish-right-title{
+	background-color: #F7F8FA;
+	font-size: 18px;
+	font-weight: bold;
+	padding: 10px;
+}
+ .tslist{
+	padding: 10px;
+	border-left: 1px solid #F7F8FA;
+}
+ .tslist a{
+	margin-left: 5px;
+	display: block;
+}
+.tslist .time{
+	margin-bottom: 5px;
+	color: #A0A0A0;
+}
+.tslist .time>img{
+	width: 10px;
+	height: 10px;
+	margin: 0px 10px 5px -15px;
+}
 /*剑鱼设置页面*/
 .swordfish-rssset .btn{
 	background-color: #37C6DA;
@@ -235,32 +261,6 @@ a:focus, a:hover{
 	margin-bottom: 20px;
 }
 /*******剑鱼首页*******/
-.swordfish-index .b-right>div{
-	padding-left: 10px;
-}
-.swordfish-index .swordfish-right-title{
-	background-color: #F7F8FA;
-	font-size: 18px;
-	font-weight: bold;
-	padding: 10px;
-}
-.swordfish-index .tslist{
-	padding: 10px;
-	border-left: 1px solid #F7F8FA;
-}
-.swordfish-index .tslist a{
-	margin-left: 5px;
-	display: block;
-}
-.swordfish-index .tslist .time{
-	margin-bottom: 5px;
-	color: #A0A0A0;
-}
-.swordfish-index .tslist .time>img{
-	width: 10px;
-	height: 10px;
-	margin: 0px 10px 5px -15px;
-}
 .swordfish-guide>div{
 	display: inline-block;
 	height: inherit;

+ 31 - 6
core/src/web/staticres/js/entportrait.js

@@ -106,14 +106,39 @@ function ServiceList(){
 			}
 			var html = '';
 			for(var i=0;i<r.length;i++){
+				var f_price = r[i].f_price;
+				if(typeof(f_price) == "undefined" || f_price == null || f_price == ""){
+					f_price = 0;
+				}
+				var i_sales = r[i].i_sales;
+				if(typeof(i_sales) == "undefined" || i_sales == null || i_sales == ""){
+					i_sales = 0;
+				}
+				var i_comments = r[i].i_comments;
+				if(typeof(i_comments) == "undefined" || i_comments == null || i_comments == ""){
+					i_comments = 0;
+				}
+				var flag = typeof(r[i].s_isshow) != "undefined" && r[i].s_isshow != null && r[i].s_isshow.indexOf("3")>-1;
 				html += '<tr>'
 						+'<td rowspan="2" width="120"><img src="'+(r[i].s_images==""?"null":r[i].s_images)+'" onerror="this.src=\'/images/services/default.png\'"></td>'
-						+'<td class="b-com-name"><a href="/market/detail/'+r[i]._id+'.html">'+r[i].s_name+'</a></td>'
-						+'<td width="100" class="text-center">报价:<font class="text-primary">'+(r[i].s_pricemy==1?"面议":r[i].f_price+"元")+'</font></td>'
-						+'<td width="100" class="text-center">评价:<font class="text-primary">'+r[i].i_comments+'</font></td>'
-						+'</tr><tr>'
-						+'<td>'+r[i].s_introduction+'</td>'
-						+'</tr>';
+						+'<td class="b-com-name">';
+				if(flag){
+					html += '<a href="/market/detail/'+r[i]._id+'.html">';
+				}
+				html += r[i].s_name;
+				if(flag){
+					html += '</a>';
+				}
+				html += '</td>';
+				if(flag){
+					html += '<td width="150" class="text-center"><font class="b-disabled">报价:</font><font class="text-primary">'+(r[i].s_pricemy==1?"面议":f_price+"元")+'</font></td>'
+						+'<td width="250" class="text-center"><font class="b-disabled">成交:</font><font class="text-primary">'+i_sales+'</font><font class="margin-lr-5 b-disabled">|</font><font class="b-disabled">评价:</font><font class="text-primary">'+i_comments+'</font></td>';
+				}else{
+					html += '<td>&nbsp;</td><td>&nbsp;</td>';
+				}
+				html += '</tr><tr>'
+					+'<td>'+r[i].s_introduction+'</td>'
+					+'</tr>';
 			}
 			$("#serviceListPaging").parent().prevAll().remove();
 			$("#serviceListPaging").parent().before(html);

+ 1 - 5
core/src/web/templates/common/memberleft.html

@@ -258,7 +258,7 @@ var MemberLeftMenu = {
 	},
 	//积分规则
 	creditRule: function(){
-		return '<a onclick="creditModel(2)" class="menu-childnode2 list-group-item"><i class="glyphicon"></i>积分规则</a>';
+		return '<a href="/member/credit/creditRule" class="menu-childnode2 list-group-item"><i class="glyphicon"></i>积分规则</a>';
 	}
  };
 $(function (){
@@ -292,16 +292,12 @@ function creditModel(type){
 	if (num>2){
 		if(type=="1"){
 			window.location.href="/member/credit/myCredit";
-		}else{
-			window.location.href="/member/credit/creditRule";
 		}
 	}else{
 		$("#vipcreditModal").modal("show");
 		$('#vipcreditModal').on('hidden.bs.modal', function () {
 			if(type=="1"){
 				window.location.href="/member/credit/myCredit";
-			}else{
-				window.location.href="/member/credit/creditRule";
 			}
 		})	
 	}

+ 42 - 23
core/src/web/templates/swordfish/rssset.html

@@ -1,6 +1,8 @@
 <html>
 <head>
 <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>
@@ -100,9 +102,12 @@
 			<div class="swordfish-panel-c">开发中,敬请期待!</div>
 		</div>
 	</div>
-	<div class="b-right swordfish-qrcode text-center">
-		<img src="/images/swordfish/qrcode.png">
-		<br>关注微信公众号:企明星
+	 
+	<div class="b-right">
+		<div class="swordfish-right-title">
+			剑鱼最新消息
+		</div>
+		<div id="list"></div>
 	</div>
 </div>
 
@@ -117,16 +122,6 @@
 					<li>
 						<button class="btn">全国</button>
 					</li>
-					<li>
-						<div>华东地区</div>
-						<button class="btn">上海</button>
-						<button class="btn">江苏</button>
-						<button class="btn">浙江</button>
-						<button class="btn">安徽</button>
-						<button class="btn">江西</button>
-						<button class="btn">山东</button>
-						<button class="btn">福建</button>
-					</li>
 					<li>
 						<div>华北地区</div>
 						<button class="btn">北京</button>
@@ -136,10 +131,20 @@
 						<button class="btn">内蒙古</button>
 					</li>
 					<li>
-						<div>华中地区</div>
-						<button class="btn">河南</button>
-						<button class="btn">湖北</button>
-						<button class="btn">湖南</button>
+						<div>东北地区</div>
+						<button class="btn">黑龙江</button>
+						<button class="btn">吉林</button>
+						<button class="btn">辽宁</button>
+					</li>
+					<li>
+						<div>华东地区</div>
+						<button class="btn">上海</button>
+						<button class="btn">江苏</button>
+						<button class="btn">浙江</button>
+						<button class="btn">安徽</button>
+						<button class="btn">江西</button>
+						<button class="btn">山东</button>
+						<button class="btn">福建</button>
 					</li>
 					<li>
 						<div>华南地区</div>
@@ -150,6 +155,12 @@
 						<button class="btn">澳门</button>
 						<button class="btn">台湾</button>
 					</li>
+					<li>
+						<div>华中地区</div>
+						<button class="btn">河南</button>
+						<button class="btn">湖北</button>
+						<button class="btn">湖南</button>
+					</li>
 					<li>
 						<div>西南地区</div>
 						<button class="btn">重庆</button>
@@ -166,12 +177,6 @@
 						<button class="btn">宁夏</button>
 						<button class="btn">新疆</button>
 					</li>
-					<li>
-						<div>东北地区</div>
-						<button class="btn">黑龙江</button>
-						<button class="btn">吉林</button>
-						<button class="btn">辽宁</button>
-					</li>
 				</ul>
 				<div class="clearfix"></div>
 	      	</div>
@@ -636,6 +641,20 @@ function swordfishpay(oprtype){
 $('#tishiModal').on('hidden.bs.modal', function () {
   swordfishpay(1);
 })
+
+$(function(){
+	var data = {{.T.list}};
+	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);
+	}
+});
 </script>
 </body>
 </html>

+ 1 - 1
weixin/src/config.json

@@ -33,5 +33,5 @@
                 "title":"企明星新年抽奖活动进行中",
                 "picurl":"http://www.qimingxing.info/images/choujiang.png"
         },"weixinautorpl":"小主的吩咐我们已经收到了,请留下您的联系方式(手机号或qq号),企明星客服会在下一个工作日9:00-17:00给小主回复哦!",
-		"creditRpc":"http://127.0.0.1:8765"
+		"creditRpc":"127.0.0.1:8765"
 }

+ 5 - 1
weixin/src/qfw/weixin/dao/userdao.go

@@ -42,7 +42,11 @@ func AddUser(openid, unionid, bindweixin, userphoto string) (err error, flag int
 		data["s_m_openid"] = openid //微信手机端openid
 		if id := Save("user", data); len(id) > 0 {
 			//赠送个人,新用户注册积分
-			go credit.InCreditA(id, credit.A_ZC, 0)
+			go util.Try(func() {
+				credit.InCreditA(id, credit.A_ZC, 0)
+			}, func(e interface{}) {
+				log.Println(e)
+			})
 			//赠送个人用户游戏卡1张,可以用来抽奖
 			//go SaveMyNewUserCoupon(openid)
 			//卡劵赠送完成,暂不存来源记录

+ 9 - 0
weixin/src/qfw/weixin/msgtxtchandler.go

@@ -74,6 +74,15 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 		//查改用户是否已经抽过奖
 		if dao.FindWinningRecord(r.FromUserName, wf.SysConfig.Activity["activitycode"]) {
 			w.ReplyText("小主莫贪心,每人只有一次抽奖机会呦")
+<<<<<<< HEAD
+=======
+		}*/
+		//TODO 改为查我的抽奖卷
+		if dao.GetMyCouponAmount(r.FromUserName) <= 0 {
+			w.ReplyText("对不起,你的奖劵不足。您可以查看<a href='http://www.qimingxing.info/p/'>企明星的最新活动</a>赚取积分。")
+		} else if dao.GetMyTodayDrawTimes(openid) > 0 { //检查今日抽奖次数
+			w.ReplyText("对不起,你今天的抽奖次数已经用完,请您明天再来。")
+>>>>>>> 456c5e620092155af63ebe9691a745396ed266d2
 		} else {
 			targeturl := fmt.Sprintf("http://%s/activity/%s/%s", wf.SysConfig.Domain, wf.SysConfig.Activity["activitycode"], se.EncodeString(r.FromUserName))
 			log.Println("choujiang url:", targeturl)