travel.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view class="travelPage">
  3. <u-swiper height=500 :list="swiper" :autoplay="false" circular autoplay show-center-play-btn
  4. :poster="imgUrl"></u-swiper>
  5. <u-sticky bgColor="#fff">
  6. <view class="tags">
  7. <u-tabs :list="list" :activeStyle="{color: '#1E9F6A','font-weight': 'bold'}" lineColor="#1E9F6A" :inactiveStyle="{color: 'rgba(51, 51, 51, 0.5)'}" :is-scroll="true" lineWidth="55" @change="chooseTitle">
  8. </u-tabs>
  9. </view>
  10. </u-sticky>
  11. <view class="travelContent" v-for="item,index in listArr" @click="gotravelDetails(item.id)">
  12. <!-- <image src="http://cdn.uviewui.com/uview/empty/list.png" mode=""></image> -->
  13. <view class="video">
  14. <image :src="item.cover_picture" mode="aspectFill"></image>
  15. <!-- <video src="" controls></video> -->
  16. </view>
  17. <view class="travel" >
  18. <view class="traveltitle">
  19. {{item.name}}
  20. </view>
  21. <view class="price">
  22. ¥{{item.min_price}}
  23. </view>
  24. </view>
  25. <view class="describe">
  26. {{item.subtitle}}
  27. <!-- 夏日的森林,雨水充沛了山林,鲜花盛放,溪水潺潺。漫步于自然之中,感受清新的空气,放空心灵,沉醉于山雾之中,感受不同于城市的静谧与轻松。 -->
  28. </view>
  29. </view>
  30. <view class="paddingsafe"></view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return {
  37. imgUrl: "https://t38.9026.com/uploads/golf/images/2022-05-31/20220531601652.png",
  38. swiper: [],
  39. // 标签栏
  40. list: [
  41. // {name:"老年康养团",id:1},{name:"上班族解乏团",id:2},{name:"少儿夏令营",id:3},{name:"自然&教育",id:4},
  42. ],
  43. // 套餐列表
  44. listArr:[
  45. // {cover_picture:"https://t38.9026.com/uploads/golf/images/2022-05-31/20220531601652.png",name:"深林康养",description:" 夏日的森林,雨水充沛了山林,鲜花盛放,溪水潺潺。漫步于自然之中,感受清新的空气,放空心灵,沉醉于山雾之中,感受不同于城市的静谧与轻松。",min_price:"300"},
  46. // {cover_picture:"https://t38.9026.com/uploads/golf/images/2022-05-31/20220531601652.png",name:"深林康养",description:" 夏日的森林,雨水充沛了山林,鲜花盛放,溪水潺潺。漫步于自然之中,感受清新的空气,放空心灵,沉醉于山雾之中,感受不同于城市的静谧与轻松。",min_price:"300"}
  47. ],
  48. lineWidth:''
  49. }
  50. },
  51. onLoad() {
  52. this.init()
  53. },
  54. methods: {
  55. init() {
  56. let userinfo=this.$store.state.userinfo
  57. // 获取轮播图
  58. let home=uni.getStorageSync("home")
  59. home.images.forEach(item=>{
  60. this.swiper.push(item.url)
  61. })
  62. uni.$u.http.post('/api/category/list',userinfo,{
  63. custom: {
  64. auth: true
  65. }
  66. }).then((res) => {
  67. // console.log(res)
  68. this.list=res
  69. }).catch((err) => {
  70. console.log( err)
  71. })
  72. // 套餐列表
  73. uni.$u.http.post('/api/good/index',{
  74. category_id:1,
  75. per_page:15,
  76. page:1
  77. },{
  78. custom: {
  79. auth: true
  80. }
  81. }).then((res) => {
  82. // console.log(res.data)
  83. this.listArr=res.data
  84. this.list2=res.data.picture
  85. // console.log(res.data[0].picture,"详情图")
  86. }).catch((err) => {
  87. console.log( err)
  88. })
  89. },
  90. // 切换标签
  91. chooseTitle(e){
  92. // console.log(e)
  93. this.lineWidth=e.rect.width
  94. uni.$u.http.post('/api/good/index',{
  95. category_id:e.id,
  96. per_page:15,
  97. page:1
  98. },{
  99. custom: {
  100. auth: true
  101. }
  102. }).then((res) => {
  103. // console.log(res.data)
  104. this.listArr=res.data
  105. }).catch((err) => {
  106. console.log( err)
  107. })
  108. },
  109. // 跳转套餐详情
  110. gotravelDetails(id) {
  111. uni.navigateTo({
  112. url: `/pages/travel/travelDetails?id=${id}`
  113. })
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang="less">
  119. page{
  120. color: rgba(51, 51, 51, 1);
  121. }
  122. .tags{
  123. box-shadow: 0px 2rpx 8rpx 0px rgba(0, 0, 0, 0.06);
  124. }
  125. .travelPage {
  126. // padding: 20rpx;
  127. box-sizing: border-box;
  128. height: 100%;
  129. background-color: #FCFCFC;
  130. .title {
  131. margin: 20rpx;
  132. }
  133. .travelContent {
  134. font-size: 28rpx;
  135. font-family: PingFang-SC-Medium, PingFang-SC;
  136. font-weight: 500;
  137. margin: 40rpx 0rpx;
  138. background-color: #fff;
  139. border-radius: 30rpx;
  140. // background: #FFFFFF;
  141. box-shadow: 0px 8rpx 14rpx 0rpx rgba(0, 21, 3, 0.05);
  142. border-radius: 0px 0px 16rpx 100rpx;
  143. .video {
  144. margin: 0 30rpx;
  145. // box-shadow: 0px 8px 14px 0px rgba(0, 21, 3, 0.05);
  146. // border-radius: 16px 16px 16px 58px;
  147. image{
  148. width: 690rpx;
  149. height: 410rpx;
  150. }
  151. }
  152. // video {
  153. // width: 100%;
  154. // box-shadow: 0px 8px 14px 0px rgba(0, 21, 3, 0.05);
  155. // border-radius: 16rpx 16rpx 0px 0px;
  156. // }
  157. .travel {
  158. font-weight: bold;
  159. font-size: 30rpx;
  160. padding: 40rpx 56rpx 10rpx;
  161. display: flex;
  162. justify-content: space-between;
  163. }
  164. .describe {
  165. font-size: 26rpx;
  166. box-sizing: border-box;
  167. padding: 10rpx 56rpx 40rpx;
  168. }
  169. }
  170. }
  171. </style>