order-payunder.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. <template>
  2. <view class="container cashier">
  3. <tui-skeleton
  4. v-if="skeletonShow"
  5. backgroundColor="#fafafa"
  6. borderRadius="10rpx"
  7. :isLoading="true"
  8. :loadingType="5"
  9. />
  10. <view class="container-cash clearfix" v-else>
  11. <view class="pay-bring-title" v-if="onlinePay == 2">{{ payBringTitle }}</view>
  12. <view class="container-wrapper">
  13. <view class="pay-content">
  14. <view class="pay-p"><text>待付金额</text></view>
  15. <view class="pay-money">
  16. <text class="pay-sm">¥</text> <text class="pay-bg">{{ payableAmount | NumFormat }}</text>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="pay-bring-wrapper clearfix">
  21. <view class="pay-bring-content">
  22. <view class="text-title">
  23. <image
  24. src="https://static.caimei365.com/app/img/icon/icon-vxkecode.png"
  25. mode=""
  26. @click="previewImg"
  27. ></image>
  28. </view>
  29. <view class="text-v"
  30. >订单标识:{{ payOrderId }}
  31. <text class="clipboard" @click.stop="clipboard(payOrderId)">复制</text></view
  32. >
  33. <view class="text-content"
  34. >请点击上方二维码,长按保存后,使用微信扫码添加采美客服,将订单标识告知客服,客服会为您推荐最合适的线下转账方式。</view
  35. >
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. const thorui = require('@/components/clipboard/clipboard.thorui.js')
  43. import bankMixins from '@/mixins/bankMixins.js'
  44. export default {
  45. mixins: [bankMixins],
  46. data() {
  47. return {
  48. orderId: '',
  49. payableAmount: 0,
  50. emptyWrapperH: '',
  51. bankNumber: '6230 2100 9221 2400',
  52. payOrderId: '',
  53. isIphoneX: this.$store.state.isIphoneX,
  54. CustomBar: this.CustomBar, // 顶部导航栏高度
  55. tabCurrentIndex: 0,
  56. isReceiptStatus: false,
  57. buttonText: '使用微信支付',
  58. btnColor: '#09BB07',
  59. receiptStatus: '',
  60. onlinePay: 1,
  61. optionType: '',
  62. onlinePayFlag: '',
  63. payBringTitle: '本次交易暂不支持线上支付,请使用线下转账方式付款',
  64. payStatusText: '使用任何一种线上支付方式支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。',
  65. pageType: '',
  66. skeletonShow: true,
  67. productImage: ['https://static.caimei365.com/app/img/icon/icon-vxkecode.png']
  68. }
  69. },
  70. onLoad(option) {
  71. this.initData(option)
  72. },
  73. filters: {
  74. NumFormat(value) {
  75. if (!value) return '0.00'
  76. /*原来用的是Number(value).toFixed(0),这样取整时有问题,例如0.51取整之后为1,感谢Nils指正*/
  77. /*后来改成了 Number(value)|0,但是输入超过十一位就为负数了,具体见评论 */
  78. var intPart = Number(value) - (Number(value) % 1) //获取整数部分(这里是windy93的方法)
  79. var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') //将整数部分逢三一断
  80. var floatPart = '.00' //预定义小数部分
  81. var value2Array = value.toString().split('.')
  82. //=2表示数据有小数位
  83. if (value2Array.length == 2) {
  84. floatPart = value2Array[1].toString() //拿到小数部分
  85. if (floatPart.length == 1) {
  86. //补0,实际上用不着
  87. return intPartFormat + '.' + floatPart + '0'
  88. } else {
  89. return intPartFormat + '.' + floatPart
  90. }
  91. } else {
  92. return intPartFormat + floatPart
  93. }
  94. }
  95. },
  96. methods: {
  97. initData(e) {
  98. console.log(e)
  99. this.shopOrderId = e.shopOrderId
  100. this.payOrderId = '#' + e.shopOrderId + '#'
  101. this.cmGetBankTypeLists()
  102. this.PayOrderCheckoutCounter(this.shopOrderId)
  103. },
  104. PayOrderCheckoutCounter(shopOrderId) {
  105. this.PayService.PayOrderCheckoutCounter({ shopOrderId: shopOrderId })
  106. .then(response => {
  107. let data = response.data.order
  108. this.payableAmount = data.payableAmount - data.receiptAmount //待付金额
  109. this.receiptStatus = data.receiptStatus
  110. this.onlinePayFlag = data.onlinePayFlag
  111. //判断线上线下显示
  112. if (this.optionType == 'onlinePay') {
  113. this.onlinePay = 2
  114. } else {
  115. this.onlinePay = response.data.onlinePay
  116. }
  117. setTimeout(() => {
  118. this.skeletonShow = false
  119. }, 500)
  120. })
  121. .catch(error => {
  122. this.$util.msg(error.msg, 2000)
  123. })
  124. },
  125. clipboard(data) {
  126. thorui.getClipboardData(data, res => {
  127. if (res) {
  128. this.$util.msg('复制成功', 2000, true, 'success')
  129. } else {
  130. this.$util.msg('复制失败', 2000, true, 'none')
  131. }
  132. })
  133. },
  134. previewImg(index) {
  135. //顶部商品图片预览
  136. let previewUrls = this.productImage
  137. uni.previewImage({
  138. current: 0, //图片索引
  139. urls: previewUrls, //必须是http图片,本地图片无效
  140. longPressActions: ''
  141. })
  142. }
  143. },
  144. onShow() {}
  145. }
  146. </script>
  147. <style lang="scss">
  148. page {
  149. height: auto !important;
  150. background-color: #ffffff;
  151. }
  152. .container-cash {
  153. width: 100%;
  154. padding-bottom: 250rpx;
  155. .pay-bring-title {
  156. box-sizing: border-box;
  157. width: 100%;
  158. min-height: 96rpx;
  159. padding: 20rpx 24rpx;
  160. line-height: 48rpx;
  161. text-align: left;
  162. font-size: $font-size-24;
  163. background: rgba(255, 234, 221, 1);
  164. color: $color-system;
  165. }
  166. .container-wrapper {
  167. width: 662rpx;
  168. margin: 0 auto;
  169. .pay-title {
  170. font-size: $font-size-32;
  171. line-height: 44rpx;
  172. text-align: center;
  173. color: #2a86ff;
  174. margin: 40rpx 0 0 0;
  175. width: 100%;
  176. float: left;
  177. }
  178. .pay-content {
  179. width: 574rpx;
  180. height: 136rpx;
  181. padding: 52rpx 44rpx;
  182. background: url(https://static.caimei365.com/app/img/icon/icon-paybg.png) no-repeat;
  183. background-size: cover;
  184. float: left;
  185. margin-top: 40rpx;
  186. .pay-p {
  187. font-size: $font-size-26;
  188. color: #ffffff;
  189. line-height: 36rpx;
  190. }
  191. .pay-money {
  192. color: #ffffff;
  193. line-height: 84rpx;
  194. font-weight: bold;
  195. .pay-sm {
  196. font-size: $font-size-26;
  197. }
  198. .pay-bg {
  199. font-size: 50rpx;
  200. }
  201. }
  202. }
  203. .pay-check {
  204. width: 100%;
  205. height: auto;
  206. float: left;
  207. .check-title {
  208. width: 622rpx;
  209. height: 40rpx;
  210. line-height: 40rpx;
  211. padding: 0 20rpx;
  212. margin-top: 24rpx;
  213. .text {
  214. font-size: $font-size-28;
  215. color: $text-color;
  216. text-align: left;
  217. float: left;
  218. }
  219. .icon {
  220. width: 40rpx;
  221. height: 40rpx;
  222. border-radius: 50%;
  223. line-height: 40rpx;
  224. text-align: center;
  225. color: #ffffff;
  226. font-size: $font-size-24;
  227. background: radial-gradient(
  228. circle,
  229. rgba(225, 86, 22, 1) 0%,
  230. rgba(255, 170, 0, 1) 67%,
  231. rgba(249, 185, 156, 1) 100%
  232. );
  233. float: right;
  234. }
  235. }
  236. .pay-checked {
  237. width: 100%;
  238. height: auto;
  239. .pay-item {
  240. width: 618rpx;
  241. height: 96rpx;
  242. border: 2px solid #f5f5f5;
  243. border-radius: 30rpx;
  244. padding: 20rpx;
  245. margin: 24rpx 0;
  246. display: flex;
  247. background-color: #ffffff;
  248. &.current {
  249. border-color: $color-system;
  250. .item-r {
  251. .icon-duigou {
  252. color: $color-system;
  253. }
  254. }
  255. }
  256. .item-l {
  257. flex: 8;
  258. .item-icon {
  259. width: 96rpx;
  260. height: 96rpx;
  261. float: left;
  262. text-align: center;
  263. line-height: 96rpx;
  264. margin-right: 20rpx;
  265. .iconfont {
  266. font-size: 88rpx;
  267. }
  268. .icon-weixinzhifu {
  269. color: #09bb07;
  270. }
  271. .icon-gerenwangyinzhifu {
  272. color: #034582;
  273. }
  274. .icon-daewangyinzhuanzhang {
  275. font-size: 68rpx;
  276. color: #034582;
  277. }
  278. .icon-qiyewangyinzhifu {
  279. color: #004889;
  280. }
  281. }
  282. .item-texts {
  283. line-height: 96rpx;
  284. font-size: $font-size-26;
  285. color: $text-color;
  286. }
  287. .item-text {
  288. line-height: 48rpx;
  289. font-size: $font-size-26;
  290. .txt-p {
  291. color: $text-color;
  292. }
  293. .txt-t {
  294. font-size: $font-size-24;
  295. color: #999999;
  296. }
  297. }
  298. }
  299. .item-r {
  300. flex: 2;
  301. text-align: center;
  302. line-height: 96rpx;
  303. .icon-duigou {
  304. font-size: 60rpx;
  305. color: #ffffff;
  306. }
  307. }
  308. }
  309. }
  310. }
  311. }
  312. .pay-button {
  313. width: 100%;
  314. float: left;
  315. margin-top: 30rpx;
  316. .btn {
  317. width: 662rpx;
  318. height: 88rpx;
  319. border-radius: 44rpx;
  320. font-size: $font-size-28;
  321. line-height: 88rpx;
  322. color: #ffffff;
  323. margin: 0 auto;
  324. text-align: center;
  325. background: $btn-confirm;
  326. }
  327. }
  328. .pay-statustext {
  329. width: 100%;
  330. height: auto;
  331. float: left;
  332. margin-top: 40rpx;
  333. .pay-statustext-inner {
  334. width: 662rpx;
  335. height: 100%;
  336. margin: 0 auto;
  337. .pay-icon {
  338. width: 62rpx;
  339. height: 100%;
  340. float: left;
  341. text-align: center;
  342. .iconfont {
  343. color: #ff2a2a;
  344. font-size: $font-size-36;
  345. line-height: 20rpx;
  346. }
  347. }
  348. .pay-text {
  349. width: 560rpx;
  350. height: 100%;
  351. float: left;
  352. line-height: 40rpx;
  353. font-size: $font-size-24;
  354. color: #ff2a2a;
  355. text-align: justify;
  356. }
  357. }
  358. }
  359. .pay-bring {
  360. width: 100%;
  361. min-height: 190rpx;
  362. padding: 24rpx 0;
  363. background-color: #ffffff;
  364. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  365. position: fixed;
  366. bottom: 0;
  367. left: 0;
  368. border-radius: 30rpx 30rpx 0 0;
  369. display: flex;
  370. align-items: center;
  371. flex-direction: column;
  372. .pay-bring-line {
  373. display: flex;
  374. align-items: center;
  375. .line {
  376. display: inline-block;
  377. width: 48rpx;
  378. height: 2px;
  379. background-color: #707070;
  380. }
  381. }
  382. .pay-bring-content {
  383. width: 654rpx;
  384. height: auto;
  385. padding: 0 24rpx;
  386. .text {
  387. font-size: $font-size-24;
  388. color: #666;
  389. line-height: 44rpx;
  390. text-align: center;
  391. &.bg-color {
  392. color: $color-system;
  393. line-height: 88rpx;
  394. }
  395. }
  396. .text-v {
  397. font-size: $font-size-28;
  398. color: #4a4f58;
  399. line-height: 70rpx;
  400. text-align: left;
  401. &.bg-color {
  402. line-height: 44rpx;
  403. color: $color-system;
  404. }
  405. .clipboard {
  406. width: 84rpx;
  407. height: 36rpx;
  408. background: linear-gradient(34deg, rgba(255, 41, 41, 1) 0%, rgba(255, 109, 27, 1) 100%);
  409. text-align: center;
  410. font-size: $font-size-24;
  411. color: #ffffff;
  412. border-radius: 18rpx;
  413. line-height: 36rpx;
  414. display: inline-block;
  415. margin-left: 10rpx;
  416. }
  417. }
  418. }
  419. }
  420. .pay-bring-wrapper {
  421. width: 100%;
  422. padding: 24rpx 0;
  423. background-color: #ffffff;
  424. display: flex;
  425. align-items: center;
  426. flex-direction: column;
  427. .pay-bring-content {
  428. width: 654rpx;
  429. height: auto;
  430. padding: 0 24rpx;
  431. margin-top: 60rpx;
  432. .text-title {
  433. width: 100%;
  434. height: 320rpx;
  435. margin-bottom: 20rpx;
  436. image {
  437. width: 320rpx;
  438. height: 320rpx;
  439. display: block;
  440. margin: 0 auto;
  441. }
  442. }
  443. .text {
  444. font-size: $font-size-24;
  445. color: #666;
  446. line-height: 44rpx;
  447. text-align: center;
  448. &.bg-color {
  449. color: $color-system;
  450. line-height: 88rpx;
  451. }
  452. }
  453. .text-v {
  454. font-size: $font-size-32;
  455. color: #4a4f58;
  456. line-height: 70rpx;
  457. text-align: center;
  458. margin-bottom: 30rpx;
  459. &.bg-color {
  460. line-height: 44rpx;
  461. color: $color-system;
  462. }
  463. .clipboard {
  464. width: 128rpx;
  465. height: 48rpx;
  466. background: linear-gradient(34deg, #ff2929 0%, #ff6d1b 100%);
  467. text-align: center;
  468. font-size: $font-size-24;
  469. color: #ffffff;
  470. border-radius: 24rpx;
  471. line-height: 48rpx;
  472. display: inline-block;
  473. margin-left: 10rpx;
  474. }
  475. }
  476. .text-content {
  477. width: 100%;
  478. height: 160rpx;
  479. background-color: #f5f5f5;
  480. box-sizing: border-box;
  481. padding: 24rpx;
  482. line-height: 40rpx;
  483. font-size: $font-size-28;
  484. color: #666666;
  485. text-align: justify;
  486. margin-top: 60rpx;
  487. }
  488. }
  489. }
  490. }
  491. .freight-alert {
  492. width: 100%;
  493. height: 100%;
  494. background: rgba(0, 0, 0, 0.5);
  495. position: fixed;
  496. top: 0;
  497. left: 0;
  498. z-index: 8888;
  499. transition: all 0.4s;
  500. &.none {
  501. display: none;
  502. }
  503. &.show {
  504. display: block;
  505. }
  506. .content {
  507. width: 422rpx;
  508. height: 434rpx;
  509. position: absolute;
  510. background: $bg-color;
  511. left: 0;
  512. right: 0;
  513. bottom: 0;
  514. top: 0;
  515. margin: auto;
  516. padding: 20rpx 32rpx;
  517. border-radius: 12rpx;
  518. .title {
  519. width: 100%;
  520. height: 68rpx;
  521. line-height: 68rpx;
  522. font-size: $font-size-28;
  523. color: $text-color;
  524. text-align: center;
  525. position: relative;
  526. .icon-iconfontguanbi {
  527. width: 68rpx;
  528. height: 68rpx;
  529. text-align: center;
  530. line-height: 68rpx;
  531. position: absolute;
  532. right: 0;
  533. top: 0;
  534. font-size: $font-size-36;
  535. color: #999999;
  536. }
  537. }
  538. .text-content {
  539. width: 100%;
  540. height: auto;
  541. .text {
  542. padding: 20rpx 0;
  543. line-height: 44rpx;
  544. font-size: $font-size-26;
  545. color: #666666;
  546. text-align: justify;
  547. }
  548. .text-p {
  549. line-height: 44rpx;
  550. font-size: $font-size-26;
  551. color: $color-system;
  552. text-align: left;
  553. }
  554. }
  555. }
  556. }
  557. </style>