Commit f1750aad authored by 周俊涛(东信)'s avatar 周俊涛(东信)
parents 7b232dea 249d2f19
...@@ -45,11 +45,15 @@ onMounted(async () => { ...@@ -45,11 +45,15 @@ onMounted(async () => {
getStartDateList(); getStartDateList();
}); });
const selectItem = (index, item) => { const selectItem = (index, item) => {
console.log(item, 323);
const datePart = timestampToDateBasic(value.value); const datePart = timestampToDateBasic(value.value);
if (index === selectedItem.value) {
selectedItem.value = null;
delete item.key;
emit('dataParams', item, datePart);
} else {
selectedItem.value = index; selectedItem.value = index;
emit('dataParams', item, datePart); emit('dataParams', item, datePart);
console.log(datePart, 'datePart'); }
}; };
const getStartDateList = () => { const getStartDateList = () => {
getStartDate(params).then((res) => { getStartDate(params).then((res) => {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
{{ item.startDate }} {{ item.startDate }}
</li> </li>
<wd-calendar use-default-slot v-model="value" @confirm="handleConfirm"> <wd-calendar use-default-slot v-model="value" @confirm="handleConfirm">
<li @tap="selectItem(index, item)">选择日期</li> <li>选择日期</li>
</wd-calendar> </wd-calendar>
</ul> </ul>
</view> </view>
...@@ -37,15 +37,23 @@ const props = defineProps({ ...@@ -37,15 +37,23 @@ const props = defineProps({
}, },
}); });
const reset = () => {
selectedItem.value = null;
};
defineExpose({ reset });
onMounted(async () => { onMounted(async () => {
getStartDateList(); getStartDateList();
}); });
const selectItem = (index, item) => { const selectItem = (index, item) => {
console.log(item, 323);
const datePart = timestampToDateBasic(value.value); const datePart = timestampToDateBasic(value.value);
if (index === selectedItem.value) {
selectedItem.value = null;
delete item.key;
emit('dataParams', item, datePart);
} else {
selectedItem.value = index; selectedItem.value = index;
emit('dataParams', item, datePart); emit('dataParams', item, datePart);
console.log(datePart, 'datePart'); }
}; };
const getStartDateList = () => { const getStartDateList = () => {
getStartDate(params).then((res) => { getStartDate(params).then((res) => {
...@@ -54,8 +62,7 @@ const getStartDateList = () => { ...@@ -54,8 +62,7 @@ const getStartDateList = () => {
}; };
function handleConfirm({ value }) { function handleConfirm({ value }) {
const datePart = timestampToDateBasic(value); const datePart = timestampToDateBasic(value);
console.log(datePart, 'datePart---111'); emit('dataParams', null, datePart);
selectItem(undefined, undefined);
} }
function timestampToDateBasic(timestamp) { function timestampToDateBasic(timestamp) {
const date = new Date(timestamp); const date = new Date(timestamp);
...@@ -64,10 +71,6 @@ function timestampToDateBasic(timestamp) { ...@@ -64,10 +71,6 @@ function timestampToDateBasic(timestamp) {
const day = date.getDate().toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, '0');
return `${year}/${month}/${day}`; return `${year}/${month}/${day}`;
} }
const reset = () => {
selectedItem.value = null;
};
defineExpose({ reset });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -90,6 +90,9 @@ defineExpose({ reset }); ...@@ -90,6 +90,9 @@ defineExpose({ reset });
padding-left: 20rpx; padding-left: 20rpx;
display: flex; display: flex;
flex-flow: wrap; flex-flow: wrap;
overflow: hidden;
height: 160rpx;
overflow-y: auto;
li { li {
width: 154rpx; width: 154rpx;
border-radius: 8rpx; border-radius: 8rpx;
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
"sdkConfigs": { "sdkConfigs": {
"maps": { "maps": {
"qqmap": { "qqmap": {
"key": "B7VBZ-PT5RB-WRHUT-J2EEQ-3WTUE-APFX4" "key": "MN4BZ-7JXKW-2RYRD-32QGF-AHONV-PAFUN"
} }
} }
} }
......
...@@ -120,7 +120,8 @@ ...@@ -120,7 +120,8 @@
{ {
"path": "pages/storeEntry/index", "path": "pages/storeEntry/index",
"style": { "style": {
"navigationBarTitleText": "我的店铺" "navigationBarTitleText": "我的店铺",
"enablePullDownRefresh": true
} }
}, },
{ {
......
...@@ -328,15 +328,28 @@ const sortParams = (sortMode) => { ...@@ -328,15 +328,28 @@ const sortParams = (sortMode) => {
getProd(); getProd();
}; };
// 出发日期 // 出发日期
// const dataParams = (item, datePart) => {
// if (item !== undefined) {
// dateType.value = item.key;
// getProd();
// } else if (item === undefined) {
// dateType.value = 8;
// allocateDate.value = datePart;
// getProd();
// }
// };
const dataParams = (item, datePart) => { const dataParams = (item, datePart) => {
if (item !== undefined) { if (item) {
dateType.value = item.key; dateType.value = item.key;
getProd(); getProd();
} else if (item === undefined) { } else {
dateType.value = 8; dateType.value = 8;
if (datePart && datePart !== 'NaN/NaN/NaN') {
allocateDate.value = datePart; allocateDate.value = datePart;
rotate2.value = false;
getProd(); getProd();
} }
}
}; };
// 景点 // 景点
const placeParams = (item) => { const placeParams = (item) => {
......
...@@ -176,7 +176,7 @@ const rateList = ref({ ...@@ -176,7 +176,7 @@ const rateList = ref({
onLoad(async (options) => { onLoad(async (options) => {
catalog.shopId = options.shopId; catalog.shopId = options.shopId;
catalog.prodId = options.prodId catalog.prodId = options.prodId;
console.log(options); console.log(options);
await getList(); await getList();
await getTotal(); await getTotal();
......
...@@ -22,6 +22,54 @@ ...@@ -22,6 +22,54 @@
height="512rpx" height="512rpx"
></wd-swiper> ></wd-swiper>
</view> </view>
<view class="countDown">
<img
src="/static/assistingAgriculture/detail/img5.png"
style="width: 750rpx; height: 122rpx; position: absolute"
/>
<img
src="/static/assistingAgriculture/detail/img1.png"
style="width: 368rpx; height: 122rpx; position: absolute; z-index: 99; margin-left: 380rpx"
/>
<view class="count-info">
<view class="flex-center">
<view style="color: #fa5151">{{ dataDetails.prod.price }}</view>
<text style="margin-left: -30rpx">/只</text>
<view style="z-index: 9999; color: #ffffff; margin-left: 320rpx; font-size: 28rpx">
距离结束仅剩
</view>
</view>
<view class="flex-center">
<view style="font-size: 28rpx">
已销售{{ dataDetails.prod.soldNum || 0 }}件 | 仅剩{{
dataDetails.skus[0].stocks || 0
}}
</view>
<wd-count-down
:time="timeLeft"
style="
position: absolute;
z-index: 999;
left: 440rpx;
margin-top: 10rpx;
width: max-content;
"
>
<template #default="{ current }">
<span class="custom-count-down">{{ current.days }}</span>
<span class="custom-count-down-colon">:</span>
<span class="custom-count-down">{{ current.hours }}</span>
<span class="custom-count-down-colon">:</span>
<span class="custom-count-down">{{ current.minutes }}</span>
<span class="custom-count-down-colon">:</span>
<span class="custom-count-down">{{ current.seconds }}</span>
</template>
</wd-count-down>
</view>
</view>
</view>
<!--详情--> <!--详情-->
<view class="detail"> <view class="detail">
<view class="detail-title">{{ dataDetails.prod.prodName }}</view> <view class="detail-title">{{ dataDetails.prod.prodName }}</view>
...@@ -129,6 +177,8 @@ const storeList = ref([ ...@@ -129,6 +177,8 @@ const storeList = ref([
{ img: '/static/assistingAgriculture/detail/img8.png', text: '客服' }, { img: '/static/assistingAgriculture/detail/img8.png', text: '客服' },
{ img: '/static/assistingAgriculture/detail/img6.png', text: '购物车' }, { img: '/static/assistingAgriculture/detail/img6.png', text: '购物车' },
]); ]);
const format = ref('DD:HH:mm');
const time = ref('');
let prodId; let prodId;
const dataDetails = ref({}); const dataDetails = ref({});
const commentData = ref({}); const commentData = ref({});
...@@ -145,12 +195,29 @@ function handleClick(e) { ...@@ -145,12 +195,29 @@ function handleClick(e) {
} }
function jumpPjPgae() { function jumpPjPgae() {
xma.navigateTo({ xma.navigateTo({
url: `/pages/assistingAgriculture/detail/comment?shopId=${dataDetails.value.prod.shopId}`, url: `/pages/assistingAgriculture/detail/comment?shopId=${dataDetails.value.prod.shopId}&prodId=${dataDetails.value.prodPresale.prodId}`,
}); });
} }
function onChange(e) { function onChange(e) {
console.log(e); console.log(e);
} }
const currentTime = ref(Date.now()); // 当前时间
// 每隔一秒更新当前时间
setInterval(() => {
currentTime.value = Date.now();
}, 1000);
// 计算属性:剩余时间
const timeLeft = computed(() => {
if (dataDetails.value.prodPresale && dataDetails.value.prodPresale.presaleEndTime) {
const endTime = new Date(dataDetails.value.prodPresale.presaleEndTime).getTime();
const timeDiff = endTime - currentTime.value;
return timeDiff > 0 ? timeDiff : 0;
}
return 0;
});
// 获取商品详情 // 获取商品详情
const getProdDetailFn = () => { const getProdDetailFn = () => {
getProdDetail(prodId).then((res) => { getProdDetail(prodId).then((res) => {
...@@ -191,6 +258,7 @@ const addOrderFn = () => { ...@@ -191,6 +258,7 @@ const addOrderFn = () => {
duration: 1500, duration: 1500,
icon: 'none', icon: 'none',
}); });
getshoppingCartListFn();
}); });
}; };
// 获取购物车列表 // 获取购物车列表
...@@ -286,7 +354,6 @@ page { ...@@ -286,7 +354,6 @@ page {
border-radius: 16rpx; border-radius: 16rpx;
background: #ffffff; background: #ffffff;
position: relative; position: relative;
top: 10px;
} }
.detail-title { .detail-title {
width: 277 * 2rpx; width: 277 * 2rpx;
...@@ -301,6 +368,7 @@ page { ...@@ -301,6 +368,7 @@ page {
color: #3d3d3d; color: #3d3d3d;
padding-top: 20rpx; padding-top: 20rpx;
padding-left: 20rpx; padding-left: 20rpx;
padding-bottom: 40rpx;
} }
.detail-int { .detail-int {
width: 336 * 2rpx; width: 336 * 2rpx;
...@@ -313,8 +381,8 @@ page { ...@@ -313,8 +381,8 @@ page {
font-variation-settings: 'opsz' auto; font-variation-settings: 'opsz' auto;
font-feature-settings: 'kern' on; font-feature-settings: 'kern' on;
color: #abaaaa; color: #abaaaa;
padding-top: 10rpx;
padding-left: 20rpx; padding-left: 20rpx;
padding-bottom: 20rpx;
} }
.share-img { .share-img {
float: right; float: right;
...@@ -342,7 +410,7 @@ page { ...@@ -342,7 +410,7 @@ page {
height: 88rpx; height: 88rpx;
border-radius: 16rpx; border-radius: 16rpx;
background: #ffffff; background: #ffffff;
margin-top: 30rpx; margin-top: 10rpx;
} }
.evaluate { .evaluate {
display: flex; display: flex;
...@@ -395,7 +463,9 @@ page { ...@@ -395,7 +463,9 @@ page {
padding-bottom: 120rpx; padding-bottom: 120rpx;
.content { .content {
margin-top: 30rpx; margin-top: 30rpx;
padding: 20rpx;
.desc { .desc {
padding-bottom: 20rpx;
img { img {
width: 100%; width: 100%;
} }
...@@ -458,4 +528,36 @@ page { ...@@ -458,4 +528,36 @@ page {
margin-top: -90rpx; margin-top: -90rpx;
margin-left: 400rpx; margin-left: 400rpx;
} }
.countDown {
height: 122rpx;
}
.count-info {
position: absolute;
display: flex;
flex-direction: column;
align-items: center;
padding: 20rpx 30rpx;
}
.flex-center {
display: flex;
justify-content: space-between;
width: 100%;
padding: 0 20px;
}
.custom-count-down {
display: inline-block;
width: 56rpx;
color: #fa5151;
font-size: 24rpx;
text-align: center;
background-color: #ffffff;
border-radius: 4rpx;
}
.custom-count-down-colon {
display: inline-block;
margin: 0 8rpx;
color: #ffffff;
}
</style> </style>
...@@ -84,8 +84,9 @@ ...@@ -84,8 +84,9 @@
<!-- ></wd-icon>--> <!-- ></wd-icon>-->
<view class="buy-img"> <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 <image
class="rice" class="rice"
mode="aspectFill"
@tap="toDetail(item)" @tap="toDetail(item)"
:src="item.img" :src="item.img"
style="width: 670rpx; height: 236rpx" style="width: 670rpx; height: 236rpx"
...@@ -480,13 +481,13 @@ page { ...@@ -480,13 +481,13 @@ page {
height: 100%; height: 100%;
background-color: lightgreen; background-color: lightgreen;
} }
img.rice {
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin-left: 20rpx;
}
.buy-img { .buy-img {
position: relative; position: relative;
top: -20rpx; top: -20rpx;
.rice {
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin-left: 20rpx;
}
} }
.searchBox { .searchBox {
opacity: 1; opacity: 1;
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
> >
<view class="searchBox" :style="{ border }"> <view class="searchBox" :style="{ border }">
<image <image
mode="aspectFill"
class="magnifyingGlass" class="magnifyingGlass"
src="../../../static/index/magnifyingGlass.png" src="../../../static/index/magnifyingGlass.png"
mode="aspectFit|aspectFill|widthFix"
/> />
<input <input
type="text" type="text"
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
v-for="(item, index) in sortList" v-for="(item, index) in sortList"
:key="index" :key="index"
> >
<img :src="item.icon" style="width: 96rpx; height: 96rpx" /> <image mode="aspectFill" :src="item.icon" style="width: 96rpx; height: 96rpx" />
<view class="sort-text">{{ item.categoryName }}</view> <view class="sort-text">{{ item.categoryName }}</view>
</view> </view>
</view> </view>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<view class="product-page" v-for="(item, index) in list" :key="index"> <view class="product-page" v-for="(item, index) in list" :key="index">
<view> <view>
<view class="page-title">{{ item.categoryName }}</view> <view class="page-title">{{ item.categoryName }}</view>
<img :src="item.img" class="main-img" /> <image mode="aspectFill" :src="item.img" class="main-img" />
<view style="display: flex; flex-direction: row"> <view style="display: flex; flex-direction: row">
<view <view
class="detail-border" class="detail-border"
...@@ -59,7 +59,8 @@ ...@@ -59,7 +59,8 @@
:key="index" :key="index"
@click="toDetail(item)" @click="toDetail(item)"
> >
<img <image
mode="aspectFill"
:src="item.commodityImg" :src="item.commodityImg"
style="width: 216rpx; height: 176rpx; border-radius: 16rpx" style="width: 216rpx; height: 176rpx; border-radius: 16rpx"
/> />
......
...@@ -195,8 +195,7 @@ const stateList = ref({}); ...@@ -195,8 +195,7 @@ const stateList = ref({});
const orderDic = ref(); const orderDic = ref();
onLoad(async (options) => { onLoad(async (options) => {
// await signIn(); // await signIn();
if (!getToken()) await signIn(); if (!getToken()) await signIn2();
// if (!getToken()) await signIn2();
if (!getOrderDic()) await orderStatus(); if (!getOrderDic()) await orderStatus();
orderDic.value = getOrderDic(); orderDic.value = getOrderDic();
orderDic.value.baseOrder[0].value = 'all'; orderDic.value.baseOrder[0].value = 'all';
......
...@@ -169,7 +169,6 @@ ...@@ -169,7 +169,6 @@
v-model="show" v-model="show"
position="bottom" position="bottom"
custom-style="height:500px;overflow:auto;" custom-style="height:500px;overflow:auto;"
safe-area-inset-bottom="true"
@close="handleClose" @close="handleClose"
> >
<view class="hcontent"> <view class="hcontent">
...@@ -383,7 +382,6 @@ const exsitedData = ref(); ...@@ -383,7 +382,6 @@ const exsitedData = ref();
const dealCategoryData = ref([]); const dealCategoryData = ref([]);
onLoad((options) => { onLoad((options) => {
console.log(options.content);
headers.value = { Authorization: 'Bearer ' + token }; headers.value = { Authorization: 'Bearer ' + token };
if (options.content != null) { if (options.content != null) {
isNewFlag.value = false; isNewFlag.value = false;
...@@ -710,17 +708,19 @@ const submitData = () => { ...@@ -710,17 +708,19 @@ const submitData = () => {
// 重新定位收货地址 // 重新定位收货地址
async function changeLocation() { async function changeLocation() {
showNavBar.value = false; showNavBar.value = false;
console.log('1111');
uni.chooseLocation({ uni.chooseLocation({
success: function (res) { success: function (res) {
console.log('第一次回调', res);
// forMData.value.city = res.address; // forMData.value.city = res.address;
formData.shopAddress = res.address; formData.shopAddress = res.address;
formData.shopLng = res.longitude; formData.shopLng = res.longitude;
formData.shopLat = res.latitude; formData.shopLat = res.latitude;
uni.request({ uni.request({
url: '/ws/geocoder/v1/', url: 'https://apis.map.qq.com/ws/geocoder/v1/',
data: { data: {
key: 'B7VBZ-PT5RB-WRHUT-J2EEQ-3WTUE-APFX4', key: 'MN4BZ-7JXKW-2RYRD-32QGF-AHONV-PAFUN',
location: `${res.latitude},${res.longitude}`, location: `${res.latitude},${res.longitude}`,
}, },
success: function (res) { success: function (res) {
...@@ -740,6 +740,10 @@ async function changeLocation() { ...@@ -740,6 +740,10 @@ async function changeLocation() {
// showNavBar.value = true; // showNavBar.value = true;
} }
}, },
complete: function (res) {
console.log('在complete里');
console.log(res);
},
}); });
}, },
complete: (res) => { complete: (res) => {
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
import Header from '@/pages/order/components/Header/index.vue'; import Header from '@/pages/order/components/Header/index.vue';
import { shopList, deleteShopInfoById } from '@/api/storeEntry'; import { shopList, deleteShopInfoById } from '@/api/storeEntry';
const itemUrl = import.meta.env.VITE_APP_IMG_URL; const itemUrl = import.meta.env.VITE_APP_IMG_URL;
const shopStatus = reactive({ const shopStatus = reactive({
0: '停业中', 0: '停业中',
1: '营业中', 1: '营业中',
...@@ -83,7 +84,17 @@ const shopGto = (item) => { ...@@ -83,7 +84,17 @@ const shopGto = (item) => {
onLoad(() => { onLoad(() => {
getList(); getList();
}); });
onPullDownRefresh(async () => {
await getList();
xma.stopPullDownRefresh({
success: function (res) {
xma.showToast({
title: '刷新列表成功',
duration: 1000,
});
},
});
});
const deleteShop = (shopId) => { const deleteShop = (shopId) => {
xma.showModal({ xma.showModal({
title: '删除提示', title: '删除提示',
...@@ -114,6 +125,10 @@ const deleteShop = (shopId) => { ...@@ -114,6 +125,10 @@ const deleteShop = (shopId) => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.uni-page-refresh) {
top: 50%;
}
.container { .container {
position: relative; position: relative;
width: 375 * 2rpx; width: 375 * 2rpx;
......
...@@ -131,7 +131,8 @@ const fileDomain = import.meta.env.VITE_APP_IMG_URL; ...@@ -131,7 +131,8 @@ const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const contentHeight = ref('88rpx'); const contentHeight = ref('88rpx');
onLoad(async () => { onLoad(async () => {
if (!getToken()) await signIn(); // await signIn();
if (!getToken()) await signIn2();
xma.xh.getMenuButtonBoundingClientRect({ xma.xh.getMenuButtonBoundingClientRect({
success(res) { success(res) {
contentHeight.value = res.bottom * 2 + 10 + 'rpx'; // 左边界坐标,单位:px contentHeight.value = res.bottom * 2 + 10 + 'rpx'; // 左边界坐标,单位:px
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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