travel.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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)'}" lineWidth=50 :scrollable="true" @click="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="widthFix"></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. }
  48. },
  49. onLoad() {
  50. this.init()
  51. },
  52. methods: {
  53. init() {
  54. let userinfo=this.$store.state.userinfo
  55. // 获取轮播图
  56. let swiper=uni.getStorageSync("data")
  57. this.swiper=swiper[9].value
  58. // 套餐主题
  59. uni.$u.http.post('/api/category/list',userinfo,{
  60. custom: {
  61. auth: true
  62. }
  63. }).then((res) => {
  64. console.log(res)
  65. this.list=res
  66. }).catch((err) => {
  67. console.log( err)
  68. })
  69. // 套餐列表
  70. uni.$u.http.post('/api/good/index',{
  71. category_id:1,
  72. per_page:15,
  73. page:1
  74. },{
  75. custom: {
  76. auth: true
  77. }
  78. }).then((res) => {
  79. console.log(res.data)
  80. this.listArr=res.data
  81. this.list2=res.data.picture
  82. console.log(res.data[0].picture,"详情图")
  83. }).catch((err) => {
  84. console.log( err)
  85. })
  86. },
  87. // 切换标签
  88. chooseTitle(e){
  89. console.log(e)
  90. uni.$u.http.post('/api/good/index',{
  91. category_id:e.id,
  92. per_page:15,
  93. page:1
  94. },{
  95. custom: {
  96. auth: true
  97. }
  98. }).then((res) => {
  99. console.log(res.data)
  100. this.listArr=res.data
  101. }).catch((err) => {
  102. console.log( err)
  103. })
  104. },
  105. // 跳转套餐详情
  106. gotravelDetails(id) {
  107. uni.navigateTo({
  108. url: `/pages/travel/travelDetails?id=${id}`
  109. })
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="less">
  115. page{
  116. color: rgba(51, 51, 51, 1);
  117. }
  118. .tags{
  119. box-shadow: 0px 2rpx 8rpx 0px rgba(0, 0, 0, 0.06);
  120. }
  121. .travelPage {
  122. // padding: 20rpx;
  123. box-sizing: border-box;
  124. height: 100%;
  125. background-color: #FCFCFC;
  126. .title {
  127. margin: 20rpx;
  128. }
  129. .travelContent {
  130. font-size: 28rpx;
  131. font-family: PingFang-SC-Medium, PingFang-SC;
  132. font-weight: 500;
  133. ;
  134. margin: 40rpx 0rpx;
  135. background-color: #fff;
  136. border-radius: 30rpx;
  137. background: #FFFFFF;
  138. box-shadow: 0px 8rpx 14rpx 0rpx rgba(0, 21, 3, 0.05);
  139. border-radius: 0px 0px 16rpx 100rpx;
  140. .video {
  141. margin: 0 30rpx;
  142. // box-shadow: 0px 8px 14px 0px rgba(0, 21, 3, 0.05);
  143. // border-radius: 16px 16px 16px 58px;
  144. image{
  145. width: 100%;
  146. }
  147. }
  148. // video {
  149. // width: 100%;
  150. // box-shadow: 0px 8px 14px 0px rgba(0, 21, 3, 0.05);
  151. // border-radius: 16rpx 16rpx 0px 0px;
  152. // }
  153. .travel {
  154. font-weight: bold;
  155. font-size: 30rpx;
  156. padding: 40rpx 56rpx 10rpx;
  157. display: flex;
  158. justify-content: space-between;
  159. }
  160. .describe {
  161. font-size: 26rpx;
  162. box-sizing: border-box;
  163. padding: 10rpx 56rpx 40rpx;
  164. }
  165. }
  166. }
  167. </style>