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

接口联调

parent 06a3435b
......@@ -10,13 +10,14 @@
>
{{ item }}
</li>
<li>选择日期</li>
</ul>
</view>
</template>
<script setup>
import { defineProps } from 'vue';
const items = reactive(['智能排序', '距离优先', '好评优先', '销量优先', '低价优先', '低价优先']);
const items = reactive(['日期不限', '今天', '明天', '一周内', '一月内', '本周末', '七夕节']);
const selectedItem = ref(null);
const props = defineProps({
width: {
......
......@@ -54,6 +54,7 @@ function back() {
padding-left: 20rpx;
padding-top: 75rpx;
box-sizing: border-box;
z-index: 999;
.arrow {
width: 15rpx;
height: 24rpx;
......
......@@ -112,8 +112,13 @@
<script setup>
import Search from '../../../components/assistingAgriculture/index/Search.vue';
import { getStrictSelection } from '../../../api/assistingAgriculture/building';
import {
getGoodSaleProdList,
getPlatformProdList,
getStrictSelection,
} from '../../../api/assistingAgriculture/building';
import { onMounted } from 'vue';
import { useRoute } from 'vue-router';
const current = ref(0);
const rightList = ref([]);
const light = ref(0);
......@@ -147,8 +152,21 @@ const detailList = ref([
const choice = (index) => {
light.value = index;
};
const params = {
current: 1,
size: 10,
};
const router = useRoute();
console.log(router, 211);
const params1 = {
current: 1,
size: 10,
categoryId: router.query.categoryId,
};
onMounted(async () => {
getStrictSelectionList();
getGoodSaleProd();
platformProdList();
});
// 筑农严选分类
const getStrictSelectionList = () => {
......@@ -159,6 +177,19 @@ const getStrictSelectionList = () => {
rightList.value = res.data.splice(0, 2);
});
};
// 好货热卖
const getGoodSaleProd = () => {
getGoodSaleProdList(params).then((res) => {
console.log(res, 123);
});
};
// 筑农严选首页-分类查询商品列表
const platformProdList = () => {
getPlatformProdList(params1).then((res) => {
console.log(res, 111);
});
};
// 跳转预售
const toPresale = (id) => {
console.log(id, 121);
xma.navigateTo({
......@@ -171,12 +202,6 @@ function handleClick(e) {
function onChange(e) {
console.log(e);
}
// function toPresale() {
// // TODO: 跳转到预售
// xma.navigateTo({
// url: '/pages/assistingAgriculture/index/presale',
// });
// }
function toDetail() {
// TODO: 跳转到详情页
xma.navigateTo({
......
......@@ -23,7 +23,7 @@
<view style="display: flex; flex-direction: row">
<view
class="borderClass"
@click="toBuilding(index)"
@click="toBuilding(item)"
v-for="(item, index) in sortList"
:key="index"
>
......@@ -62,7 +62,6 @@ import {
} from '../../../api/assistingAgriculture/building';
import { onMounted, ref } from 'vue';
import { groupImgList } from '@/api';
const list = ref([]);
const sortList = ref([]);
const swiperList = ref([]);
......@@ -90,6 +89,7 @@ onMounted(async () => {
getList();
getPresaleCategoryList();
getPresale();
platformProdList();
});
// 获取筑农专区分类;
const getList = () => {
......@@ -126,26 +126,25 @@ const getPresale = () => {
});
});
};
const onChange = (e) => {
// console.log(e);
};
function toBuilding(index) {
if (index === 0) {
// TODO: 跳转到筑农严选
const toBuilding = (item) => {
if (item.categoryName === '筑农严选') {
// 跳转到筑农严选
xma.navigateTo({
url: '/pages/assistingAgriculture/index/building',
url: `/pages/assistingAgriculture/index/building?categoryId=${item.categoryId}`,
});
} else if (index === 1) {
console.log(111);
} else if (index === 2) {
// TODO: 跳转到乡村旅居
} else if (item.categoryName === '乡村旅居') {
// 跳转到乡村旅居
xma.navigateTo({
url: '/pages/assistingAgriculture/RuralTravel/RuralTravel',
url: `/pages/assistingAgriculture/RuralTravel/RuralTravel?categoryId=${item.categoryId}`,
});
} else if (index === 3) {
} else {
console.log(222);
}
}
};
// 跳转详情页
function toDetail() {
// TODO: 跳转到详情页
......
......@@ -230,6 +230,11 @@ const goodList = ref([
},
]);
const router = useRoute();
const params = {
current: 1,
size: 10,
categoryId: router.query.categoryId,
};
onMounted(async () => {
getPresale();
getPresaleProd();
......@@ -249,8 +254,8 @@ const getPresale = () => {
};
// 筑农首页-分类查询商品列表
const getPresaleProd = () => {
getPresaleProdList(router.query).then((res) => {
console.log(res, 111);
getPresaleProdList(params).then((res) => {
console.log(res, 222);
});
};
// 左侧数据列表
......
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