jingXuanBiZhi.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. <image class="w-220 h-120 radio-20 mgr-20"
  12. @click="navTo('/pages/tools/liuXingBiZhi')"
  13. src="/static/image/source/pop_bz.jpg"></image>
  14. <image class="w-220 h-120 radio-20 mgr-20"
  15. @click="navTo('/pages/tools/zuiXinBiZhi')"
  16. src="/static/image/source/new_bz.jpg"></image>
  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. 'https://img2.baidu.com/it/u=2843793126,682473204&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800',
  37. 'https://img1.baidu.com/it/u=1292485292,902063151&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=1083',
  38. 'https://img0.baidu.com/it/u=15396030,1143539239&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
  39. 'https://img2.baidu.com/it/u=1320672626,288218548&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
  40. 'https://img0.baidu.com/it/u=1652113119,3226642753&fm=253&app=138&f=JPEG?w=1423&h=800',
  41. 'https://img0.baidu.com/it/u=3087392912,2682394042&fm=253&app=138&f=JPEG?w=1423&h=800',
  42. 'https://img1.baidu.com/it/u=3631027001,3666368042&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
  43. 'https://img1.baidu.com/it/u=3637490291,2814538424&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800',
  44. 'https://img2.baidu.com/it/u=2114786151,2275385596&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  45. ],id:1 },
  46. { name:'设计',list:[],id:2 },
  47. { name:'物语',list:[],id:3 },
  48. { name:'城市',list:[],id:4 },
  49. ])
  50. const active = ref(1)
  51. const navTo = (url)=>{
  52. uni.navigateTo({
  53. url
  54. })
  55. }
  56. const chooseTab = (tab) =>{
  57. active.value = tab.id
  58. }
  59. onMounted(()=>{
  60. })
  61. </script>
  62. <style lang="scss" scoped>
  63. .content{
  64. min-height: 100vh;
  65. padding: 28rpx;
  66. background: linear-gradient(to bottom, #a9d4ff, #cce6ff);
  67. }
  68. .active{
  69. color: #000;
  70. font-weight: 500;
  71. font-size: 30rpx;
  72. }
  73. </style>