|
@@ -241,6 +241,42 @@
|
|
|
}
|
|
|
return cycle
|
|
|
}
|
|
|
+
|
|
|
+ function calcAccountNum(order) {
|
|
|
+ var filterInfo = order.filter ? JSON.parse(order.filter) : {}
|
|
|
+ var filter_vip_new = order.new_filter ? JSON.parse(order.new_filter) : {}
|
|
|
+ var buyAccountCount = filterInfo.buyAccountCount || filter_vip_new.buyAccountCount || 0
|
|
|
+ var giftAccountCount = filterInfo.giftAccountCount || filter_vip_new.giftAccountCount || 0
|
|
|
+ var totalAccountCount = Number(buyAccountCount) + Number(giftAccountCount)
|
|
|
+
|
|
|
+ var addAreaCount = filterInfo.addAreaCount || filter_vip_new.addAreaCount || 0
|
|
|
+ var onlyAddCount = addAreaCount <= 0 // 仅增购子账号
|
|
|
+
|
|
|
+ // 续费vip_type=1
|
|
|
+ if (order.vip_type == 1 || order.service_type == 2) {
|
|
|
+ // 人数就是购买人数
|
|
|
+ buyNumber2 = filterInfo.buyAccountCount || filter_vip_new.finalAccountCount || 0
|
|
|
+ } else if (order.vip_type == 2 || order.service_type == 3) {
|
|
|
+ // 人数是升级人数/如果只补充服务,则人数就是购买人数
|
|
|
+ if (buyAccountCount == 0 && giftAccountCount == 0) {
|
|
|
+ buyNumber2 = order.buyNum || filter_vip_new.finalAccountCount || 0
|
|
|
+ } else {
|
|
|
+ buyNumber2 = order.buyNum || totalAccountCount || filter_vip_new.finalAccountCount || 0
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ buyNumber2 = order.buy_count || order.buyNum || filter_vip_new.finalAccountCount || 0
|
|
|
+ }
|
|
|
+ return buyNumber2
|
|
|
+ }
|
|
|
+
|
|
|
+ function calcIsOnlyAddPower(order) {
|
|
|
+ var filter_vip = order.filter ? JSON.parse(order.filter) : {}
|
|
|
+ var filter_vip_new = order.new_filter ? JSON.parse(order.new_filter) : {}
|
|
|
+ var buyAccountCount = filter_vip.buyAccountCount || filter_vip_new.buyAccountCount || 0
|
|
|
+ var giftAccountCount = filter_vip.giftAccountCount || filter_vip_new.giftAccountCount || 0
|
|
|
+ var totalAccountCount = Number(buyAccountCount) + Number(giftAccountCount)
|
|
|
+ return totalAccountCount <= 0
|
|
|
+ }
|
|
|
$(function () {
|
|
|
//分享
|
|
|
initShare({{.T.signature}},{{.T.openid}}, 2, "jy_wxmyorder",{{.T.nickname}},{{.T.avatar}});
|
|
@@ -277,14 +313,24 @@
|
|
|
}
|
|
|
}
|
|
|
//购买数量
|
|
|
+ var order = r.data.order;
|
|
|
+ //购买数量
|
|
|
+ var onlyAddPower = calcIsOnlyAddPower(order)
|
|
|
+ var upgrade = order.vip_type == 2 || order.service_type == 3
|
|
|
if(r.data.order.buy_subject=='2'){
|
|
|
- $('.membernum').show();
|
|
|
- $('.buy_num_value').text(r.data.order.buy_count+'人')
|
|
|
-
|
|
|
+ var buyAccountNum = calcAccountNum(order)
|
|
|
+ var num2 = r.data.order.buy_count||buyAccountNum
|
|
|
+ $('.buy_num_value').text(num2+'人')
|
|
|
+ if (num2) {
|
|
|
+ $('.membernum').show();
|
|
|
+ }
|
|
|
}else{
|
|
|
$('.membernum').parent().hide();
|
|
|
-
|
|
|
}
|
|
|
+ if (onlyAddPower && upgrade) {
|
|
|
+ $('.membernum').parents('.l-item').hide()
|
|
|
+ }
|
|
|
+
|
|
|
if (!r.data.order.discount_price || (r.data.order.discount_price && r.data.order.discount_price <= 0)) {
|
|
|
$(".discountPrice").parent().hide();
|
|
|
}
|