success.vue 3.2 KB

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