success.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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">继续购买</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. },
  44. computed: {
  45. ...mapGetters(['isIphoneX']),
  46. hanldOrder() {
  47. return {
  48. order: this.orderInfo
  49. }
  50. }
  51. },
  52. methods: {
  53. initOrderInfo() {
  54. this.orderInfo = uni.getStorageSync('orderInfo')
  55. uni.removeStorageSync('orderInfo')
  56. },
  57. // 回到首页
  58. goHome() {
  59. uni.reLaunch({ url: '/pages/tabBar/index/index' })
  60. },
  61. // 查看订单
  62. searchOrder() {
  63. this.$api.redirectTo('/pages/order/order-detail?type=confim&orderId=' + this.orderInfo.orderId)
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. page {
  70. background-color: #f7f7f7;
  71. height: auto !important;
  72. }
  73. .container-cash {
  74. width: 100%;
  75. .container-wrapper {
  76. width: 100%;
  77. margin: 0 auto;
  78. margin-top: 120rpx;
  79. display: flex;
  80. flex-direction: column;
  81. align-items: center;
  82. background-color: #ffffff;
  83. .cash-icon {
  84. width: 210rpx;
  85. height: 210rpx;
  86. margin-top: 112rpx;
  87. image {
  88. width: 210rpx;
  89. height: 210rpx;
  90. }
  91. }
  92. .cash-text {
  93. font-size: $font-size-28;
  94. color: #666666;
  95. line-height: 104rpx;
  96. font-weight: bold;
  97. }
  98. }
  99. .container-money {
  100. width: 100%;
  101. height: 90rpx;
  102. float: left;
  103. line-height: 90rpx;
  104. font-size: $font-size-28;
  105. box-sizing: border-box;
  106. padding: 0 24rpx;
  107. margin-top: 20rpx;
  108. background-color: #ffffff;
  109. .label {
  110. float: left;
  111. color: #333333;
  112. }
  113. .money {
  114. float: right;
  115. color: #666666;
  116. }
  117. }
  118. .container-button {
  119. width: 100%;
  120. height: auto;
  121. float: left;
  122. display: flex;
  123. flex-direction: column;
  124. align-items: center;
  125. margin-top: 160rpx;
  126. .btn {
  127. width: 600rpx;
  128. height: 90rpx;
  129. border-radius: 45rpx;
  130. line-height: 90rpx;
  131. text-align: center;
  132. font-size: $font-size-26;
  133. color: #ffffff;
  134. box-sizing: border-box;
  135. border: 1px solid $color-system;
  136. margin-bottom: 24rpx;
  137. &.btn-open {
  138. color: $color-system;
  139. }
  140. &.btn-pay {
  141. border-color: $color-system;
  142. background: $btn-confirm;
  143. }
  144. }
  145. }
  146. }
  147. </style>