success.vue 5.3 KB

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