order-payunder.vue 12 KB

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