Commit 85c212a3 authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents 73fb7e26 9f8cc38c
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
<text class="one-text">{{ item.grade }}推荐</text> <text class="one-text">{{ item.grade }}推荐</text>
<!-- <text class="two-text">¥30/人</text> --> <!-- <text class="two-text">¥30/人</text> -->
<text class="three-text">销量{{ item.monthSoldNum }}</text> <text class="three-text">销量{{ item.monthSoldNum }}</text>
<text class="four-text">1.2km</text> <text class="four-text">
{{ getDistance(item.shopLat, item.shopLng, latF, lonF) }}
</text>
</view> </view>
<view class="threeBox" v-if="item.evaluationVos.length === 0"> <view class="threeBox" v-if="item.evaluationVos.length === 0">
<image class="img2" :src="item.evaluationVos[0].avatar" mode="aspectFill" /> <image class="img2" :src="item.evaluationVos[0].avatar" mode="aspectFill" />
...@@ -23,19 +25,21 @@ ...@@ -23,19 +25,21 @@
<text class="three-text">{{ item.oriPrice }}</text> <text class="three-text">{{ item.oriPrice }}</text>
<text class="four-text">{{ item.prodName }}</text> <text class="four-text">{{ item.prodName }}</text>
</view> </view>
<!-- <view class="groupPurchasePrice">
<image class="img" src="../../static/index/groupBuying.png" mode="widthFix" />
<text class="one-text">¥39</text>
<view class="two-text">8.8折</view>
<text class="three-text">¥59.8</text>
<text class="four-text">游戏通宵补血套餐</text>
</view> -->
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { defineProps } from 'vue'; import { defineProps } from 'vue';
import { getLocation } from '../../utils/tool';
import { getDistance } from '../../utils/common';
const lonF = ref(0);
const latF = ref(0);
onMounted(async () => {
const { lon, lat } = await getLocation();
lonF.value = lon;
latF.value = lat;
});
const props = defineProps({ const props = defineProps({
cardData: { cardData: {
type: Array, type: Array,
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
<text class="one-text">{{ shopCardData.grade }}推荐</text> <text class="one-text">{{ shopCardData.grade }}推荐</text>
<!-- <text class="two-text">¥30/人</text> --> <!-- <text class="two-text">¥30/人</text> -->
<text class="three-text">销量{{ shopCardData.monthSoldNum }}</text> <text class="three-text">销量{{ shopCardData.monthSoldNum }}</text>
<text class="four-text">1.2km</text> <text class="four-text">
{{ getDistance(shopCardData.shopLat, shopCardData.shopLng, latF, lonF) }}
</text>
</view> </view>
<view class="threeBox"> <view class="threeBox">
<image class="img2" :src="shopCardData.evaluationVos[0].avatar" mode="aspectFill" /> <image class="img2" :src="shopCardData.evaluationVos[0].avatar" mode="aspectFill" />
...@@ -23,7 +25,12 @@ ...@@ -23,7 +25,12 @@
</view> </view>
</view> </view>
<view class="nearby-bootom"> <view class="nearby-bootom">
<view class="contentBox" v-for="(item, index) in shopCardData.simpleProds" :key="index"> <view
class="contentBox"
@tap="topFoodDetails(item.prodId)"
v-for="(item, index) in shopCardData.simpleProds"
:key="index"
>
<image class="img" :src="item.pic" mode="aspectFill" /> <image class="img" :src="item.pic" mode="aspectFill" />
<text class="one">{{ item.prodName }}</text> <text class="one">{{ item.prodName }}</text>
<view class="price"> <view class="price">
...@@ -33,11 +40,16 @@ ...@@ -33,11 +40,16 @@
</view> </view>
</view> </view>
</view> </view>
<wd-status-tip image="content" tip="暂无内容" v-if="shopCardData.simpleProds.length === 0" />
</view> </view>
</template> </template>
<script setup> <script setup>
import { defineProps } from 'vue'; import { defineProps } from 'vue';
import { getDistance } from '../../utils/common';
import { getLocation } from '../../utils/tool';
const lonF = ref(0);
const latF = ref(0);
const props = defineProps({ const props = defineProps({
shopCardData: { shopCardData: {
type: Object, type: Object,
...@@ -46,6 +58,16 @@ const props = defineProps({ ...@@ -46,6 +58,16 @@ const props = defineProps({
}), }),
}, },
}); });
onMounted(async () => {
const { lon, lat } = await getLocation();
lonF.value = lon;
latF.value = lat;
});
const topFoodDetails = (id) => {
xma.navigateTo({
url: `/pages/packageDetails/packageDetails?prodId=${id}`,
});
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -90,6 +112,8 @@ const props = defineProps({ ...@@ -90,6 +112,8 @@ const props = defineProps({
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 10rpx; margin-top: 10rpx;
position: relative;
width: 510rpx;
.one-text { .one-text {
font-size: 22rpx; font-size: 22rpx;
font-weight: bold; font-weight: bold;
...@@ -111,7 +135,8 @@ const props = defineProps({ ...@@ -111,7 +135,8 @@ const props = defineProps({
font-size: 20rpx; font-size: 20rpx;
color: #ffffff; color: #ffffff;
font-weight: 500; font-weight: 500;
margin-left: 182rpx; position: absolute;
right: 20rpx;
} }
} }
.threeBox { .threeBox {
......
import { request } from '../../utils/request'; import { request } from '../../utils/request';
// 获取指定类型轮播图 // 筑农专区分类
export function getSortList(data) { export function getSortList(data) {
return request({ return request({
url: `/sgyrdd/category/znList`, url: `/sgyrdd/category/znList`,
...@@ -9,6 +9,24 @@ export function getSortList(data) { ...@@ -9,6 +9,24 @@ export function getSortList(data) {
}); });
} }
// 预售板块轮播图
export function getPresaleList(data) {
return request({
url: `/sgyrdd/carousel/presaleList`,
method: 'GET',
data,
});
}
// 筑农严选分类
export function getStrictSelection(data) {
return request({
url: `/sgyrdd/category/getZnyx`,
method: 'GET',
data,
});
}
// 筑农严选首页-分类预售商品列表 // 筑农严选首页-分类预售商品列表
export function getPresaleCategory(data) { export function getPresaleCategory(data) {
return request({ return request({
...@@ -18,28 +36,28 @@ export function getPresaleCategory(data) { ...@@ -18,28 +36,28 @@ export function getPresaleCategory(data) {
}); });
} }
// 预售板块轮播图 // 筑农严选首页-好货特卖商品列表
export function getPresaleList(data) { export function getGoodSaleProdList(data) {
return request({ return request({
url: `/sgyrdd/carousel/presaleList`, url: `/sgyrdd/znprod/getGoodSaleProdList`,
method: 'GET', method: 'GET',
data, data,
}); });
} }
// 筑农严选分类 // 筑农严选首页-分类查询商品列表
export function getStrictSelection(data) { export function getPlatformProdList(data) {
return request({ return request({
url: `/sgyrdd/category/getZnyx`, url: `/sgyrdd/znprod/getPlatformProdList`,
method: 'GET', method: 'GET',
data, data,
}); });
} }
// 筑农预售分类 // 筑农首页-分类查询商品列表
export function getBuindingSort(data) { export function getPresaleProdList(data) {
return request({ return request({
url: `/sgyrdd/category/presaleList`, url: `/sgyrdd/znprod/getPresaleProdList`,
method: 'GET', method: 'GET',
data, data,
}); });
......
...@@ -27,17 +27,11 @@ ...@@ -27,17 +27,11 @@
src="/static/assistingAgriculture/assets/culture.png" src="/static/assistingAgriculture/assets/culture.png"
style="width: 366rpx; height: 362rpx" style="width: 366rpx; height: 362rpx"
/> />
<view class="right-img"> <view v-for="(item, index) in rightList" :key="index">
<img <img
class="delicacy" class="right-sort"
src="/static/assistingAgriculture/assets/delicacy.png" :src="item.icon"
style="height: 176rpx; margin-left: 8rpx" style="width: 336rpx; height: 176rpx; margin-left: 8rpx"
/>
<img
@tap="toPresale"
class="fresh"
src="/static/assistingAgriculture/assets/fresh.png"
style="height: 176rpx; margin-left: 8rpx"
/> />
</view> </view>
</view> </view>
...@@ -46,7 +40,7 @@ ...@@ -46,7 +40,7 @@
<view class="hot-sale"> <view class="hot-sale">
<view class="top-title"> <view class="top-title">
<text class="left-title">好货热卖</text> <text class="left-title">好货热卖</text>
<text class="right-title">更多</text> <text class="right-title" @tap="toPresale">更多</text>
</view> </view>
<wd-icon <wd-icon
name="arrow-right" name="arrow-right"
...@@ -116,7 +110,10 @@ ...@@ -116,7 +110,10 @@
<script setup> <script setup>
import Search from '../../../components/assistingAgriculture/index/Search.vue'; import Search from '../../../components/assistingAgriculture/index/Search.vue';
import { getStrictSelection } from '../../../api/assistingAgriculture/building';
import { onMounted } from 'vue';
const current = ref(0); const current = ref(0);
const rightList = ref([]);
const light = ref(0); const light = ref(0);
// 轮播图 // 轮播图
const swiperList = ref([ const swiperList = ref([
...@@ -148,6 +145,18 @@ const detailList = ref([ ...@@ -148,6 +145,18 @@ const detailList = ref([
const choice = (index) => { const choice = (index) => {
light.value = index; light.value = index;
}; };
onMounted(async () => {
getStrictSelectionList();
});
// 筑农严选分类
const getStrictSelectionList = () => {
getStrictSelection().then((res) => {
res.data.forEach((item) => {
item.icon = import.meta.env.VITE_APP_IMG_URL + item.pic;
});
rightList.value = res.data.splice(0, 2);
});
};
function handleClick(e) { function handleClick(e) {
console.log(e); console.log(e);
} }
......
...@@ -8,21 +8,16 @@ ...@@ -8,21 +8,16 @@
placeholderText="请输入要搜索的内容" placeholderText="请输入要搜索的内容"
></Search> ></Search>
<view> <view>
<img <wd-swiper
class="img1" :list="swiperList"
src="/static/assistingAgriculture/assets/bacImg.png" autoplay
style="width: 750rpx; height: 440rpx" v-model:current="current"
/> @click="handleClick"
<img @change="onChange"
class="img2" customClass="guiyang"
src="/static/assistingAgriculture/assets/bottom.png" height="220"
style="width: 750rpx; height: 32rpx" imageMode="aspectFill"
/> ></wd-swiper>
<img
class="img3"
src="/static/assistingAgriculture/assets/right.png"
style="width: 288rpx; height: 124rpx"
/>
</view> </view>
<view class="sort"> <view class="sort">
<view style="display: flex; flex-direction: row"> <view style="display: flex; flex-direction: row">
...@@ -62,11 +57,19 @@ ...@@ -62,11 +57,19 @@
import Search from '../../../components/assistingAgriculture/index/Search.vue'; import Search from '../../../components/assistingAgriculture/index/Search.vue';
import { import {
getPresaleCategory, getPresaleCategory,
getPresaleList,
getSortList, getSortList,
getStrictSelection, getStrictSelection,
} from '../../../api/assistingAgriculture/building'; } from '../../../api/assistingAgriculture/building';
import { onMounted } from 'vue'; import { onMounted, ref } from 'vue';
import { groupImgList } from '@/api';
const list = ref([]); const list = ref([]);
const sortList = ref([]);
const swiperList = ref([]);
const current = ref(0);
// 轮播图数据
let lunboData;
const detailList = ref([ const detailList = ref([
{ {
img: '/static/assistingAgriculture/assets/detailedMapOne.png', img: '/static/assistingAgriculture/assets/detailedMapOne.png',
...@@ -84,11 +87,10 @@ const detailList = ref([ ...@@ -84,11 +87,10 @@ const detailList = ref([
text: '麻辣鱼豆腐', text: '麻辣鱼豆腐',
}, },
]); ]);
const sortList = ref([]);
onMounted(async () => { onMounted(async () => {
getList(); getList();
getPresaleCategoryList(); getPresaleCategoryList();
getStrictSelectionList(); getPresale();
}); });
// 获取筑农专区分类; // 获取筑农专区分类;
const getList = () => { const getList = () => {
...@@ -107,31 +109,43 @@ const getPresaleCategoryList = () => { ...@@ -107,31 +109,43 @@ const getPresaleCategoryList = () => {
item.commodityList = item.prodSimples; item.commodityList = item.prodSimples;
item.commodityList.forEach((item) => { item.commodityList.forEach((item) => {
item.commodityImg = import.meta.env.VITE_APP_IMG_URL + item.pic; item.commodityImg = import.meta.env.VITE_APP_IMG_URL + item.pic;
console.log(item.commodityImg, 111);
}); });
}); });
list.value = res.data; list.value = res.data;
}); });
}; };
// 筑农严选分类 // 预售板块轮播图
const getStrictSelectionList = () => { const getPresale = () => {
getStrictSelection().then((res) => { getPresaleList({ place: 'index_top' }).then((res) => {
console.log(res, 333); console.log(res, 111);
res.data.forEach((item) => {
item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.imgUrl;
});
lunboData = res.data;
swiperList.value = res.data.map((item) => {
return item.imgUrl;
});
}); });
}; };
const onChange = (e) => {
// console.log(e);
};
function toBuilding(index) { function toBuilding(index) {
if (index === 0) { if (index === 0) {
// TODO: 跳转到筑农严选 // TODO: 跳转到筑农严选
xma.navigateTo({ xma.navigateTo({
url: '/pages/assistingAgriculture/index/building', url: '/pages/assistingAgriculture/index/building',
}); });
} else if (index === 1) {
console.log(111);
} else if (index === 2) { } else if (index === 2) {
// TODO: 跳转到乡村旅居 // TODO: 跳转到乡村旅居
xma.navigateTo({ xma.navigateTo({
url: '/pages/assistingAgriculture/RuralTravel/RuralTravel', url: '/pages/assistingAgriculture/RuralTravel/RuralTravel',
}); });
} else if (index === 3) {
console.log(222);
} }
console.log(index, 121);
} }
// 跳转详情页 // 跳转详情页
function toDetail() { function toDetail() {
...@@ -157,15 +171,6 @@ page { ...@@ -157,15 +171,6 @@ page {
.img1 { .img1 {
display: flex; display: flex;
} }
.img2 {
display: flex;
margin-top: -31rpx;
}
.img3 {
display: flex;
margin-top: -120rpx;
margin-left: 462rpx;
}
.bottom-image { .bottom-image {
position: relative; position: relative;
top: -40rpx; top: -40rpx;
...@@ -273,8 +278,8 @@ page { ...@@ -273,8 +278,8 @@ page {
color: #fa5151; color: #fa5151;
} }
::v-deep .icon { ::v-deep .icon {
width: 40rpx; width: 40 rpx;
height: 40rpx; height: 40 rpx;
margin-left: 40rpx; margin-left: 40 rpx;
} }
</style> </style>
...@@ -10,13 +10,14 @@ ...@@ -10,13 +10,14 @@
</view> </view>
<view class="nav"> <view class="nav">
<wd-swiper <wd-swiper
class="main-img"
:list="swiperList" :list="swiperList"
autoplay autoplay
v-model:current="current" v-model:current="current"
@click="handleClick" @click="handleClick"
@change="onChange" @change="onChange"
height="188" customClass="guiyang"
height="220"
imageMode="aspectFill"
></wd-swiper> ></wd-swiper>
</view> </view>
<view class="sort"> <view class="sort">
...@@ -143,12 +144,11 @@ ...@@ -143,12 +144,11 @@
<script setup> <script setup>
import Search from '../../../components/assistingAgriculture/index/Search.vue'; import Search from '../../../components/assistingAgriculture/index/Search.vue';
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { import { getPresaleList } from '../../../api/assistingAgriculture/building';
getBuindingSort, const swiperList = ref([]);
getPresaleList,
getStrictSelection,
} from '../../../api/assistingAgriculture/building';
const current = ref(0); const current = ref(0);
// 轮播图数据
let lunboData;
const light = ref(0); const light = ref(0);
const sortList = ref([ const sortList = ref([
{ img: '/static/assistingAgriculture/presale/bacImg.png', price: '25', text: '应季好物' }, { img: '/static/assistingAgriculture/presale/bacImg.png', price: '25', text: '应季好物' },
...@@ -157,11 +157,6 @@ const sortList = ref([ ...@@ -157,11 +157,6 @@ const sortList = ref([
{ img: '/static/assistingAgriculture/presale/img4.png', price: '25', text: '预选蔬菜' }, { img: '/static/assistingAgriculture/presale/img4.png', price: '25', text: '预选蔬菜' },
{ img: '/static/assistingAgriculture/presale/img5.png', price: '25', text: '心选水果' }, { img: '/static/assistingAgriculture/presale/img5.png', price: '25', text: '心选水果' },
]); ]);
const swiperList = ref([
'../../../static/assistingAgriculture/presale/img.png',
'../../../static/assistingAgriculture/presale/img.png',
'../../../static/assistingAgriculture/presale/img.png',
]);
const tabsData = ref([ const tabsData = ref([
{ img: '/static/assistingAgriculture/assets/mainPicture.png', text: '全部' }, { img: '/static/assistingAgriculture/assets/mainPicture.png', text: '全部' },
{ img: '/static/assistingAgriculture/assets/presale.png', text: '分类1' }, { img: '/static/assistingAgriculture/assets/presale.png', text: '分类1' },
...@@ -235,18 +230,18 @@ const goodList = ref([ ...@@ -235,18 +230,18 @@ const goodList = ref([
]); ]);
onMounted(async () => { onMounted(async () => {
getPresale(); getPresale();
getBuindingSortList();
}); });
// 预售板块轮播图 // 预售板块轮播图
const getPresale = () => { const getPresale = () => {
getPresaleList({ place: 3 }).then((res) => { getPresaleList({ place: 'presale' }).then((res) => {
console.log(res, 111); console.log(res, 111);
}); res.data.forEach((item) => {
}; item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.imgUrl;
// 筑农预售分类 });
const getBuindingSortList = () => { lunboData = res.data;
getBuindingSort({ level: 3 }).then((res) => { swiperList.value = res.data.map((item) => {
console.log(res, 222); return item.imgUrl;
});
}); });
}; };
// 左侧数据列表 // 左侧数据列表
......
...@@ -53,12 +53,11 @@ ...@@ -53,12 +53,11 @@
<script setup> <script setup>
import {} from 'vue'; import {} from 'vue';
import { getCoupon, getShopAndProdPage } from '../../api/index'; import { getCoupon, getShopAndProdPage } from '../../api/index';
import { getLocation } from '../../utils/tool';
const tabs = ref(['推荐', '附近美食', '果蔬生鲜', '数码商城', '小吃快餐', '数码商城', '餐饮券']); const tabs = ref(['推荐', '附近美食', '果蔬生鲜', '数码商城', '小吃快餐', '数码商城', '餐饮券']);
const params = { const params = {
current: 1, current: 1,
size: 6, size: 6,
lng: 106.68650025025502,
lat: 26.567192352601154,
}; };
let total; let total;
const active = ref(0); const active = ref(0);
...@@ -107,10 +106,13 @@ const getCoupons = () => { ...@@ -107,10 +106,13 @@ const getCoupons = () => {
}; };
// 领券中心-店铺商品列表分页 // 领券中心-店铺商品列表分页
const getShop = () => { const getShop = async () => {
xma.showLoading({ xma.showLoading({
title: '加载中', title: '加载中',
}); });
const { lon, lat } = await getLocation();
params.lng = lon;
params.lat = lat;
getShopAndProdPage(params).then((res) => { getShopAndProdPage(params).then((res) => {
xma.hideLoading(); xma.hideLoading();
total = res.data.total; total = res.data.total;
......
...@@ -78,8 +78,8 @@ ...@@ -78,8 +78,8 @@
></wd-icon> ></wd-icon>
</view> </view>
</view> </view>
<view class="bootom-bottom"> <!-- <view class="bootom-bottom">
<!-- <view <view
@tap="choice(index)" @tap="choice(index)"
class="item" class="item"
:class="{ light: active === index }" :class="{ light: active === index }"
...@@ -87,8 +87,8 @@ ...@@ -87,8 +87,8 @@
:key="index" :key="index"
> >
{{ item }} {{ item }}
</view> --> </view>
</view> </view> -->
<!-- 美食类别 --> <!-- 美食类别 -->
<Classification v-show="rotate" :category="categoryData" @foodCategory="foodCategory" /> <Classification v-show="rotate" :category="categoryData" @foodCategory="foodCategory" />
<!-- 附近筛选 --> <!-- 附近筛选 -->
...@@ -476,15 +476,17 @@ page { ...@@ -476,15 +476,17 @@ page {
} }
} }
.bootom { .bootom {
height: 124rpx; position: sticky;
top: 0;
height: 70rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
border-radius: 6rpx; border-radius: 6rpx;
background: #ffffff; background: #ffffff;
position: relative;
margin-top: 10rpx; margin-top: 10rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
z-index: 999;
.bootom-top { .bootom-top {
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
@click="handleClick" @click="handleClick"
@change="onChange" @change="onChange"
customClass="guiyang" customClass="guiyang"
height="68" height="120"
imageMode="aspectFill" imageMode="aspectFill"
></wd-swiper> ></wd-swiper>
<!-- 附近人气美食 --> <!-- 附近人气美食 -->
...@@ -120,10 +120,10 @@ ...@@ -120,10 +120,10 @@
:class="{ rotate: rotate }" :class="{ rotate: rotate }"
></wd-icon> ></wd-icon>
</view> </view>
<view class="box"> <!-- <view class="box">
<text class="text2">排序筛选</text> <text class="text2">排序筛选</text>
<wd-icon name="fill-arrow-down" size="22rpx" class="icon2"></wd-icon> <wd-icon name="fill-arrow-down" size="22rpx" class="icon2"></wd-icon>
</view> </view> -->
</view> </view>
<!-- 位置定位 --> <!-- 位置定位 -->
<Position v-show="rotate" @nearby="nearby" @popular="popular" @region="region" /> <Position v-show="rotate" @nearby="nearby" @popular="popular" @region="region" />
...@@ -175,6 +175,7 @@ import ShopCard from '../../components/index/ShopCard.vue'; ...@@ -175,6 +175,7 @@ import ShopCard from '../../components/index/ShopCard.vue';
import Marketing from '../../components/index/Marketing.vue'; import Marketing from '../../components/index/Marketing.vue';
import Position from '../../components/index/Position.vue'; import Position from '../../components/index/Position.vue';
import { orderStatus } from '../../utils/signIn'; import { orderStatus } from '../../utils/signIn';
import { getLocation, timeConversion } from '../../utils/tool';
import { import {
getTokenUser, getTokenUser,
groupBuyList, groupBuyList,
...@@ -185,7 +186,7 @@ import { ...@@ -185,7 +186,7 @@ import {
couponMainList, couponMainList,
receiveCoupon, receiveCoupon,
} from '../../api/index'; } from '../../api/index';
import { timeConversion } from '../../utils/tool';
// import testJson from '../../static/json/test.json'; // import testJson from '../../static/json/test.json';
const nowTime = ref(new Date().getTime()); const nowTime = ref(new Date().getTime());
const title = ref('小程序平台'); const title = ref('小程序平台');
...@@ -285,24 +286,19 @@ const getClassification = () => { ...@@ -285,24 +286,19 @@ const getClassification = () => {
}); });
}; };
// 附近人气美食分页 // 附近人气美食分页
const nearbyFood = () => { const nearbyFood = async () => {
// xma.getLocation({ xma.showLoading({
// isHighAccuracy: true, title: '加载中',
// success: function (res) { });
// console.log('经度', res.longitude);
// console.log('维度', res.latitude);
// },
// fail: function (err) {
// console.log('获取位置失败:', err);
// },
// });
const data = { const data = {
current: 1, current: 1,
size: 3, size: 3,
lon: 106.68650025025502,
lat: 26.567192352601154,
}; };
const { lon, lat } = await getLocation();
data.lon = lon;
data.lat = lat;
popularityPage(data).then((res) => { popularityPage(data).then((res) => {
xma.hideLoading();
res.data.content.forEach((item) => { res.data.content.forEach((item) => {
item.shopLogo = import.meta.env.VITE_APP_IMG_URL + item.shopLogo; item.shopLogo = import.meta.env.VITE_APP_IMG_URL + item.shopLogo;
item.lastBuyTime = new Date().getTime() - new Date(item.lastBuyTime).getTime(); item.lastBuyTime = new Date().getTime() - new Date(item.lastBuyTime).getTime();
...@@ -313,7 +309,7 @@ const nearbyFood = () => { ...@@ -313,7 +309,7 @@ const nearbyFood = () => {
// 附近美食查看更多 // 附近美食查看更多
const more = () => { const more = () => {
xma.navigateTo({ xma.navigateTo({
url: '/pages/index/listFood?type=2', url: '/pages/index/listFood?categoryId=&place=rqms',
}); });
}; };
// 轮播图 // 轮播图
...@@ -351,10 +347,13 @@ const toUse = () => { ...@@ -351,10 +347,13 @@ const toUse = () => {
}); });
}; };
// 商家列表分页-搜索列表 // 商家列表分页-搜索列表
const getMerchantList = () => { const getMerchantList = async () => {
xma.showLoading({ xma.showLoading({
title: '加载中', title: '加载中',
}); });
const { lon, lat } = await getLocation();
listParams.lon = lon;
listParams.lat = lat;
merchantList(listParams).then((res) => { merchantList(listParams).then((res) => {
xma.hideLoading(); xma.hideLoading();
total = res.data.totalElements; total = res.data.totalElements;
......
...@@ -72,7 +72,7 @@ import Classification from '../../components/index/Classification.vue'; ...@@ -72,7 +72,7 @@ import Classification from '../../components/index/Classification.vue';
import Position from '../../components/index/Position.vue'; import Position from '../../components/index/Position.vue';
import Sort from '../../components/index/Sort.vue'; import Sort from '../../components/index/Sort.vue';
import { merchantList, getByParentId, getByType } from '../../api/index'; import { merchantList, getByParentId, getByType } from '../../api/index';
import { getLocation } from '../../utils/tool';
const business = reactive(['优选商家', '超值半价', '今日可订', '经典单人']); const business = reactive(['优选商家', '超值半价', '今日可订', '经典单人']);
const active = ref(null); const active = ref(null);
const rotate = ref(false); const rotate = ref(false);
...@@ -169,11 +169,15 @@ const back = () => { ...@@ -169,11 +169,15 @@ const back = () => {
}); });
}; };
// 商家列表分页-搜索列表 // 商家列表分页-搜索列表
const getMerchantList = () => { const getMerchantList = async () => {
xma.showLoading({ xma.showLoading({
title: '加载中', title: '加载中',
}); });
const { lon, lat } = await getLocation();
listParams.lon = lon;
listParams.lat = lat;
merchantList(listParams).then((res) => { merchantList(listParams).then((res) => {
xma.hideLoading();
total = res.data.totalElements; total = res.data.totalElements;
xma.hideLoading(); xma.hideLoading();
console.log('商家列表', res); console.log('商家列表', res);
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<view class="itemPicker"> <view class="itemPicker">
<view class="item01"> <view class="item01">
<text class="label">评分</text> <text class="label">评分</text>
<!-- 评分 -->
<wd-rate <wd-rate
prop="merchantServices" prop="merchantServices"
v-model="formdata.merchantServices" v-model="formdata.merchantServices"
...@@ -20,23 +21,25 @@ ...@@ -20,23 +21,25 @@
<text>{{ merList[formdata.merchantServices] }}</text> <text>{{ merList[formdata.merchantServices] }}</text>
</view> </view>
</view> </view>
<!-- 内容描述 -->
<wd-textarea <wd-textarea
prop="evaluation" prop="evaluation"
v-model="formdata.evaluation" v-model="formdata.evaluation"
placeholder="亲,分享您的看法,给其他人一个参考哦!" placeholder="亲,分享您的看法,给其他人一个参考哦!"
/> />
<text class="textarea">上传图片/视频</text> <text class="textarea">上传图片/视频</text>
<!-- 图片上传 -->
<view class="wdUpload" prop="images"> <view class="wdUpload" prop="images">
<wd-upload <wd-upload
multiple multiple
:action="action" :action="action"
@change="handleFile" @change="handleFile"
:file-list="formdata.images" :file-list="fList"
:before-remove="beforeRemove" :before-remove="beforeRemove"
:header="headers" :header="headers"
></wd-upload> ></wd-upload>
</view> </view>
<!-- 匿名评价 -->
<wd-cell title="匿名评价" prop="isAnonymous" class="itemSwichval"> <wd-cell title="匿名评价" prop="isAnonymous" class="itemSwichval">
<wd-switch <wd-switch
size="48rpx" size="48rpx"
...@@ -63,7 +66,8 @@ ...@@ -63,7 +66,8 @@
import Header from './components/Header/index.vue'; import Header from './components/Header/index.vue';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import { evaluation } from '@/api/order'; import { evaluation } from '@/api/order';
import { useToast } from 'wot-design-uni';
const uToast = useToast();
const form = ref(); const form = ref();
const token = getToken(); const token = getToken();
// 上传图片地址 // 上传图片地址
...@@ -74,7 +78,6 @@ const headers = ref(); ...@@ -74,7 +78,6 @@ const headers = ref();
*/ */
const shopname = ref<string>(''); const shopname = ref<string>('');
onLoad((options) => { onLoad((options) => {
console.log(options);
shopname.value = options?.shopName; shopname.value = options?.shopName;
formdata.orderNumber = options?.orderNumber; formdata.orderNumber = options?.orderNumber;
headers.value = { Authorization: 'Bearer ' + token }; headers.value = { Authorization: 'Bearer ' + token };
...@@ -83,18 +86,40 @@ onLoad((options) => { ...@@ -83,18 +86,40 @@ onLoad((options) => {
const formdata = reactive<{ const formdata = reactive<{
orderNumber: string; orderNumber: string;
evaluation: string; evaluation: string;
images: string; images: string[];
isAnonymous: number; isAnonymous: number;
descriptionMatches: number;
merchantServices: number; merchantServices: number;
}>({ }>({
orderNumber: '', orderNumber: '',
evaluation: '', evaluation: '',
images: '', images: [],
isAnonymous: 0, isAnonymous: 0,
descriptionMatches: 0,
merchantServices: 0, merchantServices: 0,
}); });
const rules = {};
/**
* 表单验证规则
*/
const rules = {
images: [
{
required: true,
message: '请上传图片',
validator: (value: any) => {
if (value) {
console.log('123456');
} else {
console.log('963852');
}
},
},
],
evaluation: [{ required: true, message: '请填写评价内容' }],
merchantServices: [{ required: true, message: '请选择商家服务评分' }],
};
/** /**
* 显示推荐菜 * 显示推荐菜
*/ */
...@@ -118,16 +143,15 @@ const handlemerchant = (item: { value: number }) => { ...@@ -118,16 +143,15 @@ const handlemerchant = (item: { value: number }) => {
/** /**
* 图片上传 * 图片上传
*/ */
const fileList = ref<any[]>([]); const fList = ref<any[]>([]);
function handleFile({ fileList: files }) { function handleFile({ fileList: files }) {
console.log('fileList', formdata.images); fList.value = files;
fileList.value = files;
} }
/** /**
* 图片地址处理 * 图片地址处理
*/ */
const proImage = () => { const proImage = () => {
const data = fileList.value.map((item) => { const data = fList.value.map((item) => {
return JSON.parse(item.response).data.url; return JSON.parse(item.response).data.url;
}); });
return data.join(','); return data.join(',');
...@@ -135,34 +159,41 @@ const proImage = () => { ...@@ -135,34 +159,41 @@ const proImage = () => {
const overshow = ref<boolean>(false); const overshow = ref<boolean>(false);
const resolves = ref(); const resolves = ref();
const beforeRemove = ({ file, fileList, resolve }) => { const beforeRemove = ({ resolve }) => {
overshow.value = true; overshow.value = true;
resolves.value = resolve; resolves.value = resolve;
}; };
const deleteImg = () => { const deleteImg = () => {
console.log(resolves.value(true)); resolves.value(true);
overshow.value = false; overshow.value = false;
}; };
/** /**
* Release提交 * Release提交
*/ */
const handleSubmit = async () => { const handleSubmit = async () => {
await evaluation({ await evaluation({
...formdata, ...formdata,
// images: proImage(), images: proImage(),
});
xma.showToast({
title: '评价成功',
duration: 1000,
icon: 'none',
}); });
uToast.success('评价成功');
xma.redirectTo({ xma.redirectTo({
url: `/pages/order/order?status=not_eval`, url: `/pages/order/order?status=not_eval`,
}); });
console.log(formdata);
}; };
// const handleSubmit = async () => {
// console.log(form.value.validate());
// form.value
// .validate()
// .then(({ valid, errors }) => {
// if (valid) {
// uToast.info({ msg: '校验通过' });
// }
// })
// .catch((error: any) => {
// console.log(error, 'error');
// });
// };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
...@@ -207,6 +238,9 @@ const handleSubmit = async () => { ...@@ -207,6 +238,9 @@ const handleSubmit = async () => {
margin-top: 25rpx; margin-top: 25rpx;
margin-bottom: 172rpx; margin-bottom: 172rpx;
padding: 20rpx; padding: 20rpx;
:deep(.wd-textarea) {
padding: 0 30rpx;
}
.itemPicker { .itemPicker {
display: flex; display: flex;
......
...@@ -5,16 +5,21 @@ ...@@ -5,16 +5,21 @@
<view class="content"> <view class="content">
<!-- 列表 --> <!-- 列表 -->
<view class="listcon"> <view class="listcon">
<view class="pubList" v-for="item in list" :key="item.id"> <view
class="pubList"
v-for="item in list"
:key="item.shopId"
@click="item.shopStatus != [1, 2, 3] ? shopGto(item.shopId) : ''"
>
<!-- 列表头部 --> <!-- 列表头部 -->
<view class="titlecon"> <view class="titlecon">
<span>{{ item.shopName }}</span> <span>{{ item.shopName }}</span>
<span>{{ item.shopStatus }}</span> <span>{{ shopStatus[item.shopStatus] }}</span>
</view> </view>
<!-- 列表详细 --> <!-- 列表详细 -->
<view class="delbox"> <view class="delbox">
<view class="listPic"> <view class="listPic">
<img :src="item.shopLogo" /> <img :src="itemUrl + item.shopLogo" />
</view> </view>
<view class="deltxt"> <view class="deltxt">
...@@ -38,13 +43,22 @@ ...@@ -38,13 +43,22 @@
</view> </view>
<view class="shbox" v-if="list.length > 0">审核被拒可点击修改重新提交</view> <view class="shbox" v-if="list.length > 0">审核被拒可点击修改重新提交</view>
</view> </view>
<view class="butCon"><button class="butXz" @click="shopGto">申请入驻</button></view> <view class="butCon"><button class="butXz" @click="shopGto()">申请入驻</button></view>
</view> </view>
</template> </template>
<script setup> <script setup>
import Header from '@/pages/order/components/Header/index.vue'; import Header from '@/pages/order/components/Header/index.vue';
import { shopList } from '@/api/storeEntry'; import { shopList } from '@/api/storeEntry';
const itemUrl = import.meta.env.VITE_APP_IMG_URL;
const shopStatus = reactive({
0: '停业中',
1: '营业中',
2: '平台下线',
3: '平台下线待审核',
4: '开店申请中',
5: '开店申请待审核',
});
const list = ref([]); const list = ref([]);
const getList = async () => { const getList = async () => {
const { data: res } = await shopList(); const { data: res } = await shopList();
...@@ -52,12 +66,12 @@ const getList = async () => { ...@@ -52,12 +66,12 @@ const getList = async () => {
if (res.length > 0) { if (res.length > 0) {
list.value = res; list.value = res;
} else { } else {
// shopGto(); shopGto();
} }
}; };
const shopGto = () => { const shopGto = (item) => {
xma.redirectTo({ xma.redirectTo({
url: `/pages/storeEntry/detail`, url: `/pages/storeEntry/detail${item ? `?id=${item}` : ''}`,
}); });
}; };
getList(); getList();
......
...@@ -21,7 +21,7 @@ export function getDistance(lat1, lng1, lat2, lng2, type = 1) { ...@@ -21,7 +21,7 @@ export function getDistance(lat1, lng1, lat2, lng2, type = 1) {
? type === 0 ? type === 0
? distance.toFixed(2) + '千米' ? distance.toFixed(2) + '千米'
: distance.toFixed(2) + 'km' : distance.toFixed(2) + 'km'
: type === 1 : type === 0
? (distance * 1000).toFixed(2) + '米' ? (distance * 1000).toFixed(2) + '米'
: (distance * 1000).toFixed(2) + 'm'; : (distance * 1000).toFixed(2) + 'm';
} }
......
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