pay_status.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view :style="colorStyle" class="main">
  3. <view class='payment-status'>
  4. <view class='iconfont icons icon-duihao2 bg-color'></view>
  5. <view class='status'>{{$t(`代付成功`)}}</view>
  6. <view class='wrapper'>
  7. <view class='itemCom'> <text class="rmb">{{$t(`¥`)}}</text> {{resData.pay_price || 0.00}}</view>
  8. </view>
  9. <view class="head-other">
  10. <view class="user-img">
  11. <image class="" :src="resData.avatar" mode=""></image>
  12. </view>
  13. <view class="order-status">
  14. {{$t(`谢谢你为我付款,还可以再去看看其他商品哟~`)}}
  15. </view>
  16. </view>
  17. </view>
  18. <button @click="goIndex" class='returnBnt' formType="submit" hover-class='none'>{{$t(`返回首页`)}}</button>
  19. </view>
  20. </template>
  21. <script>
  22. import {
  23. getOrderDetail
  24. } from '@/api/order.js';
  25. import {
  26. toLogin
  27. } from '@/libs/login.js';
  28. import {
  29. mapGetters
  30. } from "vuex";
  31. import colors from "@/mixins/color";
  32. import {
  33. friendDetail
  34. } from '@/api/user.js'
  35. export default {
  36. mixins: [colors],
  37. data() {
  38. return {
  39. loading: false,
  40. isAuto: false, //没有授权的不会自动授权
  41. isShowAuth: false, //是否隐藏授权
  42. resData: {}
  43. };
  44. },
  45. computed: mapGetters(['isLogin']),
  46. watch: {
  47. isLogin: {
  48. handler: (newV, oldV) => {
  49. if (newV) {
  50. this.getDetail();
  51. }
  52. },
  53. deep: true
  54. }
  55. },
  56. onLoad(options) {
  57. this.options = options
  58. if (!options.order_id) return this.$util.Tips({
  59. title: this.$t(`缺少参数无法查看订单支付状态`)
  60. }, {
  61. tab: 3,
  62. url: 1
  63. });
  64. this.orderId = options.order_id;
  65. },
  66. onShow() {
  67. if (this.isLogin) {
  68. this.getDetail();
  69. } else {
  70. toLogin();
  71. }
  72. },
  73. methods: {
  74. getDetail() {
  75. friendDetail(this.orderId).then(res => {
  76. if (this.resData.paid == 0) {
  77. return this.$util.Tips({
  78. title: this.$t(`该订单暂未支付`)
  79. }, {
  80. tab: 3,
  81. url: 1
  82. });
  83. }
  84. this.resData = res.data.info
  85. })
  86. },
  87. openTap() {
  88. this.$set(this, 'couponsHidden', !this.couponsHidden);
  89. },
  90. onLoadFun() {
  91. this.getDetail();
  92. },
  93. /**
  94. * 支付完成查询支付状态
  95. */
  96. getOrderPayInfo() {
  97. let that = this;
  98. uni.showLoading({
  99. title: that.$t(`正在加载中`)
  100. });
  101. getOrderDetail(that.orderId).then(res => {
  102. uni.hideLoading();
  103. that.$set(that, 'order_pay_info', res.data);
  104. uni.setNavigationBarTitle({
  105. title: res.data.paid ? that.$t(`支付成功`) : that.$t(`未支付`)
  106. });
  107. this.loading = true
  108. }).catch(err => {
  109. this.loading = true
  110. uni.hideLoading();
  111. });
  112. },
  113. /**
  114. * 去首页关闭当前所有页面
  115. */
  116. goIndex(e) {
  117. uni.switchTab({
  118. url: '/pages/index/index'
  119. });
  120. },
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. .main {
  126. width: 100%;
  127. height: 100vh;
  128. background-color: #fff;
  129. .payment-status {
  130. background-color: #fff;
  131. margin: 0rpx 30rpx 0 30rpx;
  132. border-radius: 10rpx;
  133. padding: 94rpx 0 60rpx 0;
  134. color: #333;
  135. .icons {
  136. font-size: 70rpx;
  137. width: 140rpx;
  138. height: 140rpx;
  139. border-radius: 50%;
  140. color: #fff;
  141. text-align: center;
  142. line-height: 140rpx;
  143. border: 6rpx solid #f5f5f5;
  144. margin: 0rpx auto 0 auto;
  145. background-color: #999;
  146. }
  147. .rmb {
  148. font-size: 33rpx;
  149. }
  150. .status {
  151. font-size: 32rpx;
  152. font-weight: bold;
  153. text-align: center;
  154. margin: 25rpx 0 7rpx 0;
  155. }
  156. .wrapper {
  157. text-align: center;
  158. color: #333;
  159. font-size: 66rpx;
  160. font-weight: bold;
  161. }
  162. .head-other {
  163. display: flex;
  164. align-items: center;
  165. justify-content: center;
  166. padding-top: 20rpx;
  167. .user-img {
  168. display: flex;
  169. align-items: center;
  170. image {
  171. width: 50rpx;
  172. height: 50rpx;
  173. border-radius: 50%;
  174. }
  175. }
  176. .order-status {
  177. margin-left: 20rpx;
  178. color: #666666;
  179. padding: 6rpx 13rpx;
  180. font-size: 24rpx;
  181. }
  182. }
  183. }
  184. .returnBnt {
  185. width: 80%;
  186. height: 86rpx;
  187. border-radius: 50rpx;
  188. color: #fff;
  189. font-size: 30rpx;
  190. text-align: center;
  191. line-height: 86rpx;
  192. margin: 0 auto;
  193. background-color: var(--view-theme);
  194. }
  195. }
  196. </style>