card-under.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  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. ></tui-skeleton>
  10. <view class="container-cash clearfix" v-else>
  11. <view class="container-wrapper">
  12. <view class="pay-content">
  13. <view class="pay-p"><text>待付金额</text></view>
  14. <view class="pay-money">
  15. <text class="pay-sm">¥</text>
  16. <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-v-title title">
  23. <text class="account">转账信息</text>
  24. <text
  25. class="clipboard"
  26. v-if="bankInfo.bankAccountName || bankInfo.bankAccount || bankInfo.bankName"
  27. @click.stop="clipboard(clipboardtEXT)"
  28. >
  29. 复制信息
  30. </text>
  31. </view>
  32. <view class="text-v">
  33. <text class="label">开户行:</text>
  34. {{ bankInfo.bankAccountName || '暂无' }}
  35. </view>
  36. <view class="text-v">
  37. <text class="label">银行卡号:</text>
  38. {{ bankInfo.bankAccount || '暂无' }}
  39. </view>
  40. <view class="text-v">
  41. <text class="label">公司名称:</text>
  42. {{ bankInfo.bankName || '暂无' }}
  43. </view>
  44. <view class="text-content">
  45. 请将订单款项转账至上述账号,转账完成后截图支付凭证,并在订单页面上传支付凭证。
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. const thorui = require('@/components/clipboard/clipboard.thorui.js')
  54. import bankMixins from './mixins/bankMixins.js'
  55. export default {
  56. mixins: [bankMixins],
  57. data() {
  58. return {
  59. bankInfo: {
  60. bankAccountName: '江苏银行北京朝阳门支行',
  61. bankAccount: '32250188000060717',
  62. name: '联合丽格(北京)医疗美容投资连锁集团股份有限公司'
  63. },
  64. clipboardtEXT:
  65. '开户行:江苏银行北京朝阳门支行,银行卡号:32250188000060717,公司名称:联合丽格(北京)医疗美容投资连锁集团股份有限公司',
  66. orderId: '',
  67. shopOrderId: '',
  68. payableAmount: 0,
  69. payOrderId: '',
  70. isIphoneX: this.$store.state.isIphoneX,
  71. CustomBar: this.CustomBar, // 顶部导航栏高度
  72. skeletonShow: true,
  73. productImage: ['https://static.caimei365.com/app/img/icon/icon-vxkecode.png']
  74. }
  75. },
  76. onLoad(option) {
  77. this.initData(option)
  78. },
  79. filters: {
  80. NumFormat(value) {
  81. if (!value) return '0.00'
  82. /*原来用的是Number(value).toFixed(0),这样取整时有问题,例如0.51取整之后为1,感谢Nils指正*/
  83. /*后来改成了 Number(value)|0,但是输入超过十一位就为负数了,具体见评论 */
  84. var intPart = Number(value) - (Number(value) % 1) //获取整数部分(这里是windy93的方法)
  85. var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') //将整数部分逢三一断
  86. var floatPart = '.00' //预定义小数部分
  87. var value2Array = value.toString().split('.')
  88. //=2表示数据有小数位
  89. if (value2Array.length == 2) {
  90. floatPart = value2Array[1].toString() //拿到小数部分
  91. if (floatPart.length == 1) {
  92. //补0,实际上用不着
  93. return intPartFormat + '.' + floatPart + '0'
  94. } else {
  95. return intPartFormat + '.' + floatPart
  96. }
  97. } else {
  98. return intPartFormat + floatPart
  99. }
  100. }
  101. },
  102. methods: {
  103. initData(e) {
  104. this.shopOrderId = e.shopOrderId
  105. this.payOrderId = '#' + e.orderId + '#'
  106. // this.cmGetBankTypeLists()
  107. this.PayOrderCheckoutCounter(this.shopOrderId)
  108. },
  109. async PayOrderCheckoutCounter(shopOrderId) {
  110. try {
  111. const { data } = await this.PayService.PayOrderCheckoutCounter({ shopOrderId: shopOrderId })
  112. this.payableAmount = data.shopOrder.obligation
  113. const { data: bankData } = await this.PayService.getShopBank({ shopId: data.shopOrder.shopId })
  114. this.bankInfo = bankData
  115. this.clipboardtEXT = `开户行:${bankData.bankAccountName},银行卡号:${
  116. bankData.bankAccount
  117. },公司名称:${bankData.bankName}`
  118. setTimeout(() => {
  119. this.skeletonShow = false
  120. }, 500)
  121. } catch (error) {
  122. console.log('error', error)
  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/mini-mcare/icon/icon_payUnd@2x.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: 40rpx;
  197. }
  198. .pay-bg {
  199. font-size: 40rpx;
  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-title {
  397. }
  398. .text-v {
  399. font-size: $font-size-28;
  400. color: #4a4f58;
  401. line-height: 70rpx;
  402. text-align: left;
  403. &.bg-color {
  404. line-height: 44rpx;
  405. color: $color-system;
  406. }
  407. .clipboard {
  408. width: 84rpx;
  409. height: 36rpx;
  410. background: linear-gradient(34deg, rgba(255, 41, 41, 1) 0%, rgba(255, 109, 27, 1) 100%);
  411. text-align: center;
  412. font-size: $font-size-24;
  413. color: #ffffff;
  414. border-radius: 18rpx;
  415. line-height: 36rpx;
  416. display: inline-block;
  417. margin-left: 10rpx;
  418. }
  419. }
  420. }
  421. }
  422. .pay-bring-wrapper {
  423. width: 100%;
  424. padding: 24rpx 0;
  425. background-color: #ffffff;
  426. display: flex;
  427. align-items: center;
  428. flex-direction: column;
  429. .pay-bring-content {
  430. width: 654rpx;
  431. height: auto;
  432. padding: 0 24rpx;
  433. margin-top: 48rpx;
  434. .text-title {
  435. width: 100%;
  436. height: 320rpx;
  437. margin-bottom: 20rpx;
  438. image {
  439. width: 320rpx;
  440. height: 320rpx;
  441. display: block;
  442. margin: 0 auto;
  443. }
  444. }
  445. .text {
  446. font-size: $font-size-24;
  447. color: #666;
  448. line-height: 44rpx;
  449. text-align: center;
  450. &.bg-color {
  451. color: $color-system;
  452. line-height: 88rpx;
  453. }
  454. }
  455. .text-v {
  456. font-size: $font-size-28;
  457. color: #4a4f58;
  458. line-height: 48rpx;
  459. text-align: justify;
  460. margin-bottom: 20rpx;
  461. .account {
  462. color: #333333;
  463. }
  464. }
  465. .text-v-title {
  466. font-size: $font-size-28;
  467. color: #4a4f58;
  468. line-height: 48rpx;
  469. text-align: justify;
  470. margin-bottom: 40rpx;
  471. .account {
  472. color: #333333;
  473. }
  474. .label {
  475. color: #999999;
  476. }
  477. &.bg-color {
  478. line-height: 44rpx;
  479. color: $color-system;
  480. }
  481. .clipboard {
  482. height: 48rpx;
  483. background: #e2e2e2;
  484. text-align: center;
  485. font-size: $font-size-24;
  486. color: #999999;
  487. border-radius: 24rpx;
  488. line-height: 46rpx;
  489. display: inline-block;
  490. margin-left: 24rpx;
  491. border: 1px solid #f7f7f7;
  492. box-sizing: border-box;
  493. padding: 0 10px;
  494. margin-left: 60rpx;
  495. }
  496. }
  497. .text-content {
  498. width: 100%;
  499. background-color: #f5f5f5;
  500. box-sizing: border-box;
  501. padding: 24rpx;
  502. line-height: 44rpx;
  503. font-size: $font-size-28;
  504. color: #f94b4b;
  505. text-align: justify;
  506. margin-top: 60rpx;
  507. border-radius: 8rpx;
  508. }
  509. }
  510. }
  511. }
  512. .freight-alert {
  513. width: 100%;
  514. height: 100%;
  515. background: rgba(0, 0, 0, 0.5);
  516. position: fixed;
  517. top: 0;
  518. left: 0;
  519. z-index: 8888;
  520. transition: all 0.4s;
  521. &.none {
  522. display: none;
  523. }
  524. &.show {
  525. display: block;
  526. }
  527. .content {
  528. width: 422rpx;
  529. height: 434rpx;
  530. position: absolute;
  531. background: $bg-color;
  532. left: 0;
  533. right: 0;
  534. bottom: 0;
  535. top: 0;
  536. margin: auto;
  537. padding: 20rpx 32rpx;
  538. border-radius: 12rpx;
  539. .title {
  540. width: 100%;
  541. height: 68rpx;
  542. line-height: 68rpx;
  543. font-size: $font-size-28;
  544. color: $text-color;
  545. text-align: center;
  546. position: relative;
  547. .icon-iconfontguanbi {
  548. width: 68rpx;
  549. height: 68rpx;
  550. text-align: center;
  551. line-height: 68rpx;
  552. position: absolute;
  553. right: 0;
  554. top: 0;
  555. font-size: $font-size-36;
  556. color: #999999;
  557. }
  558. }
  559. .text-content {
  560. width: 100%;
  561. height: auto;
  562. .text {
  563. padding: 20rpx 0;
  564. line-height: 44rpx;
  565. font-size: $font-size-26;
  566. color: #666666;
  567. text-align: justify;
  568. }
  569. .text-p {
  570. line-height: 44rpx;
  571. font-size: $font-size-26;
  572. color: $color-system;
  573. text-align: left;
  574. }
  575. }
  576. }
  577. }
  578. </style>