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