|
|
@@ -12,7 +12,7 @@
|
|
|
<el-row type="flex" align="middle" justify="space-between">
|
|
|
<div>
|
|
|
<span>链接平台:</span>
|
|
|
- <el-radio-group v-model="menuIndex" size="mini" style="margin-right: 20px;">
|
|
|
+ <el-radio-group v-model="menuIndex" size="mini" style="margin-right: 10px;">
|
|
|
<!-- <el-radio-button label="3" size="mini">天猫</el-radio-button> -->
|
|
|
<el-radio-button label="4" size="mini">淘宝/天猫</el-radio-button>
|
|
|
<el-radio-button label="1" size="mini">1688</el-radio-button>
|
|
|
@@ -20,9 +20,16 @@
|
|
|
<el-radio-button label="5" size="mini">小红书</el-radio-button>
|
|
|
<el-radio-button label="10" size="mini">其他</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
+
|
|
|
+ <a href="https://www.xingyousoft.com/help2">
|
|
|
+ <el-link type="danger" style="font-size: 12px;">点击查看网址格式</el-link>
|
|
|
+ </a>
|
|
|
+ <el-popover placement="bottom" popper-class="popper-open" trigger="hover" content="https://www.xingyousoft.com/help2">
|
|
|
+ <i class="el-icon-info" slot="reference" style="color: #F56C6C; vertical-align: middle;"></i>
|
|
|
+ </el-popover>
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
-
|
|
|
<!-- 阿里巴巴账号 -->
|
|
|
<template v-if="menuIndex == '1'">
|
|
|
<div>
|
|
|
@@ -65,7 +72,7 @@
|
|
|
|
|
|
<!-- 其他 -->
|
|
|
<template v-if="menuIndex == '10'">
|
|
|
- <el-link type="danger" :underline="false" style="font-size: 12px;font-weight: 600;">其他平台仅提供试用,非会员功能</el-link>
|
|
|
+ <el-link type="danger" :underline="false" style="font-size: 12px;font-weight: 600;">其他平台仅提供试用,非会员功能</el-link>
|
|
|
</template>
|
|
|
</el-row>
|
|
|
|
|
|
@@ -75,6 +82,8 @@
|
|
|
<el-radio :label="1">后台运行</el-radio>
|
|
|
<el-radio :label="2">前台显示</el-radio>
|
|
|
</el-radio-group>
|
|
|
+
|
|
|
+ <el-link v-if="exeType == 2" :underline="false" style="font-size: 12px; margin-left: 5px;">会调起浏览器,请不要操作页面或关闭浏览器,可最小化窗口</el-link>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
@@ -218,7 +227,7 @@
|
|
|
commonList: [],
|
|
|
alibabaShop: {},
|
|
|
|
|
|
- execNum: 100, //限制
|
|
|
+ execNum: 5, //限制
|
|
|
checkLoading: false, //点击检测登录状态
|
|
|
tbStatus: 1, // 1、未检测 2、已经登录 3、未登录
|
|
|
jdStatus: 1, // 1、未检测 2、已经登录 3、未登录
|
|
|
@@ -373,10 +382,6 @@
|
|
|
return null;
|
|
|
}
|
|
|
},
|
|
|
- checkAuthority(){
|
|
|
- let authority = this.$refs.headerRef.authority;
|
|
|
- this.$refs.imgRef.authority = authority;
|
|
|
- },
|
|
|
// 选择目录
|
|
|
pickPath() {
|
|
|
this.$refs['upload-input'].blur();
|
|
|
@@ -469,6 +474,14 @@
|
|
|
},
|
|
|
//导出全部链接
|
|
|
exportLinks(){
|
|
|
+ let authority = this.$refs.headerRef.authority.isAuthority;
|
|
|
+ if(!authority){
|
|
|
+ this.$notify.warning({
|
|
|
+ title: '提示',
|
|
|
+ message: '导出全部链接功能需开通会员'
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
let allRows = {
|
|
|
title: '商品链接汇总',
|
|
|
urls: [],
|
|
|
@@ -509,6 +522,7 @@
|
|
|
},
|
|
|
// 导出单页链接
|
|
|
exportPageLinks(row){
|
|
|
+ let authority = this.$refs.headerRef.authority.isAuthority;
|
|
|
row.loading = true;
|
|
|
let filename = row.title + '-' + this.$utils.formatFileTime() +'.xlsx';
|
|
|
let sheet1 = [['序号','商品ID','商品标题','商品链接','价格','销量','店铺名称','店铺地址','首图地址']];
|
|
|
@@ -529,8 +543,12 @@
|
|
|
}else if(this.menuIndex == '10'){
|
|
|
info = [i+1, item.title, item.href];
|
|
|
}
|
|
|
-
|
|
|
- sheet1.push(info);
|
|
|
+ if(!authority && i < this.execNum){
|
|
|
+ sheet1.push(info);
|
|
|
+ }
|
|
|
+ if(authority){
|
|
|
+ sheet1.push(info);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
let buffer = xlsx.build([
|
|
|
@@ -567,10 +585,7 @@
|
|
|
this.loginBrowser = null;
|
|
|
}
|
|
|
|
|
|
- let index = Number(this.menuIndex) - 1;
|
|
|
-
|
|
|
if(this.menuIndex == '1'){ // 阿里巴巴
|
|
|
- this.alibabaList = [];
|
|
|
if(this.alibabaStatus == 1 || this.alibabaStatus == 3){ // 未检测登录状态/或提示未登录状态,开始检测
|
|
|
await this.checkAlibabaLogin().then((data) => {
|
|
|
if(data != 2){ // 未登录
|
|
|
@@ -643,9 +658,9 @@
|
|
|
}
|
|
|
|
|
|
let userDataDir = this.initDataDir();
|
|
|
- if(this.menuIndex == '2'){
|
|
|
- userDataDir = this.initDataDir('jd');
|
|
|
- }
|
|
|
+ let index = Number(this.menuIndex) - 1;
|
|
|
+ let type = listNameArr[index];
|
|
|
+ this[type+'List'] = [];
|
|
|
// 运行不同平台的浏览器
|
|
|
puppeteer.use(StealthPlugin());
|
|
|
let browserName = listNameArr[index] + 'Browser';
|
|
|
@@ -693,32 +708,10 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- /**
|
|
|
- * 1、搜索页面
|
|
|
- * https://s.taobao.com/search?initiative_id=staobaoz_20251013&page=1&q=123&tab=all
|
|
|
- * https://search.taobao.com/search?initiative_id=staobaoz_20251013&page=1&q=123&tab=all
|
|
|
- *
|
|
|
- * 2、淘宝店铺主页
|
|
|
- * https://shop129008953.taobao.com/shop/view_shop.htm?appUid=RAzN8HWKfxsFarWFEi9gLm2itTXHaYPr4nA4TWswCv3gerYvjs8&spm=a21n57.1.hoverItem.10
|
|
|
- * https://yyyy.taobao.com
|
|
|
- * 淘宝店铺搜索
|
|
|
- * https://shop71610707.taobao.com/search.htm?keyword=%B4%BA%D6%F1%D1%F2%C3%AB%BF%E3%C4%D0&spm=a21xtw.29178619.0.0
|
|
|
- *
|
|
|
- * 3、天猫店铺主页
|
|
|
- * https://cexu.tmall.com/shop/view_shop.htm?appUid=RAzN8HWRk67qBqZaMatNxpJ7z2rznpMGpbayXUUXf5rWRaQ5EVP&spm=a21n57.1.hoverItem.2
|
|
|
- * 天猫店铺搜索
|
|
|
- * https://cexu.tmall.com/search.htm?keyword=%D0%C2%D6%D0%CA%BD%C4%D0%D7%B0&spm=a21xtw.29178619.0.0
|
|
|
- *
|
|
|
- * 5、天猫国际店铺主页
|
|
|
- * https://jp.tmall.hk/?spm=a1z10.3-b.1997427721.d4918089.13aa32643EEzRU
|
|
|
- *
|
|
|
- **/
|
|
|
-
|
|
|
// 天猫/淘宝扫描网址
|
|
|
tbScanUrl(url){
|
|
|
(async () => {
|
|
|
try{
|
|
|
- let authority = this.$refs.headerRef.authority.isAuthority;
|
|
|
let page = await this.tbBrowser.newPage();
|
|
|
let waitUntil = 'networkidle2';
|
|
|
waitUntil = this.initDevelop().waitUntil;
|
|
|
@@ -933,7 +926,6 @@
|
|
|
alibabaScanUrl(url){
|
|
|
(async () => {
|
|
|
try{
|
|
|
- let authority = this.$refs.headerRef.authority.isAuthority;
|
|
|
let page = await this.alibabaBrowser.newPage();
|
|
|
let gapTime = Number(this.initGap()) * 1000;
|
|
|
|
|
|
@@ -1047,7 +1039,6 @@
|
|
|
jdScanUrl(url){
|
|
|
(async () => {
|
|
|
try{
|
|
|
- let authority = this.$refs.headerRef.authority.isAuthority;
|
|
|
let page = await this.jdBrowser.newPage();
|
|
|
let gapTime = Number(this.initGap()) * 1000;
|
|
|
|
|
|
@@ -1110,7 +1101,6 @@
|
|
|
redScanUrl(url){
|
|
|
(async () => {
|
|
|
try{
|
|
|
- let authority = this.$refs.headerRef.authority.isAuthority;
|
|
|
let page = await this.redBrowser.newPage();
|
|
|
|
|
|
|
|
|
@@ -1225,7 +1215,6 @@
|
|
|
commonScanUrl(url){
|
|
|
(async () => {
|
|
|
try{
|
|
|
- let authority = this.$refs.headerRef.authority.isAuthority;
|
|
|
let page = await this.commonBrowser.newPage();
|
|
|
|
|
|
|
|
|
@@ -1504,9 +1493,28 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //主图
|
|
|
- let arr1 = document.querySelectorAll('dl[class^=item]');
|
|
|
- for(let i=0; i< arr1.length; i++){
|
|
|
+ //主图
|
|
|
+ let arr1 = document.querySelectorAll('#J_ShopSearchResult dl[class^=item]');
|
|
|
+ if(arr1 && arr1.length == 0){
|
|
|
+ arr1 = document.querySelectorAll('dl[class^=item]');
|
|
|
+ }
|
|
|
+ let comboDom = document.querySelector('.comboHd');
|
|
|
+ let comboLen = 0;
|
|
|
+ if(comboDom){ // 店铺推荐商品过滤掉
|
|
|
+ let len1 = 0, len2 = 0, len3 = 0;
|
|
|
+ if(comboDom.nextElementSibling){
|
|
|
+ len1 = comboDom.nextElementSibling.querySelectorAll('dl').length;
|
|
|
+ }
|
|
|
+ if(comboDom.nextElementSibling.nextElementSibling){
|
|
|
+ len2 = comboDom.nextElementSibling.nextElementSibling.querySelectorAll('dl').length;
|
|
|
+ }
|
|
|
+ if(comboDom.nextElementSibling.nextElementSibling.nextElementSibling){
|
|
|
+ len3 = comboDom.nextElementSibling.nextElementSibling.nextElementSibling.querySelectorAll('dl').length;
|
|
|
+ }
|
|
|
+ comboLen = len1 + len2 + len3;
|
|
|
+ }
|
|
|
+ let length = arr1.length-comboLen;
|
|
|
+ for(let i=0; i<length; i++){
|
|
|
let href = arr1[i].querySelector('[class^=photo] a').href;
|
|
|
let id = arr1[i].dataset.id;
|
|
|
let title = arr1[i].querySelector('[class^=item-name]') ? arr1[i].querySelector('[class^=item-name]').innerText : '淘宝商品'+new Date().getTime();
|
|
|
@@ -2092,6 +2100,7 @@
|
|
|
// 错误提示
|
|
|
showError(e){
|
|
|
let str = '';
|
|
|
+ // console.log(e.toString());
|
|
|
if(e.toString().indexOf('ERR_NAME_NOT_RESOLVE') > -1){
|
|
|
str = '无法解析该网址,请查看网址是否正确!-1';
|
|
|
}else if(e.toString().indexOf('Cannot navigate to invalid URL') > -1){
|
|
|
@@ -2103,12 +2112,11 @@
|
|
|
}else if(e.toString().indexOf('operation not permitted') > -1){
|
|
|
str = '权限受限,请以管理员权限运行软件!-5';
|
|
|
}else if(e.toString().indexOf('browser has disconnected') > -1){
|
|
|
- str = '内置浏览器已关闭!-6';
|
|
|
+ str = '浏览器已关闭!-6';
|
|
|
}else if(e.toString().indexOf('Failed to launch the browser') > -1){
|
|
|
- str = '请先关闭内置浏览器!-7';
|
|
|
+ str = '浏览器启动失败,请查看设置是否正确或重启电脑后重试!-7';
|
|
|
}else{
|
|
|
str = e.toString();
|
|
|
- //console.log(e);
|
|
|
}
|
|
|
this.loading = false;
|
|
|
this.$notify.error({
|