order-payment.vue 12 KB

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