bug修复

parent f8b05f7e
...@@ -56,7 +56,7 @@ const toShop = (id) => { ...@@ -56,7 +56,7 @@ const toShop = (id) => {
.card { .card {
width: 710rpx; width: 710rpx;
// height: 316rpx; // height: 316rpx;
border-radius: 0rpx 0rpx 16rpx 16rpx; border-radius: 16rpx 16rpx 16rpx 16rpx;
background: #fdfdfd; background: #fdfdfd;
margin: 0 auto; margin: 0 auto;
margin-bottom: 2rpx; margin-bottom: 2rpx;
......
...@@ -5,7 +5,16 @@ ...@@ -5,7 +5,16 @@
<view @tap="choice(1)" class="option" :class="light2 === 1 ? 'light2' : ''">行政区</view> <view @tap="choice(1)" class="option" :class="light2 === 1 ? 'light2' : ''">行政区</view>
</view> </view>
<view class="right-details" v-show="light2 === 0"> <view class="right-details" v-show="light2 === 0">
<text class="nearby-title">我的附近</text> <view class="title-box">
<text class="nearby-title">我的附近</text>
<wd-icon
@tap="refresh"
class="icon"
:class="{ rotate: reset }"
name="refresh"
size="12px"
></wd-icon>
</view>
<view class="nearby-card"> <view class="nearby-card">
<view @tap="choice2(0, 0)" class="label" :class="light3 === 0 ? 'light3' : ''">附近</view> <view @tap="choice2(0, 0)" class="label" :class="light3 === 0 ? 'light3' : ''">附近</view>
<view @tap="choice2(1, 0.5)" class="label" :class="light3 === 1 ? 'light3' : ''">500m</view> <view @tap="choice2(1, 0.5)" class="label" :class="light3 === 1 ? 'light3' : ''">500m</view>
...@@ -14,7 +23,7 @@ ...@@ -14,7 +23,7 @@
<view @tap="choice2(4, 5)" class="label" :class="light3 === 4 ? 'light3' : ''">5km</view> <view @tap="choice2(4, 5)" class="label" :class="light3 === 4 ? 'light3' : ''">5km</view>
<view @tap="choice2(5, 10)" class="label" :class="light3 === 5 ? 'light3' : ''">10km</view> <view @tap="choice2(5, 10)" class="label" :class="light3 === 5 ? 'light3' : ''">10km</view>
</view> </view>
<text class="nearby-title margin">热门地点</text> <text class="nearby-title2 margin">热门地点</text>
<ul class="ul"> <ul class="ul">
<li <li
v-for="(item, index) in items" v-for="(item, index) in items"
...@@ -60,7 +69,8 @@ const props = defineProps({ ...@@ -60,7 +69,8 @@ const props = defineProps({
default: '100%', default: '100%',
}, },
}); });
const emit = defineEmits(['nearby', 'popular', 'region']); const reset = ref(false);
const emit = defineEmits(['nearby', 'popular', 'region', 'refresh']);
const light2 = ref(0); const light2 = ref(0);
const light3 = ref(0); const light3 = ref(0);
const items = ref(['云岩区', '白云区', '乌当区', '花溪区', '清镇市', '开阳县', '修文县']); const items = ref(['云岩区', '白云区', '乌当区', '花溪区', '清镇市', '开阳县', '修文县']);
...@@ -82,6 +92,18 @@ onMounted(() => { ...@@ -82,6 +92,18 @@ onMounted(() => {
getPlace(); getPlace();
getAdministration(); getAdministration();
}); });
// 重置选项
const refresh = () => {
light3.value = 0;
selectedItem.value = null;
selectedItem2.value = null;
reset.value = true;
setTimeout(() => {
reset.value = false;
}, 400);
emit('refresh');
};
// 热门地点 // 热门地点
const getPlace = () => { const getPlace = () => {
getRegion({ city: '贵阳' }).then((res) => { getRegion({ city: '贵阳' }).then((res) => {
...@@ -151,7 +173,35 @@ const selectItem2 = (index, area) => { ...@@ -151,7 +173,35 @@ const selectItem2 = (index, area) => {
.right-details { .right-details {
width: calc(100% - 176rpx); width: calc(100% - 176rpx);
height: 100%; height: 100%;
.nearby-title { .title-box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10rpx;
.nearby-title {
font-size: 24rpx;
color: #3d3d3d;
font-weight: 500;
font-family: Source Han Sans;
margin-left: 40rpx;
}
.icon {
margin-right: 40rpx;
}
.rotate {
animation: spin 0.3s linear;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
}
.nearby-title2 {
font-size: 24rpx; font-size: 24rpx;
color: #3d3d3d; color: #3d3d3d;
font-weight: 500; font-weight: 500;
......
...@@ -10,14 +10,15 @@ ...@@ -10,14 +10,15 @@
"path": "pages/index/loading", "path": "pages/index/loading",
"style": { "style": {
"navigationBarTitleText": "加载", "navigationBarTitleText": "加载",
"navigationStyle":"custom" "navigationStyle":"custom",
} }
}, },
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "小程序平台", "navigationBarTitleText": "小程序平台",
"navigationStyle":"custom" "navigationStyle":"custom",
"enablePullDownRefresh": true
} }
}, },
{ {
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<text class="price">{{ item.price }}</text> <text class="price">{{ item.price }}</text>
<view class="afterTheCoupon"> <view class="afterTheCoupon">
<text class="afterTheCoupon1">券后¥</text> <text class="afterTheCoupon1">券后¥</text>
<text class="afterTheCoupon2">{{ item.price - item.reduceAmount }}</text> <text class="afterTheCoupon2">{{ (item.price - item.reduceAmount).toFixed(1) }}</text>
</view> </view>
</view> </view>
<view class="twoBox"> <view class="twoBox">
...@@ -191,6 +191,7 @@ page { ...@@ -191,6 +191,7 @@ page {
margin-bottom: 18rpx; margin-bottom: 18rpx;
box-sizing: border-box; box-sizing: border-box;
padding-bottom: 20rpx; padding-bottom: 20rpx;
// flex-shrink: 0;
.commodity { .commodity {
width: 341rpx; width: 341rpx;
height: 401rpx; height: 401rpx;
...@@ -206,11 +207,13 @@ page { ...@@ -206,11 +207,13 @@ page {
font-family: font-family:
PingFang SC, PingFang SC,
PingFang SC; PingFang SC;
display: inline-block;
height: 80rpx;
} }
.oneBox { .oneBox {
display: flex; display: flex;
align-items: end; align-items: end;
margin: 20rpx 0; margin-bottom: 20rpx;
.price { .price {
font-weight: bold; font-weight: bold;
color: #f12a2a; color: #f12a2a;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<text class="textW">{{ item.discountValue }}</text> <text class="textW">{{ item.discountValue }}</text>
</view> </view>
<view v-if="item.numState === 0" class="textF" @tap="receive(item)">领取</view> <view v-if="item.numState === 0" class="textF" @tap="receive(item)">领取</view>
<view v-else class="textF" @tap="toUse">去使用</view> <view v-else class="textF" @tap="toUse(item)">去使用</view>
</view> </view>
</scroll-view> </scroll-view>
<image <image
...@@ -126,7 +126,13 @@ ...@@ -126,7 +126,13 @@
</view> --> </view> -->
</view> </view>
<!-- 位置定位 --> <!-- 位置定位 -->
<Position v-show="rotate" @nearby="nearby" @popular="popular" @region="region" /> <Position
v-show="rotate"
@nearby="nearby"
@popular="popular"
@region="region"
@refresh="refresh"
/>
</view> </view>
<!-- 美食卡片 --> <!-- 美食卡片 -->
<FoodDetails :cardData="cardData" /> <FoodDetails :cardData="cardData" />
...@@ -226,7 +232,16 @@ const coupon = ref([]); ...@@ -226,7 +232,16 @@ const coupon = ref([]);
let total; let total;
// 轮播图数据 // 轮播图数据
let lunboData; let lunboData;
onMounted(async () => { onMounted(() => {
orderStatus();
getClassification();
rotatingBroadcast();
nearbyFood();
recommendedClassification();
getMerchantList();
getCouponMainList();
});
onPullDownRefresh(() => {
orderStatus(); orderStatus();
getClassification(); getClassification();
rotatingBroadcast(); rotatingBroadcast();
...@@ -235,7 +250,6 @@ onMounted(async () => { ...@@ -235,7 +250,6 @@ onMounted(async () => {
getMerchantList(); getMerchantList();
getCouponMainList(); getCouponMainList();
}); });
function jumpProductDetails(item) { function jumpProductDetails(item) {
xma.navigateTo({ xma.navigateTo({
url: '/pages/shop/shop?shopId=' + item.shopId, url: '/pages/shop/shop?shopId=' + item.shopId,
...@@ -341,10 +355,19 @@ const reset = () => { ...@@ -341,10 +355,19 @@ const reset = () => {
show.value = false; show.value = false;
}; };
const toUse = () => { const toUse = (data) => {
xma.navigateTo({ const { activityCode, couponType } = data;
url: '/pages/index/listFood?type=1', if (couponType === 'mch') {
}); xma.navigateTo({
url: `/pages/shop/shop?shopId=${activityCode}`,
});
} else {
xma.showToast({
title: '请打开翼支付app查看',
icon: 'none',
duration: 2000,
});
}
}; };
// 商家列表分页-搜索列表 // 商家列表分页-搜索列表
const getMerchantList = async () => { const getMerchantList = async () => {
...@@ -355,6 +378,7 @@ const getMerchantList = async () => { ...@@ -355,6 +378,7 @@ const getMerchantList = async () => {
listParams.lon = lon; listParams.lon = lon;
listParams.lat = lat; listParams.lat = lat;
merchantList(listParams).then((res) => { merchantList(listParams).then((res) => {
xma.stopPullDownRefresh();
xma.hideLoading(); xma.hideLoading();
total = res.data.totalElements; total = res.data.totalElements;
res.data.content.forEach((item) => { res.data.content.forEach((item) => {
...@@ -411,6 +435,16 @@ const getMerchantListPaging = () => { ...@@ -411,6 +435,16 @@ const getMerchantListPaging = () => {
cardData2.value = [...cardData2.value, ...res.data.content]; cardData2.value = [...cardData2.value, ...res.data.content];
}); });
}; };
// 位置重置
const refresh = () => {
delete listParams.distance;
delete listParams.area;
delete listParams.communityName;
setTimeout(() => {
rotate.value = false;
}, 400);
getMerchantList();
};
// distance参数来源 // distance参数来源
const nearby = (distance) => { const nearby = (distance) => {
console.log('distance', distance); console.log('distance', distance);
...@@ -445,6 +479,7 @@ const region = (area) => { ...@@ -445,6 +479,7 @@ const region = (area) => {
// tabs // tabs
const choice = (index, categoryId) => { const choice = (index, categoryId) => {
reset(); reset();
rotate.value = false;
light.value = index; light.value = index;
listParams.categoryIds = [categoryId]; listParams.categoryIds = [categoryId];
if (index === 0) { if (index === 0) {
......
...@@ -49,7 +49,13 @@ ...@@ -49,7 +49,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="refresh"
/>
<!-- 排序筛选 --> <!-- 排序筛选 -->
<Sort v-show="rotate3" @sortParams="sortParams" /> <Sort v-show="rotate3" @sortParams="sortParams" />
</view> </view>
...@@ -104,7 +110,16 @@ onLoad((options) => { ...@@ -104,7 +110,16 @@ onLoad((options) => {
topBg.value = `url(${import.meta.env.VITE_APP_IMG_URL + res.data[0].imgUrl})`; topBg.value = `url(${import.meta.env.VITE_APP_IMG_URL + res.data[0].imgUrl})`;
}); });
}); });
// distance参数来源
const refresh = () => {
delete listParams.distance;
delete listParams.area;
delete listParams.communityName;
setTimeout(() => {
rotate2.value = false;
}, 400);
getMerchantList();
}; // distance参数来源
const nearby = (distance) => { const nearby = (distance) => {
console.log('distance', distance); console.log('distance', distance);
reset(); reset();
......
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