多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

196 lines
4.7 KiB

2 years ago
  1. <template>
  2. <view class="payCourteous">
  3. <global-loading />
  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. <image src="https://ceres.zkthink.com/static/images/payIcon.png"></image>
  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 class="orderPolite" v-if="orderPolite.growth || orderPolite.couponList">
  17. <view class="politeImgBox">
  18. <image src="https://ceres.zkthink.com/static/images/politeIcon.png"></image>
  19. </view>
  20. <view class="rightInfo">
  21. <view class="growthBox"
  22. v-if="orderPolite.credit">
  23. 恭喜获得额外积分<text class="growth">{{ orderPolite.credit }}</text>
  24. </view>
  25. <view class="growthBox" v-if="orderPolite.growth">
  26. 恭喜获得额外会员成长值<text class="growth">{{ orderPolite.growth }}</text>
  27. </view>
  28. <view class="couponBox"
  29. v-for="(item, index) of orderPolite.couponList"
  30. :key="index"
  31. >
  32. 恭喜获得<text class="coupon">{{item.discount}}</text>{{ item.couponType === 1 ? '满减优惠券' : '折扣券'}}
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 推荐 -->
  38. <HotTemplate />
  39. <!-- 广告 -->
  40. <ad-window ref="adWindow" :triggerCondition="2"></ad-window>
  41. </view>
  42. </template>
  43. <script>
  44. import HotTemplate from '@/components/hoteRecommed/index.vue'
  45. import AdWindow from "../../components/adWindow";
  46. const NET = require('../../utils/request')
  47. const API = require('../../config/api')
  48. export default {
  49. name: "payCourteous",
  50. components: {
  51. AdWindow,
  52. HotTemplate
  53. },
  54. data() {
  55. return {
  56. orderId: null,
  57. orderPolite: {},
  58. topHeight: 0
  59. }
  60. },
  61. onShow() {
  62. // #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
  63. let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  64. this.topHeight = menuButtonInfo.top + 10
  65. // #endif
  66. },
  67. onLoad(option) {
  68. this.orderId = option.orderId
  69. if (this.orderId) {
  70. this.getOrderPoliteFn()
  71. }
  72. this.$nextTick(()=>{
  73. this.$refs.adWindow.getAd()
  74. })
  75. },
  76. methods: {
  77. goToOrder() {
  78. uni.navigateTo({
  79. url: '../orderModule/index'
  80. })
  81. },
  82. goToHome() {
  83. uni.switchTab({
  84. url: '../../pages/tabbar/index/index'
  85. })
  86. },
  87. getOrderPoliteFn() {
  88. // uni.showLoading({
  89. // mask: true,
  90. // title: '加载中...',
  91. // })
  92. NET.request(API.getOrderPolite,{
  93. orderId: this.orderId
  94. },'GET').then(res => {
  95. uni.hideLoading()
  96. this.orderPolite = res.data
  97. }).catch(res => {
  98. uni.hideLoading()
  99. })
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .payCourteous {
  106. .payTitBox {
  107. height: 100rpx;
  108. position: fixed;
  109. left: 0;
  110. top: 0;
  111. width: 100%;
  112. background: #FFFFFF;
  113. z-index: 99;
  114. }
  115. .resultCard{
  116. padding: 200rpx 0 50rpx 0;
  117. .imgBox {
  118. padding-top: 100rpx;
  119. display: flex;
  120. justify-content: center;
  121. image {
  122. width: 166rpx;
  123. height: 121rpx;
  124. }
  125. }
  126. .successful {
  127. text-align: center;
  128. margin-top: 30rpx;
  129. }
  130. .btnBox {
  131. display: flex;
  132. justify-content: center;
  133. margin-top: 30rpx;
  134. .btn {
  135. width: 140rpx;
  136. height: 58rpx;
  137. line-height: 58rpx;
  138. border: 2rpx solid #999999;
  139. text-align: center;
  140. font-size: 24rpx;
  141. color: #999999;
  142. }
  143. .orderBtn {
  144. margin-right: 30rpx;
  145. }
  146. .homeBtn {
  147. background: #333333;
  148. border: none;
  149. color: #FFEBC4;
  150. }
  151. }
  152. .orderPolite {
  153. display: flex;
  154. align-items: center;
  155. width: 670rpx;
  156. background: #FFF9F6;
  157. border: 2rpx solid #FBE9E6;
  158. margin: 50rpx auto 0 auto;
  159. padding: 0 30rpx;
  160. box-sizing: border-box;
  161. .politeImgBox {
  162. image {
  163. width: 186rpx;
  164. height: 186rpx;
  165. }
  166. }
  167. .rightInfo {
  168. flex: 1;
  169. font-size: 28rpx;
  170. color: #333333;
  171. .growthBox {
  172. margin-bottom: 30rpx;
  173. .growth {
  174. color: #C83732;
  175. }
  176. }
  177. .couponBox {
  178. margin-bottom: 30rpx;
  179. .coupon {
  180. color: #C83732;
  181. }
  182. &:last-child {
  183. margin-bottom: 0 !important;
  184. }
  185. }
  186. }
  187. }
  188. }
  189. }
  190. </style>