Commit b53be77f authored by 张娇(东信)'s avatar 张娇(东信)

预售分类接口数据获取

parent 29ff107f
...@@ -28,10 +28,11 @@ export function getStrictSelection(data) { ...@@ -28,10 +28,11 @@ export function getStrictSelection(data) {
} }
// 筑农预售分类 // 筑农预售分类
export function presaleList() { export function categoryPresaleList(data) {
return request({ return request({
url: '/sgyrdd/category/presaleList', url: '/sgyrdd/category/presaleList',
method: 'GET', method: 'GET',
data,
}); });
} }
......
...@@ -129,7 +129,6 @@ const swiperList = ref([ ...@@ -129,7 +129,6 @@ const swiperList = ref([
'../../../static/assistingAgriculture/assets/village.png', '../../../static/assistingAgriculture/assets/village.png',
]); ]);
// 分类列表数据 // 分类列表数据
const tabsList = ref([]);
const detailList = ref([ const detailList = ref([
{ img: '/static/assistingAgriculture/assets/fruit.png', price: '2555', text: '这是草莓这是草莓' }, { img: '/static/assistingAgriculture/assets/fruit.png', price: '2555', text: '这是草莓这是草莓' },
{ {
...@@ -160,10 +159,14 @@ onMounted(async () => { ...@@ -160,10 +159,14 @@ onMounted(async () => {
}); });
// 筑农严选分类 // 筑农严选分类
const getStrictSelectionList = () => { const getStrictSelectionList = () => {
getStrictSelection({ parentId: router.query.categoryId }).then((res) => { getStrictSelection().then((res) => {
tabsList.value = res.data; res.data.forEach((item) => {
item.icon = import.meta.env.VITE_APP_IMG_URL + item.pic;
});
rightList.value = res.data.splice(0, 2);
}); });
}; };
// 好货热卖 // 好货热卖
const getGoodSaleProd = () => { const getGoodSaleProd = () => {
getGoodSaleProdList(params).then((res) => {}); getGoodSaleProdList(params).then((res) => {});
......
...@@ -145,7 +145,11 @@ ...@@ -145,7 +145,11 @@
import Search from '../../../components/assistingAgriculture/index/Search.vue'; import Search from '../../../components/assistingAgriculture/index/Search.vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { getPresaleList, getPresaleProdList } from '../../../api/assistingAgriculture/building'; import {
categoryPresaleList,
getPresaleList,
getPresaleProdList,
} from '../../../api/assistingAgriculture/building';
const swiperList = ref([]); const swiperList = ref([]);
const current = ref(0); const current = ref(0);
// 轮播图数据 // 轮播图数据
...@@ -235,9 +239,11 @@ const params = { ...@@ -235,9 +239,11 @@ const params = {
size: 10, size: 10,
categoryId: router.query.categoryId, categoryId: router.query.categoryId,
}; };
const tabsList = ref([]);
onMounted(async () => { onMounted(async () => {
getPresale(); getPresale();
getPresaleProd(); getPresaleProd();
presaleSortList();
}); });
// 预售板块轮播图 // 预售板块轮播图
const getPresale = () => { const getPresale = () => {
...@@ -252,6 +258,13 @@ const getPresale = () => { ...@@ -252,6 +258,13 @@ const getPresale = () => {
}); });
}); });
}; };
// 筑农预售分类
const presaleSortList = () => {
categoryPresaleList({ level: 1 }).then((res) => {
console.log(res, 111);
tabsList.value = res.data;
});
};
// 筑农首页-分类查询商品列表 // 筑农首页-分类查询商品列表
const getPresaleProd = () => { const getPresaleProd = () => {
getPresaleProdList(params).then((res) => { getPresaleProdList(params).then((res) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment