From 7bfaef448ac12b36114fc1b16b2bf508afc243c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=89=E9=B2=AB=E9=9B=AA=E7=8B=90?= <139336664+ArcticFoxPro@users.noreply.github.com> Date: Fri, 16 Aug 2024 22:00:03 +0800 Subject: [PATCH] =?UTF-8?q?1.1.2=20=E6=9B=B4=E6=96=B0=E5=90=88=E5=85=A5=20?= =?UTF-8?q?(#7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * TD 上游更新,修复一处报错问题 * 新增自定义猜版后缀 * 一点细微更改 * 新增回顶按钮 * 修复微信猜版直链为空也认定猜版成功的Bug,猜版成功页新增文件大小显示,猜版成功页新增复制分享文案按钮 修复微信猜版直链为空也认定猜版成功的Bug,猜版成功页新增文件大小显示,猜版成功页新增可复制分享文案 --- source/app.json | 2 +- source/miniprogram_npm/dayjs/index.js | 4 +- .../cascader/README.en-US.md | 16 +- .../tdesign-miniprogram/cascader/README.md | 18 +- .../cascader/cascader.d.ts | 10 + .../tdesign-miniprogram/cascader/cascader.js | 49 +++ .../cascader/cascader.wxml | 2 + .../cascader/cascader.wxss | 34 +- .../cell-group/cell-group.js | 3 + .../tdesign-miniprogram/image/image.wxml | 4 +- .../tdesign-miniprogram/image/image.wxss | 8 + .../tdesign-miniprogram/input/README.en-US.md | 50 +-- .../tdesign-miniprogram/input/README.md | 54 +-- .../tdesign-miniprogram/input/input.wxss | 2 +- .../message-item/message-item.wxss | 2 +- .../tdesign-miniprogram/message/message.d.ts | 5 +- .../tdesign-miniprogram/message/message.js | 16 +- .../tdesign-miniprogram/message/message.wxml | 7 +- .../tdesign-miniprogram/navbar/navbar.wxss | 2 +- .../notice-bar/notice-bar.wxss | 3 + .../tdesign-miniprogram/popup/README.en-US.md | 3 +- .../tdesign-miniprogram/popup/README.md | 3 +- .../tdesign-miniprogram/popup/popup.wxss | 1 + .../pull-down-refresh/pull-down-refresh.d.ts | 8 +- .../pull-down-refresh/pull-down-refresh.js | 41 +- .../pull-down-refresh/pull-down-refresh.wxml | 6 +- .../pull-down-refresh/pull-down-refresh.wxss | 3 + .../tdesign-miniprogram/search/README.md | 28 +- .../tab-panel/tab-panel.wxml | 2 +- .../tdesign-miniprogram/tabs/tabs.d.ts | 1 + .../tdesign-miniprogram/tabs/tabs.js | 3 + .../tdesign-miniprogram/tabs/tabs.wxss | 28 +- source/node_modules/.yarn-integrity | 6 +- .../tdesign-miniprogram/CHANGELOG.md | 15 + .../miniprogram_dist/cascader/README.en-US.md | 16 +- .../miniprogram_dist/cascader/README.md | 18 +- .../miniprogram_dist/cascader/cascader.d.ts | 10 + .../miniprogram_dist/cascader/cascader.js | 49 +++ .../miniprogram_dist/cascader/cascader.wxml | 2 + .../miniprogram_dist/cascader/cascader.wxss | 34 +- .../miniprogram_dist/cell-group/cell-group.js | 3 + .../miniprogram_dist/image/image.wxml | 4 +- .../miniprogram_dist/image/image.wxss | 8 + .../miniprogram_dist/input/README.en-US.md | 50 +-- .../miniprogram_dist/input/README.md | 54 +-- .../miniprogram_dist/input/input.wxss | 2 +- .../message-item/message-item.wxss | 2 +- .../miniprogram_dist/message/message.d.ts | 5 +- .../miniprogram_dist/message/message.js | 16 +- .../miniprogram_dist/message/message.wxml | 7 +- .../miniprogram_dist/navbar/navbar.wxss | 2 +- .../notice-bar/notice-bar.wxss | 3 + .../miniprogram_dist/popup/README.en-US.md | 3 +- .../miniprogram_dist/popup/README.md | 3 +- .../miniprogram_dist/popup/popup.wxss | 1 + .../pull-down-refresh/pull-down-refresh.d.ts | 8 +- .../pull-down-refresh/pull-down-refresh.js | 41 +- .../pull-down-refresh/pull-down-refresh.wxml | 6 +- .../pull-down-refresh/pull-down-refresh.wxss | 3 + .../miniprogram_dist/search/README.md | 28 +- .../miniprogram_dist/tab-panel/tab-panel.wxml | 2 +- .../miniprogram_dist/tabs/tabs.d.ts | 1 + .../miniprogram_dist/tabs/tabs.js | 3 + .../miniprogram_dist/tabs/tabs.wxss | 28 +- .../tdesign-miniprogram/package.json | 2 +- source/package-lock.json | 26 ++ source/pages/index/index.js | 345 ++++++++++++++++- source/pages/index/index.json | 4 +- source/pages/index/index.wxml | 360 +++++++++++------- source/pages/index/index.wxss | 23 +- source/yarn.lock | 4 +- 71 files changed, 1168 insertions(+), 447 deletions(-) create mode 100644 source/package-lock.json diff --git a/source/app.json b/source/app.json index 4a9cc6d..377763c 100644 --- a/source/app.json +++ b/source/app.json @@ -7,7 +7,7 @@ "window": { "navigationStyle": "custom", "navigationBarTextStyle":"@navTxtStyle", - "navigationBarTitleText": "QQ Ver. Lite", + "navigationBarTitleText": "QQ 版本列表 Lite", "navigationBarBackgroundColor": "#F6F6F6", "backgroundColor": "#F6F6F6" }, diff --git a/source/miniprogram_npm/dayjs/index.js b/source/miniprogram_npm/dayjs/index.js index f368d58..54f41fd 100644 --- a/source/miniprogram_npm/dayjs/index.js +++ b/source/miniprogram_npm/dayjs/index.js @@ -4,10 +4,10 @@ var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexport var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; -__DEFINE__(1722257556078, function(require, module, exports) { +__DEFINE__(1723543565644, function(require, module, exports) { !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t); }; methods: { + updateOptionsHeight(steps: number): void; + initOptionsHeight(steps: number): Promise; initWithValue(): void; getIndexesByValue(options: import("../common/common").TreeOptionData[], value: any): any[]; updateScrollTop(): void; diff --git a/source/miniprogram_npm/tdesign-miniprogram/cascader/cascader.js b/source/miniprogram_npm/tdesign-miniprogram/cascader/cascader.js index 513b92d..1efa191 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/cascader/cascader.js +++ b/source/miniprogram_npm/tdesign-miniprogram/cascader/cascader.js @@ -30,6 +30,13 @@ function parseOptions(options, keys) { }; }); } +const defaultState = { + contentHeight: 0, + stepHeight: 0, + tabsHeight: 0, + subTitlesHeight: 0, + stepsInitHeight: 0, +}; let Cascader = class Cascader extends SuperComponent { constructor() { super(...arguments); @@ -45,6 +52,7 @@ let Cascader = class Cascader extends SuperComponent { event: 'change', }, ]; + this.state = Object.assign({}, defaultState); this.data = { prefix, name, @@ -53,15 +61,23 @@ let Cascader = class Cascader extends SuperComponent { selectedValue: [], scrollTopList: [], steps: [], + _optionsHeight: 0, }; this.observers = { visible(v) { if (v) { const $tabs = this.selectComponent('#tabs'); $tabs === null || $tabs === void 0 ? void 0 : $tabs.setTrack(); + $tabs === null || $tabs === void 0 ? void 0 : $tabs.getTabHeight().then((res) => { + this.state.tabsHeight = res.height; + }); + this.initOptionsHeight(this.data.steps.length); this.updateScrollTop(); this.initWithValue(); } + else { + this.state = Object.assign({}, defaultState); + } }, value() { this.initWithValue(); @@ -76,12 +92,16 @@ let Cascader = class Cascader extends SuperComponent { }); }, selectedIndexes() { + const { visible, theme } = this.properties; const { selectedValue, steps, items } = this.genItems(); this.setData({ steps, selectedValue, stepIndex: items.length - 1, }); + if (visible && theme === 'step') { + this.updateOptionsHeight(steps.length); + } }, stepIndex() { return __awaiter(this, void 0, void 0, function* () { @@ -93,6 +113,35 @@ let Cascader = class Cascader extends SuperComponent { }, }; this.methods = { + updateOptionsHeight(steps) { + const { contentHeight, stepsInitHeight, stepHeight, subTitlesHeight } = this.state; + this.setData({ + _optionsHeight: contentHeight - stepsInitHeight - subTitlesHeight - (steps - 1) * stepHeight, + }); + }, + initOptionsHeight(steps) { + return __awaiter(this, void 0, void 0, function* () { + const { theme, subTitles } = this.properties; + const { height } = yield getRect(this, `.${name}__content`); + this.state.contentHeight = height; + if (theme === 'step') { + yield Promise.all([getRect(this, `.${name}__steps`), getRect(this, `.${name}__step`)]).then(([stepsRect, stepRect]) => { + this.state.stepsInitHeight = stepsRect.height - (steps - 1) * stepRect.height; + this.state.stepHeight = stepRect.height; + }); + } + if (subTitles.length > 0) { + const { height } = yield getRect(this, `.${name}__options-title`); + this.state.subTitlesHeight = height; + } + const optionsInitHeight = this.state.contentHeight - this.state.subTitlesHeight; + this.setData({ + _optionsHeight: theme === 'step' + ? optionsInitHeight - this.state.stepsInitHeight - (steps - 1) * this.state.stepHeight + : optionsInitHeight - this.state.tabsHeight, + }); + }); + }, initWithValue() { if (this.data.value != null && this.data.value !== '') { const selectedIndexes = this.getIndexesByValue(this.data.options, this.data.value); diff --git a/source/miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxml b/source/miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxml index ce3b5cb..f106894 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxml +++ b/source/miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxml @@ -43,6 +43,8 @@ class="{{name}}__options" scroll-y scroll-top="{{scrollTopList[index]}}" + type="list" + style="height: {{_optionsHeight}}px" > + ## 引入 全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。 @@ -78,8 +79,8 @@ isComponent: true {{ custom }} - ## API + ### Input Props 名称 | 类型 | 默认值 | 说明 | 必传 @@ -141,8 +142,9 @@ nicknamereview | `(pass: boolean, timeout: boolean)`| 用户昵称审核完毕 click `v0.32.0`| `(trigger: InputTrigger)` | 点击事件。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts)。
`type InputTrigger = 'suffix' \| 'suffix-icon';`
### CellGroup 外部样式类 + 类名 | 说明 --- | -- +-- | -- t-class | 根节点样式类 t-class-prefix-icon | 前置图标样式类 t-class-label | 标题样式类 @@ -153,28 +155,30 @@ t-class-suffix-icon | 后置图标样式类 t-class-tips | 提示样式类 ### CSS 变量 + 组件提供了下列 CSS 变量,可用于自定义样式。 -名称 | 默认值 | 描述 +名称 | 默认值 | 描述 -- | -- | -- ---td-input-bg-color | @bg-color-container | - ---td-input-border-color | @component-stroke | - ---td-input-border-left-space | 32rpx | - ---td-input-border-radius | @radius-default | - ---td-input-border-right-space | 0 | - ---td-input-default-text-color | @font-gray-1 | - ---td-input-default-tips-color | @font-gray-3 | - ---td-input-disabled-text-color | @text-color-disabled | - ---td-input-error-text-color | @error-color | - ---td-input-error-tips-color | @error-color | - ---td-input-label-max-width | 5em | - ---td-input-label-min-width | 2em | - ---td-input-label-text-color | @font-gray-1 | - ---td-input-placeholder-text-color | @text-color-placeholder | - ---td-input-prefix-icon-color | @font-gray-1 | - ---td-input-success-text-color | @success-color | - ---td-input-success-tips-color | @success-color | - ---td-input-suffix-icon-color | @font-gray-3 | - ---td-input-suffix-text-color | @font-gray-1 | - ---td-input-vertical-padding | 32rpx | - ---td-input-warning-text-color | @warning-color | - ---td-input-warning-tips-color | @warning-color | - +--td-input-bg-color | @bg-color-container | - +--td-input-border-color | @component-stroke | - +--td-input-border-left-space | 32rpx | - +--td-input-border-radius | @radius-default | - +--td-input-border-right-space | 0 | - +--td-input-default-text-color | @font-gray-1 | - +--td-input-default-tips-color | @font-gray-3 | - +--td-input-disabled-text-color | @text-color-disabled | - +--td-input-error-text-color | @error-color | - +--td-input-error-tips-color | @error-color | - +--td-input-label-max-width | 5em | - +--td-input-label-min-width | 2em | - +--td-input-label-text-color | @font-gray-1 | - +--td-input-placeholder-text-color | @text-color-placeholder | - +--td-input-placeholder-text-font-size | @font-size-m | - +--td-input-prefix-icon-color | @font-gray-1 | - +--td-input-success-text-color | @success-color | - +--td-input-success-tips-color | @success-color | - +--td-input-suffix-icon-color | @font-gray-3 | - +--td-input-suffix-text-color | @font-gray-1 | - +--td-input-vertical-padding | 32rpx | - +--td-input-warning-text-color | @warning-color | - +--td-input-warning-tips-color | @warning-color | - diff --git a/source/miniprogram_npm/tdesign-miniprogram/input/input.wxss b/source/miniprogram_npm/tdesign-miniprogram/input/input.wxss index a5a8470..70fa8fa 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/input/input.wxss +++ b/source/miniprogram_npm/tdesign-miniprogram/input/input.wxss @@ -166,7 +166,7 @@ } .t-input__placeholder { color: var(--td-input-placeholder-text-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)))); - font-size: var(--td-font-size-m, 32rpx); + font-size: var(--td-input-placeholder-text-font-size, var(--td-font-size-m, 32rpx)); } .t-input__placeholder--disabled { color: var(--td-input-disabled-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)))); diff --git a/source/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxss b/source/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxss index 947eabe..2b0e579 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxss +++ b/source/miniprogram_npm/tdesign-miniprogram/message-item/message-item.wxss @@ -41,7 +41,7 @@ border-radius: var(--td-message-border-radius, var(--td-radius-default, 12rpx)); line-height: 1; background-color: var(--td-message-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); - box-shadow: var(--td-message-box-shadow, var(--td-shadow-4, 0 2px 8px 0 rgba(0, 0, 0, 0.06))); + box-shadow: var(--td-message-box-shadow, var(--td-shadow-1, 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12))); } .t-message__text { display: inline-block; diff --git a/source/miniprogram_npm/tdesign-miniprogram/message/message.d.ts b/source/miniprogram_npm/tdesign-miniprogram/message/message.d.ts index 556dcaf..e3de7ca 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/message/message.d.ts +++ b/source/miniprogram_npm/tdesign-miniprogram/message/message.d.ts @@ -12,7 +12,9 @@ export default class Message extends SuperComponent { index: number; instances: any[]; gap: number; - observers: {}; + observers: { + visible(value: any): void; + }; pageLifetimes: { show(): void; }; @@ -31,4 +33,5 @@ export default class Message extends SuperComponent { removeMsg(id: any): void; handleClose(): void; handleLinkClick(): void; + handleDurationEnd(): void; } diff --git a/source/miniprogram_npm/tdesign-miniprogram/message/message.js b/source/miniprogram_npm/tdesign-miniprogram/message/message.js index deb2323..b240baa 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/message/message.js +++ b/source/miniprogram_npm/tdesign-miniprogram/message/message.js @@ -27,7 +27,18 @@ let Message = class Message extends SuperComponent { this.index = 0; this.instances = []; this.gap = 12; - this.observers = {}; + this.observers = { + visible(value) { + if (value) { + this.setMessage(this.properties, this.properties.theme); + } + else { + this.setData({ + messageList: [], + }); + } + }, + }; this.pageLifetimes = { show() { this.hideAll(); @@ -153,6 +164,9 @@ let Message = class Message extends SuperComponent { handleLinkClick() { this.triggerEvent('link-click'); } + handleDurationEnd() { + this.triggerEvent('duration-end'); + } }; Message = __decorate([ wxComponent() diff --git a/source/miniprogram_npm/tdesign-miniprogram/message/message.wxml b/source/miniprogram_npm/tdesign-miniprogram/message/message.wxml index 90f6958..75b002c 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/message/message.wxml +++ b/source/miniprogram_npm/tdesign-miniprogram/message/message.wxml @@ -1,5 +1,10 @@ - + diff --git a/source/miniprogram_npm/tdesign-miniprogram/navbar/navbar.wxss b/source/miniprogram_npm/tdesign-miniprogram/navbar/navbar.wxss index 755906c..deda870 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/navbar/navbar.wxss +++ b/source/miniprogram_npm/tdesign-miniprogram/navbar/navbar.wxss @@ -60,7 +60,7 @@ padding-right: var(--td-navbar-right, 95px); padding-top: var(--td-navbar-padding-top, 20px); color: var(--td-navbar-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)))); - background: var(--td-navbar-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); + background-color: var(--td-navbar-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); display: flex; align-items: center; box-sizing: content-box; diff --git a/source/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.wxss b/source/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.wxss index e2f790b..0935ea1 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.wxss +++ b/source/miniprogram_npm/tdesign-miniprogram/notice-bar/notice-bar.wxss @@ -73,6 +73,9 @@ color: var(--td-notice-bar-operation-font-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); font-weight: 700; } +.t-notice-bar__operation:empty { + display: none; +} .t-notice-bar__suffix-icon:not(:empty) { padding-left: var(--td-spacer, 16rpx); } diff --git a/source/miniprogram_npm/tdesign-miniprogram/popup/README.en-US.md b/source/miniprogram_npm/tdesign-miniprogram/popup/README.en-US.md index 46ffa71..dc58ce2 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/popup/README.en-US.md +++ b/source/miniprogram_npm/tdesign-miniprogram/popup/README.en-US.md @@ -40,4 +40,5 @@ The component provides the following CSS variables, which can be used to customi Name | Default Value | Description -- | -- | -- --td-popup-bg-color | @bg-color-container | - ---td-popup-border-radius | @radius-default | - \ No newline at end of file +--td-popup-border-radius | @radius-default | - +--td-popup-close-btn-color | @text-color-primary | - diff --git a/source/miniprogram_npm/tdesign-miniprogram/popup/README.md b/source/miniprogram_npm/tdesign-miniprogram/popup/README.md index 774c318..2d943be 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/popup/README.md +++ b/source/miniprogram_npm/tdesign-miniprogram/popup/README.md @@ -79,4 +79,5 @@ t-class-content | 内容样式类 名称 | 默认值 | 描述 -- | -- | -- --td-popup-bg-color | @bg-color-container | - ---td-popup-border-radius | @radius-default | - \ No newline at end of file +--td-popup-border-radius | @radius-default | - +--td-popup-close-btn-color | @text-color-primary | - diff --git a/source/miniprogram_npm/tdesign-miniprogram/popup/popup.wxss b/source/miniprogram_npm/tdesign-miniprogram/popup/popup.wxss index 56423e5..a4be02c 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/popup/popup.wxss +++ b/source/miniprogram_npm/tdesign-miniprogram/popup/popup.wxss @@ -42,6 +42,7 @@ right: 0; padding: 20rpx; line-height: 1; + color: var(--td-popup-close-btn-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)))); } .t-popup--top { top: 0; diff --git a/source/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.d.ts b/source/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.d.ts index cfa1723..eb7a2e0 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.d.ts +++ b/source/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.d.ts @@ -6,12 +6,12 @@ export default class PullDownRefresh extends SuperComponent { pageY: number; } | null; isPulling: boolean; - loadingBarHeight: number; maxRefreshAnimateTimeFlag: number; closingAnimateTimeFlag: number; externalClasses: string[]; options: { multipleSlots: boolean; + pureDataPattern: RegExp; }; relations: RelationsOptions; properties: import("./type").TdPullDownRefreshProps; @@ -19,10 +19,13 @@ export default class PullDownRefresh extends SuperComponent { prefix: string; classPrefix: string; barHeight: number; + tipsHeight: number; refreshStatus: number; loosing: boolean; enableToRefresh: boolean; scrollTop: number; + _maxBarHeight: number; + _loadingBarHeight: number; }; lifetimes: { attached(): void; @@ -30,6 +33,9 @@ export default class PullDownRefresh extends SuperComponent { }; observers: { value(val: any): void; + barHeight(val: any): void; + maxBarHeight(v: any): void; + loadingBarHeight(v: any): void; }; methods: { onScrollToBottom(): void; diff --git a/source/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.js b/source/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.js index f0e169b..d0aeb8e 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.js +++ b/source/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.js @@ -16,12 +16,12 @@ let PullDownRefresh = class PullDownRefresh extends SuperComponent { this.pixelRatio = 1; this.startPoint = null; this.isPulling = false; - this.loadingBarHeight = 100; this.maxRefreshAnimateTimeFlag = 0; this.closingAnimateTimeFlag = 0; this.externalClasses = [`${prefix}-class`, `${prefix}-class-loading`, `${prefix}-class-text`, `${prefix}-class-indicator`]; this.options = { multipleSlots: true, + pureDataPattern: /^_/, }; this.relations = { '../back-top/back-top': { @@ -33,36 +33,26 @@ let PullDownRefresh = class PullDownRefresh extends SuperComponent { prefix, classPrefix: name, barHeight: 0, + tipsHeight: 0, refreshStatus: -1, loosing: false, enableToRefresh: true, scrollTop: 0, + _maxBarHeight: 0, + _loadingBarHeight: 0, }; this.lifetimes = { attached() { const { screenWidth } = wx.getSystemInfoSync(); - const { loadingBarHeight, loadingTexts } = this.properties; + const { loadingTexts, maxBarHeight, loadingBarHeight } = this.properties; this.setData({ + _maxBarHeight: unitConvert(maxBarHeight), + _loadingBarHeight: unitConvert(loadingBarHeight), loadingTexts: Array.isArray(loadingTexts) && loadingTexts.length >= 4 ? loadingTexts : ['下拉刷新', '松手刷新', '正在刷新', '刷新完成'], }); this.pixelRatio = 750 / screenWidth; - Object.defineProperty(this, 'maxBarHeight', { - get() { - return unitConvert(this.data.maxBarHeight); - }, - }); - Object.defineProperty(this, 'loadingBarHeight', { - get() { - return unitConvert(this.data.loadingBarHeight); - }, - }); - if (loadingBarHeight) { - this.setData({ - computedLoadingBarHeight: unitConvert(loadingBarHeight), - }); - } }, detached() { clearTimeout(this.maxRefreshAnimateTimeFlag); @@ -84,6 +74,15 @@ let PullDownRefresh = class PullDownRefresh extends SuperComponent { this.doRefresh(); } }, + barHeight(val) { + this.setData({ tipsHeight: Math.min(val, this.data._loadingBarHeight) }); + }, + maxBarHeight(v) { + this.setData({ _maxBarHeight: unitConvert(v) }); + }, + loadingBarHeight(v) { + this.setData({ _loadingBarHeight: unitConvert(v) }); + }, }; this.methods = { onScrollToBottom() { @@ -135,7 +134,7 @@ let PullDownRefresh = class PullDownRefresh extends SuperComponent { this.startPoint = null; this.isPulling = false; this.setData({ loosing: true }); - if (barHeight > this.loadingBarHeight) { + if (barHeight > this.data._loadingBarHeight) { this._trigger('change', { value: true }); this.triggerEvent('refresh'); } @@ -165,7 +164,7 @@ let PullDownRefresh = class PullDownRefresh extends SuperComponent { if (this.properties.disabled) return; this.setData({ - barHeight: this.loadingBarHeight, + barHeight: this.data._loadingBarHeight, refreshStatus: 2, loosing: true, }); @@ -178,9 +177,9 @@ let PullDownRefresh = class PullDownRefresh extends SuperComponent { }, this.properties.refreshTimeout); }, setRefreshBarHeight(value) { - const barHeight = Math.min(value, this.maxBarHeight); + const barHeight = Math.min(value, this.data._maxBarHeight); const data = { barHeight }; - if (barHeight >= this.loadingBarHeight) { + if (barHeight >= this.data._loadingBarHeight) { data.refreshStatus = 1; } else { diff --git a/source/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.wxml b/source/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.wxml index d08d4a4..5bfa68f 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.wxml +++ b/source/miniprogram_npm/tdesign-miniprogram/pull-down-refresh/pull-down-refresh.wxml @@ -32,7 +32,11 @@ class="{{classPrefix}}__track {{classPrefix + '__track--' + (loosing ? 'loosing' : '')}}" style="{{barHeight > 0 ? 'transform: translate3d(0, ' + barHeight + 'px, 0);' : ''}}" > - + + ## 引入 全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。 @@ -67,7 +68,7 @@ disabled | Boolean | false | 是否禁用 | N focus | Boolean | false | 是否聚焦 | N hold-keyboard | Boolean | false | focus时,点击页面的时候不收起键盘 | N label | String | '' | 已废弃。左侧文本 | N -left-icon | String / Slot | 'search' | 左侧图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N +left-icon | String / Slot | 'search' | 左侧图标。如果需要使用 `Slot` 进行自定义,必须将该值设置为假值。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 | N maxlength | Number | -1 | 用户最多可以输入的文本长度,一个中文等于一个计数长度。默认为 -1,不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用 | N placeholder | String | '' | 占位符 | N @@ -91,6 +92,7 @@ change | `({ value: string })` | 值发生变化时触发 clear | `({ value: string })` | 点击清除时触发 focus | `({ value: string })` | 聚焦时触发 submit | `({ value: string })` | 提交时触发 + ### Search External Classes 类名 | 描述 @@ -105,17 +107,17 @@ t-class-left | 左侧图标样式类 ### CSS Variables 组件提供了下列 CSS 变量,可用于自定义样式。 -名称 | 默认值 | 描述 +名称 | 默认值 | 描述 -- | -- | -- ---td-search-action-color | @brand-color | - ---td-search-bg-color | @bg-color-secondarycontainer | - ---td-search-clear-icon-color | @font-gray-3 | - ---td-search-font-size | @font-size-m | - ---td-search-height | 80rpx | - ---td-search-icon-color | @font-gray-3 | - ---td-search-label-color | @font-gray-1 | - ---td-search-padding | 16rpx 24rpx | - ---td-search-placeholder-color | @font-gray-3 | - +--td-search-action-color | @brand-color | - +--td-search-bg-color | @bg-color-secondarycontainer | - +--td-search-clear-icon-color | @font-gray-3 | - +--td-search-font-size | @font-size-m | - +--td-search-height | 80rpx | - +--td-search-icon-color | @font-gray-3 | - +--td-search-label-color | @font-gray-1 | - +--td-search-padding | 16rpx 24rpx | - +--td-search-placeholder-color | @font-gray-3 | - --td-search-result-high-light-color | @brand-color | - ---td-search-square-radius | @radius-default | - ---td-search-text-color | @font-gray-1 | - \ No newline at end of file +--td-search-square-radius | @radius-default | - +--td-search-text-color | @font-gray-1 | - diff --git a/source/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxml b/source/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxml index a62e20e..7bcb902 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxml +++ b/source/miniprogram_npm/tdesign-miniprogram/tab-panel/tab-panel.wxml @@ -2,7 +2,7 @@ diff --git a/source/miniprogram_npm/tdesign-miniprogram/tabs/tabs.d.ts b/source/miniprogram_npm/tdesign-miniprogram/tabs/tabs.d.ts index 8225136..1efdbf6 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/tabs/tabs.d.ts +++ b/source/miniprogram_npm/tdesign-miniprogram/tabs/tabs.d.ts @@ -41,6 +41,7 @@ export default class Tabs extends SuperComponent { setCurrentIndex(index: number): void; getCurrentName(): any; calcScrollOffset(containerWidth: number, targetLeft: number, targetWidth: number, offset: number): number; + getTabHeight(): Promise; getTrackSize(): Promise; setTrack(): Promise; onTabTap(event: any): void; diff --git a/source/miniprogram_npm/tdesign-miniprogram/tabs/tabs.js b/source/miniprogram_npm/tdesign-miniprogram/tabs/tabs.js index 6008b1b..232d87f 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/tabs/tabs.js +++ b/source/miniprogram_npm/tdesign-miniprogram/tabs/tabs.js @@ -150,6 +150,9 @@ let Tabs = class Tabs extends SuperComponent { calcScrollOffset(containerWidth, targetLeft, targetWidth, offset) { return offset + targetLeft - (1 / 2) * containerWidth + targetWidth / 2; }, + getTabHeight() { + return getRect(this, `.${name}`); + }, getTrackSize() { return new Promise((resolve, reject) => { if (this.trackWidth) { diff --git a/source/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxss b/source/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxss index 233dea6..7dc3352 100644 --- a/source/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxss +++ b/source/miniprogram_npm/tdesign-miniprogram/tabs/tabs.wxss @@ -48,7 +48,7 @@ justify-content: center; font-weight: 400; color: var(--td-tab-item-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)))); - padding: 0 32rpx; + padding: 0 var(--td-spacer-2, 32rpx); box-sizing: border-box; white-space: nowrap; overflow: hidden; @@ -72,7 +72,7 @@ .t-tabs__item-inner--tag { width: 100%; text-align: center; - padding: 0 32rpx; + padding: 0 var(--td-spacer-2, 32rpx); line-height: var(--td-tab-item-tag-height, 64rpx); border-radius: calc(var(--td-tab-item-tag-height, 64rpx) / 2); background-color: var(--td-tab-item-tag-bg, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3))); @@ -81,20 +81,20 @@ background-color: var(--td-tab-item-tag-active-bg, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff))); } .t-tabs__item--tag:not(.t-tabs__item--evenly) { - padding: 0 8rpx; + padding: 0 calc(var(--td-spacer, 16rpx) / 2); } .t-tabs__item--tag:not(.t-tabs__item--evenly):first-child { - margin-left: 16rpx; + margin-left: var(--td-spacer, 16rpx); } .t-tabs__item--tag:not(.t-tabs__item--evenly):last-child { - padding-right: 24rpx; + padding-right: var(--td-spacer-1, 24rpx); } .t-tabs__item--tag { - padding: 0 16rpx; + padding: 0 var(--td-spacer, 16rpx); } .t-tabs__item--card.t-tabs__item--active { background-color: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); - border-radius: 18rpx 18rpx 0 0; + border-radius: var(--td-radius-large, 18rpx) var(--td-radius-large, 18rpx) 0 0; } .t-tabs__item--card.t-tabs__item--active:first-child { border-top-left-radius: 0; @@ -103,15 +103,15 @@ border-top-right-radius: 0; } .t-tabs__item--card.t-tabs__item--pre { - border-bottom-right-radius: 18rpx; + border-bottom-right-radius: var(--td-radius-large, 18rpx); } .t-tabs__item-prefix, .t-tabs__item-suffix { position: absolute; bottom: 0; - width: 36rpx; - height: 36rpx; - background: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); + width: 18rpx; + height: 18rpx; + background-color: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); } .t-tabs__item-prefix::after, .t-tabs__item-suffix::after { @@ -125,17 +125,17 @@ right: 0; } .t-tabs__item-prefix::after { - border-bottom-right-radius: 18rpx; + border-bottom-right-radius: var(--td-radius-large, 18rpx); } .t-tabs__item-suffix { left: 0; } .t-tabs__item-suffix::after { - border-bottom-left-radius: 18rpx; + border-bottom-left-radius: var(--td-radius-large, 18rpx); } .t-tabs__icon { font-size: var(--td-tab-icon-size, 36rpx); - margin-right: 4rpx; + margin-right: calc(var(--td-spacer, 16rpx) / 4); } .t-tabs__content { overflow: hidden; diff --git a/source/node_modules/.yarn-integrity b/source/node_modules/.yarn-integrity index 110bba7..e52d534 100644 --- a/source/node_modules/.yarn-integrity +++ b/source/node_modules/.yarn-integrity @@ -6,11 +6,11 @@ "flags": [], "linkedModules": [], "topLevelPatterns": [ - "tdesign-miniprogram@^1.5.0" + "tdesign-miniprogram@^1.5.1" ], "lockfileEntries": { - "dayjs@^1.10.7": "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.12.tgz#5245226cc7f40a15bf52e0b99fd2a04669ccac1d", - "tdesign-miniprogram@^1.5.0": "https://registry.yarnpkg.com/tdesign-miniprogram/-/tdesign-miniprogram-1.5.0.tgz#2523de22775d42e838616cb2b22ca86fe41f0eb1" + "dayjs@^1.10.7": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.12.tgz", + "tdesign-miniprogram@^1.5.1": "https://registry.npmjs.org/tdesign-miniprogram/-/tdesign-miniprogram-1.5.1.tgz" }, "files": [], "artifacts": {} diff --git a/source/node_modules/tdesign-miniprogram/CHANGELOG.md b/source/node_modules/tdesign-miniprogram/CHANGELOG.md index 0acde1e..9f15bcb 100644 --- a/source/node_modules/tdesign-miniprogram/CHANGELOG.md +++ b/source/node_modules/tdesign-miniprogram/CHANGELOG.md @@ -6,6 +6,21 @@ docClass: timeline --- +## 🌈 1.5.1 `2024-08-09` +### 🚀 Features +- `Input`: 新增 `--td-input-placeholder-text-font-size` 变量 @betavs ([#3018](https://github.com/Tencent/tdesign-miniprogram/pull/3018)) +- `Popup`: 新增 `--td-popup-close-btn-color` @anlyyao ([#3035](https://github.com/Tencent/tdesign-miniprogram/pull/3035)) +- `Message`: 支持组件通过 `visible` 属性调用 @novlan1 ([#3058](https://github.com/Tencent/tdesign-miniprogram/pull/3058)) +### 🐞 Bug Fixes +- `NoticeBar`: 修复 `content` 插槽内容的底边距异常 @anlyyao ([#3025](https://github.com/Tencent/tdesign-miniprogram/pull/3025)) +- `Cascader`: 修复组件高度设置错误,交互有调整 @anlyyao ([#3027](https://github.com/Tencent/tdesign-miniprogram/pull/3027)) +- `Image`: 修复懒加载无效的问题 @huxinhai ([#3036](https://github.com/Tencent/tdesign-miniprogram/pull/3036)) +- `Message`: 修复 `duration-end` 事件未回调 @jarmywang ([#3051](https://github.com/Tencent/tdesign-miniprogram/pull/3051)) +- `Tabs`: 修复 `card` 主题下`label` 显示不全 @anlyyao ([#3059](https://github.com/Tencent/tdesign-miniprogram/pull/3059)) +- `Tabs`: 修复 `TabPanel`面板内容快速滚动时,点击tab切换出现偶发性页面空白 @hkaikai ([#3055](https://github.com/Tencent/tdesign-miniprogram/pull/3055)) +- `PullDownRefresh`: 修复 `skyline` 下提示语占位高度计算错误 @richardji202 ([#3014](https://github.com/Tencent/tdesign-miniprogram/pull/3014)) + + ## 🌈 1.5.0 `2024-07-26` ### 🚀 Features - `Guide`: 新增`Guide`组件 @hkaikai ([#2998](https://github.com/Tencent/tdesign-miniprogram/pull/2998)) ⚡ diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/README.en-US.md b/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/README.en-US.md index 9b31dc4..2382bd0 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/README.en-US.md +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/README.en-US.md @@ -30,12 +30,16 @@ The component provides the following CSS variables, which can be used to customi Name | Default Value | Description -- | -- | -- --td-cascader-active-color | @brand-color | - ---td-cascader-border-color | @border-color | - ---td-cascader-disabled-color | @font-gray-4 | - ---td-cascader-options-height | 640rpx | - ---td-cascader-options-title-color | @font-gray-3 | - ---td-cascader-step-arrow-color | @font-gray-3 | - +--td-cascader-bg-color | @bg-color-container | - +--td-cascader-border-color | @component-stroke | - +--td-cascader-content-height | 78vh | - +--td-cascader-disabled-color | @text-color-disabled | - +--td-cascader-options-height | calc(100% - @cascader-step-height) | - +--td-cascader-options-title-color | @text-color-placeholder | - +--td-cascader-step-arrow-color | @text-color-placeholder | - --td-cascader-step-dot-size | 16rpx | - --td-cascader-step-height | 88rpx | - ---td-cascader-title-color | @font-gray-1 | - +--td-cascader-title-color | @text-color-primary | - +--td-cascader-title-height | 26rpx | - +--td-cascader-title-padding | @spacer-2 | - --td-cascder-title-font-size | 36rpx | - diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/README.md b/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/README.md index 52e0a05..b277c16 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/README.md +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/README.md @@ -77,17 +77,21 @@ close | `(trigger: TriggerSource)` | `1.0.1`。关闭时触发。[详细类型 pick | `(value: string \| number, index: number)` | `1.0.1`。选择后触发 -### CSS 变量 +### CSS Variables 组件提供了下列 CSS 变量,可用于自定义样式。 名称 | 默认值 | 描述 -- | -- | -- --td-cascader-active-color | @brand-color | - ---td-cascader-border-color | @border-color | - ---td-cascader-disabled-color | @font-gray-4 | - ---td-cascader-options-height | 640rpx | - ---td-cascader-options-title-color | @font-gray-3 | - ---td-cascader-step-arrow-color | @font-gray-3 | - +--td-cascader-bg-color | @bg-color-container | - +--td-cascader-border-color | @component-stroke | - +--td-cascader-content-height | 78vh | - +--td-cascader-disabled-color | @text-color-disabled | - +--td-cascader-options-height | calc(100% - @cascader-step-height) | - +--td-cascader-options-title-color | @text-color-placeholder | - +--td-cascader-step-arrow-color | @text-color-placeholder | - --td-cascader-step-dot-size | 16rpx | - --td-cascader-step-height | 88rpx | - ---td-cascader-title-color | @font-gray-1 | - +--td-cascader-title-color | @text-color-primary | - +--td-cascader-title-height | 26rpx | - +--td-cascader-title-padding | @spacer-2 | - --td-cascder-title-font-size | 36rpx | - diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/cascader.d.ts b/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/cascader.d.ts index 439fd4b..a7de69e 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/cascader.d.ts +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/cascader.d.ts @@ -11,6 +11,13 @@ export default class Cascader extends SuperComponent { key: string; event: string; }[]; + state: { + contentHeight: number; + stepHeight: number; + tabsHeight: number; + subTitlesHeight: number; + stepsInitHeight: number; + }; data: { prefix: string; name: string; @@ -19,6 +26,7 @@ export default class Cascader extends SuperComponent { selectedValue: any[]; scrollTopList: any[]; steps: any[]; + _optionsHeight: number; }; observers: { visible(v: any): void; @@ -28,6 +36,8 @@ export default class Cascader extends SuperComponent { stepIndex(): Promise; }; methods: { + updateOptionsHeight(steps: number): void; + initOptionsHeight(steps: number): Promise; initWithValue(): void; getIndexesByValue(options: import("../common/common").TreeOptionData[], value: any): any[]; updateScrollTop(): void; diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/cascader.js b/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/cascader.js index 513b92d..1efa191 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/cascader.js +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/cascader.js @@ -30,6 +30,13 @@ function parseOptions(options, keys) { }; }); } +const defaultState = { + contentHeight: 0, + stepHeight: 0, + tabsHeight: 0, + subTitlesHeight: 0, + stepsInitHeight: 0, +}; let Cascader = class Cascader extends SuperComponent { constructor() { super(...arguments); @@ -45,6 +52,7 @@ let Cascader = class Cascader extends SuperComponent { event: 'change', }, ]; + this.state = Object.assign({}, defaultState); this.data = { prefix, name, @@ -53,15 +61,23 @@ let Cascader = class Cascader extends SuperComponent { selectedValue: [], scrollTopList: [], steps: [], + _optionsHeight: 0, }; this.observers = { visible(v) { if (v) { const $tabs = this.selectComponent('#tabs'); $tabs === null || $tabs === void 0 ? void 0 : $tabs.setTrack(); + $tabs === null || $tabs === void 0 ? void 0 : $tabs.getTabHeight().then((res) => { + this.state.tabsHeight = res.height; + }); + this.initOptionsHeight(this.data.steps.length); this.updateScrollTop(); this.initWithValue(); } + else { + this.state = Object.assign({}, defaultState); + } }, value() { this.initWithValue(); @@ -76,12 +92,16 @@ let Cascader = class Cascader extends SuperComponent { }); }, selectedIndexes() { + const { visible, theme } = this.properties; const { selectedValue, steps, items } = this.genItems(); this.setData({ steps, selectedValue, stepIndex: items.length - 1, }); + if (visible && theme === 'step') { + this.updateOptionsHeight(steps.length); + } }, stepIndex() { return __awaiter(this, void 0, void 0, function* () { @@ -93,6 +113,35 @@ let Cascader = class Cascader extends SuperComponent { }, }; this.methods = { + updateOptionsHeight(steps) { + const { contentHeight, stepsInitHeight, stepHeight, subTitlesHeight } = this.state; + this.setData({ + _optionsHeight: contentHeight - stepsInitHeight - subTitlesHeight - (steps - 1) * stepHeight, + }); + }, + initOptionsHeight(steps) { + return __awaiter(this, void 0, void 0, function* () { + const { theme, subTitles } = this.properties; + const { height } = yield getRect(this, `.${name}__content`); + this.state.contentHeight = height; + if (theme === 'step') { + yield Promise.all([getRect(this, `.${name}__steps`), getRect(this, `.${name}__step`)]).then(([stepsRect, stepRect]) => { + this.state.stepsInitHeight = stepsRect.height - (steps - 1) * stepRect.height; + this.state.stepHeight = stepRect.height; + }); + } + if (subTitles.length > 0) { + const { height } = yield getRect(this, `.${name}__options-title`); + this.state.subTitlesHeight = height; + } + const optionsInitHeight = this.state.contentHeight - this.state.subTitlesHeight; + this.setData({ + _optionsHeight: theme === 'step' + ? optionsInitHeight - this.state.stepsInitHeight - (steps - 1) * this.state.stepHeight + : optionsInitHeight - this.state.tabsHeight, + }); + }); + }, initWithValue() { if (this.data.value != null && this.data.value !== '') { const selectedIndexes = this.getIndexesByValue(this.data.options, this.data.value); diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/cascader.wxml b/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/cascader.wxml index ce3b5cb..f106894 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/cascader.wxml +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/cascader/cascader.wxml @@ -43,6 +43,8 @@ class="{{name}}__options" scroll-y scroll-top="{{scrollTopList[index]}}" + type="list" + style="height: {{_optionsHeight}}px" > + ## 引入 全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。 @@ -78,8 +79,8 @@ isComponent: true {{ custom }} - ## API + ### Input Props 名称 | 类型 | 默认值 | 说明 | 必传 @@ -141,8 +142,9 @@ nicknamereview | `(pass: boolean, timeout: boolean)`| 用户昵称审核完毕 click `v0.32.0`| `(trigger: InputTrigger)` | 点击事件。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts)。
`type InputTrigger = 'suffix' \| 'suffix-icon';`
### CellGroup 外部样式类 + 类名 | 说明 --- | -- +-- | -- t-class | 根节点样式类 t-class-prefix-icon | 前置图标样式类 t-class-label | 标题样式类 @@ -153,28 +155,30 @@ t-class-suffix-icon | 后置图标样式类 t-class-tips | 提示样式类 ### CSS 变量 + 组件提供了下列 CSS 变量,可用于自定义样式。 -名称 | 默认值 | 描述 +名称 | 默认值 | 描述 -- | -- | -- ---td-input-bg-color | @bg-color-container | - ---td-input-border-color | @component-stroke | - ---td-input-border-left-space | 32rpx | - ---td-input-border-radius | @radius-default | - ---td-input-border-right-space | 0 | - ---td-input-default-text-color | @font-gray-1 | - ---td-input-default-tips-color | @font-gray-3 | - ---td-input-disabled-text-color | @text-color-disabled | - ---td-input-error-text-color | @error-color | - ---td-input-error-tips-color | @error-color | - ---td-input-label-max-width | 5em | - ---td-input-label-min-width | 2em | - ---td-input-label-text-color | @font-gray-1 | - ---td-input-placeholder-text-color | @text-color-placeholder | - ---td-input-prefix-icon-color | @font-gray-1 | - ---td-input-success-text-color | @success-color | - ---td-input-success-tips-color | @success-color | - ---td-input-suffix-icon-color | @font-gray-3 | - ---td-input-suffix-text-color | @font-gray-1 | - ---td-input-vertical-padding | 32rpx | - ---td-input-warning-text-color | @warning-color | - ---td-input-warning-tips-color | @warning-color | - +--td-input-bg-color | @bg-color-container | - +--td-input-border-color | @component-stroke | - +--td-input-border-left-space | 32rpx | - +--td-input-border-radius | @radius-default | - +--td-input-border-right-space | 0 | - +--td-input-default-text-color | @font-gray-1 | - +--td-input-default-tips-color | @font-gray-3 | - +--td-input-disabled-text-color | @text-color-disabled | - +--td-input-error-text-color | @error-color | - +--td-input-error-tips-color | @error-color | - +--td-input-label-max-width | 5em | - +--td-input-label-min-width | 2em | - +--td-input-label-text-color | @font-gray-1 | - +--td-input-placeholder-text-color | @text-color-placeholder | - +--td-input-placeholder-text-font-size | @font-size-m | - +--td-input-prefix-icon-color | @font-gray-1 | - +--td-input-success-text-color | @success-color | - +--td-input-success-tips-color | @success-color | - +--td-input-suffix-icon-color | @font-gray-3 | - +--td-input-suffix-text-color | @font-gray-1 | - +--td-input-vertical-padding | 32rpx | - +--td-input-warning-text-color | @warning-color | - +--td-input-warning-tips-color | @warning-color | - diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/input/input.wxss b/source/node_modules/tdesign-miniprogram/miniprogram_dist/input/input.wxss index a5a8470..70fa8fa 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/input/input.wxss +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/input/input.wxss @@ -166,7 +166,7 @@ } .t-input__placeholder { color: var(--td-input-placeholder-text-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)))); - font-size: var(--td-font-size-m, 32rpx); + font-size: var(--td-input-placeholder-text-font-size, var(--td-font-size-m, 32rpx)); } .t-input__placeholder--disabled { color: var(--td-input-disabled-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)))); diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/message-item/message-item.wxss b/source/node_modules/tdesign-miniprogram/miniprogram_dist/message-item/message-item.wxss index 947eabe..2b0e579 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/message-item/message-item.wxss +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/message-item/message-item.wxss @@ -41,7 +41,7 @@ border-radius: var(--td-message-border-radius, var(--td-radius-default, 12rpx)); line-height: 1; background-color: var(--td-message-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); - box-shadow: var(--td-message-box-shadow, var(--td-shadow-4, 0 2px 8px 0 rgba(0, 0, 0, 0.06))); + box-shadow: var(--td-message-box-shadow, var(--td-shadow-1, 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12))); } .t-message__text { display: inline-block; diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/message/message.d.ts b/source/node_modules/tdesign-miniprogram/miniprogram_dist/message/message.d.ts index 556dcaf..e3de7ca 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/message/message.d.ts +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/message/message.d.ts @@ -12,7 +12,9 @@ export default class Message extends SuperComponent { index: number; instances: any[]; gap: number; - observers: {}; + observers: { + visible(value: any): void; + }; pageLifetimes: { show(): void; }; @@ -31,4 +33,5 @@ export default class Message extends SuperComponent { removeMsg(id: any): void; handleClose(): void; handleLinkClick(): void; + handleDurationEnd(): void; } diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/message/message.js b/source/node_modules/tdesign-miniprogram/miniprogram_dist/message/message.js index deb2323..b240baa 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/message/message.js +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/message/message.js @@ -27,7 +27,18 @@ let Message = class Message extends SuperComponent { this.index = 0; this.instances = []; this.gap = 12; - this.observers = {}; + this.observers = { + visible(value) { + if (value) { + this.setMessage(this.properties, this.properties.theme); + } + else { + this.setData({ + messageList: [], + }); + } + }, + }; this.pageLifetimes = { show() { this.hideAll(); @@ -153,6 +164,9 @@ let Message = class Message extends SuperComponent { handleLinkClick() { this.triggerEvent('link-click'); } + handleDurationEnd() { + this.triggerEvent('duration-end'); + } }; Message = __decorate([ wxComponent() diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/message/message.wxml b/source/node_modules/tdesign-miniprogram/miniprogram_dist/message/message.wxml index 90f6958..75b002c 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/message/message.wxml +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/message/message.wxml @@ -1,5 +1,10 @@ - + diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/navbar/navbar.wxss b/source/node_modules/tdesign-miniprogram/miniprogram_dist/navbar/navbar.wxss index 755906c..deda870 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/navbar/navbar.wxss +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/navbar/navbar.wxss @@ -60,7 +60,7 @@ padding-right: var(--td-navbar-right, 95px); padding-top: var(--td-navbar-padding-top, 20px); color: var(--td-navbar-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)))); - background: var(--td-navbar-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); + background-color: var(--td-navbar-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); display: flex; align-items: center; box-sizing: content-box; diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/notice-bar/notice-bar.wxss b/source/node_modules/tdesign-miniprogram/miniprogram_dist/notice-bar/notice-bar.wxss index e2f790b..0935ea1 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/notice-bar/notice-bar.wxss +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/notice-bar/notice-bar.wxss @@ -73,6 +73,9 @@ color: var(--td-notice-bar-operation-font-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); font-weight: 700; } +.t-notice-bar__operation:empty { + display: none; +} .t-notice-bar__suffix-icon:not(:empty) { padding-left: var(--td-spacer, 16rpx); } diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/popup/README.en-US.md b/source/node_modules/tdesign-miniprogram/miniprogram_dist/popup/README.en-US.md index 46ffa71..dc58ce2 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/popup/README.en-US.md +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/popup/README.en-US.md @@ -40,4 +40,5 @@ The component provides the following CSS variables, which can be used to customi Name | Default Value | Description -- | -- | -- --td-popup-bg-color | @bg-color-container | - ---td-popup-border-radius | @radius-default | - \ No newline at end of file +--td-popup-border-radius | @radius-default | - +--td-popup-close-btn-color | @text-color-primary | - diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/popup/README.md b/source/node_modules/tdesign-miniprogram/miniprogram_dist/popup/README.md index 774c318..2d943be 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/popup/README.md +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/popup/README.md @@ -79,4 +79,5 @@ t-class-content | 内容样式类 名称 | 默认值 | 描述 -- | -- | -- --td-popup-bg-color | @bg-color-container | - ---td-popup-border-radius | @radius-default | - \ No newline at end of file +--td-popup-border-radius | @radius-default | - +--td-popup-close-btn-color | @text-color-primary | - diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/popup/popup.wxss b/source/node_modules/tdesign-miniprogram/miniprogram_dist/popup/popup.wxss index 56423e5..a4be02c 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/popup/popup.wxss +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/popup/popup.wxss @@ -42,6 +42,7 @@ right: 0; padding: 20rpx; line-height: 1; + color: var(--td-popup-close-btn-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)))); } .t-popup--top { top: 0; diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/pull-down-refresh/pull-down-refresh.d.ts b/source/node_modules/tdesign-miniprogram/miniprogram_dist/pull-down-refresh/pull-down-refresh.d.ts index cfa1723..eb7a2e0 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/pull-down-refresh/pull-down-refresh.d.ts +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/pull-down-refresh/pull-down-refresh.d.ts @@ -6,12 +6,12 @@ export default class PullDownRefresh extends SuperComponent { pageY: number; } | null; isPulling: boolean; - loadingBarHeight: number; maxRefreshAnimateTimeFlag: number; closingAnimateTimeFlag: number; externalClasses: string[]; options: { multipleSlots: boolean; + pureDataPattern: RegExp; }; relations: RelationsOptions; properties: import("./type").TdPullDownRefreshProps; @@ -19,10 +19,13 @@ export default class PullDownRefresh extends SuperComponent { prefix: string; classPrefix: string; barHeight: number; + tipsHeight: number; refreshStatus: number; loosing: boolean; enableToRefresh: boolean; scrollTop: number; + _maxBarHeight: number; + _loadingBarHeight: number; }; lifetimes: { attached(): void; @@ -30,6 +33,9 @@ export default class PullDownRefresh extends SuperComponent { }; observers: { value(val: any): void; + barHeight(val: any): void; + maxBarHeight(v: any): void; + loadingBarHeight(v: any): void; }; methods: { onScrollToBottom(): void; diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/pull-down-refresh/pull-down-refresh.js b/source/node_modules/tdesign-miniprogram/miniprogram_dist/pull-down-refresh/pull-down-refresh.js index f0e169b..d0aeb8e 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/pull-down-refresh/pull-down-refresh.js +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/pull-down-refresh/pull-down-refresh.js @@ -16,12 +16,12 @@ let PullDownRefresh = class PullDownRefresh extends SuperComponent { this.pixelRatio = 1; this.startPoint = null; this.isPulling = false; - this.loadingBarHeight = 100; this.maxRefreshAnimateTimeFlag = 0; this.closingAnimateTimeFlag = 0; this.externalClasses = [`${prefix}-class`, `${prefix}-class-loading`, `${prefix}-class-text`, `${prefix}-class-indicator`]; this.options = { multipleSlots: true, + pureDataPattern: /^_/, }; this.relations = { '../back-top/back-top': { @@ -33,36 +33,26 @@ let PullDownRefresh = class PullDownRefresh extends SuperComponent { prefix, classPrefix: name, barHeight: 0, + tipsHeight: 0, refreshStatus: -1, loosing: false, enableToRefresh: true, scrollTop: 0, + _maxBarHeight: 0, + _loadingBarHeight: 0, }; this.lifetimes = { attached() { const { screenWidth } = wx.getSystemInfoSync(); - const { loadingBarHeight, loadingTexts } = this.properties; + const { loadingTexts, maxBarHeight, loadingBarHeight } = this.properties; this.setData({ + _maxBarHeight: unitConvert(maxBarHeight), + _loadingBarHeight: unitConvert(loadingBarHeight), loadingTexts: Array.isArray(loadingTexts) && loadingTexts.length >= 4 ? loadingTexts : ['下拉刷新', '松手刷新', '正在刷新', '刷新完成'], }); this.pixelRatio = 750 / screenWidth; - Object.defineProperty(this, 'maxBarHeight', { - get() { - return unitConvert(this.data.maxBarHeight); - }, - }); - Object.defineProperty(this, 'loadingBarHeight', { - get() { - return unitConvert(this.data.loadingBarHeight); - }, - }); - if (loadingBarHeight) { - this.setData({ - computedLoadingBarHeight: unitConvert(loadingBarHeight), - }); - } }, detached() { clearTimeout(this.maxRefreshAnimateTimeFlag); @@ -84,6 +74,15 @@ let PullDownRefresh = class PullDownRefresh extends SuperComponent { this.doRefresh(); } }, + barHeight(val) { + this.setData({ tipsHeight: Math.min(val, this.data._loadingBarHeight) }); + }, + maxBarHeight(v) { + this.setData({ _maxBarHeight: unitConvert(v) }); + }, + loadingBarHeight(v) { + this.setData({ _loadingBarHeight: unitConvert(v) }); + }, }; this.methods = { onScrollToBottom() { @@ -135,7 +134,7 @@ let PullDownRefresh = class PullDownRefresh extends SuperComponent { this.startPoint = null; this.isPulling = false; this.setData({ loosing: true }); - if (barHeight > this.loadingBarHeight) { + if (barHeight > this.data._loadingBarHeight) { this._trigger('change', { value: true }); this.triggerEvent('refresh'); } @@ -165,7 +164,7 @@ let PullDownRefresh = class PullDownRefresh extends SuperComponent { if (this.properties.disabled) return; this.setData({ - barHeight: this.loadingBarHeight, + barHeight: this.data._loadingBarHeight, refreshStatus: 2, loosing: true, }); @@ -178,9 +177,9 @@ let PullDownRefresh = class PullDownRefresh extends SuperComponent { }, this.properties.refreshTimeout); }, setRefreshBarHeight(value) { - const barHeight = Math.min(value, this.maxBarHeight); + const barHeight = Math.min(value, this.data._maxBarHeight); const data = { barHeight }; - if (barHeight >= this.loadingBarHeight) { + if (barHeight >= this.data._loadingBarHeight) { data.refreshStatus = 1; } else { diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/pull-down-refresh/pull-down-refresh.wxml b/source/node_modules/tdesign-miniprogram/miniprogram_dist/pull-down-refresh/pull-down-refresh.wxml index d08d4a4..5bfa68f 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/pull-down-refresh/pull-down-refresh.wxml +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/pull-down-refresh/pull-down-refresh.wxml @@ -32,7 +32,11 @@ class="{{classPrefix}}__track {{classPrefix + '__track--' + (loosing ? 'loosing' : '')}}" style="{{barHeight > 0 ? 'transform: translate3d(0, ' + barHeight + 'px, 0);' : ''}}" > - + + ## 引入 全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。 @@ -67,7 +68,7 @@ disabled | Boolean | false | 是否禁用 | N focus | Boolean | false | 是否聚焦 | N hold-keyboard | Boolean | false | focus时,点击页面的时候不收起键盘 | N label | String | '' | 已废弃。左侧文本 | N -left-icon | String / Slot | 'search' | 左侧图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N +left-icon | String / Slot | 'search' | 左侧图标。如果需要使用 `Slot` 进行自定义,必须将该值设置为假值。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 | N maxlength | Number | -1 | 用户最多可以输入的文本长度,一个中文等于一个计数长度。默认为 -1,不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用 | N placeholder | String | '' | 占位符 | N @@ -91,6 +92,7 @@ change | `({ value: string })` | 值发生变化时触发 clear | `({ value: string })` | 点击清除时触发 focus | `({ value: string })` | 聚焦时触发 submit | `({ value: string })` | 提交时触发 + ### Search External Classes 类名 | 描述 @@ -105,17 +107,17 @@ t-class-left | 左侧图标样式类 ### CSS Variables 组件提供了下列 CSS 变量,可用于自定义样式。 -名称 | 默认值 | 描述 +名称 | 默认值 | 描述 -- | -- | -- ---td-search-action-color | @brand-color | - ---td-search-bg-color | @bg-color-secondarycontainer | - ---td-search-clear-icon-color | @font-gray-3 | - ---td-search-font-size | @font-size-m | - ---td-search-height | 80rpx | - ---td-search-icon-color | @font-gray-3 | - ---td-search-label-color | @font-gray-1 | - ---td-search-padding | 16rpx 24rpx | - ---td-search-placeholder-color | @font-gray-3 | - +--td-search-action-color | @brand-color | - +--td-search-bg-color | @bg-color-secondarycontainer | - +--td-search-clear-icon-color | @font-gray-3 | - +--td-search-font-size | @font-size-m | - +--td-search-height | 80rpx | - +--td-search-icon-color | @font-gray-3 | - +--td-search-label-color | @font-gray-1 | - +--td-search-padding | 16rpx 24rpx | - +--td-search-placeholder-color | @font-gray-3 | - --td-search-result-high-light-color | @brand-color | - ---td-search-square-radius | @radius-default | - ---td-search-text-color | @font-gray-1 | - \ No newline at end of file +--td-search-square-radius | @radius-default | - +--td-search-text-color | @font-gray-1 | - diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/tab-panel/tab-panel.wxml b/source/node_modules/tdesign-miniprogram/miniprogram_dist/tab-panel/tab-panel.wxml index a62e20e..7bcb902 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/tab-panel/tab-panel.wxml +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/tab-panel/tab-panel.wxml @@ -2,7 +2,7 @@ diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/tabs/tabs.d.ts b/source/node_modules/tdesign-miniprogram/miniprogram_dist/tabs/tabs.d.ts index 8225136..1efdbf6 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/tabs/tabs.d.ts +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/tabs/tabs.d.ts @@ -41,6 +41,7 @@ export default class Tabs extends SuperComponent { setCurrentIndex(index: number): void; getCurrentName(): any; calcScrollOffset(containerWidth: number, targetLeft: number, targetWidth: number, offset: number): number; + getTabHeight(): Promise; getTrackSize(): Promise; setTrack(): Promise; onTabTap(event: any): void; diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/tabs/tabs.js b/source/node_modules/tdesign-miniprogram/miniprogram_dist/tabs/tabs.js index 6008b1b..232d87f 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/tabs/tabs.js +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/tabs/tabs.js @@ -150,6 +150,9 @@ let Tabs = class Tabs extends SuperComponent { calcScrollOffset(containerWidth, targetLeft, targetWidth, offset) { return offset + targetLeft - (1 / 2) * containerWidth + targetWidth / 2; }, + getTabHeight() { + return getRect(this, `.${name}`); + }, getTrackSize() { return new Promise((resolve, reject) => { if (this.trackWidth) { diff --git a/source/node_modules/tdesign-miniprogram/miniprogram_dist/tabs/tabs.wxss b/source/node_modules/tdesign-miniprogram/miniprogram_dist/tabs/tabs.wxss index 233dea6..7dc3352 100644 --- a/source/node_modules/tdesign-miniprogram/miniprogram_dist/tabs/tabs.wxss +++ b/source/node_modules/tdesign-miniprogram/miniprogram_dist/tabs/tabs.wxss @@ -48,7 +48,7 @@ justify-content: center; font-weight: 400; color: var(--td-tab-item-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)))); - padding: 0 32rpx; + padding: 0 var(--td-spacer-2, 32rpx); box-sizing: border-box; white-space: nowrap; overflow: hidden; @@ -72,7 +72,7 @@ .t-tabs__item-inner--tag { width: 100%; text-align: center; - padding: 0 32rpx; + padding: 0 var(--td-spacer-2, 32rpx); line-height: var(--td-tab-item-tag-height, 64rpx); border-radius: calc(var(--td-tab-item-tag-height, 64rpx) / 2); background-color: var(--td-tab-item-tag-bg, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3))); @@ -81,20 +81,20 @@ background-color: var(--td-tab-item-tag-active-bg, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff))); } .t-tabs__item--tag:not(.t-tabs__item--evenly) { - padding: 0 8rpx; + padding: 0 calc(var(--td-spacer, 16rpx) / 2); } .t-tabs__item--tag:not(.t-tabs__item--evenly):first-child { - margin-left: 16rpx; + margin-left: var(--td-spacer, 16rpx); } .t-tabs__item--tag:not(.t-tabs__item--evenly):last-child { - padding-right: 24rpx; + padding-right: var(--td-spacer-1, 24rpx); } .t-tabs__item--tag { - padding: 0 16rpx; + padding: 0 var(--td-spacer, 16rpx); } .t-tabs__item--card.t-tabs__item--active { background-color: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); - border-radius: 18rpx 18rpx 0 0; + border-radius: var(--td-radius-large, 18rpx) var(--td-radius-large, 18rpx) 0 0; } .t-tabs__item--card.t-tabs__item--active:first-child { border-top-left-radius: 0; @@ -103,15 +103,15 @@ border-top-right-radius: 0; } .t-tabs__item--card.t-tabs__item--pre { - border-bottom-right-radius: 18rpx; + border-bottom-right-radius: var(--td-radius-large, 18rpx); } .t-tabs__item-prefix, .t-tabs__item-suffix { position: absolute; bottom: 0; - width: 36rpx; - height: 36rpx; - background: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); + width: 18rpx; + height: 18rpx; + background-color: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); } .t-tabs__item-prefix::after, .t-tabs__item-suffix::after { @@ -125,17 +125,17 @@ right: 0; } .t-tabs__item-prefix::after { - border-bottom-right-radius: 18rpx; + border-bottom-right-radius: var(--td-radius-large, 18rpx); } .t-tabs__item-suffix { left: 0; } .t-tabs__item-suffix::after { - border-bottom-left-radius: 18rpx; + border-bottom-left-radius: var(--td-radius-large, 18rpx); } .t-tabs__icon { font-size: var(--td-tab-icon-size, 36rpx); - margin-right: 4rpx; + margin-right: calc(var(--td-spacer, 16rpx) / 4); } .t-tabs__content { overflow: hidden; diff --git a/source/node_modules/tdesign-miniprogram/package.json b/source/node_modules/tdesign-miniprogram/package.json index fc323db..3d1e16b 100644 --- a/source/node_modules/tdesign-miniprogram/package.json +++ b/source/node_modules/tdesign-miniprogram/package.json @@ -1,7 +1,7 @@ { "name": "tdesign-miniprogram", "purename": "tdesign", - "version": "1.5.0", + "version": "1.5.1", "description": "tdesign-miniprogram", "title": "tdesign-miniprogram", "main": "miniprogram_dist/index.js", diff --git a/source/package-lock.json b/source/package-lock.json new file mode 100644 index 0000000..963c4a4 --- /dev/null +++ b/source/package-lock.json @@ -0,0 +1,26 @@ +{ + "name": "source", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "tdesign-miniprogram": "^1.5.1" + } + }, + "node_modules/dayjs": { + "version": "1.11.12", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.12.tgz", + "integrity": "sha512-Rt2g+nTbLlDWZTwwrIXjy9MeiZmSDI375FvZs72ngxx8PDC6YXOeR3q5LAuPzjZQxhiWdRKac7RKV+YyQYfYIg==", + "license": "MIT" + }, + "node_modules/tdesign-miniprogram": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/tdesign-miniprogram/-/tdesign-miniprogram-1.5.1.tgz", + "integrity": "sha512-QnZJk5WRWdiUHGcQZvl/p6z6KUJE6MWBNaeWnrW2MgYeCLVaUEAMZMyqiVCy/zNDF9GtjtDeimG856FGRu/pOA==", + "dependencies": { + "dayjs": "^1.10.7" + } + } + } +} diff --git a/source/pages/index/index.js b/source/pages/index/index.js index 3d7163f..702a44e 100644 --- a/source/pages/index/index.js +++ b/source/pages/index/index.js @@ -18,7 +18,11 @@ const util = require('../../utils/util.js') const QQVersionBean = require('./QQVersionBean.js'); Page({ - options: { + properties: { + scrollTop: { + type: Number, value: 0 + }, + }, options: { styleIsolation: 'apply-shared', }, data: { qqVersions: [], @@ -26,7 +30,6 @@ Page({ refreshIcon: "refresh", versionSmallVisible: wx.getStorage({ key: "versionSelect", success(res) { - //console.log(res.data) } }), seeJson: "查看 JSON 字符串", @@ -47,6 +50,9 @@ Page({ successGuessedLink: "", guessSuccessVisible: false, QQTestSwitch: false, + suffixSettingVisible: false, + scrollNumber: 0, + topNum: 0 }, onLoad: function () { this.setData({ theme: wx.getSystemInfoSync().theme || 'light', @@ -59,6 +65,12 @@ Page({ qqVersionBig: wx.getStorageSync('qqVersionBig'), qqVersionSmall: wx.getStorageSync('qqVersionSmall') }); + + const suffixKeys = ['suffix64HB', 'suffixHB64', 'suffix64HB1', 'suffixHB164', 'suffix64HB2', 'suffixHB264', 'suffix64HB3', 'suffixHB364', 'suffix64HD', 'suffixHD64', 'suffix64HD1', 'suffixHD164', 'suffix64HD2', 'suffixHD264', 'suffix64HD3', 'suffixHD364', 'suffix64HD1HB', 'suffixHD1HB64', 'suffixTest']; + suffixKeys.forEach(suffixKey => { + if (wx.getStorageSync(suffixKey) === '') wx.setStorageSync(suffixKey, true); + }); + if (wx.getStorageSync('isQQTestOn') === false || wx.getStorageSync('isQQTestOn') === "") this.setData({ QQTestSwitch: false }); else if (wx.getStorageSync('isQQTestOn') === true) this.setData({ @@ -86,6 +98,29 @@ Page({ }); else if (wx.getStorageSync('isNot5') === true) this.setData({ Not5Switch: true }) + + this.setData({ + suffix64HB: wx.getStorageSync('suffix64HB'), + suffixHB64: wx.getStorageSync('suffixHB64'), + suffix64HB1: wx.getStorageSync('suffix64HB1'), + suffixHB164: wx.getStorageSync('suffixHB164'), + suffix64HB2: wx.getStorageSync('suffix64HB2'), + suffixHB264: wx.getStorageSync('suffixHB264'), + suffix64HB3: wx.getStorageSync('suffix64HB3'), + suffixHB364: wx.getStorageSync('suffixHB364'), + suffix64HD: wx.getStorageSync('suffix64HD'), + suffixHD64: wx.getStorageSync('suffixHD64'), + suffix64HD1: wx.getStorageSync('suffix64HD1'), + suffixHD164: wx.getStorageSync('suffixHD164'), + suffix64HD2: wx.getStorageSync('suffix64HD2'), + suffixHD264: wx.getStorageSync('suffixHD264'), + suffix64HD3: wx.getStorageSync('suffix64HD3'), + suffixHD364: wx.getStorageSync('suffixHD364'), + suffix64HD1HB: wx.getStorageSync('suffix64HD1HB'), + suffixHD1HB64: wx.getStorageSync('suffixHD1HB64'), + suffixTest: wx.getStorageSync('suffixTest'), + customSuffix: wx.getStorageSync('customSuffix') + }) }, onReady: async function () { const windowHeight = await new Promise((resolve) => { wx.getSystemInfo({ @@ -133,7 +168,7 @@ Page({ } this.getData(); - }, onunload: function () { + }, onUnload: function () { this.stopGuessing(); }, refreshData: function () { this.getData(); @@ -150,7 +185,6 @@ Page({ url: 'https://im.qq.com/rainbow/androidQQVersionList', method: 'GET', success: (res) => { try { let responseData = res.data; - //console.log(responseData); let start = responseData.indexOf("versions64\":[") + 12; let end = responseData.indexOf(";\n" + " typeof"); let totalJson = responseData.substring(start, end); @@ -222,13 +256,12 @@ Page({ }, guessPopupVisible(e) { this.setData({ guessVisible: e.detail.visible, - }, () => { - const tabs = this.selectComponent('tabs'); - tabs.setTrack(); }); }, handleGuessPopup() { this.setData({ guessVisible: true + }, () => { + this.selectComponent('#tabs').setTrack(); }); }, closeGuessPopup() { this.setData({ @@ -282,7 +315,7 @@ Page({ if (opa < 0) opa = 0; else if (opa > 1) opa = 1; this.setData({ - titleOpacity: opa, + scrollNumber: e.detail.scrollTop, titleOpacity: opa, }); }, errorPopupVisible(e) { @@ -433,8 +466,7 @@ Page({ }); } else if (qqVersionSmall % 5 !== 0 && this.data.QQTestSwitch === true && this.data.Not5Switch === false) { this.setData({ - errorText: '小版本号需填写 5 的倍数。如需解除此限制,请前往设置进行解除。', - errorVisible: true + errorText: '小版本号需填写 5 的倍数。如需解除此限制,请前往设置进行解除。', errorVisible: true }); } else { this.closeGuessPopup(); @@ -463,7 +495,16 @@ Page({ return new Promise((resolve, reject) => { wx.request({ url, method: 'HEAD', success: function (res) { - resolve(res.statusCode === 200); + if (res.header['Content-Type'] === 'application/octet-stream' || res.header['Content-Type'] === 'application/vnd.android.package-archive') { + const resContentLength = res.header['Content-Length'] + const fileSizeInBytes = parseInt(resContentLength, 10); + const fileSize = fileSizeInBytes / (1024 * 1024); + resolve({ + exists: true, fileSize: fileSize.toFixed(2) + }); + } else resolve({ + exists: false, fileSize: false + }); }, fail: function (err) { reject(err); } @@ -477,10 +518,37 @@ Page({ continueGuessing: 'STATUS_ONGOING' }); let timerId; - const soList = ["_64", "_64_HB", "_64_HB1", "_64_HB2", "_64_HB3", "_HB_64", "_HB1_64", "_HB2_64", "_HB3_64", "_64_BBPJ", "_BBPJ_64"]; - const stList = ["_64", "_64_HB", "_64_HB1", "_64_HB2", "_64_HB3", "_64_HD", "_64_HD1", "_64_HD2", "_64_HD3", "_64_HD1HB", "_HB_64", "_HB1_64", "_HB2_64", "_HB3_64", "_HD_64", "_HD1_64", "_HD2_64", "_HD3_64", "_HD1HB_64", "_test"]; + const isCustomSufEmpty = wx.getStorageSync('customSuffix') !== ""; + const customSufList = isCustomSufEmpty ? wx.getStorageSync('customSuffix').split(', ') : []; + const soListPre = ["_64", "_64_HB", "_64_HB1", "_64_HB2", "_64_HB3", "_HB_64", "_HB1_64", "_HB2_64", "_HB3_64", "_64_BBPJ", "_BBPJ_64"]; + const soList = soListPre.concat(customSufList); + const stListPre = ["_64"]; let sIndex = 0; + // ["_64", "_64_HB", "_64_HB1", "_64_HB2", "_64_HB3", "_64_HD", "_64_HD1", "_64_HD2", "_64_HD3", "_64_HD1HB", "_HB_64", "_HB1_64", "_HB2_64", "_HB3_64", "_HD_64", "_HD1_64", "_HD2_64", "_HD3_64", "_HD1HB_64", "_test"] + + const suf64hb = wx.getStorageSync('suffix64HB') ? ["_64_HB"] : []; + const suf64hb1 = wx.getStorageSync('suffix64HB1') ? ["_64_HB1"] : []; + const suf64hb2 = wx.getStorageSync('suffix64HB2') ? ["_64_HB2"] : []; + const suf64hb3 = wx.getStorageSync('suffix64HB3') ? ["_64_HB3"] : []; + const suf64hd = wx.getStorageSync('suffix64HD') ? ["_64_HD"] : []; + const suf64hd1 = wx.getStorageSync('suffix64HD1') ? ["_64_HD1"] : []; + const suf64hd2 = wx.getStorageSync('suffix64HD2') ? ["_64_HD2"] : []; + const suf64hd3 = wx.getStorageSync('suffix64HD3') ? ["_64_HD3"] : []; + const suf64hd1hb = wx.getStorageSync('suffix64HD1HB') ? ["_64_HD1HB"] : []; + const sufHb64 = wx.getStorageSync('suffixHB64') ? ["_HB_64"] : []; + const sufHb164 = wx.getStorageSync('suffixHB164') ? ["_HB1_64"] : []; + const sufHb264 = wx.getStorageSync('suffixHB264') ? ["_HB2_64"] : []; + const sufHb364 = wx.getStorageSync('suffixHB364') ? ["_HB3_64"] : []; + const sufHd64 = wx.getStorageSync('suffixHD64') ? ["_HD_64"] : []; + const sufHd164 = wx.getStorageSync('suffixHD164') ? ["_HD1_64"] : []; + const sufHd264 = wx.getStorageSync('suffixHD264') ? ["_HD2_64"] : []; + const sufHd364 = wx.getStorageSync('suffixHD364') ? ["_HD3_64"] : []; + const sufHd1hb64 = wx.getStorageSync('suffixHD1HB64') ? ["_HD1HB_64"] : []; + const sufTest = wx.getStorageSync('suffixTest') ? ["_test"] : []; + const stListPre2 = stListPre.concat(suf64hb, suf64hb1, suf64hb2, suf64hb3, suf64hd, suf64hd1, suf64hd2, suf64hd3, suf64hd1hb, sufHb64, sufHb164, sufHb264, sufHb364, sufHd64, sufHd164, sufHd264, sufHd364, sufHd1hb64, sufTest, customSufList); + const stList = stListPre2.flat(Infinity) + const guess = () => { switch (this.data.continueGuessing) { case 'STATUS_ONGOING': @@ -492,9 +560,14 @@ Page({ updateProgressDialogMessage: `正在猜测下载地址:${guessedLink}` }) this.fetchLink(guessedLink).then(isSuccess => { - if (isSuccess) { + if (isSuccess.exists && isSuccess.fileSize !== false) { this.setData({ - successGuessedLink: guessedLink, guessSuccessVisible: true + successGuessedLink: guessedLink, + guessSuccessVisible: true, + successGuessedModeShare: mode === 'WeChat' ? '微信' : mode === 'WeType' ? '微信输入法' : 'QQ', + succeedGuessedVersionShare: mode === 'WeChat' ? versionBig + `(${versionSuf})` : mode === 'WeType' ? versionBig + `(${vSuf})` : mode === 'QQOfficial' ? versionBig + ` 正式版` : versionBig + '.' + vSuf + ' 测试版', + succeedGuessedFileSizeShare: `(大小:${isSuccess.fileSize} MB)`, + successGuessedWarningShare: mode === 'QQTest' ? '鉴于 QQ 测试版可能存在不可预知的稳定性问题,您在下载及使用该测试版本之前,必须明确并确保自身具备足够的风险识别和承受能力。' : false }); switch (mode) { case 'WeChat': @@ -592,10 +665,24 @@ Page({ continueGuessing: 'STATUS_END' }); }, 50) + }, copyGuessSuccessShare() { + this.copyUtil(`Android ${this.data.successGuessedModeShare} ${this.data.succeedGuessedVersionShare}${this.data.succeedGuessedFileSizeShare}\n\n下载地址:${this.data.successGuessedLink}${this.data.successGuessedWarningShare !== false ? '\n\n' + this.data.successGuessedWarningShare : ''}`); + this.setData({ + guessSuccessVisible: false + }); + setTimeout(() => { + this.setData({ + continueGuessing: 'STATUS_END' + }); + }, 50) }, guessSuccessPopupVisible(e) { this.setData({ guessSuccessVisible: e.detail.visible, }); + }, loadingPopupVisible(e) { + this.setData({ + loadingVisible: e.detail.visible, + }); }, copyUtil(copyData) { const that = this; wx.setClipboardData({ @@ -618,5 +705,233 @@ Page({ }, fail: function (res) { } }) + }, suffixSettingPopupVisible(e) { + this.setData({ + suffixSettingVisible: e.detail.visible, + }); + }, handleSuffixSetting() { + this.setData({ + suffixSettingVisible: true, + settingVisible: false, + suffix64HB: wx.getStorageSync('suffix64HB'), + suffixHB64: wx.getStorageSync('suffixHB64'), + suffix64HB1: wx.getStorageSync('suffix64HB1'), + suffixHB164: wx.getStorageSync('suffixHB164'), + suffix64HB2: wx.getStorageSync('suffix64HB2'), + suffixHB264: wx.getStorageSync('suffixHB264'), + suffix64HB3: wx.getStorageSync('suffix64HB3'), + suffixHB364: wx.getStorageSync('suffixHB364'), + suffix64HD: wx.getStorageSync('suffix64HD'), + suffixHD64: wx.getStorageSync('suffixHD64'), + suffix64HD1: wx.getStorageSync('suffix64HD1'), + suffixHD164: wx.getStorageSync('suffixHD164'), + suffix64HD2: wx.getStorageSync('suffix64HD2'), + suffixHD264: wx.getStorageSync('suffixHD264'), + suffix64HD3: wx.getStorageSync('suffix64HD3'), + suffixHD364: wx.getStorageSync('suffixHD364'), + suffix64HD1HB: wx.getStorageSync('suffix64HD1HB'), + suffixHD1HB64: wx.getStorageSync('suffixHD1HB64'), + suffixTest: wx.getStorageSync('suffixTest'), + customSuffix: wx.getStorageSync('customSuffix') + }) + }, closeSuffixSettingPopup() { + this.setData({ + suffixSettingVisible: false, + settingVisible: true, + suffix64HB: wx.getStorageSync('suffix64HB'), + suffixHB64: wx.getStorageSync('suffixHB64'), + suffix64HB1: wx.getStorageSync('suffix64HB1'), + suffixHB164: wx.getStorageSync('suffixHB164'), + suffix64HB2: wx.getStorageSync('suffix64HB2'), + suffixHB264: wx.getStorageSync('suffixHB264'), + suffix64HB3: wx.getStorageSync('suffix64HB3'), + suffixHB364: wx.getStorageSync('suffixHB364'), + suffix64HD: wx.getStorageSync('suffix64HD'), + suffixHD64: wx.getStorageSync('suffixHD64'), + suffix64HD1: wx.getStorageSync('suffix64HD1'), + suffixHD164: wx.getStorageSync('suffixHD164'), + suffix64HD2: wx.getStorageSync('suffix64HD2'), + suffixHD264: wx.getStorageSync('suffixHD264'), + suffix64HD3: wx.getStorageSync('suffix64HD3'), + suffixHD364: wx.getStorageSync('suffixHD364'), + suffix64HD1HB: wx.getStorageSync('suffix64HD1HB'), + suffixHD1HB64: wx.getStorageSync('suffixHD1HB64'), + suffixTest: wx.getStorageSync('suffixTest'), + customSuffix: wx.getStorageSync('customSuffix') + }) + }, suffix64HBChange(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffix64HB: e.detail.checked + }) + }, suffixHB64Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffixHB64: e.detail.checked + }) + }, suffix64HB1Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffix64HB1: e.detail.checked + }) + }, suffixHB164Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffixHB164: e.detail.checked + }) + }, suffix64HB2Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffix64HB2: e.detail.checked + }) + }, suffixHB264Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffixHB264: e.detail.checked + }) + }, suffix64HB3Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffix64HB3: e.detail.checked + }) + }, suffixHB364Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffixHB364: e.detail.checked + }) + }, suffix64HDChange(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffix64HD: e.detail.checked + }) + }, suffixHD64Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffixHD64: e.detail.checked + }) + }, suffix64HD1Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffix64HD1: e.detail.checked + }) + }, suffixHD164Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffixHD164: e.detail.checked + }) + }, suffix64HD2Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffix64HD2: e.detail.checked + }) + }, suffixHD264Change(e) { + wx.vibrateShort({ + type: 'light', + }) + this.setData({ + suffixHD264: e.detail.checked + }) + }, suffix64HD3Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffix64HD3: e.detail.checked + }) + }, suffixHD364Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffixHD364: e.detail.checked + }) + }, suffix64HD1HBChange(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffix64HD1HB: e.detail.checked + }) + }, suffixHD1HB64Change(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffixHD1HB64: e.detail.checked + }) + }, suffixTestChange(e) { + wx.vibrateShort({ + type: 'light', + }); + this.setData({ + suffixTest: e.detail.checked + }) + }, changeCustomSuffix(e) { + this.setData({ + customSuffix: e.detail.value + }) + }, saveSuffixSetting() { + this.setData({ + suffixSettingVisible: false, settingVisible: true + }); + wx.setStorageSync('suffix64HB', this.data.suffix64HB); + wx.setStorageSync('suffixHB64', this.data.suffixHB64); + wx.setStorageSync('suffix64HB1', this.data.suffix64HB1); + wx.setStorageSync('suffixHB164', this.data.suffixHB164); + wx.setStorageSync('suffix64HB2', this.data.suffix64HB2); + wx.setStorageSync('suffixHB264', this.data.suffixHB264); + wx.setStorageSync('suffix64HB3', this.data.suffix64HB3); + wx.setStorageSync('suffixHB364', this.data.suffixHB364); + wx.setStorageSync('suffix64HD', this.data.suffix64HD); + wx.setStorageSync('suffixHD64', this.data.suffixHD64); + wx.setStorageSync('suffix64HD1', this.data.suffix64HD1); + wx.setStorageSync('suffixHD164', this.data.suffixHD164); + wx.setStorageSync('suffix64HD2', this.data.suffix64HD2); + wx.setStorageSync('suffixHD264', this.data.suffixHD264); + wx.setStorageSync('suffix64HD3', this.data.suffix64HD3); + wx.setStorageSync('suffixHD364', this.data.suffixHD364); + wx.setStorageSync('suffix64HD1HB', this.data.suffix64HD1HB); + wx.setStorageSync('suffixHD1HB64', this.data.suffixHD1HB64); + wx.setStorageSync('suffixTest', this.data.suffixTest); + wx.setStorageSync('customSuffix', this.data.customSuffix); + Message.info({ + context: this, + offset: [90, 32], + duration: 1500, + icon: false, + single: false, + content: '已保存', + align: 'center' + }); + }, onToTop() { + this.setData({ + topNum: 0 + }) }, }) \ No newline at end of file diff --git a/source/pages/index/index.json b/source/pages/index/index.json index c260c79..c39156c 100644 --- a/source/pages/index/index.json +++ b/source/pages/index/index.json @@ -20,7 +20,9 @@ "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", "t-input": "tdesign-miniprogram/input/input", "t-message": "tdesign-miniprogram/message/message", - "t-notice-bar": "tdesign-miniprogram/notice-bar/notice-bar" + "t-notice-bar": "tdesign-miniprogram/notice-bar/notice-bar", + "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", + "t-back-top": "tdesign-miniprogram/back-top/back-top" }, "disableScroll": true } \ No newline at end of file diff --git a/source/pages/index/index.wxml b/source/pages/index/index.wxml index 9c64f22..d9a52c7 100644 --- a/source/pages/index/index.wxml +++ b/source/pages/index/index.wxml @@ -1,16 +1,16 @@ - + @@ -18,7 +18,7 @@ - @@ -28,158 +28,166 @@ - - QQ 版本列表 Lite - + + QQ 版本列表 Lite + - - + + {{format.formatPercent(item.size, maxSize)}} - + - - - - - 猜版 Extd. + + + + + 猜版 + Extd. + - + 关于 QQ 版本列表 Lite for WeChat MiniProgram - 版本:1.1.1 + 版本:1.1.2 作者:快乐小牛、有鲫雪狐 Since 2024.03.12 - + - + - 确定 + 确定 - 撤回同意用户协议 + 撤回同意用户协议 - + 猜版 Extended for Android - + - + - - - - + + + + - 开始 + 开始 - 取消 + 取消 - + - - - + + + - 开始 + 开始 - 取消 + 取消 - + - - + + - 开始 + 开始 - 取消 + 取消 - + 详情 @@ -187,12 +195,14 @@ 版本:{{itemVersion}} 额定大小:{{itemSize}} MB - 占比历史最大包({{maxSize}} + + 占比历史最大包({{maxSize}} MB): - + {{itemFeatureTitle}} @@ -200,64 +210,64 @@ - 查看源 JSON + 查看源 JSON - 确定 + 确定 - + JSON 详情 - {{itemString}} + {{itemString}} - + 复制全部 - + 确定 - + - + 错误 - + - 复制错误信息 + 复制错误信息 - 确定 + 确定 - + 用户协议 - - + + - 同意 + 同意 - {{UADisagreeText}} + {{UADisagreeText}} - + 设置 - - + + - - + + - - + + - - + + + - 确定 + 确定 - + - + 猜版 Extended - + {{updateProgressDialogMessage}} - 取消 + 取消 - + - 猜版 Extended + 猜版 Extended - + - - 复制并停止 + + + + + 复制链接并停止 - 仅停止 + 仅停止 - 跳过以继续 + 跳过以继续 + + + + + + + 猜版直链后缀设置 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 返回 + + 保存 + + + + \ No newline at end of file diff --git a/source/pages/index/index.wxss b/source/pages/index/index.wxss index 5333e41..1ae838f 100644 --- a/source/pages/index/index.wxss +++ b/source/pages/index/index.wxss @@ -248,6 +248,11 @@ display: flex; } +.guess-success-button-top { + margin: 24rpx 32rpx 32rpx; + display: flex; +} + .TD_and_MulanPubLv2 { display: flex; justify-content: center; @@ -260,11 +265,25 @@ overflow: hidden; } -.suffix-setting-button{ - margin: 16rpx 32rpx 32rpx; +.suffix-setting-button { + margin: 32rpx; display: flex; } +.chbox { + padding: 16rpx 32rpx; + display: flex; + justify-content: space-between; + background-color: var(--td-bg-color-container, #fff); +} + +.chbox-top { + padding: 16rpx 32rpx; + display: flex; + justify-content: space-between; + background-color: var(--td-bg-color-container, #fff); +} + @media (prefers-color-scheme: dark) { .recycle-view-container { diff --git a/source/yarn.lock b/source/yarn.lock index 1daa247..cdc1578 100644 --- a/source/yarn.lock +++ b/source/yarn.lock @@ -4,12 +4,12 @@ dayjs@^1.10.7: version "1.11.12" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.12.tgz#5245226cc7f40a15bf52e0b99fd2a04669ccac1d" + resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.11.12.tgz" integrity sha512-Rt2g+nTbLlDWZTwwrIXjy9MeiZmSDI375FvZs72ngxx8PDC6YXOeR3q5LAuPzjZQxhiWdRKac7RKV+YyQYfYIg== tdesign-miniprogram@^1.5.1: version "1.5.1" - resolved "https://registry.yarnpkg.com/tdesign-miniprogram/-/tdesign-miniprogram-1.5.1.tgz#a63fadf836c5e5f9af7657a9ca28000fa4dd1423" + resolved "https://registry.npmjs.org/tdesign-miniprogram/-/tdesign-miniprogram-1.5.1.tgz" integrity sha512-QnZJk5WRWdiUHGcQZvl/p6z6KUJE6MWBNaeWnrW2MgYeCLVaUEAMZMyqiVCy/zNDF9GtjtDeimG856FGRu/pOA== dependencies: dayjs "^1.10.7"