Browse Source

[完善]新增和删除图片后更新viewer.js

develop
邵佳豪 4 years ago
parent
commit
1eb80784fe
  1. 9
      src/app/ui/collection-tools/collection-tools.component.ts

9
src/app/ui/collection-tools/collection-tools.component.ts

@ -65,11 +65,13 @@ export class CollectionToolsComponent implements OnInit {
canvasAssetObj //传入的素材属性对象
isImgNumCss = false //控制上传文件input显隐
mySwiper:any //轮播图实例
gallery
setAssetsProperty(obj){
setTimeout(() => {
obj.PropertyInfos.forEach(item => {
if(item.PropertyType == 4){
let gallery = new Viewer(document.getElementById('viewerjs'),{
this.gallery = new Viewer(document.getElementById('viewerjs'),{
url: 'data-original'
});
}
@ -314,6 +316,7 @@ export class CollectionToolsComponent implements OnInit {
this.imagesArr.push(imgObj)
this.canvasAssetObj.PropertyInfos.push(imgObj)
setTimeout(() => {
this.mySwiper = new Swiper('.swiper-container',{
loop: false,
@ -330,9 +333,8 @@ export class CollectionToolsComponent implements OnInit {
}
});
// this.mySwiper.update()
this.mySwiper.slideTo(this.imagesArr.length - 1)
this.gallery.update()
}, 0);
//判断上传素材属性图片是否超出数量 超出数量则隐藏input框
@ -378,6 +380,7 @@ export class CollectionToolsComponent implements OnInit {
//更新swiper视图
setTimeout(() => {
this.mySwiper.update();
this.gallery.update()
}, 0);
this.canvasData.isChange = true

Loading…
Cancel
Save