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