order-payment.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  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">
  5. <view class="container-wrapper">
  6. <view class="pay-title" v-show="isConfirm"><text>订单提交成功,请支付订单</text></view>
  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.toFixed(2)}}</text>
  12. </view>
  13. </view>
  14. <view class="pay-check">
  15. <view class="check-title"><view class="text">选择支付方式</view></view>
  16. <view class="pay-checked">
  17. <view class="pay-item" :class="{ 'current' : tabCurrentIndex === 0}" @click="tabClick(0)" >
  18. <view class="item-l">
  19. <view class="item-icon"><text class="iconfont icon-weixinzhifu"></text></view>
  20. <view class="item-texts"><text>微信支付</text></view>
  21. </view>
  22. <view class="item-r">
  23. <text class="iconfont icon-gougou"></text>
  24. </view>
  25. </view>
  26. <view class="pay-item" :class="{ 'current' : tabCurrentIndex === 1}" @click="tabClick(1)" >
  27. <view class="item-l">
  28. <view class="item-icon"><text class="iconfont icon-yinlianzhifu"></text></view>
  29. <view class="item-text">
  30. <view class="txt-p">企业网银支付</view>
  31. <view class="txt-t">需要在电脑端汇款</view>
  32. </view>
  33. </view>
  34. <view class="item-r">
  35. <text class="iconfont icon-gougou"></text>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="pay-button">
  42. <view class="btn" @click.stop="goOrderCash" :style="{'background':btnColor}">{{buttonText}}</view>
  43. </view>
  44. <view class="pay-statustext">
  45. <view class="pay-statustext-inner">
  46. <view class="pay-icon">
  47. <text class="iconfont icon-gantanhao-yuankuang"></text>
  48. </view>
  49. <view class="pay-text">
  50. <text>{{payStatusText}}</text>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="pay-bring clearfix" :style="{bottom:isIphoneX ? '68rpx' : '24rpx'}" @click.stop="showTips" v-if="isReceiptStatus">
  55. <view class="pay-bring-line"><text class="line"></text></view>
  56. <view class="pay-bring-content" v-if="!isShowTip">
  57. <view class="text bg-color">查看转账信息</view>
  58. <view class="text">除了以上两种支付方式</view>
  59. <view class="text">您还可以通过线下转账的方式付款</view>
  60. </view>
  61. <view class="pay-bring-content" v-else>
  62. <view class="text-v title">转账信息</view>
  63. <view class="text-v">开户行:中信银行(深圳泰然支行)</view>
  64. <view class="text-v">银行卡号:{{bankNumber}}</view>
  65. <view class="text-v">户名:周仁声</view>
  66. <view class="text-v">订单标识:{{payOrderId}} <text class="clipboard" @click.stop="clipboard(payOrderId)">复制</text></view>
  67. <view class="text-v title">特别注意</view>
  68. <view class="text-v bg-color">请在转账备注中填写上述订单标识,方便财务快速审核,提高发货速度</view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. const thorui = require("@/components/clipboard/clipboard.thorui.js")
  76. export default{
  77. data(){
  78. return{
  79. orderID:'',
  80. payableAmount:0,
  81. emptyWrapperH: '',
  82. bankNumber:'6217 6803 0362 0897',
  83. payOrderId:'#10226#',
  84. nvabarData: { //顶部自定义导航
  85. showCapsule:1, // 是否显示左上角图标 1表示显示 0表示不显示,
  86. showSearch: 0,
  87. title: '选择支付方式', // 导航栏 中间的标题
  88. haveBack:false,
  89. haveHome:true,
  90. textLeft:this.$store.state.isIphone
  91. },
  92. isIphoneX:this.$store.state.isIphoneX,
  93. CustomBar:this.CustomBar,// 顶部导航栏高度
  94. tabCurrentIndex:0,
  95. isShowTip:false,
  96. isConfirm:false,
  97. isReceiptStatus:false,
  98. buttonText:'使用微信支付',
  99. btnColor:'#09BB07',
  100. receiptStatus:'',
  101. payStatusText:'使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。'
  102. }
  103. },
  104. onLoad(option) {
  105. this.initData(option)
  106. },
  107. methods:{
  108. initData(e){
  109. console.log(this.orderID)
  110. switch(e.type){
  111. case 'confirm':
  112. this.isConfirm = true
  113. this.nvabarData.haveBack = false
  114. this.nvabarData.haveHome = true
  115. break;
  116. case 'payfirm':
  117. this.isConfirm = false
  118. this.nvabarData.haveBack = true
  119. this.nvabarData.haveHome = false
  120. break;
  121. }
  122. this.orderID = e.orderID
  123. this.PayService.PayOrderCheckoutCounter({orderId:this.orderID}).then(response =>{
  124. let data = response.data.order
  125. this.payableAmount = data.payableAmount - data.receiptAmount //待付金额
  126. this.receiptStatus = data.receiptStatus
  127. if(this.receiptStatus =='2'){
  128. this.payStatusText = '使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。'
  129. this.isReceiptStatus = false
  130. }else{
  131. this.payStatusText = '使用微信和企业网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。'
  132. this.isReceiptStatus = true
  133. }
  134. }).catch(error =>{
  135. this.$util.msg(error.msg,2000)
  136. })
  137. },
  138. goOrderCash(){
  139. switch(this.tabCurrentIndex){
  140. case 0:
  141. this.$api.navigateTo(`/pages/user/order/order-pay?type=0&orderID=${this.orderID}`)
  142. break;
  143. case 1:
  144. this.$api.navigateTo(`/pages/user/order/order-pay?type=1&orderID=${this.orderID}`)
  145. break;
  146. }
  147. },
  148. tabClick(index) {//tab切换
  149. this.tabCurrentIndex = index;
  150. switch(index){
  151. case 0:
  152. this.btnColor="#09BB07"
  153. this.buttonText='使用微信支付';
  154. break;
  155. case 1:
  156. this.btnColor="#034582"
  157. this.buttonText='使用网银支付';
  158. break;
  159. }
  160. },
  161. hanldNavigateBack(){//页面返回
  162. uni.navigateBack({
  163. delta: 1
  164. });
  165. },
  166. showTips(){
  167. this.isShowTip=!this.isShowTip
  168. },
  169. clipboard(data) {
  170. thorui.getClipboardData(data, (res) => {
  171. if (res) {
  172. this.$util.msg("复制成功",2000,true,'success');
  173. } else {
  174. this.$util.msg("复制失败",2000,true,'none');
  175. }
  176. })
  177. },
  178. },
  179. onShow() {
  180. }
  181. }
  182. </script>
  183. <style lang="scss">
  184. page{
  185. height: auto !important;
  186. background-color: #F7F7F7;
  187. }
  188. .container-cash{
  189. width: 100%;
  190. .container-wrapper{
  191. width:662rpx;
  192. margin: 0 auto;
  193. .pay-title{
  194. font-size: $font-size-32;
  195. line-height: 44rpx;
  196. text-align: center;
  197. color: #2A86FF;
  198. margin: 40rpx 0 0 0;
  199. width: 100%;
  200. float: left;
  201. }
  202. .pay-content{
  203. width: 574rpx;
  204. height: 136rpx;
  205. padding: 52rpx 44rpx;
  206. background: url(https://img.caimei365.com/group1/M00/03/BD/Cmis218ekFyAHoAzAALhR3oBpDI049.png) no-repeat;
  207. background-size: cover;
  208. float: left;
  209. margin-top: 40rpx;
  210. margin-bottom: 40rpx;
  211. .pay-p{
  212. font-size: $font-size-26;
  213. color: #FFFFFF;
  214. line-height: 36rpx;
  215. }
  216. .pay-money{
  217. color: #FFFFFF;
  218. line-height: 84rpx;
  219. font-weight: bold;
  220. .pay-sm{
  221. font-size: $font-size-26;
  222. }
  223. .pay-bg{
  224. font-size: 50rpx;
  225. }
  226. }
  227. }
  228. .pay-check{
  229. width: 100%;
  230. height: auto;
  231. float: left;
  232. .check-title{
  233. width: 622rpx;
  234. height: 40rpx;
  235. line-height: 40rpx;
  236. padding: 0 20rpx;
  237. margin-top: 24rpx;
  238. .text{
  239. font-size: $font-size-28;
  240. color: $text-color;
  241. text-align: left;
  242. float: left;
  243. }
  244. .icon{
  245. width: 40rpx;
  246. height: 40rpx;
  247. border-radius: 50%;
  248. line-height: 40rpx;
  249. text-align: center;
  250. color: #FFFFFF;
  251. font-size: $font-size-24;
  252. background: radial-gradient(circle,rgba(225,86,22,1) 0%,rgba(255,170,0,1) 67%,rgba(249,185,156,1) 100%);
  253. float: right;
  254. }
  255. }
  256. .pay-checked{
  257. width: 100%;
  258. height: auto;
  259. .pay-item{
  260. width: 618rpx;
  261. height: 96rpx;
  262. border: 2px solid #F5F5F5;
  263. border-radius: 30rpx;
  264. padding: 20rpx;
  265. margin: 24rpx 0;
  266. display: flex;
  267. background-color: #FFFFFF;
  268. &.current{
  269. border-color:$color-system;
  270. .item-r{
  271. .icon-gougou{
  272. color: $color-system;
  273. }
  274. }
  275. }
  276. .item-l{
  277. flex: 8;
  278. .item-icon{
  279. width: 96rpx;
  280. height: 96rpx;
  281. float: left;
  282. text-align: center;
  283. line-height: 96rpx;
  284. margin-right: 20rpx;
  285. .iconfont{
  286. font-size:88rpx;
  287. }
  288. .icon-weixinzhifu{
  289. color: #09BB07;
  290. }
  291. .icon-yinlianzhifu{
  292. color: #034582;
  293. }
  294. }
  295. .item-texts{
  296. line-height: 96rpx;
  297. font-size:$font-size-26;
  298. color: $text-color;
  299. }
  300. .item-text{
  301. line-height: 48rpx;
  302. font-size:$font-size-26;
  303. .txt-p{
  304. color: $text-color;
  305. }
  306. .txt-t{
  307. color: #999999;
  308. }
  309. }
  310. }
  311. .item-r{
  312. flex: 2;
  313. text-align: right;
  314. line-height: 96rpx;
  315. .icon-gougou{
  316. font-size: 66rpx;
  317. color: #FFFFFF;
  318. }
  319. }
  320. }
  321. }
  322. }
  323. }
  324. .pay-button{
  325. width: 100%;
  326. float: left;
  327. margin-top:30rpx;
  328. .btn{
  329. width: 662rpx;
  330. height: 88rpx;
  331. border-radius: 14rpx;
  332. font-size: $font-size-28;
  333. line-height: 88rpx;
  334. color: #FFFFFF;
  335. margin: 0 auto;
  336. text-align: center;
  337. background:$btn-confirm;
  338. }
  339. }
  340. .pay-statustext{
  341. width: 100%;
  342. height: 120rpx;
  343. float: left;
  344. margin-top:40rpx;
  345. .pay-statustext-inner{
  346. width: 662rpx;
  347. height: 100%;
  348. margin: 0 auto;
  349. .pay-icon{
  350. width: 62rpx;
  351. height: 100%;
  352. float: left;
  353. text-align: center;
  354. .iconfont{
  355. color: #FF2A2A;
  356. font-size:$font-size-36;
  357. line-height: 20rpx;
  358. }
  359. }
  360. .pay-text{
  361. width: 560rpx;
  362. height: 100%;
  363. float: left;
  364. line-height: 40rpx;
  365. font-size: $font-size-26;
  366. color: #FF2A2A;
  367. text-align: justify;
  368. }
  369. }
  370. }
  371. .pay-bring{
  372. width: 702rpx;
  373. min-height: 190rpx;
  374. padding: 24rpx 0;
  375. background-color: #FFFFFF;
  376. box-shadow:0px 3px 6px rgba(0,0,0,0.16);
  377. position: fixed;
  378. bottom: 24rpx;
  379. left: 24rpx;
  380. border-radius: 14rpx;
  381. display: flex;
  382. align-items: center;
  383. flex-direction: column;
  384. .pay-bring-line{
  385. display: flex;
  386. align-items: center;
  387. .line{
  388. display: inline-block;
  389. width: 48rpx;
  390. height: 2px;
  391. background-color: #707070;
  392. }
  393. }
  394. .pay-bring-content{
  395. width: 654rpx;
  396. height: auto;
  397. padding: 0 24rpx;
  398. .text{
  399. font-size: $font-size-24;
  400. color: #666;
  401. line-height: 44rpx;
  402. text-align: center;
  403. &.bg-color{
  404. color: $color-system;
  405. line-height: 88rpx;
  406. }
  407. }
  408. .text-v{
  409. font-size: $font-size-28;
  410. color: #999;
  411. line-height: 70rpx;
  412. text-align: left;
  413. &.title{
  414. font-size: $font-size-26;
  415. color: #666666;
  416. }
  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: 4rpx;
  429. line-height: 36rpx;
  430. display: inline-block;
  431. margin-left: 10rpx;
  432. }
  433. }
  434. }
  435. }
  436. }
  437. .freight-alert{
  438. width: 100%;
  439. height: 100%;
  440. background: rgba(0,0,0,.5);
  441. position: fixed;
  442. top: 0;
  443. left: 0;
  444. z-index: 8888;
  445. transition: all 0.4s;
  446. &.none{
  447. display: none;
  448. }
  449. &.show{
  450. display: block;
  451. }
  452. .content{
  453. width: 422rpx;
  454. height:434rpx;
  455. position: absolute;
  456. background: $bg-color;
  457. left: 0;
  458. right: 0;
  459. bottom: 0;
  460. top: 0;
  461. margin: auto;
  462. padding: 20rpx 32rpx;
  463. border-radius: 12rpx;
  464. .title{
  465. width: 100%;
  466. height: 68rpx;
  467. line-height: 68rpx;
  468. font-size: $font-size-28;
  469. color: $text-color;
  470. text-align: center;
  471. position: relative;
  472. .icon-iconfontguanbi{
  473. width: 68rpx;
  474. height: 68rpx;
  475. text-align: center;
  476. line-height: 68rpx;
  477. position: absolute;
  478. right: 0;
  479. top: 0;
  480. font-size: $font-size-36;
  481. color: #999999;
  482. }
  483. }
  484. .text-content{
  485. width: 100%;
  486. height: auto;
  487. .text{
  488. padding: 20rpx 0;
  489. line-height: 44rpx;
  490. font-size: $font-size-26;
  491. color:#666666;
  492. text-align: justify;
  493. }
  494. .text-p{
  495. line-height: 44rpx;
  496. font-size: $font-size-26;
  497. color:$color-system;
  498. text-align: left;
  499. }
  500. }
  501. }
  502. }
  503. </style>