error.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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 | formatPrice }}</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. 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. searchOrder() {
  95. this.$api.redirectTo('/pages/user/order/order-details?type=confim&orderId=' + this.orderInfo.orderId)
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. page {
  102. background-color: #f7f7f7;
  103. height: auto !important;
  104. }
  105. .container-cash {
  106. width: 100%;
  107. .container-wrapper {
  108. width: 100%;
  109. margin: 0 auto;
  110. margin-top: 120rpx;
  111. display: flex;
  112. flex-direction: column;
  113. align-items: center;
  114. background-color: #ffffff;
  115. .cash-icon {
  116. width: 210rpx;
  117. height: 210rpx;
  118. margin-top: 112rpx;
  119. image {
  120. width: 210rpx;
  121. height: 210rpx;
  122. }
  123. }
  124. .cash-text {
  125. font-size: $font-size-28;
  126. color: #666666;
  127. line-height: 104rpx;
  128. font-weight: bold;
  129. }
  130. }
  131. .container-money {
  132. width: 100%;
  133. height: 90rpx;
  134. float: left;
  135. line-height: 90rpx;
  136. font-size: $font-size-28;
  137. box-sizing: border-box;
  138. padding: 0 24rpx;
  139. margin-top: 20rpx;
  140. background-color: #ffffff;
  141. .label {
  142. float: left;
  143. color: #333333;
  144. }
  145. .money {
  146. float: right;
  147. color: #666666;
  148. }
  149. }
  150. .container-button {
  151. width: 100%;
  152. height: auto;
  153. float: left;
  154. display: flex;
  155. flex-direction: column;
  156. align-items: center;
  157. margin-top: 160rpx;
  158. .btn {
  159. width: 600rpx;
  160. height: 90rpx;
  161. border-radius: 45rpx;
  162. line-height: 90rpx;
  163. text-align: center;
  164. font-size: $font-size-26;
  165. color: #ffffff;
  166. box-sizing: border-box;
  167. border: 1px solid $color-system;
  168. margin-bottom: 24rpx;
  169. &.btn-open {
  170. color: $color-system;
  171. }
  172. &.btn-pay {
  173. border-color: $color-system;
  174. background: $btn-confirm;
  175. }
  176. }
  177. }
  178. }
  179. </style>