storeBelieveInLight před 1 rokem
rodič
revize
198f862895
1 změnil soubory, kde provedl 24 přidání a 5 odebrání
  1. 24 5
      shop/perating/activitecode.vue

+ 24 - 5
shop/perating/activitecode.vue

@@ -53,14 +53,14 @@
53 53
         ></image>
54 54
         <view class="downLoad-text"> 保存图片 </view>
55 55
       </view> -->
56
-      <!-- <view class="downLoadButton" @click="clickGeneratePicture2">
56
+      <view class="downLoadButton" @click="clickGeneratePicture2">
57 57
         <image
58 58
           class="downLoad-image"
59 59
           src="../../static/saveImage.png"
60 60
           mode=""
61 61
         ></image>
62 62
         <view class="downLoad-text"> 保存图片 </view>
63
-      </view> -->
63
+      </view>
64 64
     </view>
65 65
 
66 66
     <!-- ************************* 海报画板 **********************-->
@@ -379,7 +379,26 @@ export default {
379 379
       });
380 380
     },
381 381
     clickGeneratePicture2() {
382
-      this.drawImageToCanvas();
382
+      //this.drawImageToCanvas();
383
+      let fileName = "pension_分享海报.jpg";
384
+      if (this.qrcode_src == "") {
385
+        uni.showToast({
386
+          title: "无生成二维码",
387
+          icon: "none",
388
+          duration: 2000,
389
+        });
390
+        return;
391
+      }
392
+      let fileUrl = decodeURIComponent(this.qrcode_src);
393
+      if (window.android) {
394
+        window.android.downloadFile(fileName, fileUrl);
395
+      } else {
396
+        uni.showToast({
397
+          title: "未检测到Android环境",
398
+          icon: "none",
399
+          duration: 2000,
400
+        });
401
+      }
383 402
     },
384 403
     // 保存图片
385 404
     saveImage() {
@@ -424,7 +443,7 @@ export default {
424 443
 
425 444
     fileDwonload(base64Data, path) {
426 445
       uni.showLoading({ title: "保存中...", mask: true });
427
-   const _this =this
446
+      const _this = this;
428 447
       // const blob = this.base64ToBlob(base64Data);
429 448
       // const blobUrl = URL.createObjectURL(blob);
430 449
       const finName = "海报.jpg";
@@ -462,7 +481,7 @@ export default {
462 481
           console.log(e, "文件下载失败downloadFile");
463 482
           uni.hideLoading();
464 483
           _this.loadFiles(path, finName);
465
-          
484
+
466 485
           // uni.showToast({
467 486
           //   title: "文件下载保存失败",
468 487
           //   icon: "error",