success.vue 5.4 KB

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