Skip to content

Commit

Permalink
add get news
Browse files Browse the repository at this point in the history
  • Loading branch information
ezshine committed Nov 6, 2020
1 parent 0e406f8 commit e871f87
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 2 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
src/dont_include/
src/dont_include.js
src/node_modules/
dist/
Binary file modified src/app.jsc
Binary file not shown.
Binary file added src/images/head_sheng.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/head_shuai.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/head_xia.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/head_yang.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
});
</script>
</head>
<body style="-webkit-app-region: drag;">
<body>
<div class='steamgear' style="width:600px;height:600px;">
<div id='buttons' style="width: 100%;height:100%;position: absolute;z-index: 10;display: flex;flex-direction: column;align-items:center;justify-content:center;">
<img class="imgButton" onclick="app.goJuejin()" src="images/btn_author.png" style="margin-top: 30px;"/>
Expand Down Expand Up @@ -113,5 +113,6 @@
</div>
<img src="images/back.png" class="back" style="z-index: 1;"/>
</div>
<div style="-webkit-app-region:drag;width: 100%;height: 80px;position: absolute;z-index: 99;background: rgba(0,0,0,0.01);left: 0;top:0;"></div>
</body>
</html>
28 changes: 27 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const fs = require("fs");
const package = require("./package.json");
const bn = require('bytenode');
const path = require('path');
const http = require('http');
const userDataPath = app.getPath ('userData');

let mainWindow;
Expand All @@ -26,6 +25,33 @@ var windowobj;
var defaultSize={width:300,height:300};
// if (process.platform == 'darwin') app.dock.hide();

ipcMain.on("showNotification",function(event,obj){
// console.log(obj);
showNotification(obj.msg,{title:obj.title,icon:obj.icon,click:()=>{
shell.openExternal(obj.url);
}})
})

function showNotification(msg='',options){
if(!Notification.isSupported())return;

if(!options)options={};

let notification = new Notification({
title: options.title??"提醒您",
body: msg,
icon:nativeImage.createFromPath(path.posix.join(__dirname,options.icon)),
silent: options.silent??false
})
notification.show();

if(options.click){
notification.addListener("click",function(e){
options.click();
});
}
}

function createMainWindow(loadpath) {
const {
width,
Expand Down
13 changes: 13 additions & 0 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"dependencies": {
"@tarojs/cli": "^3.0.15",
"axios": "^0.21.0",
"bytenode": "^1.1.7",
"cheerio": "^1.0.0-rc.3",
"child_process": "^1.0.2",
Expand Down

0 comments on commit e871f87

Please sign in to comment.