Browse Source

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

熊啸云 3 years ago
parent
commit
bb898fb07a

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

@@ -126,13 +126,13 @@ func (pi *ParamInfo) GetSubMsg() UserSubMsg {
 		o_jy, _ := (*mData)["o_jy"].(map[string]interface{})
 		if o_jy["o_area"] != nil {
 			res.Area, _ = o_jy["o_area"].(map[string]interface{})
-			res.Infotype, _ = o_jy["a_infotype"].([]interface{})
 		}
+		res.Infotype, _ = o_jy["a_infotype"].([]interface{})
 		//地区调整可用次数
 		pnum := redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, pi.UserId))
 		res.Areanum = qutil.If(pnum > 0, jy.BaseAreaNum-pnum, jy.BaseAreaNum).(int)
 		//购买省份订阅包
-		if o_jy["i_ppstatus"] != nil && qutil.IntAll(o_jy["i_ppstatus"]) > -1 {
+		if o_jy["i_ppstatus"] != nil && qutil.IntAll(o_jy["i_ppstatus"]) > 0 {
 			o_buyset_p, _ := o_jy["o_buyset_p"].(map[string]interface{})
 			res.Provincenum = qutil.IntAll(o_buyset_p["areacount"]) //-1 全国无限制
 			res.Areanum = res.Provincenum

+ 2 - 2
src/jfw/modules/publicapply/src/subscribePush/entity/setting.go

@@ -95,12 +95,12 @@ func IsCanSet(userId string) (bool, bool, int) {
 	}
 	o_jy, _ := (*mData)["o_jy"].(map[string]interface{})
 	//是否购买省份订阅包
-	if o_jy["i_ppstatus"] != nil && qutil.IntAll(o_jy["i_ppstatus"]) > -1 {
+	if o_jy["i_ppstatus"] != nil && qutil.IntAll(o_jy["i_ppstatus"]) > 0 {
 		o_buyset_p, _ := o_jy["o_buyset_p"].(map[string]interface{})
 		areacount = qutil.IntAll(o_buyset_p["areacount"]) //-1 全国无限制
 	}
 	log.Println(jy.BaseAreaNum, "---areacount:", areacount)
-	return o_jy["o_area"] == nil, o_jy["i_ppstatus"] != nil && qutil.IntAll(o_jy["i_ppstatus"]) > -1, areacount
+	return o_jy["o_area"] == nil, o_jy["i_ppstatus"] != nil && qutil.IntAll(o_jy["i_ppstatus"]) > 0, areacount
 }
 
 //

+ 1 - 3
src/jfw/modules/subscribepay/src/entity/areaPack.go

@@ -179,12 +179,10 @@ func (this *areaPackPrice) PayCallBack(param *CallBackParam) bool {
 
 //修改用户权益
 func (this *AreaPackFilter) Power(userid string, startime, endtime time.Time) bool {
-	log.Println("--->", startime)
-	log.Println("--->", endtime)
 	setMap := map[string]interface{}{
 		"o_jy.o_buyset_p":  map[string]interface{}{"areacount": this.Num},
 		"o_jy.l_areaEnd_p": endtime.Unix(),
-		"o_jy.i_ppstatus":  0,
+		"o_jy.i_ppstatus":  1,
 	}
 	if this.OrderType == 1 || this.OrderType == 2 {
 		setMap["o_jy.l_areaStart_p"] = startime.Unix()

+ 10 - 0
src/jfw/modules/subscribepay/src/pay/util.go

@@ -115,6 +115,14 @@ var (
 		"ali_app": ALI_DATAPACK_APP,
 		"ali_pc":  ALI_DATAPACK_NATIVE,
 	}
+	//省份订阅包
+	areaPackMap = map[string]string{
+		"wx_js":   WX_AREAPACK_JSAPI,
+		"wx_app":  WX_AREAPACK_APP,
+		"wx_pc":   WX_AREAPACK_NATIVE,
+		"ali_app": ALI_AREAPACK_APP,
+		"ali_pc":  ALI_AREAPACK_NATIVE,
+	}
 
 	PayWayAndSign = map[string]map[string]string{
 		"subvip":         vipMap,
@@ -127,6 +135,7 @@ var (
 		"aiForecastPack": aiForecastPackMap,
 		"bidfile":        bifileMap,
 		"integral":       integralMap,
+		"areaPack":       areaPackMap,
 		"VIP订阅":          vipMap,
 		"企业商机管理":         entnicheMap,
 		"历史数据":           dataexportMap,
@@ -139,6 +148,7 @@ var (
 		"大会员-招标文件解读":     bifileMap,
 		"剑鱼币":            integralMap,
 		"数据流量包":          dataPackMap,
+		"省份订阅包":          areaPackMap,
 	}
 	varOrderCode *orderCode
 )

+ 21 - 20
src/jfw/modules/subscribepay/src/service/areaPack.go

@@ -63,25 +63,6 @@ func (this *AreaPack) CreateOrder() {
 		lotteryId := this.GetString("lotteryId")
 		discount_price, userLotteryId := 0, ""
 		useProduct, _ := this.GetInteger("useProduct")
-		if lotteryId != "" {
-			products := config.CouponConfig.Products[filter.ProductId()]
-			if useProduct > 0 {
-				products = strconv.Itoa(useProduct)
-			}
-			full_price, reduce_price := 0, 0
-			var discount float64
-			full_price, reduce_price, discount, userLotteryId = util.GetCouponInfo(userId, lotteryId, products)
-			if discount == 100 { //满减
-				if full_price <= totalfee {
-					totalfee = totalfee - reduce_price
-					discount_price = reduce_price
-				}
-			} else { //满折
-				disCount_int := int(math.Ceil(discount * 100))
-				discount_price = totalfee - totalfee*disCount_int/1000
-				totalfee = totalfee * disCount_int / 1000
-			}
-		}
 		//赠品相关
 		discountId, _ := this.GetInteger("discountId")
 		if discountId > 0 {
@@ -90,6 +71,26 @@ func (this *AreaPack) CreateOrder() {
 			filter.GiveCycle = timeNum
 			filter.GiveType = timeType
 			filter.DisCountId = discountId
+		} else {
+			if lotteryId != "" {
+				products := config.CouponConfig.Products[filter.ProductId()]
+				if useProduct > 0 {
+					products = strconv.Itoa(useProduct)
+				}
+				full_price, reduce_price := 0, 0
+				var discount float64
+				full_price, reduce_price, discount, userLotteryId = util.GetCouponInfo(userId, lotteryId, products)
+				if discount == 100 { //满减
+					if full_price <= totalfee {
+						totalfee = totalfee - reduce_price
+						discount_price = reduce_price
+					}
+				} else { //满折
+					disCount_int := int(math.Ceil(discount * 100))
+					discount_price = totalfee - totalfee*disCount_int/1000
+					totalfee = totalfee * disCount_int / 1000
+				}
+			}
 		}
 		//
 		if totalfee <= 0 {
@@ -117,7 +118,7 @@ func (this *AreaPack) CreateOrder() {
 		if ok && rdata != nil && len(*rdata) > 0 {
 			ojy := qutil.ObjToMap((*rdata)["o_jy"])
 			area_status := qutil.IntAllDef((*ojy)["i_ppstatus"], -1)
-			if area_status == 0 && filter.OrderType == 1 { //1为非省份订阅用户可购买
+			if area_status == 1 && filter.OrderType == 1 { //1为非省份订阅用户可购买
 				return nil, fmt.Errorf("非法请求")
 			}
 			if area_status < 0 && filter.OrderType > 1 { //非省份订阅用户不可升级续费

+ 3 - 3
src/web/staticres/common-module/order-list/js/order-detail.js

@@ -448,8 +448,8 @@ var vm = new Vue({
     getAreaPackInfo: function (order) {
       var filterInfo = JSON.parse(order.filter)
 
-      function formatAreaText (value) {
-        return value === -1  ? '全国' : (value + '个省')
+      function formatAreaText (value, old) {
+        return value === -1  ? '全国' : ((old ? (value - old) : value)  + '个省')
       }
 
       function formatTimeText (type) {
@@ -479,7 +479,7 @@ var vm = new Vue({
       var prodType = {
         label: tempMap[filterInfo.ordertype].before + '区域',
         split: ':',
-        text:  formatAreaText(filterInfo.OldNum ? (filterInfo.num - filterInfo.OldNum) : filterInfo.num)
+        text:  formatAreaText(filterInfo.num, filterInfo.OldNum)
       }
       var buyCount = {
         label: '订阅周期',

+ 3 - 3
src/web/staticres/common-module/order-list/js/order-list.js

@@ -2036,8 +2036,8 @@ var vm = new Vue({
     getAreaPackInfo: function (order) {
       var filterInfo = JSON.parse(order.filter)
 
-      function formatAreaText (value) {
-        return value === -1  ? '全国' : (value + '个省')
+      function formatAreaText (value, old) {
+        return value === -1  ? '全国' : ((old ? (value - old) : value)  + '个省')
       }
 
       function formatTimeText (type) {
@@ -2067,7 +2067,7 @@ var vm = new Vue({
       var prodType = {
         label: tempMap[filterInfo.ordertype].before + '区域',
         split: ':',
-        text: formatAreaText(filterInfo.OldNum ? (filterInfo.num - filterInfo.OldNum) : filterInfo.num)
+        text: formatAreaText(filterInfo.num, filterInfo.OldNum)
       }
       var buyCount = {
         label: '订阅周期',

+ 12 - 13
src/web/staticres/js/superSearch.js

@@ -247,7 +247,7 @@ function getNewBids(pnum){
       // 隐藏页码
       searchInnerVue.showPage = false
     }
-    getBidIsColl()
+    // getBidIsColl()
 	})
 }
 
@@ -307,14 +307,13 @@ function getNewBiddings(){
       // 隐藏页码
       searchInnerVue.showPage = false
     }
-    getBidIsColl()
 	})
 }
 //
 
 function appendDatas(datas,flag,isNew,onlyUpdateTable){
   // flag // 是否有输入
-  console.log('selectType: ' + selectType,',flag: ',flag)
+  // console.log('selectType: ' + selectType,',flag: ',flag)
 	var listHtml = '';
 	var tableHtml = '';
 	$(".working").hide();
@@ -560,7 +559,9 @@ function appendDatas(datas,flag,isNew,onlyUpdateTable){
 	}
 	$(".tabContainer").css("min-height","");
 	submitflag=true;
-	// backTopAdjust();
+  // backTopAdjust();
+  // 生成dom之后再查标讯有无收藏
+  getBidIsColl()
 }
 
 function getacount(bidamount,budget){
@@ -747,7 +748,6 @@ function getVIPData(clickpaging){
         searchInnerVue.showPage = false
 			}
       tabflag = true;
-      getBidIsColl()
 		}
 	})
 	return tabflag
@@ -983,7 +983,7 @@ function searchOnsubmit(clickpaging){
       LimitClass.limitFlag = false;
       pcAjaxReqCallBack(r);
     }
-    getBidIsColl()
+    // getBidIsColl()
 	});
 }
 function showSearchTipForTimeRange (type) {
@@ -1108,7 +1108,9 @@ function getBidIsColl () {
   var bids = ""
   var dataId = ""
   // 区分标题搜索和全文搜索收藏
-  var $dom = selectType.indexOf('content') == -1 ? $('.title-text-checkbox[name="bid-list"]') : $('.all-text-checkbox[name="bid-list"]')
+  var allSearch = selectType.indexOf('content') > -1 && $("#zbSeatchT [name='keywords']").val() !==""
+  console.log('当前是否显示的是全文',allSearch)
+  var $dom = allSearch ? $('.all-text-checkbox[name="bid-list"]') : $('.title-text-checkbox[name="bid-list"]')
   $dom.each(function() {
     if ($(this).attr('dataid')) {
       dataId = $(this).attr("dataid");
@@ -1145,7 +1147,7 @@ function getBidIsColl () {
 function collectClick() {
   // console.log(vipState, '是否是超级订阅用户')
   // 单个收藏点击事件
-  $('.icon-collect').on('click',function(e) {
+  $('.icon-collect').unbind('click').on('click',function(e) {
     // 登录判断
     if (!loginflag) {
       openLoginDig()
@@ -1258,7 +1260,7 @@ function collectClick() {
           }
         }
         // 如果没有不同的值 即为选中的标讯都已收藏过 有不同的值即为有未收藏的标讯
-        console.log(notSameArr, 'notSameArr')
+        // console.log(notSameArr, 'notSameArr')
         if(notSameArr.length == 0) {
           toastFn('已收藏', 800)
           return
@@ -1323,7 +1325,7 @@ function  updateVipDialog(str) {
 }
 // 列表页收藏点击事件 百度统计
 function baiduEvent(name) {
-  console.log(name, 'name')
+  // console.log(name, 'name')
   try {
     _hmt.push(['_trackEvent', '超级订阅-pc', 'click', name]);
   } catch (e) {
@@ -1357,14 +1359,11 @@ function isPower () {
         var member = r.data.member
         var vip = r.data.vip
         if (entniche || member || vip > 0) {
-          console.log('true')
           return 'true'
         } else {
-          console.log('false')
           return 'false'
         }
       } else {
-        console.log('false')
         return 'false'
       }
     }

+ 3 - 3
src/web/templates/areaPack/pc/page_order.html

@@ -222,8 +222,8 @@
                     }
                     // 展示字段
 
-                    function formatAreaText (value) {
-                        return value === -1  ? '全国' : (value + '个省')
+                    function formatAreaText (value, old) {
+                        return value === -1  ? '全国' : ((old ? (value - old) : value)  + '个省')
                     }
                     function formatAreaTextBefore (type) {
                         var typeMap = {
@@ -251,7 +251,7 @@
                     }
 
                     $('.filter_data .replace_text[name="type"]').text(formatAreaTextBefore(filterObj.ordertype))
-                    $('.filter_data .replace_text[name="area"]').text(formatAreaText(filterObj.OldNum ? (filterObj.num - filterObj.OldNum) : filterObj.num))
+                    $('.filter_data .replace_text[name="area"]').text(formatAreaText(filterObj.num, filterObj.OldNum))
                     $('.filter_data .replace_text[name="cycle"]').text(filterObj.ordertype === 2 ? '不延期' : formatCycleText(filterObj.cycleunit))
                     $('.filter_data .replace_text[name="time"]').text(formatTimeText(r.data.order.vip_endtime) + '到期')
 

+ 2 - 2
src/web/templates/common/pcbottom.html

@@ -188,7 +188,7 @@ if (location.href.indexOf('jyblog') === -1) {
                 return -1;//不是ie浏览器
             }
         }
-        console.info(IEVersion());
+        // console.info(IEVersion());
         IEVersion();
         if (IEVersion() != '-1' && IEVersion() != 'edge') {
             var IEtips = document.getElementById('tips');
@@ -794,7 +794,7 @@ if (location.href.indexOf('jyblog') === -1) {
             manual: false
         })
         zc("offline_message_count",function(res){
-            console.log(res, 'offline_message_count')
+            // console.log(res, 'offline_message_count')
             if (res && res.size && res.size > 0) {
                 var omc = res.size > 99 ? '99+' : res.size
                 $(".icon-badge-number").attr('data-badge-number', omc)

+ 3 - 3
src/web/templates/pc/myOrder.html

@@ -281,7 +281,7 @@
                                     <p>有效时间:@#item.vip_starttime#@</p>
                                 </div>
                                 <div class="fl shop_main" v-if="item.product_type === '省份订阅包'">
-                                    <p><span v-if="item.order_status !== -2">@#item.filter.ordertype|formatAreaTextBefore#@</span>区域:@#(item.filter.OldNum ? (item.filter.num - item.filter.OldNum) : item.filter.num)|formatAreaText#@</p>
+                                    <p><span v-if="item.order_status !== -2">@#item.filter.ordertype|formatAreaTextBefore#@</span>区域:@#item.filter.num|formatAreaText(item.filter.OldNum)#@</p>
                                     <p>
                                         订阅周期:<span v-if="item.filter.ordertype !== 2">@#item.filter.cycleunit|formatCycleText#@</span><span v-else>不延期</span>
                                         <!--赠送30天-->
@@ -671,8 +671,8 @@
         FormatDateFn (value) {
           return new Date(value * 1000).Format('yyyy/MM/dd')
         },
-        formatAreaText (value) {
-            return value === -1  ? '全国' : (value + '个省')
+        formatAreaText (value, old) {
+            return value === -1  ? '全国' : ((old ? (value - old) : value)  + '个省')
         },
         formatAreaTextBefore (type) {
           var typeMap = {

+ 12 - 14
src/web/templates/pc/supsearch.html

@@ -305,7 +305,7 @@ function getDefaultRangeForLocal () {
 	}
 	if (!tempList.length) {
 		if (changeDefaultForSearchRange('get', 'Title') == 'false' || changeDefaultForSearchRange('get', 'Content') == 'false') {
-			console.log('存在未勾选')
+			// console.log('存在未勾选')
 		} else {
 			tempList = ['title', 'content']
 		}
@@ -328,7 +328,7 @@ formarForSelectType()
 if (beforeOfSelectType != selectType) {
 	$(function () {
 		$("#zbSeatchT [name='selectType']").val(selectType);
-		console.log(selectType, '当前', beforeOfSelectType, searchvalue, $("#zbSeatchT [name='keywords']").val())
+		// console.log(selectType, '当前', beforeOfSelectType, searchvalue, $("#zbSeatchT [name='keywords']").val())
 		if (searchvalue != '' || $("#zbSeatchT [name='keywords']").val() != '') {
 			searchOnsubmit()
 		}
@@ -355,7 +355,7 @@ if(secondList.length>0){
 var dataId = "";
 $(function(){
 
-	console.log("是否有会员筛选权限 showVipScreen", {{.T.showVipScreen}})
+	// console.log("是否有会员筛选权限 showVipScreen", {{.T.showVipScreen}})
 
 	var oInput=document.getElementById("searchinput");
 	moveEnd(oInput)
@@ -381,7 +381,7 @@ $(function(){
   //  回显搜索范围
   if(selectType) {
     var space = selectType.split(',')
-    console.log(space, '回显的搜索范围',vipState)
+    // console.log(space, '回显的搜索范围',vipState)
     space.forEach(function(item){
     	if (item) {
 			$('.searchSpace .search-list .search-list-checkbox[data-name=' + item + ']').addClass('checkbox-checked')
@@ -759,7 +759,7 @@ $.ajax({
               async: true
           });
           var frames = document.getElementById("iframeu6603895_0");
-          console.log(frames, 'frames')
+          // console.log(frames, 'frames')
 
           IframeOnClick.track(frames, function() {
                   jQuery(document).click();
@@ -780,7 +780,7 @@ function getAjaxAdv () {
       position: '搜索列表页'
     },
     success: function(res) {
-      console.log(res)
+      // console.log(res)
     }
   })
 }
@@ -815,7 +815,7 @@ var IframeOnClick = {
                             position: '搜索列表页'
                           },
                           success: function(res) {
-                              console.log(res)
+                              // console.log(res)
                           }
                       })
                   }
@@ -1667,8 +1667,8 @@ $(function(){
       var listLen = $('.buyclass-content .buy-list:not(.buy-list-parent)').length;
       var curListLen = $(this).parent('.clearfix').find('.buy-list:not(.buy-list-parent)').length;
       var curActiveLen = $(this).parent('.clearfix').find(".active").length;
-      console.log(curListLen,curActiveLen)
-      console.log(listLen, activeLen)
+      // console.log(curListLen,curActiveLen)
+      // console.log(listLen, activeLen)
       if (activeLen === listLen || activeLen === 0) {
         $('.buyclass-content .buy-list').removeClass('active')
         $('.buyclass-all').addClass('active')
@@ -1689,7 +1689,7 @@ $(function(){
       }
       var activeLen = $('.buyclass-content .buy-list-parent').filter(".active").length;
       var listLen = $('.buyclass-content .buy-list-parent').length;
-      console.log(activeLen,listLen)
+      // console.log(activeLen,listLen)
       if (activeLen === listLen || activeLen === 0) {
         $('.buyclass-content .buy-list').removeClass('active')
         $('.buyclass-all').addClass('active')
@@ -1830,8 +1830,6 @@ $(function(){
       $('.tag-placeholder').show()
     })
   })
-  // 查询标讯是否收藏
-  getBidIsColl()
   // 搜索范围点击事件
   $('.search-content .search-list .search-list-checkbox').on('click',function(){
     var hasVipIcon = $(this).siblings().hasClass('icon-vip'); // 有无点击付费的搜索范围
@@ -1937,7 +1935,7 @@ function renderTagsList (data) {
           return item.lid != id
         })
         activeTags = newArr
-        console.log(activeTags,newArr, 'quxiao')
+        // console.log(activeTags,newArr, 'quxiao')
         inputTagList ()
       }
 
@@ -2147,7 +2145,7 @@ document.querySelector(".searchControl").oncopy = function(){
         // console.log(newVal, '分页')
       },
       'listState.total' (newVal) {
-        console.log(newVal, '总页码')
+        // console.log(newVal, '总页码')
       }
     },
     mounted () {