|
@@ -4,7 +4,7 @@
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
|
|
|
- <title>超级订阅</title>
|
|
|
+ <title>开通超级订阅</title>
|
|
|
<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/rem.js'></script>
|
|
|
<link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/css/base.css?v={{Msg "seo" "version"}}'/>
|
|
|
<link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/weui.min.css'>
|
|
@@ -66,13 +66,26 @@
|
|
|
text-align: left;
|
|
|
margin-top: 2px;
|
|
|
}
|
|
|
+ .area-result{
|
|
|
+ /* width:1.2rem; */
|
|
|
+ height: .38rem;
|
|
|
+ padding: 0 .16rem;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background: #2abed1;
|
|
|
+ border: 1px solid #2abed1;
|
|
|
+ border-radius: 41px;
|
|
|
+ font-size: .22rem;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
</style>
|
|
|
<!--E-手机号输入样式-->
|
|
|
</head>
|
|
|
<body data-weui-theme="light">
|
|
|
<div class="app-layout-header jy-app-header" style="z-index: 8;">
|
|
|
<span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
|
|
|
- 超级订阅{{if not .T.isTrial }}{{else}}(试用){{end}}
|
|
|
+ 开通超级订阅{{if not .T.isTrial }}{{else}}(试用){{end}}
|
|
|
<span></span>
|
|
|
</div>
|
|
|
<div class="app-layout-content-b">
|
|
@@ -99,14 +112,23 @@
|
|
|
<div class="choose_condition">
|
|
|
<ul class="chooseList">
|
|
|
<li class="choose_item">
|
|
|
- <a href="/jyapp/vipsubscribe/toChooseArea">
|
|
|
- <span class="label">省份数量</span>
|
|
|
- {{if not .T.isTrial }}
|
|
|
- <input type="text" disabled value="" placeholder="1个省" class="info choose_area">
|
|
|
- {{else}}
|
|
|
- <input type="text" disabled value="" placeholder="选择全国、省份、地市" class="info choose_area">
|
|
|
- {{end}}
|
|
|
- <i class="iconfont icon-arrow"></i>
|
|
|
+ <a href="javascript:;" onclick="toChooseArea()">
|
|
|
+ <div style="display: flex;align-items: center;flex: 1;">
|
|
|
+ <span class="label">省份数量</span>
|
|
|
+ <div class="area-result">
|
|
|
+ {{if not .T.isTrial }}
|
|
|
+ <input type="hidden" disabled value="" placeholder="1个省" class="info choose_area">
|
|
|
+ <span class="area-result-text"></span>
|
|
|
+ {{else}}
|
|
|
+ <input type="hidden" disabled value="" placeholder="选择全国、省份、地市" class="info choose_area">
|
|
|
+ <span class="area-result-text"></span>
|
|
|
+ {{end}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex;align-items: center;">
|
|
|
+ <em style="color: #9B9CA3;font-size: .28rem;">选择</em>
|
|
|
+ <i class="iconfont icon-arrow"></i>
|
|
|
+ </div>
|
|
|
</a>
|
|
|
<p class="add_tips area_warn" style="display: none;">请选择区域</p>
|
|
|
<!-- 无选择时不显示 -->
|
|
@@ -145,11 +167,11 @@
|
|
|
</ul>
|
|
|
<!-- 商品规格 -->
|
|
|
<div id="goods-size-vue">
|
|
|
- <vip-size-template @select-vip-size="getGoodSize" @select-auto-renew="getAutoRenew"></vip-size-template>
|
|
|
+ <goods-size-template ref="goodsSize" :config="props" @select-vip-size="getGoodSize"></goods-size-template>
|
|
|
</div>
|
|
|
<!-- 商品优惠券 -->
|
|
|
<div id="goods-coupon-vue">
|
|
|
- <vip-coupon-template></vip-coupon-template>
|
|
|
+ <goods-coupon-template ref="goodsCoupon" @update-coupon="updateCoupon"></goods-coupon-template>
|
|
|
</div>
|
|
|
<!-- <div class="pay_mode">
|
|
|
{{if not .T.isTrial }}
|
|
@@ -628,41 +650,89 @@
|
|
|
//试用用户
|
|
|
{{end}}
|
|
|
|
|
|
+ // 跳转区域选择清除商品规格及优惠券选择
|
|
|
+ function toChooseArea() {
|
|
|
+ sessionStorage.removeItem('vip-cur-select-coupon')
|
|
|
+ sessionStorage.removeItem('vip-cur-select-size')
|
|
|
+ location.href = '/jyapp/vipsubscribe/toChooseArea'
|
|
|
+ }
|
|
|
/* vue 代码 start */
|
|
|
// vip商品规格
|
|
|
var goodsSize = new Vue({
|
|
|
el:'#goods-size-vue',
|
|
|
data: function() {
|
|
|
return {
|
|
|
-
|
|
|
+ props: {
|
|
|
+ areaCount: 1,
|
|
|
+ priceInfo: {}
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+ created () {
|
|
|
+ this.getAreaCount()
|
|
|
+ },
|
|
|
mounted () {
|
|
|
-
|
|
|
+ this.getSizeStorage()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 父组件传省份数量至子组件
|
|
|
+ getAreaCount: function() {
|
|
|
+ var areaStorage = JSON.parse(sessionStorage.getItem('vipSubSelectArea'))
|
|
|
+ if (areaStorage) {
|
|
|
+ var count = 0
|
|
|
+ for (var key in areaStorage) {
|
|
|
+ if (key.indexOf('全国') > -1) {
|
|
|
+ count = 16
|
|
|
+ } else {
|
|
|
+ count++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.props.areaCount = count
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getSizeStorage: function() {
|
|
|
+ // 恢复商品规格选择
|
|
|
+ var size = JSON.parse(sessionStorage.getItem('vip-cur-select-size'))
|
|
|
+ if (size) {
|
|
|
+ this.$refs.goodsSize.goodsActive = size.index
|
|
|
+ this.$nextTick(function(){
|
|
|
+ console.log(size.price, 'size.price')
|
|
|
+ coupon.updatePrice(size.price/100)
|
|
|
+ goodsCoupon.updatePrice(size.price/100)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
getGoodSize: function(data) {
|
|
|
console.log(data, '父组件接收子组件传来的商品规格')
|
|
|
- },
|
|
|
- getAutoRenew: function(data) {
|
|
|
- console.log(data, '父组件接收子组件传来的是否开启自动续费')
|
|
|
+ coupon.updatePrice(data.price/100)
|
|
|
+ goodsCoupon.updatePrice(data.price/100)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- // vip活动
|
|
|
// vip优惠券
|
|
|
var goodsCoupon = new Vue({
|
|
|
el:'#goods-coupon-vue',
|
|
|
data: function() {
|
|
|
return {
|
|
|
-
|
|
|
+ curSelectCoupon: {}
|
|
|
}
|
|
|
},
|
|
|
- mounted () {
|
|
|
-
|
|
|
- },
|
|
|
+ mounted () {},
|
|
|
methods: {
|
|
|
-
|
|
|
+ updatePrice: function(data){
|
|
|
+ this.$refs.goodsCoupon.getCoupon(data)
|
|
|
+ },
|
|
|
+ updateCoupon: function(data) {
|
|
|
+ console.log(data, '更新优惠券选择')
|
|
|
+ this.curSelectCoupon = data
|
|
|
+ var curSize = JSON.parse(sessionStorage.getItem('vip-cur-select-size'))
|
|
|
+ // 更新优惠券选择同时更新订单组件的价格及优惠金额
|
|
|
+ if (curSize) {
|
|
|
+ coupon.updatePrice(curSize.price/100)
|
|
|
+ } else {
|
|
|
+ coupon.updatePrice(coupon.initPrice)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
// 订单提交
|
|
@@ -697,10 +767,17 @@
|
|
|
// 更新价格相关
|
|
|
updatePrice: function (before) {
|
|
|
console.log( '原价:' + before)
|
|
|
+ var curCoupon = JSON.parse(sessionStorage.getItem('vip-cur-select-coupon'))
|
|
|
+ console.log(curCoupon, '当前选择的优惠券')
|
|
|
+ if (curCoupon) {
|
|
|
+ this.$refs.couponRef.coupon.value = curCoupon.reduce
|
|
|
+ } else {
|
|
|
+ this.$refs.couponRef.coupon.value = 0
|
|
|
+ }
|
|
|
this.initPrice = before;
|
|
|
// 调用子组件查询最优卡券
|
|
|
if (!{{.T.isTrial }}) {
|
|
|
- this.$refs.couponRef.getCoupon();
|
|
|
+ // this.$refs.couponRef.getCoupon();
|
|
|
}
|
|
|
},
|
|
|
// 初始化及回显相关
|
|
@@ -843,6 +920,8 @@
|
|
|
// showGiveStatus(false)
|
|
|
// }
|
|
|
Calculation.Init(false, undefined, [], 0)
|
|
|
+ // 将价格列表传至商品规格组件
|
|
|
+ goodsSize.props.priceInfo = r.new
|
|
|
}
|
|
|
}, false)
|
|
|
sessionStorage.removeItem("pay_read_cache");
|
|
@@ -854,23 +933,26 @@
|
|
|
showArea: function () {
|
|
|
if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["一个省"]) { //有选择
|
|
|
if (this.nowBuyset.areacount === -1) {
|
|
|
- $(".choose_area").val("全国");
|
|
|
+ $(".choose_area").val("已选: 全国");
|
|
|
+ $(".area-result-text").text("已选: 全国");
|
|
|
} else {
|
|
|
- var tipTxt = "已选择 ";
|
|
|
- if (this.nowBuyset.areacount > 0) tipTxt += this.nowBuyset.areacount + " 个省";
|
|
|
+ var tipTxt = "已选: ";
|
|
|
+ if (this.nowBuyset.areacount > 0) tipTxt += this.nowBuyset.areacount + "";
|
|
|
var count = 0;
|
|
|
this.nowBuyset.citys.forEach(function (item, index) {
|
|
|
count += item;
|
|
|
});
|
|
|
- if (count > 0) {
|
|
|
- if (this.nowBuyset.areacount > 0) tipTxt += "、";
|
|
|
- tipTxt += count + " 个市";
|
|
|
- if (this.nowBuyset.citys.length > 1) tipTxt += "(分布在" + this.nowBuyset.citys.length + "个省内)"
|
|
|
- }
|
|
|
+ // if (count > 0) {
|
|
|
+ // if (this.nowBuyset.areacount > 0) tipTxt += "、";
|
|
|
+ // tipTxt += count + " 个市";
|
|
|
+ // if (this.nowBuyset.citys.length > 1) tipTxt += "(分布在" + this.nowBuyset.citys.length + "个省内)"
|
|
|
+ // }
|
|
|
$(".choose_area").val(tipTxt);
|
|
|
+ $(".area-result-text").text(tipTxt);
|
|
|
}
|
|
|
} else {
|
|
|
$(".choose_area").val("");
|
|
|
+ $(".area-result-text").text("");
|
|
|
//是否勾选已阅读
|
|
|
if (sessionStorage.getItem("vipSub_read") === "true") {
|
|
|
$(".area_warn").css("display", "");
|
|
@@ -952,7 +1034,6 @@
|
|
|
// var price = getsubVipOrderPriceBybuyset(this.nowBuyset, time);
|
|
|
// var givePrice = getsubVipOrderPriceBybuyset(this.nowBuyset, [time[1] === 1 ? 1 :time[0], time[1]]);
|
|
|
var obj = this.nowBuyset
|
|
|
- // console.log(obj, 'obj')
|
|
|
obj.areacount = obj.areacount == 0 ? 1 : obj.areacount
|
|
|
var price = Calculation.GetTotal(new Buyset(obj.areacount,[],obj.buyerclasscount, 1),time)
|
|
|
var givePrice = Calculation.GetTotal(new Buyset(obj.areacount,[],obj.buyerclasscount, 1),[time[1] === 1 ? 1 :time[0], time[1]])
|
|
@@ -975,7 +1056,11 @@
|
|
|
$('.discount-price .dis-price').text(formatMoney(givePrice))
|
|
|
}
|
|
|
console.log(price, '计算的价格')
|
|
|
- coupon.updatePrice(price)
|
|
|
+ var size = JSON.parse(sessionStorage.getItem('vip-cur-select-size'))
|
|
|
+ if (!size) {
|
|
|
+ coupon.updatePrice(price)
|
|
|
+ goodsCoupon.updatePrice(price)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -986,6 +1071,7 @@
|
|
|
purchase.showIndustry();
|
|
|
purchase.showPrice();
|
|
|
purchase.showTime();
|
|
|
+ console.log(purchase.timeSelect, 'purchase.timeSelect')
|
|
|
purchase.flushPrice(purchase.timeSelect);
|
|
|
checkOk();
|
|
|
var time_limit;//定义一个周期变量
|
|
@@ -1180,7 +1266,7 @@
|
|
|
$("input").bind("input propertychange change", function (event) {
|
|
|
checkOk();
|
|
|
});
|
|
|
- console.log(coupon.$refs.couponRef.coupon, '用户优惠券id')
|
|
|
+ // console.log(coupon.$refs.couponRef.coupon, '用户优惠券id')
|
|
|
$('#payHandle').click(function () {
|
|
|
$("#payHandle").attr("disabled", "disabled");
|
|
|
//支付请求
|
|
@@ -1202,8 +1288,8 @@
|
|
|
}
|
|
|
//付费用户
|
|
|
var param = {
|
|
|
- "userLotteryId":coupon.$refs.couponRef.coupon.userLotteryId,
|
|
|
- "lotteryId": coupon.$refs.couponRef.coupon.lotteryId,
|
|
|
+ "userLotteryId":goodsCoupon.curSelectCoupon.userLotteryId,
|
|
|
+ "lotteryId": goodsCoupon.curSelectCoupon.lotteryId,
|
|
|
"area": JSON.stringify(area),
|
|
|
// "industry": industry.join(","),
|
|
|
"time": $(".info:eq(2)").val().trim(),
|
|
@@ -1304,6 +1390,10 @@
|
|
|
|
|
|
sessionStorage.removeItem("pay_read_cache");
|
|
|
sessionStorage.removeItem("liveActiveCode_purchase");
|
|
|
+ // 清除商品规格当前选择
|
|
|
+ sessionStorage.removeItem("vip-cur-select-size")
|
|
|
+ // 清除商品优惠券当前选择
|
|
|
+ sessionStorage.removeItem("vip-cur-select-coupon")
|
|
|
}
|
|
|
|
|
|
/******* 获取url参数(正则)********/
|