uview-plus组件库全面升级更新,订单结算判断支付方式是否可用代码调整,公众号关注二维码修改

This commit is contained in:
2025-10-21 10:44:31 +08:00
parent 5d98b7efc2
commit 5f3a307fec
395 changed files with 31264 additions and 2477 deletions

View File

@@ -15,6 +15,7 @@ export default {
indexList: [],
sticky: true,
customNavHeight: 0,
safeBottomFix: false
safeBottomFix: false,
itemMargin: '0rpx'
}
}

View File

@@ -32,5 +32,10 @@ export const props = defineMixin({
type: Boolean,
default: () => defProps.indexList.safeBottomFix
},
//自定义下边距
itemMargin: {
type: String,
default: () => defProps.indexList.itemMargin
},
}
})

View File

@@ -66,7 +66,7 @@
<text
class="u-index-list__letter__item__index"
:style="{color: activeIndex === index ? '#fff' : inactiveColor}"
>{{ item }}</text>
>{{ item.key || item }}</text>
</view>
</view>
<u-transition
@@ -87,7 +87,7 @@
width: addUnit(indicatorHeight)
}"
>
<text class="u-index-list__indicator__text">{{ uIndexList[activeIndex] }}</text>
<text class="u-index-list__indicator__text">{{ uIndexList[activeIndex]?.key || uIndexList[activeIndex] }}</text>
</view>
</u-transition>
</view>
@@ -284,8 +284,10 @@
return new Promise(resolve => {
// 延时一定时间以获取dom尺寸
// #ifndef APP-NVUE
this.$uGetRect('.u-index-list__scroll-view').then(size => {
resolve(size)
this.$nextTick(() => {
this.$uGetRect('.u-index-list__scroll-view').then(size => {
resolve(size)
})
})
// #endif
@@ -389,9 +391,14 @@
// 如果偏移量太小,前后得出的会是同一个索引字母,为了防抖,进行返回
if (currentIndex === this.activeIndex) return
this.activeIndex = currentIndex
this.$emit('select', this.uIndexList[currentIndex])
// #ifndef APP-NVUE || MP-WEIXIN
// 在非nvue中由于anchor和item都在u-index-item中所以需要对index-item进行偏移
this.scrollIntoView = `u-index-item-${this.uIndexList[currentIndex].charCodeAt(0)}`
if (typeof this.uIndexList[currentIndex] == 'string') {
this.scrollIntoView = `u-index-item-${this.uIndexList[currentIndex].charCodeAt(0)}`
} else {
this.scrollIntoView = `u-index-item-${this.uIndexList[currentIndex].name.charCodeAt(0)}`
}
// #endif
// #ifdef MP-WEIXIN
@@ -406,12 +413,13 @@
const anchors = this.anchors
// 由于list组件无法获取cell的top值这里通过header slot和各个item之间的height模拟出类似非nvue下的位置信息
let children = this.children.map((item, index) => {
const childHeight = item.height + getPx(this.itemMargin)
const child = {
height: item.height,
height: childHeight,
top: top
}
// 进行累加给下一个item提供计算依据
top = top + item.height
top = top + childHeight
// #ifdef APP-NVUE
// 只有nvue下需要将锚点的高度也累加非nvue下锚点高度是包含在index-item中的。
top = top + anchors[index].height
@@ -419,7 +427,7 @@
return child
})
// console.log('this.children[currentIndex].top', children[currentIndex].top)
if (children[currentIndex]?.top) {
if (children[currentIndex]?.top || children[currentIndex].top === 0) {
this.scrollTop = children[currentIndex].top - getPx(customNavHeight)
}
// #endif
@@ -489,12 +497,13 @@
const anchors = this.anchors
// 由于list组件无法获取cell的top值这里通过header slot和各个item之间的height模拟出类似非nvue下的位置信息
children = this.children.map((item, index) => {
const childHeight = item.height + getPx(this.itemMargin)
const child = {
height: item.height,
height: childHeight,
top: top
}
// 进行累加给下一个item提供计算依据
top = top + item.height
top = top + childHeight
// #ifdef APP-NVUE
// 只有nvue下需要将锚点的高度也累加非nvue下锚点高度是包含在index-item中的。
top = top + anchors[index].height
@@ -531,7 +540,6 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/components.scss";
.u-index-list {