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

接口联调

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