zjh
2025-05-22 56c8021dcbfc13a24ad13c783bb5fb23a9afd318
pages/QC/LLJ/ImageItemALL.vue
@@ -107,7 +107,8 @@
      uni.chooseImage({
        sourceType: sourceTypeArray[this.sourceTypeIndex],
        sizeType: sizeTypeArray[this.sizeTypeIndex],
        //sizeType: sizeTypeArray[this.sizeTypeIndex],
       sizeType: ['compressed'], // 强制使用压缩模式
        crop: this.isCrop ? {
          "quality": this.cropPercent,
          "width": this.cropWidth,
@@ -116,7 +117,7 @@
        } : null,
        count: this.qsImage.length + this.count[this.countIndex] > 9 ? 9 - this.qsImage.length : this.count[this.countIndex],
        success: (res) => {
          let url = res.tempFilePaths[0];
          pathToBase64(url)
              .then(base64 => {
                // 找到最后一个斜杠的位置
@@ -135,6 +136,7 @@
              .catch(error => {
                console.error(error)
              })
        },
        fail: (err) => {
          console.log("err: ", JSON.stringify(err));
@@ -142,11 +144,24 @@
      });
    },
    previewImage(index) {
      // console.log(this.qsImage.map(s=>s.img)[0])
      let imagesArry = [];
      base64ToPath(this.qsImage.map(s=>s.img)[index]).then(path => {
                  uni.hideLoading();
                   imagesArry[0] = path
                  console.log(path);
                  uni.previewImage({
                     current: 0,
                     urls: imagesArry
                  })
               })
      // uni.previewImage({
      //   current: index, // 设置当前显示图片的链接
      //   current: '0', // 设置当前显示图片的链接
      //   urls: this.qsImage.map(s=>s.img), // 需要预览的图片链接列表
      //   loop: false, // 是否开启图片轮播,默认为 false
      //   indicator: 'default',// 图片指示器类型,可选值为 "default"、"number"、"pointer",默认为 "default"
      //   indicator: 'pointer',// 图片指示器类型,可选值为 "default"、"number"、"pointer",默认为 "default"
      // });
    },
    init() {