|
@@ -12,14 +12,13 @@ function $DoPost(url,param={},callback,async=true){
|
|
|
async: async,
|
|
|
dataType: "json",
|
|
|
success: function(r){
|
|
|
+ callback(r)
|
|
|
if(r.error||r.errMsg){
|
|
|
var errTip = r.error||r.errMsg;
|
|
|
weui.toast(errTip,{
|
|
|
duration: 2000,
|
|
|
className: 'custom-toast',
|
|
|
});
|
|
|
- }else{
|
|
|
- callback(r)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -56,7 +55,7 @@ function getAreaClassArr(area){
|
|
|
return [provinceArr,cityArr]
|
|
|
}
|
|
|
|
|
|
-/* vip订阅
|
|
|
+/* vip订阅价格
|
|
|
area:地区 {}
|
|
|
industry:行业 []
|
|
|
time[count,unit] count:时间长度 unit 1:年 2:月
|
|
@@ -69,29 +68,24 @@ function getsubVipOrderPrice(area,industry,t){
|
|
|
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,0,t[1])*t[0]/100 //全国多行业套餐
|
|
|
+ return getSetMealPrice(0,industry.length,t[1]) * t[0] / 100 //全国多行业套餐
|
|
|
}
|
|
|
var final_price = 0//最终价格
|
|
|
for(var i in area) {
|
|
|
- let thisPrice = 0;
|
|
|
- let citys = area[i]
|
|
|
+ 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[1]==2){//月
|
|
|
- var industry_Price= 580*industry.length>1800?1800:580*industry.length;
|
|
|
- var city_Price = citys.length*580>1180?1180:citys.length*580;
|
|
|
- if(t[0]>10) t[0]=10 //月份十个月以上价格一样
|
|
|
- thisPrice = (industry_Price + city_Price)*t[0];
|
|
|
- }else{//年
|
|
|
- var industry_Price= 5800*industry.length>18000?18000:5800*industry.length;
|
|
|
- var city_Price = citys.length*5800>11800?11800:citys.length*5800;
|
|
|
- thisPrice = (industry_Price + city_Price)*5800*t[0]/100;
|
|
|
- }
|
|
|
+ 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倍
|
|
|
}
|
|
|
}
|
|
|
}else{//省
|
|
@@ -107,8 +101,8 @@ function getsubVipOrderPrice(area,industry,t){
|
|
|
//i(industry) 全行业:0 行业:1 其他:多个行业
|
|
|
//u(unit) 年:1 月:2
|
|
|
function getSetMealPrice(c,i,u){
|
|
|
- let t = u==2 //是否是月单位
|
|
|
- let icount=1 //行业个数
|
|
|
+ var t = u==2 //是否是月单位
|
|
|
+ var icount=1 //行业个数
|
|
|
if(i>1){
|
|
|
icount=i;
|
|
|
}
|
|
@@ -118,24 +112,24 @@ function getSetMealPrice(c,i,u){
|
|
|
if(t)return 38800 //1月全国全行业
|
|
|
return 388000 //1年全国全行业
|
|
|
}else{
|
|
|
- if(t)return 11800*icount //1月全国icount个行业
|
|
|
- return 118000*icount //1年全国icount个行业
|
|
|
+ if(t)return 11800 * icount //1月全国icount个行业
|
|
|
+ return 118000 * icount //1年全国icount个行业
|
|
|
}
|
|
|
case 1:
|
|
|
if(i==0){
|
|
|
if(t)return 3800 //1月1省全行业
|
|
|
return 38000 //1年1省全行业
|
|
|
}else{
|
|
|
- if(t)return 1180*icount //1月1省icount个行业
|
|
|
- return 11800*icount //1年1省icount个行业
|
|
|
+ if(t)return 1180 * icount //1月1省icount个行业
|
|
|
+ return 11800 * icount //1年1省icount个行业
|
|
|
}
|
|
|
default:
|
|
|
if(i==0){
|
|
|
if(t)return 1800 //1月1市全行业
|
|
|
return 18000 //1年1市全行业
|
|
|
}else{
|
|
|
- if(t)return 580*icount //1月1市icount个行业
|
|
|
- return 5800*icount //1年1市icount个行业
|
|
|
+ if(t)return 580 * icount //1月1市icount个行业
|
|
|
+ return 5800 * icount //1年1市icount个行业
|
|
|
}
|
|
|
}
|
|
|
}
|