pay.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. <template>
  2. <div
  3. :class="[
  4. 'pay',
  5. {
  6. 'has-banner':
  7. showPayYearBanner || showSpecialPayTempalte || xiyue_pay_template
  8. }
  9. ]"
  10. >
  11. <x-header></x-header>
  12. <template v-if="!xiyue_pay_template">
  13. <div class="section-edge-all">
  14. <div class="pay-account">
  15. 您的余额:
  16. <span class="red">{{ balance }}</span>
  17. 书币
  18. <span
  19. :class="[
  20. 'red',
  21. { 'no-enough-money': showPayYearBanner || showSpecialPayTempalte }
  22. ]"
  23. v-if="showTip"
  24. >{{
  25. showPayYearBanner || showSpecialPayTempalte ? "" : "(余额不足)"
  26. }}</span
  27. >
  28. </div>
  29. <div class="pay-fee" v-if="showTip && !showChapterConsume">
  30. <template v-if="isFirstPay">
  31. <p v-html="isFirstPay"></p>
  32. </template>
  33. <template v-else>
  34. {{ showBookTip ? "此书全本" : "当前章节" }}需要消耗
  35. <span class="red">{{ $route.query.fee }}</span
  36. >书币
  37. </template>
  38. </div>
  39. <div
  40. class="pay-explain"
  41. v-if="!showPayYearBanner && !showSpecialPayTempalte"
  42. >
  43. 选择充值金额
  44. <span class="red">(1元=100书币)</span>
  45. </div>
  46. <div class="pay-coupon">
  47. <p class="pay-coupon__img">
  48. <img src="../assets/coupon _pay.png" />优惠券
  49. </p>
  50. <p class="pay-coupon__right" @click="changeCoupon">
  51. <span v-if="!isCouponChecked"
  52. >您有{{ availdCouponList.length }}张优惠券待使用</span
  53. ><span class="usecoupon" v-else
  54. >- &yen;{{ currentCoupon.price }}</span
  55. >
  56. <img src="../assets/个人中心-进入.png" />
  57. </p>
  58. </div>
  59. <template v-if="show_month_order_entry">
  60. <div
  61. class="pay-product__item pay-product__month"
  62. @click="chooseMonthOrder"
  63. >
  64. <img
  65. :src="
  66. isMonthOrder
  67. ? show_month_order_entry.focus_img
  68. : show_month_order_entry.unfocus_img
  69. "
  70. alt=""
  71. />
  72. </div>
  73. </template>
  74. <ul class="pay-product">
  75. <!-- <v-touch :class="['pay-product__item',{'is-active': i === selectedProduct, 'is-recommend': i === defaultProduct }]"
  76. v-for="(v,i) in product"
  77. :key="v.product_id"
  78. @tap="selectProduct(i)">
  79. <p class="pay-product__name">{{v.price}}</p>
  80. <p class="pay-product__intro">
  81. <i class="year-vip"
  82. :class="{'is-active': i === selectedProduct}"
  83. v-if="v.vip"></i>
  84. <span v-for="(text,i) in v.intro"
  85. :key="i"
  86. :class="{red: text.important}">{{text.label}}</span>
  87. </p>
  88. <p class="pay-product__intro">
  89. <span v-for="(text,i) in v.intro2"
  90. :key="i"
  91. :class="{red: text.important}">{{text.label}}</span>
  92. </p>
  93. </v-touch> -->
  94. <!-- <template v-if="showPayYearBanner">
  95. <div class="pay-for__year"
  96. @click="payForYear">
  97. <img src="../assets/year_banner.jpg"
  98. alt="">
  99. </div>
  100. </template> -->
  101. <template v-if="showPayYearBanner">
  102. <div
  103. class="pay-product__item"
  104. @click="selectProduct(product.length - 1)"
  105. >
  106. <img
  107. :src="
  108. product.length - 1 === selectedProduct
  109. ? year_item_bg_check
  110. : year_item_bg
  111. "
  112. alt=""
  113. />
  114. </div>
  115. </template>
  116. <template v-for="(v, i) in product">
  117. <template v-if="showPayYearBanner">
  118. <template v-if="i < product.length - 1">
  119. <v-touch
  120. :class="[
  121. 'pay-product__item',
  122. {
  123. 'is-active': i === selectedProduct,
  124. 'is-recommend': i === defaultProduct,
  125. 'is-first': i === cheaperProduct
  126. }
  127. ]"
  128. :key="v.product_id"
  129. @tap="selectProduct(i)"
  130. >
  131. <p class="pay-product__name">{{ v.price }}</p>
  132. <p class="pay-product__intro">{{ v.text }}</p>
  133. <p class="pay-product__intro cheaper-box" v-if="v.save_text">
  134. <span class="text" v-if="!v.is_year_order">省</span>
  135. <span class="text" v-else><i class="is_year"></i></span>
  136. <span>{{ v.save_text }}</span>
  137. </p>
  138. <!-- <p class="pay-product__gift">赠送价值{{calcGiftPrice(v.gift)}}书币的礼物道具</p> -->
  139. </v-touch>
  140. </template>
  141. <!-- <template v-else>
  142. <div class="pay-product__item"
  143. :key="'year' + i"
  144. @click="selectProduct(i)">
  145. <img :src="i === selectedProduct ? year_item_bg_check : year_item_bg"
  146. alt="">
  147. </div>
  148. </template> -->
  149. </template>
  150. <template v-else>
  151. <template v-if="showSpecialPayTempalte">
  152. <template v-if="i < product.length - 1">
  153. <v-touch
  154. :class="[
  155. 'pay-product__item',
  156. {
  157. 'is-active': i === selectedProduct,
  158. 'is-recommend': i === defaultProduct,
  159. 'is-first': i === cheaperProduct
  160. }
  161. ]"
  162. :key="v.product_id"
  163. @tap="selectProduct(i)"
  164. >
  165. <p class="pay-product__name">{{ v.price }}</p>
  166. <p class="pay-product__intro">{{ v.text }}</p>
  167. <p
  168. class="pay-product__intro cheaper-box"
  169. v-if="v.save_text"
  170. >
  171. <span class="text" v-if="!v.is_year_order">省</span>
  172. <span class="text" v-else><i class="is_year"></i></span>
  173. <span>{{ v.save_text }}</span>
  174. </p>
  175. </v-touch>
  176. </template>
  177. <template v-else>
  178. <template v-if="product.length < 7">
  179. <v-touch
  180. :class="[
  181. 'pay-product__item',
  182. {
  183. 'is-active': i === selectedProduct,
  184. 'is-recommend': i === defaultProduct,
  185. 'is-first': i === cheaperProduct
  186. }
  187. ]"
  188. :key="v.product_id"
  189. @tap="selectProduct(i)"
  190. >
  191. <p class="pay-product__name">{{ v.price }}</p>
  192. <p class="pay-product__intro">{{ v.text }}</p>
  193. <p
  194. class="pay-product__intro cheaper-box"
  195. v-if="v.save_text"
  196. >
  197. <span class="text" v-if="!v.is_year_order">省</span>
  198. <span class="text" v-else><i class="is_year"></i></span>
  199. <span>{{ v.save_text }}</span>
  200. </p>
  201. </v-touch>
  202. </template>
  203. <template v-else>
  204. <div
  205. class="pay-product__item pay-product__item--year"
  206. :key="'year' + i"
  207. @click="selectProduct(i)"
  208. >
  209. <img
  210. :src="
  211. i === selectedProduct
  212. ? mi_wan_year_bg_check
  213. : mi_wan_year_bg
  214. "
  215. alt=""
  216. />
  217. </div>
  218. </template>
  219. </template>
  220. </template>
  221. <template v-else>
  222. <v-touch
  223. :class="[
  224. 'pay-product__item',
  225. {
  226. 'is-active': i === selectedProduct,
  227. 'is-recommend': i === defaultProduct,
  228. 'is-first': i === cheaperProduct
  229. }
  230. ]"
  231. :key="v.product_id"
  232. @tap="selectProduct(i)"
  233. >
  234. <p class="pay-product__name">{{ v.price }}</p>
  235. <p class="pay-product__intro">{{ v.text }}</p>
  236. <p class="pay-product__intro cheaper-box" v-if="v.save_text">
  237. <span class="text" v-if="!v.is_year_order">省</span>
  238. <span class="text" v-else><i class="is_year"></i></span>
  239. <span>{{ v.save_text }}</span>
  240. </p>
  241. <p class="item-tag" v-if="v.angle_sign_text">
  242. {{ v.angle_sign_text }}
  243. </p>
  244. <!-- <p class="pay-product__gift">赠送价值{{calcGiftPrice(v.gift)}}书币的礼物道具</p> -->
  245. </v-touch>
  246. </template>
  247. </template>
  248. </template>
  249. <template v-if="showAd_entry && !is_iPhone">
  250. <v-touch
  251. class="pay-product__adwrap"
  252. v-if="product.length"
  253. @tap="toFreeAds()"
  254. >
  255. <img src="../assets/cz.jpg" alt="" />
  256. </v-touch>
  257. </template>
  258. </ul>
  259. <div
  260. class="pay-explain"
  261. v-if="showPayYearBanner || showSpecialPayTempalte"
  262. >
  263. 选择充值金额
  264. <span class="red">(1元=100书币)</span>
  265. </div>
  266. <!-- <i class="pay-for__gift--txt" v-if="giftPrice"><i @click="see">查看礼物道具详情&gt;</i></p> -->
  267. <!-- <p class="pay-for__gift--txt"
  268. v-if="giftPrice">充值赠送价值{{giftPrice}}书币的礼物道具 <i @click="see">点击查看&gt;</i></p> -->
  269. <div class="gift-fixed__wrap" v-if="giftPrice">
  270. <p class="gift-title__text">赠送价值{{ giftPrice }}书币的礼物道具</p>
  271. <div class="gift-preview">
  272. <span class="title">获赠道具详情</span>
  273. <div class="preview-wrap">
  274. <span
  275. class="gift-preview__item"
  276. v-for="(g, i) in giftList"
  277. :key="i"
  278. >
  279. <img :src="g.icon" :alt="g.name_desc" />
  280. <i>{{ g.name_desc }}x{{ g.num }}</i>
  281. </span>
  282. </div>
  283. </div>
  284. </div>
  285. <template v-if="showPayYearBanner || showSpecialPayTempalte">
  286. <div class="pay-btn-box">
  287. <div v-if="showHelpPay" class="help-pay__btn" @click="toHelpPay">
  288. 请好友代充
  289. </div>
  290. <div class="pay-btn" @click="pay">立即充值</div>
  291. </div>
  292. </template>
  293. <template v-else>
  294. <div class="pay-box__fixed">
  295. <div v-if="showHelpPay" class="help-pay__btn" @click="toHelpPay">
  296. 请好友代充
  297. </div>
  298. <div class="pay-btn" @click="pay">
  299. {{
  300. chargePrice ? "¥" + (chargePrice - currentCoupon.price) : ""
  301. }}立即充值
  302. </div>
  303. </div>
  304. </template>
  305. <!-- <div class="pay-agreement">点击立即充值,即表示您已同意
  306. <router-link to="agreement"
  307. class="red">《充值协议》</router-link>
  308. </div> -->
  309. <!-- <div class="pay-tip">
  310. <p>若充值遇到问题或充值失败,请联系客服。</p>
  311. <p>客服QQ:84869600</p>
  312. </div> -->
  313. <p class="pay-shubi-tip">书币属于虚拟商品,一经充值不得退还</p>
  314. <div class="reader-loading" v-show="loading">
  315. <mt-spinner
  316. class="reader-loading-icon"
  317. type="fading-circle"
  318. color="#32a1ff"
  319. ></mt-spinner>
  320. </div>
  321. </div>
  322. </template>
  323. <template v-else>
  324. <!-- 喜悦的充值界面 -->
  325. <div class="section-edge-all xiyue-pay-template">
  326. <div class="user-balance">
  327. <div class="pay-account">
  328. 您的余额:
  329. <span class="red">{{ balance }}</span>
  330. 书币
  331. <span class="red no-enough-money" v-if="showTip"></span>
  332. </div>
  333. <div class="pay-fee" v-if="showTip && !showChapterConsume">
  334. <template v-if="isFirstPay">
  335. <p v-html="isFirstPay"></p>
  336. </template>
  337. <template v-else>
  338. {{ showBookTip ? "此书全本" : "当前章节" }}需要消耗
  339. <span class="red">{{ $route.query.fee }}</span
  340. >书币
  341. </template>
  342. </div>
  343. </div>
  344. <div class="xiyue-entry" @click="chooseXiYueEntry">
  345. <img
  346. :src="
  347. isXYEntrySelect
  348. ? xiyue_pay_template.xiyue_pay_focus_img
  349. : xiyue_pay_template.xiyue_pay_unfocus_img
  350. "
  351. alt=""
  352. />
  353. </div>
  354. <div class="pay-wrap">
  355. <div class="pay-explain">
  356. 选择充值金额
  357. <span class="red">(1元=100书币)</span>
  358. </div>
  359. <ul class="pay-product">
  360. <template v-for="(v, i) in product">
  361. <v-touch
  362. :class="[
  363. 'pay-product__item',
  364. {
  365. 'is-active': i === selectedProduct,
  366. 'is-recommend': i === defaultProduct,
  367. 'is-first': i === cheaperProduct
  368. }
  369. ]"
  370. :key="v.product_id"
  371. @tap="selectProduct(i)"
  372. >
  373. <p class="pay-product__name">{{ v.price }}</p>
  374. <p class="pay-product__intro">{{ v.text }}</p>
  375. <p class="pay-product__intro cheaper-box" v-if="v.save_text">
  376. <span class="text" v-if="!v.is_year_order">省</span>
  377. <span class="text" v-else><i class="is_year"></i></span>
  378. <span>{{ v.save_text }}</span>
  379. </p>
  380. </v-touch>
  381. </template>
  382. </ul>
  383. </div>
  384. <div class="pay-btn-box">
  385. <div v-if="showHelpPay" class="help-pay__btn" @click="toHelpPay">
  386. 请好友代充
  387. </div>
  388. <div class="pay-btn" @click="payInXiYue">
  389. {{ xiyue_pay_btn_text }}
  390. </div>
  391. </div>
  392. <div class="reader-loading" v-show="loading">
  393. <mt-spinner
  394. class="reader-loading-icon"
  395. type="fading-circle"
  396. color="#32a1ff"
  397. ></mt-spinner>
  398. </div>
  399. </div>
  400. </template>
  401. <mt-popup v-model="popupVisible" position="bottom">
  402. <div class="pop-coupon" ref="couponList">
  403. <div class="coupon-list">
  404. <div class="coupon-item" v-for="coupon in availdCouponList">
  405. <p class="coupon-item__amount">
  406. <span>&yen;</span>{{ coupon.price }}
  407. </p>
  408. <div class="coupon-item__info">
  409. <div class="info-amount">
  410. <p class="title">大于{{ coupon.use_condition }}元可用</p>
  411. <p class="desc">
  412. {{
  413. coupon.expire_time && coupon.expire_time.slice(0, 16)
  414. }}到期
  415. </p>
  416. </div>
  417. <v-touch class="info-button" @tap="chooseCoupon(coupon)">
  418. 立即使用
  419. </v-touch>
  420. </div>
  421. </div>
  422. </div>
  423. </div>
  424. </mt-popup>
  425. </div>
  426. </template>
  427. <script>
  428. import { Pay, HelpPayQrcode } from "./namespace.js";
  429. // import product from "../mock/pay.js";
  430. import {
  431. getProductList,
  432. subscribeByRMB,
  433. recharge,
  434. getUserInfo,
  435. isMonthOrderSuc,
  436. getOrderCoupon
  437. } from "../api";
  438. import { PayForGift } from "../components/prompt";
  439. export default {
  440. name: Pay.name,
  441. data() {
  442. return {
  443. HelpPayQrcode: HelpPayQrcode.name,
  444. balance: "...",
  445. product: [],
  446. selectedProduct: 0,
  447. defaultProduct: null,
  448. cheaperProduct: null,
  449. prevRoute: null,
  450. loading: false,
  451. showTip: !!this.$route.query.code,
  452. showBookTip: this.$route.query.code == 10020, //全本提醒true,单本提醒false
  453. isFirstPay: this.$route.query.first_pay_tip,
  454. showHelpPay: window.options.showDaiChong,
  455. showChapterConsume: window.options.is_hide_chapter_consume,
  456. showAd_entry: false,
  457. is_iPhone: navigator.userAgent.indexOf("iPhone") !== -1,
  458. showPayYearBanner: window.options.outstanding_year_order,
  459. showSpecialPayTempalte: window.options.special_pay_template,
  460. year_item_bg: require("../assets/year_charge.png"),
  461. year_item_bg_check: require("../assets/year_charge_check.jpg"),
  462. mi_wan_year_bg: require("../assets/mi_wan_year.jpg"),
  463. mi_wan_year_bg_check: require("../assets/mi_wan_year_check.jpg"),
  464. month_order_bg: require("../assets/month_order_1.png"),
  465. month_order_bg_check: require("../assets/month_order_check.png"),
  466. show_month_order_entry: window.options.month_order_info,
  467. xiyue_pay_template: window.options.xiyue_info,
  468. isMonthOrder: false,
  469. isXYEntrySelect: false,
  470. xiyue_pay_btn_text: "立即充值",
  471. isCouponChecked: false,
  472. couponList: [],
  473. availdCouponList: [],
  474. popupVisible: false,
  475. currentCoupon: {
  476. id: "",
  477. price: 0
  478. }
  479. };
  480. },
  481. computed: {
  482. giftList() {
  483. const { product, selectedProduct } = this;
  484. return selectedProduct && product.length
  485. ? product[selectedProduct].gift
  486. : [];
  487. },
  488. giftPrice() {
  489. return this.giftList.reduce((a, b) => {
  490. return a + b.cost * b.num;
  491. }, 0);
  492. },
  493. chargePrice() {
  494. let select_pro = this.product[this.selectedProduct];
  495. let normal_value = select_pro ? select_pro.price : "0";
  496. let special_value = this.isMonthOrder
  497. ? this.show_month_order_entry.price
  498. : normal_value;
  499. return Number(special_value.replace("元", ""));
  500. }
  501. },
  502. methods: {
  503. changeCoupon() {
  504. if (this.availdCouponList.length <= 0) {
  505. this.$MessageBox.alert(
  506. "当前暂无可用优惠券,请检查充值额度是否满足优惠券使用条件,优惠券是否在有效期",
  507. "温馨提示"
  508. );
  509. return false;
  510. } else {
  511. this.popupVisible = true;
  512. this.$nextTick(() => {
  513. if (this.$refs.couponList) {
  514. this.$refs.couponList.scrollTop = 0;
  515. }
  516. });
  517. }
  518. },
  519. //选择优惠券
  520. chooseCoupon(coupon) {
  521. this.currentCoupon = coupon;
  522. this.popupVisible = false;
  523. this.isCouponChecked = true;
  524. },
  525. selectProduct(i) {
  526. this.selectedProduct = i;
  527. this.isMonthOrder = false;
  528. this.isXYEntrySelect = false;
  529. this.xiyue_pay_btn_text = "立即充值";
  530. this.getAvaildCoupon(
  531. Number(this.product[this.selectedProduct].price.replace("元", ""))
  532. );
  533. },
  534. pay() {
  535. if (this.isMonthOrder) {
  536. this.toMonthOrder();
  537. } else {
  538. recharge({
  539. product_id: this.product[this.selectedProduct].product_id,
  540. bid: this.$route.query.book_id,
  541. cid: this.$route.query.chapter_id,
  542. use_coupon: this.currentCoupon.id
  543. });
  544. }
  545. },
  546. payForYear() {
  547. let product_id = this.product[this.product.length - 1].product_id;
  548. recharge({
  549. product_id,
  550. bid: this.$route.query.book_id,
  551. cid: this.$route.query.chapter_id
  552. });
  553. },
  554. toHelpPay() {
  555. this.$router.push({
  556. name: this.HelpPayQrcode,
  557. query: { product_id: this.product[this.selectedProduct].product_id }
  558. });
  559. },
  560. toFreeAds() {
  561. window.location.href = `${window.location.origin +
  562. window.options.appad_url}`;
  563. },
  564. see() {
  565. PayForGift({ list: this.giftList });
  566. },
  567. calcGiftPrice(list) {
  568. return list.reduce((a, b) => {
  569. return a + b.cost * b.num;
  570. }, 0);
  571. },
  572. toMonthOrder() {
  573. const origin = window.location.origin;
  574. const href = window.location.href;
  575. // const r = origin + "/monthpay/wait?r=" + encodeURIComponent(href);
  576. location.href =
  577. this.show_month_order_entry.link +
  578. `&use_coupon=${this.currentCoupon.id}`;
  579. },
  580. chooseMonthOrder() {
  581. this.selectedProduct = null;
  582. this.isMonthOrder = true;
  583. this.defaultProduct = null;
  584. console.log("我被选中了");
  585. this.getAvaildCoupon(
  586. Number(window.options.month_order_info.price.replace("元", ""))
  587. );
  588. },
  589. //获取当前金额的可用优惠券
  590. getAvaildCoupon(price) {
  591. this.currentCoupon = { id: "", price: 0 };
  592. this.isCouponChecked = false;
  593. this.availdCouponList = this.couponList.filter(
  594. item => item.use_condition < price
  595. );
  596. },
  597. findMonthOrder() {
  598. this.$Indicator.open("查询订单中...请稍等");
  599. let time = 0;
  600. this.timer = setInterval(() => {
  601. if (time === 10) {
  602. this.$Indicator.close();
  603. window.clearInterval(this.timer);
  604. this.$Toast("订单可能延迟几分钟,稍后到个人中心查看或联系客服");
  605. return;
  606. }
  607. isMonthOrderSuc()
  608. .then(_ => {
  609. this.$Indicator.close();
  610. window.clearInterval(this.timer);
  611. this.$Toast("包月订购成功!");
  612. })
  613. .catch(e => {
  614. time++;
  615. console.log(e, "continue");
  616. });
  617. }, 1000);
  618. },
  619. chooseXiYueEntry() {
  620. this.selectedProduct = null;
  621. this.isXYEntrySelect = true;
  622. this.xiyue_pay_btn_text = "了解更多";
  623. },
  624. payInXiYue() {
  625. if (this.isXYEntrySelect) {
  626. location.href = this.xiyue_pay_template.xiyue_pay_page;
  627. } else {
  628. recharge({
  629. product_id: this.product[this.selectedProduct].product_id,
  630. bid: this.$route.query.book_id,
  631. cid: this.$route.query.chapter_id
  632. });
  633. }
  634. }
  635. },
  636. created() {
  637. this.loading = true;
  638. getOrderCoupon().then(r => {
  639. this.couponList = r;
  640. getProductList(this.$route.query.book_id).then(r => {
  641. this.product = r;
  642. this.showAd_entry = !!r[0].show_free_ads;
  643. this.loading = false;
  644. this.product_len = r.length;
  645. r.forEach((p, i) => {
  646. if (this.product_len === 6 && !this.is_iPhone && this.showAd_entry) {
  647. if (p.price === "100元") {
  648. this.product.splice(i, 1);
  649. i = i - 1;
  650. }
  651. }
  652. if (p.today_special) {
  653. this.defaultProduct = i;
  654. this.selectedProduct = i;
  655. this.getAvaildCoupon(Number(p.price.replace("元", "")));
  656. }
  657. if (p.first_charge) {
  658. this.cheaperProduct = i;
  659. }
  660. if (this.show_month_order_entry) {
  661. this.chooseMonthOrder();
  662. }
  663. if (this.xiyue_pay_template) {
  664. this.chooseXiYueEntry();
  665. }
  666. });
  667. });
  668. });
  669. getUserInfo().then(r => {
  670. this.balance = r.balance;
  671. });
  672. //用户优惠券
  673. // 是否包月回调
  674. const { from_wxpay } = this.$route.query;
  675. if (from_wxpay) this.findMonthOrder();
  676. }
  677. };
  678. </script>
  679. <style lang="scss">
  680. .pay-product {
  681. // margin-bottom: 2.3rem;
  682. }
  683. .pay-box__fixed {
  684. position: fixed;
  685. bottom: 0;
  686. left: 0;
  687. right: 0;
  688. height: 1.2rem;
  689. background: #fff;
  690. border-top: 1px solid #f7f7f7;
  691. padding: 0 0.24rem;
  692. overflow: hidden;
  693. display: flex;
  694. justify-content: space-between;
  695. align-items: center;
  696. z-index: 999;
  697. .help-pay__btn {
  698. width: 2.1rem;
  699. border-radius: 4px;
  700. border-color: #e6e6e6;
  701. color: #e6e6e6;
  702. height: 0.76rem;
  703. line-height: 0.76rem;
  704. margin-right: 0.26rem;
  705. margin-top: 0;
  706. font-size: 0.28rem;
  707. }
  708. .pay-btn {
  709. flex: 1;
  710. margin: 0;
  711. background: #ef5952;
  712. border-radius: 4px;
  713. border: 1px solid #ef5952;
  714. height: 0.76rem;
  715. line-height: 0.76rem;
  716. font-size: 0.28rem;
  717. font-weight: bold;
  718. box-shadow: none;
  719. }
  720. }
  721. .gift-fixed__wrap {
  722. position: fixed;
  723. bottom: 1.2rem;
  724. max-height: 1.1rem;
  725. left: 0;
  726. right: 0;
  727. background: #f7f7f7;
  728. padding: 0.22rem 0.24rem;
  729. .gift-title__text {
  730. color: #ef5952;
  731. font-size: 0.26rem;
  732. font-weight: bold;
  733. &.text-align {
  734. text-align: center;
  735. }
  736. }
  737. .gift-preview {
  738. font-size: 0.24rem;
  739. display: flex;
  740. justify-content: flex-start;
  741. align-items: center;
  742. // overflow: auto;
  743. // -webkit-overflow-scrolling: touch;
  744. .title {
  745. flex-basis: 2rem;
  746. flex-shrink: 0;
  747. white-space: nowrap;
  748. color: #333;
  749. }
  750. .preview-wrap {
  751. flex: 1;
  752. display: flex;
  753. overflow: auto;
  754. -webkit-overflow-scrolling: touch;
  755. &::-webkit-scrollbar {
  756. display: none;
  757. }
  758. }
  759. .gift-preview__item {
  760. font-size: 0;
  761. flex-shrink: 0;
  762. white-space: nowrap;
  763. display: flex;
  764. i {
  765. font-size: 0.22rem;
  766. color: #666;
  767. font-style: normal;
  768. }
  769. &:not(:last-child) {
  770. margin-right: 0.18rem;
  771. }
  772. }
  773. img {
  774. width: 0.34rem;
  775. height: 0.34rem;
  776. }
  777. }
  778. }
  779. </style>