payResult.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="content">
  3. <view class="success-title">{{payResult == 1 ? '开通成功' : (payResult == 0 ? '待支付' : '开通失败')}}</view>
  4. <view class="success-icon">
  5. <u-icon name="clock-fill" :color="mainColor" size="156" v-if="payResult == 0"></u-icon>
  6. <u-icon name="checkmark-circle-fill" color="#19be6b" size="156" v-else-if="payResult == 1"></u-icon>
  7. <u-icon name="close-circle-fill" color="#fa3534" size="156" v-else-if="payResult == 2"></u-icon>
  8. </view>
  9. <view class="success-text">{{payResult == 1 ? '恭喜您!开通会员成功!' : (payResult == 0 ? '请支付该订单!' : '支付失败!无法开通会员!')}}</view>
  10. <view class="success-text">订单号:{{orderId}}</view>
  11. <view class="handle-fix-box">
  12. <u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="goBack()">返回</u-button>
  13. </view>
  14. <u-top-tips ref="uTips"></u-top-tips>
  15. </view>
  16. </template>
  17. <script>
  18. import {
  19. mapGetters
  20. } from 'vuex'
  21. const NET = require('@/utils/request')
  22. const API = require('@/config/api')
  23. export default {
  24. computed: {
  25. ...mapGetters([
  26. 'mainColor',
  27. 'customStyle',
  28. ])
  29. },
  30. data() {
  31. return {
  32. orderId: '',
  33. payResult: '0',
  34. }
  35. },
  36. onLoad(options) {
  37. this.orderId = options.id
  38. NET.request(API.getPayResult, {
  39. oderNo: this.orderId
  40. }, 'POST').then(res => {
  41. this.payResult = res.data.status
  42. }).catch(error => {
  43. this.$refs.uTips.show({
  44. title: error.message,
  45. type: 'warning',
  46. })
  47. })
  48. },
  49. onReady() {},
  50. methods: {
  51. // 返回
  52. goBack() {
  53. uni.navigateBack()
  54. },
  55. },
  56. }
  57. </script>
  58. <style>
  59. page {
  60. width: 100%;
  61. height: 100%;
  62. position: relative;
  63. }
  64. </style>
  65. <style lang="scss" scoped>
  66. @import "@/static/css/themes.scss";
  67. .content {
  68. width: 100%;
  69. float: left;
  70. padding: 0 15px 60px 15px;
  71. box-sizing: border-box;
  72. .success-title {
  73. width: 100%;
  74. height: 64px;
  75. float: left;
  76. line-height: 48px;
  77. font-size: 28px;
  78. text-align: center;
  79. }
  80. .success-icon {
  81. width: 100%;
  82. float: left;
  83. text-align: center;
  84. margin-bottom: 20px;
  85. }
  86. .success-text {
  87. width: 100%;
  88. height: 20px;
  89. float: left;
  90. line-height: 20px;
  91. font-size: 12px;
  92. text-align: center;
  93. }
  94. }
  95. </style>