Преглед изворни кода

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

# Conflicts:
#	src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html
zhangyuhan пре 3 година
родитељ
комит
8498fdc8f3

+ 1 - 0
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -650,6 +650,7 @@
       success: function(res) {
         console.log(res)
         if(res.error_code == 0) {
+          sessionStorage.setItem('setEntStatus', res.data.isNew)
           SuperSearch.isEntNicheNew = res.data.isNew
           jyUserPower.entniche = res.data.isNew || res.data.isPower
         }

+ 2 - 1
src/jfw/modules/app/src/web/templates/weixin/search/tabSearch.html

@@ -2023,6 +2023,7 @@
         }
         // tabs 切换
         $(".tabs-nav div").on('click', function () {
+            var setEntStatus = sessionStorage.getItem('setEntStatus')
             $(this).addClass('active').siblings().removeClass('active')
             var nowIndex = $(this).index()
             var tipArr = ['多个关键词用空格隔开', '企业名称', '采购单位名称']
@@ -2033,7 +2034,7 @@
                 $(".search-header-box").addClass('m-r')
                 if (nowIndex !== 1) {
                   $(".search-header-box").removeAttr("action")
-                  if(SuperSearch.isEntNicheNew) {
+                  if(SuperSearch.isEntNicheNew || setEntStatus) {
                     $(".search-header-box").next().show()
                   } else {
                     $(".search-header-box").next().hide()

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

@@ -1180,12 +1180,12 @@
               newEntNiche = res.data.isNew
               if(res.data.isNew) {
                 $('.commonUser').hide()
-                var buyerName = {{.T.obj.buyer}}
-                if (buyerName) {
-                    $('.entnicheUser').show()
+                $('.entnicheUser').show()
+                if({{.T.obj.buyer}} == '') {
+                  $('.entnicheUser .sum_right').hide()
                 }
-                getActionState(buyerName, 'g')
-                getActionState(buyerName, 'r')
+                getActionState ({{.T.obj.buyer}}, 'g')
+                getActionState ({{.T.obj.buyer}}, 'r')
               } else {
                 $('.commonUser').show()
                 $('.entnicheUser').hide()
@@ -1330,7 +1330,7 @@
           url: '/entnicheNew/follow/project/check',
           data: param,
           success: function(res) {
-            if(res.error_code == 0 && res.data&& res.data.showFollow) {
+            if(res.error_code == 0 &&res.data&& res.data.showFollow) {
               $(".follow").css("display","")
               if(res.data.flag) {
                 followFlag = true
@@ -2444,7 +2444,7 @@
           // 添加关注的项目
           let cancelurl = '/bigmember/follow/project/cancel'
           let confirmurl = '/bigmember/follow/project/add'
-          if(window.entniche && bigstatus < 0) {
+          if(newEntNiche) {
             cancelurl = '/entnicheNew/follow/project/cancel'
             confirmurl = '/entnicheNew/follow/project/add'
           }

+ 24 - 0
src/jfw/modules/publicapply/src/active/21yearEndReport.go

@@ -68,6 +68,11 @@ func (this *YearEndReport) YearEndReportApi() {
 		if userId == "" {
 			return nil, fmt.Errorf("未登录")
 		}
+		openid := qutil.ObjToString(this.Session().Get("s_m_openid"))
+		if !checkUserIsSubscribe(openid) {
+			return nil, fmt.Errorf("未关注")
+		}
+
 		if time.Now().Unix() > yearEndReportEndTimeStamp {
 			return nil, fmt.Errorf("不在活动期限内")
 		}
@@ -138,3 +143,22 @@ func getRandom(userId string, t int64) int32 {
 	}
 	return int32(i)%9 + 1
 }
+
+//checkUserIsSubscribe 检查用户是否关注
+func checkUserIsSubscribe(openid string) bool {
+	if openid == "" {
+		user, ok := db.Mgo.FindOneByField("user", map[string]interface{}{
+			"i_appid":    2,
+			"s_m_openid": openid,
+			"s_unionid":  map[string]interface{}{"$ne": openid},
+		}, `{"i_ispush":1}`)
+		if ok && user != nil {
+			if (*user)["_id"] == nil || qutil.IntAllDef((*user)["i_ispush"], 1) == 0 {
+				return false
+			} else {
+				return true
+			}
+		}
+	}
+	return false
+}