success.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="container cashier">
  3. <header-pay
  4. :systeminfo="systeminfo"
  5. :navbar-data="nvabarData"
  6. :headerBtnPosi="headerBtnPosi"
  7. :isBackType="true"
  8. :path="'/pages/user/cart/cart'"
  9. >
  10. </header-pay>
  11. <view class="container-cash clearfix" :style="{ marginTop: CustomBar + 'px' }">
  12. <view class="container-wrapper">
  13. <view class="cash-icon"> <image :src="StaticUrl + 'icon-pay-success.png'" mode=""></image> </view>
  14. <view class="cash-text">
  15. <text>{{ successText }}</text>
  16. </view>
  17. </view>
  18. <view class="container-money">
  19. <view class="label">支付金额</view>
  20. <view class="money">¥{{ orderInfo.payableAmount | formatPrice }}</view>
  21. </view>
  22. <view class="container-button">
  23. <view class="btn btn-pay" @click="goHome">继续购买</view>
  24. <view class="btn btn-open" @click="searchOrder">查看订单</view>
  25. </view>
  26. </view>
  27. <cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
  28. </view>
  29. </template>
  30. <script>
  31. import HeaderPay from '@/components/cm-module/headerNavbar/header-pay'
  32. import authorize from '@/common/authorize.js'
  33. import CmLoading from '@/components/cm-module/cm-loading/cm-loading.vue'
  34. import wechatPay from '@/mixins/wechatPay.js'
  35. import { mapGetters } from 'vuex'
  36. export default {
  37. components: {
  38. HeaderPay,
  39. CmLoading
  40. },
  41. // 混入支付
  42. mixins: [wechatPay],
  43. data() {
  44. return {
  45. StaticUrl: this.$Static,
  46. CustomBar: this.CustomBar, // 顶部导航栏高度
  47. orderId: '',
  48. nvabarData: {
  49. //顶部自定义导航
  50. haveBack: false,
  51. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  52. showSearch: 0,
  53. title: '支付结果', // 导航栏 中间的标题
  54. textLeft: this.$store.getters.isIphone
  55. },
  56. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  57. systeminfo: this.setSysteminfo(), //获取设备信息
  58. successText: '订单支付成功',
  59. orderInfo: {}
  60. }
  61. },
  62. onLoad() {
  63. this.initOrderInfo()
  64. },
  65. computed: {
  66. ...mapGetters(['isIphoneX']),
  67. hanldOrder() {
  68. return {
  69. order: this.orderInfo
  70. }
  71. }
  72. },
  73. methods: {
  74. initOrderInfo() {
  75. this.orderInfo = uni.getStorageSync('orderInfo')
  76. uni.removeStorageSync('orderInfo')
  77. },
  78. setHeaderBtnPosi() {
  79. // 获得胶囊按钮位置信息
  80. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  81. return headerBtnPosi
  82. },
  83. setSysteminfo() {
  84. let systeminfo
  85. uni.getSystemInfo({
  86. // 获取设备信息
  87. success: res => {
  88. systeminfo = res
  89. }
  90. })
  91. return systeminfo
  92. },
  93. // 回到首页
  94. goHome() {
  95. uni.reLaunch({ url: '/pages/tabBar/index/index' })
  96. },
  97. // 查看订单
  98. searchOrder() {
  99. this.$api.redirectTo('/pages/user/order/order-details?type=confim&orderId=' + this.orderInfo.orderId)
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. page {
  106. background-color: #f7f7f7;
  107. height: auto !important;
  108. }
  109. .container-cash {
  110. width: 100%;
  111. .container-wrapper {
  112. width: 100%;
  113. margin: 0 auto;
  114. margin-top: 120rpx;
  115. display: flex;
  116. flex-direction: column;
  117. align-items: center;
  118. background-color: #ffffff;
  119. .cash-icon {
  120. width: 210rpx;
  121. height: 210rpx;
  122. margin-top: 112rpx;
  123. image {
  124. width: 210rpx;
  125. height: 210rpx;
  126. }
  127. }
  128. .cash-text {
  129. font-size: $font-size-28;
  130. color: #666666;
  131. line-height: 104rpx;
  132. font-weight: bold;
  133. }
  134. }
  135. .container-money {
  136. width: 100%;
  137. height: 90rpx;
  138. float: left;
  139. line-height: 90rpx;
  140. font-size: $font-size-28;
  141. box-sizing: border-box;
  142. padding: 0 24rpx;
  143. margin-top: 20rpx;
  144. background-color: #ffffff;
  145. .label {
  146. float: left;
  147. color: #333333;
  148. }
  149. .money {
  150. float: right;
  151. color: #666666;
  152. }
  153. }
  154. .container-button {
  155. width: 100%;
  156. height: auto;
  157. float: left;
  158. display: flex;
  159. flex-direction: column;
  160. align-items: center;
  161. margin-top: 160rpx;
  162. .btn {
  163. width: 600rpx;
  164. height: 90rpx;
  165. border-radius: 45rpx;
  166. line-height: 90rpx;
  167. text-align: center;
  168. font-size: $font-size-26;
  169. color: #ffffff;
  170. box-sizing: border-box;
  171. border: 1px solid $color-system;
  172. margin-bottom: 24rpx;
  173. &.btn-open {
  174. color: $color-system;
  175. }
  176. &.btn-pay {
  177. border-color: $color-system;
  178. background: $btn-confirm;
  179. }
  180. }
  181. }
  182. }
  183. </style>