card-under.vue 12 KB

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