浏览代码

解决冲突

zhangwf 5 年之前
父节点
当前提交
dcc8b23407
共有 2 个文件被更改,包括 31 次插入28 次删除
  1. 7 6
      src/util/appConst.js
  2. 24 22
      src/views/h5editor/index.vue

+ 7 - 6
src/util/appConst.js

@@ -1,7 +1,8 @@
-console.log('process.env.NODE_ENV'+process.env.NODE_ENV)
-let BACKEND_DOMAIN = ''
-let QINIU_DOMAIN = ''
-let DIAOYANBAO_PATH = ''
+
+console.log('process.env.NODE_ENV' + process.env.NODE_ENV)
+let BACKEND_DOMAIN = '';
+let QINIU_DOMAIN = '';
+let DIAOYANBAO_PATH = '';
 if (process.env.NODE_ENV === 'test') {
   //测试
   BACKEND_DOMAIN = 'http://gatewaytest.elab-plus.com/elab-diaoyanbao/'
@@ -11,11 +12,11 @@ if (process.env.NODE_ENV === 'test') {
   BACKEND_DOMAIN = 'http://192.168.0.16:5318'
   // QINIU_DOMAIN = 'http://139.196.5.59:5555'
   DIAOYANBAO_PATH = 'http://192.168.4.249:8080/#/preview?mgid='
-}else if (process.env.NODE_ENV === 'uat') {//UAT
+} else if (process.env.NODE_ENV === 'uat') {//UAT
   BACKEND_DOMAIN = 'http://192.168.0.16:5318'
   // QINIU_DOMAIN = 'http://139.196.5.59:5555'
   DIAOYANBAO_PATH = 'http://192.168.4.249:8080/#/preview?mgid='
-}else{//PROD
+} else {//PROD
   //生产PROD
   // BACKEND_DOMAIN = 'https://engine.elab-plus.cn'
   // QINIU_DOMAIN = 'https://dm-api.elab-plus.cn'

+ 24 - 22
src/views/h5editor/index.vue

@@ -739,28 +739,29 @@
                     spinner: "el-icon-loading",
                     background: "rgba(0, 0, 0, 0.7)"
                 });
-                if (!hasSaveFlag) {
-                    $(".animated").css("animation-name", "null");
-                    $(".animated>div").css("animation-name", "null");
-                    $(".animated span").css({
-                        animationDelay: "0s",
-                        animationDuration: "0s"
-                    });
-                    await html2canvas(document.querySelector("#canvasPage"), {
-                        useCORS: true,
-                        scale: 0.5,
-                        height: 1334,
-                        logging: false //日志开关,便于查看html2canvas的内部执行流程
-                    }).then(async canvas => {
-                        var result = await uploadBase64({base64Str: canvas.toDataURL()});
-                        if (result.data.success) {
-                            this.$store.state.editor.editorTheme.cover =
-                                result.data.single.filePath;
-                        } else {
-                            this.$message.error("封面图片上传失败!");
-                        }
-                    });
-                }
+
+                $(".animated").css("animation-name", "null");
+                $(".animated>div").css("animation-name", "null");
+                $(".animated span").css({
+                    animationDelay: "0s",
+                    animationDuration: "0s"
+                });
+                await html2canvas(document.querySelector("#canvasPage"), {
+                    useCORS: true,
+                    scale: 0.5,
+                    height: 1334,
+                    logging: false //日志开关,便于查看html2canvas的内部执行流程
+                }).then(async canvas => {
+                    var result = await uploadBase64({base64Str: canvas.toDataURL()});
+                    if (result.data.success) {
+                        this.$store.state.editor.editorTheme.cover =
+                            result.data.single.filePath;
+                            console.log("封面地址",result.data.single.filePath);
+                    } else {
+                        this.$message.error("封面图片上传失败!");
+                    }
+                });
+
                 this.$store.state.editor.editorTheme.bgc = this.bgc;
                 this.$store.state.editor.editorTheme.btnColor = this.btnColor;
                 this.$store.state.editor.editorTheme.bodyBackgroundColor =
@@ -795,6 +796,7 @@
                 console.log("子组件结果页的值:", chil.resultPageCount);
                 let param = {
                     id: this.itemId,
+                    coverImg: this.$store.state.editor.editorTheme.cover,
                     jsonString: JSON.stringify(this.$store.state.editor.editorTheme),
                     resultPageCount: chil.resultPageCount,
                     updator: "admin"