deeke-script-app 1.6.7 → 1.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@deekeScript/@type/Class/Global.d.ts +1 -1
- package/@deekeScript/@type/Class/Rect.d.ts +16 -16
- package/@deekeScript/@type/Class/UiSelector.d.ts +201 -201
- package/@deekeScript/@type/Class/WebSocket.d.ts +49 -49
- package/@deekeScript/@type/interface/Access.d.ts +104 -71
- package/@deekeScript/@type/interface/App.d.ts +101 -93
- package/@deekeScript/@type/interface/DeekeScriptJson.d.ts +13 -13
- package/@deekeScript/@type/interface/Device.d.ts +88 -88
- package/@deekeScript/@type/interface/Encrypt.d.ts +58 -58
- package/@deekeScript/@type/interface/Engines.d.ts +39 -39
- package/@deekeScript/@type/interface/Files.d.ts +283 -0
- package/@deekeScript/@type/interface/FloatDialogs.d.ts +41 -35
- package/@deekeScript/@type/interface/ForegroundServiceBridge.d.ts +31 -31
- package/@deekeScript/@type/interface/Hid.d.ts +342 -342
- package/@deekeScript/@type/interface/Http.d.ts +41 -41
- package/@deekeScript/@type/interface/Images.d.ts +71 -71
- package/@deekeScript/@type/interface/Java.d.ts +7 -7
- package/@deekeScript/@type/interface/KeyBoards.d.ts +27 -27
- package/@deekeScript/@type/interface/Log.d.ts +16 -16
- package/@deekeScript/@type/interface/MediaStore.d.ts +146 -0
- package/@deekeScript/@type/interface/NotificationBridge.d.ts +28 -28
- package/@deekeScript/@type/interface/{SocketIOClient.d.ts → SocketIoClient.d.ts} +76 -76
- package/@deekeScript/@type/interface/Storage.d.ts +119 -110
- package/@deekeScript/@type/interface/System.d.ts +114 -114
- package/@deekeScript/@type/interface/UiObject.d.ts +197 -197
- package/README.md +67 -67
- package/deekeScript.json +669 -669
- package/deekeScriptZipBuild +48 -48
- package/gulpfile +17 -17
- package/images/test/statistics.png +0 -0
- package/init +32 -32
- package/jsconfig.json +11 -11
- package/package.json +43 -43
- package/script/statistics/statistics.js +120 -120
- package/script/task.html +4 -4
- package/src/statistics/statistics.js +120 -120
- package/src/task/douyin_zan.js +89 -89
- package/src/task/dy.js +14 -14
- package/src/task/dyApp.js +7 -7
- package/src/task/tool.js +19 -19
- package/src/task.html +4 -4
- package/uglify-config.json +15 -15
package/deekeScriptZipBuild
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
const path = require('path'); // CommonJS 方式引入 path:ml-citation{ref="1,2" data="citationList"}
|
|
2
|
-
const fs = require('fs'); // 引入 fs 模块:ml-citation{ref="5" data="citationList"}
|
|
3
|
-
const AdmZip = require('adm-zip'); // 引入 adm-zip 库:ml-citation{ref="3,4" data="citationList"}
|
|
4
|
-
|
|
5
|
-
// 获取上层目录路径
|
|
6
|
-
// const parentDir = path.join(__dirname, '..');
|
|
7
|
-
const parentDir = __dirname;
|
|
8
|
-
console.log('开始执行打包');
|
|
9
|
-
|
|
10
|
-
fs.unlink(path.join(parentDir, 'deekeScript.zip'), (err) => {
|
|
11
|
-
if (err) {
|
|
12
|
-
//没有文件
|
|
13
|
-
} else {
|
|
14
|
-
//console.log('deekeScript.zip文件已删除');
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
// 创建 zip 实例
|
|
19
|
-
const zip = new AdmZip();
|
|
20
|
-
|
|
21
|
-
// 递归添加文件并排除目录
|
|
22
|
-
function addFilesToZip(directory) {
|
|
23
|
-
const files = fs.readdirSync(directory);
|
|
24
|
-
|
|
25
|
-
files.forEach(file => {
|
|
26
|
-
const fullPath = path.join(directory, file);
|
|
27
|
-
const relativePath = path.relative(parentDir, fullPath);
|
|
28
|
-
|
|
29
|
-
// 排除 DeekeScript 和 node_modules 目录
|
|
30
|
-
if (relativePath.startsWith('src') || relativePath.startsWith('.vscode') || relativePath.startsWith('.git') || relativePath.startsWith('@deekeScript') || relativePath.startsWith('node_modules')) {
|
|
31
|
-
console.log('排除目录:' + relativePath);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// 处理子目录或文件
|
|
36
|
-
if (fs.statSync(fullPath).isDirectory()) {
|
|
37
|
-
addFilesToZip(fullPath); // 递归处理子目录
|
|
38
|
-
} else {
|
|
39
|
-
zip.addLocalFile(fullPath, path.dirname(relativePath));
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// 执行压缩
|
|
45
|
-
addFilesToZip(parentDir);
|
|
46
|
-
zip.writeZip(path.join(parentDir, 'deekeScript.zip'));
|
|
47
|
-
|
|
48
|
-
console.log('打包完成');
|
|
1
|
+
const path = require('path'); // CommonJS 方式引入 path:ml-citation{ref="1,2" data="citationList"}
|
|
2
|
+
const fs = require('fs'); // 引入 fs 模块:ml-citation{ref="5" data="citationList"}
|
|
3
|
+
const AdmZip = require('adm-zip'); // 引入 adm-zip 库:ml-citation{ref="3,4" data="citationList"}
|
|
4
|
+
|
|
5
|
+
// 获取上层目录路径
|
|
6
|
+
// const parentDir = path.join(__dirname, '..');
|
|
7
|
+
const parentDir = __dirname;
|
|
8
|
+
console.log('开始执行打包');
|
|
9
|
+
|
|
10
|
+
fs.unlink(path.join(parentDir, 'deekeScript.zip'), (err) => {
|
|
11
|
+
if (err) {
|
|
12
|
+
//没有文件
|
|
13
|
+
} else {
|
|
14
|
+
//console.log('deekeScript.zip文件已删除');
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// 创建 zip 实例
|
|
19
|
+
const zip = new AdmZip();
|
|
20
|
+
|
|
21
|
+
// 递归添加文件并排除目录
|
|
22
|
+
function addFilesToZip(directory) {
|
|
23
|
+
const files = fs.readdirSync(directory);
|
|
24
|
+
|
|
25
|
+
files.forEach(file => {
|
|
26
|
+
const fullPath = path.join(directory, file);
|
|
27
|
+
const relativePath = path.relative(parentDir, fullPath);
|
|
28
|
+
|
|
29
|
+
// 排除 DeekeScript 和 node_modules 目录
|
|
30
|
+
if (relativePath.startsWith('src') || relativePath.startsWith('.vscode') || relativePath.startsWith('.git') || relativePath.startsWith('@deekeScript') || relativePath.startsWith('node_modules')) {
|
|
31
|
+
console.log('排除目录:' + relativePath);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 处理子目录或文件
|
|
36
|
+
if (fs.statSync(fullPath).isDirectory()) {
|
|
37
|
+
addFilesToZip(fullPath); // 递归处理子目录
|
|
38
|
+
} else {
|
|
39
|
+
zip.addLocalFile(fullPath, path.dirname(relativePath));
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 执行压缩
|
|
45
|
+
addFilesToZip(parentDir);
|
|
46
|
+
zip.writeZip(path.join(parentDir, 'deekeScript.zip'));
|
|
47
|
+
|
|
48
|
+
console.log('打包完成');
|
package/gulpfile
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const uglifyConfig = require('./uglify-config.json');
|
|
2
|
-
const gulp = require('gulp');
|
|
3
|
-
const uglify = require('gulp-uglify');
|
|
4
|
-
|
|
5
|
-
function compressJS() {
|
|
6
|
-
let config = ['script/**/*.js'];//需要混淆的文件
|
|
7
|
-
//不需要混淆
|
|
8
|
-
let exclude = [
|
|
9
|
-
"!script/statistics/*.js"
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
config = [...config, ...exclude];
|
|
13
|
-
return gulp.src(config).pipe(uglify(uglifyConfig)) // 应用 JSON 配置
|
|
14
|
-
.pipe(gulp.dest('script'));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
compressJS();
|
|
1
|
+
const uglifyConfig = require('./uglify-config.json');
|
|
2
|
+
const gulp = require('gulp');
|
|
3
|
+
const uglify = require('gulp-uglify');
|
|
4
|
+
|
|
5
|
+
function compressJS() {
|
|
6
|
+
let config = ['script/**/*.js'];//需要混淆的文件
|
|
7
|
+
//不需要混淆
|
|
8
|
+
let exclude = [
|
|
9
|
+
"!script/statistics/*.js"
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
config = [...config, ...exclude];
|
|
13
|
+
return gulp.src(config).pipe(uglify(uglifyConfig)) // 应用 JSON 配置
|
|
14
|
+
.pipe(gulp.dest('script'));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
compressJS();
|
|
Binary file
|
package/init
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
function generateFiles(answers) {
|
|
5
|
-
const projectPath = path.dirname(path.dirname(__dirname)); // 输出:/Users/username/project
|
|
6
|
-
const files = fs.readdirSync(projectPath);
|
|
7
|
-
|
|
8
|
-
if (files.includes('init.lock')) {
|
|
9
|
-
return ;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const entries = fs.readdirSync(__dirname, { withFileTypes: true });
|
|
13
|
-
const excludeFiles = ['node_modules']; // 需排除的文件名列表
|
|
14
|
-
|
|
15
|
-
const filteredEntries = entries.filter(entry =>
|
|
16
|
-
!excludeFiles.includes(entry.name)
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
filteredEntries.forEach(entry => {
|
|
20
|
-
const srcPath = path.join(__dirname, entry.name);
|
|
21
|
-
const destPath = path.join(projectPath, entry.name);
|
|
22
|
-
|
|
23
|
-
if (entry.isFile()) {
|
|
24
|
-
fs.copyFileSync(srcPath, destPath);
|
|
25
|
-
} else if (entry.isDirectory()) {
|
|
26
|
-
fs.cpSync(srcPath, destPath, { recursive: true });
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
generateFiles({});
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
function generateFiles(answers) {
|
|
5
|
+
const projectPath = path.dirname(path.dirname(__dirname)); // 输出:/Users/username/project
|
|
6
|
+
const files = fs.readdirSync(projectPath);
|
|
7
|
+
|
|
8
|
+
if (files.includes('init.lock')) {
|
|
9
|
+
return ;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const entries = fs.readdirSync(__dirname, { withFileTypes: true });
|
|
13
|
+
const excludeFiles = ['node_modules']; // 需排除的文件名列表
|
|
14
|
+
|
|
15
|
+
const filteredEntries = entries.filter(entry =>
|
|
16
|
+
!excludeFiles.includes(entry.name)
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
filteredEntries.forEach(entry => {
|
|
20
|
+
const srcPath = path.join(__dirname, entry.name);
|
|
21
|
+
const destPath = path.join(projectPath, entry.name);
|
|
22
|
+
|
|
23
|
+
if (entry.isFile()) {
|
|
24
|
+
fs.copyFileSync(srcPath, destPath);
|
|
25
|
+
} else if (entry.isDirectory()) {
|
|
26
|
+
fs.cpSync(srcPath, destPath, { recursive: true });
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
generateFiles({});
|
package/jsconfig.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES6",
|
|
4
|
-
"lib": ["es6"], // 不包含 "dom"
|
|
5
|
-
"checkJs": true
|
|
6
|
-
},
|
|
7
|
-
"include": [
|
|
8
|
-
"src/**/*",
|
|
9
|
-
"test/**/*",
|
|
10
|
-
"@deekeScript/**/*"
|
|
11
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES6",
|
|
4
|
+
"lib": ["es6"], // 不包含 "dom"
|
|
5
|
+
"checkJs": true
|
|
6
|
+
},
|
|
7
|
+
"include": [
|
|
8
|
+
"src/**/*",
|
|
9
|
+
"test/**/*",
|
|
10
|
+
"@deekeScript/**/*"
|
|
11
|
+
]
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "deeke-script-app",
|
|
3
|
-
"version": "1.6.
|
|
4
|
-
"description": "DeekeScript应用",
|
|
5
|
-
"main": "src/index.ts",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "rimraf script && cpx \"src/**/*\" script",
|
|
8
|
-
"build-zip": "rimraf script && cpx \"src/**/*\" script && ts-node --esm ./deekeScriptZipBuild",
|
|
9
|
-
"build-obfuscator": "rimraf script && cpx \"src/**/*\" script && ts-node --esm ./gulpfile",
|
|
10
|
-
"build-obfuscator-zip": "rimraf script && cpx \"src/**/*\" script && ts-node --esm ./gulpfile && ts-node --esm ./deekeScriptZipBuild",
|
|
11
|
-
"postinstall": "ts-node --esm init"
|
|
12
|
-
},
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "git+https://github.com/DeekeScript/deekeScript.git"
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"DeekeScript应用"
|
|
19
|
-
],
|
|
20
|
-
"author": "DeekeScript",
|
|
21
|
-
"license": "ISC",
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/DeekeScript/deekeScript/issues"
|
|
24
|
-
},
|
|
25
|
-
"homepage": "https://github.com/DeekeScript/deekeScript#readme",
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@types/adm-zip": "^0.5.7",
|
|
28
|
-
"@types/node": "^22.13.9",
|
|
29
|
-
"file-loader": "^6.2.0",
|
|
30
|
-
"glob": "^11.0.0",
|
|
31
|
-
"gulp": "^5.0.0",
|
|
32
|
-
"gulp-uglify": "^3.0.2",
|
|
33
|
-
"rimraf": "^6.1.0",
|
|
34
|
-
"ts-loader": "^9.5.1",
|
|
35
|
-
"typescript": "^5.8.2"
|
|
36
|
-
},
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"adm-zip": "^0.5.16",
|
|
39
|
-
"cpx": "^1.5.0",
|
|
40
|
-
"socket.io": "^4.8.1",
|
|
41
|
-
"ts-node": "^10.9.2"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "deeke-script-app",
|
|
3
|
+
"version": "1.6.9",
|
|
4
|
+
"description": "DeekeScript应用",
|
|
5
|
+
"main": "src/index.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rimraf script && cpx \"src/**/*\" script",
|
|
8
|
+
"build-zip": "rimraf script && cpx \"src/**/*\" script && ts-node --esm ./deekeScriptZipBuild",
|
|
9
|
+
"build-obfuscator": "rimraf script && cpx \"src/**/*\" script && ts-node --esm ./gulpfile",
|
|
10
|
+
"build-obfuscator-zip": "rimraf script && cpx \"src/**/*\" script && ts-node --esm ./gulpfile && ts-node --esm ./deekeScriptZipBuild",
|
|
11
|
+
"postinstall": "ts-node --esm init"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/DeekeScript/deekeScript.git"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"DeekeScript应用"
|
|
19
|
+
],
|
|
20
|
+
"author": "DeekeScript",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/DeekeScript/deekeScript/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/DeekeScript/deekeScript#readme",
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/adm-zip": "^0.5.7",
|
|
28
|
+
"@types/node": "^22.13.9",
|
|
29
|
+
"file-loader": "^6.2.0",
|
|
30
|
+
"glob": "^11.0.0",
|
|
31
|
+
"gulp": "^5.0.0",
|
|
32
|
+
"gulp-uglify": "^3.0.2",
|
|
33
|
+
"rimraf": "^6.1.0",
|
|
34
|
+
"ts-loader": "^9.5.1",
|
|
35
|
+
"typescript": "^5.8.2"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"adm-zip": "^0.5.16",
|
|
39
|
+
"cpx": "^1.5.0",
|
|
40
|
+
"socket.io": "^4.8.1",
|
|
41
|
+
"ts-node": "^10.9.2"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
var deekeStatistics = {
|
|
2
|
-
getDate() {
|
|
3
|
-
let d = new Date();
|
|
4
|
-
let m = d.getMonth() + 1;
|
|
5
|
-
let date = d.getDate();
|
|
6
|
-
return (m >= 10 ? m : ('0' + m)) + '.' + (date >= 10 ? date : ('0' + date));
|
|
7
|
-
},
|
|
8
|
-
getData(time) {
|
|
9
|
-
time = time || this.getDate();
|
|
10
|
-
return {
|
|
11
|
-
s_viewVideo: Storage.getInteger('s_viewVideo' + time) || 0,
|
|
12
|
-
s_viewTargetVideo: Storage.getInteger('s_viewTargetVideo' + time) || 0,
|
|
13
|
-
s_zan: Storage.getInteger('s_zan' + time) || 0,
|
|
14
|
-
s_comment: Storage.getInteger('s_comment' + time) || 0,
|
|
15
|
-
s_zanComment: Storage.getInteger('s_zanComment' + time) || 0,
|
|
16
|
-
s_privateMsg: Storage.getInteger('s_privateMsg' + time) || 0,
|
|
17
|
-
s_focus: Storage.getInteger('s_focus' + time) || 0,
|
|
18
|
-
s_viewUser: Storage.getInteger('s_viewUser' + time) || 0,
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
getWeekDate() {
|
|
22
|
-
let dates = [];
|
|
23
|
-
// 获取当前日期
|
|
24
|
-
let now = new Date();
|
|
25
|
-
// 循环获取最近 7 天的日期
|
|
26
|
-
for (let i = 1; i <= 7; i++) {
|
|
27
|
-
// 获取当前日期的时间戳
|
|
28
|
-
let timestamp = now.getTime();
|
|
29
|
-
// 计算 i 天前的时间戳
|
|
30
|
-
let dayTimestamp = 24 * 60 * 60 * 1000; // 一天的毫秒数
|
|
31
|
-
let iDayAgoTimestamp = timestamp - i * dayTimestamp;
|
|
32
|
-
// 转换为日期对象
|
|
33
|
-
let date = new Date(iDayAgoTimestamp);
|
|
34
|
-
// 格式化日期为 "yyyy-MM-dd" 的字符串并存入数组
|
|
35
|
-
//let year = date.getFullYear();
|
|
36
|
-
let month = ("0" + (date.getMonth() + 1)).slice(-2);
|
|
37
|
-
let day = ("0" + date.getDate()).slice(-2);
|
|
38
|
-
dates.push(month + "." + day);
|
|
39
|
-
}
|
|
40
|
-
return dates;
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
getWeekData() {
|
|
44
|
-
let dates = this.getWeekDate();
|
|
45
|
-
let data = [];
|
|
46
|
-
for (let i in dates) {
|
|
47
|
-
data.push([dates[i], this.getData(dates[i])]);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
//数据整理
|
|
51
|
-
let res = [];
|
|
52
|
-
let ids = ['s_viewVideo', 's_viewTargetVideo', 's_zan', 's_comment', 's_zanComment', 's_privateMsg', 's_focus', 's_viewUser'];
|
|
53
|
-
for (let i in ids) {
|
|
54
|
-
res[ids[i]] = [];
|
|
55
|
-
for (let j = data.length - 1; j >= 0; j--) {
|
|
56
|
-
res[ids[i]].push([data[j][0], data[j][1][ids[i]]]);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return res;
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
dataList() {
|
|
63
|
-
let data = this.getData(this.getDate());
|
|
64
|
-
let weekData = this.getWeekData();
|
|
65
|
-
//weight最大24
|
|
66
|
-
return [
|
|
67
|
-
{
|
|
68
|
-
'title': '今日累计视频',
|
|
69
|
-
'weight': 12,
|
|
70
|
-
'checked': true,
|
|
71
|
-
'value': data['s_viewVideo'],
|
|
72
|
-
'data': weekData['s_viewVideo'],
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
'title': '今日目标视频',
|
|
76
|
-
'weight': 12,
|
|
77
|
-
'value': data['s_viewTargetVideo'],
|
|
78
|
-
'data': weekData['s_viewTargetVideo'],
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
'title': '今日点赞',
|
|
82
|
-
'weight': 8,
|
|
83
|
-
'value': data['s_zan'],
|
|
84
|
-
'data': weekData['s_zan'],
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
'title': '今日评论',
|
|
88
|
-
'count': 1,
|
|
89
|
-
'weight': 8,
|
|
90
|
-
'value': data['s_comment'],
|
|
91
|
-
'data': weekData['s_comment'],
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
'title': '今日赞评论',
|
|
95
|
-
'weight': 8,
|
|
96
|
-
'value': data['s_zanComment'],
|
|
97
|
-
'data': weekData['s_zanComment'],
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
'title': '今日私信',
|
|
101
|
-
'weight': 8,
|
|
102
|
-
'value': data['s_privateMsg'],
|
|
103
|
-
'data': weekData['s_privateMsg'],
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
'title': '今日关注',
|
|
107
|
-
'count': 1,
|
|
108
|
-
'weight': 8,
|
|
109
|
-
'value': data['s_focus'],
|
|
110
|
-
'data': weekData['s_focus'],
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
'title': '今日访问',
|
|
114
|
-
'weight': 8,
|
|
115
|
-
'value': data['s_viewUser'],
|
|
116
|
-
'data': weekData['s_viewUser'],
|
|
117
|
-
},
|
|
118
|
-
];
|
|
119
|
-
}
|
|
120
|
-
}
|
|
1
|
+
var deekeStatistics = {
|
|
2
|
+
getDate() {
|
|
3
|
+
let d = new Date();
|
|
4
|
+
let m = d.getMonth() + 1;
|
|
5
|
+
let date = d.getDate();
|
|
6
|
+
return (m >= 10 ? m : ('0' + m)) + '.' + (date >= 10 ? date : ('0' + date));
|
|
7
|
+
},
|
|
8
|
+
getData(time) {
|
|
9
|
+
time = time || this.getDate();
|
|
10
|
+
return {
|
|
11
|
+
s_viewVideo: Storage.getInteger('s_viewVideo' + time) || 0,
|
|
12
|
+
s_viewTargetVideo: Storage.getInteger('s_viewTargetVideo' + time) || 0,
|
|
13
|
+
s_zan: Storage.getInteger('s_zan' + time) || 0,
|
|
14
|
+
s_comment: Storage.getInteger('s_comment' + time) || 0,
|
|
15
|
+
s_zanComment: Storage.getInteger('s_zanComment' + time) || 0,
|
|
16
|
+
s_privateMsg: Storage.getInteger('s_privateMsg' + time) || 0,
|
|
17
|
+
s_focus: Storage.getInteger('s_focus' + time) || 0,
|
|
18
|
+
s_viewUser: Storage.getInteger('s_viewUser' + time) || 0,
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
getWeekDate() {
|
|
22
|
+
let dates = [];
|
|
23
|
+
// 获取当前日期
|
|
24
|
+
let now = new Date();
|
|
25
|
+
// 循环获取最近 7 天的日期
|
|
26
|
+
for (let i = 1; i <= 7; i++) {
|
|
27
|
+
// 获取当前日期的时间戳
|
|
28
|
+
let timestamp = now.getTime();
|
|
29
|
+
// 计算 i 天前的时间戳
|
|
30
|
+
let dayTimestamp = 24 * 60 * 60 * 1000; // 一天的毫秒数
|
|
31
|
+
let iDayAgoTimestamp = timestamp - i * dayTimestamp;
|
|
32
|
+
// 转换为日期对象
|
|
33
|
+
let date = new Date(iDayAgoTimestamp);
|
|
34
|
+
// 格式化日期为 "yyyy-MM-dd" 的字符串并存入数组
|
|
35
|
+
//let year = date.getFullYear();
|
|
36
|
+
let month = ("0" + (date.getMonth() + 1)).slice(-2);
|
|
37
|
+
let day = ("0" + date.getDate()).slice(-2);
|
|
38
|
+
dates.push(month + "." + day);
|
|
39
|
+
}
|
|
40
|
+
return dates;
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
getWeekData() {
|
|
44
|
+
let dates = this.getWeekDate();
|
|
45
|
+
let data = [];
|
|
46
|
+
for (let i in dates) {
|
|
47
|
+
data.push([dates[i], this.getData(dates[i])]);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//数据整理
|
|
51
|
+
let res = [];
|
|
52
|
+
let ids = ['s_viewVideo', 's_viewTargetVideo', 's_zan', 's_comment', 's_zanComment', 's_privateMsg', 's_focus', 's_viewUser'];
|
|
53
|
+
for (let i in ids) {
|
|
54
|
+
res[ids[i]] = [];
|
|
55
|
+
for (let j = data.length - 1; j >= 0; j--) {
|
|
56
|
+
res[ids[i]].push([data[j][0], data[j][1][ids[i]]]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return res;
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
dataList() {
|
|
63
|
+
let data = this.getData(this.getDate());
|
|
64
|
+
let weekData = this.getWeekData();
|
|
65
|
+
//weight最大24
|
|
66
|
+
return [
|
|
67
|
+
{
|
|
68
|
+
'title': '今日累计视频',
|
|
69
|
+
'weight': 12,
|
|
70
|
+
'checked': true,
|
|
71
|
+
'value': data['s_viewVideo'],
|
|
72
|
+
'data': weekData['s_viewVideo'],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
'title': '今日目标视频',
|
|
76
|
+
'weight': 12,
|
|
77
|
+
'value': data['s_viewTargetVideo'],
|
|
78
|
+
'data': weekData['s_viewTargetVideo'],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
'title': '今日点赞',
|
|
82
|
+
'weight': 8,
|
|
83
|
+
'value': data['s_zan'],
|
|
84
|
+
'data': weekData['s_zan'],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
'title': '今日评论',
|
|
88
|
+
'count': 1,
|
|
89
|
+
'weight': 8,
|
|
90
|
+
'value': data['s_comment'],
|
|
91
|
+
'data': weekData['s_comment'],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
'title': '今日赞评论',
|
|
95
|
+
'weight': 8,
|
|
96
|
+
'value': data['s_zanComment'],
|
|
97
|
+
'data': weekData['s_zanComment'],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
'title': '今日私信',
|
|
101
|
+
'weight': 8,
|
|
102
|
+
'value': data['s_privateMsg'],
|
|
103
|
+
'data': weekData['s_privateMsg'],
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
'title': '今日关注',
|
|
107
|
+
'count': 1,
|
|
108
|
+
'weight': 8,
|
|
109
|
+
'value': data['s_focus'],
|
|
110
|
+
'data': weekData['s_focus'],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
'title': '今日访问',
|
|
114
|
+
'weight': 8,
|
|
115
|
+
'value': data['s_viewUser'],
|
|
116
|
+
'data': weekData['s_viewUser'],
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
}
|
package/script/task.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<h1>功能说明</h1>
|
|
2
|
-
|
|
3
|
-
<h3>一、功能一</h3>
|
|
4
|
-
功能说明:XXXXX
|
|
1
|
+
<h1>功能说明</h1>
|
|
2
|
+
|
|
3
|
+
<h3>一、功能一</h3>
|
|
4
|
+
功能说明:XXXXX
|