Commit b0411422 authored by 彭佳妮(贵阳日报)'s avatar 彭佳妮(贵阳日报)
parents ebb1cd19 79910082
...@@ -13,6 +13,13 @@ ...@@ -13,6 +13,13 @@
"navigationStyle":"custom", "navigationStyle":"custom",
} }
}, },
{
"path": "pages/assistingAgriculture/searchPage/searchPage",
"style": {
"navigationBarTitleText": "搜索",
"navigationStyle":"custom"
}
},
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "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 @@ ...@@ -92,7 +92,13 @@
<!-- 美食类别 --> <!-- 美食类别 -->
<Classification v-show="rotate" :category="categoryData" @foodCategory="foodCategory" /> <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" /> <Sort v-show="rotate3" @sortParams="sortParams" />
</view> </view>
...@@ -160,6 +166,17 @@ const nearby = (distance) => { ...@@ -160,6 +166,17 @@ const nearby = (distance) => {
getMerchantList(); 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参数来源 // communityName参数来源
const popular = (communityName) => { const popular = (communityName) => {
params.value.communityName = communityName; params.value.communityName = communityName;
......
...@@ -266,6 +266,7 @@ function jumpProductDetails(item) { ...@@ -266,6 +266,7 @@ function jumpProductDetails(item) {
// 搜索 // 搜索
const toSearch = (keyword) => { const toSearch = (keyword) => {
listParams.keyword = keyword; listParams.keyword = keyword;
reset();
getMerchantList(); getMerchantList();
}; };
// 获取优惠券 // 获取优惠券
...@@ -564,6 +565,7 @@ page { ...@@ -564,6 +565,7 @@ page {
display: flex; display: flex;
justify-content: space-evenly; justify-content: space-evenly;
margin-top: 32rpx; margin-top: 32rpx;
align-items: center;
.choice { .choice {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -583,6 +585,7 @@ page { ...@@ -583,6 +585,7 @@ page {
display: flex; display: flex;
justify-content: space-evenly; justify-content: space-evenly;
margin-top: 34rpx; margin-top: 34rpx;
align-items: center;
.choice { .choice {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
...@@ -17,18 +17,22 @@ ...@@ -17,18 +17,22 @@
@change="handlemerchant" @change="handlemerchant"
/> />
</view> </view>
<view class="item02"> <view class="item02">
<text>{{ merList[formdata.merchantServices] }}</text> <text>{{ merList[formdata.merchantServices] }}</text>
</view> </view>
</view> </view>
<!-- 内容描述 --> <!-- 内容描述 -->
<view prop="evaluation"> <view class="item03">
<wd-textarea <wd-textarea
prop="evaluation"
type="textarea"
v-model="formdata.evaluation" v-model="formdata.evaluation"
placeholder="亲,分享您的看法,给其他人一个参考哦!" placeholder="亲,分享您的看法,给其他人一个参考哦!"
clearable
/> />
</view> </view>
<wd-cell title-width="0px"></wd-cell>
<text class="textarea">上传图片/视频</text> <text class="textarea">上传图片/视频</text>
<!-- 图片上传 --> <!-- 图片上传 -->
<view class="wdUpload" prop="images"> <view class="wdUpload" prop="images">
...@@ -89,7 +93,7 @@ onLoad((options) => { ...@@ -89,7 +93,7 @@ onLoad((options) => {
const formdata = reactive<{ const formdata = reactive<{
orderNumber: string; orderNumber: string;
evaluation: string; evaluation: null | string;
images: string[]; images: string[];
isAnonymous: number; isAnonymous: number;
descriptionMatches: number; descriptionMatches: number;
...@@ -107,33 +111,59 @@ const formdata = reactive<{ ...@@ -107,33 +111,59 @@ const formdata = reactive<{
* 表单验证规则 * 表单验证规则
*/ */
const rules = { const rules = {
// images: [ images: [
// { {
// required: true, required: true,
// message: '请上传图片1', validator: (value: any) => {
// validator: (value: any) => { if (value.length) {
// if (value.length) { return true;
// console.log('上传成功'); } else {
// } else { xma.showToast({
// console.log('请上传图片'); title: '最少上传一张图片',
// } icon: 'none',
// }, duration: 2000,
// }, });
// ], return false;
evaluation: [{ required: true, message: '请填写评价内容' }], }
// merchantServices: [ },
// { },
// required: true, ],
// message: '请选择商家服务评分', evaluation: [
// validator: (value: any) => { {
// if (value >= 1 && value <= 5) { required: true,
// console.log('评分成功'); message: '请填你的看法',
// } else { validator: (value: string) => {
// console.log('请选择评分'); 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 () => { ...@@ -199,19 +229,11 @@ const hdSubmit = async () => {
}; };
const handleSubmit = async () => { const handleSubmit = async () => {
form.value form.value.validate().then(({ valid, errors }) => {
.validate() if (valid) {
.then(({ valid, errors }) => { hdSubmit();
console.log('valid', errors); }
if (valid) { });
// uToast.info({ msg: '校验通过' });
console.log('校验通过');
hdSubmit();
}
})
.catch((error: any) => {
console.log(error, 'error');
});
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -311,8 +333,10 @@ const handleSubmit = async () => { ...@@ -311,8 +333,10 @@ const handleSubmit = async () => {
:deep(.wd-upload__status-content) { :deep(.wd-upload__status-content) {
background-color: #000; background-color: #000;
} }
:deep(.wd-upload) { :deep(.wd-upload) {
gap: 20rpx; gap: 20rpx;
.wd-upload__preview { .wd-upload__preview {
width: calc((100% - 60rpx) / 4); width: calc((100% - 60rpx) / 4);
margin: 0; margin: 0;
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
<view class="start" @click="collectionFn"> <view class="start" @click="collectionFn">
<image v-if="shopInfo.isCollect === 0" src="@/static/shop/start.png"></image> <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> <wd-icon v-else color="red" name="star-on" size="22px"></wd-icon>
{{ shopInfo.privateIntFcount }} {{ shopInfo.privateIntFcount || 0 }}
</view> </view>
<!-- <view class="start" @click="shareFn"> <!-- <view class="start" @click="shareFn">
<image src="@/static/shop/share.png"></image> <image src="@/static/shop/share.png"></image>
...@@ -1033,6 +1033,7 @@ page { ...@@ -1033,6 +1033,7 @@ page {
background: #fa5151; background: #fa5151;
box-sizing: border-box; box-sizing: border-box;
padding: 20rpx 208rpx; padding: 20rpx 208rpx;
max-height: 72rpx;
} }
} }
} }
......
...@@ -242,7 +242,7 @@ function showDetailFn(item) { ...@@ -242,7 +242,7 @@ function showDetailFn(item) {
* 选择优惠券 * 选择优惠券
*/ */
function selectShopCoupon(item) { function selectShopCoupon(item) {
if (item.cashCondition < orderInfo.value.orderItems[0].price) { if (item.cashCondition <= orderInfo.value.orderItems[0].price) {
activeCouponId.value = item.couponId; activeCouponId.value = item.couponId;
activeCouponInfo.value = item; activeCouponInfo.value = item;
showpopup.value = false; showpopup.value = false;
......
...@@ -351,7 +351,7 @@ const recommendedListOfPeripherals = ref([]); ...@@ -351,7 +351,7 @@ const recommendedListOfPeripherals = ref([]);
onLoad(async (options) => { onLoad(async (options) => {
params.value.shopId = options.shopId; params.value.shopId = options.shopId;
shopId.value = options.shopId; shopId.value = options.shopId;
scrollToTop();
// 使用 Promise.all 并行请求,提升性能 // 使用 Promise.all 并行请求,提升性能
await Promise.all([ await Promise.all([
getStoreInformationFn(options.shopId), getStoreInformationFn(options.shopId),
...@@ -368,7 +368,13 @@ onLoad(async (options) => { ...@@ -368,7 +368,13 @@ onLoad(async (options) => {
// 获取位置并计算距离 // 获取位置并计算距离
calculateDistance(); calculateDistance();
}); });
function scrollToTop() {
// 使用 scrollTo 方法滚动到顶部
xma.pageScrollTo({
scrollTop: 0,
duration: 300, // 动画时间,可选
});
}
onShow(async () => { onShow(async () => {
await getStoreInformationFn(params.value.shopId); await getStoreInformationFn(params.value.shopId);
...@@ -376,24 +382,28 @@ onShow(async () => { ...@@ -376,24 +382,28 @@ onShow(async () => {
calculateDistance(); calculateDistance();
}); });
async function refreshShowDetail(item) { async function refreshShowDetail(item) {
params.value.shopId = item.shopId; // params.value.shopId = item.shopId;
shopId.value = item.shopId; // shopId.value = item.shopId;
// 使用 Promise.all 并行请求,提升性能 // // 使用 Promise.all 并行请求,提升性能
await Promise.all([ // await Promise.all([
getStoreInformationFn(item.shopId), // getStoreInformationFn(item.shopId),
groupBuyListFn(item.shopId), // groupBuyListFn(item.shopId),
couponShopListFn(item.shopId), // couponShopListFn(item.shopId),
]); // ]);
// 获取周边推荐信息 // // 获取周边推荐信息
peripheryRecomFn(); // peripheryRecomFn();
// 获取评价信息 // // 获取评价信息
getEvaluationPageFn(); // getEvaluationPageFn();
// 获取位置并计算距离 // // 获取位置并计算距离
calculateDistance(); // calculateDistance();
/// /////////////////////
xma.navigateTo({
url: `/pages/shop/shop?shopId=${item.shopId}`,
});
} }
// 计算距离的函数封装 // 计算距离的函数封装
async function calculateDistance() { 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