Skip to content

Commit

Permalink
1.1.2 更新合入 (#7)
Browse files Browse the repository at this point in the history
* TD 上游更新,修复一处报错问题

* 新增自定义猜版后缀

* 一点细微更改

* 新增回顶按钮

* 修复微信猜版直链为空也认定猜版成功的Bug,猜版成功页新增文件大小显示,猜版成功页新增复制分享文案按钮

修复微信猜版直链为空也认定猜版成功的Bug,猜版成功页新增文件大小显示,猜版成功页新增可复制分享文案
  • Loading branch information
ArcticFoxPro authored Aug 16, 2024
1 parent fc30e10 commit 7bfaef4
Show file tree
Hide file tree
Showing 71 changed files with 1,168 additions and 447 deletions.
2 changes: 1 addition & 1 deletion source/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"window": {
"navigationStyle": "custom",
"navigationBarTextStyle":"@navTxtStyle",
"navigationBarTitleText": "QQ Ver. Lite",
"navigationBarTitleText": "QQ 版本列表 Lite",
"navigationBarBackgroundColor": "#F6F6F6",
"backgroundColor": "#F6F6F6"
},
Expand Down
4 changes: 2 additions & 2 deletions source/miniprogram_npm/dayjs/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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 | -
18 changes: 11 additions & 7 deletions source/miniprogram_npm/tdesign-miniprogram/cascader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | -
10 changes: 10 additions & 0 deletions source/miniprogram_npm/tdesign-miniprogram/cascader/cascader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -19,6 +26,7 @@ export default class Cascader extends SuperComponent {
selectedValue: any[];
scrollTopList: any[];
steps: any[];
_optionsHeight: number;
};
observers: {
visible(v: any): void;
Expand All @@ -28,6 +36,8 @@ export default class Cascader extends SuperComponent {
stepIndex(): Promise<void>;
};
methods: {
updateOptionsHeight(steps: number): void;
initOptionsHeight(steps: number): Promise<void>;
initWithValue(): void;
getIndexesByValue(options: import("../common/common").TreeOptionData<string | number>[], value: any): any[];
updateScrollTop(): void;
Expand Down
49 changes: 49 additions & 0 deletions source/miniprogram_npm/tdesign-miniprogram/cascader/cascader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -45,6 +52,7 @@ let Cascader = class Cascader extends SuperComponent {
event: 'change',
},
];
this.state = Object.assign({}, defaultState);
this.data = {
prefix,
name,
Expand All @@ -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();
Expand All @@ -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* () {
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
class="{{name}}__options"
scroll-y
scroll-top="{{scrollTopList[index]}}"
type="list"
style="height: {{_optionsHeight}}px"
>
<view class="cascader-radio-group-{{index}}">
<t-radio-group
Expand Down
34 changes: 15 additions & 19 deletions source/miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -30,47 +30,43 @@
flex-direction: column;
background-color: var(--td-cascader-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
color: var(--td-cascader-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
border-radius: 24rpx 24rpx 0 0;
border-radius: var(--td-radius-extra-large, 24rpx) var(--td-radius-extra-large, 24rpx) 0 0;
--td-radio-icon-checked-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
--td-tab-item-active-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
--td-tab-track-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
}
.t-cascader__close-btn {
right: 16px;
top: 12px;
right: 32rpx;
top: 24rpx;
position: absolute;
}
.t-cascader__title {
position: relative;
font-weight: 700;
text-align: center;
line-height: 48px;
line-height: var(--td-cascader-title-height, 26rpx);
padding: var(--td-cascader-title-padding, var(--td-spacer-2, 32rpx));
font-size: var(--td-cascder-title-font-size, 36rpx);
}
.t-cascader__content {
width: 100%;
flex: 1;
height: var(--td-cascader-content-height, 78vh);
display: flex;
flex-direction: column;
}
.t-cascader__options {
width: 100vw;
height: var(--td-cascader-options-height, 640rpx);
}
.t-cascader__options-title {
margin-top: 40rpx;
color: var(--td-cascader-options-title-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
font-size: 28rpx;
font-size: var(--td-font-size-base, 28rpx);
line-height: 44rpx;
padding-left: 16px;
}
.t-cascader__options-content {
flex: 1;
height: 100%;
overflow: auto;
padding-left: 16px;
padding-top: 40rpx;
padding-left: var(--td-spacer-2, 32rpx);
box-sizing: border-box;
}
.t-cascader__options-container {
flex: 1;
display: flex;
transition: all ease 0.3s;
}
Expand Down Expand Up @@ -104,7 +100,7 @@
width: var(--td-cascader-step-dot-size, 16rpx);
height: var(--td-cascader-step-dot-size, 16rpx);
border-radius: 50%;
border: 1px solid var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
border: 2rpx solid var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
box-sizing: border-box;
}
.t-cascader__step-dot:not(.t-cascader__step-dot--last)::after {
Expand All @@ -114,7 +110,7 @@
left: 50%;
top: calc(var(--td-cascader-step-dot-size, 16rpx) + 14rpx);
height: 36rpx;
width: 1px;
width: 2rpx;
background: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
transform: translateX(-50%);
}
Expand All @@ -123,8 +119,8 @@
border-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
}
.t-cascader__step-label {
padding-left: 16px;
font-size: 16px;
padding-left: var(--td-spacer-2, 32rpx);
font-size: var(--td-font-size-m, 32rpx);
}
.t-cascader__step-label--active {
color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
Expand Down
Loading

0 comments on commit 7bfaef4

Please sign in to comment.