Commit aaeb1eaf authored by 陈宗胤(贵阳日报)'s avatar 陈宗胤(贵阳日报)
parents 530749b0 ec4dc1d0
...@@ -94,7 +94,7 @@ const selectItem = (selectItem) => { ...@@ -94,7 +94,7 @@ const selectItem = (selectItem) => {
} }
.active { .active {
color: #fa5151; color: #fa5151;
background: #FEEEEE; background: #feeeee;
} }
} }
} }
......
...@@ -140,6 +140,13 @@ ...@@ -140,6 +140,13 @@
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff"
} }
}, },
{
"path": "pages/assistingAgriculture/RuralTravel/specialOfferZoneList",
"style": {
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#ffffff"
}
},
{ {
"path": "pages/assistingAgriculture/shop/index", "path": "pages/assistingAgriculture/shop/index",
"style": { "style": {
......
<template>
<view class="special-offer-zone-list-page">
<view class="swiper">
<wd-swiper
customClass="swiper-custom"
:list="shopSwiperList"
autoplay
height="440rpx"
customStyle="border-radius: 0rpx !important;"
:current="current"
@click="handleClick"
@change="onChange"
:indicator="{ type: 'dots-bar' }"
>
<template #indicator="{ current, total }">
<view class="custom-indicator" style="position: absolute; bottom: 24rpx; right: 24rpx">
{{ current + 1 }}/{{ total }}
</view>
</template>
</wd-swiper>
<!-- 列表-->
<view class="bootom">
<view class="bootom-top">
<view class="option" @tap="locationFiltering(0)">
<text :class="{ rotate: rotate }">智能排序</text>
<wd-icon
:class="{ rotate: rotate }"
name="fill-arrow-down"
size="24rpx"
class="icons"
></wd-icon>
</view>
</view>
<view class="bootom-top">
<view class="option" @tap="locationFiltering(1)">
<text :class="{ rotate: rotate2 }">出发日期</text>
<wd-icon
:class="{ rotate: rotate2 }"
name="fill-arrow-down"
size="24rpx"
class="icons"
></wd-icon>
</view>
</view>
<view class="bootom-top">
<view class="option" @tap="locationFiltering(2)">
<text :class="{ rotate: rotate3 }">景点</text>
<wd-icon
:class="{ rotate: rotate3 }"
name="fill-arrow-down"
size="24rpx"
class="icons"
></wd-icon>
</view>
</view>
<view class="bootom-top">
<view class="option" @tap="locationFiltering(3)">
<text :class="{ rotate: rotate4 }">筛选</text>
<wd-icon
:class="{ rotate: rotate4 }"
name="fill-arrow-down"
size="24rpx"
class="icons"
></wd-icon>
</view>
</view>
<Sort v-show="rotate" />
<DepartureDate v-show="rotate2" />
<ScenicSpots v-show="rotate3" />
<Screen v-show="rotate4" />
</view>
<view class="list">
<view class="item" v-for="i in 10" :key="i">
<image mode="aspectFill" src="@/static/assistingAgriculture/reviewDetails/fj.png"></image>
<view class="info">
<text class="title multi-line">红枫湖+青岩古镇+云漫湖+云顶高坡景区一日游</text>
<text class="subtitle">赠价值59元特产伴手礼一份</text>
<view class="tag-list">
<text class="tag">可定明日</text>
<text class="tag">可定明日</text>
<text class="tag">可定明日</text>
</view>
<view class="fs-box">
<text class="fs-num">4.9分</text>
<text style="margin-left: 20rpx" class="sales-volume">月销2000+</text>
</view>
<text class="address">云岩出发</text>
</view>
<text class="price">¥299.00</text>
</view>
</view>
</view>
</view>
</template>
<script setup>
import Sort from '../../../components/assistingAgriculture/index/Sort.vue';
import DepartureDate from '../../../components/assistingAgriculture/index/DepartureDate.vue';
import ScenicSpots from '../../../components/assistingAgriculture/index/ScenicSpots.vue';
import Screen from '../../../components/assistingAgriculture/index/Screen.vue';
const rotate = ref(false);
const rotate2 = ref(false);
const rotate3 = ref(false);
const rotate4 = ref(false);
const current = ref(0);
const shopSwiperList = ref([
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg',
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/capybara.jpg',
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg',
]);
const locationFiltering = (index) => {
switch (index) {
case 0:
rotate.value = !rotate.value;
rotate2.value = false;
rotate3.value = false;
rotate4.value = false;
break;
case 1:
rotate2.value = !rotate2.value;
rotate.value = false;
rotate3.value = false;
rotate4.value = false;
break;
case 2:
rotate3.value = !rotate3.value;
rotate.value = false;
rotate2.value = false;
rotate4.value = false;
break;
case 3:
rotate4.value = !rotate4.value;
rotate.value = false;
rotate2.value = false;
rotate3.value = false;
break;
}
};
function handleClick(e) {
console.log(e);
}
function onChange(e) {
console.log(e);
}
</script>
<style lang="scss" scoped>
page {
background: #f3f3f3;
}
.special-offer-zone-list-page {
display: flex;
flex-direction: column;
align-items: center;
width: 750rpx;
.custom-indicator {
padding: 0 12rpx;
height: 48rpx;
line-height: 48rpx;
border-radius: 45%;
background: rgba(0, 0, 0, 0.6);
color: #ffffff;
font-size: 24rpx;
}
.swiper {
width: 100%;
:deep(.wd-swiper__track) {
border-radius: 0;
}
}
.bootom {
display: flex;
flex-direction: row;
justify-content: space-around;
border-radius: 6rpx;
position: relative;
margin-top: 20rpx;
.bootom-top {
display: flex;
align-items: center;
padding: 0 20rpx;
justify-content: space-between;
.option {
text {
font-size: 24rpx;
color: #343434;
}
.red {
color: #fa5151;
}
.icons {
color: #d8d8d8;
transform: rotate(-180deg);
transition: all 0.3s linear;
}
.rotate {
transform: rotate(0deg);
transition: all 0.3s linear;
color: #fa5151;
}
}
.light {
color: #ff7c00;
background: #ffdcbb;
}
}
}
.list {
width: 335 * 2rpx;
background: #fff;
display: flex;
flex-direction: column;
align-items: center;
margin: 0 auto;
border-radius: 16rpx;
margin-top: 20rpx;
.item {
width: 100%;
padding: 20rpx;
box-sizing: border-box;
display: flex;
image {
width: 240rpx;
height: 240rpx;
border-radius: 16rpx;
flex-shrink: 0;
}
.info {
display: flex;
flex-direction: column;
align-items: flex-start;
margin-left: 20rpx;
.title {
max-width: 400rpx;
font-size: 14 * 2rpx;
color: #3d3d3d;
}
.subtitle {
font-size: 11 * 2rpx;
color: #666666;
margin-top: 10rpx;
}
.tag-list {
display: flex;
flex-wrap: wrap;
margin-top: 10rpx;
.tag {
box-sizing: border-box;
padding: 10rpx 16rpx;
background: #eee;
color: #3d3d3d;
font-size: 16rpx;
border-radius: 30rpx;
margin-top: 10rpx;
margin-left: 10rpx;
}
}
.fs-box {
margin-top: 10rpx;
font-size: 12 * 2rpx;
color: #0974f5;
}
.address {
margin-top: 10rpx;
font-size: 12 * 2rpx;
color: #0974f5;
}
}
.price {
font-size: 14 * 2rpx;
font-weight: bold;
/* 主题色 */
color: #fa5151;
align-self: flex-end;
}
}
}
}
</style>
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
<!-- </view>--> <!-- </view>-->
<view class="btn"> <view class="btn">
<wd-button type="warning" size="small" style="margin-right: 10rpx">加入购物车</wd-button> <wd-button type="warning" size="small" style="margin-right: 10rpx">加入购物车</wd-button>
<wd-button type="error" size="small">立即购买</wd-button> <wd-button type="error" size="small" @tap="toSettle">立即购买</wd-button>
</view> </view>
</view> </view>
</view> </view>
...@@ -142,9 +142,18 @@ function toCart() { ...@@ -142,9 +142,18 @@ function toCart() {
url: '/pages/assistingAgriculture/cart/cart', url: '/pages/assistingAgriculture/cart/cart',
}); });
} }
function toSettle() {
// TODO: 跳转到结算页面
xma.navigateTo({
url: '/pages/assistingAgriculture/cart/ConfirmOrder',
});
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page {
background-color: #f3f3f3;
}
.container { .container {
position: relative; position: relative;
left: 0rpx; left: 0rpx;
...@@ -306,12 +315,13 @@ function toCart() { ...@@ -306,12 +315,13 @@ function toCart() {
} }
.detail-info { .detail-info {
width: 750rpx; width: 750rpx;
height: 1168px;
border-radius: 16rpx; border-radius: 16rpx;
background: #ffffff; background: #ffffff;
margin-top: 20rpx; margin-top: 20rpx;
position: relative; position: relative;
z-index: 9; z-index: 9;
top: -8rpx;
padding-bottom: 120rpx;
} }
.info-title { .info-title {
width: 64rpx; width: 64rpx;
...@@ -330,7 +340,6 @@ function toCart() { ...@@ -330,7 +340,6 @@ function toCart() {
} }
.info-img { .info-img {
width: 710rpx; width: 710rpx;
height: 1168rpx;
border-radius: 16rpx; border-radius: 16rpx;
position: relative; position: relative;
margin-top: 40rpx; margin-top: 40rpx;
......
...@@ -37,105 +37,14 @@ ...@@ -37,105 +37,14 @@
</view> </view>
</view> </view>
</view> </view>
<view class="product-page">
<view>
<view class="page-title">特色美食</view>
<img src="/static/assistingAgriculture/assets/mainPicture.png" class="main-img" />
<view style="display: flex; flex-direction: row">
<view class="detail-border">
<img
src="/static/assistingAgriculture/assets/detailedMapOne.png"
style="width: 216rpx; height: 176rpx"
/>
<view class="detail-title">干辣椒炒肉</view>
<view class="jiage-page">
<text class="jiage">¥25</text>
/份
</view>
<view class="yushou">预售</view>
</view>
<view class="detail-border">
<img
src="/static/assistingAgriculture/assets/detailedMapOne.png"
style="width: 216rpx; height: 176rpx"
/>
<view class="detail-title">贵阳辣子鸡</view>
<view class="jiage-page">
<text class="jiage">¥25</text>
/份
</view>
<view class="yushou">预售</view>
</view>
<view class="detail-border">
<img
src="/static/assistingAgriculture/assets/detailedMapOne.png"
style="width: 216rpx; height: 176rpx"
/>
<view class="detail-title">麻辣鱼豆腐</view>
<view class="jiage-page">
<text class="jiage">¥25</text>
/份
</view>
<view class="yushou">预售</view>
</view>
</view>
</view>
</view>
<view class="product-page" @tap="toDetail">
<view>
<view class="page-title">农货预售</view>
<img src="/static/assistingAgriculture/assets/img4.png" class="main-img" />
<view style="display: flex; flex-direction: row">
<view class="detail-border">
<img
src="/static/assistingAgriculture/assets/img1.png"
style="width: 216rpx; height: 176rpx"
/>
<view class="detail-title">这是农村种的土豆</view>
<view class="jiage-page">
<text class="jiage">¥25</text>
/份
</view>
<view class="yushou">预售</view>
</view>
<view class="detail-border">
<img
src="/static/assistingAgriculture/assets/img2.png"
style="width: 216rpx; height: 176rpx"
/>
<view class="detail-title">这是农村玉米</view>
<view class="jiage-page">
<text class="jiage">¥25</text>
/份
</view>
<view class="yushou">预售</view>
</view>
<view class="detail-border">
<img
src="/static/assistingAgriculture/assets/img3.png"
style="width: 216rpx; height: 176rpx"
/>
<view class="detail-title">这是农村中的猕猴桃</view>
<view class="jiage-page">
<text class="jiage">¥25</text>
/份
</view>
<view class="yushou">预售</view>
</view>
</view>
</view>
</view>
<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.text }}</view> <view class="page-title">{{ item.categoryName }}</view>
<img :src="item.img" class="main-img" /> <img :src="item.img" class="main-img" />
<view style="display: flex; flex-direction: row"> <view style="display: flex; flex-direction: row">
<view class="detail-border" v-for="(item, index) in detailList" :key="index"> <view class="detail-border" v-for="(item, index) in item.commodityList" :key="index">
<img <img :src="item.commodityImg" style="width: 216rpx; height: 176rpx" />
src="/static/assistingAgriculture/assets/detailedMapOne.png" <view class="detail-title">{{ item.prodName }}</view>
style="width: 216rpx; height: 176rpx"
/>
<view class="detail-title">{{ item.text }}</view>
<view class="jiage-page"> <view class="jiage-page">
<text class="jiage">{{ item.price }}</text> <text class="jiage">{{ item.price }}</text>
/份 /份
...@@ -157,14 +66,7 @@ import { ...@@ -157,14 +66,7 @@ import {
getStrictSelection, getStrictSelection,
} from '../../../api/assistingAgriculture/building'; } from '../../../api/assistingAgriculture/building';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const list = ref([ const list = ref([]);
// // { img: '/static/assistingAgriculture/assets/mainPicture.png', text: '特色美食' },
// // { img: '/static/assistingAgriculture/assets/presale.png', text: '农货预售' },
{ img: '/static/assistingAgriculture/assets/mainPicture.png', text: '乡村非遗' },
{ img: '/static/assistingAgriculture/assets/mainPicture.png', text: '认养农业' },
{ img: '/static/assistingAgriculture/assets/mainPicture.png', text: '乡村旅居' },
{ img: '/static/assistingAgriculture/assets/mainPicture.png', text: '特色农庄' },
]);
const detailList = ref([ const detailList = ref([
{ {
img: '/static/assistingAgriculture/assets/detailedMapOne.png', img: '/static/assistingAgriculture/assets/detailedMapOne.png',
...@@ -191,19 +93,24 @@ onMounted(async () => { ...@@ -191,19 +93,24 @@ onMounted(async () => {
// 获取筑农专区分类; // 获取筑农专区分类;
const getList = () => { const getList = () => {
getSortList().then((res) => { getSortList().then((res) => {
console.log(res, 111);
res.data.forEach((item) => { res.data.forEach((item) => {
item.icon = import.meta.env.VITE_APP_IMG_URL + item.icon; item.icon = import.meta.env.VITE_APP_IMG_URL + item.pic;
item.pic = import.meta.env.VITE_APP_IMG_URL + item.pic;
}); });
sortList.value = res.data; sortList.value = res.data.splice(0, 4);
console.log(list.value, 111);
}); });
}; };
// 筑农严选首页-分类预售商品列表 // 筑农严选首页-分类预售商品列表
const getPresaleCategoryList = () => { const getPresaleCategoryList = () => {
getPresaleCategory().then((res) => { getPresaleCategory().then((res) => {
console.log(res, 222); res.data.forEach((item) => {
item.img = import.meta.env.VITE_APP_IMG_URL + item.pic;
item.commodityList = item.prodSimples;
item.commodityList.forEach((item) => {
item.commodityImg = import.meta.env.VITE_APP_IMG_URL + item.pic;
console.log(item.commodityImg, 111);
});
});
list.value = res.data;
}); });
}; };
// 筑农严选分类 // 筑农严选分类
...@@ -340,7 +247,6 @@ page { ...@@ -340,7 +247,6 @@ page {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.jiage-page { .jiage-page {
width: 96rpx;
height: 28rpx; height: 28rpx;
margin-top: 20rpx; margin-top: 20rpx;
font-size: 24rpx; font-size: 24rpx;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</text> </text>
</scroll-view> </scroll-view>
</view> </view>
<view class="tab-list" v-for="(item, index) in buyList" :key="index"> <view class="tab-list" v-for="(item, index) in buyList" :key="index" @tap="toDetail">
<img class="buy-list" :src="item.img" style="width: 670rpx; height: 670rpx" /> <img class="buy-list" :src="item.img" style="width: 670rpx; height: 670rpx" />
<view> <view>
<text class="retail-price">零售价:¥{{ item.price }}/盒</text> <text class="retail-price">零售价:¥{{ item.price }}/盒</text>
...@@ -65,12 +65,7 @@ ...@@ -65,12 +65,7 @@
</view> </view>
<view class="waterfall"> <view class="waterfall">
<view class="wt-left wt-list"> <view class="wt-left wt-list">
<view <view class="wt-item" v-for="(good, index) in LeftList" :key="index" @tap="toDetail">
class="wt-item"
v-for="(good, index) in LeftList"
:key="index"
@click="ToDetail(good.id)"
>
<view class="item-img"> <view class="item-img">
<image :src="good.image" mode="widthFix"></image> <image :src="good.image" mode="widthFix"></image>
<image <image
...@@ -105,12 +100,7 @@ ...@@ -105,12 +100,7 @@
</view> </view>
<view class="vt-right wt-list"> <view class="vt-right wt-list">
<view <view class="wt-item" v-for="(good, index) in RightList" :key="index" @tap="toDetail">
class="wt-item"
v-for="(good, index) in RightList"
:key="index"
@click="ToDetail(good.id)"
>
<view class="item-img"> <view class="item-img">
<image :src="good.image" mode="widthFix"></image> <image :src="good.image" mode="widthFix"></image>
<image <image
......
...@@ -24,19 +24,19 @@ ...@@ -24,19 +24,19 @@
prop="evaluation" prop="evaluation"
v-model="formdata.evaluation" v-model="formdata.evaluation"
placeholder="亲,分享您的看法,给其他人一个参考哦!" placeholder="亲,分享您的看法,给其他人一个参考哦!"
:rules="[{ required: true, message: '请填写你的评价' }]"
/> />
<text class="textarea">上传图片/视频</text> <text class="textarea">上传图片/视频</text>
<wd-upload <view class="wdUpload" prop="images">
prop="images" <wd-upload
class="wdUpload" multiple
multiple :action="action"
:action="action" @change="handleFile"
@change="handleFile" :file-list="formdata.images"
:file-list="fileList" :before-remove="beforeRemove"
:before-remove="beforeRemove" :header="headers"
:header="headers" ></wd-upload>
></wd-upload> </view>
<wd-cell title="匿名评价" prop="isAnonymous" class="itemSwichval"> <wd-cell title="匿名评价" prop="isAnonymous" class="itemSwichval">
<wd-switch <wd-switch
size="48rpx" size="48rpx"
...@@ -94,12 +94,7 @@ const formdata = reactive<{ ...@@ -94,12 +94,7 @@ const formdata = reactive<{
isAnonymous: 0, isAnonymous: 0,
merchantServices: 0, merchantServices: 0,
}); });
const rules = { const rules = {};
// evaluation: [
// { required: true, message: '请填写你的评价' },
// { type: 'array', min: 1, message: '请上传图片/视频' },
// ],
};
/** /**
* 显示推荐菜 * 显示推荐菜
*/ */
...@@ -125,6 +120,7 @@ const handlemerchant = (item: { value: number }) => { ...@@ -125,6 +120,7 @@ const handlemerchant = (item: { value: number }) => {
*/ */
const fileList = ref<any[]>([]); const fileList = ref<any[]>([]);
function handleFile({ fileList: files }) { function handleFile({ fileList: files }) {
console.log('fileList', formdata.images);
fileList.value = files; fileList.value = files;
} }
/** /**
...@@ -154,7 +150,7 @@ const deleteImg = () => { ...@@ -154,7 +150,7 @@ const deleteImg = () => {
const handleSubmit = async () => { const handleSubmit = async () => {
await evaluation({ await evaluation({
...formdata, ...formdata,
images: proImage(), // images: proImage(),
}); });
xma.showToast({ xma.showToast({
title: '评价成功', title: '评价成功',
......
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
<text class="goods-type">火锅</text> <text class="goods-type">火锅</text>
<!-- <text class="goods-rs">36/人</text> --> <!-- <text class="goods-rs">36/人</text> -->
</view> </view>
<text class="distance">距你{{ distance }}</text> <text class="distance">距你{{ shopInfo.distance }}</text>
<text class="address">{{ shopInfo.shopAddress }}</text> <text class="address">{{ shopInfo.shopAddress }}</text>
</view> </view>
<!-- 适用门店-end --> <!-- 适用门店-end -->
...@@ -398,8 +398,8 @@ function getLocationFn() { ...@@ -398,8 +398,8 @@ function getLocationFn() {
success: function (res) { success: function (res) {
const myLatitude = shopLocation.value.latitude; const myLatitude = shopLocation.value.latitude;
const myLongitude = shopLocation.value.longitude; const myLongitude = shopLocation.value.longitude;
console.log('myLongitude', myLatitude, myLongitude);
const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1); const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1);
shopInfo.value.distance = distance; shopInfo.value.distance = distance;
}, },
fail: function (err) { fail: function (err) {
......
...@@ -163,6 +163,7 @@ ...@@ -163,6 +163,7 @@
import Header from '@/pages/order/components/Header/index.vue'; import Header from '@/pages/order/components/Header/index.vue';
import { groupBuyConfirm, groupBuyUpdate, groupBuyCreate } from '@/api/confirmOrder'; import { groupBuyConfirm, groupBuyUpdate, groupBuyCreate } from '@/api/confirmOrder';
import { getOrderDetail } from '@/api/order'; import { getOrderDetail } from '@/api/order';
import { debounce } from '@/utils/common';
const imgUrl = import.meta.env.VITE_APP_IMG_URL; const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const selectType = ref('TENPAY'); const selectType = ref('TENPAY');
const prodId = ref(null); const prodId = ref(null);
...@@ -261,7 +262,7 @@ function groupBuyUpdateFn(couponUserId) { ...@@ -261,7 +262,7 @@ function groupBuyUpdateFn(couponUserId) {
} }
}); });
} }
function submitOrder() { const submitOrder = debounce(() => {
// TODO: 跳转到确认订单页面,并��带所选的支付方式 // TODO: 跳转到确认订单页面,并��带所选的支付方式
// id String 是 临时订单的id或key // id String 是 临时订单的id或key
...@@ -276,28 +277,28 @@ function submitOrder() { ...@@ -276,28 +277,28 @@ function submitOrder() {
}; };
groupBuyCreate(params).then((res) => { groupBuyCreate(params).then((res) => {
if (res.code === 0) { if (res.code === 0) {
let timeout = null;
const start = new Date().getTime();
const { paymentUrl, outTradeNo } = res.data.result; const { paymentUrl, outTradeNo } = res.data.result;
outTradeNos.value = outTradeNo; outTradeNos.value = outTradeNo;
window.location.href = paymentUrl; window.location.href = paymentUrl;
timeout = setTimeout(function () { // 设置一个延时器
const end = new Date().getTime(); const start = Date.now();
// 如果超时未打开应用,则假设未安装 setTimeout(() => {
if (end - start < 1000) { const end = Date.now();
if (end - start < 1200) {
groupBuyConfirmFn(prodIds.value, skuIds.value);
// 如果 iframe 加载时间小于 1.2 秒,说明应用没有安装
xma.showToast({ xma.showToast({
title: '未安装App', title: '未安装App',
icon: 'error', icon: 'error',
}); });
groupBuyConfirmFn(prodIds.value, skuIds.value); // 这里可以跳转到应用下载页面
} }
}, 1500); }, 1000);
} else {
groupBuyConfirmFn(prodIds.value, skuIds.value);
} }
}); });
// xma.redirectTo({ }, 1000);
// url: '/pages/shop/paymentSuccessful',
// });
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -271,6 +271,7 @@ ...@@ -271,6 +271,7 @@
class="scroll-view-item_H" class="scroll-view-item_H"
v-for="(item, index) in recommendedListOfPeripherals" v-for="(item, index) in recommendedListOfPeripherals"
:key="index" :key="index"
@click="refreshShowDetail(item)"
> >
<view class="item-box"> <view class="item-box">
<image mode="aspectFill" :src="imgUrl + item.shopLogo"></image> <image mode="aspectFill" :src="imgUrl + item.shopLogo"></image>
...@@ -348,31 +349,6 @@ const recommendedTypesOfPeripherals = ref([]); ...@@ -348,31 +349,6 @@ const recommendedTypesOfPeripherals = ref([]);
const shopId = ref(''); const shopId = ref('');
// 周边推荐-商家列表 // 周边推荐-商家列表
const recommendedListOfPeripherals = ref([]); const recommendedListOfPeripherals = ref([]);
// onLoad((options) => {
// params.value.shopId = options.shopId;
// getStoreInformationFn(options.shopId).then(() => {
// peripheryRecomFn();
// });
// groupBuyListFn(options.shopId);
// shopId.value = options.shopId;
// couponShopListFn(options.shopId);
// getEvaluationPageFn();
// });
// onShow(() => {
// getStoreInformationFn(params.value.shopId).then(() => {
// // 获取位置
// getLocationFn().then((res) => {
// const distance = getDistance(
// res.lat,
// res.lon,
// shopLocation.value.lat,
// shopLocation.value.lon,
// 1,
// );
// shopInfo.value.distance = distance;
// });
// });
// });
onLoad(async (options) => { onLoad(async (options) => {
params.value.shopId = options.shopId; params.value.shopId = options.shopId;
shopId.value = options.shopId; shopId.value = options.shopId;
...@@ -400,6 +376,26 @@ onShow(async () => { ...@@ -400,6 +376,26 @@ onShow(async () => {
// 获取位置并计算距离 // 获取位置并计算距离
calculateDistance(); calculateDistance();
}); });
async function refreshShowDetail(item) {
params.value.shopId = item.shopId;
shopId.value = item.shopId;
// 使用 Promise.all 并行请求,提升性能
await Promise.all([
getStoreInformationFn(item.shopId),
groupBuyListFn(item.shopId),
couponShopListFn(item.shopId),
]);
// 获取周边推荐信息
peripheryRecomFn();
// 获取评价信息
getEvaluationPageFn();
// 获取位置并计算距离
calculateDistance();
}
// 计算距离的函数封装 // 计算距离的函数封装
async function calculateDistance() { async function calculateDistance() {
try { try {
...@@ -474,7 +470,6 @@ function sgyrddShopPageFn(categoryIds, lat, lon) { ...@@ -474,7 +470,6 @@ function sgyrddShopPageFn(categoryIds, lat, lon) {
.filter((item) => { .filter((item) => {
return item !== ''; return item !== '';
}); });
console.log('res.data.content', res.data.content);
recommendedListOfPeripherals.value = res.data.content; recommendedListOfPeripherals.value = res.data.content;
xma.hideLoading(); xma.hideLoading();
...@@ -560,9 +555,13 @@ const groupBuyListFn = (shopId) => { ...@@ -560,9 +555,13 @@ const groupBuyListFn = (shopId) => {
if (res.code === 0) { if (res.code === 0) {
listOfGroupBuyingProducts.value = res.data.map((item) => { listOfGroupBuyingProducts.value = res.data.map((item) => {
item.pic = imgUrl + item.pic; item.pic = imgUrl + item.pic;
item.labelNames = item.labelNames.split(',').filter((lab) => { if (item.labelNames) {
return lab !== ''; item.labelNames = item.labelNames.split(',').filter((lab) => {
}); return lab !== '';
});
} else {
item.labelNames = [];
}
return item; return item;
}); });
} }
...@@ -742,6 +741,11 @@ page { ...@@ -742,6 +741,11 @@ page {
width: 375 * 2rpx; width: 375 * 2rpx;
margin: 0 auto; margin: 0 auto;
.icon-statr {
:deep(.wd-icon-star-on) {
display: block !important;
}
}
.search { .search {
width: 710rpx; width: 710rpx;
height: 80rpx; height: 80rpx;
......
<template>
<div>
<wd-rate
custom-class="icon-statr"
color="#fff"
readonly
v-model="grade"
size="22rpx"
space="8rpx"
:active-color="['#FA5151']"
/>
</div>
</template>
<script setup>
const grade = ref(5);
</script>
<style lang="scss" scoped>
.icon-statr {
:deep(.wd-icon-star-on) {
display: block !important;
}
}
</style>
...@@ -9,39 +9,36 @@ ...@@ -9,39 +9,36 @@
<!-- 列表头部 --> <!-- 列表头部 -->
<view class="titlecon"> <view class="titlecon">
<span>{{ item.shopName }}</span> <span>{{ item.shopName }}</span>
<span>未通过</span> <span>{{ item.shopStatus }}</span>
</view> </view>
<!-- 列表详细 --> <!-- 列表详细 -->
<view class="delbox"> <view class="delbox">
<view class="listPic"> <view class="listPic">
<img <img :src="item.shopLogo" />
src="https://www.gywb.cn/upload/web/dataset/2024/08/01/2282c5c7e93b42c88dcfc606440f9716.jpg"
alt=""
/>
</view> </view>
<view class="deltxt"> <view class="deltxt">
<ul> <ul>
<li> <li>
<span>申请时间:</span> <span>申请时间:</span>
<span>2024-08-02 16:21:19</span> <span>{{ item.createTime }}</span>
</li> </li>
<li> <li>
<span>签约时间:</span> <span>签约时间:</span>
<span>2024-08-02 ~ 2024-08-02</span> <span>{{ item.contractStartTime }} ~ {{ item.contractEndTime }}</span>
</li> </li>
<li> <li>
<span>地址:</span> <span>地址:</span>
<span>贵州省贵阳市南明区彭家湾花果园项目M区3栋1单元25层5号房</span> <span>{{ item.shopAddress }}</span>
</li> </li>
</ul> </ul>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="shbox">审核被拒可点击修改重新提交</view> <view class="shbox" v-if="list.length > 0">审核被拒可点击修改重新提交</view>
</view> </view>
<view class="butCon"><button class="butXz">主要按钮</button></view> <view class="butCon"><button class="butXz" @click="shopGto">申请入驻</button></view>
</view> </view>
</template> </template>
...@@ -50,9 +47,18 @@ import Header from '@/pages/order/components/Header/index.vue'; ...@@ -50,9 +47,18 @@ import Header from '@/pages/order/components/Header/index.vue';
import { shopList } from '@/api/storeEntry'; import { shopList } from '@/api/storeEntry';
const list = ref([]); const list = ref([]);
const getList = async () => { const getList = async () => {
const res = await shopList(); const { data: res } = await shopList();
list.value = res.data;
console.log(res); console.log(res);
if (res.length > 0) {
list.value = res;
} else {
// shopGto();
}
};
const shopGto = () => {
xma.redirectTo({
url: `/pages/storeEntry/detail`,
});
}; };
getList(); getList();
</script> </script>
...@@ -63,7 +69,8 @@ getList(); ...@@ -63,7 +69,8 @@ getList();
width: 375 * 2rpx; width: 375 * 2rpx;
margin: 0 auto; margin: 0 auto;
background: #f1f1f1; background: #f1f1f1;
padding-bottom: 80px; padding-bottom: 160rpx;
min-height: calc(100vh - 160rpx);
.content { .content {
padding-top: 88rpx; padding-top: 88rpx;
......
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