card-coupon-under.vue 13 KB

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