pay-faild.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="pay-result">
  3. <!-- 提示图标 -->
  4. <view class="tip-icon">
  5. <image class="icon" :src="staticUrl + 'icon-pay-fail.png'"></image>
  6. <view class="tip">订单支付失败~~</view>
  7. </view>
  8. <!-- 支付金额 -->
  9. <view class="payAmount">
  10. <text class="label">支付金额:</text>
  11. <text class="price">¥{{ orderInfo.payableAmount | priceFormat }}</text>
  12. </view>
  13. <!-- 执行操作 -->
  14. <view class="control">
  15. <tui-button type="base" width="600rpx" height="90rpx" shape="circle" :size="28" @click="onPayAgain">
  16. 重新支付
  17. </tui-button>
  18. <tui-button
  19. type="base"
  20. :plain="true"
  21. width="600rpx"
  22. height="90rpx"
  23. shape="circle"
  24. :size="28"
  25. @click="onSearch"
  26. >
  27. 查看订单
  28. </tui-button>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import wechatPayMixin from '@/pages/views/order/mixins/wechatPay.js'
  34. export default {
  35. mixins: [wechatPayMixin],
  36. data() {
  37. return {
  38. orderInfo: {
  39. collageId: '0',
  40. orderId: '18897',
  41. orderMark: '#18897#',
  42. orderNo: 'H164783438949249',
  43. payTotalFee: '0',
  44. payableAmount: '0'
  45. }
  46. }
  47. },
  48. beforeDestroy() {
  49. this.$off('orderPaySuccess')
  50. },
  51. onLoad() {
  52. this.orderInfo = uni.getStorageSync('PAY_ORDER_INFO')
  53. this.orderPaySuccess()
  54. },
  55. methods: {
  56. // 支付成功回调
  57. orderPaySuccess() {
  58. this.$on('orderPaySuccess', orderInfo => {
  59. if (orderInfo.collageFlag) {
  60. this.$router.redirectTo(`share-buy/share-buy-detail?collageId=${orderInfo.collageId}`)
  61. } else {
  62. uni.setStorageSync('PAY_ORDER_INFO', orderInfo)
  63. this.$router.redirectTo('order/pay-success')
  64. }
  65. })
  66. },
  67. onPayAgain() {
  68. this.miniWxPayFor(this.orderInfo)
  69. },
  70. onSearch() {
  71. this.$router.redirectTo('order/order-detail?orderId=' + this.orderInfo.orderId)
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .pay-result {
  78. height: 100vh;
  79. .tip-icon {
  80. @extend .cm-flex-center;
  81. flex-direction: column;
  82. height: 340rpx;
  83. background-color: #fff;
  84. .icon {
  85. width: 210rpx;
  86. height: 210rpx;
  87. }
  88. .tip {
  89. margin-top: 24rpx;
  90. font-size: 28rpx;
  91. font-weight: bold;
  92. color: #666;
  93. }
  94. }
  95. .payAmount {
  96. @extend .cm-flex-between;
  97. height: 90rpx;
  98. padding: 0 24rpx;
  99. margin-top: 24rpx;
  100. font-size: 28rpx;
  101. background-color: #fff;
  102. .label {
  103. color: #333333;
  104. }
  105. .price {
  106. color: #666666;
  107. }
  108. }
  109. .control {
  110. @extend .cm-flex-between;
  111. flex-direction: column;
  112. height: 204rpx;
  113. margin-top: 100rpx;
  114. }
  115. }
  116. </style>