card-under.vue 13 KB

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