index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="payCourteous">
  3. <JHeader title="支付成功" width="50" height="50" style="padding: 24upx 0 0;"></JHeader>
  4. <view class="payTitBox flex-items flex-center" :style="{ 'padding-top': topHeight + 'px' }">
  5. <view class="payTit fs30">支付成功</view>
  6. </view>
  7. <view class="resultCard">
  8. <view class="imgBox">
  9. <tui-icon name="wallet" :size="166" unit="upx" color="#333333"></tui-icon>
  10. </view>
  11. <view class="successful">支付成功</view>
  12. <view class="btnBox fs28 font-color-333">
  13. <view class="orderBtn btn" @click="goToOrder">查看订单</view>
  14. <view class="homeBtn btn" @click="goToHome">返回首页</view>
  15. </view>
  16. <view v-if="orderPolite.growth || orderPolite.couponList" class="orderPolite">
  17. <view>
  18. <tui-icon name="service-fill" :size="186" unit="upx" color="#f94f98"></tui-icon>
  19. </view>
  20. <view class="rightInfo">
  21. <view v-if="orderPolite.credit" class="growthBox">
  22. 恭喜获得额外积分<text class="growth">{{ orderPolite.credit }}</text>
  23. </view>
  24. <view v-if="orderPolite.growth" class="growthBox">
  25. 恭喜获得额外会员成长值<text class="growth">{{ orderPolite.growth }}</text>
  26. </view>
  27. <view v-for="(item, index) in orderPolite.couponList" :key="index" class="couponBox">
  28. 恭喜获得<text class="coupon">{{ item.discount }}</text>{{ item.couponType === 1 ? '满减优惠券' : '折扣券' }}
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <!-- 推荐 -->
  34. <ATFHoteRecommed></ATFHoteRecommed>
  35. <!-- 广告 -->
  36. <ATFAdWindow ref="refATFAdWindow" :trigger-condition="2"></ATFAdWindow>
  37. </view>
  38. </template>
  39. <script>
  40. import { getOrderPoliteApi } from '../../../api/anotherTFInterface'
  41. export default {
  42. name: 'PaySuccessful',
  43. data() {
  44. return {
  45. orderId: null,
  46. orderPolite: {},
  47. topHeight: 0
  48. }
  49. },
  50. onShow() {
  51. // #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
  52. const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  53. this.topHeight = menuButtonInfo.top + 10
  54. // #endif
  55. },
  56. onLoad(option) {
  57. this.orderId = option.orderId
  58. if (this.orderId) {
  59. this.getOrderPoliteFn()
  60. }
  61. this.$nextTick(() => {
  62. this.$refs.refATFAdWindow.getAd()
  63. })
  64. },
  65. methods: {
  66. goToOrder() {
  67. this.$switchTab('/')
  68. },
  69. goToHome() {
  70. this.$switchTab('/')
  71. },
  72. getOrderPoliteFn() {
  73. uni.showLoading({
  74. mask: true,
  75. title: '加载中...'
  76. })
  77. getOrderPoliteApi({
  78. orderId: this.orderId
  79. }).then((res) => {
  80. uni.hideLoading()
  81. this.orderPolite = res.data
  82. })
  83. .catch((e) => {
  84. uni.hideLoading()
  85. })
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="less" scoped>
  91. .payCourteous {
  92. .payTitBox {
  93. height: 100rpx;
  94. position: fixed;
  95. left: 0;
  96. top: 0;
  97. width: 100%;
  98. background: #FFFFFF;
  99. z-index: 99;
  100. }
  101. .resultCard {
  102. padding: 200rpx 0 50rpx 0;
  103. .imgBox {
  104. padding-top: 100rpx;
  105. display: flex;
  106. justify-content: center;
  107. }
  108. .successful {
  109. text-align: center;
  110. margin-top: 30rpx;
  111. }
  112. .btnBox {
  113. display: flex;
  114. justify-content: center;
  115. margin-top: 30rpx;
  116. .btn {
  117. width: 140rpx;
  118. height: 58rpx;
  119. line-height: 58rpx;
  120. border: 2rpx solid #999999;
  121. text-align: center;
  122. font-size: 24rpx;
  123. color: #999999;
  124. }
  125. .orderBtn {
  126. margin-right: 30rpx;
  127. }
  128. .homeBtn {
  129. background: #333333;
  130. border: none;
  131. color: #FFEBC4;
  132. }
  133. }
  134. .orderPolite {
  135. display: flex;
  136. align-items: center;
  137. width: 670rpx;
  138. background: #FFF9F6;
  139. border: 2rpx solid #FBE9E6;
  140. margin: 50rpx auto 0 auto;
  141. padding: 0 30rpx;
  142. box-sizing: border-box;
  143. .rightInfo {
  144. flex: 1;
  145. font-size: 28rpx;
  146. color: #333333;
  147. .growthBox {
  148. margin-bottom: 30rpx;
  149. .growth {
  150. color: #C83732;
  151. }
  152. }
  153. .couponBox {
  154. margin-bottom: 30rpx;
  155. .coupon {
  156. color: #C83732;
  157. }
  158. &:last-child {
  159. margin-bottom: 0 !important;
  160. }
  161. }
  162. }
  163. }
  164. }
  165. }
  166. </style>