index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898
  1. <template>
  2. <view class="page" v-if="payPriceShow">
  3. <view class="pay-price">
  4. <view class="price">
  5. <text class="unit">{{$t(`¥`)}}</text>
  6. <numberScroll :num='payPriceShow' color="#E93323" width='30' height='50' fontSize='50'></numberScroll>
  7. </view>
  8. <view class="count-down">
  9. {{$t(`支付剩余时间`)}}:
  10. <countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '" :minute-text="' : '"
  11. :second-text="' '" :datatime="invalidTime"></countDown>
  12. </view>
  13. </view>
  14. <view class="payment">
  15. <view class="title">
  16. {{$t(`支付方式`)}}
  17. </view>
  18. <view class="item acea-row row-between-wrapper" v-for="(item,index) in cartArr" :key="index"
  19. v-show='item.payStatus' @click="payType(item.number || 0, item.value, index)">
  20. <view class="left acea-row row-between-wrapper">
  21. <view class="iconfont" :class="item.icon"></view>
  22. <view class="text">
  23. <view class="name">{{$t(item.name)}}</view>
  24. <view class="info" v-if="item.value == 'yue'">
  25. {{$t(item.title)}} <span class="money">{{$t(`¥`)}}{{ item.number }}</span>
  26. </view>
  27. <view class="info" v-else>{{$t(item.title)}}</view>
  28. </view>
  29. </view>
  30. <view class="iconfont" :class="active==index?'icon-xuanzhong11 font-num':'icon-weixuan'"></view>
  31. </view>
  32. </view>
  33. <view class="btn">
  34. <view class="button acea-row row-center-wrapper" @click='goPay(number, paytype)'>{{$t(`确认支付`)}}</view>
  35. <view class="wait-pay" @click="waitPay">{{$t(`暂不支付`)}}</view>
  36. </view>
  37. <view v-show="false" v-html="formContent"></view>
  38. </view>
  39. </template>
  40. <script>
  41. import countDown from '@/components/countDown';
  42. import numberScroll from '@/components/numberScroll.vue'
  43. import {
  44. getCashierOrder,
  45. orderPay
  46. } from '@/api/order.js';
  47. import {
  48. basicConfig
  49. } from '@/api/public.js'
  50. import {
  51. piPay,
  52. piPaySuccess,
  53. piPayReadSuccess,
  54. piPayCancel
  55. } from '@/api/pi.js'
  56. //初始化
  57. Pi.init({
  58. version: "2.0"
  59. // ,sandbox: true
  60. })
  61. export default {
  62. components: {
  63. countDown,
  64. numberScroll
  65. },
  66. data() {
  67. return {
  68. checked: false,
  69. datatime: 1676344056,
  70. //支付方式
  71. cartArr: [{
  72. "name": this.$t(`微信支付`),
  73. "icon": "icon-weixin2",
  74. value: 'weixin',
  75. title: this.$t(`使用微信快捷支付`),
  76. payStatus: 1,
  77. },
  78. {
  79. "name": this.$t(`支付宝支付`),
  80. "icon": "icon-zhifubao",
  81. value: 'alipay',
  82. title: this.$t(`使用支付宝支付`),
  83. payStatus: 1,
  84. },
  85. {
  86. "name": this.$t(`余额支付`),
  87. "icon": "icon-yuezhifu",
  88. value: 'yue',
  89. title: this.$t(`可用余额`),
  90. payStatus: 1,
  91. },
  92. {
  93. "name": this.$t(`线下支付`),
  94. "icon": "icon-yuezhifu1",
  95. value: 'offline',
  96. title: this.$t(`使用线下付款`),
  97. payStatus: 2,
  98. }, {
  99. "name": this.$t(`好友代付`),
  100. "icon": "icon-haoyoudaizhifu",
  101. value: 'friend',
  102. title: this.$t(`找微信好友支付`),
  103. payStatus: 1,
  104. },
  105. {
  106. "name": this.$t(`PI支付`),
  107. "icon": "icon-haoyoudaizhifu",
  108. value: 'piPay',
  109. title: this.$t(`使用pi支付`),
  110. payStatus: 1,
  111. }
  112. ],
  113. orderId: 0,
  114. fromType: '',
  115. active: 0,
  116. payPrice: 0,
  117. payPriceShow: 0,
  118. payPostage: 0,
  119. offlinePostage: false,
  120. invalidTime: 0,
  121. initIn: false,
  122. jumpData: {
  123. orderId: '',
  124. msg: ''
  125. },
  126. formContent: ''
  127. }
  128. },
  129. watch: {
  130. cartArr: {
  131. handler(newV, oldValue) {
  132. let newPayList = [];
  133. newV.forEach((item, index) => {
  134. if (item.payStatus) {
  135. item.index = index;
  136. newPayList.push(item)
  137. }
  138. });
  139. this.active = newPayList[0].index;
  140. this.paytype = newPayList[0].value;
  141. this.number = newPayList[0].number || 0;
  142. },
  143. immediate: true,
  144. deep: true
  145. }
  146. },
  147. onLoad(options) {
  148. if (options.order_id) this.orderId = options.order_id
  149. if (options.from_type) this.fromType = options.from_type
  150. this.getBasicConfig()
  151. },
  152. onShow() {
  153. let options = wx.getEnterOptionsSync();
  154. console.log(options)
  155. if (options.scene == '1038' && options.referrerInfo.appId == 'wxef277996acc166c3' && this.initIn) {
  156. // 代表从收银台小程序返回
  157. let extraData = options.referrerInfo.extraData;
  158. this.initIn = false
  159. if (!extraData) {
  160. // "当前通过物理按键返回,未接收到返参,建议自行查询交易结果";
  161. this.$util.Tips({
  162. title: this.$t(`取消支付`)
  163. }, {
  164. tab: 5,
  165. url: `/pages/goods/order_pay_status/index?order_id=${this.orderId}&msg=${this.$t(`取消支付`)}&type=3&totalPrice=${this.payPriceShow}&status=2`
  166. });
  167. } else {
  168. if (extraData.code == 'success') {
  169. this.$util.Tips({
  170. title: this.$t(`支付成功`),
  171. icon: 'success'
  172. }, {
  173. tab: 5,
  174. url: `/pages/goods/order_pay_status/index?order_id=${this.orderId}&msg=${this.jumpData.msg}&type=3&totalPrice=${this.payPriceShow}`
  175. });
  176. } else if (extraData.code == 'cancel') {
  177. // "支付已取消";
  178. this.$util.Tips({
  179. title: this.$t(`取消支付`)
  180. }, {
  181. tab: 5,
  182. url: `/pages/goods/order_pay_status/index?order_id=${this.orderId}&msg=${this.$t(`取消支付`)}&type=3&totalPrice=${this.payPriceShow}&status=2`
  183. });
  184. } else {
  185. // "支付失败:" + extraData.errmsg;
  186. uni.reLaunch({
  187. url: `/pages/goods/order_pay_status/index?order_id=${this.orderId}&msg=${this.$t(`支付失败`)}&totalPrice=${this.payPriceShow}`
  188. })
  189. }
  190. }
  191. }
  192. },
  193. methods: {
  194. getBasicConfig() {
  195. basicConfig().then(res => {
  196. //微信支付是否开启
  197. this.cartArr[0].payStatus = res.data.pay_weixin_open || 0
  198. //支付宝是否开启
  199. this.cartArr[1].payStatus = res.data.ali_pay_status || 0;
  200. //#ifdef MP
  201. this.cartArr[1].payStatus = 0;
  202. //#endif
  203. //余额支付是否开启
  204. this.cartArr[2].payStatus = res.data.yue_pay_status
  205. if (res.data.offline_pay_status) {
  206. this.cartArr[3].payStatus = 1
  207. } else {
  208. this.cartArr[3].payStatus = 0
  209. }
  210. //好友代付是否开启
  211. this.cartArr[4].payStatus = res.data.friend_pay_status || 0;
  212. this.getCashierOrder()
  213. }).catch(err => {
  214. uni.hideLoading();
  215. return this.$util.Tips({
  216. title: err
  217. })
  218. })
  219. },
  220. getCashierOrder() {
  221. uni.showLoading({
  222. title: this.$t(`创建订单中`)
  223. });
  224. getCashierOrder(this.orderId, this.fromType).then(res => {
  225. console.log(res)
  226. this.payPrice = this.payPriceShow = res.data.pay_price
  227. this.payPostage = res.data.pay_postage
  228. this.offlinePostage = res.data.offline_postage
  229. this.invalidTime = res.data.invalid_time
  230. this.cartArr[2].number = res.data.now_money;
  231. uni.hideLoading();
  232. }).catch(err => {
  233. uni.hideLoading();
  234. return this.$util.Tips({
  235. title: err
  236. })
  237. })
  238. },
  239. payType(number, paytype, index) {
  240. this.active = index;
  241. this.paytype = paytype;
  242. this.number = number;
  243. if (this.offlinePostage) {
  244. if (paytype == 'offline') {
  245. this.payPriceShow = this.$util.$h.Sub(this.payPrice, this.payPostage);
  246. } else {
  247. this.payPriceShow = this.payPrice;
  248. }
  249. }
  250. },
  251. formpost(url, postData) {
  252. let tempform = document.createElement("form");
  253. tempform.action = url;
  254. tempform.method = "post";
  255. tempform.target = "_self";
  256. tempform.style.display = "none";
  257. for (let x in postData) {
  258. let opt = document.createElement("input");
  259. opt.name = x;
  260. opt.value = postData[x];
  261. tempform.appendChild(opt);
  262. }
  263. document.body.appendChild(tempform);
  264. this.$nextTick(e => {
  265. tempform.submit();
  266. })
  267. },
  268. waitPay() {
  269. uni.reLaunch({
  270. url: '/pages/goods/order_pay_status/index?order_id=' + this.orderId + '&msg=取消支付&type=3' +
  271. '&status=2&totalPrice=' + this.payPriceShow
  272. })
  273. },
  274. goPay(number, paytype) {
  275. let that = this;
  276. if (!that.orderId) return that.$util.Tips({
  277. title: that.$t(`请选择要支付的订单`)
  278. });
  279. if (paytype == 'yue' && parseFloat(number) < parseFloat(that.payPriceShow)) return that.$util.Tips({
  280. title: that.$t(`余额不足`)
  281. });
  282. uni.showLoading({
  283. title: that.$t(`支付中`)
  284. });
  285. if (paytype == 'friend' && that.orderId) {
  286. uni.hideLoading();
  287. return uni.navigateTo({
  288. url: '/pages/users/payment_on_behalf/index?order_id=' + that.orderId + '&spread=' +
  289. that.$store.state.app.uid,
  290. success: res => {},
  291. fail: () => {},
  292. complete: () => {}
  293. });
  294. }
  295. if (paytype == 'piPay') {
  296. // Authenticate the user, and get permission to request payments from them:
  297. const scopes = ['payments'];
  298. Pi.authenticate(scopes, (payment) => {
  299. return piPayReadSuccess({
  300. payment
  301. }).then((res) => {}).catch((res) => {
  302. uni.showModal({
  303. title: '错误can',
  304. content: res,
  305. showCancel: false,
  306. success: res => {},
  307. fail: () => {},
  308. complete: () => {}
  309. });
  310. })
  311. }).then(function(auth) {
  312. // window.alert('成功auth' + auth)
  313. Pi.createPayment({
  314. // 支付金额
  315. amount: 0.0001,
  316. // 支付说明
  317. memo: "请求支付", // e.g: "Digital kitten #1234",
  318. // 用于保存自己要用的数据,后台查询时可获取到
  319. metadata: {
  320. tip: '我来支付了'
  321. }, // e.g: { kittenId: 1234 }
  322. }, {
  323. // 请求支付调用
  324. onReadyForServerApproval: function(paymentId) {
  325. // 请求服务器授权允许支付
  326. piPay({
  327. paymentId
  328. }).then((res) => {
  329. // window.alert('成功'+res)
  330. }).catch((res) => {
  331. uni.showModal({
  332. title: '错误pia',
  333. content: res,
  334. showCancel: false,
  335. success: res => {},
  336. fail: () => {},
  337. complete: () => {}
  338. });
  339. })
  340. },
  341. // 请求服务器端支付确认
  342. onReadyForServerCompletion: function(paymentId, txid) {
  343. piPaySuccess({
  344. paymentId,
  345. txid
  346. }).then((res) => {}).catch((res) => {
  347. uni.showModal({
  348. title: '错误read',
  349. content: res,
  350. showCancel: false,
  351. success: res => {},
  352. fail: () => {},
  353. complete: () => {}
  354. });
  355. })
  356. },
  357. onCancel: function(paymentId) {
  358. piPayCancel({
  359. paymentId
  360. }).then((res) => {
  361. // window.alert('成功'+res)
  362. }).catch((res) => {
  363. // window.alert('错误can'+res)
  364. })
  365. },
  366. onError: function(error, payment) {
  367. uni.showModal({
  368. title: '错误',
  369. content: error + (payment ? JSON.stringify(payment) : ''),
  370. showCancel: false,
  371. success: res => {},
  372. fail: () => {},
  373. complete: () => {}
  374. });
  375. },
  376. });
  377. }).catch(function(error) {
  378. uni.showModal({
  379. title: '错误',
  380. content: error,
  381. showCancel: false,
  382. success: res => {},
  383. fail: () => {},
  384. complete: () => {}
  385. });
  386. });
  387. return
  388. }
  389. orderPay({
  390. uni: that.orderId,
  391. paytype: paytype,
  392. type: that.friendPay ? 1 : 0,
  393. // #ifdef H5
  394. quitUrl: location.port ? location.protocol + '//' + location.hostname + ':' + location
  395. .port +
  396. '/pages/goods/order_details/index?order_id=' + this.orderId : location.protocol +
  397. '//' + location.hostname +
  398. '/pages/goods/order_details/index?order_id=' + this.orderId
  399. // #endif
  400. // #ifdef APP-PLUS
  401. quitUrl: '/pages/goods/order_details/index?order_id=' + this.orderId
  402. // #endif
  403. }).then(res => {
  404. let status = res.data.status,
  405. orderId = res.data.result.orderId,
  406. jsConfig = res.data.result.jsConfig,
  407. goPages = '/pages/goods/order_pay_status/index?order_id=' + this.orderId + '&msg=' +
  408. res
  409. .msg +
  410. '&type=3' + '&totalPrice=' + this.payPriceShow,
  411. friendPay = '/pages/users/payment_on_behalf/index?order_id=' + this.orderId +
  412. '&spread=' +
  413. this
  414. .$store.state.app.uid
  415. switch (status) {
  416. case 'ORDER_EXIST':
  417. case 'EXTEND_ORDER':
  418. uni.hideLoading();
  419. return that.$util.Tips({
  420. title: res.msg
  421. }, {
  422. tab: 5,
  423. url: goPages
  424. });
  425. case 'ALLINPAY_PAY':
  426. uni.hideLoading();
  427. // #ifdef MP
  428. this.initIn = true
  429. wx.openEmbeddedMiniProgram({
  430. appId: 'wxef277996acc166c3',
  431. extraData: {
  432. cusid: jsConfig.cusid,
  433. appid: jsConfig.appid,
  434. version: jsConfig.version,
  435. trxamt: jsConfig.trxamt,
  436. reqsn: jsConfig.reqsn,
  437. notify_url: jsConfig.notify_url,
  438. body: jsConfig.body,
  439. remark: jsConfig.remark,
  440. validtime: jsConfig.validtime,
  441. randomstr: jsConfig.randomstr,
  442. paytype: jsConfig.paytype,
  443. sign: jsConfig.sign,
  444. signtype: jsConfig.signtype
  445. }
  446. })
  447. this.jumpData = {
  448. orderId: res.data.result.orderId,
  449. msg: res.msg,
  450. }
  451. // #endif
  452. // #ifdef APP-PLUS
  453. plus.runtime.openURL(jsConfig.payinfo);
  454. setTimeout(e => {
  455. uni.reLaunch({
  456. url: goPages
  457. })
  458. }, 1000)
  459. // #endif
  460. // #ifdef H5
  461. this.formpost(res.data.result.pay_url, jsConfig)
  462. // #endif
  463. break;
  464. case 'PAY_ERROR':
  465. uni.hideLoading();
  466. return that.$util.Tips({
  467. title: res.msg
  468. }, {
  469. tab: 5,
  470. url: goPages
  471. });
  472. break;
  473. case 'SUCCESS':
  474. uni.hideLoading();
  475. if (paytype !== 'friend') {
  476. return that.$util.Tips({
  477. title: res.msg,
  478. icon: 'success'
  479. }, {
  480. tab: 4,
  481. url: goPages
  482. });
  483. } else {
  484. return that.$util.Tips({
  485. title: res.msg,
  486. icon: 'success'
  487. }, {
  488. tab: 4,
  489. url: friendPay
  490. });
  491. }
  492. break;
  493. case 'WECHAT_PAY':
  494. that.toPay = true;
  495. // #ifdef MP
  496. /* that.toPay = true; */
  497. let mp_pay_name = ''
  498. if (uni.requestOrderPayment) {
  499. mp_pay_name = 'requestOrderPayment'
  500. } else {
  501. mp_pay_name = 'requestPayment'
  502. }
  503. uni[mp_pay_name]({
  504. timeStamp: jsConfig.timestamp,
  505. nonceStr: jsConfig.nonceStr,
  506. package: jsConfig.package,
  507. signType: jsConfig.signType,
  508. paySign: jsConfig.paySign,
  509. success: function(res) {
  510. uni.hideLoading();
  511. if (that.BargainId || that.combinationId || that.pinkId ||
  512. that
  513. .seckillId || that.discountId)
  514. return that.$util.Tips({
  515. title: that.$t(`支付成功`),
  516. icon: 'success'
  517. }, {
  518. tab: 4,
  519. url: goPages
  520. });
  521. return that.$util.Tips({
  522. title: that.$t(`支付成功`),
  523. icon: 'success'
  524. }, {
  525. tab: 5,
  526. url: goPages
  527. });
  528. },
  529. fail: function(e) {
  530. uni.hideLoading();
  531. return that.$util.Tips({
  532. title: that.$t(`取消支付`)
  533. }, {
  534. tab: 5,
  535. url: goPages + '&status=2'
  536. });
  537. },
  538. complete: function(e) {
  539. uni.hideLoading();
  540. //关闭当前页面跳转至订单状态
  541. if (res.errMsg == 'requestPayment:cancel' || e.errMsg ==
  542. 'requestOrderPayment:cancel') return that.$util
  543. .Tips({
  544. title: that.$t(`取消支付`)
  545. }, {
  546. tab: 5,
  547. url: goPages + '&status=2'
  548. });
  549. },
  550. })
  551. // #endif
  552. // #ifdef H5
  553. this.$wechat.pay(res.data.result.jsConfig).then(res => {
  554. return that.$util.Tips({
  555. title: that.$t(`支付成功`),
  556. icon: 'success'
  557. }, {
  558. tab: 5,
  559. url: goPages
  560. });
  561. }).catch(res => {
  562. if (!this.$wechat.isWeixin()) {
  563. uni.redirectTo({
  564. url: goPages + '&msg=' + that.$t(`支付失败`) +
  565. '&status=2'
  566. // '&msg=支付失败&status=2'
  567. })
  568. }
  569. if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
  570. title: that.$t(`取消支付`)
  571. }, {
  572. tab: 5,
  573. url: goPages + '&status=2'
  574. });
  575. })
  576. // #endif
  577. // #ifdef APP-PLUS
  578. uni.requestPayment({
  579. provider: 'wxpay',
  580. orderInfo: jsConfig,
  581. success: (e) => {
  582. let url = goPages;
  583. uni.showToast({
  584. title: that.$t(`支付成功`)
  585. })
  586. setTimeout(res => {
  587. uni.redirectTo({
  588. url: url
  589. })
  590. }, 2000)
  591. },
  592. fail: (e) => {
  593. let url = '/pages/goods/order_pay_status/index?order_id=' +
  594. orderId +
  595. '&msg=' + that.$t(`支付失败`);
  596. uni.showModal({
  597. content: that.$t(`支付失败`),
  598. showCancel: false,
  599. success: function(res) {
  600. if (res.confirm) {
  601. uni.redirectTo({
  602. url: url
  603. })
  604. } else if (res.cancel) {}
  605. }
  606. })
  607. },
  608. complete: () => {
  609. uni.hideLoading();
  610. },
  611. });
  612. // #endif
  613. break;
  614. case 'PAY_DEFICIENCY':
  615. uni.hideLoading();
  616. //余额不足
  617. return that.$util.Tips({
  618. title: res.msg
  619. }, {
  620. tab: 5,
  621. url: goPages + '&status=1'
  622. });
  623. break;
  624. case "WECHAT_H5_PAY":
  625. uni.hideLoading();
  626. that.$util.Tips({
  627. title: that.$t(`等待支付中`)
  628. }, {
  629. tab: 4,
  630. url: goPages + '&status=0'
  631. });
  632. setTimeout(() => {
  633. location.href = res.data.result.jsConfig.h5_url;
  634. }, 1500);
  635. break;
  636. case 'ALIPAY_PAY':
  637. //#ifdef H5
  638. uni.hideLoading();
  639. that.$util.Tips({
  640. title: that.$t(`等待支付中`)
  641. }, {
  642. tab: 4,
  643. url: goPages + '&status=0'
  644. });
  645. that.formContent = res.data.result.jsConfig;
  646. setTimeout(() => {
  647. document.getElementById('alipaysubmit').submit();
  648. }, 1500);
  649. //#endif
  650. // #ifdef MP
  651. uni.navigateTo({
  652. url: `/pages/users/alipay_invoke/index?id=${orderId}&link=${jsConfig.qrCode}`
  653. });
  654. // #endif
  655. // #ifdef APP-PLUS
  656. uni.requestPayment({
  657. provider: 'alipay',
  658. orderInfo: jsConfig,
  659. success: (e) => {
  660. uni.showToast({
  661. title: that.$t(`支付成功`)
  662. })
  663. let url = '/pages/goods/order_pay_status/index?order_id=' +
  664. orderId +
  665. '&msg=' + that.$t(`支付成功`);
  666. setTimeout(res => {
  667. uni.redirectTo({
  668. url: url
  669. })
  670. }, 2000)
  671. },
  672. fail: (e) => {
  673. let url = '/pages/goods/order_pay_status/index?order_id=' +
  674. orderId +
  675. '&msg=' + that.$t(`支付失败`);
  676. uni.showModal({
  677. content: that.$t(`支付失败`),
  678. showCancel: false,
  679. success: function(res) {
  680. if (res.confirm) {
  681. uni.redirectTo({
  682. url: url
  683. })
  684. } else if (res.cancel) {}
  685. }
  686. })
  687. },
  688. complete: () => {
  689. uni.hideLoading();
  690. },
  691. });
  692. // #endif
  693. break;
  694. }
  695. }).catch(err => {
  696. uni.hideLoading();
  697. return that.$util.Tips({
  698. title: err
  699. }, () => {
  700. that.$emit('onChangeFun', {
  701. action: 'pay_fail'
  702. });
  703. });
  704. })
  705. }
  706. }
  707. }
  708. </script>
  709. <style lang="scss" scoped>
  710. .page {
  711. padding-bottom: 200rpx;
  712. .pay-price {
  713. display: flex;
  714. justify-content: center;
  715. flex-direction: column;
  716. align-items: center;
  717. padding: 50rpx 0 40rpx 0;
  718. .price {
  719. color: #E93323;
  720. margin-bottom: 20rpx;
  721. display: flex;
  722. align-items: flex-end;
  723. .unit {
  724. font-size: 34rpx;
  725. font-weight: 500;
  726. line-height: 41rpx;
  727. }
  728. .num {
  729. font-size: 50rpx;
  730. font-weight: 600;
  731. }
  732. }
  733. .count-down {
  734. display: flex;
  735. align-items: center;
  736. background-color: #fff;
  737. padding: 8rpx 28rpx;
  738. border-radius: 40rpx;
  739. font-size: 24rpx;
  740. color: #E93323;
  741. .time {
  742. margin-top: 0 !important;
  743. }
  744. /deep/.red {
  745. margin: 0 !important;
  746. }
  747. }
  748. }
  749. .payment {
  750. width: 690rpx;
  751. border-radius: 14rpx 14rpx;
  752. background-color: #fff;
  753. z-index: 999;
  754. margin: 0 30rpx;
  755. .title {
  756. color: #666666;
  757. font-size: 26rpx;
  758. padding: 30rpx 0 0 30rpx;
  759. }
  760. .payMoney {
  761. font-size: 28rpx;
  762. color: #333333;
  763. text-align: center;
  764. margin-top: 50rpx;
  765. .font-color {
  766. margin-left: 10rpx;
  767. .money {
  768. font-size: 40rpx;
  769. }
  770. }
  771. }
  772. }
  773. .payment.on {
  774. transform: translate3d(0, 0, 0);
  775. }
  776. .icon-xuanzhong11 {
  777. color: #E93323 !important;
  778. }
  779. .payment .item {
  780. border-bottom: 1rpx solid #eee;
  781. height: 130rpx;
  782. margin-left: 30rpx;
  783. padding-right: 30rpx;
  784. }
  785. .payment .item:last-child {
  786. border-bottom: none;
  787. }
  788. .payment .item .left {
  789. flex: 1;
  790. }
  791. .payment .item .left .text {
  792. flex: 1;
  793. }
  794. .payment .item .left .text .name {
  795. font-size: 30rpx;
  796. color: #333;
  797. }
  798. .payment .item .left .text .info {
  799. font-size: 22rpx;
  800. color: #999;
  801. }
  802. .payment .item .left .text .info .money {
  803. color: #ff9900;
  804. }
  805. .payment .item .left .iconfont {
  806. font-size: 50rpx;
  807. color: #09bb07;
  808. margin-right: 28rpx;
  809. }
  810. .payment .item .left .iconfont.icon-zhifubao {
  811. color: #00aaea;
  812. }
  813. .payment .item .left .iconfont.icon-yuezhifu {
  814. color: #ff9900;
  815. }
  816. .payment .item .left .iconfont.icon-yuezhifu1 {
  817. color: #eb6623;
  818. }
  819. .payment .item .left .iconfont.icon-tonglianzhifu1 {
  820. color: #305fd8;
  821. }
  822. .payment .item .iconfont {
  823. font-size: 40rpx;
  824. color: #ccc;
  825. }
  826. .icon-haoyoudaizhifu {
  827. color: #F34C3E !important;
  828. }
  829. .btn {
  830. position: fixed;
  831. left: 30rpx;
  832. display: flex;
  833. flex-direction: column;
  834. align-items: center;
  835. bottom: 30rpx;
  836. bottom: calc(30rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  837. bottom: calc(30rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  838. }
  839. .wait-pay {
  840. color: #aaa;
  841. font-size: 24rpx;
  842. padding-top: 20rpx;
  843. }
  844. .button {
  845. width: 690rpx;
  846. height: 90rpx;
  847. border-radius: 45rpx;
  848. color: #FFFFFF;
  849. background-color: #E93323;
  850. }
  851. }
  852. </style>