classify.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="classLayout pageBg">
  3. <!-- #ifndef MP-TOUTIAO -->
  4. <custom-nav-bar title="分类"></custom-nav-bar>
  5. <!-- #endif -->
  6. <view class="classify">
  7. <theme-item v-for="item in classifyList"
  8. :key="item._id"
  9. :item="item"
  10. ></theme-item>
  11. </view>
  12. </view>
  13. </template>
  14. <script setup>
  15. import { ref } from 'vue';
  16. import {onShareAppMessage,onShareTimeline} from "@dcloudio/uni-app"
  17. import {apiGetClassify} from "@/api/apis.js"
  18. const classifyList = ref([]);
  19. const getClassify =async()=>{
  20. let res =await apiGetClassify({
  21. pageSize:15
  22. });
  23. classifyList.value = res.data
  24. console.log(res);
  25. }
  26. //分享给好友
  27. onShareAppMessage((e)=>{
  28. return {
  29. title:"咸虾米壁纸,精选分类",
  30. path:"/pages/classify/classify"
  31. }
  32. })
  33. //分享朋友圈
  34. onShareTimeline(()=>{
  35. return {
  36. title:"咸虾米壁纸,精选分类"
  37. }
  38. })
  39. getClassify();
  40. </script>
  41. <style lang="scss" scoped>
  42. .classify{
  43. padding:30rpx;
  44. display: grid;
  45. grid-template-columns: repeat(3,1fr);
  46. gap:15rpx;
  47. }
  48. </style>