feat:代码优化
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user