feat:base64字体格式
This commit is contained in:
@@ -10,6 +10,7 @@ Page({
|
||||
|
||||
data: {
|
||||
cardList: [] as Array<{ color: string; word: string }>,
|
||||
showPopup: false,
|
||||
},
|
||||
|
||||
onReady() {
|
||||
@@ -30,37 +31,6 @@ Page({
|
||||
.exec();
|
||||
},
|
||||
|
||||
// renderCanvas() {
|
||||
// // wx.nextTick(() => {
|
||||
// // this.setCanvasBoxSize();
|
||||
// // });
|
||||
// console.log('this.boxWidth:', this.boxWidth);
|
||||
// console.log('this.boxHeight:', this.boxHeight);
|
||||
// if (this.boxWidth && this.boxHeight) {
|
||||
// this.initCanvas(this.boxWidth, this.boxHeight);
|
||||
// }
|
||||
// },
|
||||
|
||||
// setCanvasBoxSize() {
|
||||
// const { windowWidth } = wx.getWindowInfo();
|
||||
// console.log('windowWidth---:', windowWidth);
|
||||
// const query = wx.createSelectorQuery();
|
||||
// query
|
||||
// .select('#canvasWrapper')
|
||||
// .boundingClientRect((rect) => {
|
||||
// if (rect) {
|
||||
// const boxWidth = rect.width;
|
||||
// const boxHeight = boxWidth / (width / height);
|
||||
|
||||
// console.log('boxWidth----:', boxWidth);
|
||||
// console.log('boxHeight----:', boxHeight);
|
||||
|
||||
// this.initCanvas(boxHeight, boxWidth);
|
||||
// }
|
||||
// })
|
||||
// .exec();
|
||||
// },
|
||||
|
||||
initCanvas(boxWidth: number, boxHeight: number) {
|
||||
wx.createSelectorQuery()
|
||||
.select('#canvasContent')
|
||||
@@ -150,4 +120,14 @@ Page({
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
onClickColor(e: WechatMiniprogram.CustomEvent) {
|
||||
const { key, word, color } = e.detail;
|
||||
console.log('onClickColor key:', key, 'word:', word, 'color:', color);
|
||||
this.setData({ showPopup: true });
|
||||
},
|
||||
|
||||
onClosePopup() {
|
||||
this.setData({ showPopup: false });
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user