提交 b4b0fb05 编写于 作者: shuang.zhou's avatar shuang.zhou

Merge branch 'teasing/3.21.0' into 'release'

Teasing/3.21.0

See merge request com.pica.cloud.education.frontend/pica.cloud.web-education-admin!360
......@@ -51,10 +51,12 @@ let errorCode = new Map([
[701,'在断点续上传过程中,后续上传接收地址不正确或ctx信息已过期。']
]);
let qiniuErrorCheck = function (code) {
let qiniuErrorCheck = function (code,self) {
errorCode.forEach(function (value, key, map) {
if (code === key){
self.$message.error(value);
console.error(key+':'+value)
}
})
}
......@@ -243,7 +245,7 @@ export const qiniuUpload = (self, file, filePath, previewId, progressId) => {
console.log("七牛上传失败,详细信息请参考:https://developer.qiniu.com/kodo/api/3928/error-responses");
//输出简略错误信息
if (err.isRequestError){
qiniuErrorCheck(err.code)
qiniuErrorCheck(err.code,self)
}else {
console.error(err);
}
......@@ -428,7 +430,7 @@ export const doUpload = (self, file, filePath, previewId, progressId, fileType)
console.log("七牛上传失败,详细信息请参考:https://developer.qiniu.com/kodo/api/3928/error-responses");
//输出简略错误信息
if (err.isRequestError){
qiniuErrorCheck(err.code)
qiniuErrorCheck(err.code,self)
}else {
console.error(err);
}
......
......@@ -75,7 +75,7 @@
<img class="bg-img" src="../../assets/image/small.png" v-if="fileGoodsList.length < 6"/>
<div class="limit-text" v-if="fileGoodsList.length < 6">
<!-- <p>限制大小: 200kb</p> -->
<p>建议尺寸:750*420</p>
<p>建议尺寸:750*750</p>
<p>支持jpeg, png格式</p>
</div>
</el-upload>
......@@ -103,7 +103,7 @@
<div class="limit-text" v-if="videoList.length <1">
<p>建议大小:20M以内</p>
<p>仅支持MP4格式</p>
<P>建议视频文件名格式:举例(GXY_001_02_03.mp4)</P>
<P>视频名称必须包含3个下划线:举例(YQ_01_02_03.mp4)</P>
</div>
</el-upload>
......@@ -1120,6 +1120,19 @@
}
},
methods: {
// 判断imgurl是否有效
checkImgExists(imgurl) {
return new Promise(function(resolve, reject) {
var ImgObj = new Image()
ImgObj.src = imgurl
ImgObj.onload = function(res) {
resolve(res)
}
ImgObj.onerror = function(err) {
reject(err)
}
})
},
// 获取适用人群
getTypeCodeList() {
return getTypeCodeList().then((res) => {
......@@ -1174,6 +1187,15 @@
this.videoList.push(goodsInfo.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;
this.rules = {
...this.rules,
......@@ -1209,7 +1231,7 @@
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType, expressLimitFlag };
this.hasRepoFlag = hasRepoFlag;
this.buyLimitDtoList = this.formData.buyLimitDtoList;
this.formData.optPrice = this.formData.costPrice/100;
this.formData.optPrice = this.formData.costPrice/100;
this.fileGoodsList = this.getImges(goodsList[0].goodsImgList,1);
this.fileIntrList = this.getImges(goodsList[0].medicImgList,2);
this.formData.stock = this.formData.goodsStock;
......@@ -1218,7 +1240,15 @@
this.videoList.push(goodsList[0].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;
if(this.isMedic){
this.getLever(5,2,1)
}else{
......@@ -1629,7 +1659,10 @@
vm.slide2.oriUrl = theFile.target.result;
image.onload = function () {
let _this = this;
console.log(_this.width,_this.height)
if (_this.width !== 750 || _this.height !== 750) {
vm.$message.error("图片长宽尺寸必须为750*750");
return;
};
openLoading(vm);
doUpload(vm, file, getFilePath(file, null), "preview4", "progress1", 1).then(function (path) {
closeLoading(vm);
......
......@@ -634,7 +634,8 @@
uploadTemp(){
// let url = "https://file.yunqueyi.com/trade/store/goods_import_template.xlsx 'https://file.yunqueyi.com/trade/store/20210129/goods_import_template.xlsx'"
// const url = 'https://files.yunqueyi.com/template/goods_import_template_1.xlsx';
const url = 'https://test1-file.yunqueyi.com/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/common/20211103204355554.xlsx';
const url = 'https://files.yunqueyi.com/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/common/20211105150219553.xlsx';
window.location.href = url
},
getLever(id=0){
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册