浏览代码

no message

zhujindu 2 周之前
父节点
当前提交
9da75c7251
共有 2 个文件被更改,包括 14 次插入10 次删除
  1. 13 9
      src/components/deleteUploadImgTaskPhoto.vue
  2. 1 1
      src/components/uploadVNormalTaskPhoto.vue

+ 13 - 9
src/components/deleteUploadImgTaskPhoto.vue

@@ -40,6 +40,7 @@ import { ImagePreview } from 'vant';
 import { removePhotoBatch } from '@/api/index';
 import uploadVNormalTaskPhoto from '@/components/uploadVNormalTaskPhoto';
 import { mapState } from 'vuex';
+import { getTicketFun } from '@/utils/TXApiFun';
 export default {
   name: 'deleteUploadImgTaskPhoto',
   components: { uploadVNormalTaskPhoto },
@@ -119,17 +120,20 @@ export default {
   //   },
   // },
   created() {
-    this.imgArr = [];
-    // <!-- 0=企业微信,1=H5相机 -->
-    if (this.formData) {
-      if (this.userInfo.photoMethod == '1') {
-        this.imgArr = this.formData.collectionItemList[0].fileInfoList || [];
-      } else {
-        if (this.formData.mediaInfos) {
-          this.downloadImage(this.formData.mediaInfos);
+    // 授权
+    getTicketFun(['downloadImage']).then(() => {
+      this.imgArr = [];
+      // <!-- 0=企业微信,1=H5相机 -->
+      if (this.formData) {
+        if (this.userInfo.photoMethod == '1') {
+          this.imgArr = this.formData.collectionItemList[0].fileInfoList || [];
+        } else {
+          if (this.formData.mediaInfos) {
+            this.downloadImage(this.formData.mediaInfos);
+          }
         }
       }
-    }
+    });
   },
   data() {
     return {

+ 1 - 1
src/components/uploadVNormalTaskPhoto.vue

@@ -172,7 +172,7 @@ export default {
               timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
               nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
               signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
-              jsApiList: ['ready', 'chooseImage', 'uploadImage', 'getLocation', 'downloadImage'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
+              jsApiList: ['ready', 'chooseImage', 'uploadImage', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
             });
             wx.ready(function () {
               wx.getLocation({