Commit 49428624 authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents 141dbf39 448e7214
......@@ -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;
......
......@@ -21,17 +21,18 @@ export function getPresaleList(data) {
// 筑农严选分类
export function getStrictSelection(data) {
return request({
url: `/sgyrdd/category/getZnyx`,
url: `/sgyrdd/category/getByParentId`,
method: 'GET',
data,
});
}
// 筑农预售分类
export function presaleList() {
export function categoryPresaleList(data) {
return request({
url: '/sgyrdd/category/presaleList',
method: 'GET',
data,
});
}
......
......@@ -18,7 +18,7 @@
</view>
<!-- 热门-->
<view style="display: flex; flex-direction: row">
<view class="left-offer">
<view class="left-offer" @click="toSpecialOfferZoneList">
<text class="left-title">特价专区</text>
<img
class="special-icon"
......@@ -243,6 +243,12 @@ function toRouteDetails() {
url: '/pages/assistingAgriculture/RouteDetails/RouteDetails',
});
}
function toSpecialOfferZoneList() {
// TODO: 跳转到特价专区
xma.navigateTo({
url: '/pages/assistingAgriculture/RuralTravel/specialOfferZoneList',
});
}
</script>
<style lang="scss" scoped>
......
......@@ -67,12 +67,12 @@
<scroll-view class="tabs" show-scrollbar="false" scroll-x :scroll-with-animation="true">
<text
@tap="choice(index, item.categoryId)"
v-for="(item, index) in tabsData"
v-for="(item, index) in tabsList"
:key="index"
class="text"
:class="light === index ? 'light' : ''"
>
{{ item.text }}
{{ item.categoryName }}
</text>
</scroll-view>
<!-- 列表-->
......@@ -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);
......@@ -124,16 +129,6 @@ const swiperList = ref([
'../../../static/assistingAgriculture/assets/village.png',
]);
// 分类列表数据
const tabsData = ref([
{ img: '/static/assistingAgriculture/assets/mainPicture.png', text: '水果生鲜' },
{ img: '/static/assistingAgriculture/assets/presale.png', text: '米面粮油' },
{ img: '/static/assistingAgriculture/assets/mainPicture.png', text: '农家干货' },
{ img: '/static/assistingAgriculture/assets/mainPicture.png', text: '鲜货预售' },
{ img: '/static/assistingAgriculture/assets/mainPicture.png', text: '水果生鲜' },
{ img: '/static/assistingAgriculture/assets/mainPicture.png', text: '米面粮油' },
{ img: '/static/assistingAgriculture/assets/mainPicture.png', text: '农家干货' },
{ img: '/static/assistingAgriculture/assets/mainPicture.png', text: '鲜货预售' },
]);
const detailList = ref([
{ img: '/static/assistingAgriculture/assets/fruit.png', price: '2555', text: '这是草莓这是草莓' },
{
......@@ -147,8 +142,20 @@ const detailList = ref([
const choice = (index) => {
light.value = index;
};
const params = {
current: 1,
size: 10,
};
const router = useRoute();
const params1 = {
current: 1,
size: 10,
categoryId: router.query.categoryId,
};
onMounted(async () => {
getStrictSelectionList();
getGoodSaleProd();
platformProdList();
});
// 筑农严选分类
const getStrictSelectionList = () => {
......@@ -159,8 +166,17 @@ const getStrictSelectionList = () => {
rightList.value = res.data.splice(0, 2);
});
};
// 好货热卖
const getGoodSaleProd = () => {
getGoodSaleProdList(params).then((res) => {});
};
// 筑农严选首页-分类查询商品列表
const platformProdList = () => {
getPlatformProdList(params1).then((res) => {});
};
// 跳转预售
const toPresale = (id) => {
console.log(id, 121);
xma.navigateTo({
url: `/pages/assistingAgriculture/index/presale?categoryId=${id}`,
});
......@@ -171,12 +187,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: 跳转到详情页
......
......@@ -145,7 +145,11 @@
import Search from '../../../components/assistingAgriculture/index/Search.vue';
import { useRoute } from 'vue-router';
import { ref, onMounted } from 'vue';
import { getPresaleList, getPresaleProdList } from '../../../api/assistingAgriculture/building';
import {
categoryPresaleList,
getPresaleList,
getPresaleProdList,
} from '../../../api/assistingAgriculture/building';
const swiperList = ref([]);
const current = ref(0);
// 轮播图数据
......@@ -230,9 +234,16 @@ const goodList = ref([
},
]);
const router = useRoute();
const params = {
current: 1,
size: 10,
categoryId: router.query.categoryId,
};
const tabsList = ref([]);
onMounted(async () => {
getPresale();
getPresaleProd();
presaleSortList();
});
// 预售板块轮播图
const getPresale = () => {
......@@ -247,10 +258,17 @@ const getPresale = () => {
});
});
};
// 筑农预售分类
const presaleSortList = () => {
categoryPresaleList({ level: 1 }).then((res) => {
console.log(res, 111);
tabsList.value = res.data;
});
};
// 筑农首页-分类查询商品列表
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