|
@@ -296,27 +296,31 @@ export default {
|
|
|
that.$util.pageTo({ url: '/admin/clear/customInfo?id=' + id })
|
|
that.$util.pageTo({ url: '/admin/clear/customInfo?id=' + id })
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- /** 预览售后图片:传入完整列表与当前索引,支持左右滑动切换 */
|
|
|
|
|
|
|
+ /** 预览售后图片:urls 与列表缩略图同源,current 传 URL 避免 App 端滑动加载失败 */
|
|
|
showBig(index) {
|
|
showBig(index) {
|
|
|
const urls = this.getPreviewImageUrls()
|
|
const urls = this.getPreviewImageUrls()
|
|
|
if (!urls.length) {
|
|
if (!urls.length) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ const safeIndex = index >= 0 && index < urls.length ? index : 0
|
|
|
uni.previewImage({
|
|
uni.previewImage({
|
|
|
urls,
|
|
urls,
|
|
|
- current: index,
|
|
|
|
|
- loop: true
|
|
|
|
|
|
|
+ current: urls[safeIndex]
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- /** 优先大图列表,无大图时用小图列表 */
|
|
|
|
|
|
|
+ /** 与页面缩略图同源生成预览 URL,去掉 m_fill 裁切参数避免滑动时下一张一直加载 */
|
|
|
getPreviewImageUrls() {
|
|
getPreviewImageUrls() {
|
|
|
- if (this.info.bigImgList && !this.$util.isEmpty(this.info.bigImgList)) {
|
|
|
|
|
- return this.info.bigImgList
|
|
|
|
|
- }
|
|
|
|
|
- if (this.info.smallImgList && !this.$util.isEmpty(this.info.smallImgList)) {
|
|
|
|
|
- return this.info.smallImgList
|
|
|
|
|
|
|
+ const source = this.info.smallImgList && !this.$util.isEmpty(this.info.smallImgList)
|
|
|
|
|
+ ? this.info.smallImgList
|
|
|
|
|
+ : (this.info.bigImgList || [])
|
|
|
|
|
+ return source.map(url => this.normalizePreviewUrl(url)).filter(url => !!url)
|
|
|
|
|
+ },
|
|
|
|
|
+ normalizePreviewUrl(url) {
|
|
|
|
|
+ if (!url) {
|
|
|
|
|
+ return ''
|
|
|
}
|
|
}
|
|
|
- return []
|
|
|
|
|
|
|
+ const base = String(url).split('?')[0]
|
|
|
|
|
+ return base + '?x-oss-process=image/resize,w_1200'
|
|
|
},
|
|
},
|
|
|
goBack() {
|
|
goBack() {
|
|
|
uni.navigateBack()
|
|
uni.navigateBack()
|