Commit 46315ba8 authored by 陈宗胤(贵阳日报)'s avatar 陈宗胤(贵阳日报)
parents 774242b2 c271370a
...@@ -69,7 +69,7 @@ function timestampToDateBasic(timestamp) { ...@@ -69,7 +69,7 @@ function timestampToDateBasic(timestamp) {
const year = date.getFullYear(); const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0'); const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, '0');
return `${year}/${month}/${day}`; return `${year}-${month}-${day} 00:00:00`;
} }
</script> </script>
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref } from 'vue';
const items = ref([ const items = ref([
{ name: '距离优先', sortMode: 1 }, { name: '距离优先', sortMode: '1' },
{ name: '好评优先', sortMode: 2 }, { name: '好评优先', sortMode: '2' },
{ name: '销量优先', sortMode: 3 }, { name: '销量优先', sortMode: '3' },
{ name: '低价优先', sortMode: 4 }, { name: '低价优先', sortMode: '4' },
{ name: '高价优先', sortMode: 5 }, { name: '高价优先', sortMode: '5' },
]); ]);
const emit = defineEmits(['sortParams']); const emit = defineEmits(['sortParams']);
const selectedItem = ref(null); const selectedItem = ref(null);
......
...@@ -340,10 +340,10 @@ const sortParams = (sortMode) => { ...@@ -340,10 +340,10 @@ const sortParams = (sortMode) => {
// }; // };
const dataParams = (item, datePart) => { const dataParams = (item, datePart) => {
if (item) { if (item) {
dateType.value = item.key; dateType.value = item.key.toString();
getProd(); getProd();
} else { } else {
dateType.value = 8; dateType.value = '8';
if (datePart && datePart !== 'NaN/NaN/NaN') { if (datePart && datePart !== 'NaN/NaN/NaN') {
allocateDate.value = datePart; allocateDate.value = datePart;
rotate2.value = false; rotate2.value = false;
...@@ -355,7 +355,7 @@ const dataParams = (item, datePart) => { ...@@ -355,7 +355,7 @@ const dataParams = (item, datePart) => {
const placeParams = (item) => { const placeParams = (item) => {
const ids = item.map((i) => i.id); const ids = item.map((i) => i.id);
const arr = ids.join(','); const arr = ids.join(',');
attractionIdList.value = arr.split(',').map(Number); attractionIdList.value = arr.split(',').map(String);
getProd(); getProd();
}; };
...@@ -406,7 +406,7 @@ const getProd = (searchKeyword = '') => { ...@@ -406,7 +406,7 @@ const getProd = (searchKeyword = '') => {
// ...(startCityList.value && { startCityList: startCityList.value.split(',') }), // ...(startCityList.value && { startCityList: startCityList.value.split(',') }),
// ...(serviceList.value && { serviceList: serviceList.value.split(',') }), // ...(serviceList.value && { serviceList: serviceList.value.split(',') }),
// ...(forPeopleList.value && { forPeopleList: forPeopleList.value.split(',') }), // ...(forPeopleList.value && { forPeopleList: forPeopleList.value.split(',') }),
...(dateType.value === 8 && { allocateDate: allocateDate.value }), ...(dateType.value === '8' && { allocateDate: allocateDate.value }),
...(searchKeyword && { keyword: searchKeyword }), ...(searchKeyword && { keyword: searchKeyword }),
}; };
getProdList(params).then((res) => { getProdList(params).then((res) => {
......
...@@ -198,7 +198,7 @@ const sortParams = (sortMode) => { ...@@ -198,7 +198,7 @@ const sortParams = (sortMode) => {
// 出发日期 // 出发日期
const dataParams = (item, datePart) => { const dataParams = (item, datePart) => {
if (item) { if (item) {
params.value.dateType = item.key; params.value.dateType = String(item.key);
refresh().then(() => { refresh().then(() => {
queryOfferProdListFn(); queryOfferProdListFn();
}); });
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</div> </div>
<div class="type">店铺</div> <div class="type">店铺</div>
<div class="shop-name" @click="toStore(item)">{{ shop.shopName }}</div> <div class="shop-name" @click="toStore(item)">{{ shop.shopName }}</div>
<wd-icon name="arrow-right" size="32rpx" style="margin-left: -15rpx"></wd-icon> <wd-icon name="arrow-right" size="32rpx" style="position: relative"></wd-icon>
</div> </div>
<div class="commodity-list"> <div class="commodity-list">
<div class="commodity-item flex-align-center" v-for="(item, j) in shop.prodInfos" :key="j"> <div class="commodity-item flex-align-center" v-for="(item, j) in shop.prodInfos" :key="j">
......
<template> <template>
<Search <Search :backgroundBox="backgroundBox" :backIcon="backIcon">
style="position: fixed; top: 0; width: 100%"
:backgroundBox="backgroundBox"
:backIcon="backIcon"
>
<view class="searchBox" :style="{ border }"> <view class="searchBox" :style="{ border }">
<image <image
class="magnifyingGlass" class="magnifyingGlass"
...@@ -21,31 +17,7 @@ ...@@ -21,31 +17,7 @@
/> />
</view> </view>
</Search> </Search>
<view class="container"> <view class="bck-img">
<view class="top">
<!-- <Search-->
<!-- style="position: fixed; top: 0; width: 100%"-->
<!-- :backgroundBox="backgroundBox"-->
<!-- :backIcon="backIcon"-->
<!-- >-->
<!-- <view class="searchBox" :style="{ border }">-->
<!-- <image-->
<!-- class="magnifyingGlass"-->
<!-- src="../../../static/index/magnifyingGlass.png"-->
<!-- mode="aspectFit|aspectFill|widthFix"-->
<!-- />-->
<!-- <input-->
<!-- type="text"-->
<!-- class="text"-->
<!-- @confirm="toSearch"-->
<!-- placeholder="输入商品名称"-->
<!-- @input="updateModelValue"-->
<!-- @keyup.enter="toSearch"-->
<!-- @focus="toSearch"-->
<!-- />-->
<!-- </view>-->
<!-- </Search>-->
</view>
<view class="nav"> <view class="nav">
<wd-swiper <wd-swiper
:list="swiperList" :list="swiperList"
...@@ -58,109 +30,99 @@ ...@@ -58,109 +30,99 @@
imageMode="aspectFill" imageMode="aspectFill"
></wd-swiper> ></wd-swiper>
</view> </view>
<view class="sort"> </view>
<view style="display: flex; flex-direction: row"> <view class="sort">
<view <view style="display: flex; flex-direction: row">
class="borderClass" <view
@tap="chooseTab(index, item.categoryId)" class="borderClass"
v-for="(item, index) in sortList" @tap="chooseTab(index, item.categoryId)"
:key="index" v-for="(item, index) in sortList"
> :key="index"
<img :src="item.imgUrl" style="width: 48rpx; height: 48rpx" /> >
<view class="sort-text">{{ item.categoryName }}</view> <img :src="item.imgUrl" style="width: 48rpx; height: 48rpx" />
</view> <view class="sort-text">{{ item.categoryName }}</view>
</view> </view>
</view> </view>
</view>
<view>
<view> <view>
<scroll-view class="tabs" show-scrollbar="false" scroll-x :scroll-with-animation="true">
<text
@tap="chooseBTab(index, item.categoryId)"
v-for="(item, index) in tabsData"
:key="index"
class="text"
:class="light === index ? 'light' : ''"
>
{{ item.categoryName }}
</text>
</scroll-view>
</view>
<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; border-radius: 16rpx"
/>
<view> <view>
<scroll-view class="tabs" show-scrollbar="false" scroll-x :scroll-with-animation="true"> <text class="retail-price">零售价:¥{{ item.oriPrice }}/盒</text>
<text <text class="presale-price">预售价:¥{{ item.price }}/盒</text>
@tap="chooseBTab(index, item.categoryId)"
v-for="(item, index) in tabsData"
:key="index"
class="text"
:class="light === index ? 'light' : ''"
>
{{ item.categoryName }}
</text>
</scroll-view>
</view> </view>
<view class="tab-list" v-for="(item, index) in buyList" :key="index" @tap="toDetail(item)"> <view>
<img <img
class="buy-list" class="buy-img"
:src="item.img" src="/static/assistingAgriculture/presale/img6.png"
style="width: 670rpx; height: 670rpx; border-radius: 16rpx" style="
position: sticky;
width: 284rpx;
height: 128rpx;
float: right;
margin-top: -80rpx;
margin-right: 16rpx;
"
/> />
<view> </view>
<text class="retail-price">零售价:¥{{ item.oriPrice }}/盒</text> </view>
<text class="presale-price">预售价:¥{{ item.price }}/盒</text> </view>
</view> <view class="waterfall">
<view> <view class="wt-left wt-list">
<img <view class="wt-item" v-for="(item, index) in buyList" :key="index" @tap="toDetail(item)">
class="buy-img" <view class="item-img">
src="/static/assistingAgriculture/presale/img6.png" <image :src="item.img" mode="widthFix" style="border-radius: 16rpx"></image>
<image
class="presale-img"
src="/static/assistingAgriculture/presale/presale.png"
style=" style="
position: sticky; width: 132rpx;
width: 284rpx; height: 64rpx;
height: 128rpx; z-index: 10;
float: right; margin-left: 18rpx;
margin-top: -80rpx; top: -70rpx;
margin-right: 16rpx; left: -19rpx;
" "
/> />
<image
class="preview-img"
src="/static/assistingAgriculture/presale/preview.png"
style="width: 264rpx; height: 40rpx; z-index: 9; top: -70rpx"
/>
<text class="pre-text">预计9月15日发货</text>
</view> </view>
</view> <!-- 介绍部分 -->
</view> <view class="introduce-section">
<view class="waterfall"> <text class="title">{{ item.prodName }}</text>
<view class="wt-left wt-list"> <view class="tags-box">
<view class="wt-item" v-for="(item, index) in buyList" :key="index" @tap="toDetail(item)"> <text class="good-detail">{{ item.detail }}</text>
<view class="item-img"> <text class="introduction">{{ item.introduction }}</text>
<image :src="item.img" mode="widthFix" style="border-radius: 16rpx"></image>
<image
class="presale-img"
src="/static/assistingAgriculture/presale/presale.png"
style="
width: 132rpx;
height: 64rpx;
z-index: 10;
margin-left: 18rpx;
top: -70rpx;
left: -19rpx;
"
/>
<image
class="preview-img"
src="/static/assistingAgriculture/presale/preview.png"
style="width: 264rpx; height: 40rpx; z-index: 9; top: -70rpx"
/>
<text class="pre-text">预计9月15日发货</text>
</view> </view>
<!-- 介绍部分 --> <view class="price-info">
<view class="introduce-section"> <text class="good-price">{{ item.price }}</text>
<text class="title">{{ item.prodName }}</text> <img class="add" src="/static/assistingAgriculture/presale/add.png" />
<view class="tags-box">
<text class="good-detail">{{ item.detail }}</text>
<text class="introduction">{{ item.introduction }}</text>
</view>
<view class="price-info">
<text class="good-price">{{ item.price }}</text>
<img class="add" src="/static/assistingAgriculture/presale/add.png" />
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 购物车悬浮按钮 -->
<!--<view class="cart-floating" @tap="toCart">
<wd-badge :modelValue="subscript">
<img
class="shop-car"
src="/static/assistingAgriculture/presale/cart.png"
style="width: 40rpx; height: 40rpx"
/>
</wd-badge>
</view>-->
<fab position="2" :cartCount="subscript" /> <fab position="2" :cartCount="subscript" />
</template> </template>
...@@ -194,7 +156,7 @@ const params = { ...@@ -194,7 +156,7 @@ const params = {
}; };
const subscript = ref(0); const subscript = ref(0);
const tabsList = ref([]); const tabsList = ref([]);
const backgroundBox = ref(''); const backgroundBox = ref('#71C456');
const border = ref(''); const border = ref('');
onMounted(async () => { onMounted(async () => {
getPresale(); getPresale();
...@@ -303,7 +265,7 @@ onPageScroll((e) => { ...@@ -303,7 +265,7 @@ onPageScroll((e) => {
backgroundBox.value = '#fff'; backgroundBox.value = '#fff';
border.value = '1rpx solid gray'; border.value = '1rpx solid gray';
} else { } else {
backgroundBox.value = ''; backgroundBox.value = '#71C456';
border.value = ''; border.value = '';
} }
}); });
...@@ -313,19 +275,12 @@ onPageScroll((e) => { ...@@ -313,19 +275,12 @@ onPageScroll((e) => {
page { page {
background: #f3f3f3; background: #f3f3f3;
} }
.container { .bck-img {
.top { background: linear-gradient(180deg, #71c456 0%, rgba(129, 159, 81, 0) 100%);
width: 100%;
height: 440rpx;
background: linear-gradient(180deg, #71c456 0%, rgba(243, 243, 243, 0) 100%);
border-radius: 0rpx 0rpx 0rpx 0rpx;
overflow: hidden;
}
} }
.nav { .nav {
width: 710rpx; width: 710rpx;
margin-left: 18rpx; margin-left: 18rpx;
margin-top: -300rpx;
} }
.nav-img { .nav-img {
width: 710rpx; width: 710rpx;
......
...@@ -180,46 +180,50 @@ ...@@ -180,46 +180,50 @@
</view> </view>
<view class="nr"> <view class="nr">
<view class="left"> <view class="left">
<template v-for="(item, index) in shopCategoryTree" :key="index"> <scroll-view scroll-y="true" class="scroll-Y">
<view <template v-for="(item, index) in shopCategoryTree" :key="index">
class="name"
@tap="setActiveCategory(index)"
:class="{ active: categoryActiveIndex == index }"
>
{{ item.name }}
</view>
</template>
</view>
<view class="right">
<template v-for="(item, index) in shopCategoryTree" :key="index">
<view class="item" v-show="categoryActiveIndex == index">
<view <view
v-for="item1 in shopCategoryTree[index].children" class="name"
:key="item1.areaId" @tap="setActiveCategory(index)"
class="miniitem" :class="{ active: categoryActiveIndex == index }"
> >
<view class="hname"> {{ item.name }}
{{ item1.name }} </view>
</view> </template>
<view class="hnr"> </scroll-view>
<template v-for="sitem in item1.children" :key="sitem.areaId"> </view>
<wd-tag <view class="right">
class="tagstyle" <scroll-view scroll-y="true" class="scroll-Y">
:class="{ <template v-for="(item, index) in shopCategoryTree" :key="index">
active: choosedShopInfo.some( <view class="item" v-show="categoryActiveIndex == index">
(item) => item.areaId === sitem.areaId, <view
), v-for="item1 in shopCategoryTree[index].children"
}" :key="item1.areaId"
round class="miniitem"
@tap="chooseShopType(sitem.areaId, sitem.name)" >
> <view class="hname">
{{ sitem.name }} {{ item1.name }}
</wd-tag> </view>
</template> <view class="hnr">
<template v-for="sitem in item1.children" :key="sitem.areaId">
<wd-tag
class="tagstyle"
:class="{
active: choosedShopInfo.some(
(item) => item.areaId === sitem.areaId,
),
}"
round
@tap="chooseShopType(sitem.areaId, sitem.name)"
>
{{ sitem.name }}
</wd-tag>
</template>
</view>
</view> </view>
</view> </view>
</view> </template>
</template> </scroll-view>
</view> </view>
</view> </view>
</view> </view>
...@@ -725,7 +729,6 @@ async function changeLocation() { ...@@ -725,7 +729,6 @@ async function changeLocation() {
location: `${res.latitude},${res.longitude}`, location: `${res.latitude},${res.longitude}`,
}, },
success: function (res) { success: function (res) {
// console.log('逆地理编码:' + JSON.stringify(res));
console.log('进入成功回调'); console.log('进入成功回调');
console.log(res.data.status); console.log(res.data.status);
if (res.data.status === 0) { if (res.data.status === 0) {
...@@ -799,11 +802,13 @@ page { ...@@ -799,11 +802,13 @@ page {
.hcontent { .hcontent {
height: 100%; height: 100%;
display: flex;
flex-direction: column;
.flex1 { .flex1 {
padding: 10px; padding: 10px;
display: flex; display: flex;
position: fixed;
width: 100%; width: 100%;
justify-content: space-between; justify-content: space-between;
box-sizing: border-box; box-sizing: border-box;
...@@ -813,15 +818,19 @@ page { ...@@ -813,15 +818,19 @@ page {
} }
.nr { .nr {
padding-top: 42px; padding-top: 0px;
display: flex; display: flex;
flex: 1;
overflow: hidden;
.left { .left {
background: rgb(244, 244, 244); background: rgb(244, 244, 244);
width: 28%; width: 28%;
height: 100%; height: 100%;
position: fixed; overflow-y: hidden;
.scroll-Y {
height: 100%;
}
.name { .name {
text-align: left; text-align: left;
padding-left: 20rpx; padding-left: 20rpx;
...@@ -837,10 +846,16 @@ page { ...@@ -837,10 +846,16 @@ page {
.right { .right {
background: #fff; background: #fff;
width: 72%; width: 72%;
position: fixed;
left: 28%; left: 28%;
height: 100%; height: 100%;
overflow-y: auto; overflow-y: hidden;
padding: 0 5px 5px 5px;
box-sizing: border-box;
.scroll-Y {
height: 100%;
}
.item { .item {
height: auto; height: auto;
......
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