error.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 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. filters: {
  66. NumFormat(value) {
  67. //处理金额
  68. return Number(value).toFixed(2)
  69. }
  70. },
  71. computed: {
  72. ...mapGetters(['isIphoneX']),
  73. hanldOrder() {
  74. return {
  75. order: this.orderInfo
  76. }
  77. }
  78. },
  79. methods: {
  80. initOrderInfo() {
  81. this.orderInfo = uni.getStorageSync('orderInfo')
  82. uni.removeStorageSync('orderInfo')
  83. },
  84. setHeaderBtnPosi() {
  85. // 获得胶囊按钮位置信息
  86. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  87. return headerBtnPosi
  88. },
  89. setSysteminfo() {
  90. let systeminfo
  91. uni.getSystemInfo({
  92. // 获取设备信息
  93. success: res => {
  94. systeminfo = res
  95. }
  96. })
  97. return systeminfo
  98. },
  99. // 查看订单
  100. searchOrder() {
  101. this.$api.redirectTo('/pages/user/order/order-details?type=confim&orderId=' + this.orderInfo.orderId)
  102. }
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. page {
  108. background-color: #f7f7f7;
  109. height: auto !important;
  110. }
  111. .container-cash {
  112. width: 100%;
  113. .container-wrapper {
  114. width: 100%;
  115. margin: 0 auto;
  116. margin-top: 120rpx;
  117. display: flex;
  118. flex-direction: column;
  119. align-items: center;
  120. background-color: #ffffff;
  121. .cash-icon {
  122. width: 210rpx;
  123. height: 210rpx;
  124. margin-top: 112rpx;
  125. image {
  126. width: 210rpx;
  127. height: 210rpx;
  128. }
  129. }
  130. .cash-text {
  131. font-size: $font-size-28;
  132. color: #666666;
  133. line-height: 104rpx;
  134. font-weight: bold;
  135. }
  136. }
  137. .container-money {
  138. width: 100%;
  139. height: 90rpx;
  140. float: left;
  141. line-height: 90rpx;
  142. font-size: $font-size-28;
  143. box-sizing: border-box;
  144. padding: 0 24rpx;
  145. margin-top: 20rpx;
  146. background-color: #ffffff;
  147. .label {
  148. float: left;
  149. color: #333333;
  150. }
  151. .money {
  152. float: right;
  153. color: #666666;
  154. }
  155. }
  156. .container-button {
  157. width: 100%;
  158. height: auto;
  159. float: left;
  160. display: flex;
  161. flex-direction: column;
  162. align-items: center;
  163. margin-top: 160rpx;
  164. .btn {
  165. width: 600rpx;
  166. height: 90rpx;
  167. border-radius: 45rpx;
  168. line-height: 90rpx;
  169. text-align: center;
  170. font-size: $font-size-26;
  171. color: #ffffff;
  172. box-sizing: border-box;
  173. border: 1px solid $color-system;
  174. margin-bottom: 24rpx;
  175. &.btn-open {
  176. color: $color-system;
  177. }
  178. &.btn-pay {
  179. border-color: $color-system;
  180. background: $btn-confirm;
  181. }
  182. }
  183. }
  184. }
  185. </style>