Commit 2201074b authored by 彭佳妮(贵阳日报)'s avatar 彭佳妮(贵阳日报)
parents 46073972 ca947b37
<template>
<view class="card" v-for="(item, index) in cardData" :key="index">
<view @tap="toShop(item.shopId)" class="card" v-for="(item, index) in cardData" :key="index">
<image class="img" :src="item.shopLogo" mode="aspectFill" />
<view class="right">
<text class="text">{{ item.shopName }}</text>
......@@ -41,6 +41,11 @@ const props = defineProps({
type: Array,
},
});
const toShop = (id) => {
uni.navigateTo({
url: `/pages/shop/shop?shopId=${id}`,
});
};
</script>
<style lang="scss" scoped>
......
<template>
<view class="card">
<view class="head" :style="{ backgroundImage: `url(${shopCardData.shopLogo})` }">
<view class="head">
<image class="imgBg" :src="shopCardData.shopLogo" mode="aspectFill" />
<view class="containerBox">
<image class="img" :src="shopCardData.shopLogo" mode="aspectFill" />
<view class="right">
......@@ -12,8 +13,8 @@
<text class="four-text">1.2km</text>
</view>
<view class="threeBox">
<image class="img2" :src="shopCardData.evaluationVos[0]?.avatar" mode="aspectFill" />
<text class="one-text">{{ shopCardData.evaluationVos[0]?.evaluation }}</text>
<image class="img2" :src="shopCardData.evaluationVos?.[0].avatar" mode="aspectFill" />
<text class="one-text">{{ shopCardData.evaluationVos?.[0].evaluation }}</text>
</view>
<view class="labelBox">
<view v-for="(item, index) in shopCardData.labels" :key="index">{{ item }}</view>
......@@ -55,11 +56,14 @@ const props = defineProps({
.head {
width: 100%;
height: 200rpx;
// background: url('../../static/index/test3.png') no-repeat;
background-size: 100%;
position: relative;
backdrop-filter: blur(10px); /* 背景模糊度为10像素 */
-webkit-backdrop-filter: blur(10px); /* Safari 和 Chrome 需要的前缀 */
.imgBg {
width: 100%;
height: 200rpx;
filter: blur(16rpx);
position: absolute;
top: 0;
}
.containerBox {
display: flex;
position: absolute;
......
......@@ -63,7 +63,7 @@
<image class="tou" src="../../static/index/eat.png" mode="widthFix" />
<text class="">附近人气美食</text>
</view>
<view class="right">
<view class="right" @tap="more">
<text class="">立即查看</text>
<image class="jian" src="../../static/index/rightJ.png" mode="widthFix" />
</view>
......@@ -239,6 +239,12 @@ const nearbyFood = () => {
foodNearbyData.value = res.data.content;
});
};
// 附近美食查看更多
const more = () => {
xma.navigateTo({
url: '/pages/index/listFood?type=2',
});
};
// 轮播图
const rotatingBroadcast = () => {
groupImgList().then((res) => {
......@@ -347,7 +353,7 @@ const handleClick = (e) => {
const index = e.index;
if (index === 0) {
xma.navigateTo({
url: '/pages/index/listFood',
url: '/pages/index/listFood?type=1',
});
}
};
......
<template>
<view class="container">
<view class="head">
<view class="top">
<view class="top" :style="{ backgroundImage: topBg }">
<wd-icon name="thin-arrow-left" class="icon" @tap="back"></wd-icon>
</view>
<view class="bootom">
......@@ -68,12 +68,26 @@ import { merchantList } from '../../api/index';
onMounted(() => {
getMerchantList();
});
onLoad((options) => {
const { type } = options;
console.log('打印', type);
switch (type) {
case '1':
topBg.value = 'url(../../static/index/taste.png)';
break;
case '2':
topBg.value = 'url(../../static/index/foodBg.png)';
break;
}
});
const business = reactive(['优选商家', '超值半价', '今日可订', '经典单人']);
const active = ref(null);
const rotate = ref(false);
const rotate2 = ref(false);
const rotate3 = ref(false);
const topBg = ref(null);
const back = () => {
xma.navigateBack({
delta: 1,
......@@ -147,7 +161,7 @@ page {
height: 480rpx;
.top {
height: 356rpx;
background: url('../../static/index/taste.png');
// background: url('../../static/index/taste.png');
background-size: 100% 100%;
.icon {
font-size: 28rpx;
......
......@@ -3,11 +3,13 @@
<wd-popup
v-model="showpopup"
position="bottom"
custom-style="height: 50%;"
custom-style="height: 50%;border-radius: 16rpx 16rpx 0 0 ;"
@close="handleClose"
:safe-area-inset-bottom="true"
custom-class="popup"
></wd-popup>
>
<view class="popup-content"></view>
</wd-popup>
<!-- 轮播 -->
<view class="swiper">
<wd-swiper
......@@ -149,7 +151,8 @@
<!-- 底部 -->
<view class="bottom-operation-bar">
<view class="start" @click="collectionFn">
<image 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>
{{ shopInfo.privateIntFcount }}
</view>
<view class="start">
......@@ -193,7 +196,9 @@ onShow(() => {
getLocationFn();
});
function alert() {
if (productCoupons.value.length > 0) {
show.value = true;
}
}
/**
......
......@@ -294,7 +294,7 @@ const activeId = ref(1);
const shopInfo = ref({});
// 店铺轮播图
const shopSwiperList = ref([]);
// 当前位置的经纬度
// 当前位置的经纬度-// 店铺的经纬度
const currentLatitudeAndLongitude = ref({ latitude: 0, longitude: 0 });
// 团购商品列表
const listOfGroupBuyingProducts = ref([]);
......@@ -304,7 +304,7 @@ const merchantCoupons = ref({});
const params = ref({
current: 1,
size: 3,
shopId: '1626126617850544129',
shopId: '',
isEnd: false,
});
const isLoadReachBottom = ref(null);
......@@ -320,11 +320,12 @@ const tagList2 = ref([{ name: '免费停车', id: 1 }]);
// 周边推荐-商家列表
const recommendedListOfPeripherals = ref([]);
onLoad((options) => {
getStoreInformationFn('1626126617850544129').then(() => {
params.value.shopId = options.shopId;
getStoreInformationFn(options.shopId).then(() => {
peripheryRecomFn();
});
groupBuyListFn('1626126617850544129');
couponShopListFn('1626126617850544129');
groupBuyListFn(options.shopId);
couponShopListFn(options.shopId);
getEvaluationPageFn();
});
onShow(() => {
......@@ -355,16 +356,16 @@ function peripheryRecomFn() {
recommendedTypesOfPeripherals.value = res.data;
const id = recommendedTypesOfPeripherals.value[0].categoryId;
activeId.value = id;
sgyrddShopPageFn(id);
sgyrddShopPageFn(id, lat, lon);
}
});
}
function sgyrddShopPageFn(categoryIds) {
function sgyrddShopPageFn(categoryIds, lat, lon) {
const params = {
current: 1,
size: 15,
lat: '106.68650025025502',
lon: '26.567192352601154',
lat,
lon,
categoryIds,
distance: 200,
};
......@@ -391,7 +392,7 @@ function getLocationFn() {
success: function (res) {
// 经纬度
console.log('res.latitude, res.longitude', res.latitude, res.longitude);
// 店铺的经纬度
const myLatitude = currentLatitudeAndLongitude.value.latitude;
const myLongitude = currentLatitudeAndLongitude.value.longitude;
const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1);
......@@ -515,6 +516,11 @@ const getEvaluationPageFn = () => {
}
});
};
function back() {
xma.navigateBack({
delta: 1,
});
}
function refresh() {
return new Promise((resolve) => {
params.value = {
......
......@@ -225,8 +225,8 @@ const changeShowDetail = () => {
}
.btn {
width: 100rpx;
height: 50rpx;
padding: 20rpx;
box-sizing: border-box;
border-radius: 26rpx;
display: flex;
align-items: center;
......
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