order-payment.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. <template>
  2. <view class="container cashier" :style="{paddingTop:CustomBar+'px'}">
  3. <cu-custom :navbar-data='nvabarData' @navigateBack="hanldNavigateBack"></cu-custom>
  4. <view class="container-cash clearfix" v-if="invoiceStatus">
  5. <view class="pay-bring-title">{{payBringTitle}}</view>
  6. <view class="container-wrapper">
  7. <view class="pay-content">
  8. <view class="pay-p"><text>待付金额</text></view>
  9. <view class="pay-money">
  10. <text class="pay-sm">¥</text>
  11. <text class="pay-bg">{{payableAmount | NumFormat}}</text>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="pay-bring-wrapper clearfix">
  16. <view class="pay-bring-content">
  17. <view class="text-v title">转账信息</view>
  18. <view class="text-v">开户行:中信银行(深圳泰然支行)</view>
  19. <view class="text-v">银行卡号:{{bankNumber}}</view>
  20. <view class="text-v">户名:周仁声</view>
  21. <view class="text-v">订单标识:{{payOrderId}} <text class="clipboard" @click.stop="clipboard(payOrderId)">复制</text></view>
  22. <view class="text-v title">特别注意</view>
  23. <view class="text-v bg-color">请在转账备注中填写上述订单标识,方便财务快速审核,提高发货速度</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="container-cash clearfix" v-else>
  28. <view class="container-wrapper">
  29. <view class="pay-content">
  30. <view class="pay-p"><text>待付金额</text></view>
  31. <view class="pay-money">
  32. <text class="pay-sm">¥</text>
  33. <text class="pay-bg">{{payableAmount | NumFormat}}</text>
  34. </view>
  35. </view>
  36. <view class="pay-check">
  37. <view class="check-title"><view class="text">选择支付方式</view></view>
  38. <view class="pay-checked">
  39. <view class="pay-item" :class="{ 'current' : tabCurrentIndex === 0}" @click="tabClick(0)" >
  40. <view class="item-l">
  41. <view class="item-icon"><text class="iconfont icon-weixinzhifu"></text></view>
  42. <view class="item-texts"><text>微信支付</text></view>
  43. </view>
  44. <view class="item-r">
  45. <text class="iconfont icon-gougou"></text>
  46. </view>
  47. </view>
  48. <view class="pay-item" :class="{ 'current' : tabCurrentIndex === 1}" @click="tabClick(1)" >
  49. <view class="item-l">
  50. <view class="item-icon"><text class="iconfont icon-yinlianzhifu"></text></view>
  51. <view class="item-text">
  52. <view class="txt-p">企业网银支付</view>
  53. <view class="txt-t">需要在电脑端汇款</view>
  54. </view>
  55. </view>
  56. <view class="item-r">
  57. <text class="iconfont icon-gougou"></text>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="pay-button">
  64. <view class="btn" @click.stop="goOrderCash" :style="{'background':btnColor}">{{buttonText}}</view>
  65. </view>
  66. <view class="pay-statustext">
  67. <view class="pay-statustext-inner">
  68. <view class="pay-icon">
  69. <text class="iconfont icon-gantanhao-yuankuang"></text>
  70. </view>
  71. <view class="pay-text">
  72. <text>{{payStatusText}}</text>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="pay-bring clearfix" :style="{paddingBottom:isIphoneX ? '68rpx' : '24rpx'}" @click.stop="showTips" v-if="isReceiptStatus">
  77. <view class="pay-bring-line"><text class="line"></text></view>
  78. <view class="pay-bring-content" v-if="!isShowTip">
  79. <view class="text bg-color">查看转账信息</view>
  80. <view class="text">除了以上两种支付方式</view>
  81. <view class="text">您还可以通过线下转账的方式付款</view>
  82. </view>
  83. <view class="pay-bring-content" v-else>
  84. <view class="text-v title">转账信息</view>
  85. <view class="text-v">开户行:中信银行(深圳泰然支行)</view>
  86. <view class="text-v">银行卡号:{{bankNumber}}</view>
  87. <view class="text-v">户名:周仁声</view>
  88. <view class="text-v">订单标识:{{payOrderId}} <text class="clipboard" @click.stop="clipboard(payOrderId)">复制</text></view>
  89. <view class="text-v title">特别注意</view>
  90. <view class="text-v bg-color">请在转账备注中填写上述订单标识,方便财务快速审核,提高发货速度</view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. <script>
  97. const thorui = require("@/components/clipboard/clipboard.thorui.js")
  98. export default{
  99. data(){
  100. return{
  101. orderID:'',
  102. payableAmount:0,
  103. emptyWrapperH: '',
  104. bankNumber:'6217 6803 0362 0897',
  105. payOrderId:'',
  106. nvabarData: { //顶部自定义导航
  107. showCapsule:1, // 是否显示左上角图标 1表示显示 0表示不显示,
  108. showSearch: 0,
  109. title: '选择支付方式', // 导航栏 中间的标题
  110. haveBack:false,
  111. haveHome:true,
  112. textLeft:this.$store.state.isIphone
  113. },
  114. isIphoneX:this.$store.state.isIphoneX,
  115. CustomBar:this.CustomBar,// 顶部导航栏高度
  116. tabCurrentIndex:0,
  117. isShowTip:false,
  118. isReceiptStatus:false,
  119. buttonText:'使用微信支付',
  120. btnColor:'#09BB07',
  121. receiptStatus:'',
  122. invoiceStatus:false,
  123. onlinePayFlag:'',
  124. payBringTitle:'本次交易暂不支持线上支付,请使用线下转账方式付款',
  125. payStatusText:'使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。'
  126. }
  127. },
  128. onLoad(option) {
  129. this.initData(option)
  130. },
  131. filters: {
  132. NumFormat(value) {
  133. if(!value) return '0.00';
  134. /*原来用的是Number(value).toFixed(0),这样取整时有问题,例如0.51取整之后为1,感谢Nils指正*/
  135. /*后来改成了 Number(value)|0,但是输入超过十一位就为负数了,具体见评论 */
  136. var intPart = Number(value) - Number(value)%1; //获取整数部分(这里是windy93的方法)
  137. var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'); //将整数部分逢三一断
  138. var floatPart = ".00"; //预定义小数部分
  139. var value2Array = value.toString().split(".");
  140. //=2表示数据有小数位
  141. if(value2Array.length == 2) {
  142. floatPart = value2Array[1].toString(); //拿到小数部分
  143. if(floatPart.length == 1) { //补0,实际上用不着
  144. return intPartFormat + "." + floatPart + '0';
  145. } else {
  146. return intPartFormat + "." + floatPart;
  147. }
  148. } else {
  149. return intPartFormat + floatPart;
  150. }
  151. }
  152. },
  153. methods:{
  154. initData(e){
  155. this.orderID = e.orderID
  156. this.payOrderId ='#'+e.orderID+'#';
  157. switch(e.type){
  158. case 'confirm':
  159. this.nvabarData.haveBack = false
  160. this.nvabarData.haveHome = true
  161. this.nvabarData.title = '支付'
  162. this.PayOrderCheckoutCounter(this.orderID)
  163. break;
  164. case 'payfirm':
  165. this.nvabarData.haveBack = true
  166. this.nvabarData.haveHome = false
  167. this.nvabarData.title = '选择支付方式'
  168. this.PayOrderCheckoutCounter(this.orderID)
  169. break;
  170. case 'onlinePay':
  171. this.nvabarData.haveBack = true
  172. this.nvabarData.haveHome = false
  173. this.nvabarData.title = '付款提示'
  174. this.invoiceStatus = true
  175. this.payableAmount = e.payAmount
  176. this.payBringTitle = '您已通过线下转账的方式支付了订单部分款项,剩余款项依然需要使用线下转账方式,给您带来的不便敬请谅解'
  177. break;
  178. }
  179. },
  180. PayOrderCheckoutCounter(orderId){
  181. this.PayService.PayOrderCheckoutCounter({orderId:orderId}).then(response =>{
  182. let data = response.data.order
  183. this.payableAmount = data.payableAmount - data.receiptAmount //待付金额
  184. this.receiptStatus = data.receiptStatus
  185. this.invoiceStatus = data.invoiceStatus
  186. this.onlinePayFlag = data.onlinePayFlag
  187. if(data.receiptAmount>0){
  188. this.payStatusText = '使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。'
  189. this.isReceiptStatus = false
  190. }else{
  191. this.payStatusText = '使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。'
  192. this.isReceiptStatus = true
  193. }
  194. }).catch(error =>{
  195. this.$util.msg(error.msg,2000)
  196. })
  197. },
  198. goOrderCash(){
  199. if(this.invoiceStatus){
  200. this.$util.modal('','本次交易暂不支持线上支付开票,请使用线下转账的方式付款','知道了','',false,() =>{})
  201. this.payStatusText = '使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。'
  202. this.isReceiptStatus = true
  203. }else{
  204. switch(this.tabCurrentIndex){
  205. case 0:
  206. this.$api.navigateTo(`/pages/user/order/order-pay?type=0&orderID=${this.orderID}`)
  207. break;
  208. case 1:
  209. this.$api.navigateTo(`/pages/user/order/order-pay?type=1&orderID=${this.orderID}`)
  210. break;
  211. }
  212. }
  213. },
  214. tabClick(index) {//tab切换
  215. this.tabCurrentIndex = index;
  216. switch(index){
  217. case 0:
  218. this.btnColor="#09BB07"
  219. this.buttonText='使用微信支付';
  220. break;
  221. case 1:
  222. this.btnColor="#034582"
  223. this.buttonText='使用网银支付';
  224. break;
  225. }
  226. },
  227. hanldNavigateBack(){//页面返回
  228. uni.navigateBack({
  229. delta: 1
  230. });
  231. },
  232. showTips(){
  233. this.isShowTip=!this.isShowTip
  234. },
  235. clipboard(data) {
  236. thorui.getClipboardData(data, (res) => {
  237. if (res) {
  238. this.$util.msg("复制成功",2000,true,'success');
  239. } else {
  240. this.$util.msg("复制失败",2000,true,'none');
  241. }
  242. })
  243. },
  244. },
  245. onShow() {
  246. }
  247. }
  248. </script>
  249. <style lang="scss">
  250. page{
  251. height: auto !important;
  252. background-color: #FFFFFF;
  253. }
  254. .container-cash{
  255. width: 100%;
  256. .pay-bring-title{
  257. box-sizing: border-box;
  258. width: 100%;
  259. min-height: 96rpx;
  260. padding: 20rpx 24rpx;
  261. line-height: 48rpx;
  262. text-align: left;
  263. font-size: $font-size-24;
  264. background:rgba(255,234,221,1);
  265. color: $color-system;
  266. }
  267. .container-wrapper{
  268. width:662rpx;
  269. margin: 0 auto;
  270. .pay-title{
  271. font-size: $font-size-32;
  272. line-height: 44rpx;
  273. text-align: center;
  274. color: #2A86FF;
  275. margin: 40rpx 0 0 0;
  276. width: 100%;
  277. float: left;
  278. }
  279. .pay-content{
  280. width: 574rpx;
  281. height: 136rpx;
  282. padding: 52rpx 44rpx;
  283. background: url(https://img.caimei365.com/group1/M00/03/BD/Cmis218ekFyAHoAzAALhR3oBpDI049.png) no-repeat;
  284. background-size: cover;
  285. float: left;
  286. margin-top: 40rpx;
  287. margin-bottom: 40rpx;
  288. .pay-p{
  289. font-size: $font-size-26;
  290. color: #FFFFFF;
  291. line-height: 36rpx;
  292. }
  293. .pay-money{
  294. color: #FFFFFF;
  295. line-height: 84rpx;
  296. font-weight: bold;
  297. .pay-sm{
  298. font-size: $font-size-26;
  299. }
  300. .pay-bg{
  301. font-size: 50rpx;
  302. }
  303. }
  304. }
  305. .pay-check{
  306. width: 100%;
  307. height: auto;
  308. float: left;
  309. .check-title{
  310. width: 622rpx;
  311. height: 40rpx;
  312. line-height: 40rpx;
  313. padding: 0 20rpx;
  314. margin-top: 24rpx;
  315. .text{
  316. font-size: $font-size-28;
  317. color: $text-color;
  318. text-align: left;
  319. float: left;
  320. }
  321. .icon{
  322. width: 40rpx;
  323. height: 40rpx;
  324. border-radius: 50%;
  325. line-height: 40rpx;
  326. text-align: center;
  327. color: #FFFFFF;
  328. font-size: $font-size-24;
  329. background: radial-gradient(circle,rgba(225,86,22,1) 0%,rgba(255,170,0,1) 67%,rgba(249,185,156,1) 100%);
  330. float: right;
  331. }
  332. }
  333. .pay-checked{
  334. width: 100%;
  335. height: auto;
  336. .pay-item{
  337. width: 618rpx;
  338. height: 96rpx;
  339. border: 2px solid #F5F5F5;
  340. border-radius: 30rpx;
  341. padding: 20rpx;
  342. margin: 24rpx 0;
  343. display: flex;
  344. background-color: #FFFFFF;
  345. &.current{
  346. border-color:$color-system;
  347. .item-r{
  348. .icon-gougou{
  349. color: $color-system;
  350. }
  351. }
  352. }
  353. .item-l{
  354. flex: 8;
  355. .item-icon{
  356. width: 96rpx;
  357. height: 96rpx;
  358. float: left;
  359. text-align: center;
  360. line-height: 96rpx;
  361. margin-right: 20rpx;
  362. .iconfont{
  363. font-size:88rpx;
  364. }
  365. .icon-weixinzhifu{
  366. color: #09BB07;
  367. }
  368. .icon-yinlianzhifu{
  369. color: #034582;
  370. }
  371. }
  372. .item-texts{
  373. line-height: 96rpx;
  374. font-size:$font-size-26;
  375. color: $text-color;
  376. }
  377. .item-text{
  378. line-height: 48rpx;
  379. font-size:$font-size-26;
  380. .txt-p{
  381. color: $text-color;
  382. }
  383. .txt-t{
  384. color: #999999;
  385. }
  386. }
  387. }
  388. .item-r{
  389. flex: 2;
  390. text-align: right;
  391. line-height: 96rpx;
  392. .icon-gougou{
  393. font-size: 66rpx;
  394. color: #FFFFFF;
  395. }
  396. }
  397. }
  398. }
  399. }
  400. }
  401. .pay-button{
  402. width: 100%;
  403. float: left;
  404. margin-top:30rpx;
  405. .btn{
  406. width: 662rpx;
  407. height: 88rpx;
  408. border-radius: 14rpx;
  409. font-size: $font-size-28;
  410. line-height: 88rpx;
  411. color: #FFFFFF;
  412. margin: 0 auto;
  413. text-align: center;
  414. background:$btn-confirm;
  415. }
  416. }
  417. .pay-statustext{
  418. width: 100%;
  419. height: 120rpx;
  420. float: left;
  421. margin-top:40rpx;
  422. .pay-statustext-inner{
  423. width: 662rpx;
  424. height: 100%;
  425. margin: 0 auto;
  426. .pay-icon{
  427. width: 62rpx;
  428. height: 100%;
  429. float: left;
  430. text-align: center;
  431. .iconfont{
  432. color: #FF2A2A;
  433. font-size:$font-size-36;
  434. line-height: 20rpx;
  435. }
  436. }
  437. .pay-text{
  438. width: 560rpx;
  439. height: 100%;
  440. float: left;
  441. line-height: 40rpx;
  442. font-size: $font-size-26;
  443. color: #FF2A2A;
  444. text-align: justify;
  445. }
  446. }
  447. }
  448. .pay-bring{
  449. width: 100%;
  450. min-height: 190rpx;
  451. padding: 24rpx 0;
  452. background-color: #FFFFFF;
  453. box-shadow:0px 3px 6px rgba(0,0,0,0.16);
  454. position: fixed;
  455. bottom: 0;
  456. left: 0;
  457. border-radius: 30rpx 30rpx 0 0;
  458. display: flex;
  459. align-items: center;
  460. flex-direction: column;
  461. .pay-bring-line{
  462. display: flex;
  463. align-items: center;
  464. .line{
  465. display: inline-block;
  466. width: 48rpx;
  467. height: 2px;
  468. background-color: #707070;
  469. }
  470. }
  471. .pay-bring-content{
  472. width: 654rpx;
  473. height: auto;
  474. padding: 0 24rpx;
  475. .text{
  476. font-size: $font-size-24;
  477. color: #666;
  478. line-height: 44rpx;
  479. text-align: center;
  480. &.bg-color{
  481. color: $color-system;
  482. line-height: 88rpx;
  483. }
  484. }
  485. .text-v{
  486. font-size: $font-size-28;
  487. color: #999;
  488. line-height: 70rpx;
  489. text-align: left;
  490. &.title{
  491. font-size: $font-size-26;
  492. color: #666666;
  493. }
  494. &.bg-color{
  495. line-height: 44rpx;
  496. color: $color-system;
  497. }
  498. .clipboard{
  499. width: 84rpx;
  500. height: 36rpx;
  501. background:linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  502. text-align: center;
  503. font-size: $font-size-24;
  504. color: #FFFFFF;
  505. border-radius: 4rpx;
  506. line-height: 36rpx;
  507. display: inline-block;
  508. margin-left: 10rpx;
  509. }
  510. }
  511. }
  512. }
  513. .pay-bring-wrapper{
  514. width: 100%;
  515. padding: 24rpx 0;
  516. background-color: #FFFFFF;
  517. display: flex;
  518. align-items: center;
  519. flex-direction: column;
  520. .pay-bring-content{
  521. width: 654rpx;
  522. height: auto;
  523. padding: 0 24rpx;
  524. .text{
  525. font-size: $font-size-24;
  526. color: #666;
  527. line-height: 44rpx;
  528. text-align: center;
  529. &.bg-color{
  530. color: $color-system;
  531. line-height: 88rpx;
  532. }
  533. }
  534. .text-v{
  535. font-size: $font-size-28;
  536. color: #999;
  537. line-height: 70rpx;
  538. text-align: left;
  539. &.title{
  540. font-size: $font-size-28;
  541. color: #666666;
  542. }
  543. &.bg-color{
  544. line-height: 44rpx;
  545. color: $color-system;
  546. }
  547. .clipboard{
  548. width: 84rpx;
  549. height: 36rpx;
  550. background:linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  551. text-align: center;
  552. font-size: $font-size-24;
  553. color: #FFFFFF;
  554. border-radius: 4rpx;
  555. line-height: 36rpx;
  556. display: inline-block;
  557. margin-left: 10rpx;
  558. }
  559. }
  560. }
  561. }
  562. }
  563. .freight-alert{
  564. width: 100%;
  565. height: 100%;
  566. background: rgba(0,0,0,.5);
  567. position: fixed;
  568. top: 0;
  569. left: 0;
  570. z-index: 8888;
  571. transition: all 0.4s;
  572. &.none{
  573. display: none;
  574. }
  575. &.show{
  576. display: block;
  577. }
  578. .content{
  579. width: 422rpx;
  580. height:434rpx;
  581. position: absolute;
  582. background: $bg-color;
  583. left: 0;
  584. right: 0;
  585. bottom: 0;
  586. top: 0;
  587. margin: auto;
  588. padding: 20rpx 32rpx;
  589. border-radius: 12rpx;
  590. .title{
  591. width: 100%;
  592. height: 68rpx;
  593. line-height: 68rpx;
  594. font-size: $font-size-28;
  595. color: $text-color;
  596. text-align: center;
  597. position: relative;
  598. .icon-iconfontguanbi{
  599. width: 68rpx;
  600. height: 68rpx;
  601. text-align: center;
  602. line-height: 68rpx;
  603. position: absolute;
  604. right: 0;
  605. top: 0;
  606. font-size: $font-size-36;
  607. color: #999999;
  608. }
  609. }
  610. .text-content{
  611. width: 100%;
  612. height: auto;
  613. .text{
  614. padding: 20rpx 0;
  615. line-height: 44rpx;
  616. font-size: $font-size-26;
  617. color:#666666;
  618. text-align: justify;
  619. }
  620. .text-p{
  621. line-height: 44rpx;
  622. font-size: $font-size-26;
  623. color:$color-system;
  624. text-align: left;
  625. }
  626. }
  627. }
  628. }
  629. </style>