card-coupon-under.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  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.payableAmount = e.amount
  105. setTimeout(() => {
  106. this.skeletonShow = false
  107. }, 500)
  108. // this.PayOrderCheckoutCounter(this.shopOrderId)
  109. },
  110. //初始化子订单信息
  111. async PayOrderCheckoutCounter(shopOrderId) {
  112. try {
  113. const res = await this.PayService.PayOrderCheckoutCounter({ shopOrderId: shopOrderId })
  114. const data = res.data.shopOrder
  115. this.payableAmount = data.needPayAmount
  116. this.getShopBank(data.shopId)
  117. } catch (error) {
  118. console.log('error', error)
  119. }
  120. },
  121. //获取供应商线下转账账号
  122. async getShopBank(shopId){
  123. try {
  124. const res = await this.PayService.getShopBank({ shopId: shopId })
  125. const data = res.data
  126. this.bankInfo = data
  127. setTimeout(() => {
  128. this.skeletonShow = false
  129. }, 500)
  130. }catch (error) {
  131. console.log('error', error)
  132. }
  133. },
  134. //复制
  135. clipboard() {
  136. const data = `开户行:${this.bankInfo.bankName},银行卡号:${this.bankInfo.bankAccount},公司名称:${this.bankInfo.bankAccountName}`
  137. thorui.getClipboardData(data, res => {
  138. if (res) {
  139. this.$util.msg('复制成功', 2000, true, 'success')
  140. } else {
  141. this.$util.msg('复制失败', 2000, true, 'none')
  142. }
  143. })
  144. },
  145. //顶部商品图片预览
  146. previewImg (index) {
  147. let previewUrls = []
  148. if(index === 1){
  149. previewUrls = ['https://static.caimei365.com/app/img/icon/icon-vxPaycode@2x.jpg']
  150. }else{
  151. previewUrls = ['https://static.caimei365.com/app/img/icon/icon-vxkecode.png']
  152. }
  153. uni.previewImage({
  154. current: 0, //图片索引
  155. urls: previewUrls, //必须是http图片,本地图片无效
  156. longPressActions:''
  157. })
  158. }
  159. },
  160. onShow() {}
  161. }
  162. </script>
  163. <style lang="scss">
  164. page {
  165. height: auto !important;
  166. background-color: #ffffff;
  167. }
  168. .container-cash {
  169. width: 100%;
  170. padding-bottom: 250rpx;
  171. .pay-bring-title {
  172. box-sizing: border-box;
  173. width: 100%;
  174. min-height: 96rpx;
  175. padding: 20rpx 24rpx;
  176. line-height: 48rpx;
  177. text-align: left;
  178. font-size: $font-size-24;
  179. background: rgba(255, 234, 221, 1);
  180. color: $color-system;
  181. }
  182. .container-wrapper {
  183. width: 662rpx;
  184. margin: 0 auto;
  185. .pay-title {
  186. font-size: $font-size-32;
  187. line-height: 44rpx;
  188. text-align: center;
  189. color: #2a86ff;
  190. margin: 40rpx 0 0 0;
  191. width: 100%;
  192. float: left;
  193. }
  194. .pay-content {
  195. width: 574rpx;
  196. height: 136rpx;
  197. padding: 52rpx 44rpx;
  198. background: url(https://static.caimei365.com/app/img/icon/icon-paybg.png) no-repeat;
  199. background-size: cover;
  200. float: left;
  201. margin-top: 40rpx;
  202. .pay-p {
  203. font-size: $font-size-26;
  204. color: #ffffff;
  205. line-height: 36rpx;
  206. }
  207. .pay-money {
  208. color: #ffffff;
  209. line-height: 84rpx;
  210. font-weight: bold;
  211. .pay-sm {
  212. font-size: $font-size-26;
  213. }
  214. .pay-bg {
  215. font-size: 50rpx;
  216. }
  217. }
  218. }
  219. .pay-check {
  220. width: 100%;
  221. height: auto;
  222. float: left;
  223. .check-title {
  224. width: 622rpx;
  225. height: 40rpx;
  226. line-height: 40rpx;
  227. padding: 0 20rpx;
  228. margin-top: 24rpx;
  229. .text {
  230. font-size: $font-size-28;
  231. color: $text-color;
  232. text-align: left;
  233. float: left;
  234. }
  235. .icon {
  236. width: 40rpx;
  237. height: 40rpx;
  238. border-radius: 50%;
  239. line-height: 40rpx;
  240. text-align: center;
  241. color: #ffffff;
  242. font-size: $font-size-24;
  243. background: radial-gradient(
  244. circle,
  245. rgba(225, 86, 22, 1) 0%,
  246. rgba(255, 170, 0, 1) 67%,
  247. rgba(249, 185, 156, 1) 100%
  248. );
  249. float: right;
  250. }
  251. }
  252. .pay-checked {
  253. width: 100%;
  254. height: auto;
  255. .pay-item {
  256. width: 618rpx;
  257. height: 96rpx;
  258. border: 2px solid #f5f5f5;
  259. border-radius: 30rpx;
  260. padding: 20rpx;
  261. margin: 24rpx 0;
  262. display: flex;
  263. background-color: #ffffff;
  264. &.current {
  265. border-color: $color-system;
  266. .item-r {
  267. .icon-duigou {
  268. color: $color-system;
  269. }
  270. }
  271. }
  272. .item-l {
  273. flex: 8;
  274. .item-icon {
  275. width: 96rpx;
  276. height: 96rpx;
  277. float: left;
  278. text-align: center;
  279. line-height: 96rpx;
  280. margin-right: 20rpx;
  281. .iconfont {
  282. font-size: 88rpx;
  283. }
  284. .icon-weixinzhifu {
  285. color: #09bb07;
  286. }
  287. .icon-gerenwangyinzhifu {
  288. color: #034582;
  289. }
  290. .icon-daewangyinzhuanzhang {
  291. font-size: 68rpx;
  292. color: #034582;
  293. }
  294. .icon-qiyewangyinzhifu {
  295. color: #004889;
  296. }
  297. }
  298. .item-texts {
  299. line-height: 96rpx;
  300. font-size: $font-size-26;
  301. color: $text-color;
  302. }
  303. .item-text {
  304. line-height: 48rpx;
  305. font-size: $font-size-26;
  306. .txt-p {
  307. color: $text-color;
  308. }
  309. .txt-t {
  310. font-size: $font-size-24;
  311. color: #999999;
  312. }
  313. }
  314. }
  315. .item-r {
  316. flex: 2;
  317. text-align: center;
  318. line-height: 96rpx;
  319. .icon-duigou {
  320. font-size: 60rpx;
  321. color: #ffffff;
  322. }
  323. }
  324. }
  325. }
  326. }
  327. }
  328. .pay-button {
  329. width: 100%;
  330. float: left;
  331. margin-top: 30rpx;
  332. .btn {
  333. width: 662rpx;
  334. height: 88rpx;
  335. border-radius: 44rpx;
  336. font-size: $font-size-28;
  337. line-height: 88rpx;
  338. color: #ffffff;
  339. margin: 0 auto;
  340. text-align: center;
  341. background: $btn-confirm;
  342. }
  343. }
  344. .pay-statustext {
  345. width: 100%;
  346. height: auto;
  347. float: left;
  348. margin-top: 40rpx;
  349. .pay-statustext-inner {
  350. width: 662rpx;
  351. height: 100%;
  352. margin: 0 auto;
  353. .pay-icon {
  354. width: 62rpx;
  355. height: 100%;
  356. float: left;
  357. text-align: center;
  358. .iconfont {
  359. color: #ff2a2a;
  360. font-size: $font-size-36;
  361. line-height: 20rpx;
  362. }
  363. }
  364. .pay-text {
  365. width: 560rpx;
  366. height: 100%;
  367. float: left;
  368. line-height: 40rpx;
  369. font-size: $font-size-24;
  370. color: #ff2a2a;
  371. text-align: justify;
  372. }
  373. }
  374. }
  375. .pay-bring {
  376. width: 100%;
  377. min-height: 190rpx;
  378. padding: 24rpx 0;
  379. background-color: #ffffff;
  380. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  381. position: fixed;
  382. bottom: 0;
  383. left: 0;
  384. border-radius: 30rpx 30rpx 0 0;
  385. display: flex;
  386. align-items: center;
  387. flex-direction: column;
  388. .pay-bring-line {
  389. display: flex;
  390. align-items: center;
  391. .line {
  392. display: inline-block;
  393. width: 48rpx;
  394. height: 2px;
  395. background-color: #707070;
  396. }
  397. }
  398. .pay-bring-content {
  399. width: 654rpx;
  400. height: auto;
  401. padding: 0 24rpx;
  402. .text {
  403. font-size: $font-size-24;
  404. color: #666;
  405. line-height: 44rpx;
  406. text-align: center;
  407. &.bg-color {
  408. color: $color-system;
  409. line-height: 88rpx;
  410. }
  411. }
  412. .text-v {
  413. font-size: $font-size-28;
  414. color: #4a4f58;
  415. line-height: 70rpx;
  416. text-align: left;
  417. &.bg-color {
  418. line-height: 44rpx;
  419. color: $color-system;
  420. }
  421. .clipboard {
  422. width: 84rpx;
  423. height: 36rpx;
  424. background: linear-gradient(34deg, rgba(255, 41, 41, 1) 0%, rgba(255, 109, 27, 1) 100%);
  425. text-align: center;
  426. font-size: $font-size-24;
  427. color: #ffffff;
  428. border-radius: 18rpx;
  429. line-height: 36rpx;
  430. display: inline-block;
  431. margin-left: 10rpx;
  432. }
  433. }
  434. }
  435. }
  436. .pay-bring-wrapper {
  437. width: 100%;
  438. padding: 24rpx 0;
  439. background-color: #ffffff;
  440. display: flex;
  441. align-items: center;
  442. flex-direction: column;
  443. .pay-bring-content {
  444. width: 654rpx;
  445. height: auto;
  446. padding: 0 24rpx;
  447. margin-top: 60rpx;
  448. .text-title {
  449. width: 100%;
  450. height: 320rpx;
  451. margin-bottom: 20rpx;
  452. image {
  453. width: 320rpx;
  454. height: 320rpx;
  455. display: block;
  456. margin: 0 auto;
  457. }
  458. }
  459. .text {
  460. font-size: $font-size-24;
  461. color: #666;
  462. line-height: 44rpx;
  463. text-align: center;
  464. &.bg-color {
  465. color: $color-system;
  466. line-height: 88rpx;
  467. }
  468. }
  469. .text-v {
  470. font-size: $font-size-28;
  471. color: #4a4f58;
  472. line-height: 48rpx;
  473. text-align: justify;
  474. margin-bottom: 40rpx;
  475. .label {
  476. color: #999999;
  477. }
  478. &.bg-color {
  479. line-height: 44rpx;
  480. color: $color-system;
  481. }
  482. .clipboard {
  483. height: 48rpx;
  484. background: #e2e2e2;
  485. text-align: center;
  486. font-size: $font-size-24;
  487. color: #999999;
  488. border-radius: 24rpx;
  489. line-height: 46rpx;
  490. display: inline-block;
  491. margin-left: 24rpx;
  492. border: 1px solid #f7f7f7;
  493. box-sizing: border-box;
  494. padding: 0 10px;
  495. }
  496. }
  497. .text-content {
  498. width: 100%;
  499. background-color: #f5f5f5;
  500. box-sizing: border-box;
  501. padding: 24rpx;
  502. line-height: 44rpx;
  503. font-size: $font-size-28;
  504. color: $color-system;
  505. text-align: justify;
  506. margin-top: 60rpx;
  507. border-radius: 8rpx;
  508. }
  509. }
  510. }
  511. }
  512. .freight-alert {
  513. width: 100%;
  514. height: 100%;
  515. background: rgba(0, 0, 0, 0.5);
  516. position: fixed;
  517. top: 0;
  518. left: 0;
  519. z-index: 8888;
  520. transition: all 0.4s;
  521. &.none {
  522. display: none;
  523. }
  524. &.show {
  525. display: block;
  526. }
  527. .content {
  528. width: 422rpx;
  529. height: 434rpx;
  530. position: absolute;
  531. background: $bg-color;
  532. left: 0;
  533. right: 0;
  534. bottom: 0;
  535. top: 0;
  536. margin: auto;
  537. padding: 20rpx 32rpx;
  538. border-radius: 12rpx;
  539. .title {
  540. width: 100%;
  541. height: 68rpx;
  542. line-height: 68rpx;
  543. font-size: $font-size-28;
  544. color: $text-color;
  545. text-align: center;
  546. position: relative;
  547. .icon-iconfontguanbi {
  548. width: 68rpx;
  549. height: 68rpx;
  550. text-align: center;
  551. line-height: 68rpx;
  552. position: absolute;
  553. right: 0;
  554. top: 0;
  555. font-size: $font-size-36;
  556. color: #999999;
  557. }
  558. }
  559. .text-content {
  560. width: 100%;
  561. height: auto;
  562. .text {
  563. padding: 20rpx 0;
  564. line-height: 44rpx;
  565. font-size: $font-size-26;
  566. color: #666666;
  567. text-align: justify;
  568. }
  569. .text-p {
  570. line-height: 44rpx;
  571. font-size: $font-size-26;
  572. color: $color-system;
  573. text-align: left;
  574. }
  575. }
  576. }
  577. }
  578. </style>