فهرست منبع

Merge branch 'dev4.5' of http://192.168.3.207:8080/qmx/jy into dev4.5

zhangyuhan 4 سال پیش
والد
کامیت
13035ca2f5

+ 3 - 4
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -174,8 +174,8 @@
                 }
             </script>
             <div class="toolbar">
-                {{if .T.isVip}}
-                    <!--VIP-->
+                {{if or .T.isVip .T.isEntniche .T.isMember }}
+                    <!--付费用户-->
                     <div class="type_label clearfix">
                         <script>var area="{{.T.obj.area}}"; if(area!="A" && area.replace(/\s+/g,"")!=""){document.write('<span class="tag area">'+area+'</span>');}</script>
                         <script>
@@ -260,7 +260,7 @@
                         </div>
                     </div>
                 {{else}}
-                    <!--非VIP-->
+                    <!--非付费用户-->
                     <div class="tool_top">
                         <script>var area="{{.T.obj.area}}"; if(area!="A" && area.replace(/\s+/g,"")!=""){document.write('<span class="tag area">'+area+'</span>');}</script>
                         <script>
@@ -1897,7 +1897,6 @@
     $('.collec_star').on('click', function () {
         var $this = $(this)
         var $icon = $this.children('.icon')
-        var $text = $this.children('.icon-text')
         var shoucang = $icon.hasClass('weishoucang')
         // 说明未收藏,点击收藏
         if (vKeepComponent) {

+ 49 - 0
src/jfw/modules/publicapply/src/applocation/entity/entity.go

@@ -0,0 +1,49 @@
+package entity
+
+import (
+	"db"
+	"fmt"
+	"log"
+	"qfw/util/redis"
+	"time"
+)
+
+type AppLocStruct struct {
+	UserId    string //用户id
+	Longitude string // 经度
+	Latitude  string //纬度
+}
+
+func NewAppLoc(userId, longitude, latitude string) *AppLocStruct {
+	return &AppLocStruct{userId, longitude, latitude}
+}
+
+var AppLocLog = "apploc_log"
+var RedisUserKey = "apploc_%s"
+
+//保存定位信息
+func (this *AppLocStruct) SaveAppLocInfo() bool {
+	log.Println(this.Longitude, "---", this.Latitude)
+	timeNow := time.Now()
+	appLocInfo := map[string]interface{}{
+		"date":      timeNow.Unix(),
+		"userId":    this.UserId,
+		"longitude": this.Longitude,
+		"latitude":  this.Latitude,
+	}
+	if db.Mgo_Log.Save(AppLocLog, appLocInfo) != "" {
+		redis.Put("other", fmt.Sprintf(RedisUserKey, this.UserId), timeNow.Day(), 12*60*60)
+		return true
+	}
+	return false
+}
+
+//是否保存信息
+func (this *AppLocStruct) IsSaveBool() bool {
+	_day := time.Now().Day()
+	day := redis.GetInt("other", fmt.Sprintf(RedisUserKey, this.UserId))
+	if day != _day {
+		return true
+	}
+	return false
+}

+ 11 - 0
src/jfw/modules/publicapply/src/applocation/init.go

@@ -0,0 +1,11 @@
+package applocation
+
+import (
+	"applocation/service"
+
+	"github.com/go-xweb/xweb"
+)
+
+func init() {
+	xweb.AddAction(&service.ServiceStruct{})
+}

+ 38 - 0
src/jfw/modules/publicapply/src/applocation/service/service.go

@@ -0,0 +1,38 @@
+package service
+
+import (
+	. "api"
+	"applocation/entity"
+	"log"
+	qu "qfw/util"
+
+	"github.com/go-xweb/xweb"
+)
+
+type ServiceStruct struct {
+	*xweb.Action
+	appLocAction xweb.Mapper `xweb:"/appLoc/action"` //app端定位信息
+}
+
+var AppLocUser = map[string][]string{}
+
+//保存定位信息
+func (this *ServiceStruct) AppLocAction() {
+	userId, _ := this.GetSession("userId").(string)
+	defer qu.Catch()
+	r := func() Result {
+		var retBool = false
+		if this.Method() != "POST" {
+			return Result{Data: nil, Error_msg: Error_msg_1005}
+		}
+		longitude := this.GetString("longitude") //经度
+		latitude := this.GetString("latitude")   //纬度
+		newAppLoc := entity.NewAppLoc(userId, longitude, latitude)
+		if newAppLoc.IsSaveBool() {
+			retBool = newAppLoc.SaveAppLocInfo()
+		}
+		log.Println("retBool:", retBool)
+		return Result{Data: retBool}
+	}()
+	this.ServeJson(r)
+}

+ 12 - 0
src/jfw/modules/publicapply/src/bidcollection/entity/entity.go

@@ -464,6 +464,7 @@ func GetCollList(c *CollList, userid string) map[string]interface{} {
 	data := db.Mysql.SelectBySql(sql)
 	count := 0
 	result := []map[string]interface{}{}
+	ids := ""
 	if data != nil && len(*data) > 0 {
 		if c.Pagenum <= 0 {
 			c.Pagenum = 1
@@ -477,6 +478,16 @@ func GetCollList(c *CollList, userid string) map[string]interface{} {
 			result = (*data)[start:end]
 		}
 		count = len(*data)
+		// util.CommonEncodeArticle("content", encodeId)
+		log.Println(time.Now())
+		for k, v := range *data {
+			if k == len(*data)-1 {
+				ids += util.EncodeId(qu.ObjToString(v["bid"]))
+			} else {
+				ids += util.EncodeId(qu.ObjToString(v["bid"])) + ","
+			}
+		}
+		log.Println(time.Now())
 	}
 	haveNextPage := len(result) >= pagesize_max
 	// rdata["res"] = result
@@ -484,6 +495,7 @@ func GetCollList(c *CollList, userid string) map[string]interface{} {
 	rdata["haveNextPage"] = haveNextPage
 	rdata["pageSize"] = pagesize_max
 	rdata["res"] = GetInfoById(db.Mgo_Bidding, db.DbConf.Mongodb.Bidding.Collection, db.DbConf.Mongodb.Bidding.Collection_change, result)
+	rdata["ids"] = ids
 	return rdata
 }
 

+ 1 - 0
src/jfw/modules/publicapply/src/main.go

@@ -2,6 +2,7 @@ package main
 
 import (
 	_ "a"
+	_ "applocation"
 	_ "bidcollection"
 	. "config"
 	_ "dataexport"

+ 2 - 3
src/web/templates/weixin/wxinfocontent_rec.html

@@ -683,8 +683,8 @@ pre {
           type=""
         }
 
-        {{if .T.isVip}}
-          // VIP用户
+        {{if or .T.isVip .T.isEntniche .T.isMember }}
+          // 付费用户
 				  var buyerclass={{.T.obj.buyerclass}};
           if(buyerclass){
             document.write("<span class='tag buyerclass'>"+ buyerclass+"</span>");
@@ -2247,7 +2247,6 @@ function getCollectionState () {
 $('.collec_star').on('click', function () {
     var $this = $(this)
     var $icon = $this.children('.icon')
-    var $text = $this.children('.icon-text')
     var shoucang = $icon.hasClass('weishoucang')
     if (vKeepComponent) {
         vKeepComponent.changeBid(id, shoucang)