card-under.vue 12 KB

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