|
@@ -117,11 +117,22 @@
|
|
|
|
|
|
<div v-if="menuIndex < 10" style="padding-top: 10px;">
|
|
|
<label>下载类型:</label>
|
|
|
- <el-checkbox :value="true" style="opacity: 0.6; cursor: not-allowed;">主图</el-checkbox>
|
|
|
+ <el-checkbox-group :min="1" v-model="settingArr" style="display: inline-block;">
|
|
|
+ <el-checkbox label="mainImg">主图</el-checkbox>
|
|
|
+ <el-checkbox label="detailImg">详情图</el-checkbox>
|
|
|
+ <el-checkbox label="skuImg">SKU图</el-checkbox>
|
|
|
+ <el-checkbox label="commentImg" v-if="menuIndex == '3' || menuIndex == '4'">评论图</el-checkbox>
|
|
|
+ <el-checkbox label="video">视频</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ <el-popover placement="bottom" popper-class="popper-open" trigger="hover" content="下载类型至少选一个,评论图默认只下载商品首页展示的评论内容">
|
|
|
+ <i class="el-icon-info" slot="reference" style="margin-left: 10px; color: #F56C6C;"></i>
|
|
|
+ </el-popover>
|
|
|
+
|
|
|
+ <!-- <el-checkbox :value="true" style="opacity: 0.6; cursor: not-allowed;">主图</el-checkbox>
|
|
|
<el-checkbox v-model="settingData.detailImg" >详情图</el-checkbox>
|
|
|
<el-checkbox v-model="settingData.skuImg" >SKU图</el-checkbox>
|
|
|
<el-checkbox v-model="settingData.commentImg" v-if="menuIndex == '3' || menuIndex == '4'">评论图</el-checkbox>
|
|
|
- <el-checkbox v-model="settingData.video" >视频</el-checkbox>
|
|
|
+ <el-checkbox v-model="settingData.video" >视频</el-checkbox> -->
|
|
|
</div>
|
|
|
|
|
|
<!-- 天猫/淘宝 -->
|
|
@@ -270,6 +281,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ settingArr: ['mainImg'],
|
|
|
loginVisible: false,
|
|
|
addVisible: false,
|
|
|
formData: {
|
|
@@ -1090,7 +1102,7 @@
|
|
|
|
|
|
urlInfo.status = '3';
|
|
|
|
|
|
- if(detailUrl && this.settingData.detailImg){ // jd商品详情
|
|
|
+ if(detailUrl && this.settingArr.indexOf('detailImg') > -1){ // jd商品详情
|
|
|
try {
|
|
|
let data = await response.text();
|
|
|
if(data.indexOf('showdesc(') > -1){
|
|
@@ -1139,7 +1151,7 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(videoUrl && this.settingData.video){ // jd商品视频
|
|
|
+ if(videoUrl && this.settingArr.indexOf('video') > -1){ // jd商品视频
|
|
|
try {
|
|
|
let data = await response.text();
|
|
|
data = data.slice(0, -1).replace(/^jQuery[0-9]+\(/, '');
|
|
@@ -1172,7 +1184,7 @@
|
|
|
// let regex = /^https:\/\/img[0-9]+.360buyimg.com\/n/;
|
|
|
// if(regex.exec(response.url())){ // 匹配符合规则的图片路径
|
|
|
// let skuReg = /\/n[0-9]+\/s(60|40)x(80|40)_jfs\//;
|
|
|
- // if(response.url().match(skuReg) && this.settingData.skuImg){ // sku图片
|
|
|
+ // if(response.url().match(skuReg) && this.settingArr.indexOf('skuImg') > -1){ // sku图片
|
|
|
// let replaceStr = '/n1/s800x800_jfs/';
|
|
|
// if(response.url().match(/\/n[0-9]+\/s60x80_jfs\//)){
|
|
|
// replaceStr = '/n1/s750x1000_jfs/';
|
|
@@ -1313,7 +1325,7 @@
|
|
|
}
|
|
|
|
|
|
// sku图片下载
|
|
|
- if(this.settingData.skuImg){
|
|
|
+ if(this.settingArr.indexOf('skuImg') > -1){
|
|
|
for(let j = 0; j < imgInfo.skuImg.length; j++){
|
|
|
let fileName = imgInfo.skuImg[j].split('/').pop();
|
|
|
if(fileName){
|
|
@@ -1599,7 +1611,7 @@
|
|
|
}
|
|
|
|
|
|
// sku图片下载
|
|
|
- if(this.settingData.skuImg){
|
|
|
+ if(this.settingArr.indexOf('skuImg') > -1){
|
|
|
for(let j = 0; j < imgInfo.skuImg.length; j++){
|
|
|
let fileName = imgInfo.skuImg[j].split('/').pop();
|
|
|
if(fileName){
|
|
@@ -1625,7 +1637,7 @@
|
|
|
}
|
|
|
|
|
|
//详情图下载
|
|
|
- if(this.settingData.detailImg){
|
|
|
+ if(this.settingArr.indexOf('detailImg') > -1){
|
|
|
for(let j = 0; j < imgInfo.detailImg.length; j++){
|
|
|
let fileName = imgInfo.detailImg[j].split('/').pop();
|
|
|
if(fileName){
|
|
@@ -1651,7 +1663,7 @@
|
|
|
}
|
|
|
|
|
|
//评论图下载
|
|
|
- if(this.settingData.commentImg){
|
|
|
+ if(this.settingArr.indexOf('commentImg') > -1){
|
|
|
for(let j = 0; j < imgInfo.commentImg.length; j++){
|
|
|
let fileName = imgInfo.commentImg[j].split('/').pop();
|
|
|
if(fileName){
|
|
@@ -1677,7 +1689,7 @@
|
|
|
}
|
|
|
|
|
|
//视频下载
|
|
|
- if(this.settingData.video){
|
|
|
+ if(this.settingArr.indexOf('video') > -1){
|
|
|
for(let j = 0; j < imgInfo.video.length; j++){
|
|
|
let fileName = imgInfo.video[j].split('/').pop();
|
|
|
if(fileName){
|
|
@@ -1806,7 +1818,7 @@
|
|
|
}
|
|
|
|
|
|
// sku图片下载
|
|
|
- if(this.settingData.skuImg){
|
|
|
+ if(this.settingArr.indexOf('skuImg') > -1){
|
|
|
for(let j = 0; j < imgInfo.skuImg.length; j++){
|
|
|
let fileName = imgInfo.skuImg[j].split('/').pop();
|
|
|
if(fileName){
|
|
@@ -1832,7 +1844,7 @@
|
|
|
}
|
|
|
|
|
|
//详情图下载
|
|
|
- if(this.settingData.detailImg){
|
|
|
+ if(this.settingArr.indexOf('detailImg') > -1){
|
|
|
for(let j = 0; j < imgInfo.detailImg.length; j++){
|
|
|
let fileName = imgInfo.detailImg[j].split('/').pop();
|
|
|
if(fileName){
|
|
@@ -1858,7 +1870,7 @@
|
|
|
}
|
|
|
|
|
|
//评论图下载
|
|
|
- // if(this.settingData.commentImg){
|
|
|
+ // if(this.settingArr.indexOf('commentImg') > -1){
|
|
|
// for(let j = 0; j < imgInfo.commentImg.length; j++){
|
|
|
// let fileName = imgInfo.commentImg[j].split('/').pop();
|
|
|
// if(fileName){
|
|
@@ -1878,7 +1890,7 @@
|
|
|
// }
|
|
|
|
|
|
//视频下载
|
|
|
- if(this.settingData.video){
|
|
|
+ if(this.settingArr.indexOf('video') > -1){
|
|
|
for(let j = 0; j < imgInfo.video.length; j++){
|
|
|
let fileName = imgInfo.video[j].split('/').pop();
|
|
|
if(fileName){
|