feat:选择文字

This commit is contained in:
2025-06-30 17:14:03 +08:00
parent 23ad49d333
commit 654afced6f
10 changed files with 129 additions and 39 deletions
+13 -6
View File
@@ -16,7 +16,6 @@ Page({
currentColor: '',
showIntroductionPopup: false,
showSelectWordPopup: false, // 选择文字弹窗
selectedWords: [] as string[],
},
onLoad() {
@@ -295,15 +294,23 @@ Page({
showSelectWordPopup: true,
});
},
closeSelectWordPopup() {
this.setData({
showSelectWordPopup: false,
});
},
onSelectWord(e: WechatMiniprogram.CustomEvent) {
const { words } = e.detail;
this.setData({
selectedWords: words,
});
onChangeWord(e: WechatMiniprogram.CustomEvent) {
const selectedWords = e.detail.selectedWords as string[];
console.log('selectedWords:', selectedWords);
const colors = [...WATER_COLORS.basic12];
const cardList = selectedWords.map((word, index) => ({
color: colors[index].hex,
word,
}));
this.setData({ showSelectWordPopup: false });
this.drawCanvas(cardList);
},
});