pay_success.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="pageBg">
  3. <view class="success_box">
  4. <image src="http://139.9.103.171:1888/img/image/success.png"></image>
  5. <text v-if="state">{{state==1?"支付成功":"支付失败"}}</text>
  6. <view class="price"><text>¥</text><text>{{amount}}</text></view>
  7. <view class="btn_group">
  8. <view class="go_home btn" @tap="goHome">返回首页</view>
  9. <view class="go_order_detail btn" @tap="goOrderDetail">查看订单</view>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. tradeNo: '',
  19. amount: '',
  20. payFlag: '',
  21. state: '',
  22. orderSns: ''
  23. }
  24. },
  25. methods: {
  26. onLoadPage(options) {
  27. wx.hideShareMenu();
  28. console.log(options);
  29. this.payFlag = options.payFlag;
  30. this.state = options.state;
  31. this.tradeNo = options.tradeNo;
  32. this.amount = options.amount;
  33. this.orderSns = options.orderSns;
  34. this.wxappFinish();
  35. },
  36. async wxappFinish() {
  37. let data = {};
  38. data.tradeNo = this.tradeNo;
  39. data.status=this.state;
  40. let res = await this.$api.wxappFinish(data);
  41. console.log(res);
  42. },
  43. goHome() {
  44. uni.switchTab({
  45. url: '/pages/home'
  46. });
  47. },
  48. goOrderDetail() {
  49. if (this.payFlag == this.$global.payFlag.normal) {
  50. this.$util.refreshPage([
  51. 'pages/wode/wode'
  52. ])
  53. }else if (this.payFlag == this.$global.payFlag.order) {
  54. this.$util.refreshPage([
  55. 'pages/wode/wode',
  56. '/pagesM/pages/mine_order_list'
  57. ])
  58. }
  59. uni.redirectTo({
  60. url: "/pagesM/pages/order_detail?orderSns=" + this.orderSns
  61. });
  62. }
  63. },
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .success_box {
  68. display: flex;
  69. flex-direction: column;
  70. align-items: center;
  71. width: 100%;
  72. image {
  73. width: 100upx;
  74. height: 100upx;
  75. padding-top: 110upx;
  76. }
  77. text {
  78. color: #353535;
  79. font-size: 30upx;
  80. margin-top: 20upx;
  81. }
  82. .price {
  83. color: #333333;
  84. margin-top: 50upx;
  85. text:first-child {
  86. font-size: 30upx;
  87. }
  88. text:last-child {
  89. font-size: 60upx;
  90. }
  91. }
  92. .btn_group {
  93. display: flex;
  94. flex-direction: row;
  95. align-items: center;
  96. margin-top: 140upx;
  97. width: 520upx;
  98. justify-content: space-between;
  99. .btn {
  100. border-radius: 10upx;
  101. font-size: 30upx;
  102. padding: 15upx 50upx;
  103. letter-spacing: 1upx;
  104. }
  105. .go_home {
  106. background: #fff;
  107. color: #333;
  108. border: 1upx solid #ccc;
  109. }
  110. .go_order_detail {
  111. background: $dt-color-primary;
  112. color: #fff;
  113. }
  114. }
  115. }
  116. </style>