qiushang il y a 1 mois
Parent
commit
72ac596842
4 fichiers modifiés avec 95 ajouts et 12 suppressions
  1. 3 3
      nsis/test.nsi
  2. 1 1
      package.json
  3. 37 1
      src/renderer/components/header.vue
  4. 54 7
      src/renderer/components/home.vue

+ 3 - 3
nsis/test.nsi

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

+ 1 - 1
package.json

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

+ 37 - 1
src/renderer/components/header.vue

@@ -214,6 +214,17 @@
 				<el-button type="primary" @click="saveDevelop" :loading="saveDevelopLoading">保存设置</el-button>
 				<el-button type="primary" @click="saveDevelop" :loading="saveDevelopLoading">保存设置</el-button>
 			</span>
 			</span>
 		</el-dialog>
 		</el-dialog>
+		
+		<!-- 通知 -->
+		<el-dialog title="软件通知" :visible.sync="noticeModel" width="400px">
+			<div style="padding-left: 20px; line-height: 1.8;" v-html="noticeValue.desc">
+		
+			</div>
+			<span slot="footer" class="dialog-footer">
+				<el-checkbox v-model="isRead" style="float:left">我已知晓,7天内不再提醒</el-checkbox>
+				<el-button type="primary" size="small" @click="readClose">确定</el-button>
+			</span>
+		</el-dialog>
 
 
 	</div>
 	</div>
 </template>
 </template>
@@ -293,7 +304,11 @@
 				saveDevelopLoading: false,
 				saveDevelopLoading: false,
 				developerModal: false,
 				developerModal: false,
 				headless: 1,
 				headless: 1,
-				waitUntil: 'networkidle2'
+				waitUntil: 'networkidle2',
+				
+				isRead: false,
+				noticeValue: {},
+				noticeModel: false,
 			}
 			}
 		},
 		},
         props: {
         props: {
@@ -467,6 +482,14 @@
 				}
 				}
 				
 				
 			},
 			},
+			readClose(){
+				if(this.isRead == true){
+					this.$utils.setStorage('isRead', {token: true, expire: 60*60*24*7});
+				}else{
+					this.$utils.setStorage('isRead', false);
+				}
+				this.noticeModel = false;
+			},
 			// 保存设置
 			// 保存设置
 			saveSetting(){
 			saveSetting(){
 				this.saveLoading = true;
 				this.saveLoading = true;
@@ -555,6 +578,19 @@
 					this.memberUrl = "https://www.xingyousoft.com/soft/reminder2/"+pjson.softInfo.softMid+"?p_mid="+pjson.softInfo.softMid+"&agent_mid="+this.sysInfo.agentMid+"&uuid="+windows_uuid+"&soft_type="+this.sysInfo.softType;
 					this.memberUrl = "https://www.xingyousoft.com/soft/reminder2/"+pjson.softInfo.softMid+"?p_mid="+pjson.softInfo.softMid+"&agent_mid="+this.sysInfo.agentMid+"&uuid="+windows_uuid+"&soft_type="+this.sysInfo.softType;
 				});
 				});
 				
 				
+				
+				this.$http.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';
+				this.$http.get(pjson.softInfo.downloadPrefix + '/' + pjson.name + "/notice.json?"+Math.random()).then((response) => {
+					this.noticeValue = response.data || {};
+					let nowTime = new Date().getTime();
+					let isRead = this.$utils.getStorage('isRead');
+					if(this.noticeValue.t > nowTime && !isRead){
+						this.noticeModel = true;
+					}
+				}).catch(function(error){
+					console.log(error);
+				});
+				
 			},
 			},
 			// 刷新登录二维码
 			// 刷新登录二维码
 			refreshCode() {
 			refreshCode() {

+ 54 - 7
src/renderer/components/home.vue

@@ -376,7 +376,7 @@
 					],
 					],
 					url: [
 					url: [
 						{ required: true, message: '请输入网页链接', trigger: 'blur' },
 						{ required: true, message: '请输入网页链接', trigger: 'blur' },
-						{ pattern: /^(http|https):\/\/.+$/, message: '请输入正确的网址链接(http://或https://开头)', trigger: 'blur' } 
+						{ pattern: /^(http|https):\/\/.+$/, message: '请输入正确的网址链接(http://或https://开头),结尾不能有换行符', trigger: 'blur' } 
 					],
 					],
 				},
 				},
 				tabLoading: false,
 				tabLoading: false,
@@ -771,6 +771,10 @@
 						    const newProto = navigator.__proto__;
 						    const newProto = navigator.__proto__;
 							delete newProto.webdriver;
 							delete newProto.webdriver;
 							navigator.__proto__ = newProto;
 							navigator.__proto__ = newProto;
+							
+							window.navigator.chrome = {
+								runtime: {}
+							};
 						});
 						});
 						await page.goto(url, {waitUntil : 'networkidle2'});
 						await page.goto(url, {waitUntil : 'networkidle2'});
 					}catch(e){
 					}catch(e){
@@ -1395,6 +1399,10 @@
 							    const newProto = navigator.__proto__;
 							    const newProto = navigator.__proto__;
 								delete newProto.webdriver;
 								delete newProto.webdriver;
 								navigator.__proto__ = newProto;
 								navigator.__proto__ = newProto;
+								
+								window.navigator.chrome = {
+									runtime: {}
+								};
 							});
 							});
 							
 							
 							let jdImgInfo = {
 							let jdImgInfo = {
@@ -1520,7 +1528,6 @@
 							});
 							});
 							await page.goto(urlInfo.url, {waitUntil : 'networkidle2'});
 							await page.goto(urlInfo.url, {waitUntil : 'networkidle2'});
 							
 							
-							
 							let pageInfo = await page.evaluate(() => {
 							let pageInfo = await page.evaluate(() => {
 								let cHeight = document.documentElement.clientHeight;
 								let cHeight = document.documentElement.clientHeight;
 								let scrollHeight = document.body.scrollHeight;
 								let scrollHeight = document.body.scrollHeight;
@@ -1564,6 +1571,7 @@
 										let outObj = {
 										let outObj = {
 											mainImg: [],
 											mainImg: [],
 											skuImg: [],
 											skuImg: [],
+											detailImg: []
 										};
 										};
 										//主图 
 										//主图 
 										let arr1 = document.querySelectorAll('#spec-list img');
 										let arr1 = document.querySelectorAll('#spec-list img');
@@ -1572,9 +1580,9 @@
 											let reg = /\/n[0-9]+\/jfs\//;
 											let reg = /\/n[0-9]+\/jfs\//;
 											let reg2 = /\/n[0-9]+\/s([0-9]+)x([0-9]+)_jfs\//;
 											let reg2 = /\/n[0-9]+\/s([0-9]+)x([0-9]+)_jfs\//;
 											let reg3 = /![a-z]+_[0-9]+x[0-9]+(.avif)?/;
 											let reg3 = /![a-z]+_[0-9]+x[0-9]+(.avif)?/;
-											let replaceStr = '/n1/s800x800_jfs/';
+											let replaceStr = '/n5/s800x800_jfs/';
 											if(mainImgUrl.match(/\/n[0-9]+\/s50x66_jfs\//)){
 											if(mainImgUrl.match(/\/n[0-9]+\/s50x66_jfs\//)){
-												replaceStr = '/n1/s750x1000_jfs/';
+												replaceStr = '/n5/s750x1000_jfs/';
 											}
 											}
 											mainImgUrl = mainImgUrl.replace(reg, replaceStr).replace(reg2, replaceStr).replace(reg3, '').replace('.avif', '');
 											mainImgUrl = mainImgUrl.replace(reg, replaceStr).replace(reg2, replaceStr).replace(reg3, '').replace('.avif', '');
 										
 										
@@ -1590,9 +1598,9 @@
 										for(let i=0; i< arr2.length; i++){
 										for(let i=0; i< arr2.length; i++){
 											let skuImgUrl = arr2[i].src;
 											let skuImgUrl = arr2[i].src;
 											let skuReg = /\/n[0-9]+\/s([0-9]+)x([0-9]+)_jfs\//;
 											let skuReg = /\/n[0-9]+\/s([0-9]+)x([0-9]+)_jfs\//;
-											let replaceStr = '/n1/s800x800_jfs/';
+											let replaceStr = '/n5/s800x800_jfs/';
 											if(skuImgUrl.match(/\/n[0-9]+\/s60x80_jfs\//)){
 											if(skuImgUrl.match(/\/n[0-9]+\/s60x80_jfs\//)){
-												replaceStr = '/n1/s750x1000_jfs/';
+												replaceStr = '/n5/s750x1000_jfs/';
 											}
 											}
 											skuImgUrl = skuImgUrl.replace(skuReg, replaceStr).replace('.avif', '');
 											skuImgUrl = skuImgUrl.replace(skuReg, replaceStr).replace('.avif', '');
 											if(!authority && i < execNum){
 											if(!authority && i < execNum){
@@ -1601,7 +1609,19 @@
 											if(authority){
 											if(authority){
 												outObj.skuImg.push(skuImgUrl);
 												outObj.skuImg.push(skuImgUrl);
 											}
 											}
-											
+										}
+										
+										//详情图 - 图片类目需要网页直接抓取
+										let arr3 = document.querySelectorAll('.book-detail-content img');
+										for(let i=0; i< arr3.length; i++){
+											let detailImgUrl = arr3[i].src;
+											detailImgUrl = detailImgUrl.replace('.avif', '');
+											if(!authority && i < execNum){
+												outObj.detailImg.push(detailImgUrl);
+											}
+											if(authority){
+												outObj.detailImg.push(detailImgUrl);
+											}
 										}
 										}
 										
 										
 										return outObj;
 										return outObj;
@@ -1658,6 +1678,33 @@
 											}
 											}
 										}
 										}
 									}
 									}
+									
+									// 详情图下载 --图书类目
+									if(this.settingArr.indexOf('detailImg') > -1 && jdImgInfo.detailImg.length == 0){
+										for(let j = 0; j < imgInfo.detailImg.length; j++){
+											let fileName = imgInfo.detailImg[j].split('/').pop();
+											if(fileName){
+												let queryIndex = fileName.indexOf('?');
+												if (queryIndex !== -1) {
+													fileName = fileName.substr(0, queryIndex);
+												}
+												
+												let num = Number(j) + 1;
+												let suffix = '';
+												if(fileName.lastIndexOf('.') > -1){
+													suffix = fileName.substr(fileName.lastIndexOf('.'));
+												}
+												
+												if (!fs.existsSync(urlInfo.newPath + '\\详情图')) {
+													fs.mkdirSync(urlInfo.newPath + '\\详情图');
+												}
+												
+												let outputPath = urlInfo.newPath + '\\详情图\\详情图' + num + suffix;
+												await this.downloadImage(imgInfo.detailImg[j], outputPath, urlInfo);
+											}
+										}
+									}
+									
 									/**end**/
 									/**end**/
 									await page.close();
 									await page.close();
 									urlInfo.status = '4';
 									urlInfo.status = '4';