|
@@ -85,23 +85,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
- <template v-if="show_month_order_entry">
|
|
|
|
- <div
|
|
|
|
- class="pay-product__item pay-product__month"
|
|
|
|
- @click="chooseMonthOrder"
|
|
|
|
- >
|
|
|
|
- <img
|
|
|
|
- :src="
|
|
|
|
- isMonthOrder
|
|
|
|
- ? show_month_order_entry.focus_img
|
|
|
|
- : show_month_order_entry.unfocus_img
|
|
|
|
- "
|
|
|
|
- alt=""
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- <ul class="pay-product">
|
|
|
|
|
|
+ <ul class="pay-product" style="margin-bottom: 1.4rem">
|
|
<!-- <v-touch :class="['pay-product__item',{'is-active': i === selectedProduct, 'is-recommend': i === defaultProduct }]"
|
|
<!-- <v-touch :class="['pay-product__item',{'is-active': i === selectedProduct, 'is-recommend': i === defaultProduct }]"
|
|
v-for="(v,i) in product"
|
|
v-for="(v,i) in product"
|
|
:key="v.product_id"
|
|
:key="v.product_id"
|
|
@@ -165,7 +149,6 @@
|
|
<span class="text" v-else><i class="is_year"></i></span>
|
|
<span class="text" v-else><i class="is_year"></i></span>
|
|
<span>{{ v.save_text }}</span>
|
|
<span>{{ v.save_text }}</span>
|
|
</p>
|
|
</p>
|
|
- <!-- <p class="pay-product__gift">赠送价值{{calcGiftPrice(v.gift)}}书币的礼物道具</p> -->
|
|
|
|
</v-touch>
|
|
</v-touch>
|
|
</template>
|
|
</template>
|
|
<!-- <template v-else>
|
|
<!-- <template v-else>
|
|
@@ -271,7 +254,6 @@
|
|
<p class="item-tag" v-if="v.angle_sign_text">
|
|
<p class="item-tag" v-if="v.angle_sign_text">
|
|
{{ v.angle_sign_text }}
|
|
{{ v.angle_sign_text }}
|
|
</p>
|
|
</p>
|
|
- <!-- <p class="pay-product__gift">赠送价值{{calcGiftPrice(v.gift)}}书币的礼物道具</p> -->
|
|
|
|
</v-touch>
|
|
</v-touch>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
@@ -293,25 +275,7 @@
|
|
选择充值金额
|
|
选择充值金额
|
|
<span class="red">(1元=100书币)</span>
|
|
<span class="red">(1元=100书币)</span>
|
|
</div>
|
|
</div>
|
|
- <!-- <i class="pay-for__gift--txt" v-if="giftPrice"><i @click="see">查看礼物道具详情></i></p> -->
|
|
|
|
- <!-- <p class="pay-for__gift--txt"
|
|
|
|
- v-if="giftPrice">充值赠送价值{{giftPrice}}书币的礼物道具 <i @click="see">点击查看></i></p> -->
|
|
|
|
- <div class="gift-fixed__wrap" v-if="giftPrice">
|
|
|
|
- <p class="gift-title__text">赠送价值{{ giftPrice }}书币的礼物道具</p>
|
|
|
|
- <div class="gift-preview">
|
|
|
|
- <span class="title">获赠道具详情</span>
|
|
|
|
- <div class="preview-wrap">
|
|
|
|
- <span
|
|
|
|
- class="gift-preview__item"
|
|
|
|
- v-for="(g, i) in giftList"
|
|
|
|
- :key="i"
|
|
|
|
- >
|
|
|
|
- <img :src="g.icon" :alt="g.name_desc" />
|
|
|
|
- <i>{{ g.name_desc }}x{{ g.num }}</i>
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+
|
|
<template v-if="showPayYearBanner || showSpecialPayTempalte">
|
|
<template v-if="showPayYearBanner || showSpecialPayTempalte">
|
|
<div class="pay-btn-box">
|
|
<div class="pay-btn-box">
|
|
<div class="pay-btn" @click="pay">立即充值</div>
|
|
<div class="pay-btn" @click="pay">立即充值</div>
|
|
@@ -453,12 +417,9 @@ import {
|
|
subscribeByRMB,
|
|
subscribeByRMB,
|
|
recharge,
|
|
recharge,
|
|
getUserInfo,
|
|
getUserInfo,
|
|
- isMonthOrderSuc,
|
|
|
|
getOrderCoupon
|
|
getOrderCoupon
|
|
} from "../api";
|
|
} from "../api";
|
|
|
|
|
|
-import { PayForGift } from "../components/prompt";
|
|
|
|
-
|
|
|
|
export default {
|
|
export default {
|
|
name: Pay.name,
|
|
name: Pay.name,
|
|
data() {
|
|
data() {
|
|
@@ -484,9 +445,7 @@ export default {
|
|
year_item_bg_check: require("../assets/year_charge_check.jpg"),
|
|
year_item_bg_check: require("../assets/year_charge_check.jpg"),
|
|
mi_wan_year_bg: require("../assets/mi_wan_year.jpg"),
|
|
mi_wan_year_bg: require("../assets/mi_wan_year.jpg"),
|
|
mi_wan_year_bg_check: require("../assets/mi_wan_year_check.jpg"),
|
|
mi_wan_year_bg_check: require("../assets/mi_wan_year_check.jpg"),
|
|
- month_order_bg: require("../assets/month_order_1.png"),
|
|
|
|
- month_order_bg_check: require("../assets/month_order_check.png"),
|
|
|
|
- show_month_order_entry: window.options.month_order_info,
|
|
|
|
|
|
+
|
|
xiyue_pay_template: window.options.xiyue_info,
|
|
xiyue_pay_template: window.options.xiyue_info,
|
|
isMonthOrder: false,
|
|
isMonthOrder: false,
|
|
isXYEntrySelect: false,
|
|
isXYEntrySelect: false,
|
|
@@ -496,7 +455,7 @@ export default {
|
|
availdCouponList: [],
|
|
availdCouponList: [],
|
|
popupVisible: false,
|
|
popupVisible: false,
|
|
payType: [
|
|
payType: [
|
|
- { name: "微信", img: require("../assets/wechat.png"), nickName: "wx" },
|
|
|
|
|
|
+ { name: "微信", img: require("../assets/wechat.png"), nickName: "wx" }
|
|
/* {
|
|
/* {
|
|
name: "支付宝",
|
|
name: "支付宝",
|
|
img: require("../assets/alipay.png"),
|
|
img: require("../assets/alipay.png"),
|
|
@@ -511,23 +470,10 @@ export default {
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- giftList() {
|
|
|
|
- const { product, selectedProduct } = this;
|
|
|
|
- return selectedProduct && product.length
|
|
|
|
- ? product[selectedProduct].gift
|
|
|
|
- : [];
|
|
|
|
- },
|
|
|
|
- giftPrice() {
|
|
|
|
- return this.giftList.reduce((a, b) => {
|
|
|
|
- return a + b.cost * b.num;
|
|
|
|
- }, 0);
|
|
|
|
- },
|
|
|
|
chargePrice() {
|
|
chargePrice() {
|
|
let select_pro = this.product[this.selectedProduct];
|
|
let select_pro = this.product[this.selectedProduct];
|
|
let normal_value = select_pro ? select_pro.price : "0";
|
|
let normal_value = select_pro ? select_pro.price : "0";
|
|
- let special_value = this.isMonthOrder
|
|
|
|
- ? this.show_month_order_entry.price
|
|
|
|
- : normal_value;
|
|
|
|
|
|
+ let special_value = normal_value;
|
|
return Number(special_value.replace("元", ""));
|
|
return Number(special_value.replace("元", ""));
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -560,7 +506,6 @@ export default {
|
|
},
|
|
},
|
|
selectProduct(i) {
|
|
selectProduct(i) {
|
|
this.selectedProduct = i;
|
|
this.selectedProduct = i;
|
|
- this.isMonthOrder = false;
|
|
|
|
this.isXYEntrySelect = false;
|
|
this.isXYEntrySelect = false;
|
|
this.xiyue_pay_btn_text = "立即充值";
|
|
this.xiyue_pay_btn_text = "立即充值";
|
|
this.getAvaildCoupon(
|
|
this.getAvaildCoupon(
|
|
@@ -568,16 +513,13 @@ export default {
|
|
);
|
|
);
|
|
},
|
|
},
|
|
pay() {
|
|
pay() {
|
|
- if (this.isMonthOrder) {
|
|
|
|
- this.toMonthOrder();
|
|
|
|
- } else {
|
|
|
|
recharge({
|
|
recharge({
|
|
product_id: this.product[this.selectedProduct].product_id,
|
|
product_id: this.product[this.selectedProduct].product_id,
|
|
bid: this.$route.query.book_id,
|
|
bid: this.$route.query.book_id,
|
|
cid: this.$route.query.chapter_id,
|
|
cid: this.$route.query.chapter_id,
|
|
use_coupon: this.currentCoupon.id
|
|
use_coupon: this.currentCoupon.id
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
payForYear() {
|
|
payForYear() {
|
|
let product_id = this.product[this.product.length - 1].product_id;
|
|
let product_id = this.product[this.product.length - 1].product_id;
|
|
@@ -597,31 +539,6 @@ export default {
|
|
window.location.href = `${window.location.origin +
|
|
window.location.href = `${window.location.origin +
|
|
window.options.appad_url}`;
|
|
window.options.appad_url}`;
|
|
},
|
|
},
|
|
- see() {
|
|
|
|
- PayForGift({ list: this.giftList });
|
|
|
|
- },
|
|
|
|
- calcGiftPrice(list) {
|
|
|
|
- return list.reduce((a, b) => {
|
|
|
|
- return a + b.cost * b.num;
|
|
|
|
- }, 0);
|
|
|
|
- },
|
|
|
|
- toMonthOrder() {
|
|
|
|
- const origin = window.location.origin;
|
|
|
|
- const href = window.location.href;
|
|
|
|
- // const r = origin + "/monthpay/wait?r=" + encodeURIComponent(href);
|
|
|
|
- location.href =
|
|
|
|
- this.show_month_order_entry.link +
|
|
|
|
- `&use_coupon=${this.currentCoupon.id}`;
|
|
|
|
- },
|
|
|
|
- chooseMonthOrder() {
|
|
|
|
- this.selectedProduct = null;
|
|
|
|
- this.isMonthOrder = true;
|
|
|
|
- this.defaultProduct = null;
|
|
|
|
- console.log("我被选中了");
|
|
|
|
- this.getAvaildCoupon(
|
|
|
|
- Number(window.options.month_order_info.price.replace("元", ""))
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
//获取当前金额的可用优惠券
|
|
//获取当前金额的可用优惠券
|
|
getAvaildCoupon(price) {
|
|
getAvaildCoupon(price) {
|
|
this.currentCoupon = { id: "", price: 0 };
|
|
this.currentCoupon = { id: "", price: 0 };
|
|
@@ -630,28 +547,6 @@ export default {
|
|
item => item.use_condition < price
|
|
item => item.use_condition < price
|
|
);
|
|
);
|
|
},
|
|
},
|
|
- findMonthOrder() {
|
|
|
|
- this.$Indicator.open("查询订单中...请稍等");
|
|
|
|
- let time = 0;
|
|
|
|
- this.timer = setInterval(() => {
|
|
|
|
- if (time === 10) {
|
|
|
|
- this.$Indicator.close();
|
|
|
|
- window.clearInterval(this.timer);
|
|
|
|
- this.$Toast("订单可能延迟几分钟,稍后到个人中心查看或联系客服");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- isMonthOrderSuc()
|
|
|
|
- .then(_ => {
|
|
|
|
- this.$Indicator.close();
|
|
|
|
- window.clearInterval(this.timer);
|
|
|
|
- this.$Toast("包月订购成功!");
|
|
|
|
- })
|
|
|
|
- .catch(e => {
|
|
|
|
- time++;
|
|
|
|
- console.log(e, "continue");
|
|
|
|
- });
|
|
|
|
- }, 1000);
|
|
|
|
- },
|
|
|
|
chooseXiYueEntry() {
|
|
chooseXiYueEntry() {
|
|
this.selectedProduct = null;
|
|
this.selectedProduct = null;
|
|
this.isXYEntrySelect = true;
|
|
this.isXYEntrySelect = true;
|
|
@@ -693,9 +588,6 @@ export default {
|
|
if (p.first_charge) {
|
|
if (p.first_charge) {
|
|
this.cheaperProduct = i;
|
|
this.cheaperProduct = i;
|
|
}
|
|
}
|
|
- if (this.show_month_order_entry) {
|
|
|
|
- this.chooseMonthOrder();
|
|
|
|
- }
|
|
|
|
|
|
|
|
if (this.xiyue_pay_template) {
|
|
if (this.xiyue_pay_template) {
|
|
this.chooseXiYueEntry();
|
|
this.chooseXiYueEntry();
|
|
@@ -709,9 +601,6 @@ export default {
|
|
});
|
|
});
|
|
//用户优惠券
|
|
//用户优惠券
|
|
|
|
|
|
- // 是否包月回调
|
|
|
|
- const { from_wxpay } = this.$route.query;
|
|
|
|
- if (from_wxpay) this.findMonthOrder();
|
|
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -763,73 +652,4 @@ export default {
|
|
box-shadow: none;
|
|
box-shadow: none;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-.gift-fixed__wrap {
|
|
|
|
- position: fixed;
|
|
|
|
- bottom: 1.2rem;
|
|
|
|
- max-height: 1.1rem;
|
|
|
|
- left: 0;
|
|
|
|
- right: 0;
|
|
|
|
- background: #f7f7f7;
|
|
|
|
- padding: 0.22rem 0.24rem;
|
|
|
|
-
|
|
|
|
- .gift-title__text {
|
|
|
|
- color: #ef5952;
|
|
|
|
- font-size: 0.26rem;
|
|
|
|
- font-weight: bold;
|
|
|
|
-
|
|
|
|
- &.text-align {
|
|
|
|
- text-align: center;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .gift-preview {
|
|
|
|
- font-size: 0.24rem;
|
|
|
|
- display: flex;
|
|
|
|
- justify-content: flex-start;
|
|
|
|
- align-items: center;
|
|
|
|
- // overflow: auto;
|
|
|
|
- // -webkit-overflow-scrolling: touch;
|
|
|
|
-
|
|
|
|
- .title {
|
|
|
|
- flex-basis: 2rem;
|
|
|
|
- flex-shrink: 0;
|
|
|
|
- white-space: nowrap;
|
|
|
|
- color: #333;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .preview-wrap {
|
|
|
|
- flex: 1;
|
|
|
|
- display: flex;
|
|
|
|
- overflow: auto;
|
|
|
|
- -webkit-overflow-scrolling: touch;
|
|
|
|
-
|
|
|
|
- &::-webkit-scrollbar {
|
|
|
|
- display: none;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .gift-preview__item {
|
|
|
|
- font-size: 0;
|
|
|
|
- flex-shrink: 0;
|
|
|
|
- white-space: nowrap;
|
|
|
|
- display: flex;
|
|
|
|
-
|
|
|
|
- i {
|
|
|
|
- font-size: 0.22rem;
|
|
|
|
- color: #666;
|
|
|
|
- font-style: normal;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- &:not(:last-child) {
|
|
|
|
- margin-right: 0.18rem;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- img {
|
|
|
|
- width: 0.34rem;
|
|
|
|
- height: 0.34rem;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
</style>
|
|
</style>
|