order-success.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="container cashier">
  3. <cu-custom :navbar-data='nvabarData'></cu-custom>
  4. <view class="container-cash clearfix" :style="{marginTop:CustomBar+'px'}">
  5. <view class="container-wrapper">
  6. <view class="cash-icon">
  7. <text class="iconfont" :class="payStatus ? 'icon-wancheng' : 'icon-shibai'"></text>
  8. </view>
  9. <view class="cash-text">
  10. <text>{{ successText }}</text>
  11. </view>
  12. </view>
  13. <view class="container-amount">
  14. <view class="amount-label">支付金额</view>
  15. <view class="amount-money">¥{{ amuntMoney | NumFormat }}</view>
  16. </view>
  17. <view class="container-button">
  18. <view class="btn btn-home" v-if="payStatus" @click="this.$api.switchTabTo('/pages/tabBar/home/index')">回到首页</view>
  19. <view class="btn btn-home" v-else @click="toAgainPay">重新支付</view>
  20. <view class="btn btn-open" @click="details">查看订单</view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default{
  27. data(){
  28. return{
  29. orderId:0,
  30. nvabarData: { //顶部自定义导航
  31. haveBack:false,
  32. haveHome:true,
  33. showCapsule:1, // 是否显示左上角图标 1表示显示 0表示不显示,
  34. showSearch: 0,
  35. title: '支付结果', // 导航栏 中间的标题
  36. textLeft:this.$store.state.isIphone
  37. },
  38. payType:'',
  39. payStatus:false,
  40. amuntMoney:0,
  41. successText:'本次支付失败',
  42. isIphoneX:this.$store.state.isIphoneX,
  43. CustomBar:this.CustomBar,// 顶部导航栏高度
  44. }
  45. },
  46. filters:{
  47. NumFormat(value) {
  48. //处理金额
  49. if (value) {
  50. return Number(value).toFixed(2)
  51. } else {
  52. return '0.00'
  53. }
  54. }
  55. },
  56. onLoad(option) {
  57. this.initData(option)
  58. },
  59. methods:{
  60. initData(option){
  61. const data = JSON.parse(option.data);
  62. this.orderId = data.data.orderId
  63. this.payType = data.data.type
  64. this.amuntMoney = data.data.payAmount
  65. if(this.payType == 'success'){
  66. this.payStatus = true
  67. this.successText = '本次支付成功'
  68. }else{
  69. this.payStatus = false
  70. this.successText = '本次支付失败'
  71. }
  72. console.log(this.orderId)
  73. },
  74. toAgainPay(){
  75. this.$api.navigateBack(2)
  76. },
  77. details(){
  78. this.$api.redirectTo('/pages/user/order/order-details?type=share&orderId='+this.orderId)
  79. }
  80. },
  81. onShow() {
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. page{
  87. height: auto !important;
  88. }
  89. .container-cash{
  90. width: 100%;
  91. .container-wrapper{
  92. width:100%;
  93. height: auto;
  94. padding: 120rpx 24rpx 0 24rpx;
  95. box-sizing: border-box;
  96. .cash-icon{
  97. width: 100%;
  98. height: 90rpx;
  99. text-align: center;
  100. .iconfont{
  101. font-size: 80rpx;
  102. &.icon-wancheng{
  103. color:#00BE6F ;
  104. }
  105. &.icon-shibai{
  106. color:#F94B4B ;
  107. }
  108. }
  109. }
  110. .cash-text{
  111. width: 100%;
  112. height: 90rpx;
  113. text-align: center;
  114. font-size: $font-size-28;
  115. color: $text-color;
  116. line-height: 90rpx;
  117. padding-bottom: 40rpx;
  118. }
  119. }
  120. .container-amount{
  121. width: 100%;
  122. height: 130rpx;
  123. box-sizing: border-box;
  124. padding: 0 24rpx;
  125. margin-bottom: 24rpx;
  126. font-size: $font-size-28;
  127. color: #333333;
  128. line-height: 90rpx;
  129. border-top: 20rpx solid #F7F7F7;
  130. border-bottom: 20rpx solid #F7F7F7;
  131. .amount-label{
  132. float: left;
  133. font-weight: bold;
  134. }
  135. .amount-money{
  136. float: right;
  137. text-align: right;
  138. }
  139. }
  140. .container-button{
  141. width: 100%;
  142. box-sizing: border-box;
  143. padding: 80rpx 75rpx;
  144. .btn{
  145. width: 100%;
  146. height: 90rpx;
  147. border-radius: 50rpx;
  148. line-height: 90rpx;
  149. box-sizing: border-box;
  150. text-align: center;
  151. font-size: $font-size-26;
  152. color: #FFFFFF;
  153. margin: 24rpx 0;
  154. &.btn-open{
  155. background:#FFFFFF;
  156. border: 1px solid $color-system;
  157. color: $color-system;
  158. }
  159. &.btn-home{
  160. background:$btn-confirm;
  161. }
  162. }
  163. }
  164. }
  165. </style>