success.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="container cashier">
  3. <view class="container-cash clearfix" :style="{ marginTop: CustomBar + 'px' }">
  4. <view class="container-wrapper">
  5. <view class="cash-icon"><image :src="StaticUrl + 'icon-pay-success.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="goHome" v-if="!hasOtherSplitOrder">继续购买</view>
  16. <view class="btn btn-pay" @click="onPayOnce" v-else>继续支付</view>
  17. <view class="btn btn-open" @click="searchOrder">查看订单</view>
  18. </view>
  19. </view>
  20. <cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
  21. </view>
  22. </template>
  23. <script>
  24. import authorize from '@/common/authorize.js'
  25. import CmLoading from '@/components/cm-module/cm-loading/cm-loading.vue'
  26. import wechatPay from './mixins/wechatPay.js'
  27. import { mapGetters } from 'vuex'
  28. export default {
  29. components: {
  30. CmLoading
  31. },
  32. // 混入支付
  33. mixins: [wechatPay],
  34. data() {
  35. return {
  36. StaticUrl: this.$Static,
  37. orderId: '',
  38. successText: '订单支付成功',
  39. orderInfo: {},
  40. orderDetail: {},
  41. mapStateArr: [11, 12, 13, 21, 22, 23, 111]
  42. }
  43. },
  44. onLoad() {
  45. this.initOrderInfo()
  46. },
  47. computed: {
  48. ...mapGetters(['isIphoneX']),
  49. hanldOrder() {
  50. return {
  51. order: this.orderInfo
  52. }
  53. },
  54. hasOtherSplitOrder() {
  55. return this.mapStateArr.includes(parseInt(this.orderDetail.status))
  56. }
  57. },
  58. methods: {
  59. initOrderInfo() {
  60. this.orderInfo = uni.getStorageSync('orderInfo')
  61. uni.removeStorageSync('orderInfo')
  62. this.getOrderDetail()
  63. },
  64. // 回到首页
  65. goHome() {
  66. uni.reLaunch({ url: '/pages/tabBar/index/index' })
  67. },
  68. // 查看订单
  69. searchOrder() {
  70. this.$api.redirectTo('/pages/order/order-detail?type=confim&orderId=' + this.orderInfo.orderId)
  71. },
  72. getOrderDetail() {
  73. this.OrderService.QueryOrderDetails({ orderId: this.orderInfo.orderId })
  74. .then(res => {
  75. this.orderDetail = res.data.order
  76. })
  77. .catch(err => {
  78. this.$util.modal('提示', '订单查询失败,请稍后重试~', '确定', '', false, () => {
  79. this.$api.switchTabTo('/pages/tabBar/index/index')
  80. })
  81. })
  82. },
  83. onPayOnce() {
  84. this.$api.navigateTo('/pages/order/order-pay?orderId=' + this.orderInfo.orderId)
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. page {
  91. background-color: #f7f7f7;
  92. height: auto !important;
  93. }
  94. .container-cash {
  95. width: 100%;
  96. .container-wrapper {
  97. width: 100%;
  98. margin: 0 auto;
  99. margin-top: 120rpx;
  100. display: flex;
  101. flex-direction: column;
  102. align-items: center;
  103. background-color: #ffffff;
  104. .cash-icon {
  105. width: 210rpx;
  106. height: 210rpx;
  107. margin-top: 112rpx;
  108. image {
  109. width: 210rpx;
  110. height: 210rpx;
  111. }
  112. }
  113. .cash-text {
  114. font-size: $font-size-28;
  115. color: #666666;
  116. line-height: 104rpx;
  117. font-weight: bold;
  118. }
  119. }
  120. .container-money {
  121. width: 100%;
  122. height: 90rpx;
  123. float: left;
  124. line-height: 90rpx;
  125. font-size: $font-size-28;
  126. box-sizing: border-box;
  127. padding: 0 24rpx;
  128. margin-top: 20rpx;
  129. background-color: #ffffff;
  130. .label {
  131. float: left;
  132. color: #333333;
  133. }
  134. .money {
  135. float: right;
  136. color: #666666;
  137. }
  138. }
  139. .container-button {
  140. width: 100%;
  141. height: auto;
  142. float: left;
  143. display: flex;
  144. flex-direction: column;
  145. align-items: center;
  146. margin-top: 160rpx;
  147. .btn {
  148. width: 600rpx;
  149. height: 90rpx;
  150. border-radius: 45rpx;
  151. line-height: 90rpx;
  152. text-align: center;
  153. font-size: $font-size-26;
  154. color: #ffffff;
  155. box-sizing: border-box;
  156. border: 1px solid $color-system;
  157. margin-bottom: 24rpx;
  158. &.btn-open {
  159. color: $color-system;
  160. }
  161. &.btn-pay {
  162. border-color: $color-system;
  163. background: $btn-confirm;
  164. }
  165. }
  166. }
  167. }
  168. </style>