card-under.vue 12 KB

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