wangkaiyue 5 жил өмнө
parent
commit
11d3b4cbc1

+ 106 - 54
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -17,6 +17,38 @@ import (
 type vipSubscribeStruct struct{}
 
 var JyVipSubStruct vipSubscribeStruct
+var SubVipPrice subVipPrice
+
+func init() {
+	qutil.ReadConfig("./subvip_price.json", &SubVipPrice)
+}
+
+//价格表
+type subVipPrice struct {
+	Month struct {
+		OneCity_oneBuyerClass     int `json:"oneCity_oneBuyerClass"`     //一个城市一个行业
+		OneCity_allBuyerClass     int `json:"oneCity_allBuyerClass"`     //一个城市全部行业
+		OneProvince_oneBuyerClass int `json:"oneProvince_oneBuyerClass"` //一个省份一个行业
+		OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
+		AllProvince_oneBuyerClass int `json:"allProvince_oneBuyerClass"` //全国一个行业
+		AllProvince_allBuyerClass int `json:"allProvince_allBuyerClass"` //全国全行业
+	} `json:"month"`
+	Year struct {
+		OneCity_oneBuyerClass     int `json:"oneCity_oneBuyerClass"`     //一个城市一个行业
+		OneCity_allBuyerClass     int `json:"oneCity_allBuyerClass"`     //一个城市全部行业
+		OneProvince_oneBuyerClass int `json:"oneProvince_oneBuyerClass"` //一个省份一个行业
+		OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
+		AllProvince_oneBuyerClass int `json:"allProvince_oneBuyerClass"` //全国一个行业
+		AllProvince_allBuyerClass int `json:"allProvince_allBuyerClass"` //全国全行业
+	} `json:"year"`
+	CityPrice          int `json:"cityPrice"`          //单个城市价格
+	ProvincePrice      int `json:"provincePrice"`      //单个省份价格
+	BuyerClassPrice    int `json:"buyerClassPrice"`    //单个行业价格
+	CityMaxCount       int `json:"cityMaxCount"`       //单个省份城市可计价最大数量
+	ProvinceMaxCount   int `json:"provinceMaxCount"`   //所有地区中省份可计价最大数量
+	BuyerClassMaxCount int `json:"buyerClassMaxCount"` //行业价格可计价最大数量
+	MonthMaxCount      int `json:"monthMaxCount"`      //月份可计价最大数量
+}
 
 //订单简单信息
 type VipSimpleMsg struct {
@@ -313,99 +345,119 @@ func (this *vipSubscribeStruct) SaveSelectLog(userId, openId string, msg *VipSim
 
 //计算价格
 func (this *vipSubscribeStruct) GetSubVipPrice(area *map[string]interface{}, industry []string, count, unit int) int {
-	if len(*area) == 0 { //全国
-		if len(industry) == 1 {
+	//当行业数量大于最大值SubVipPrice.BuyerClassMaxCount 按照全行业计算
+	industryNum := len(industry)
+	if industryNum > SubVipPrice.BuyerClassMaxCount {
+		industryNum = 0
+	}
+	//计算地区数量
+	pCount := -1                     //省份数量
+	cityCountMap := map[string]int{} //购买省份中城市数量
+
+	if len(*area) != 0 {
+		pCount = 0
+		for k, v := range *area {
+			tmp := v.([]interface{})
+			if len(tmp) == 0 { //省份
+				pCount++
+			} else { //城市
+				//当城市数量大于最大值时,按照全省计算
+				if len(tmp) > SubVipPrice.CityMaxCount {
+					pCount++
+				} else {
+					cityCountMap[k] = len(tmp)
+				}
+			}
+		}
+	}
+
+	//当省份数量大于SubVipPrice.ProvinceMaxCount 按照全国计算
+	if pCount > SubVipPrice.ProvinceMaxCount {
+		pCount = -1
+	}
+
+	//当选择月份大于  按照全年计算
+	if count > SubVipPrice.MonthMaxCount && unit == 2 { //月份十个月以上价格一样
+		count = 10
+	}
+
+	if pCount == -1 { //计算全国套餐价格
+		if industryNum == 1 {
 			return getSetMealPrice(0, 1, unit) * count //全国1行业套餐
-		} else if len(industry) == 0 {
+		} else if industryNum == 0 {
 			return getSetMealPrice(0, 0, unit) * count //全国全行业套餐
 		} else {
-			return getSetMealPrice(0, len(industry), unit) * count //全国多行业套餐
+			return getSetMealPrice(0, industryNum, unit) * count //全国多行业套餐
 		}
 	}
-	final_price := 0 //最终价格
-	for _, tmp := range *area {
+
+	//计算非全国套餐
+	finalPrice := pCount * getSetMealPrice(1, industryNum, unit) * count //省份价格
+	for _, cityCount := range cityCountMap {
 		thisPrice := 0
-		citys := qutil.ObjArrToStringArr(tmp.([]interface{}))
-		if len(citys) > 0 { //市
-			if len(citys) == 1 { //单城市
-				thisPrice = getSetMealPrice(2, len(industry), unit) * count
-			} else { //多城市
-				if len(industry) == 0 || len(industry) == 1 { //多城市 单行业
-					thisPrice = len(citys) * getSetMealPrice(2, len(industry), unit) * count
-				} else { //多行业 多行业
-					if count > 10 && unit == 2 { //月份十个月以上价格一样
-						count = 10
-					}
-					industry_Price := 580 * len(industry)
-					if 580*len(industry) > 1800 {
-						industry_Price = 1800
-					}
-					city_Price := len(citys) * 580
-					if len(citys)*580 > 1180 {
-						city_Price = 1180
-					}
-					thisPrice = (industry_Price + city_Price) * count
-					if unit == 1 { //年的价格是月的价格10倍
-						thisPrice *= 10
-					}
+		if cityCount == 1 { //单城市
+			thisPrice = getSetMealPrice(2, industryNum, unit) * count
+		} else { //多城市
+			if industryNum == 0 || industryNum == 1 { //多城市 单行业
+				thisPrice = cityCount * getSetMealPrice(2, industryNum, unit) * count
+			} else { //多行业 多行业
+				industryPrice := SubVipPrice.BuyerClassPrice * industryNum
+				cityPrice := SubVipPrice.CityPrice * cityCount
+				thisPrice = (industryPrice + cityPrice) * count
+				if unit == 1 { //年
+					thisPrice *= 10
 				}
 			}
-		} else { //省
-			thisPrice = getSetMealPrice(1, len(industry), unit) * count
 		}
-		final_price += thisPrice
+		finalPrice += thisPrice
 	}
-	return final_price
+	return finalPrice
 }
 
 /*
 vip订阅 套餐价格
 c(city) 全国:0 省:1 市:2
-i(industry) 全行业:0 行业:1 其他:多个行业
+iCount(industry) 全行业:0 行业:1 其他:多个行业
 u(unit) 年:1 月:2
 */
-func getSetMealPrice(c, i, u int) int {
+func getSetMealPrice(c, iCount, u int) int {
 	t := u == 2 //是否是月单位
-	icount := 1 //行业个数
-	if i > 1 {
-		icount = i
-	}
 	switch c {
 	case 0:
-		if i == 0 {
+		if iCount == 0 {
 			if t {
-				return 38800 //1月全国全行业
+				return SubVipPrice.Month.AllProvince_allBuyerClass // 38800 //1月全国全行业
 			}
-			return 388000 //1年全国全行业
+			return SubVipPrice.Year.AllProvince_allBuyerClass // 388000 //1年全国全行业
 		} else {
 			if t {
-				return 11800 * icount //1月全国icount个行业
+				return SubVipPrice.Month.AllProvince_oneBuyerClass * iCount // 11800 * iCount //1月全国icount个行业
 			}
-			return 118000 * icount //1年全国icount个行业
+			return SubVipPrice.Year.AllProvince_oneBuyerClass * iCount //118000 * iCount //1年全国icount个行业
 		}
 	case 1:
-		if i == 0 {
+		if iCount == 0 {
 			if t {
-				return 3800 //1月1省全行业
+				return SubVipPrice.Month.OneProvince_allBuyerClass //3800 //1月1省全行业
 			}
-			return 38000 //1年1省全行业
+			return SubVipPrice.Year.OneProvince_allBuyerClass //38000 //1年1省全行业
 		} else {
 			if t {
-				return 1180 * icount //1月1省icount个行业
+				return SubVipPrice.Month.OneProvince_oneBuyerClass * iCount //1180 * iCount //1月1省icount个行业
 			}
-			return 11800 * icount //1年1省icount个行业
+			return SubVipPrice.Year.OneProvince_oneBuyerClass * iCount //1年1省icount个行业
 		}
 	default:
-		if i == 0 {
+		if iCount == 0 {
 			if t {
-				return 1800 //1月1市全行业
+				return SubVipPrice.Month.OneCity_allBuyerClass //1800 //1月1市全行业
 			}
-			return 18000 //1年1市全行业
+			return SubVipPrice.Year.OneCity_allBuyerClass //1年1市全行业
 		} else {
 			if t {
-				return 580 * icount //1月1市icount个行业
+				return SubVipPrice.Month.OneCity_oneBuyerClass * iCount // 580 * iCount //1月1市icount个行业
 			}
-			return 5800 * icount //1年1市icount个行业
+			return SubVipPrice.Year.OneCity_oneBuyerClass * iCount //5800 * iCount //1年1市icount个行业
 		}
 	}
 }

+ 9 - 2
src/jfw/modules/subscribepay/src/service/vipSubscribePay.go

@@ -20,6 +20,7 @@ import (
 //vip订阅付费
 type SubVipPayOrder struct {
 	*xweb.Action
+	getPrice    xweb.Mapper `xweb:"/vipsubscribe/getPrice"`    //获取价格
 	createOrder xweb.Mapper `xweb:"/vipsubscribe/createOrder"` //创建订单并支付
 	orderToPay  xweb.Mapper `xweb:"/vipsubscribe/orderToPay"`  //支付已创建订单
 }
@@ -28,6 +29,11 @@ func init() {
 	xweb.AddAction(&SubVipPayOrder{})
 }
 
+//支付价格
+func (this *SubVipPayOrder) GetPrice() {
+	this.ServeJson(entity.SubVipPrice)
+}
+
 //新订单 或 即将到期续费
 func (this *SubVipPayOrder) CreateOrder() {
 	area := qutil.ObjToMap(this.GetString("area"))
@@ -68,8 +74,9 @@ func (this *SubVipPayOrder) CreateOrder() {
 			return &entity.FuncResult{false, errors.New("创建订单出错"), nil}
 		}
 		//计算价格
-		//totalfee := entity.GetSubVipPrice(area, industry, date_count, date_unit)
-		totalfee := 1
+		totalfee := entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, date_unit)
+		log.Println("totalfee",totalfee)
+		//totalfee := 1
 		//创建订单
 		tradeno, prepayid, payStr := "", "", ""
 		if payWay == "wx_js" { //微信js支付

+ 25 - 0
src/jfw/modules/subscribepay/src/subvip_price.json

@@ -0,0 +1,25 @@
+{
+  "month": {
+    "oneCity_oneBuyerClass": 580,
+    "oneCity_allBuyerClass": 1800,
+    "oneProvince_oneBuyerClass": 1180,
+    "oneProvince_allBuyerClass": 3800,
+    "allProvince_oneBuyerClass": 11800,
+    "allProvince_allBuyerClass": 38800
+  },
+  "year": {
+    "oneCity_oneBuyerClass": 5800,
+    "oneCity_allBuyerClass": 18000,
+    "oneProvince_oneBuyerClass": 11800,
+    "oneProvince_allBuyerClass": 38000,
+    "allProvince_oneBuyerClass": 118000,
+    "allProvince_allBuyerClass": 388000
+  },
+  "cityPrice": 580,
+  "provincePrice": 1180,
+  "buyerClassPrice": 580,
+  "cityMaxCount": 2,
+  "provinceMaxCount": 9,
+  "buyerClassMaxCount": 3,
+  "monthMaxCount": 9
+}

+ 1 - 0
src/web/staticres/vipsubscribe/css/choose_area.css

@@ -405,6 +405,7 @@
   position: fixed;
   top: 0;
   width: 100%;
+  z-index:999;
 }
 
 #choose_area .optional_count em {

+ 88 - 46
src/web/staticres/vipsubscribe/js/common.js

@@ -54,77 +54,119 @@ function getAreaClassArr(area){
 	area:地区 {}
 	industry:行业 []
 	time[count,unit] count:时间长度 unit 1:年 2:月
+	price 价格表
    return 价格(单位:分)
 */
-function getsubVipOrderPrice(area,industry,t){
-	if(industry[0] == "全部行业"){
-		industry= []
+var priceData
+function getsubVipOrderPrice(area,industry,t,price){
+	if(!price){
+		if(priceData){
+			price=priceData
+		}else{
+			$DoPost("/subscribepay/vipsubscribe/getPrice",{},function(r){
+	          if(r){
+	            price=r;
+	            priceData=price;
+	          }else{
+	        	weui.toast("加载价格异常",{
+		          duration: 2000,
+		          className: 'custom-toast',
+		        });
+	          }
+	        },false)
+		}
+	}	
+	if(industry[0] == "全部行业")industry= []
+	if(area["全国"]) area={}
+	//当行业数量大于最大值price.BuyerClassMaxCount 按照全行业计算
+	var industryNum = industry.length
+	if (industryNum > price.buyerClassMaxCount) {
+		industryNum = 0
 	}
-	if(area["全国"]){
-		if(industry.length==1) return getSetMealPrice(0,1,t[1])*t[0]/100 //全国1行业套餐
-		if(industry.length==0) return getSetMealPrice(0,0,t[1])*t[0]/100 //全国全行业套餐
-		return	getSetMealPrice(0,industry.length,t[1]) * t[0] / 100 //全国多行业套餐
+	//计算地区数量
+	var pCount = -1         //省份数量
+	var citysCountMap = {} //购买省份中城市数量
+	
+	if(!$.isEmptyObject(area)){
+		pCount=0
+		for(var i in area) {
+			let citys=area[i]
+			if(citys.length==0){
+				pCount++
+			}else{
+				if(citys.length > price.cityMaxCount){
+					pCount++
+				}else{
+					citysCountMap[i]= citys.length 
+				}
+			}
+	    }
+	}
+	
+	//当省份数量大于price.ProvinceMaxCount 按照全国计算
+	if (pCount > price.provinceMaxCount) {
+		pCount = -1
+	}
+	
+	if(t[0]>price.monthMaxCount&&t[1]==2) t[0]=10 //月份十个月以上价格一样
+	
+	if(pCount == -1){//计算全国套餐价格
+		if(industryNum==1) return getSetMealPrice(0,1,t[1],price)*t[0]/100 //全国1行业套餐
+		if(industryNum==0) return getSetMealPrice(0,0,t[1],price)*t[0]/100 //全国全行业套餐
+		return	getSetMealPrice(0,industryNum,t[1],price) * t[0] / 100 //全国多行业套餐
 	}
-	var final_price	= 0//最终价格
-	for(var i in area) {
+	
+	var final_price	= pCount*getSetMealPrice(1,industryNum,t[1],price)*t[0];//计算省份价格
+	
+	for(var i in citysCountMap) {
 		var thisPrice = 0;	
 		var citys = area[i]
-		if(citys.length>0){//市
-			if(citys.length==1){//单城市
-				thisPrice = getSetMealPrice(2,industry.length,t[1])*t[0];
-			}else{//多城市
-				if(industry.length==0||industry.length==1){//多城市 单行业
-					thisPrice = citys.length * getSetMealPrice(2,industry.length,t[1]) * t[0];	
-				}else{//多城市 多行业
-					if(t[0]>10&&t[1]==2) t[0]=10 //月份十个月以上价格一样
-					var industry_Price= 580 * industry.length > 1800 ? 1800 : 580 * industry.length;
-					var city_Price = citys.length * 580 > 1180 ? 1180 : citys.length * 580;
-					thisPrice = (industry_Price + city_Price) * t[0];
-					if(t[1]==1) thisPrice *= 10 //年的价格是月价格的10倍
-				}
+		if(citysCountMap[i]==1){//单城市
+			thisPrice = getSetMealPrice(2,industryNum,t[1],price)*t[0];
+		}else{//多城市
+			if(industryNum==0||industryNum==1){//多城市 单行业
+				thisPrice = citysCountMap[i] * getSetMealPrice(2,industryNum,t[1],price) * t[0];	
+			}else{//多城市 多行业
+				var industry_Price= price.buyerClassPrice  * industryNum;
+				var city_Price = price.cityPrice *citysCountMap[i];
+				thisPrice = (industry_Price + city_Price) * t[0];
+				if(t[1]==1) thisPrice *= 10 //年的价格是月价格的10倍
 			}
-		}else{//省
-			thisPrice = getSetMealPrice(1,industry.length,t[1])*t[0];
 		}
-		//console.log("thisPrice",i,thisPrice)
     	final_price += thisPrice;
     }
     return final_price/100
 }
 //获取套餐价格
 //c(city) 全国:0 省:1 市:2 
-//i(industry) 全行业:0 行业:1 其他:多个行业
+//iCount(industry) 全行业:0 行业:1 其他:多个行业
 //u(unit) 年:1 月:2
-function getSetMealPrice(c,i,u){
+function getSetMealPrice(c,iCount,u,price){
 	var t = u==2 //是否是月单位
-	var icount=1   //行业个数
-	if(i>1){
-		icount=i;
-	}
 	switch(c){
 	case 0:
-		if(i==0){
-			if(t)return 38800 //1月全国全行业
-			return 388000	//1年全国全行业
+		if(iCount==0){
+			if(t)return price.month.allProvince_allBuyerClass  //1月全国全行业
+			return price.year.allProvince_allBuyerClass //1年全国全行业
 		}else{
-			if(t)return 11800 * icount //1月全国icount个行业
-			return 118000 * icount	//1年全国icount个行业
+			if(t)return price.month.allProvince_oneBuyerClass * iCount //1月全国icount个行业
+			return price.year.allProvince_oneBuyerClass * iCount	//1年全国icount个行业
 		}
 	case 1:
-		if(i==0){
-			if(t)return 3800 //1月1省全行业
-			return 38000	//1年1省全行业
+		if(iCount==0){
+			if(t)return price.month.oneProvince_allBuyerClass  //1月1省全行业
+			return price.year.oneProvince_allBuyerClass	//1年1省全行业
 		}else{
-			if(t)return 1180 * icount //1月1省icount个行业
-			return 11800 * icount	//1年1省icount个行业
+			if(t)return price.month.oneProvince_oneBuyerClass * iCount //1月1省icount个行业
+			return price.year.oneProvince_oneBuyerClass * iCount	//1年1省icount个行业
 		}
 	default:
-		if(i==0){
-			if(t)return 1800 //1月1市全行业
-			return 18000	//1年1市全行业
+		if(iCount==0){
+			if(t)return price.month.oneCity_allBuyerClass  //1月1市全行业
+			return price.year.oneCity_allBuyerClass	//1年1市全行业
 		}else{
-			if(t)return 580 * icount //1月1市icount个行业
-			return 5800 * icount	//1年1市icount个行业
+			if(t)return price.month.oneCity_oneBuyerClass * iCount //1月1市icount个行业
+			return price.year.oneCity_oneBuyerClass * iCount	//1年1市icount个行业
 		}
 	}
 }

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

@@ -12,7 +12,7 @@
     <link rel="stylesheet" type="text/css" href="/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" type="text/css" href="/vipsubscribe/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
     <link rel="stylesheet" href="/vipsubscribe/css/public.css?v={{Msg "seo" "version"}}">
-    <link rel="stylesheet" href="/vipsubscribe/css/choose_area.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" href="/vipsubscribe/css/choose_area.css?v=1{{Msg "seo" "version"}}">
 </head>
 
 <body>
@@ -565,7 +565,7 @@
             if(selectProvince>9){
               $('.tips_btn .tips_d_text').text("已选择"+selectProvince+"个省,建议购买“全国”更划算哦~").slideDown()
             }else{
-              if (selectCityMax > 3) {
+              if (selectCityMax > 2) {
                 $('.tips_btn .tips_d_text').text("已选择"+selectCityMax+"个市,建议购买“全省”更划算哦~").slideDown();
               }else{
                 $(".tips_d_text").slideUp();

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

@@ -330,7 +330,7 @@
             function flushPrice(){
               if(!vipSubisTrial){
                 var price=getsubVipOrderPrice(selectedAreaObj,selectedIndustryArr,timeSelect);
-                $('.tips_d_money').css("display","bolck").text('¥'+price);
+                $('.tips_d_money').css("display","block").text('¥'+price);
               }
             }
             
@@ -367,7 +367,7 @@
                        
             var selectedIndustryArr =["一个行业"] //已选择行业
             var selectedAreaObj = {"一个省":["一个市"]} //计算价格临时变量
-            var timeSelect = [1,2]//计算价格临时变量 timeSelect[0]时长  timeSelect[1] 1:年 2:月
+            var timeSelect = [2,1]//计算价格临时变量 timeSelect[0]时长  timeSelect[1] 1:年 2:月
             var vipSubisTrial = false;
             $(function(){
               try{
@@ -378,7 +378,7 @@
                   selectedAreaObj=JSON.parse(sessionStorage.getItem("vipSubSelectArea"));
                 }
                 if(sessionStorage.getItem("vipSubSelectTime")){
-                  this.timeSelect=JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
+                  timeSelect=JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
                 }
                 //是否试用界面
                 if(sessionStorage.getItem("vipSubisTrial")) vipSubisTrial=true;

+ 1 - 1
src/web/templates/weixin/vipsubscribe/edit_subscribe_industry.html

@@ -282,7 +282,7 @@
                 if(this.reqData.buyset.buyerclasscount!=-1){ //非全部行业 展示数量
                   $('.total').html(this.reqData.buyset.buyerclasscount);
                   $('.count').html(this.reqData.industry.length);
-                  $('.optional_count').css({"width":"100%","position":"fixed","top":0});
+                  $('.optional_count').css({"width":"100%","position":"fixed","top":0,"z-index":9999});
                   $('.result').css({"top":$('.optional_count').height()});
                   $('.select-area-box').css({"padding-top":$('.optional_count').height()});
                   if(this.reqData.industry.length>=this.reqData.buyset[2]){

+ 3 - 1
src/web/templates/weixin/vipsubscribe/trial_info.html

@@ -135,8 +135,10 @@
                         duration: 2000,
                         className: 'custom-toast',
                       });
+                      if(r.errMsg=="手机号已使用"||r.errMsg=="信息已发送"){
+                        $(".checkCode").attr("src","/subscribepay/trial/captcha?rnd="+Math.random()); //刷新验证码
+                      }
                     }
-                    $(".checkCode").attr("src","/subscribepay/trial/captcha?rnd="+Math.random()); //刷新验证码  
                   })
                 }
             })

+ 39 - 37
src/web/templates/weixin/vipsubscribe/vip_purchase.html

@@ -92,16 +92,16 @@
                                 <td colspan="2">按月购买</td>
                             </tr>
                             <tr>
-                                <td>5.8元 月/市/行业</td>
-                                <td>18元 月/市/全行业</td>
+                                <td><span>5.8</span>元 月/市/行业</td>
+                                <td><span>18</span>元 月/市/全行业</td>
                             </tr>
                             <tr>
-                                <td>11.8元 月/省/行业</td>
-                                <td>38元 月/省/全行业</td>
+                                <td><span>11.8</span>元 月/省/行业</td>
+                                <td><span>38</span>元 月/省/全行业</td>
                             </tr>
                             <tr>
-                                <td>118元 月/全国/行业</td>
-                                <td>388元 月/全国/全行业</td>
+                                <td><span>118</span>元 月/全国/行业</td>
+                                <td><span>388</span>元 月/全国/全行业</td>
                             </tr>
                         </table>
                         <table class="yearly">
@@ -109,16 +109,16 @@
                                 <td colspan="2">按年购买</td>
                             </tr>
                             <tr>
-                                <td>58元 年/市/行业</td>
-                                <td>180元 年/市/全行业</td>
+                                <td><span>58</span>元 年/市/行业</td>
+                                <td><span>180</span>元 年/市/全行业</td>
                             </tr>
                             <tr>
-                                <td>118元 年/省/行业</td>
-                                <td>380元 年/省/全行业</td>
+                                <td><span>118</span>元 年/省/行业</td>
+                                <td><span>380</span>元 年/省/全行业</td>
                             </tr>
                             <tr>
-                                <td>1180元 年/全国/行业</td>
-                                <td>3880元 年/全国/全行业</td>
+                                <td><span>1180</span>元 年/全国/行业</td>
+                                <td><span>3880</span>元 年/全国/全行业</td>
                             </tr>
                         </table>
                         <dl class="tips">
@@ -325,6 +325,7 @@
         areaSelect:{"一个省":["一个市"]},//已选择地区 {"一个省":["一个市"]}计算价格临时变量
         industrySelect:["一个行业"],// 已选择行业 一个行业(计算价格临时变量)
         timeSelect:[1,2],//已选择时间 timeSelect[0]时长  timeSelect[1] 1:年 2:月
+        price:{}, //价格
         vipSubisTrial:false,
         initData: function(){
           //已选择
@@ -356,30 +357,7 @@
                 },false)
               }
             {{end}}
-            
-            {{if .T.again}}
-             {{if eq .T.again 1 }}
-              //即将到期 回显已购买
-              if(!sessionStorage.getItem("vipSubSelectArea")||!sessionStorage.getItem("vipSubSelectIndustry")){
-                $DoPost("/subscribepay/editSub/getSubBuyMsg",{},function(r){
-                  if(r.success){
-                    if(!$.isEmptyObject(r.data.area)){
-                      purchase.areaSelect=r.data.area
-                    }else{
-                      purchase.areaSelect={"全国":[]}
-                    }
-                    if(r.data.industry.length!=0){
-                      purchase.industrySelect=r.data.industry
-                    }else{
-                      purchase.industrySelect=["全部行业"]
-                    }
-                    sessionStorage.setItem("vipSubSelectArea",JSON.stringify(purchase.areaSelect));
-                    sessionStorage.setItem("vipSubSelectIndustry",JSON.stringify(purchase.industrySelect));
-                  }
-                },false)
-              }
-            {{end}}
-            {{end}}
+
             if(sessionStorage.getItem("vipSubSelectTime")){
               this.timeSelect=JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
             }
@@ -387,6 +365,14 @@
             if(sessionStorage.getItem("vipSub_read")=="true") $("#buy").prop("checked",true);
             //是否试用界面
             if(sessionStorage.getItem("vipSubisTrial")) this.vipSubisTrial=true;
+            
+            //加载价格
+            $DoPost("/subscribepay/vipsubscribe/getPrice",{},function(r){
+              if(r){
+                purchase.price=r;
+              }
+            },false)
+            
           }catch(e){
             console.log(e)
           }  
@@ -418,6 +404,21 @@
             $(".add_tips.area").text(tipTxt).css("display","");
           }
         },
+        showPrice:function(){
+          $('.monthly span:eq(0)').text(purchase.price.month.oneCity_oneBuyerClass/100);
+          $('.monthly span:eq(1)').text(purchase.price.month.oneCity_allBuyerClass/100);
+          $('.monthly span:eq(2)').text(purchase.price.month.oneProvince_oneBuyerClass/100);
+          $('.monthly span:eq(3)').text(purchase.price.month.oneProvince_allBuyerClass/100);
+          $('.monthly span:eq(4)').text(purchase.price.month.allProvince_oneBuyerClass/100);
+          $('.monthly span:eq(5)').text(purchase.price.month.allProvince_allBuyerClass/100);
+          
+          $('.yearly span:eq(0)').text(purchase.price.year.oneCity_oneBuyerClass/100);
+          $('.yearly span:eq(1)').text(purchase.price.year.oneCity_allBuyerClass/100);
+          $('.yearly span:eq(2)').text(purchase.price.year.oneProvince_oneBuyerClass/100);
+          $('.yearly span:eq(3)').text(purchase.price.year.oneProvince_allBuyerClass/100);
+          $('.yearly span:eq(4)').text(purchase.price.year.allProvince_oneBuyerClass/100);
+          $('.yearly span:eq(5)').text(purchase.price.year.allProvince_allBuyerClass/100);
+        },
         showIndustry:function(){
           let data = this.industrySelect;
           if(data.length>0&&data[0]!="一个行业"){
@@ -450,7 +451,7 @@
           if(this.vipSubisTrial){
             $('.price strong').text('¥0.00');
           }else{
-            var price=getsubVipOrderPrice(this.areaSelect,this.industrySelect,this.timeSelect);
+            var price=getsubVipOrderPrice(this.areaSelect,this.industrySelect,this.timeSelect,this.price);
             $('.price strong').text('¥'+price);
             $('.computed_price').html('¥' + price);
           }
@@ -468,6 +469,7 @@
           purchase.initData();
           purchase.showArea();
           purchase.showIndustry();
+          purchase.showPrice();
           purchase.showTime();
           purchase.flushPrice();
           checkOk();