completion.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. //轮播图
  34. orderBannerList: [],
  35. //是否展示抽奖区域
  36. islotteryinfo: 0,
  37. //报单成功的商品信息
  38. productTitleInfo: [],
  39. };
  40. },
  41. onLoad(option) {
  42. //接受参数
  43. let productInfo = option.params;
  44. if (productInfo) {
  45. //解密参数
  46. productInfo = decodeURIComponent(productInfo);
  47. //转成js数组对象
  48. productInfo = JSON.parse(productInfo);
  49. this.productTitleInfo = productInfo;
  50. }
  51. },
  52. onShow() {
  53. this.$http.request("/api/orders_banner/get_list").then((re) => {
  54. if (re.code === "success") {
  55. this.orderBannerList = re.data;
  56. this.islotteryinfo = this.orderBannerList.length;
  57. }
  58. });
  59. },
  60. methods: {
  61. navOrder() {
  62. uni.redirectTo({
  63. url: "/pages/orders/index",
  64. });
  65. },
  66. navHome() {
  67. uni.switchTab({
  68. url: "/pages/index/index",
  69. });
  70. },
  71. navLottery(url) {
  72. // 没有路径,不跳转
  73. if (!url) return;
  74. // 判断是不是小程序链接
  75. if (url.includes("http")) {
  76. // 转码
  77. let link_url = encodeURIComponent(url);
  78. // 跳转到webview
  79. uni.redirectTo({
  80. url: `/pages/webview/index?link_url=${link_url}`,
  81. });
  82. } else {
  83. // 跳转到webview
  84. uni.navigateTo({
  85. url: url,
  86. });
  87. }
  88. },
  89. },
  90. };
  91. </script>
  92. <style lang="less">
  93. .order_completion_box {
  94. display: block;
  95. padding-bottom: 60rpx;
  96. .order_completion_title {
  97. display: block;
  98. width: 630rpx;
  99. margin: 20rpx auto;
  100. line-height: 2;
  101. .completion_icon {
  102. width: 150rpx;
  103. height: 150rpx;
  104. margin: 30rpx auto;
  105. border-radius: 50%;
  106. display: flex;
  107. justify-content: center;
  108. align-items: center;
  109. background-color: #e15c21;
  110. }
  111. .product_title {
  112. text-align: center;
  113. font-size: 24rpx;
  114. }
  115. }
  116. .nav_button {
  117. width: 630rpx;
  118. display: block;
  119. overflow: hidden;
  120. margin: 20rpx auto;
  121. line-height: 100rpx;
  122. .nav_order {
  123. text-align: center;
  124. margin: 30rpx 0rpx;
  125. border-radius: 60rpx;
  126. background-color: #e15c21;
  127. text {
  128. color: #eeeeee;
  129. }
  130. }
  131. .nav_home {
  132. text-align: center;
  133. border: 2rpx solid #6ca69e;
  134. margin: 30rpx 0rpx;
  135. border-radius: 60rpx;
  136. }
  137. }
  138. .lotteryinfo {
  139. width: 680rpx;
  140. overflow: hidden;
  141. margin: 50rpx auto;
  142. .lottery_title {
  143. display: block;
  144. height: 60rpx;
  145. font-size: 32rpx;
  146. line-height: 60rpx;
  147. text-align: center;
  148. }
  149. .banner_list {
  150. display: block;
  151. width: 680rpx;
  152. height: 382rpx;
  153. line-height: 382rpx;
  154. text-align: center;
  155. .banner_swiper {
  156. display: block;
  157. width: 680rpx;
  158. height: 382rpx;
  159. line-height: 382rpx;
  160. text-align: center;
  161. .image {
  162. width: 680rpx;
  163. height: 382rpx;
  164. }
  165. }
  166. }
  167. }
  168. }
  169. </style>