storeBelieveInLight 1 год назад
Родитель
Сommit
198f862895
1 измененных файлов с 24 добавлено и 5 удалено
  1. 24 5
      shop/perating/activitecode.vue

+ 24 - 5
shop/perating/activitecode.vue

@@ -53,14 +53,14 @@
53
         ></image>
53
         ></image>
54
         <view class="downLoad-text"> 保存图片 </view>
54
         <view class="downLoad-text"> 保存图片 </view>
55
       </view> -->
55
       </view> -->
56
-      <!-- <view class="downLoadButton" @click="clickGeneratePicture2">
56
+      <view class="downLoadButton" @click="clickGeneratePicture2">
57
         <image
57
         <image
58
           class="downLoad-image"
58
           class="downLoad-image"
59
           src="../../static/saveImage.png"
59
           src="../../static/saveImage.png"
60
           mode=""
60
           mode=""
61
         ></image>
61
         ></image>
62
         <view class="downLoad-text"> 保存图片 </view>
62
         <view class="downLoad-text"> 保存图片 </view>
63
-      </view> -->
63
+      </view>
64
     </view>
64
     </view>
65
 
65
 
66
     <!-- ************************* 海报画板 **********************-->
66
     <!-- ************************* 海报画板 **********************-->
@@ -379,7 +379,26 @@ export default {
379
       });
379
       });
380
     },
380
     },
381
     clickGeneratePicture2() {
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
     saveImage() {
404
     saveImage() {
@@ -424,7 +443,7 @@ export default {
424
 
443
 
425
     fileDwonload(base64Data, path) {
444
     fileDwonload(base64Data, path) {
426
       uni.showLoading({ title: "保存中...", mask: true });
445
       uni.showLoading({ title: "保存中...", mask: true });
427
-   const _this =this
446
+      const _this = this;
428
       // const blob = this.base64ToBlob(base64Data);
447
       // const blob = this.base64ToBlob(base64Data);
429
       // const blobUrl = URL.createObjectURL(blob);
448
       // const blobUrl = URL.createObjectURL(blob);
430
       const finName = "海报.jpg";
449
       const finName = "海报.jpg";
@@ -462,7 +481,7 @@ export default {
462
           console.log(e, "文件下载失败downloadFile");
481
           console.log(e, "文件下载失败downloadFile");
463
           uni.hideLoading();
482
           uni.hideLoading();
464
           _this.loadFiles(path, finName);
483
           _this.loadFiles(path, finName);
465
-          
484
+
466
           // uni.showToast({
485
           // uni.showToast({
467
           //   title: "文件下载保存失败",
486
           //   title: "文件下载保存失败",
468
           //   icon: "error",
487
           //   icon: "error",