提交 e339445d 编写于 作者: xinglee23's avatar xinglee23

fix: bugfix 工作站-商品详情页-商品头图反复点击进入会无规则排序;

上级 aa33851e
......@@ -130,7 +130,7 @@
:on-exceed="imgExceed"
:limit="6"
>
<div :key="index" v-for="(item,index) in fileGoodsList">
<div :key="item.id" v-for="(item, index) in fileGoodsList">
<div class="img-box">
<div class="file-pics" v-if="fileGoodsList.length > 0" >
<img :src="item.url" @mouseover.stop="headIndex=index" class="bg-img"/>
......@@ -1083,46 +1083,41 @@ import { originRules, originRules1, originRules3 } from './common/rules';
this.formData.optPrice = this.formData.costPrice/100;
this.formData.realCostPrice = this.formData.realCostPrice/100;
this.formData.scorePerformance = this.formData.scorePerformance/100;
this.fileGoodsList = this.getImges(goodDet.goodsImgList,1);
this.fileIntrList = this.getImges(goodDet.goodsDetailImageList,2);
this.fileGoodsList = this.getImages(goodDet.goodsImgList,1);
this.fileIntrList = this.getImages(goodDet.goodsDetailImageList,2);
this.formData.stock = this.formData.goodsStock;
this.formData.reimburseMax = this.formData.reimburseMax/100;
if (goodDet.goodsVideoList.length > 0) {
this.videoList.push(goodDet.goodsVideoList[0]);
this.videoModel.videoFullPath = this.videoList[0].goodsImgUrl;
}
let newImgList = [];
this.fileGoodsList.map((item,index) => {
this.checkImgExists(item.imageUrl).then(()=> {
newImgList.push(item)
}).catch(()=> {
newImgList = this.fileGoodsList.splice(index,1);
})
})
this.fileGoodsList = newImgList;
// let newImgList = [];
// this.fileGoodsList.map((item, index) => {
// this.checkImgExists(item.imageUrl).then(()=> {
// newImgList.push(item)
// }).catch(()=> {
// newImgList = this.fileGoodsList.splice(index,1);
// })
// })
// this.fileGoodsList = newImgList;
this.rules = {
...this.rules,
...originRules
};
},
getImges(d,type){
let a = [];
if(d.length > 0){
for(let i=0;i<d.length;i++){
a.push({
url:type==1 ?d[i].goodsImgUrl :d[i].imageUrl,
imageUrl:type==1 ?d[i].goodsImgUrl :d[i].imageUrl,
goodsImgUrl:type==1 ?d[i].goodsImgUrl :d[i].imageUrl,
id: d[i].id,
imageSort: d[i].imageSort,
imgSort: d[i].imgSort,
imageType: type == 1 ? d[i].imgType : d[i].imageType,
miniProgramShow: d[i].miniProgramShow===0?0:1,
})
}
}
return a;
getImages(d, type) {
return d.map(v => ({
url: type == 1 ? v.goodsImgUrl : v.imageUrl,
imageUrl: type == 1 ? v.goodsImgUrl : v.imageUrl,
goodsImgUrl: type == 1 ? v.goodsImgUrl : v.imageUrl,
id: v.id,
imageSort: v.imageSort,
imgSort: v.imgSort,
imageType: type == 1 ? v.imgType : v.imageType,
miniProgramShow: v.miniProgramShow === 0 ? 0 : 1,
})
);
},
// 修改条形码
changeBarCode(val) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册