提交 19bf2018 authored 作者: JaxBBLL's avatar JaxBBLL

fix: photo

上级 023ee1b6
......@@ -70,9 +70,13 @@
v-for="(photo, index) in group"
:key="index"
class="card"
@click="previewPhoto(photo)"
@click="previewPhoto(photo, index)"
>
<image :src="photo.url" mode="center" class="photo"></image>
<image
:src="photo.imgPath"
mode="aspectFill"
class="photo"
></image>
<view
class="check-icon"
:class="{ active: photo.selected }"
......@@ -203,7 +207,7 @@ export default {
const base64 = await this.convertFileToBase64(tempFilePath);
const newPhoto = {
id: this.getFileName(tempFilePath),
url: base64,
// url: base64,
imgPath: saveRes.path,
date: moment().format("YYYY-MM-DD"),
time: moment().format("YYYY-MM-DD HH:mm"),
......@@ -293,10 +297,14 @@ export default {
},
// 其他功能
previewPhoto(photo) {
previewPhoto(photo, index) {
// uni.previewImage({
// urls: this.photos.map((p) => p.url),
// current: photo.url,
// });
uni.previewImage({
urls: this.photos.map((p) => p.url),
current: photo.url,
urls: this.photos.map((p) => p.imgPath),
current: index,
});
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论