bug修复

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