|
@@ -34,7 +34,7 @@
|
|
<div class="recharge-item {{curSelect === $idx ? 'recharge-item__select' : ''}}">
|
|
<div class="recharge-item {{curSelect === $idx ? 'recharge-item__select' : ''}}">
|
|
<text class="price {{curSelect === $idx ? 'price__select' : ''}}">{{charge.price}}</text>
|
|
<text class="price {{curSelect === $idx ? 'price__select' : ''}}">{{charge.price}}</text>
|
|
<text class="send {{curSelect === $idx ? 'send__select' : ''}}">{{charge.text}}</text>
|
|
<text class="send {{curSelect === $idx ? 'send__select' : ''}}">{{charge.text}}</text>
|
|
- <div class="discount {{curSelect === $idx ? 'discount__select' : ''}}">
|
|
|
|
|
|
+ <div class="discount {{curSelect === $idx ? 'discount__select' : ''}}" if="charge.save_text">
|
|
<block if="!charge.is_year_order">
|
|
<block if="!charge.is_year_order">
|
|
<text>省</text>
|
|
<text>省</text>
|
|
</block>
|
|
</block>
|
|
@@ -53,16 +53,22 @@
|
|
</tab-content>
|
|
</tab-content>
|
|
</tabs>
|
|
</tabs>
|
|
<div class="wrap-fixed">
|
|
<div class="wrap-fixed">
|
|
- <div class="total-cost">
|
|
|
|
- <text>合计:{{total}}</text>
|
|
|
|
- <text class="notice">选择充值金额(1元=100书币)</text>
|
|
|
|
|
|
+ <image src="../../assets/imgs/shadow.png" class="shadow"></image>
|
|
|
|
+ <div class="total-wrap">
|
|
|
|
+ <div class="total-cost">
|
|
|
|
+ <text>合计:{{total}}</text>
|
|
|
|
+ <text class="notice">选择充值金额(1元=100书币)</text>
|
|
|
|
+ </div>
|
|
|
|
+ <text class="go-to-pay" @click="toPay">立即充值</text>
|
|
</div>
|
|
</div>
|
|
- <text class="go-to-pay">立即充值</text>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { getChargeList } from "../../api";
|
|
|
|
+import { configWxPay } from "../../helper";
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
private: {
|
|
private: {
|
|
curPayType: 1,
|
|
curPayType: 1,
|
|
@@ -80,86 +86,7 @@ export default {
|
|
value: 2
|
|
value: 2
|
|
}
|
|
}
|
|
],
|
|
],
|
|
- rechargeList: [
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- price: "5元",
|
|
|
|
- is_year_order: 0,
|
|
|
|
- is_month_order: 0,
|
|
|
|
- text: "500+300书币",
|
|
|
|
- first_charge: false,
|
|
|
|
- today_special: false,
|
|
|
|
- save_text: "3元",
|
|
|
|
- product_id: 5448,
|
|
|
|
- show_free_ads: 0
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- price: "9.9元",
|
|
|
|
- is_year_order: 0,
|
|
|
|
- is_month_order: 0,
|
|
|
|
- text: "990+450书币",
|
|
|
|
- first_charge: false,
|
|
|
|
- today_special: false,
|
|
|
|
- save_text: "4.5元",
|
|
|
|
- product_id: 5057,
|
|
|
|
- show_free_ads: 0
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- price: "18元",
|
|
|
|
- is_year_order: 0,
|
|
|
|
- is_month_order: 0,
|
|
|
|
- text: "1800+900书币",
|
|
|
|
- first_charge: false,
|
|
|
|
- today_special: false,
|
|
|
|
- save_text: "9元",
|
|
|
|
- product_id: 5059,
|
|
|
|
- show_free_ads: 0
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- price: "30元",
|
|
|
|
- is_year_order: 0,
|
|
|
|
- is_month_order: 0,
|
|
|
|
- text: "3000+1500书币",
|
|
|
|
- first_charge: false,
|
|
|
|
- today_special: false,
|
|
|
|
- save_text: "15元",
|
|
|
|
- product_id: 5061,
|
|
|
|
- show_free_ads: 0
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- price: "50元",
|
|
|
|
- is_year_order: 0,
|
|
|
|
- is_month_order: 0,
|
|
|
|
- text: "5000+3000书币",
|
|
|
|
- first_charge: false,
|
|
|
|
- today_special: true,
|
|
|
|
- save_text: "30元",
|
|
|
|
- product_id: 5062,
|
|
|
|
- show_free_ads: 0
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- price: "100元",
|
|
|
|
- is_year_order: 0,
|
|
|
|
- is_month_order: 0,
|
|
|
|
- text: "10000+9000书币",
|
|
|
|
- first_charge: false,
|
|
|
|
- today_special: false,
|
|
|
|
- save_text: "90元",
|
|
|
|
- product_id: 5063,
|
|
|
|
- show_free_ads: 0
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- price: "365元",
|
|
|
|
- is_year_order: 1,
|
|
|
|
- is_month_order: 0,
|
|
|
|
- text: "每天1元,全年免费看",
|
|
|
|
- first_charge: false,
|
|
|
|
- today_special: false,
|
|
|
|
- save_text: "年费vip会员",
|
|
|
|
- product_id: 5064,
|
|
|
|
- show_free_ads: 0
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ rechargeList: []
|
|
},
|
|
},
|
|
changePayType(type) {
|
|
changePayType(type) {
|
|
this.curPayType = type.value;
|
|
this.curPayType = type.value;
|
|
@@ -168,14 +95,21 @@ export default {
|
|
this.curSelect = key;
|
|
this.curSelect = key;
|
|
this.total = this.rechargeList[key].price;
|
|
this.total = this.rechargeList[key].price;
|
|
},
|
|
},
|
|
- onInit() {
|
|
|
|
- // 选择默认
|
|
|
|
|
|
+ async initChargeList() {
|
|
|
|
+ this.rechargeList = await getChargeList();
|
|
this.rechargeList.forEach((p, k) => {
|
|
this.rechargeList.forEach((p, k) => {
|
|
if (p.today_special) {
|
|
if (p.today_special) {
|
|
this.curSelect = k;
|
|
this.curSelect = k;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ toPay() {
|
|
|
|
+ let product_id = this.rechargeList[this.curSelect].product_id;
|
|
|
|
+ configWxPay({ product_id: product_id })
|
|
|
|
+ },
|
|
|
|
+ onInit() {
|
|
|
|
+ this.initChargeList();
|
|
|
|
+ },
|
|
onHide() {
|
|
onHide() {
|
|
this.$app.$def.createShortcut(true);
|
|
this.$app.$def.createShortcut(true);
|
|
}
|
|
}
|