Commit 3f9e4b46 authored by 陈宗胤(贵阳日报)'s avatar 陈宗胤(贵阳日报)
parents fe6de220 206cf3ec
......@@ -92,7 +92,13 @@
<!-- 美食类别 -->
<Classification v-show="rotate" :category="categoryData" @foodCategory="foodCategory" />
<!-- 附近筛选 -->
<Position v-show="rotate2" @nearby="nearby" @popular="popular" @region="region" />
<Position
v-show="rotate2"
@nearby="nearby"
@popular="popular"
@region="region"
@refresh="refreshList"
/>
<!-- 排序筛选 -->
<Sort v-show="rotate3" @sortParams="sortParams" />
</view>
......@@ -160,6 +166,17 @@ const nearby = (distance) => {
getMerchantList();
});
};
function refreshList() {
delete params.value.distance;
delete params.value.area;
delete params.value.communityName;
params.value.isEnd = false;
params.value.current = 1;
setTimeout(() => {
rotate2.value = false;
}, 400);
getMerchantList();
}
// communityName参数来源
const popular = (communityName) => {
params.value.communityName = communityName;
......
......@@ -9,13 +9,8 @@
<view class="item01" prop="merchantServices">
<text class="label">评分</text>
<!-- 评分 -->
<wd-rate
v-model="formdata.merchantServices"
active-color="#ff0000"
size="50rpx"
space="10px"
@change="handlemerchant"
/>
<wd-rate v-model="formdata.merchantServices" active-color="#ff0000" size="50rpx" space="10px"
@change="handlemerchant" />
</view>
<view class="item02">
<text>{{ merList[formdata.merchantServices] }}</text>
......@@ -23,34 +18,20 @@
</view>
<!-- 内容描述 -->
<view prop="evaluation">
<wd-textarea
v-model="formdata.evaluation"
placeholder="亲,分享您的看法,给其他人一个参考哦!"
/>
<wd-textarea v-model="formdata.evaluation" placeholder="亲,分享您的看法,给其他人一个参考哦!" />
</view>
<wd-cell title-width="0px"></wd-cell>
<text class="textarea">上传图片/视频</text>
<!-- 图片上传 -->
<view class="wdUpload" prop="images">
<wd-upload
multiple
:action="action"
@change="handleFile"
:file-list="formdata.images"
:before-remove="beforeRemove"
:header="headers"
></wd-upload>
<wd-upload multiple :action="action" @change="handleFile" :file-list="formdata.images"
:before-remove="beforeRemove" :header="headers"></wd-upload>
</view>
<!-- 匿名评价 -->
<wd-cell title="匿名评价" prop="isAnonymous" class="itemSwichval">
<wd-switch
size="48rpx"
active-color="#EC1B1B"
v-model="formdata.isAnonymous"
active-value="1"
inactive-value="0"
/>
<wd-switch size="48rpx" active-color="#EC1B1B" v-model="formdata.isAnonymous" active-value="1"
inactive-value="0" />
</wd-cell>
</wd-cell-group>
</wd-form>
......@@ -311,8 +292,10 @@ const handleSubmit = async () => {
:deep(.wd-upload__status-content) {
background-color: #000;
}
:deep(.wd-upload) {
gap: 20rpx;
.wd-upload__preview {
width: calc((100% - 60rpx) / 4);
margin: 0;
......
......@@ -236,7 +236,7 @@
<view class="start" @click="collectionFn">
<image v-if="shopInfo.isCollect === 0" src="@/static/shop/start.png"></image>
<wd-icon v-else color="red" name="star-on" size="22px"></wd-icon>
{{ shopInfo.privateIntFcount }}
{{ shopInfo.privateIntFcount || 0 }}
</view>
<!-- <view class="start" @click="shareFn">
<image src="@/static/shop/share.png"></image>
......@@ -1033,6 +1033,7 @@ page {
background: #fa5151;
box-sizing: border-box;
padding: 20rpx 208rpx;
max-height: 72rpx;
}
}
}
......
......@@ -351,7 +351,7 @@ const recommendedListOfPeripherals = ref([]);
onLoad(async (options) => {
params.value.shopId = options.shopId;
shopId.value = options.shopId;
scrollToTop();
// 使用 Promise.all 并行请求,提升性能
await Promise.all([
getStoreInformationFn(options.shopId),
......@@ -368,7 +368,13 @@ onLoad(async (options) => {
// 获取位置并计算距离
calculateDistance();
});
function scrollToTop() {
// 使用 scrollTo 方法滚动到顶部
xma.pageScrollTo({
scrollTop: 0,
duration: 300, // 动画时间,可选
});
}
onShow(async () => {
await getStoreInformationFn(params.value.shopId);
......@@ -376,24 +382,28 @@ onShow(async () => {
calculateDistance();
});
async function refreshShowDetail(item) {
params.value.shopId = item.shopId;
shopId.value = item.shopId;
// params.value.shopId = item.shopId;
// shopId.value = item.shopId;
// 使用 Promise.all 并行请求,提升性能
await Promise.all([
getStoreInformationFn(item.shopId),
groupBuyListFn(item.shopId),
couponShopListFn(item.shopId),
]);
// // 使用 Promise.all 并行请求,提升性能
// await Promise.all([
// getStoreInformationFn(item.shopId),
// groupBuyListFn(item.shopId),
// couponShopListFn(item.shopId),
// ]);
// 获取周边推荐信息
peripheryRecomFn();
// // 获取周边推荐信息
// peripheryRecomFn();
// 获取评价信息
getEvaluationPageFn();
// // 获取评价信息
// getEvaluationPageFn();
// 获取位置并计算距离
calculateDistance();
// // 获取位置并计算距离
// calculateDistance();
/// /////////////////////
xma.navigateTo({
url: `/pages/shop/shop?shopId=${item.shopId}`,
});
}
// 计算距离的函数封装
async function calculateDistance() {
......
......@@ -11,6 +11,7 @@
<text class="title">{{ shopDetail.shopName }}</text>
<view class="ratebox">
<wd-rate
custom-class="icon-statr"
v-model="shopDetail.grade"
size="13px"
space="1px"
......@@ -382,7 +383,11 @@ page {
display: flex;
align-items: center;
gap: 8rpx;
.icon-statr {
:deep(.wd-icon-star-on) {
display: block !important;
}
}
text {
font-family: PingFang SC Regular;
font-size: 24rpx;
......
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