card-under.vue 12 KB

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