61 lines
1.1 KiB
Vue
61 lines
1.1 KiB
Vue
<template>
|
|
<view class="classLayout pageBg">
|
|
<custom-nav-bar title="分类"></custom-nav-bar>
|
|
<view class="classify">
|
|
<theme-item v-for="item in classifyList"
|
|
:key="item._id"
|
|
:item="item">
|
|
</theme-item>
|
|
</view>
|
|
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import {ref} from "vue"
|
|
import {apiGetClassify} from "@/api/apis.js"
|
|
import {onShareAppMessage,onShareTimeline} from "@dcloudio/uni-app"
|
|
const classifyList = ref([])
|
|
const getClassify = async ()=>{
|
|
let res = await apiGetClassify({
|
|
// select:true
|
|
pageSize:15
|
|
});
|
|
// console.log(res);
|
|
classifyList.value = res.data
|
|
}
|
|
|
|
getClassify();
|
|
|
|
//分享给好友
|
|
onShareAppMessage((e)=>{
|
|
//分享这里是需要有一个 “return” 的
|
|
return{
|
|
title:"hzb壁纸,精选分类",
|
|
path:"/pages/classfy/classfy"
|
|
}
|
|
})
|
|
|
|
//分享到朋友圈
|
|
onShareTimeline(()=>{
|
|
return{
|
|
// 标题
|
|
title:"hzb壁纸,精选分类",
|
|
// 分享时候的图片地址。可以本地也可以网络图
|
|
imageUrl:"/static/images/logo2.jpg"
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.classLayout{
|
|
.classify{
|
|
padding: 30rpx;
|
|
display: grid;
|
|
grid-template-columns: repeat(3,1fr);
|
|
gap: 15rpx;
|
|
}
|
|
}
|
|
</style>
|