jingXuanBiZhi.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="content">
  3. <view class="flex scroll-x ai_end mgt-20" style="gap: 50rpx;">
  4. <view class="text-28 text-999 cursor" :class="active == tab.id?'active':''"
  5. v-for="(tab,index) in category" @click="chooseTab(tab)">
  6. {{ tab.name }}
  7. </view>
  8. </view>
  9. <view class="flex mgt-40">
  10. <view class="w-220 h-120 flex ai_center jc_center bg-white radio-20 mgr-20">
  11. 流行壁纸
  12. </view>
  13. <view class="w-220 h-120 flex ai_center jc_center bg-white radio-20">
  14. 最新壁纸
  15. </view>
  16. </view>
  17. <view class="imgs mgt-40 flex fw_wrap" style="gap: 14rpx;">
  18. <image class="w-220 h-280 radio-16" mode="aspectFill"
  19. v-for="img in category[active-1].list" :src="img">
  20. </image>
  21. </view>
  22. </view>
  23. </template>
  24. <script setup>
  25. import { ref, onMounted } from "vue";
  26. import { onShow } from "@dcloudio/uni-app";
  27. const category = ref([
  28. { name:'风景',list:[
  29. 'https://img2.baidu.com/it/u=643390968,3821598343&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800',
  30. 'https://img2.baidu.com/it/u=1207164141,4244022854&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  31. 'https://img2.baidu.com/it/u=2122730436,3330551883&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  32. 'https://img2.baidu.com/it/u=1934414271,796431517&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800'
  33. ],id:1 },
  34. { name:'设计',list:[],id:2 },
  35. { name:'物语',list:[],id:3 },
  36. { name:'城市',list:[],id:4 },
  37. ])
  38. const active = ref(1)
  39. const chooseTab = (tab) =>{
  40. active.value = tab.id
  41. }
  42. onMounted(()=>{
  43. })
  44. </script>
  45. <style lang="scss" scoped>
  46. .content{
  47. height: 100vh;
  48. padding: 28rpx;
  49. background: linear-gradient(to bottom, #a9d4ff, #cce6ff);
  50. }
  51. .active{
  52. color: #000;
  53. font-weight: 500;
  54. font-size: 30rpx;
  55. }
  56. </style>