wangkaiyue 5 năm trước cách đây
mục cha
commit
a40926030e

+ 4 - 1
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -253,9 +253,12 @@ func (this *vipSubscribeStruct) GetBuySet(userId string) (*SubvipBuySet, error)
 
 
 //订阅修改校验
 //订阅修改校验
 func (this *vipSubscribeStruct) SubEditCheckArea(area *map[string]interface{}, buySet *SubvipBuySet) bool {
 func (this *vipSubscribeStruct) SubEditCheckArea(area *map[string]interface{}, buySet *SubvipBuySet) bool {
-	if buySet.AreaCount == -1 {
+	if buySet.AreaCount == -1 { //购买全国
 		return true
 		return true
 	}
 	}
+	if len(*area)==0{ //选择全国
+		return false
+	}
 	pCount := 0
 	pCount := 0
 	for k, v := range *area {
 	for k, v := range *area {
 		citys := qutil.ObjArrToStringArr(v.([]interface{}))
 		citys := qutil.ObjArrToStringArr(v.([]interface{}))

+ 1 - 1
src/jfw/modules/subscribepay/src/service/vipSubscribeEdit.go

@@ -93,7 +93,7 @@ func (this *EditSub) SaveSubEdit() {
 			if err != nil {
 			if err != nil {
 				return &editSubResult{false, errors.New("数据格式错误"), nil}
 				return &editSubResult{false, errors.New("数据格式错误"), nil}
 			}
 			}
-			if len(industryNew) > buyset.BuyerclassCount && buyset.BuyerclassCount != -1 {
+			if buyset.BuyerclassCount != -1 && (len(industryNew) == 0 || len(industryNew) > buyset.BuyerclassCount) {
 				return &editSubResult{false, errors.New("非法操作"), nil}
 				return &editSubResult{false, errors.New("非法操作"), nil}
 			}
 			}
 			if ok := util.MQFW.UpdateById("user", userId, bson.M{"$set": bson.M{"o_vipjy.a_buyerclass": industryNew}}); !ok {
 			if ok := util.MQFW.UpdateById("user", userId, bson.M{"$set": bson.M{"o_vipjy.a_buyerclass": industryNew}}); !ok {

+ 3 - 3
src/web/templates/weixin/vipsubscribe/choose_area.html

@@ -592,7 +592,7 @@
           let pHeight = $('.result_text').height()
           let pHeight = $('.result_text').height()
           let minHeight = $('.result_text').css('min-height')
           let minHeight = $('.result_text').css('min-height')
           let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
           let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
-          $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+          $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+25);
           console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
           console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
           if(rows == 1){
           if(rows == 1){
               $('.packup').hide()
               $('.packup').hide()
@@ -619,14 +619,14 @@
                 $(".result").css("padding-bottom","0.3rem")
                 $(".result").css("padding-bottom","0.3rem")
                 $(this).hide();
                 $(this).hide();
                 $('.packup').show()
                 $('.packup').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+25);
             })
             })
             $('.packup').click(function () { 
             $('.packup').click(function () { 
                 $(".result").css("padding-bottom","0.2rem")
                 $(".result").css("padding-bottom","0.2rem")
                 $('.result_text').addClass('line_two')
                 $('.result_text').addClass('line_two')
                 $(this).hide();
                 $(this).hide();
                 $('.detail').show()
                 $('.detail').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+25);
             })
             })
             $("body").on('click','.slide a',function(){
             $("body").on('click','.slide a',function(){
                 var s = $(this).html()
                 var s = $(this).html()

+ 5 - 5
src/web/templates/weixin/vipsubscribe/edit_subscribe_allArea.html

@@ -458,14 +458,14 @@
                 $(".result").css("padding-bottom","0.3rem")
                 $(".result").css("padding-bottom","0.3rem")
                 $(this).hide();
                 $(this).hide();
                 $('.packup').show()
                 $('.packup').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+25);
             })
             })
             $('.packup').click(function () { 
             $('.packup').click(function () { 
                 $(".result").css("padding-bottom","0.2rem")
                 $(".result").css("padding-bottom","0.2rem")
                 $('.result_text').addClass('line_two')
                 $('.result_text').addClass('line_two')
                 $(this).hide();
                 $(this).hide();
                 $('.detail').show()
                 $('.detail').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+25);
             })
             })
             // 锚点跳转
             // 锚点跳转
             $("body").on('click', '.slide a', function () {
             $("body").on('click', '.slide a', function () {
@@ -543,7 +543,7 @@
             $('#enter').click(function(){
             $('#enter').click(function(){
               $("#enter").attr("disabled","disabled");
               $("#enter").attr("disabled","disabled");
               //提交修改
               //提交修改
-              if(EditArea.reqData.buyset.areacount==-1&&EditArea.reqData.area["全国"]){
+              if(EditArea.reqData.area["全国"]){
                 EditArea.reqData.area={}
                 EditArea.reqData.area={}
               }
               }
               console.log("final select ",EditArea.reqData.area)
               console.log("final select ",EditArea.reqData.area)
@@ -663,7 +663,7 @@
                 }
                 }
             }
             }
             $('.result_name').append(html);
             $('.result_name').append(html);
-            $(".select-area-box .area-list").css("margin-top",$('.result').height()+20);
+            $(".select-area-box .area-list").css("margin-top",$('.result').height()+25);
             this.isOpen();
             this.isOpen();
             if(this.noChange(this.lastSelectObj,this.reqData.area)){
             if(this.noChange(this.lastSelectObj,this.reqData.area)){
               $("#enter").attr("disabled","disabled");  
               $("#enter").attr("disabled","disabled");  
@@ -681,7 +681,7 @@
             let pHeight = $('.result_text').height()
             let pHeight = $('.result_text').height()
             let minHeight = $('.result_text').css('min-height')
             let minHeight = $('.result_text').css('min-height')
             let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
             let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
-            $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+            $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+25);
             console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
             console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
             if(rows == 1){
             if(rows == 1){
                 $('.packup').hide()
                 $('.packup').hide()

+ 4 - 6
src/web/templates/weixin/vipsubscribe/edit_subscribe_city.html

@@ -418,7 +418,6 @@
             $('.count').html(num[1].length);
             $('.count').html(num[1].length);
             // 初次渲染城市选择结果
             // 初次渲染城市选择结果
             $('.result_name').html(num[1].join('、'));
             $('.result_name').html(num[1].join('、'));
-           
             // 渲染城市
             // 渲染城市
             $(".select-area-box ul li:not('.index')").each(function () {
             $(".select-area-box ul li:not('.index')").each(function () {
                 var text = $(this).find(".province").text().trim();
                 var text = $(this).find(".province").text().trim();
@@ -479,14 +478,14 @@
                 $(".result").css("padding-bottom","0.3rem")
                 $(".result").css("padding-bottom","0.3rem")
                 $(this).hide();
                 $(this).hide();
                 $('.packup').show()
                 $('.packup').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+                $('.select-area-box').css("margin-top",$(".optional_count").height()+$('.result_text').height()+25);
             })
             })
             $('.packup').click(function () { 
             $('.packup').click(function () { 
                 $(".result").css("padding-bottom","0.2rem")
                 $(".result").css("padding-bottom","0.2rem")
                 $('.result_text').addClass('line_two')
                 $('.result_text').addClass('line_two')
                 $(this).hide();
                 $(this).hide();
                 $('.detail').show()
                 $('.detail').show()
-                $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
+                $('.select-area-box').css("margin-top",$(".optional_count").height()+$('.result_text').height()+25);
             })
             })
             // 锚点跳转
             // 锚点跳转
             $("body").on('click', '.slide a', function () {
             $("body").on('click', '.slide a', function () {
@@ -613,7 +612,7 @@
             this.selectObj=selectObj;
             this.selectObj=selectObj;
             $('.count').text(cityCount)
             $('.count').text(cityCount)
             $('.result_name').append(html);
             $('.result_name').append(html);
-            $('.select-area-box').css("margin-top",$(".optional_count").height()+$(".result").height()+20);
+            $('.select-area-box').css("margin-top",$(".optional_count").height()+$(".result").height()+25);
             this.isOpen();
             this.isOpen();
             if(this.noChange(this.selectObj,EditCity.reqData.area)||!this.compareArr(Object.keys(this.selectObj),Object.keys(this.reqData.buyset.citys))){
             if(this.noChange(this.selectObj,EditCity.reqData.area)||!this.compareArr(Object.keys(this.selectObj),Object.keys(this.reqData.buyset.citys))){
               $("#enter").attr("disabled","disabled")
               $("#enter").attr("disabled","disabled")
@@ -639,8 +638,7 @@
             let pHeight = $('.result_text').height()
             let pHeight = $('.result_text').height()
             let minHeight = $('.result_text').css('min-height')
             let minHeight = $('.result_text').css('min-height')
             let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
             let rows = Math.round(Math.round(pHeight)/ parseFloat(minHeight));
-            $(".select-area-box .area-list").css("margin-top",$('.result_text').height()+20);
-            console.log("高度:"+ pHeight,"最小高度"+ minHeight,"行数:" + rows)
+            $('.select-area-box').css("margin-top",$(".optional_count").height()+$('.result_text').height()+25);
             if(rows == 1){
             if(rows == 1){
                 $('.packup').hide()
                 $('.packup').hide()
                 $('.detail').hide()
                 $('.detail').hide()