feat:代码优化

This commit is contained in:
R524809
2025-12-04 17:26:04 +08:00
parent 7f8a9b1c4d
commit c8788669c7
23 changed files with 339 additions and 428 deletions
+1 -13
View File
@@ -27,7 +27,7 @@ Page({
functionId: '',
hasContent: false,
showShareDialog: false,
showTypeSelector: false,
showTypeSelector: true, // 控制是否显示类型选择器
currentType: 'twelve-animals', // 'twelve-animals' 或 'fruits' 或 'circle' 或 'caterpillar'
currentTypeName: '十二生肖',
typeActions: [
@@ -266,24 +266,12 @@ Page({
}
},
/** 显示类型选择器 */
onShowTypeSelector() {
this.setData({ showTypeSelector: true });
},
/** 关闭类型选择器 */
onCloseTypeSelector() {
console.log('onCloseTypeSelector');
this.setData({ showTypeSelector: false });
},
/** 选择类型 */
onSelectType(event: any) {
const { name, value } = event.detail;
this.setData({
currentType: value,
currentTypeName: name,
showTypeSelector: false,
});
// 重新生成数据
this.onRandom();