completion.vue 3.8 KB

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