wangzhengchao 3 years ago
parent
commit
f4d76354a8

+ 77 - 25
src/page/decorateManage/decorateList.vue

@@ -2375,11 +2375,16 @@
                     justify-content: flex-end;
                   "
                 >
-                  <canvas
+                  <!-- <canvas
                     :id="'qrCodeUrl' + index"
                     ref="qrCodeUrl"
                     style="width: 100px; height: 100px"
-                  ></canvas>
+                  ></canvas> -->
+                  <img
+                    :id="'ewm' + index"
+                    src="null"
+                    style="width: 148px; height: 148px"
+                  />
                 </div>
               </Row>
             </div>
@@ -2455,7 +2460,12 @@
                     }}</span>
                   </div>
                   <div>
-                    <canvas :id="'qrCodeUrl' + index" class="ewmBox"></canvas>
+                    <!-- <canvas :id="'qrCodeUrl' + index" class="ewmBox"></canvas> -->
+                    <img
+                      :id="'ewm' + index"
+                      src="null"
+                      style="width: 148px; height: 148px"
+                    />
                   </div>
                 </Col>
                 <Col
@@ -2665,7 +2675,12 @@
               </Row>
               <Row type="flex" justify="end" align="middle">
                 <Col>
-                  <canvas :id="'qrCodeUrl' + index" class="ewmBox"></canvas>
+                  <!-- <canvas :id="'qrCodeUrl' + index" class="ewmBox"></canvas> -->
+                  <img
+                    :id="'ewm' + index"
+                    src="null"
+                    style="width: 148px; height: 148px"
+                  />
                 </Col>
               </Row>
             </div>
@@ -2753,7 +2768,12 @@
                 </Col>
                 <Col span="24" style="padding: 10px; position: relative">
                   <div style="position: absolute; top: 95px; right: 50px">
-                    <canvas :id="'qrCodeUrl' + index" class="ewmBox"></canvas>
+                    <!-- <canvas :id="'qrCodeUrl' + index" class="ewmBox"></canvas> -->
+                    <img
+                      :id="'ewm' + index"
+                      src="null"
+                      style="width: 148px; height: 148px"
+                    />
                   </div>
                   <p style="font-size: 18px; font-weight: 600">温馨提示:</p>
                   <p style="font-size: 18px; font-weight: 600">
@@ -5287,20 +5307,36 @@ export default {
           }
           this.xkzModal = true;
           setTimeout(() => {
+            // res.data.forEach((site, index) => {
+            //   QRCode.width = 100;
+            //   QRCode.height = 100;
+            //   QRCode.toCanvas(
+            //     document.getElementById("qrCodeUrl" + index),
+            //     site.deviceNumber,
+            //     {
+            //       width: 100,
+            //       height: 100,
+            //     },
+            //     function (error) {
+            //       console.log(error);
+            //     }
+            //   );
+            // });
             res.data.forEach((site, index) => {
-              QRCode.width = 100;
-              QRCode.height = 100;
-              QRCode.toCanvas(
-                document.getElementById("qrCodeUrl" + index),
-                site.deviceNumber,
-                {
-                  width: 100,
-                  height: 100,
-                },
-                function (error) {
-                  console.log(error);
-                }
-              );
+              QRCode.width = 148;
+              QRCode.height = 148;
+              // QRCode.toCanvas(document.getElementById('ewm'+index), site.deviceNumber, function (error) {
+              //   console.log(error)
+              // })
+              QRCode.toDataURL(site.deviceNumber)
+                .then((url) => {
+                  document
+                    .getElementById("ewm" + index)
+                    .setAttribute("src", url);
+                })
+                .catch((err) => {
+                  console.error(err);
+                });
             });
           }, 150);
         } else {
@@ -5523,14 +5559,30 @@ export default {
             };
             this.xkzModal = true;
             setTimeout(() => {
+              // res.data.forEach((site, index) => {
+              //   QRCode.toCanvas(
+              //     document.getElementById("ewm" + index),
+              //     site.deviceNumber,
+              //     function (error) {
+              //       console.log(error);
+              //     }
+              //   );
+              // });
               res.data.forEach((site, index) => {
-                QRCode.toCanvas(
-                  document.getElementById("ewm" + index),
-                  site.deviceNumber,
-                  function (error) {
-                    console.log(error);
-                  }
-                );
+                QRCode.width = 148;
+                QRCode.height = 148;
+                // QRCode.toCanvas(document.getElementById('ewm'+index), site.deviceNumber, function (error) {
+                //   console.log(error)
+                // })
+                QRCode.toDataURL(site.deviceNumber)
+                  .then((url) => {
+                    document
+                      .getElementById("ewm" + index)
+                      .setAttribute("src", url);
+                  })
+                  .catch((err) => {
+                    console.error(err);
+                  });
               });
             }, 100);
           } else {

+ 3 - 0
src/page/dictionary/dictionary.vue

@@ -96,6 +96,7 @@
                 <div class="form-item-content">
                   <Input
                     v-model="companyForm.enterpriseShortName"
+                    maxlength="100"
                     placeholder="请输入企业短名称"
                     style="flex: 1"
                   />
@@ -106,6 +107,7 @@
                 <div class="form-item-content">
                   <Input
                     v-model="companyForm.enterpriseLongtName"
+                    maxlength="100"
                     placeholder="请输入企业长名称"
                     style="flex: 1"
                   />
@@ -143,6 +145,7 @@
                       <Icon type="ios-camera" size="20"></Icon>
                     </div>
                   </Upload>
+                  <span style="margin-left: 10px">建议上传比例450x72</span>
                 </div>
               </div>
             </div>

+ 1 - 1
src/service/getData.js

@@ -954,4 +954,4 @@ export const updateLogoInfo = (data) => fetch(`/decoration/updateLogoInfo`, '/de
  * @param data
  * @returns {Promise<*>}
  */
-export const selectLogoInfo = (id, data = {}) => fetch(`/decoration/selectLogoInfo`, '/decorationManage', data, 'JSON2', 'POST');
+export const selectLogoInfo = (id, data = {}) => fetch(`/decoration/selectLogoInfo/${id}`, '/decorationManage', data, 'JSON2', 'POST');