completion.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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">
  22. <swiper class="swiper" :autoplay="true" >
  23. <swiper-item v-for="(item,index) in orderBannerList" :key="index">
  24. <image class="swiper_item_img" :src="item.thumb" mode="widthFix" @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. let link_url = encodeURIComponent(url);
  78. // 跳转到webview
  79. uni.redirectTo({
  80. url:`/pages/webview/index?link_url=${link_url}`
  81. })
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="less">
  87. .order_completion_box{
  88. display:block;
  89. padding-bottom: 60rpx;
  90. .order_completion_title{
  91. display: block;
  92. width: 630rpx;
  93. margin: 20rpx auto;
  94. line-height: 2.0;
  95. .completion_icon{
  96. width:150rpx;
  97. height: 150rpx;
  98. margin: 30rpx auto;
  99. border-radius: 50%;
  100. display: flex;
  101. justify-content: center;
  102. align-items: center;
  103. background-color: #e15c21;
  104. }
  105. .product_title{
  106. text-align: center;
  107. font-size: 24rpx;
  108. }
  109. }
  110. .nav_button{
  111. width: 630rpx;
  112. display: block;
  113. overflow: hidden;
  114. margin: 20rpx auto;
  115. line-height: 100rpx;
  116. .nav_order{
  117. text-align: center;
  118. margin: 30rpx 0rpx;
  119. border-radius: 60rpx;
  120. background-color: #e15c21;
  121. text{
  122. color: #eeeeee;
  123. }
  124. }
  125. .nav_home{
  126. text-align: center;
  127. border: 2rpx solid #6ca69e;
  128. margin: 30rpx 0rpx;
  129. border-radius: 60rpx;
  130. }
  131. }
  132. .lotteryinfo{
  133. width: 630rpx;
  134. overflow: hidden;
  135. margin: 50rpx auto;
  136. .lottery_title{
  137. display: block;
  138. height: 60rpx;
  139. font-size: 32rpx;
  140. line-height: 60rpx;
  141. text-align: center;
  142. }
  143. .banner{
  144. display: block;
  145. max-width: 630rpx;
  146. text-align: center;
  147. .swiper{
  148. display: block;
  149. max-width: 630rpx;
  150. text-align: center;
  151. }
  152. }
  153. }
  154. }
  155. </style>