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