From 13de5e0775fd8713525974b27ed309eba0c78923 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Tue, 31 May 2022 10:38:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=BC=E5=9B=BE=E6=B1=87=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/serve.js | 2 +- src/saas/AppCountryAlbum/AddReport.vue | 26 +++ .../components/report/RenderContent.vue | 152 ++++++++++++++---- .../AppCountryAlbum/images/down_boldw.png | Bin 0 -> 293 bytes src/saas/AppCountryAlbum/images/jiancai.png | Bin 0 -> 243 bytes .../AppCountryAlbum/images/remove-black.png | Bin 0 -> 334 bytes src/saas/AppCountryAlbum/images/xiugai.png | Bin 0 -> 572 bytes 7 files changed, 150 insertions(+), 30 deletions(-) create mode 100644 src/saas/AppCountryAlbum/images/down_boldw.png create mode 100644 src/saas/AppCountryAlbum/images/jiancai.png create mode 100644 src/saas/AppCountryAlbum/images/remove-black.png create mode 100644 src/saas/AppCountryAlbum/images/xiugai.png diff --git a/bin/serve.js b/bin/serve.js index 59be85ff..a9cbf775 100644 --- a/bin/serve.js +++ b/bin/serve.js @@ -15,7 +15,7 @@ const getFileInfo = (app, file) => { let {name, label} = app, path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g, `/apps/$1/$2`) apps.list.push({ - id: file.replace(/\.\/?(vue)?/g, '')?.replace(/[\\\/]/g, '_'), + id: file.replace(/\.\/?(vue)?/g, '').replace(/[\\\/]/g, '_'), name, label, path, diff --git a/src/saas/AppCountryAlbum/AddReport.vue b/src/saas/AppCountryAlbum/AddReport.vue index ce398ce9..f27d1c0f 100644 --- a/src/saas/AppCountryAlbum/AddReport.vue +++ b/src/saas/AppCountryAlbum/AddReport.vue @@ -10,6 +10,7 @@ @click="changeComponent(item, index)"> + 编辑
完成
@@ -65,6 +66,10 @@ }) }, + toEdit () { + this.$refs.reportItem.linkTo() + }, + save () { this.$loading() this.$refs.reportItem.screenshot() && this.$refs.reportItem.screenshot().then(canvas => { @@ -173,6 +178,23 @@ height: 208px; } + span { + display: none; + position: absolute; + top: 50%; + left: 50%; + z-index: 1; + width: 128px; + height: 56px; + line-height: 56px; + text-align: center; + color: #fff; + font-size: 32px; + background: rgba(0, 0, 0, 0.8); + border-radius: 8px; + transform: translate(-50%, -50%); + } + .checked { position: absolute; top: 0; @@ -186,6 +208,10 @@ .img { border: 4px solid #408EF6; } + + span { + display: block; + } } } } diff --git a/src/saas/AppCountryAlbum/components/report/RenderContent.vue b/src/saas/AppCountryAlbum/components/report/RenderContent.vue index b7e48a68..88749fee 100644 --- a/src/saas/AppCountryAlbum/components/report/RenderContent.vue +++ b/src/saas/AppCountryAlbum/components/report/RenderContent.vue @@ -1,9 +1,36 @@ @@ -13,37 +40,45 @@ data () { return { - + currIndex: -1, + isShow: false, + type: '', + value: '', + action: '' } }, methods: { + toEditText () { + this.$emit('onLongpress', { + type: this.type, + value: this.value, + index: this.currIndex, + action: 'edit' + }) + + this.currIndex = -1 + this.isShow = false + }, + + remove () { + this.$emit('onLongpress', { + type: this.type, + value: this.value, + index: this.currIndex, + action: 'remove' + }) + + this.currIndex = -1 + this.isShow = false + }, + onLongpress (item, index) { - if (item.type === 'text') { - uni.showActionSheet({ - itemList: ['编辑', '删除'], - success: res => { - this.$emit('onLongpress', { - type: item.type, - value: item.value, - index: index, - action: res.tapIndex === 0 ? 'edit' : 'remove' - }) - } - }) - } else { - uni.showActionSheet({ - itemList: ['删除'], - success: () => { - this.$emit('onLongpress', { - type: item.type, - value: item.value, - index: index, - action: 'remove' - }) - } - }) - } + this.currIndex = index + this.type = item.type + this.value = item.value + + this.isShow = true }, prview (url) { @@ -58,13 +93,72 @@