Commit b0411422 authored by 彭佳妮(贵阳日报)'s avatar 彭佳妮(贵阳日报)
parents ebb1cd19 79910082
......@@ -13,6 +13,13 @@
"navigationStyle":"custom",
}
},
{
"path": "pages/assistingAgriculture/searchPage/searchPage",
"style": {
"navigationBarTitleText": "搜索",
"navigationStyle":"custom"
}
},
{
"path": "pages/index/index",
"style": {
......
<template>
<view class="search-page">
<view class="search" :style="{ background: '#FF0101' }">
<wd-icon
name="thin-arrow-left"
class="icon"
@tap="back"
:style="{ color: '#FFFAE8' }"
></wd-icon>
<slot></slot>
<view class="searchBox">
<wd-icon name="search" size="22rpx"></wd-icon>
<input
type="text"
:value="test"
class="text"
@confirm="toSearch"
placeholder="请输入搜索内容"
confirm-type="搜索"
/>
</view>
</view>
<wd-tabs v-model="tab">
<block>
<wd-tab title="商品">
<view class="content">内容1</view>
</wd-tab>
<wd-tab title="店铺">
<view class="content">内容2</view>
</wd-tab>
</block>
</wd-tabs>
</view>
</template>
<script setup>
function toSearch(keyword) {}
const tab = ref(0);
</script>
<style lang="scss" scoped>
page {
background: #f6f6f6;
}
.search-page {
display: flex;
width: 750rpx;
flex-direction: column;
align-items: center;
.wd-tabs {
background-color: #fff;
}
&:deep(.wd-tabs__nav) {
background-color: #fff;
}
&:deep(.wd-tabs__line) {
background-color: #e9231b;
bottom: 2px;
}
.search {
width: 100%;
height: 124rpx;
opacity: 0.8;
margin: 0 auto;
display: flex;
align-items: center;
padding-left: 20rpx;
box-sizing: border-box;
.arrow {
width: 15rpx;
height: 24rpx;
}
.icon {
font-size: 28rpx;
}
.searchBox {
opacity: 1;
width: 350rpx;
height: 56rpx;
background: #ffffff;
border-radius: 28rpx 28rpx 28rpx 28rpx;
display: flex;
align-items: center;
padding-left: 20rpx;
margin-left: 20rpx;
.magnifyingGlass {
width: 26rpx;
height: 26rpx;
}
.text {
margin-left: 10rpx;
font-size: 24rpx;
}
}
}
.content {
display: flex;
flex-direction: column;
align-content: center;
gap: 20rpx;
}
}
</style>
......@@ -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;
......
......@@ -266,6 +266,7 @@ function jumpProductDetails(item) {
// 搜索
const toSearch = (keyword) => {
listParams.keyword = keyword;
reset();
getMerchantList();
};
// 获取优惠券
......@@ -564,6 +565,7 @@ page {
display: flex;
justify-content: space-evenly;
margin-top: 32rpx;
align-items: center;
.choice {
display: flex;
flex-direction: column;
......@@ -583,6 +585,7 @@ page {
display: flex;
justify-content: space-evenly;
margin-top: 34rpx;
align-items: center;
.choice {
display: flex;
flex-direction: column;
......
......@@ -17,18 +17,22 @@
@change="handlemerchant"
/>
</view>
<view class="item02">
<text>{{ merList[formdata.merchantServices] }}</text>
</view>
</view>
<!-- 内容描述 -->
<view prop="evaluation">
<view class="item03">
<wd-textarea
prop="evaluation"
type="textarea"
v-model="formdata.evaluation"
placeholder="亲,分享您的看法,给其他人一个参考哦!"
clearable
/>
</view>
<wd-cell title-width="0px"></wd-cell>
<text class="textarea">上传图片/视频</text>
<!-- 图片上传 -->
<view class="wdUpload" prop="images">
......@@ -89,7 +93,7 @@ onLoad((options) => {
const formdata = reactive<{
orderNumber: string;
evaluation: string;
evaluation: null | string;
images: string[];
isAnonymous: number;
descriptionMatches: number;
......@@ -107,33 +111,59 @@ const formdata = reactive<{
* 表单验证规则
*/
const rules = {
// images: [
// {
// required: true,
// message: '请上传图片1',
// validator: (value: any) => {
// if (value.length) {
// console.log('上传成功');
// } else {
// console.log('请上传图片');
// }
// },
// },
// ],
evaluation: [{ required: true, message: '请填写评价内容' }],
// merchantServices: [
// {
// required: true,
// message: '请选择商家服务评分',
// validator: (value: any) => {
// if (value >= 1 && value <= 5) {
// console.log('评分成功');
// } else {
// console.log('请选择评分');
// }
// },
// },
// ],
images: [
{
required: true,
validator: (value: any) => {
if (value.length) {
return true;
} else {
xma.showToast({
title: '最少上传一张图片',
icon: 'none',
duration: 2000,
});
return false;
}
},
},
],
evaluation: [
{
required: true,
message: '请填你的看法',
validator: (value: string) => {
console.log('看法', value);
if (value && value.length) {
return true;
} else {
xma.showToast({
title: '请填你的看法',
icon: 'none',
duration: 2000,
});
return false;
}
},
},
],
merchantServices: [
{
required: true,
validator: (value: any) => {
if (value >= 1 && value <= 5) {
return true;
} else {
xma.showToast({
title: '请选服务评分',
icon: 'none',
duration: 2000,
});
return false;
}
},
},
],
};
/**
......@@ -199,19 +229,11 @@ const hdSubmit = async () => {
};
const handleSubmit = async () => {
form.value
.validate()
.then(({ valid, errors }) => {
console.log('valid', errors);
if (valid) {
// uToast.info({ msg: '校验通过' });
console.log('校验通过');
hdSubmit();
}
})
.catch((error: any) => {
console.log(error, 'error');
});
form.value.validate().then(({ valid, errors }) => {
if (valid) {
hdSubmit();
}
});
};
</script>
<style lang="scss" scoped>
......@@ -311,8 +333,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;
}
}
}
......
......@@ -242,7 +242,7 @@ function showDetailFn(item) {
* 选择优惠券
*/
function selectShopCoupon(item) {
if (item.cashCondition < orderInfo.value.orderItems[0].price) {
if (item.cashCondition <= orderInfo.value.orderItems[0].price) {
activeCouponId.value = item.couponId;
activeCouponInfo.value = item;
showpopup.value = false;
......
......@@ -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() {
......
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