jingXuanBiZhi.vue 1.8 KB

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