From c10338f70869c1330f71edf821c9c976df0f6b18 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A5=89=E6=96=8C?= <947164239@qq.com>
Date: Fri, 16 Aug 2019 20:36:33 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8F=8D=E9=A6=88=E9=A1=B5=E9=9D=A2=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/layout/feedback.vue | 74 ++++++++++++++++++++++++++++-------------
1 file changed, 50 insertions(+), 24 deletions(-)
diff --git a/src/layout/feedback.vue b/src/layout/feedback.vue
index e8be2c6..8a46c3e 100644
--- a/src/layout/feedback.vue
+++ b/src/layout/feedback.vue
@@ -1,22 +1,36 @@
-
+
-
+
-
+
屏幕截图 (可选):
-
-
-
+
+
-
+
提交屏幕截图
- 提交
+ 提交
@@ -50,7 +64,7 @@ export default {
},
methods: {
- async loadLibrary () {
+ async loadLibrary() {
if (typeof html2canvas === 'undefined') {
try {
console.error('html2canvas not import', e.toString())
@@ -71,16 +85,19 @@ export default {
modals[i].setAttribute('data-html2canvas-ignore', 'true')
}
- html2canvas(document.body, { logging: false })
+ html2canvas(document.body, { logging: false })
.then(canvas => {
let screenshot = document.getElementById('screenshot')
canvas.setAttribute('style', 'width:100%')
screenshot.appendChild(canvas)
this.dataLoading = false
- window.sdb = new SimpleDrawingBoard(screenshot.getElementsByTagName('canvas')[0], {
- lineColor: '#ff0000',
- lineSize: 4
- })
+ window.sdb = new SimpleDrawingBoard(
+ screenshot.getElementsByTagName('canvas')[0],
+ {
+ lineColor: '#ff0000',
+ lineSize: 4
+ }
+ )
})
.catch(e => {
this.dataLoading = false
@@ -106,21 +123,29 @@ export default {
}
formData.append('feedback', this.feedback.info)
}
- let res = await axios.post('http://', formData, {
- headers: {
- 'Origin': window.location.origin,
- 'Content-Type': 'multipart/form-data'
- },
- changeOrigin: true
- })
+ // let res = await axios.post('http://', formData, {
+ // headers: {
+ // 'Origin': window.location.origin,
+ // 'Content-Type': 'multipart/form-data'
+ // },
+ // changeOrigin: true
+ // })
this.confirmLoading = false
- util.showResponseMessage(res.data.data)
+ this.$notify({
+ title: '反馈成功',
+ type: 'success',
+ duration: 2500
+ })
if (res.data.data.status === 1) {
this.show = false
}
} catch (e) {
- util.showErrorMessageBox(e)
+ this.$notify({
+ title: '提交失败',
+ type: 'error',
+ duration: 2500
+ })
this.confirmLoading = false
}
}
@@ -130,7 +155,8 @@ export default {