order-payment.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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">
  7. <text>订单提交成功,请支付订单</text>
  8. </view>
  9. <view class="pay-content">
  10. <view class="pay-p"><text>待付金额</text></view>
  11. <view class="pay-money">
  12. <text class="pay-sm">¥</text>
  13. <text class="pay-bg">{{payableAmount.toFixed(2)}}</text>
  14. </view>
  15. </view>
  16. <view class="pay-check">
  17. <view class="check-title">
  18. <view class="text">选择支付方式</view>
  19. <view class="icon" @click="showTips">i</view>
  20. </view>
  21. <view class="pay-checked">
  22. <view class="pay-item" :class="{ 'current' : tabCurrentIndex === 0}" @click="tabClick(0)" >
  23. <view class="item-l">
  24. <view class="item-icon"><text class="iconfont icon-weixinzhifu"></text></view>
  25. <view class="item-texts"><text>微信支付</text></view>
  26. </view>
  27. <view class="item-r">
  28. <text class="iconfont icon-gougou"></text>
  29. </view>
  30. </view>
  31. <view class="pay-item" :class="{ 'current' : tabCurrentIndex === 1}" @click="tabClick(1)" >
  32. <view class="item-l">
  33. <view class="item-icon"><text class="iconfont icon-yinlianzhifu"></text></view>
  34. <view class="item-text">
  35. <view class="txt-p">企业网银支付</view>
  36. <view class="txt-t">需要在电脑端汇款</view>
  37. </view>
  38. </view>
  39. <view class="item-r">
  40. <text class="iconfont icon-gougou"></text>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="pay-button">
  47. <view class="btn" @click.stop="goOrderCash" :style="{'background':btnColor}">{{buttonText}}</view>
  48. </view>
  49. </view>
  50. <view class="alert spec" :class="specClass" v-if="isShowTip">
  51. <!-- 选择支付弹窗说明 -->
  52. <view class="freight-alert" @tap="hideTips">
  53. <view class="content">
  54. <view class="title">
  55. <text>提示</text>
  56. <text class="iconfont icon-iconfontguanbi" @click.stop="hideTips"></text>
  57. </view>
  58. <view class="text-content">
  59. <view class="text">除了以下两种支付方式,您还可以通过线下直接转账的方式付款。获取转账信息请联系您的采美销售人员或直接拨打客服热线。</view>
  60. <view class="text-p">客服热线:</view>
  61. <view class="text-p">0755-22907771 / 15338851365</view>
  62. <view class="text-p">(周一至周五 09:00-18:00)</view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. import { PayOrderCheckoutCounter } from "@/api/order.js"
  71. export default{
  72. data(){
  73. return{
  74. orderID:'',
  75. payableAmount:0,
  76. emptyWrapperH: '',
  77. nvabarData: { //顶部自定义导航
  78. showCapsule:1, // 是否显示左上角图标 1表示显示 0表示不显示,
  79. showSearch: 0,
  80. title: '选择支付方式', // 导航栏 中间的标题
  81. haveBack:false,
  82. textLeft:true
  83. },
  84. isIphoneX:this.$store.state.isIphoneX,
  85. CustomBar:this.CustomBar,// 顶部导航栏高度
  86. tabCurrentIndex:0,
  87. isShowTip:false,
  88. isConfirm:false,
  89. buttonText:'使用微信支付',
  90. btnColor:'#09BB07'
  91. }
  92. },
  93. onLoad(option) {
  94. this.initData(option)
  95. },
  96. methods:{
  97. initData(e){
  98. console.log(this.orderID)
  99. switch(e.type){
  100. case 'confirm':
  101. this.isConfirm = true
  102. this.nvabarData.haveBack = false
  103. break;
  104. case 'payfirm':
  105. this.isConfirm = false
  106. this.nvabarData.haveBack = true
  107. break;
  108. }
  109. this.orderID = e.orderID
  110. PayOrderCheckoutCounter({orderId:this.orderID}).then(response =>{
  111. console.log(response)
  112. this.payableAmount = response.data.order.payableAmount - response.data.order.receiptAmount //待付金额
  113. }).catch(error =>{
  114. this.$util.msg(error.msg,2000)
  115. })
  116. },
  117. goOrderCash(){
  118. switch(this.tabCurrentIndex){
  119. case 0:
  120. this.$api.navigateTo(`/pages/user/order/order-pay?type=0&orderID=${this.orderID}`)
  121. break;
  122. case 1:
  123. this.$api.navigateTo(`/pages/user/order/order-pay?type=1&orderID=${this.orderID}`)
  124. break;
  125. }
  126. },
  127. tabClick(index) {//tab切换
  128. this.tabCurrentIndex = index;
  129. switch(index){
  130. case 0:
  131. this.btnColor="#09BB07"
  132. this.buttonText='使用微信支付';
  133. break;
  134. case 1:
  135. this.btnColor="#034582"
  136. this.buttonText='使用网银支付';
  137. break;
  138. }
  139. },
  140. hanldNavigateBack(){//页面返回
  141. uni.navigateBack({
  142. delta: 1
  143. });
  144. },
  145. showTips(){
  146. this.isShowTip=true
  147. },
  148. hideTips(){
  149. this.isShowTip=false
  150. }
  151. },
  152. onShow() {
  153. }
  154. }
  155. </script>
  156. <style lang="scss">
  157. page{
  158. height: auto !important;
  159. }
  160. .container-cash{
  161. width: 100%;
  162. .container-wrapper{
  163. width:662rpx;
  164. margin: 0 auto;
  165. .pay-title{
  166. font-size: $font-size-32;
  167. line-height: 44rpx;
  168. text-align: center;
  169. color: #2A86FF;
  170. margin: 54rpx 0;
  171. width: 100%;
  172. float: left;
  173. }
  174. .pay-content{
  175. width: 574rpx;
  176. height: 136rpx;
  177. padding: 52rpx 44rpx;
  178. 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;
  179. background-size: cover;
  180. float: left;
  181. margin-top: 54rpx;
  182. margin-bottom: 40rpx;
  183. .pay-p{
  184. font-size: $font-size-26;
  185. color: #FFFFFF;
  186. line-height: 36rpx;
  187. }
  188. .pay-money{
  189. color: #FFFFFF;
  190. line-height: 84rpx;
  191. font-weight: bold;
  192. .pay-sm{
  193. font-size: $font-size-26;
  194. }
  195. .pay-bg{
  196. font-size: 50rpx;
  197. }
  198. }
  199. }
  200. .pay-check{
  201. width: 100%;
  202. height: auto;
  203. float: left;
  204. .check-title{
  205. width: 622rpx;
  206. height: 40rpx;
  207. line-height: 40rpx;
  208. padding: 0 20rpx;
  209. margin-top: 24rpx;
  210. .text{
  211. font-size: $font-size-28;
  212. color: $text-color;
  213. text-align: left;
  214. float: left;
  215. }
  216. .icon{
  217. width: 40rpx;
  218. height: 40rpx;
  219. border-radius: 50%;
  220. line-height: 40rpx;
  221. text-align: center;
  222. color: #FFFFFF;
  223. font-size: $font-size-24;
  224. background: radial-gradient(circle,rgba(225,86,22,1) 0%,rgba(255,170,0,1) 67%,rgba(249,185,156,1) 100%);
  225. float: right;
  226. }
  227. }
  228. .pay-checked{
  229. width: 100%;
  230. height: auto;
  231. .pay-item{
  232. width: 618rpx;
  233. height: 96rpx;
  234. border: 2px solid #F5F5F5;
  235. border-radius: 30rpx;
  236. padding: 20rpx;
  237. margin: 24rpx 0;
  238. display: flex;
  239. &.current{
  240. border-color:$color-system;
  241. .item-r{
  242. .icon-gougou{
  243. color: $color-system;
  244. }
  245. }
  246. }
  247. .item-l{
  248. flex: 8;
  249. .item-icon{
  250. width: 96rpx;
  251. height: 96rpx;
  252. float: left;
  253. text-align: center;
  254. line-height: 96rpx;
  255. margin-right: 20rpx;
  256. .iconfont{
  257. font-size:88rpx;
  258. }
  259. .icon-weixinzhifu{
  260. color: #09BB07;
  261. }
  262. .icon-yinlianzhifu{
  263. color: #034582;
  264. }
  265. }
  266. .item-texts{
  267. line-height: 96rpx;
  268. font-size:$font-size-26;
  269. color: $text-color;
  270. }
  271. .item-text{
  272. line-height: 48rpx;
  273. font-size:$font-size-26;
  274. .txt-p{
  275. color: $text-color;
  276. }
  277. .txt-t{
  278. color: #999999;
  279. }
  280. }
  281. }
  282. .item-r{
  283. flex: 2;
  284. text-align: right;
  285. line-height: 96rpx;
  286. .icon-gougou{
  287. font-size: 66rpx;
  288. color: #FFFFFF;
  289. }
  290. }
  291. }
  292. }
  293. }
  294. }
  295. .pay-button{
  296. width: 100%;
  297. float: left;
  298. margin-top: 200rpx;
  299. .btn{
  300. width: 662rpx;
  301. height: 88rpx;
  302. border-radius: 14rpx;
  303. font-size: $font-size-28;
  304. line-height: 88rpx;
  305. color: #FFFFFF;
  306. margin: 0 auto;
  307. text-align: center;
  308. background:$btn-confirm;
  309. }
  310. }
  311. }
  312. .freight-alert{
  313. width: 100%;
  314. height: 100%;
  315. background: rgba(0,0,0,.5);
  316. position: fixed;
  317. top: 0;
  318. left: 0;
  319. z-index: 8888;
  320. transition: all 0.4s;
  321. &.none{
  322. display: none;
  323. }
  324. &.show{
  325. display: block;
  326. }
  327. .content{
  328. width: 422rpx;
  329. height:434rpx;
  330. position: absolute;
  331. background: $bg-color;
  332. left: 0;
  333. right: 0;
  334. bottom: 0;
  335. top: 0;
  336. margin: auto;
  337. padding: 20rpx 32rpx;
  338. border-radius: 12rpx;
  339. .title{
  340. width: 100%;
  341. height: 68rpx;
  342. line-height: 68rpx;
  343. font-size: $font-size-28;
  344. color: $text-color;
  345. text-align: center;
  346. position: relative;
  347. .icon-iconfontguanbi{
  348. width: 68rpx;
  349. height: 68rpx;
  350. text-align: center;
  351. line-height: 68rpx;
  352. position: absolute;
  353. right: 0;
  354. top: 0;
  355. font-size: $font-size-36;
  356. color: #999999;
  357. }
  358. }
  359. .text-content{
  360. width: 100%;
  361. height: auto;
  362. .text{
  363. padding: 20rpx 0;
  364. line-height: 44rpx;
  365. font-size: $font-size-26;
  366. color:#666666;
  367. text-align: justify;
  368. }
  369. .text-p{
  370. line-height: 44rpx;
  371. font-size: $font-size-26;
  372. color:$color-system;
  373. text-align: left;
  374. }
  375. }
  376. }
  377. }
  378. </style>