order-payment.vue 11 KB

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