completion.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="order_completion_box">
  3. <view class="order_completion_title">
  4. <view class="completion_icon">
  5. <uni-icons class="icon" type="checkmarkempty" size="40" color="#eeeeee"></uni-icons>
  6. </view>
  7. <view class="product_title" v-for="(item, index) in productTitleInfo" :key="index"> {{ item.name }} {{ item.spec }} 特惠价 ¥{{ item.price }} </view>
  8. </view>
  9. <view class="nav_button">
  10. <view class="nav_order" @click="navOrder()">
  11. <text>查看订单</text>
  12. </view>
  13. <view class="nav_home" @click="navHome()">
  14. <text>返回首页</text>
  15. </view>
  16. </view>
  17. <view class="lotteryinfo" v-if="this.islotteryinfo">
  18. <view class="lottery_title">恭喜您预约成功,诚邀您参与以下活动</view>
  19. <view class="banner_list">
  20. <swiper class="banner_swiper" :autoplay="true">
  21. <swiper-item v-for="(item, index) in orderBannerList" :key="index">
  22. <image class="image" :src="item.thumb" @click="navLottery(item.link_url)"></image>
  23. </swiper-item>
  24. </swiper>
  25. </view>
  26. </view>
  27. <uni-popup ref="addFollow" type="center" class="center_popup">
  28. <FollowPopup :closePopup="closePopup" />
  29. </uni-popup>
  30. </view>
  31. </template>
  32. <script>
  33. import FollowPopup from "@/components/FollowPopup/FollowPopup.vue";
  34. export default {
  35. components: { FollowPopup },
  36. data() {
  37. return {
  38. //轮播图
  39. orderBannerList: [],
  40. //是否展示抽奖区域
  41. islotteryinfo: 0,
  42. //报单成功的商品信息
  43. productTitleInfo: [],
  44. };
  45. },
  46. onLoad(option) {
  47. //接受参数
  48. let productInfo = option.params;
  49. if (productInfo) {
  50. //解密参数
  51. productInfo = decodeURIComponent(productInfo);
  52. //转成js数组对象
  53. productInfo = JSON.parse(productInfo);
  54. this.productTitleInfo = productInfo;
  55. }
  56. },
  57. onShow() {
  58. this.$http.request("/api/orders_banner/get_list").then((re) => {
  59. if (re.code === "success") {
  60. this.orderBannerList = re.data;
  61. this.islotteryinfo = this.orderBannerList.length;
  62. }
  63. });
  64. //如果已选城市且没有添加客服每天弹窗一次
  65. if (this.$checkAccess.getFollowQrcode()) {
  66. this.$refs.addFollow.open("center");
  67. }
  68. },
  69. methods: {
  70. closePopup() {
  71. this.$refs.addFollow.close();
  72. },
  73. navOrder() {
  74. uni.redirectTo({
  75. url: "/pages/orders/index",
  76. });
  77. },
  78. navHome() {
  79. uni.switchTab({
  80. url: "/pages/index/index",
  81. });
  82. },
  83. navLottery(url) {
  84. // 没有路径,不跳转
  85. if (!url) return;
  86. // 判断是不是小程序链接
  87. if (url.includes("http")) {
  88. // 转码
  89. let link_url = encodeURIComponent(url);
  90. // 跳转到webview
  91. uni.redirectTo({
  92. url: `/pages/webview/index?link_url=${link_url}`,
  93. });
  94. } else {
  95. // 跳转到webview
  96. uni.navigateTo({
  97. url: url,
  98. });
  99. }
  100. },
  101. },
  102. };
  103. </script>
  104. <style lang="less">
  105. .order_completion_box {
  106. display: block;
  107. padding-bottom: 60rpx;
  108. .order_completion_title {
  109. display: block;
  110. width: 630rpx;
  111. margin: 20rpx auto;
  112. line-height: 2;
  113. .completion_icon {
  114. width: 150rpx;
  115. height: 150rpx;
  116. margin: 30rpx auto;
  117. border-radius: 50%;
  118. display: flex;
  119. justify-content: center;
  120. align-items: center;
  121. background-color: #e15c21;
  122. }
  123. .product_title {
  124. text-align: center;
  125. font-size: 24rpx;
  126. }
  127. }
  128. .nav_button {
  129. width: 630rpx;
  130. display: block;
  131. overflow: hidden;
  132. margin: 20rpx auto;
  133. line-height: 100rpx;
  134. .nav_order {
  135. text-align: center;
  136. margin: 30rpx 0rpx;
  137. border-radius: 60rpx;
  138. background-color: #e15c21;
  139. text {
  140. color: #eeeeee;
  141. }
  142. }
  143. .nav_home {
  144. text-align: center;
  145. border: 2rpx solid #6ca69e;
  146. margin: 30rpx 0rpx;
  147. border-radius: 60rpx;
  148. }
  149. }
  150. .lotteryinfo {
  151. width: 680rpx;
  152. overflow: hidden;
  153. margin: 50rpx auto;
  154. .lottery_title {
  155. display: block;
  156. height: 60rpx;
  157. font-size: 32rpx;
  158. line-height: 60rpx;
  159. text-align: center;
  160. }
  161. .banner_list {
  162. display: block;
  163. width: 680rpx;
  164. height: 382rpx;
  165. line-height: 382rpx;
  166. text-align: center;
  167. .banner_swiper {
  168. display: block;
  169. width: 680rpx;
  170. height: 382rpx;
  171. line-height: 382rpx;
  172. text-align: center;
  173. .image {
  174. width: 680rpx;
  175. height: 382rpx;
  176. }
  177. }
  178. }
  179. }
  180. }
  181. </style>