travel.vue 4.7 KB

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