|
|
@@ -30,20 +30,24 @@
|
|
|
</template>
|
|
|
<div class="text">今日拜访照片</div>
|
|
|
<div class="content-photos">
|
|
|
- <!-- <template v-for="item in reportTarget.photos">
|
|
|
- <template v-for="item1 in item.photos">
|
|
|
- <img :src="item1.baseUrl" crossorigin="anonymous" referrerpolicy="no-referrer" alt=""
|
|
|
- style="display: block; width: 188px; height: 188px; object-fit: cover" v-if="item1.baseUrl" />
|
|
|
- </template>photosData
|
|
|
- </template> -->
|
|
|
- <template v-for="item in photosData">
|
|
|
+ <template v-for="item in reportTarget.photos">
|
|
|
+ <template v-for="item1 in item.photos">
|
|
|
+ <img
|
|
|
+ :src="'data:image/jpg;base64,' + item1.base64Url"
|
|
|
+ crossorigin="anonymous"
|
|
|
+ referrerpolicy="no-referrer"
|
|
|
+ alt=""
|
|
|
+ style="display: block" />
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ <!-- <template v-for="item in photosData">
|
|
|
<img
|
|
|
:src="item"
|
|
|
crossorigin="anonymous"
|
|
|
referrerpolicy="no-referrer"
|
|
|
alt=""
|
|
|
style="display: block" />
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="footerShare">
|
|
|
@@ -92,29 +96,32 @@ export default {
|
|
|
this.creatQrCode();
|
|
|
// this.toastLoading(0, '生成中...', true);
|
|
|
// 使用Promise.all确保所有图片加载完成
|
|
|
- const photos = this.reportTarget.photos;
|
|
|
- const photoPromises = [];
|
|
|
+ // const photos = this.reportTarget.photos;
|
|
|
+ // const photoPromises = [];
|
|
|
|
|
|
- // 收集所有图片转换的Promise
|
|
|
- photos.forEach((item) => {
|
|
|
- item.photos.forEach((photo) => {
|
|
|
- photoPromises.push(this.imageUrlToBase64(photo.fileUrl));
|
|
|
- });
|
|
|
- });
|
|
|
+ // // 收集所有图片转换的Promise
|
|
|
+ // photos.forEach((item) => {
|
|
|
+ // item.photos.forEach((photo) => {
|
|
|
+ // photoPromises.push(this.imageUrlToBase64(photo.fileUrl));
|
|
|
+ // });
|
|
|
+ // });
|
|
|
|
|
|
- // 等待所有图片加载完成
|
|
|
- Promise.all(photoPromises)
|
|
|
- .then((photosArr) => {
|
|
|
- this.photosData = photosArr;
|
|
|
- this.$nextTick(async () => {
|
|
|
- // await this.htmlToCanvas();
|
|
|
- });
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- console.error('图片加载失败:', error);
|
|
|
- this.$toast('图片加载失败,请检查网络');
|
|
|
- });
|
|
|
- console.log(photos);
|
|
|
+ // // 等待所有图片加载完成
|
|
|
+ // Promise.all(photoPromises)
|
|
|
+ // .then((photosArr) => {
|
|
|
+ // this.photosData = photosArr;
|
|
|
+ // this.$nextTick(async () => {
|
|
|
+ // // await this.htmlToCanvas();
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+ // .catch((error) => {
|
|
|
+ // console.error('图片加载失败:', error);
|
|
|
+ // this.$toast('图片加载失败,请检查网络');
|
|
|
+ // });
|
|
|
+ // console.log(photos);
|
|
|
+ this.$nextTick(async () => {
|
|
|
+ await this.htmlToCanvas();
|
|
|
+ });
|
|
|
|
|
|
// 上拉边界下拉出现白色空白
|
|
|
let node = document.getElementsByClassName('share')[0];
|