Jelajahi Sumber

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

zhangyuhan 3 tahun lalu
induk
melakukan
e09d6869ba

+ 2 - 2
src/jfw/modules/app/src/web/staticres/jyapp/js/historypush.js

@@ -492,9 +492,9 @@ var vm = new Vue({
             _this.entinfo = res.data
             let address = ''
             if(res.data.admin_department || res.data.admin_system) {
-              address = '/page_entniche/page/sub_management/sub_management_system.html'
+              address = '/page_entniche_new/page/sub_management/sub_management_system.html'
             } else {
-              address = '/page_entniche/page/subsetting/sub_entrance.html'
+              address = '/page_entniche_new/page/subsetting/sub_entrance.html'
             }
             $("#sub_manager").click(function() {
               setSessionStorage();

+ 7 - 3
src/jfw/modules/app/src/web/staticres/jyapp/me/js/mine.js

@@ -129,10 +129,14 @@ var mine = {
         // 我的企业跳转
         $('.my-ent').on('click', function(e) {
           setLiActive(e.currentTarget)
-          if(entUserInfo.isNew) {
-            location.href = '/page_entniche_new/ent/enterprise?t=' + new Date().getTime()
+          if(entUserInfo.status === 2||entUserInfo.isPower) {
+            if(entUserInfo.isNew) {
+              location.href = '/page_entniche_new/ent/enterprise?t=' + new Date().getTime()
+            } else {
+              location.href = '/page_entniche/ent/enterprise?t=' + new Date().getTime()
+            }
           } else {
-            location.href = '/page_entniche/ent/enterprise?t=' + new Date().getTime()
+            location.href = '/page_entniche_new/ent/enterprise?t=' + new Date().getTime()
           }
         })
         

+ 6 - 5
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -1218,11 +1218,12 @@
                                 }
                             } else {
                                 // 跳转到创建企业页面
-                                if(res.data.isNew) {
-                                  location.href = '/page_entniche_new/page/introduce_page.html'
-                                } else {
-                                  location.href = '/page_entniche/page/introduce_page.html'
-                                }
+                                location.href = '/page_entniche_new/page/introduce_page.html'
+                                // if(res.data.isNew) {
+                                //   location.href = '/page_entniche_new/page/introduce_page.html'
+                                // } else {
+                                //   location.href = '/page_entniche/page/introduce_page.html'
+                                // }
                             }
                         }
                     });

+ 21 - 22
src/jfw/modules/common/src/qfw/util/jy/switchService.go

@@ -1,11 +1,11 @@
 package jy
 
 import (
+	"fmt"
+	"github.com/go-xweb/httpsession"
 	. "mongodb"
 	"qfw/util"
 	"qfw/util/mysql"
-
-	"github.com/go-xweb/httpsession"
 )
 
 var SwitchService = &switchService{
@@ -32,10 +32,8 @@ type switchService struct {
  */
 func (s *switchService) Get(session *httpsession.Session, m MongodbSim) string {
 	userId, _ := session.Get("userId").(string)
-	//entUserId := util.IntAll(this.GetSession(""))
 	v, _ := session.Get(s.SessionKey).(string)
 	u, ok := m.FindById("user", userId, `{"i_member_status":1,"i_vip_status":1}`)
-	//entniche:=false
 	if ok && u != nil {
 		if i_vip_status := util.IntAll((*u)["i_vip_status"]); v == s.Vip && i_vip_status > 0 {
 			return s.Vip
@@ -44,7 +42,7 @@ func (s *switchService) Get(session *httpsession.Session, m MongodbSim) string {
 		} else if i_vip_status > 0 {
 			session.Set(s.SessionKey, s.Vip)
 			return s.Vip
-		}else if i_member_status > 0 {
+		} else if i_member_status > 0 {
 			session.Set(s.SessionKey, s.Member)
 			return s.Member
 		}
@@ -53,26 +51,30 @@ func (s *switchService) Get(session *httpsession.Session, m MongodbSim) string {
 	return s.Free
 }
 
-func (s *switchService) GetEntniche(session *httpsession.Session, m MongodbSim,sql *mysql.Mysql) string {
+func (s *switchService) GetEntniche(session *httpsession.Session, m MongodbSim, sql *mysql.Mysql) string {
 	userId, _ := session.Get("userId").(string)
 	entUserId := util.IntAll(session.Get("entUserId"))
 	v, _ := session.Get(s.SessionKey).(string)
 	u, ok := m.FindById("user", userId, `{"i_member_status":1,"i_vip_status":1}`)
-	entniche:=false
-	res := sql.SelectBySql(`SELECT i.isNew,i.name,i.phone,i.status,i.auth_status,u.power FROM entniche_user u LEFT JOIN entniche_info i
+	entniche := false
+	fmt.Println("2222",entUserId)
+	if entUserId != 0 {
+		res := sql.SelectBySql(`SELECT i.isNew,i.name,i.phone,i.status,i.auth_status,u.power FROM entniche_user u LEFT JOIN entniche_info i
 			ON u.ent_id=i.id
 			ORDER BY  i.status DESC,i.auth_status DESC, CASE WHEN u.id=? THEN 0  ELSE 1 END  ASC`, entUserId)
-	if res != nil && len(*res) > 0 {
-		//已购买企业未过期-商机管理用户
-		for _, v := range *res {
-			if util.IntAll(v["status"]) == 1 && util.IntAll(v["power"]) == 1 && util.IntAll(v["isNew"]) == 1 {
-				//d["isFree"] = false
-				//d["entniche"] = true
-				entniche=true
-				break
+		if res != nil && len(*res) > 0 {
+			//已购买企业未过期-商机管理用户
+			for _, v := range *res {
+				if util.IntAll(v["status"]) == 1 && util.IntAll(v["power"]) == 1 && util.IntAll(v["isNew"]) == 1 {
+					//d["isFree"] = false
+					//d["entniche"] = true
+					entniche = true
+					break
+				}
 			}
 		}
 	}
+	fmt.Println("22223",entniche)
 	if ok && u != nil {
 		if i_vip_status := util.IntAll((*u)["i_vip_status"]); v == s.Vip && i_vip_status > 0 {
 			return s.Vip
@@ -81,10 +83,11 @@ func (s *switchService) GetEntniche(session *httpsession.Session, m MongodbSim,s
 		} else if i_vip_status > 0 {
 			session.Set(s.SessionKey, s.Vip)
 			return s.Vip
-		} else if entniche   {
+		} else if entniche {
+			fmt.Println("1231212",entniche)
 			session.Set(s.SessionKey, s.Entniche)
 			return s.Entniche
-		}else if i_member_status > 0 {
+		} else if i_member_status > 0 {
 			session.Set(s.SessionKey, s.Member)
 			return s.Member
 		}
@@ -107,7 +110,3 @@ func (s *switchService) IsVip(session *httpsession.Session, m MongodbSim) bool {
 func (s *switchService) IsFree(session *httpsession.Session, m MongodbSim) bool {
 	return s.Get(session, m) == s.Free
 }
-//所选服务是否是超级订阅
-func (s *switchService) IsEntniche(session *httpsession.Session, m MongodbSim) bool {
-	return s.Get(session, m) == s.Entniche
-}

+ 2 - 2
src/jfw/modules/publicapply/src/bidcollection/entity/entity.go

@@ -542,7 +542,7 @@ func GetInfoById(Mgo_bidding mg.MongodbSim, bidding, bidding_back string, idlist
 		}
 	}
 	//mongodb bidding
-	log.Println(1)
+	fmt.Println(1)
 	mgo_ids := []primitive.ObjectID{}
 	for _, v := range es_ids {
 		if infos[v] == nil {
@@ -561,7 +561,7 @@ func GetInfoById(Mgo_bidding mg.MongodbSim, bidding, bidding_back string, idlist
 		}
 	}
 	//mongodb bidding_back
-	log.Println(2)
+	fmt.Println(2)
 	mgo_back_ids := []primitive.ObjectID{}
 	for _, v := range mgo_ids {
 		if infos[mg.BsonIdToSId(v)] == nil {

+ 1 - 1
src/jfw/modules/publicapply/src/dataexport/service/action.go

@@ -85,7 +85,7 @@ func (des *DataExportStruct) ByPushHistory() {
 		defer util.Catch()
 		vipType := des.GetString("vt")
 		if vipType == "" { //默认取已切换的企业
-			vipType = jy.SwitchService.Get(des.Session(), db.Mgo)
+			vipType = jy.SwitchService.GetEntniche(des.Session(), db.Mgo,db.Mysql)
 		}
 		exportNum, _ := des.GetInteger("exportNum")
 		_, _, list := jy.NewSubscribePush(vipType).Datas(&jy.SubPushQueryParam{

+ 16 - 9
src/jfw/modules/publicapply/src/subscribePush/service/pushList.go

@@ -31,6 +31,8 @@ type SubscribePush struct {
 //VipSwitch 大会员、超级订阅、商机管理切换
 func (sp *SubscribePush) VipSwitch() {
 	userId, _ := sp.GetSession("userId").(string)
+	//entUserId := util.IntAll(sp.GetSession("entUserId"))
+	fmt.Println("11111111111",util.IntAll(sp.GetSession("entUserId")))
 	rData, errMsg := func() (interface{}, error) {
 		if userId == "" {
 			return nil, fmt.Errorf("未登录")
@@ -38,7 +40,9 @@ func (sp *SubscribePush) VipSwitch() {
 		switchOk := false
 		vt := sp.GetString("vt")
 		if vt == "" {
-			jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
+			vt=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
+			sp.SetSession(jy.SwitchService.SessionKey, vt)
+			fmt.Println("1231233",vt)
 		} else if vt == jy.SubVipFlag {
 			vipMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
 			if vipMsg.VipStatus <= 0 {
@@ -80,13 +84,15 @@ func (sp *SubscribePush) HasPushHistory() {
 	if userId == "" {
 		return
 	}
+
 	vipType := sp.GetString("vt")
 	if vipType == "" { //默认取已切换的企业
 		vipType = jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
 	}
+	fmt.Println("12312",vipType,userId,	util.IntAll(sp.GetSession("entUserId")))
 	if vipType==jy.SwitchService.Entniche{
 		fmt.Println(util.IntAll(sp.GetSession("entUserId")))
-		userId = util.ObjToString(sp.GetSession("entUserId"))
+		userId = fmt.Sprint(util.IntAll(sp.GetSession("entUserId")))
 	}
 	go entity.HistoryPush.UpdateUserPushUnread(userId, vipType)
 	user, _ := jy.NewSubscribePush().UserInfo(db.Mgo, userId)
@@ -202,11 +208,10 @@ func (sp *SubscribePush) HistoryPaging() {
 	}
 	vipType := sp.GetString("vt")
 	if vipType == "" { //默认取已切换的企业
-		vipType = jy.SwitchService.Get(sp.Session(), db.Mgo)
+		vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
 	}
-	log.Println("ssss", util.ObjToString(sp.GetSession("entUserId")))
 	if vipType==jy.SwitchService.Entniche{
-		userId = util.ObjToString(sp.GetSession("entUserId"))
+		userId = fmt.Sprint(util.IntAll(sp.GetSession("entUserId")))
 	}
 	pageNum, _ := sp.GetInteger("pageNum")
 	PageSize, _ := sp.GetInteger("pageSize")
@@ -235,7 +240,6 @@ func (sp *SubscribePush) HistoryPaging() {
 	} else {
 		spqp.PushMysql = db.MysqlPush
 	}
-	log.Println(3333)
 	hasNextPage, total, list := jy.NewSubscribePush(vipType).Datas(spqp)
 	//查询是否收藏
 	jy.NewSubscribePush().MakeCollection(userId, db.Mysql, list)
@@ -268,11 +272,13 @@ func (sp *SubscribePush) SetRead() error {
 	}
 	vipType := sp.GetString("vt")
 	if vipType == "" { //默认取已切换的企业
-		vipType = jy.SwitchService.Get(sp.Session(), db.Mgo)
+		vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
 	}
 	if userId := util.ObjToString(sp.GetSession("userId")); userId != "" {
 		if vipType == jy.SwitchService.Member {
 			jy.NewSubscribePush(vipType).Visit(db.MysqlMemberPush, userId, vsid)
+		} else if vipType == jy.SwitchService.Entniche {
+			jy.NewSubscribePush(vipType).Visit(db.MysqlEntnichePush, userId, vsid)
 		} else {
 			jy.NewSubscribePush(vipType).Visit(db.MysqlPush, userId, vsid)
 		}
@@ -297,7 +303,8 @@ func (sp *SubscribePush) GetPushCount() error {
 	if userId != "" {
 		vipType := sp.GetString("vt")
 		if vipType == "" { //默认取已切换的企业
-			vipType = jy.SwitchService.Get(sp.Session(), db.Mgo)
+			vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
+
 		}
 		matchway, _ := sp.GetInteger("matchway")
 		sp.ServeJson(map[string]interface{}{
@@ -315,7 +322,7 @@ func (sp *SubscribePush) GetPushAllCount() error {
 		index, _ := sp.GetInteger("index")
 		vipType := sp.GetString("vt")
 		if vipType == "" { //默认取已切换的企业
-			vipType = jy.SwitchService.Get(sp.Session(), db.Mgo)
+			vipType=jy.SwitchService.GetEntniche(sp.Session(), db.Mgo,db.Mysql)
 		}
 		sp.ServeJson(map[string]interface{}{
 			"count": entity.SubViewDatasCount(userId, vipType, sp.GetString("item"), index),

+ 6 - 1
src/web/staticres/js/pur-busniess-index-pc.js

@@ -290,7 +290,12 @@ var vm = new Vue({
     },
     // 保存设置
     saveSetting () {
-      window.localStorage.setItem('bus-key-group-SCOPE', JSON.stringify(this.subData))
+      if (this.subData.length == 0) {
+        location.href = '/jylab/purSearch/index.html'
+      } else {
+        window.localStorage.setItem('bus-key-group-SCOPE', JSON.stringify(this.subData))
+        location.href = '/jylab/purSearch/index.html'
+      }
     }
   }
 })

+ 29 - 33
src/web/staticres/js/pur-search-index-pc.js

@@ -25,7 +25,6 @@ function toastFn (text, duration = 1000) {
       },duration)
 }
 function formatKeywordsList (res) {
-    console.info(res)
     // if (!res || !res.a_items) return
     // const data = res.a_items
     const newArr = []
@@ -175,7 +174,7 @@ var vm = new Vue({
     },
     methods: {
         updatescope(data) {
-            console.log(data)
+            // console.log(data)
         },
         // 采购单位模糊搜索
         getPreSearchList: utils.debounce(function () {
@@ -404,6 +403,7 @@ var vm = new Vue({
             return tempArr
         },
         doSearch: function () {
+            $('.tags-box').hide()
             this.listState.pageNum = 1
             this.getList(1, 'search')
         },
@@ -437,7 +437,6 @@ var vm = new Vue({
                         arrs.forEach(v => {
                             arr1.push(v.Buyer)
                         })
-                        console.info(arrs)
                         if (arrs.length == 0) {
                             this.listState.list = []
                         } else {
@@ -459,6 +458,7 @@ var vm = new Vue({
             })
         },
         onPageChange: function (p) {
+            $('.tags-box').hide()
             this.listState.pageNum = p
             this.getList(p)
         },
@@ -496,26 +496,24 @@ var vm = new Vue({
                 $('.check-all').prop('checked', false)
             }
             this.selectName = arr1
-            var tempArray1 = this.arrDefault(this.selectName, this.attentionName)
-            var tempArray2 = this.arrDefault(this.selectName, this.claimcheckName)
-            console.info(tempArray1)
-            console.info(tempArray2)
-            if (tempArray1.length == 0) {
-                this.follow = true
-                if (this.selectName.length == 0) {
-                    this.follow = false
-                }
-            } else {
-                this.follow = false
-            }
-            if (tempArray2.length == 0) {
-                this.claim = true
-                if (this.selectName.length == 0) {
-                    this.claim = false
-                }
-            } else {
-                this.claim = false
-            }
+            // var tempArray1 = this.arrDefault(this.selectName, this.attentionName)
+            // var tempArray2 = this.arrDefault(this.selectName, this.claimcheckName)
+            // if (tempArray1.length == 0) {
+            //     this.follow = true
+            //     if (this.selectName.length == 0) {
+            //         this.follow = false
+            //     }
+            // } else {
+            //     this.follow = false
+            // }
+            // if (tempArray2.length == 0) {
+            //     this.claim = true
+            //     if (this.selectName.length == 0) {
+            //         this.claim = false
+            //     }
+            // } else {
+            //     this.claim = false
+            // }
         },
         // 是否关注企业
         attentionCheck(arrs, item) {
@@ -582,7 +580,6 @@ var vm = new Vue({
                     D: per ? str : item.claim1
                 }
             }
-            console.info(obj)
             $.ajax({
                 url: '/entnicheNew/customer/attention',
                 method: 'POST',
@@ -632,24 +629,23 @@ var vm = new Vue({
                 var tempArray2 = this.arrDefault(this.selectName, this.claimcheckName)
                 if (type == 0) {
                     if (tempArray1.length == 0) {// 批量取关
-                        this.follow = true
+                        // this.follow = true
                         this.attention(String(this.selectName), type, true, 'pi') 
                     } else if (tempArray1.length == this.selectName.length) {// 批量关注
-                        this.follow = false
+                        // this.follow = false
                         this.attention(String(this.selectName), type, false, 'pi')
                     } else {
-                        toastFn('关注和取消关注不能同时进行!', 2000)
+                        toastFn('关注和取消不能同时进行!', 2000)
                     }
                 } else {
-                    console.info(this.selectName)
                     if (tempArray2.length == 0) {// 批量取认领
-                        this.claim = true
+                        // this.claim = true
                         this.attention(String(this.selectName), type, true, 'pi') 
                     } else if (tempArray2.length == this.selectName.length) {// 批量认领
-                        this.claim = false
+                        // this.claim = false
                         this.attention(String(this.selectName), type, false, 'pi')
                     } else {
-                        toastFn('认领和取消认领不能同时进行!', 2000)
+                        toastFn('认领和取消不能同时进行!', 2000)
                     }
                 }
             }
@@ -900,7 +896,6 @@ var vm = new Vue({
                   D: false,
                   label: lids
                 }
-                console.log(params)
                 // 执行保存绑定标签操作
                 // if (params.label !== '') {
                   saveChooseTags(params, function () {
@@ -977,7 +972,6 @@ var vm = new Vue({
                       return item.lid != id
                     })
                     activeTags = newArr
-                    console.log(activeTags, newArr, 'quxiao')
                     inputTagList()
                   }
                 })
@@ -1009,6 +1003,8 @@ var vm = new Vue({
                 dataType: 'json',
                 success: function (r) {
                   if (r.error_code == 0 && r.data) {
+                    $('.tags-box').slideToggle()
+                    _this.getList(_this.listState.pageNum)
                     _this.$toast('认领成功!')
                     _this.$emit('updatelist', true)
                     callback && callback()

+ 1 - 1
src/web/templates/pc/purScopebusniess.html

@@ -114,7 +114,7 @@
                 </div>
                 <div>
                   <div class="reset-tips">新增的关键词设置,将在登出时还原</div>
-                  <button type="button" class="save-btn" @click="saveSetting"><a href="/jylab/purSearch/index.html">保存设置</a></button>
+                  <button type="button" class="save-btn" @click="saveSetting">保存设置</button>
                 </div>
             </div>
         </div>