Commit 61a12582 authored by 陈宗胤(贵阳日报)'s avatar 陈宗胤(贵阳日报)
parents 919e2d25 05249844
...@@ -3,32 +3,22 @@ ...@@ -3,32 +3,22 @@
<view class="date">景点</view> <view class="date">景点</view>
<ul class="ul"> <ul class="ul">
<li <li
v-for="(item, index) in items" v-for="(item, index) in placeList"
:key="index" :key="index"
:class="{ active: selectedItem === index }" :class="{ active: selectedItem === index }"
@tap="selectItem(index)" @tap="selectItem(index)"
> >
{{ item }} {{ item.brief }}
</li> </li>
</ul> </ul>
</view> </view>
</template> </template>
<script setup> <script setup>
import { defineProps } from 'vue'; import { defineProps, onMounted } from 'vue';
const items = reactive([ import { getTour } from '@/api/assistingAgriculture/village';
'智能排序', const placeList = ref([]);
'距离优先', const emit = defineEmits(['sortParams']);
'好评优先',
'销量优先',
'低价优先',
'低价优先',
'距离优先',
'好评优先',
'销量优先',
'低价优先',
'距离优先',
]);
const selectedItem = ref(null); const selectedItem = ref(null);
const props = defineProps({ const props = defineProps({
width: { width: {
...@@ -36,15 +26,24 @@ const props = defineProps({ ...@@ -36,15 +26,24 @@ const props = defineProps({
default: '100%', default: '100%',
}, },
}); });
const selectItem = (selectItem) => { onMounted(async () => {
selectedItem.value = selectItem; getTourList();
});
const selectItem = (index, item) => {
selectedItem.value = index;
emit('sortParams', item);
};
// 查询景点
const getTourList = () => {
getTour({ prodId: 0 }).then((res) => {
placeList.value = res.data;
});
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sort { .sort {
width: 710rpx; width: 710rpx;
height: 192rpx;
position: absolute; position: absolute;
top: 100%; top: 100%;
// width: 100%; // width: 100%;
...@@ -78,7 +77,6 @@ const selectItem = (selectItem) => { ...@@ -78,7 +77,6 @@ const selectItem = (selectItem) => {
flex-flow: wrap; flex-flow: wrap;
li { li {
width: 154rpx; width: 154rpx;
height: 20rpx;
border-radius: 8rpx; border-radius: 8rpx;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
...@@ -87,10 +85,10 @@ const selectItem = (selectItem) => { ...@@ -87,10 +85,10 @@ const selectItem = (selectItem) => {
margin-left: 20rpx; margin-left: 20rpx;
background: #f3f3f3; background: #f3f3f3;
font-size: 24rpx; font-size: 24rpx;
line-height: 20rpx;
text-align: center; text-align: center;
list-style-type: none; list-style-type: none;
margin-top: 20rpx; margin-top: 20rpx;
display: flex;
} }
.active { .active {
color: #fa5151; color: #fa5151;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:class="{ active: selectedItem === index }" :class="{ active: selectedItem === index }"
@tap="selectItem(index)" @tap="selectItem(index)"
> >
{{ item }} {{ item.name }}
</li> </li>
</ul> </ul>
</view> </view>
...@@ -15,7 +15,14 @@ ...@@ -15,7 +15,14 @@
<script setup> <script setup>
import { defineProps } from 'vue'; import { defineProps } from 'vue';
const items = reactive(['智能排序', '距离优先', '好评优先', '销量优先', '低价优先', '低价优先']); const items = ref([
{ name: '距离优先', sortModel: 1 },
{ name: '好评优先', sortModel: 2 },
{ name: '销量优先', sortModel: 3 },
{ name: '低价优先', sortModel: 4 },
{ name: '高价优先', sortModel: 5 },
]);
const emit = defineEmits(['sortParams']);
const selectedItem = ref(null); const selectedItem = ref(null);
const props = defineProps({ const props = defineProps({
width: { width: {
...@@ -23,8 +30,9 @@ const props = defineProps({ ...@@ -23,8 +30,9 @@ const props = defineProps({
default: '100%', default: '100%',
}, },
}); });
const selectItem = (selectItem) => { const selectItem = (index, item) => {
selectedItem.value = selectItem; selectedItem.value = index;
emit('sortParams', item);
}; };
</script> </script>
......
...@@ -40,3 +40,27 @@ export function znsgyOrderCreate(data) { ...@@ -40,3 +40,27 @@ export function znsgyOrderCreate(data) {
data, data,
}); });
} }
// 筑农首页-查询用户默认收货地址
export function useraddrDefaultUserAddr(data) {
return request({
url: `/sgyrdd/useraddr/defaultUserAddr`,
method: 'GET',
data,
});
}
// 筑农首页-修改临时订单
export function previewOrderBasketUpdate(data) {
return request({
url: `/sgyrdd/previewOrder/basket/update`,
method: 'POST',
data,
});
}
// 筑农首页-3、订单详情
export function sgyOrderOrderInfo(data) {
return request({
url: `/sgyrdd/sgyOrder/orderInfo`,
method: 'GET',
data,
});
}
import { request } from '../../utils/request';
// 查询景点
export function getTour(data) {
return request({
url: `/sgyrdd/znprod/tour/list`,
method: 'GET',
data,
});
}
// 查询热门路线
export function getPopularList(data) {
return request({
url: `/sgyrdd/prod/popular`,
method: 'GET',
data,
});
}
// 查询商品列表
export function getProdList(data) {
return request({
url: `/sgyrdd/prod/prodList`,
method: 'GET',
data,
});
}
...@@ -55,17 +55,13 @@ ...@@ -55,17 +55,13 @@
:scroll-with-animation="true" :scroll-with-animation="true"
@scroll="scroll" @scroll="scroll"
> >
<view class="foodCard" v-for="(item, index) in 5" :key="index"> <view class="foodCard" v-for="(item, index) in popularRouterData" :key="index">
<!-- <img--> <!-- <img-->
<!-- class="img-icon"--> <!-- class="img-icon"-->
<!-- src="/static/assistingAgriculture/rural/icon.png"--> <!-- src="/static/assistingAgriculture/rural/icon.png"-->
<!-- style="width: 118rpx; height: 32rpx"--> <!-- style="width: 118rpx; height: 32rpx"-->
<!-- />--> <!-- />-->
<image <image class="test5" :src="item.imgUrl" mode="widthFix" />
class="test5"
src="/static/assistingAgriculture/rural/img4.png"
mode="widthFix"
/>
</view> </view>
</scroll-view> </scroll-view>
<!-- 列表--> <!-- 列表-->
...@@ -114,7 +110,7 @@ ...@@ -114,7 +110,7 @@
></wd-icon> ></wd-icon>
</view> </view>
</view> </view>
<Sort v-show="rotate" /> <Sort v-show="rotate" @sortParams="sortParams" />
<DepartureDate v-show="rotate2" /> <DepartureDate v-show="rotate2" />
<ScenicSpots v-show="rotate3" /> <ScenicSpots v-show="rotate3" />
<Screen v-show="rotate4" /> <Screen v-show="rotate4" />
...@@ -128,8 +124,8 @@ ...@@ -128,8 +124,8 @@
> >
<img class="card-img" :src="item.img" style="width: 248rpx; height: 240rpx" /> <img class="card-img" :src="item.img" style="width: 248rpx; height: 240rpx" />
<view class="detail-text"> <view class="detail-text">
<text class="detail-title">{{ item.title }}</text> <text class="detail-title">{{ item.prodName }}</text>
<text class="give">{{ item.give }}</text> <text class="give">{{ item.prodName }}</text>
<view class="tag"> <view class="tag">
<wd-tag <wd-tag
bg-color="#EEEEEE" bg-color="#EEEEEE"
...@@ -141,11 +137,11 @@ ...@@ -141,11 +137,11 @@
</wd-tag> </wd-tag>
</view> </view>
<view class="detail-score"> <view class="detail-score">
<text class="score">{{ item.score }}</text> <text class="score">{{ item.deliveryAmount }}</text>
<text class="num">月销{{ item.num }}</text> <text class="num">月销{{ item.deliveryAmount }}</text>
</view> </view>
<view class="venue"> <view class="venue">
<text class="place">{{ item.place }}</text> <text class="place">{{ item.prodName }}</text>
<text class="price">{{ item.price }}</text> <text class="price">{{ item.price }}</text>
</view> </view>
</view> </view>
...@@ -162,53 +158,24 @@ import Sort from '../../../components/assistingAgriculture/index/Sort.vue'; ...@@ -162,53 +158,24 @@ import Sort from '../../../components/assistingAgriculture/index/Sort.vue';
import DepartureDate from '../../../components/assistingAgriculture/index/DepartureDate.vue'; import DepartureDate from '../../../components/assistingAgriculture/index/DepartureDate.vue';
import ScenicSpots from '../../../components/assistingAgriculture/index/ScenicSpots.vue'; import ScenicSpots from '../../../components/assistingAgriculture/index/ScenicSpots.vue';
import Screen from '../../../components/assistingAgriculture/index/Screen.vue'; import Screen from '../../../components/assistingAgriculture/index/Screen.vue';
import { getPopularList, getProdList, getTour } from '@/api/assistingAgriculture/village';
import { getPresaleList } from '@/api/assistingAgriculture/building';
import { onMounted } from 'vue';
onMounted(async () => {
getProd();
getPopular();
});
const rotate = ref(false); const rotate = ref(false);
const rotate2 = ref(false); const rotate2 = ref(false);
const rotate3 = ref(false); const rotate3 = ref(false);
const rotate4 = ref(false); const rotate4 = ref(false);
const cardList = ref([ const cardList = ref([]);
{ const popularRouterData = ref([]);
img: '/static/assistingAgriculture/rural/img2.png', const params = ref({
title: '红枫湖+青岩古镇+云漫湖+云顶高坡景区一日游', current: 1,
give: '赠价值59元特产伴手礼一份', size: 10,
tag: ['可定明日', '无购物', '含保险'], });
score: '4.9', const sortType = ref(null);
num: '2000',
place: '云岩出发',
price: '299.00',
},
{
img: '/static/assistingAgriculture/rural/img2.png',
title: '红枫湖+青岩古镇+云漫湖+云顶高坡景区一日游',
give: '赠价值59元特产伴手礼一份',
tag: ['可定明日', '无购物', '含保险'],
score: '4.9',
num: '2000',
place: '云岩出发',
price: '299.00',
},
{
img: '/static/assistingAgriculture/rural/img2.png',
title: '红枫湖+青岩古镇+云漫湖+云顶高坡景区一日游',
give: '赠价值59元特产伴手礼一份',
tag: ['可定明日', '无购物', '含保险'],
score: '4.9',
num: '2000',
place: '云岩出发',
price: '299.00',
},
{
img: '/static/assistingAgriculture/rural/img2.png',
title: '红枫湖+青岩古镇+云漫湖+云顶高坡景区一日游',
give: '赠价值59元特产伴手礼一份',
tag: ['可定明日', '无购物', '含保险'],
score: '4.9',
num: '2000',
place: '云岩出发',
price: '299.00',
},
]);
const locationFiltering = (index) => { const locationFiltering = (index) => {
switch (index) { switch (index) {
case 0: case 0:
...@@ -237,6 +204,25 @@ const locationFiltering = (index) => { ...@@ -237,6 +204,25 @@ const locationFiltering = (index) => {
break; break;
} }
}; };
// 查询热门路线
const getPopular = () => {
getPopularList({ current: 1, size: 10 }).then((res) => {
res.data.records.forEach((item) => {
item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.pic;
});
popularRouterData.value = res.data.records;
});
};
// 查询列表
const getProd = () => {
getProdList({ current: 1, size: 10 }).then((res) => {
res.data.records.forEach((item) => {
item.img = import.meta.env.VITE_APP_IMG_URL + item.pic;
});
cardList.value = res.data.records;
console.log(res, 222);
});
};
function toRouteDetails() { function toRouteDetails() {
// TODO: 跳转到线路详情 // TODO: 跳转到线路详情
xma.navigateTo({ xma.navigateTo({
...@@ -312,6 +298,7 @@ page { ...@@ -312,6 +298,7 @@ page {
background: #ffffff; background: #ffffff;
margin-top: 20rpx; margin-top: 20rpx;
margin-left: 20rpx; margin-left: 20rpx;
padding-bottom: 30rpx;
} }
.scroll-x { .scroll-x {
width: 100%; width: 100%;
...@@ -482,4 +469,7 @@ page { ...@@ -482,4 +469,7 @@ page {
width: 56rpx; width: 56rpx;
height: 56rpx; height: 56rpx;
} }
.detail-score {
margin-top: 90rpx;
}
</style> </style>
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
color="#ABAAAA" color="#ABAAAA"
style="position: relative; float: right; top: -42rpx" style="position: relative; float: right; top: -42rpx"
></wd-icon> ></wd-icon>
<view class="buy-img">
<view class="hot-img" v-for="(item, index) in hotImgList" :key="index"> <view class="hot-img" v-for="(item, index) in hotImgList" :key="index">
<img <img
class="rice" class="rice"
...@@ -72,6 +73,7 @@ ...@@ -72,6 +73,7 @@
/> />
</view> </view>
</view> </view>
</view>
<!-- tabs--> <!-- tabs-->
<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
...@@ -98,7 +100,11 @@ ...@@ -98,7 +100,11 @@
:key="index" :key="index"
style="margin-left: 20rpx" style="margin-left: 20rpx"
> >
<img @tap="toDetail(item)" :src="item.imgUrl" style="width: 330rpx; height: 330rpx" /> <img
@tap="toDetail(item)"
:src="item.imgUrl"
style="width: 330rpx; height: 330rpx; border-radius: 16rpx"
/>
<view class="detail-title">{{ whh }}</view> <view class="detail-title">{{ whh }}</view>
<view class="price-page"> <view class="price-page">
<text class="price">{{ item.price }}</text> <text class="price">{{ item.price }}</text>
...@@ -249,18 +255,19 @@ page { ...@@ -249,18 +255,19 @@ page {
} }
.hot-sale { .hot-sale {
width: 710rpx; width: 710rpx;
height: 532rpx; //height: 532rpx;
border-radius: 16rpx; border-radius: 16rpx;
background: #ffffff; background: #ffffff;
margin: 20rpx; margin: 20rpx;
} }
.top-title { .top-title {
top: 5px; top: 20rpx;
position: relative; position: relative;
margin: 25rpx; margin: 25rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding-bottom: 10rpx;
} }
.left-title { .left-title {
font-family: Source Han Sans; font-family: Source Han Sans;
...@@ -444,7 +451,9 @@ page { ...@@ -444,7 +451,9 @@ page {
img.rice { img.rice {
border-radius: 16rpx 16rpx 16rpx 16rpx; border-radius: 16rpx 16rpx 16rpx 16rpx;
margin-left: 20rpx; margin-left: 20rpx;
margin-top: -40rpx; }
padding-bottom: 40rpx; .buy-img {
position: relative;
top: -20rpx;
} }
</style> </style>
...@@ -43,7 +43,10 @@ ...@@ -43,7 +43,10 @@
:key="index" :key="index"
@click="toDetail(item)" @click="toDetail(item)"
> >
<img :src="item.commodityImg" style="width: 216rpx; height: 176rpx" /> <img
:src="item.commodityImg"
style="width: 216rpx; height: 176rpx; border-radius: 16rpx"
/>
<view class="detail-title">{{ item.prodName }}</view> <view class="detail-title">{{ item.prodName }}</view>
<view class="jiage-page"> <view class="jiage-page">
<text class="jiage">{{ item.price }}</text> <text class="jiage">{{ item.price }}</text>
......
...@@ -48,7 +48,11 @@ ...@@ -48,7 +48,11 @@
</scroll-view> </scroll-view>
</view> </view>
<view class="tab-list" v-for="(item, index) in buyList" :key="index" @tap="toDetail(item)"> <view class="tab-list" v-for="(item, index) in buyList" :key="index" @tap="toDetail(item)">
<img class="buy-list" :src="item.img" style="width: 670rpx; height: 670rpx" /> <img
class="buy-list"
:src="item.img"
style="width: 670rpx; height: 670rpx; border-radius: 16rpx"
/>
<view> <view>
<text class="retail-price">零售价:¥{{ item.oriPrice }}/盒</text> <text class="retail-price">零售价:¥{{ item.oriPrice }}/盒</text>
<text class="presale-price">预售价:¥{{ item.price }}/盒</text> <text class="presale-price">预售价:¥{{ item.price }}/盒</text>
...@@ -83,7 +87,7 @@ ...@@ -83,7 +87,7 @@
z-index: 10; z-index: 10;
margin-left: 18rpx; margin-left: 18rpx;
top: -70rpx; top: -70rpx;
left: -14rpx; left: -19rpx;
" "
/> />
<image <image
...@@ -148,7 +152,6 @@ const params = { ...@@ -148,7 +152,6 @@ const params = {
const tabsList = ref([]); const tabsList = ref([]);
onMounted(async () => { onMounted(async () => {
getPresale(); getPresale();
// getPresaleProd();
presaleSortList(); presaleSortList();
}); });
// 预售板块轮播图 // 预售板块轮播图
...@@ -332,7 +335,7 @@ page { ...@@ -332,7 +335,7 @@ page {
height: 730rpx; height: 730rpx;
margin-top: -64rpx; margin-top: -64rpx;
margin-left: 20rpx; margin-left: 20rpx;
border-radius: 0px 0px 8px 8px; border-radius: 16rpx;
background: #ffffff; background: #ffffff;
margin-top: 6rpx; margin-top: 6rpx;
} }
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
<!-- 底部 --> <!-- 底部 -->
<view class="bottom-operation-bar"> <view class="bottom-operation-bar">
<view class="start" @click="collectionFn"> <view class="start" @click="collectionFn">
<image v-if="shopInfo.isCollect === 0" src="@/static/shop/start.png"></image> <wd-icon v-if="shopInfo.isCollect === 0" name="star" size="22px"></wd-icon>
<wd-icon v-else color="red" name="star-on" size="22px"></wd-icon> <wd-icon v-else color="red" name="star-on" size="22px"></wd-icon>
{{ shopInfo.privateIntFcount || 0 }} {{ shopInfo.privateIntFcount || 0 }}
</view> </view>
...@@ -1014,6 +1014,7 @@ page { ...@@ -1014,6 +1014,7 @@ page {
padding: 20rpx 20rpx 96rpx 42rpx; padding: 20rpx 20rpx 96rpx 42rpx;
position: fixed; position: fixed;
justify-content: space-between; justify-content: space-between;
align-items: center;
bottom: 0; bottom: 0;
.start { .start {
font-size: 11 * 2rpx; font-size: 11 * 2rpx;
...@@ -1033,7 +1034,7 @@ page { ...@@ -1033,7 +1034,7 @@ page {
background: #fa5151; background: #fa5151;
box-sizing: border-box; box-sizing: border-box;
padding: 20rpx 208rpx; padding: 20rpx 208rpx;
max-height: 72rpx; height: 72rpx;
} }
} }
} }
......
...@@ -231,6 +231,10 @@ function groupBuyConfirmFn(prodId, skuId) { ...@@ -231,6 +231,10 @@ function groupBuyConfirmFn(prodId, skuId) {
res.data.orderItems[0].pic = imgUrl + res.data.orderItems[0].pic; res.data.orderItems[0].pic = imgUrl + res.data.orderItems[0].pic;
orderInfo.value = res.data; orderInfo.value = res.data;
resolve(res.data.shopId); resolve(res.data.shopId);
}else {
wx.showToast({
title:res.msg
})
} }
}); });
}); });
......
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