feat: 优化

This commit is contained in:
2026-07-23 13:59:35 +08:00
parent 268207b01b
commit 3f335074ea
13 changed files with 614 additions and 580 deletions
+24 -7
View File
@@ -19,7 +19,8 @@
</view>
</scroll-view>
<scroll-view :scroll-y="true" class="address-bottom-list" :scroll-into-view="scrollId">
<scroll-view :scroll-y="true" class="address-bottom-list" :scroll-into-view="scrollId"
:scroll-top="scrollTop">
<view class="address-data-view" v-for="(item, index) in dataList" :key="index" :id="item.zi">
<text class="text-32 text-gray text-bold">{{ item.zi }}</text>
<view class="address-data-data" @click="onItem(item, xItem)" v-for="(xItem, xIndex) in item.data"
@@ -45,6 +46,7 @@ export default {
data() {
return {
scrollId: '',
scrollTop: 0,
}
},
props: {
@@ -68,10 +70,23 @@ export default {
type: Number,
default: 0
}
},
watch: {
dataList() {
this.resetScroll();
},
curSelect() {
this.resetScroll();
}
},
methods: {
resetScroll() {
this.scrollId = '';
this.scrollTop = this.scrollTop === 0 ? 0.01 : 0;
this.$nextTick(() => {
this.scrollTop = 0;
});
},
onClose() {
this.$emit('close')
},
@@ -83,6 +98,7 @@ export default {
},
onSelectItrm(item, index) {
if (index != this.curSelect) {
this.resetScroll();
this.$emit('select', item, index);
}
},
@@ -91,6 +107,7 @@ export default {
Func.debounce(() => this.onItemOne(item, xItem), 150);
},
onItemOne(item, xItem) {
this.resetScroll();
this.$emit('itemSelect', item, xItem);
}
}
@@ -127,8 +144,8 @@ export default {
.address-bottom-list {
width: 100%;
height: calc(100% - 88rpx - 88rpx - 32rpx);
margin-top: 32rpx;
height: calc(100% - 60rpx - 88rpx - 32rpx);
margin-top: 20rpx;
display: flex;
flex-direction: column;
overflow-y: auto;
@@ -153,8 +170,8 @@ export default {
.address-select-view {
width: 100%;
height: 88rpx;
min-height: 88rpx;
height: 60rpx;
min-height: 60rpx;
display: flex;
flex-direction: row;
align-items: center;