qiushang vor 3 Wochen
Ursprung
Commit
9673a8ab26
4 geänderte Dateien mit 109 neuen und 40 gelöschten Zeilen
  1. 3 3
      nsis/test.nsi
  2. 1 1
      package.json
  3. 77 27
      src/renderer/components/header.vue
  4. 28 9
      src/renderer/components/home.vue

+ 3 - 3
nsis/test.nsi

@@ -1,16 +1,16 @@
 # ====================== 自定义宏 产品信息==============================
 !define PRODUCT_MID        		    "Ds8JqlRmiiGR"
-!define PRODUCT_VERSION        		"2.3.6.0"
+!define PRODUCT_VERSION        		"2.3.7.0"
 !define PRODUCT_NAME           		"星优图片下载助手"
 !define INSTALL_OUTPUT_NAME    		"XYCapture_XY.exe" 
 !define EXE_NAME               		"XYCapture.exe"
 !define PRODUCT_PATHNAME           	"XYCapture"     #安装卸载项用到的KEY,注册表
 !define INSTALL_APPEND_PATH         "XYCapture"     #安装路径追加的名称 
-!define APP_DOWNLOAD_URL    		"https://xy.xingyousoft.com/soft/XYCapture/lastest2.3.6.0.7z"
+!define APP_DOWNLOAD_URL    		"https://xy.xingyousoft.com/soft/XYCapture/lastest2.3.7.0.7z"
 !define PRODUCT_PUBLISHER      	    "苏州星优办公软件有限公司"
 !define PRODUCT_LEGAL          	    "苏州星优办公软件有限公司"
 !define STATISTICS_url              "https://www.xingyousoft.com/api/index/user_log"   # 统计网址
-!define UNINSTALL_url               "https://xy.xingyousoft.com/soft/XYCapture/uninstallWeb/?v=2.3.6.0"   # 接卸优惠网址
+!define UNINSTALL_url               "https://xy.xingyousoft.com/soft/XYCapture/uninstallWeb/?v=2.3.7.0"   # 接卸优惠网址
 
 # ====================== 自定义宏 安装信息==============================
 !define INSTALL_7Z_NAME 	   		"app.7z"

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 	"name": "XYCapture",
-	"version": "2.3.6.0",
+	"version": "2.3.7.0",
 	"author": "苏州星优办公软件有限公司",
 	"description": "An electron-vue project",
 	"license": "capture",

+ 77 - 27
src/renderer/components/header.vue

@@ -143,7 +143,7 @@
 				</el-row>
 				<el-divider content-position="left">
 					浏览器选择 
-					<el-popover placement="bottom" popper-class="popper-open" trigger="hover" content="用户可使用本地电脑的谷歌/Edge浏览器或软件内置的浏览器">
+					<el-popover placement="bottom" popper-class="popper-open" trigger="hover" content="用户可使用本地电脑的谷歌/Edge浏览器">
 						<i class="el-icon-info" slot="reference" style="margin-left: 10px; color: #F56C6C;"></i>
 					</el-popover>
 				</el-divider>
@@ -154,6 +154,10 @@
 					    <el-radio :label="2">内置浏览器</el-radio>
 					</el-radio-group>
 				</el-row>
+				<!-- <el-row style="text-align: center; margin-top: 10px;">
+					<el-input size="small" v-model="chromePath" placeholder="请输入本地Chrome/Edge浏览器启动地址" style="width: 75%;" clearable></el-input>
+					<el-link @click="chromeHelp('https://www.xingyousoft.com/news/detail/Z80IPpNVNNC1')" type="danger" style="text-decoration: underline; font-size: 12px;" :underline="false">查看如何输入</el-link>
+				</el-row> -->
 				<el-row style="text-align: center; margin-top: 10px;" v-if="chromeType == 1">
 					<el-input size="small" v-model="chromePath" placeholder="请输入本地Chrome/Edge浏览器启动地址" style="width: 75%;" clearable></el-input>
 					<el-link @click="chromeHelp('https://www.xingyousoft.com/news/detail/Z80IPpNVNNC1')" type="danger" style="text-decoration: underline; font-size: 12px;" :underline="false">查看如何输入</el-link>
@@ -238,9 +242,9 @@
 		<!-- 开发者模式 -->
 		<el-dialog title="开发者模式" :visible.sync="developerModal" width="400px" :close-on-click-modal="false" :close-on-press-escape="false">
 			<div>
-				<p style="text-align: center; color: #F56C6C;">开发者参数设置,软件退出后会重置</p>
-				<p style="text-align: center; color: #F56C6C;">(网络连接:networkidle2)</p>
-				<el-divider content-position="left">网络连接模式</el-divider>
+				<!-- <p style="text-align: center; color: #F56C6C;">开发者参数设置,软件退出后会重置</p> -->
+				<p style="text-align: center; color: #F56C6C;">(默认网络连接:networkidle2)</p>
+				<el-divider content-position="left">淘宝网络连接模式</el-divider>
 				<el-row style="text-align: center;">
 					<el-radio-group v-model="waitUntil">
 						<el-radio style="margin-bottom: 20px;" label="load">load</el-radio>
@@ -249,6 +253,15 @@
 						<el-radio style="margin-bottom: 20px;" label="networkidle2">networkidle2</el-radio>
 					</el-radio-group>
 				</el-row>
+				<el-divider content-position="left">非淘宝网络连接模式</el-divider>
+				<el-row style="text-align: center;">
+					<el-radio-group v-model="waitUntil2">
+						<el-radio style="margin-bottom: 20px;" label="load">load</el-radio>
+						<el-radio style="margin-bottom: 20px;" label="domcontentloaded">domcontentloaded</el-radio>
+						<el-radio style="margin-bottom: 20px;" label="networkidle0">networkidle0</el-radio>
+						<el-radio style="margin-bottom: 20px;" label="networkidle2">networkidle2</el-radio>
+					</el-radio-group>
+				</el-row>
 			</div>
 			<span slot="footer" class="dialog-footer">
 				<el-button type="primary" @click="saveDevelop" :loading="saveDevelopLoading">保存设置</el-button>
@@ -284,6 +297,9 @@
         name: "headerTop",
 		data(){
 			return {
+				edgePath: ['C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe',
+					'C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe',
+					'C:\\Program Files\\Microsoft\\Edge\\msedge.exe'],
 				sysInfo: {},
 				vipUrl: '',
 				loginUrl: '',
@@ -293,7 +309,7 @@
 				closeModel: false,
 				closeType: 2,
 				versionType: 2,
-				chromeType: 2,
+				chromeType: 1,
 				chromePath: '',
 				gap: 3,
 				gapRandom: 2,
@@ -351,6 +367,7 @@
 				developerModal: false,
 				headless: 1,
 				waitUntil: 'networkidle2',
+				waitUntil2: 'networkidle2',
 				
 				isRead: false,
 				noticeValue: {},
@@ -368,6 +385,28 @@
 				this.userInfo = this.$utils.getStorage('userInfo');
 			}
 			
+			if(!this.$utils.getStorage('chromePath')){ // 没有设置浏览器地址的时候判断
+				let flag = true;
+				for(let i = 0; i<this.edgePath.length; i++){
+					if (fs.existsSync(this.edgePath[i])) {
+						flag = false;
+						this.$utils.setStorage('chromePath', this.edgePath[i]);
+						this.$utils.setStorage('chromeType', 1);
+						break;
+					}
+				}
+				
+				if(flag){ // 当前电脑没有找到edge浏览器
+					this.chromeType = 2;
+					this.$utils.setStorage('chromeType', 2);
+					// this.$notify.error({
+					// 	title: '提示',
+					// 	message: '未扫描到Microsoft Edge浏览器地址,请手动在软件设置中配置浏览器地址,否则软件将无法使用!',
+					// 	duration: 0
+					// });
+				}
+			}
+			
 			window.addEventListener('message', e => {
 				if (e.origin === 'https://www.xingyousoft.com') {
 					if(e.data.userInfo){ // 返回用户信息
@@ -604,6 +643,7 @@
 				this.saveDevelopLoading = true;
 				this.$utils.setStorage('headless', this.headless);
 				this.$utils.setStorage('waitUntil', this.waitUntil);
+				this.$utils.setStorage('waitUntil2', this.waitUntil2);
 				setTimeout(() => {
 					this.saveDevelopLoading = false;
 					this.developerModal = false;
@@ -944,29 +984,39 @@
 						this.chromePath = chromePath;
 					}
 				} else if (e == 'developer'){ //开发者模式
-					let password = '9d0b17e04db20927047de3d09152db0f'; //默认密钥
-					this.$http.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';
-					this.$http.get(pjson.softInfo.downloadPrefix + '/' + pjson.name + "/developer.json?"+Math.random()).then((response) => {
-						let getResult = response.data || '';
-						if(getResult && typeof(response.data) == 'string'){
-							password = getResult;
-						}
-					}).catch(function(error){
-						console.log(error);
-					});
-					this.$prompt('请输入开发者密钥:', '提示', {
-					  confirmButtonText: '确定',
-					  cancelButtonText: '取消',
-					  inputPlaceholder: '请联系软件底部企业微信客服咨询使用',
-					}).then(({ value }) => {
-						if(value == password){
-							this.developerModal = true;
-						}else{
-							this.$message.error('密钥错误,已退出');
-						}
-					}).catch(() => {      
+					let waitUntil = this.$utils.getStorage('waitUntil');
+					if(waitUntil){
+						this.waitUntil = waitUntil;
+					}
 					
-					});
+					let waitUntil2 = this.$utils.getStorage('waitUntil2');
+					if(waitUntil2){
+						this.waitUntil2 = waitUntil2;
+					}
+					this.developerModal = true;
+					// let password = '9d0b17e04db20927047de3d09152db0f'; //默认密钥
+					// this.$http.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';
+					// this.$http.get(pjson.softInfo.downloadPrefix + '/' + pjson.name + "/developer.json?"+Math.random()).then((response) => {
+					// 	let getResult = response.data || '';
+					// 	if(getResult && typeof(response.data) == 'string'){
+					// 		password = getResult;
+					// 	}
+					// }).catch(function(error){
+					// 	console.log(error);
+					// });
+					// this.$prompt('请输入开发者密钥:', '提示', {
+					//   confirmButtonText: '确定',
+					//   cancelButtonText: '取消',
+					//   inputPlaceholder: '请联系软件底部企业微信客服咨询使用',
+					// }).then(({ value }) => {
+					// 	if(value == password){
+					// 		this.developerModal = true;
+					// 	}else{
+					// 		this.$message.error('密钥错误,已退出');
+					// 	}
+					// }).catch(() => {      
+					
+					// });
 				}
 			},
 		},

+ 28 - 9
src/renderer/components/home.vue

@@ -92,7 +92,7 @@
 										@click="del()">批量删除</el-button> -->
 								</el-button-group>
 								
-								<el-link type="info" style="margin-left: 10px; vertical-align:baseline; font-size: 12px;" @click="downloadExample()">导入模板<i class="el-icon-download"></i></el-link>
+								<el-link type="info" style="margin-left: 5px; vertical-align:baseline; font-size: 12px;" @click="downloadExample()">导入模板<i class="el-icon-download"></i></el-link>
 							</div>
 							
 							<el-row type="flex" style="align-items: center;">
@@ -542,8 +542,8 @@
 			}
 			
 			// 初始化开发者设置
-			this.$utils.setStorage('headless', 1);
-			this.$utils.setStorage('waitUntil', 'networkidle2');
+			// this.$utils.setStorage('headless', 1);
+			// this.$utils.setStorage('waitUntil', 'networkidle2');
 			
 			document.getElementById('ccc').addEventListener('contextmenu', e => {
 				e.preventDefault();
@@ -585,6 +585,7 @@
 						chromePath = chromePath.replace('chrome-win', 'chrome7');
 					}
 				}
+				// let chromePath = this.$utils.getStorage('chromePath');
 				return chromePath;
 			},
 			// 实时获取浏览器数据缓存
@@ -633,7 +634,8 @@
 					waitUntil: 'networkidle2'
 				};
 				let n1 = this.$utils.getStorage('exeType');
-				let n2 = this.$utils.getStorage('waitUntil');
+				let n2 = this.$utils.getStorage('waitUntil'); //淘宝的网络连接模式
+				let n3 = this.$utils.getStorage('waitUntil2');
 				if(n1){
 					if(n1 == 1){
 						develop.headless = true;
@@ -641,8 +643,19 @@
 						develop.headless = false;
 					}
 				}
-				if(n2){
-					develop.waitUntil = n2;
+				
+				if(this.menuIndex == '3' || this.menuIndex == '4'){ // 非淘宝网络连接设置
+					if(n2){
+						develop.waitUntil = n2;
+					}else{
+						develop.waitUntil = 'domcontentloaded';
+					}
+				}
+				
+				if(this.menuIndex != '3' && this.menuIndex != '4'){ // 非淘宝网络连接设置
+					if(n3){
+						develop.waitUntil = n3;
+					}
 				}
 				
 				return develop;
@@ -1946,6 +1959,13 @@
 							waitUntil = this.initDevelop().waitUntil;
 							await page.goto(urlInfo.url, {waitUntil : waitUntil});
 							
+							// 特殊处理
+							let nextBtn = await page.$x("//button[contains(text(), '快速进入')]");
+							if(nextBtn && nextBtn.length > 0){
+								nextBtn[0].click({force: true});
+								await page.waitForTimeout(3000);
+							}
+							
 							if(this.settingArr.indexOf('video') > -1){ // 用户选择下载视频的时候才会触发
 								//鼠标放在主图第一张,生成视频
 								const elementHandle = await page.$('[class*=thumbnail--]');
@@ -1960,7 +1980,6 @@
 								}
 							}
 							
-							
 							let frames = await page.$$('iframe');
 							if(frames.length == 1){ // 就一个
 								let isAdVisible = false;
@@ -3993,9 +4012,9 @@
 				}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);