error.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class="container cashier">
  3. <view class="container-cash clearfix">
  4. <view class="container-wrapper">
  5. <view class="cash-icon"><image :src="StaticUrl + 'icon-pay-fail.png'" mode=""></image></view>
  6. <view class="cash-text">
  7. <text>{{ successText }}</text>
  8. </view>
  9. </view>
  10. <view class="container-money">
  11. <view class="label">支付金额</view>
  12. <view class="money">¥{{ orderInfo.payableAmount | formatPrice }}</view>
  13. </view>
  14. <view class="container-button">
  15. <view class="btn btn-pay" @click="miniWxPayFor(orderInfo)">重新支付</view>
  16. <view class="btn btn-open" @click="searchOrder">查看订单</view>
  17. </view>
  18. </view>
  19. <cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
  20. </view>
  21. </template>
  22. <script>
  23. import authorize from '@/common/authorize.js'
  24. import CmLoading from '@/components/cm-module/cm-loading/cm-loading.vue'
  25. import wechatPay from './mixins/wechatPay.js'
  26. import { mapGetters } from 'vuex'
  27. export default {
  28. components: {
  29. CmLoading
  30. },
  31. // 混入支付
  32. mixins: [wechatPay],
  33. data() {
  34. return {
  35. StaticUrl: this.$Static,
  36. orderId: '',
  37. successText: '订单支付失败',
  38. orderInfo: {}
  39. }
  40. },
  41. onLoad() {
  42. this.initOrderInfo()
  43. this.orderPaySuccess()
  44. },
  45. computed: {
  46. ...mapGetters(['isIphoneX']),
  47. hanldOrder() {
  48. return {
  49. order: this.orderInfo
  50. }
  51. }
  52. },
  53. methods: {
  54. // 支付回调执行函数
  55. orderPaySuccess(){
  56. this.$on('orderPaySuccess', ()=>{
  57. const orderInfo = this.hanldOrder.order
  58. if(orderInfo.collageId > 0){
  59. uni.redirectTo({ url: `/pages/fight-order/fight-detail?collageId=${orderInfo.collageId}` })
  60. }else{
  61. uni.redirectTo({ url: '/pages/order/success' })
  62. }
  63. })
  64. },
  65. initOrderInfo() {
  66. this.orderInfo = uni.getStorageSync('orderInfo')
  67. uni.removeStorageSync('orderInfo')
  68. },
  69. // 查看订单
  70. searchOrder() {
  71. this.$api.redirectTo('/pages/order/order-detail?type=confim&orderId=' + this.orderInfo.orderId)
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. page {
  78. background-color: #f7f7f7;
  79. height: auto !important;
  80. }
  81. .container-cash {
  82. width: 100%;
  83. .container-wrapper {
  84. width: 100%;
  85. margin: 0 auto;
  86. margin-top: 120rpx;
  87. display: flex;
  88. flex-direction: column;
  89. align-items: center;
  90. background-color: #ffffff;
  91. .cash-icon {
  92. width: 210rpx;
  93. height: 210rpx;
  94. margin-top: 112rpx;
  95. image {
  96. width: 210rpx;
  97. height: 210rpx;
  98. }
  99. }
  100. .cash-text {
  101. font-size: $font-size-28;
  102. color: #666666;
  103. line-height: 104rpx;
  104. font-weight: bold;
  105. }
  106. }
  107. .container-money {
  108. width: 100%;
  109. height: 90rpx;
  110. float: left;
  111. line-height: 90rpx;
  112. font-size: $font-size-28;
  113. box-sizing: border-box;
  114. padding: 0 24rpx;
  115. margin-top: 20rpx;
  116. background-color: #ffffff;
  117. .label {
  118. float: left;
  119. color: #333333;
  120. }
  121. .money {
  122. float: right;
  123. color: #666666;
  124. }
  125. }
  126. .container-button {
  127. width: 100%;
  128. height: auto;
  129. float: left;
  130. display: flex;
  131. flex-direction: column;
  132. align-items: center;
  133. margin-top: 160rpx;
  134. .btn {
  135. width: 600rpx;
  136. height: 90rpx;
  137. border-radius: 45rpx;
  138. line-height: 90rpx;
  139. text-align: center;
  140. font-size: $font-size-26;
  141. color: #ffffff;
  142. box-sizing: border-box;
  143. border: 1px solid $color-system;
  144. margin-bottom: 24rpx;
  145. &.btn-open {
  146. color: $color-system;
  147. }
  148. &.btn-pay {
  149. border-color: $color-system;
  150. background: $btn-confirm;
  151. }
  152. }
  153. }
  154. }
  155. </style>