Commit f1750aad authored by 周俊涛(东信)'s avatar 周俊涛(东信)
parents 7b232dea 249d2f19
......@@ -45,11 +45,15 @@ onMounted(async () => {
getStartDateList();
});
const selectItem = (index, item) => {
console.log(item, 323);
const datePart = timestampToDateBasic(value.value);
if (index === selectedItem.value) {
selectedItem.value = null;
delete item.key;
emit('dataParams', item, datePart);
} else {
selectedItem.value = index;
emit('dataParams', item, datePart);
console.log(datePart, 'datePart');
}
};
const getStartDateList = () => {
getStartDate(params).then((res) => {
......
......@@ -11,7 +11,7 @@
{{ item.startDate }}
</li>
<wd-calendar use-default-slot v-model="value" @confirm="handleConfirm">
<li @tap="selectItem(index, item)">选择日期</li>
<li>选择日期</li>
</wd-calendar>
</ul>
</view>
......@@ -37,15 +37,23 @@ const props = defineProps({
},
});
const reset = () => {
selectedItem.value = null;
};
defineExpose({ reset });
onMounted(async () => {
getStartDateList();
});
const selectItem = (index, item) => {
console.log(item, 323);
const datePart = timestampToDateBasic(value.value);
if (index === selectedItem.value) {
selectedItem.value = null;
delete item.key;
emit('dataParams', item, datePart);
} else {
selectedItem.value = index;
emit('dataParams', item, datePart);
console.log(datePart, 'datePart');
}
};
const getStartDateList = () => {
getStartDate(params).then((res) => {
......@@ -54,8 +62,7 @@ const getStartDateList = () => {
};
function handleConfirm({ value }) {
const datePart = timestampToDateBasic(value);
console.log(datePart, 'datePart---111');
selectItem(undefined, undefined);
emit('dataParams', null, datePart);
}
function timestampToDateBasic(timestamp) {
const date = new Date(timestamp);
......@@ -64,10 +71,6 @@ function timestampToDateBasic(timestamp) {
const day = date.getDate().toString().padStart(2, '0');
return `${year}/${month}/${day}`;
}
const reset = () => {
selectedItem.value = null;
};
defineExpose({ reset });
</script>
<style lang="scss" scoped>
......
......@@ -90,6 +90,9 @@ defineExpose({ reset });
padding-left: 20rpx;
display: flex;
flex-flow: wrap;
overflow: hidden;
height: 160rpx;
overflow-y: auto;
li {
width: 154rpx;
border-radius: 8rpx;
......
......@@ -82,7 +82,7 @@
"sdkConfigs": {
"maps": {
"qqmap": {
"key": "B7VBZ-PT5RB-WRHUT-J2EEQ-3WTUE-APFX4"
"key": "MN4BZ-7JXKW-2RYRD-32QGF-AHONV-PAFUN"
}
}
}
......
......@@ -120,7 +120,8 @@
{
"path": "pages/storeEntry/index",
"style": {
"navigationBarTitleText": "我的店铺"
"navigationBarTitleText": "我的店铺",
"enablePullDownRefresh": true
}
},
{
......
......@@ -328,15 +328,28 @@ const sortParams = (sortMode) => {
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) => {
if (item !== undefined) {
if (item) {
dateType.value = item.key;
getProd();
} else if (item === undefined) {
} else {
dateType.value = 8;
if (datePart && datePart !== 'NaN/NaN/NaN') {
allocateDate.value = datePart;
rotate2.value = false;
getProd();
}
}
};
// 景点
const placeParams = (item) => {
......
......@@ -176,7 +176,7 @@ const rateList = ref({
onLoad(async (options) => {
catalog.shopId = options.shopId;
catalog.prodId = options.prodId
catalog.prodId = options.prodId;
console.log(options);
await getList();
await getTotal();
......
......@@ -22,6 +22,54 @@
height="512rpx"
></wd-swiper>
</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-title">{{ dataDetails.prod.prodName }}</view>
......@@ -129,6 +177,8 @@ const storeList = ref([
{ img: '/static/assistingAgriculture/detail/img8.png', text: '客服' },
{ img: '/static/assistingAgriculture/detail/img6.png', text: '购物车' },
]);
const format = ref('DD:HH:mm');
const time = ref('');
let prodId;
const dataDetails = ref({});
const commentData = ref({});
......@@ -145,12 +195,29 @@ function handleClick(e) {
}
function jumpPjPgae() {
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) {
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 = () => {
getProdDetail(prodId).then((res) => {
......@@ -191,6 +258,7 @@ const addOrderFn = () => {
duration: 1500,
icon: 'none',
});
getshoppingCartListFn();
});
};
// 获取购物车列表
......@@ -286,7 +354,6 @@ page {
border-radius: 16rpx;
background: #ffffff;
position: relative;
top: 10px;
}
.detail-title {
width: 277 * 2rpx;
......@@ -301,6 +368,7 @@ page {
color: #3d3d3d;
padding-top: 20rpx;
padding-left: 20rpx;
padding-bottom: 40rpx;
}
.detail-int {
width: 336 * 2rpx;
......@@ -313,8 +381,8 @@ page {
font-variation-settings: 'opsz' auto;
font-feature-settings: 'kern' on;
color: #abaaaa;
padding-top: 10rpx;
padding-left: 20rpx;
padding-bottom: 20rpx;
}
.share-img {
float: right;
......@@ -342,7 +410,7 @@ page {
height: 88rpx;
border-radius: 16rpx;
background: #ffffff;
margin-top: 30rpx;
margin-top: 10rpx;
}
.evaluate {
display: flex;
......@@ -395,7 +463,9 @@ page {
padding-bottom: 120rpx;
.content {
margin-top: 30rpx;
padding: 20rpx;
.desc {
padding-bottom: 20rpx;
img {
width: 100%;
}
......@@ -458,4 +528,36 @@ page {
margin-top: -90rpx;
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>
......@@ -84,8 +84,9 @@
<!-- ></wd-icon>-->
<view class="buy-img">
<view class="hot-img" v-for="(item, index) in hotImgList" :key="index">
<img
<image
class="rice"
mode="aspectFill"
@tap="toDetail(item)"
:src="item.img"
style="width: 670rpx; height: 236rpx"
......@@ -480,13 +481,13 @@ page {
height: 100%;
background-color: lightgreen;
}
img.rice {
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin-left: 20rpx;
}
.buy-img {
position: relative;
top: -20rpx;
.rice {
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin-left: 20rpx;
}
}
.searchBox {
opacity: 1;
......
......@@ -8,9 +8,9 @@
>
<view class="searchBox" :style="{ border }">
<image
mode="aspectFill"
class="magnifyingGlass"
src="../../../static/index/magnifyingGlass.png"
mode="aspectFit|aspectFill|widthFix"
/>
<input
type="text"
......@@ -43,7 +43,7 @@
v-for="(item, index) in sortList"
: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>
</view>
......@@ -51,7 +51,7 @@
<view class="product-page" v-for="(item, index) in list" :key="index">
<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
class="detail-border"
......@@ -59,7 +59,8 @@
:key="index"
@click="toDetail(item)"
>
<img
<image
mode="aspectFill"
:src="item.commodityImg"
style="width: 216rpx; height: 176rpx; border-radius: 16rpx"
/>
......
......@@ -195,8 +195,7 @@ const stateList = ref({});
const orderDic = ref();
onLoad(async (options) => {
// await signIn();
if (!getToken()) await signIn();
// if (!getToken()) await signIn2();
if (!getToken()) await signIn2();
if (!getOrderDic()) await orderStatus();
orderDic.value = getOrderDic();
orderDic.value.baseOrder[0].value = 'all';
......
......@@ -169,7 +169,6 @@
v-model="show"
position="bottom"
custom-style="height:500px;overflow:auto;"
safe-area-inset-bottom="true"
@close="handleClose"
>
<view class="hcontent">
......@@ -383,7 +382,6 @@ const exsitedData = ref();
const dealCategoryData = ref([]);
onLoad((options) => {
console.log(options.content);
headers.value = { Authorization: 'Bearer ' + token };
if (options.content != null) {
isNewFlag.value = false;
......@@ -710,17 +708,19 @@ const submitData = () => {
// 重新定位收货地址
async function changeLocation() {
showNavBar.value = false;
console.log('1111');
uni.chooseLocation({
success: function (res) {
console.log('第一次回调', res);
// forMData.value.city = res.address;
formData.shopAddress = res.address;
formData.shopLng = res.longitude;
formData.shopLat = res.latitude;
uni.request({
url: '/ws/geocoder/v1/',
url: 'https://apis.map.qq.com/ws/geocoder/v1/',
data: {
key: 'B7VBZ-PT5RB-WRHUT-J2EEQ-3WTUE-APFX4',
key: 'MN4BZ-7JXKW-2RYRD-32QGF-AHONV-PAFUN',
location: `${res.latitude},${res.longitude}`,
},
success: function (res) {
......@@ -740,6 +740,10 @@ async function changeLocation() {
// showNavBar.value = true;
}
},
complete: function (res) {
console.log('在complete里');
console.log(res);
},
});
},
complete: (res) => {
......
......@@ -52,6 +52,7 @@
import Header from '@/pages/order/components/Header/index.vue';
import { shopList, deleteShopInfoById } from '@/api/storeEntry';
const itemUrl = import.meta.env.VITE_APP_IMG_URL;
const shopStatus = reactive({
0: '停业中',
1: '营业中',
......@@ -83,7 +84,17 @@ const shopGto = (item) => {
onLoad(() => {
getList();
});
onPullDownRefresh(async () => {
await getList();
xma.stopPullDownRefresh({
success: function (res) {
xma.showToast({
title: '刷新列表成功',
duration: 1000,
});
},
});
});
const deleteShop = (shopId) => {
xma.showModal({
title: '删除提示',
......@@ -114,6 +125,10 @@ const deleteShop = (shopId) => {
</script>
<style lang="scss" scoped>
:deep(.uni-page-refresh) {
top: 50%;
}
.container {
position: relative;
width: 375 * 2rpx;
......
......@@ -131,7 +131,8 @@ const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const contentHeight = ref('88rpx');
onLoad(async () => {
if (!getToken()) await signIn();
// await signIn();
if (!getToken()) await signIn2();
xma.xh.getMenuButtonBoundingClientRect({
success(res) {
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