From f86341379253edf497631a297e6ea3af28c3e325 Mon Sep 17 00:00:00 2001 From: Maylin <15178961907@163.com> Date: Tue, 11 Oct 2022 17:55:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=BF=AE=E6=94=B9=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E5=92=8C=E4=BF=9D=E5=AD=98=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/components/DrawCanvas/index.vue | 8 +- src/components/DrawToolbar/index.vue | 27 ++- src/views/shop/goodsInfo/index.vue | 289 ++++++++++++++++++++++----- src/views/shop/info/index.vue | 8 +- src/views/shop/templateInfo/draw.vue | 19 +- vite.config.js | 2 +- 7 files changed, 277 insertions(+), 77 deletions(-) diff --git a/package.json b/package.json index 4895b5c..ef08f56 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@vueuse/core": "8.5.0", "axios": "0.26.1", "echarts": "5.3.2", + "element-china-area-data": "^5.0.2", "element-plus": "2.2.15", "file-saver": "2.0.5", "fuse.js": "6.5.3", diff --git a/src/components/DrawCanvas/index.vue b/src/components/DrawCanvas/index.vue index a612d86..7a50327 100644 --- a/src/components/DrawCanvas/index.vue +++ b/src/components/DrawCanvas/index.vue @@ -156,17 +156,13 @@ watchEffect(() => { blocks.forEach(block => { if (block.type === 'image') { const image = new Image() + block.image = image image.src = block.src - image.onload = () => { - block.image = image - } }else if (block.type === 'qrcode'){ QRCode.toDataURL(block.text, {width: block.width, height: block.height}).then(src=> { const image = new Image() + block.image = image image.src = src - image.onload = () => { - block.image = image - } }) } }) diff --git a/src/components/DrawToolbar/index.vue b/src/components/DrawToolbar/index.vue index 9619c49..afc3ad0 100644 --- a/src/components/DrawToolbar/index.vue +++ b/src/components/DrawToolbar/index.vue @@ -42,15 +42,21 @@ 内容
- -
- - - +
+ + + + + + + +
+ [ {{ blockTypes[item.type] }} ] {{ item.name }} + +
@@ -104,8 +110,9 @@ function handleBlockSelect(item) { } function handleBlockDelete(key, item) { - emit('update:select-block', null) + console.log(3333) content.value.blocks.splice(key, 1) + emit('update:select-block', null) } /** diff --git a/src/views/shop/goodsInfo/index.vue b/src/views/shop/goodsInfo/index.vue index 6ab4fcd..7da4249 100644 --- a/src/views/shop/goodsInfo/index.vue +++ b/src/views/shop/goodsInfo/index.vue @@ -104,7 +104,7 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +