diff --git a/src/components/custom-refresher/custom-refresher.vue b/src/components/custom-refresher/custom-refresher.vue new file mode 100644 index 0000000..4e98290 --- /dev/null +++ b/src/components/custom-refresher/custom-refresher.vue @@ -0,0 +1,73 @@ + + + + + + diff --git a/src/components/x-paging/index.vue b/src/components/x-paging/index.vue index 8102b59..bf8f724 100644 --- a/src/components/x-paging/index.vue +++ b/src/components/x-paging/index.vue @@ -1,20 +1,30 @@ diff --git a/src/pages/chatSettings/components/settingFormItem.vue b/src/pages/chatSettings/components/settingFormItem.vue index 432284d..fcf7639 100644 --- a/src/pages/chatSettings/components/settingFormItem.vue +++ b/src/pages/chatSettings/components/settingFormItem.vue @@ -4,11 +4,12 @@
{{ props?.item?.label }}
-
- +
+ {{ props?.item?.value }} +
+ {{ props?.item?.value }} +
+
{{ props?.item?.subValue }}
@@ -125,14 +129,17 @@ const changeSwitch = (e, item) => { .item-sub { margin: 28rpx 0 0; - white-space: nowrap; - overflow: hidden; - max-width: 100%; - text-overflow: ellipsis; + span { line-height: 44rpx; color: #747474; } } + .cab1{ + white-space: nowrap; + overflow: hidden; + max-width: 100%; + text-overflow: ellipsis; + } } diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 05bc3de..cbe8634 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -1,237 +1,319 @@ diff --git a/src/static/image/clockIn/loading@2x.png b/src/static/image/clockIn/loading@2x.png new file mode 100644 index 0000000..d88960a Binary files /dev/null and b/src/static/image/clockIn/loading@2x.png differ diff --git a/src/store/modules/talk.js b/src/store/modules/talk.js index 3a7d561..f462e27 100644 --- a/src/store/modules/talk.js +++ b/src/store/modules/talk.js @@ -97,10 +97,10 @@ export const useTalkStore = defineStore('talk', { // 加载会话列表 loadTalkList() { this.loadStatus = 2 - const resp = ServeGetTalkList() - resp.then(({ code, data }) => { + // 返回 Promise 对象,使调用方可以使用 then/catch + return resp.then(({ code, data }) => { if (code == 200) { this.items = data.items.map((item) => { const value = formatTalkItem(item) @@ -118,13 +118,14 @@ export const useTalkStore = defineStore('talk', { }) this.loadStatus = 3 + return this.items // 返回处理后的数据 } else { this.loadStatus = 4 + return Promise.reject(new Error('加载会话列表失败')) // 返回拒绝的 Promise } - }) - - resp.catch(() => { + }).catch((error) => { this.loadStatus = 4 + return Promise.reject(error) // 继续向上传递错误 }) }, diff --git a/src/uni_modules/z-paging/changelog.md b/src/uni_modules/z-paging/changelog.md index d3b2d62..0b2f5d1 100644 --- a/src/uni_modules/z-paging/changelog.md +++ b/src/uni_modules/z-paging/changelog.md @@ -1,3 +1,9 @@ +## 2.8.5(2025-02-09) +1.`新增` 方法`scrollToX`,支持控制x轴滚动到指定位置。 +2.`修复` 快手小程序中报错`await isn't allowed in non-async function`的问题。 +3.`修复` 在iOS+nvue中,设置了`:loading-more-enabled="false"`后,调用`scrollToBottom`无法滚动到底部的问题。 +4.`修复` 在支付宝小程序+页面滚动中,数据为空时空数据图未居中的问题。 +5.`优化` fetch types修改。 ## 2.8.4(2024-12-02) 1.`修复` 在虚拟列表+vue2中,顶部占位采用transformY方案;在虚拟列表+vue3中,顶部占位采用view占位方案。以解决在vue2+微信小程序+安卓+兼容模式中,可能出现的虚拟列表闪动的问题。 2.`修复` 在列表渲染时(尤其是在虚拟列表中)偶现的【点击加载更多】闪现的问题。 diff --git a/src/uni_modules/z-paging/components/z-paging/js/modules/load-more.js b/src/uni_modules/z-paging/components/z-paging/js/modules/load-more.js index 3d0a66e..f6799f2 100644 --- a/src/uni_modules/z-paging/components/z-paging/js/modules/load-more.js +++ b/src/uni_modules/z-paging/components/z-paging/js/modules/load-more.js @@ -244,7 +244,7 @@ export default { } } }, - // 触发加载更多时调用,from:toBottom-滑动到底部触发;1、click-点击加载更多触发 + // 触发加载更多时调用,from:toBottom-滑动到底部触发;click-点击加载更多触发 _onLoadingMore(from = 'click') { // 如果是ios并且是滚动到底部的,则在滚动到底部时候尝试将列表设置为禁止滚动然后设置为允许滚动,以禁止底部bounce的效果 if (this.isIos && from === 'toBottom' && !this.scrollToBottomBounceEnabled && this.scrollEnable) { diff --git a/src/uni_modules/z-paging/components/z-paging/js/modules/scroller.js b/src/uni_modules/z-paging/components/z-paging/js/modules/scroller.js index 3e57ee5..8145bd0 100644 --- a/src/uni_modules/z-paging/components/z-paging/js/modules/scroller.js +++ b/src/uni_modules/z-paging/components/z-paging/js/modules/scroller.js @@ -53,6 +53,8 @@ export default { return { scrollTop: 0, oldScrollTop: 0, + scrollLeft: 0, + oldScrollLeft: 0, scrollViewStyle: {}, scrollViewContainerStyle: {}, scrollViewInStyle: {}, @@ -166,17 +168,24 @@ export default { this._scrollIntoViewByNodeTop(nodeTop, offset, animate); }) }, - // 滚动到指定位置(vue中有效)。y为与顶部的距离,单位为px;offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否 + // y轴滚动到指定位置(vue中有效)。y为与顶部的距离,单位为px;offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否 scrollToY(y, offset, animate) { this.scrollTop = this.oldScrollTop; this.$nextTick(() => { this._scrollToY(y, offset, animate); }) }, + // x轴滚动到指定位置(非页面滚动且在vue中有效)。x为与左侧的距离,单位为px;offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否 + scrollToX(x, offset, animate) { + this.scrollLeft = this.oldScrollLeft; + this.$nextTick(() => { + this._scrollToX(x, offset, animate); + }) + }, // 滚动到指定view(nvue中和虚拟列表中有效)。index为需要滚动的view的index(第几个,从0开始);offset为偏移量,单位为px;animate为是否展示滚动动画,默认为否 scrollIntoViewByIndex(index, offset, animate) { if (index >= this.realTotalData.length) { - u.consoleErr('当前滚动的index超出已渲染列表长度,请先通过refreshToPage加载到对应index页并等待渲染成功后再调用此方法!') + u.consoleErr('当前滚动的index超出已渲染列表长度,请先通过refreshToPage加载到对应index页并等待渲染成功后再调用此方法!'); return; } this.$nextTick(() => { @@ -381,7 +390,7 @@ export default { this._scrollToY(nodeTop, offset, animate, true); } }, - // 滚动到指定位置 + // y轴滚动到指定位置 _scrollToY(y, offset = 0, animate = false, addScrollTop = false) { this._updatePrivateScrollWithAnimation(animate); u.delay(() => { @@ -402,14 +411,26 @@ export default { } }, 10) }, + // x轴滚动到指定位置 + _scrollToX(x, offset = 0, animate = false) { + this._updatePrivateScrollWithAnimation(animate); + u.delay(() => { + if (!this.usePageScroll) { + this.scrollLeft = x - offset; + } else { + u.consoleErr('使用页面滚动时不支持scrollToX'); + } + }, 10) + }, // scroll-view滚动中 _scroll(e) { this.$emit('scroll', e); - const scrollTop = e.detail.scrollTop; + const { scrollTop, scrollLeft } = e.detail; // #ifndef APP-NVUE this.finalUseVirtualList && this._updateVirtualScroll(scrollTop, this.oldScrollTop - scrollTop); // #endif this.oldScrollTop = scrollTop; + this.oldScrollLeft = scrollLeft; // 滚动区域内容的总高度 - 当前滚动的scrollTop = 当前滚动区域的顶部与内容底部的距离 const scrollDiff = e.detail.scrollHeight - this.oldScrollTop; // 在非ios平台滚动中,再次验证一下是否滚动到了底部。因为在一些安卓设备中,有概率滚动到底部不触发@scrolltolower事件,因此添加双重检测逻辑 diff --git a/src/uni_modules/z-paging/components/z-paging/js/z-paging-constant.js b/src/uni_modules/z-paging/components/z-paging/js/z-paging-constant.js index 157e755..2d1c7d6 100644 --- a/src/uni_modules/z-paging/components/z-paging/js/z-paging-constant.js +++ b/src/uni_modules/z-paging/components/z-paging/js/z-paging-constant.js @@ -2,7 +2,7 @@ export default { // 当前版本号 - version: '2.8.3', + version: '2.8.5', // 延迟操作的通用时间 delayTime: 100, // 请求失败时候全局emit使用的key diff --git a/src/uni_modules/z-paging/components/z-paging/js/z-paging-main.js b/src/uni_modules/z-paging/components/z-paging/js/z-paging-main.js index eae544a..3cd8b7a 100644 --- a/src/uni_modules/z-paging/components/z-paging/js/z-paging-main.js +++ b/src/uni_modules/z-paging/components/z-paging/js/z-paging-main.js @@ -420,7 +420,12 @@ export default { let scrollViewHeight = this.windowHeight - scrollViewTop; scrollViewHeight -= finalScrollBottomNode ? finalScrollBottomNode[0].height : 0; const additionHeight = u.convertToPx(this.autoHeightAddition); - const finalHeight = scrollViewHeight + additionHeight - (this.insideMore ? 1 : 0) + 'px !important'; + // 在支付宝小程序中,添加!important会导致min-height失效,因此在支付宝小程序中需要去掉 + let importantSuffix = ' !important'; + // #ifdef MP-ALIPAY + importantSuffix = ''; + // #endif + const finalHeight = scrollViewHeight + additionHeight - (this.insideMore ? 1 : 0) + 'px' + importantSuffix; this.$set(this.scrollViewStyle, heightKey, finalHeight); this.$set(this.scrollViewInStyle, heightKey, finalHeight); } @@ -432,7 +437,7 @@ export default { }, // #ifdef MP-KUAISHOU // 设置scroll-view内容器的最小高度等于scroll-view的高度(为了解决在快手小程序中内容较少时scroll-view内容器高度无法铺满scroll-view的问题) - _setFullScrollViewInHeight() { + async _setFullScrollViewInHeight() { try { // 如果需要铺满全屏,则计算当前全屏可是区域的高度 const scrollViewNode = await this._getNodeClientRect('.zp-scroll-view'); diff --git a/src/uni_modules/z-paging/components/z-paging/z-paging.vue b/src/uni_modules/z-paging/components/z-paging/z-paging.vue index 3d0de46..b8aa423 100644 --- a/src/uni_modules/z-paging/components/z-paging/z-paging.vue +++ b/src/uni_modules/z-paging/components/z-paging/z-paging.vue @@ -4,7 +4,7 @@ / /_____| |_) | (_| | (_| | | | | | (_| | /___| | .__/ \__,_|\__, |_|_| |_|\__, | |_| |___/ |___/ -v2.8.3 (2024-11-27) +v2.8.5 (2025-02-09) @author ZXLee --> @@ -34,7 +34,7 @@ v2.8.3 (2024-11-27) - + diff --git a/src/uni_modules/z-paging/package.json b/src/uni_modules/z-paging/package.json index 977b095..fd77a7e 100644 --- a/src/uni_modules/z-paging/package.json +++ b/src/uni_modules/z-paging/package.json @@ -2,7 +2,7 @@ "id": "z-paging", "name": "z-paging", "displayName": "【z-paging下拉刷新、上拉加载】高性能,全平台兼容。支持虚拟列表,分页全自动处理", - "version": "2.8.4", + "version": "2.8.5", "description": "超简单、低耦合!使用wxs+renderjs实现。支持自定义下拉刷新、上拉加载更多、虚拟列表、下拉进入二楼、自动管理空数据图、无闪动聊天分页、本地分页、国际化等数百项配置", "keywords": [ "下拉刷新", diff --git a/src/uni_modules/z-paging/readme.md b/src/uni_modules/z-paging/readme.md index c2f1864..0168821 100644 --- a/src/uni_modules/z-paging/readme.md +++ b/src/uni_modules/z-paging/readme.md @@ -4,7 +4,7 @@ logo

-[![version](https://img.shields.io/badge/version-2.8.3-blue)](https://github.com/SmileZXLee/uni-z-paging) [![license](https://img.shields.io/github/license/SmileZXLee/uni-z-paging)](https://en.wikipedia.org/wiki/MIT_License) +[![version](https://img.shields.io/badge/version-2.8.5-blue)](https://github.com/SmileZXLee/uni-z-paging) [![license](https://img.shields.io/github/license/SmileZXLee/uni-z-paging)](https://en.wikipedia.org/wiki/MIT_License) `z-paging-x`现已支持uniapp x,持续完善中,插件地址👉🏻 [https://ext.dcloud.net.cn/plugin?name=z-paging-x](https://ext.dcloud.net.cn/plugin?name=z-paging-x) diff --git a/src/uni_modules/z-paging/types/comps/z-paging.d.ts b/src/uni_modules/z-paging/types/comps/z-paging.d.ts index eb9793c..642c57b 100644 --- a/src/uni_modules/z-paging/types/comps/z-paging.d.ts +++ b/src/uni_modules/z-paging/types/comps/z-paging.d.ts @@ -364,7 +364,7 @@ declare interface ZPagingProps { * 获取分页数据Function,功能与@query类似。若设置了fetch则@query将不再触发。 * @since 2.7.8 */ - fetch?: () => void + fetch?: (...args: any[]) => any; /** * fetch的附加参数,fetch配置后有效