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

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

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