deeke-script-app 1.9.4 → 2.0.0
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.json +700 -699
- package/deekeScript.schema.json +826 -821
- package/jsconfig.json +12 -25
- package/package.json +17 -43
- package/src/task/dy.js +14 -14
- package/.vscode/settings.json +0 -9
- package/@deekeScript/@type/Class/Global.d.ts +0 -2
- package/@deekeScript/@type/Class/Rect.d.ts +0 -16
- package/@deekeScript/@type/Class/UiSelector.d.ts +0 -201
- package/@deekeScript/@type/Class/WebSocket.d.ts +0 -49
- package/@deekeScript/@type/README.md +0 -19
- package/@deekeScript/@type/interface/Access.d.ts +0 -199
- package/@deekeScript/@type/interface/App.d.ts +0 -106
- package/@deekeScript/@type/interface/Audio.d.ts +0 -96
- package/@deekeScript/@type/interface/Console.d.ts +0 -220
- package/@deekeScript/@type/interface/DeekeScript.d.ts +0 -83
- package/@deekeScript/@type/interface/DeekeScriptJson.d.ts +0 -13
- package/@deekeScript/@type/interface/Device.d.ts +0 -275
- package/@deekeScript/@type/interface/DeviceApp.d.ts +0 -97
- package/@deekeScript/@type/interface/DeviceHardware.d.ts +0 -36
- package/@deekeScript/@type/interface/DeviceKiosk.d.ts +0 -30
- package/@deekeScript/@type/interface/DevicePolicy.d.ts +0 -27
- package/@deekeScript/@type/interface/Dialogs.d.ts +0 -41
- package/@deekeScript/@type/interface/Encrypt.d.ts +0 -58
- package/@deekeScript/@type/interface/Engines.d.ts +0 -39
- package/@deekeScript/@type/interface/Files.d.ts +0 -283
- package/@deekeScript/@type/interface/FloatDialogs.d.ts +0 -71
- package/@deekeScript/@type/interface/ForegroundServiceBridge.d.ts +0 -31
- package/@deekeScript/@type/interface/Gesture.d.ts +0 -54
- package/@deekeScript/@type/interface/Hid.d.ts +0 -342
- package/@deekeScript/@type/interface/Http.d.ts +0 -94
- package/@deekeScript/@type/interface/Images.d.ts +0 -71
- package/@deekeScript/@type/interface/Intent.d.ts +0 -12
- package/@deekeScript/@type/interface/Java.d.ts +0 -7
- package/@deekeScript/@type/interface/KeyBoards.d.ts +0 -63
- package/@deekeScript/@type/interface/Log.d.ts +0 -16
- package/@deekeScript/@type/interface/MediaStore.d.ts +0 -146
- package/@deekeScript/@type/interface/NotificationBridge.d.ts +0 -28
- package/@deekeScript/@type/interface/SocketIOClient.d.ts +0 -76
- package/@deekeScript/@type/interface/Storage.d.ts +0 -119
- package/@deekeScript/@type/interface/System.d.ts +0 -142
- package/@deekeScript/@type/interface/Threads.d.ts +0 -103
- package/@deekeScript/@type/interface/UiObject.d.ts +0 -202
- package/README.md +0 -67
- package/deekeScriptZipBuild +0 -48
- package/gulpfile +0 -17
- package/images/test/ad.png +0 -0
- package/images/test/add.png +0 -0
- package/images/test/ai-back.png +0 -0
- package/images/test/anchor_focus.png +0 -0
- package/images/test/auto-2.png +0 -0
- package/images/test/back.png +0 -0
- package/images/test/barrage.png +0 -0
- package/images/test/clear_fans.png +0 -0
- package/images/test/close.png +0 -0
- package/images/test/comment-2.png +0 -0
- package/images/test/delete.png +0 -0
- package/images/test/edit.png +0 -0
- package/images/test/fans-inc.png +0 -0
- package/images/test/fans.png +0 -0
- package/images/test/friend.png +0 -0
- package/images/test/grab.png +0 -0
- package/images/test/hot.png +0 -0
- package/images/test/into.png +0 -0
- package/images/test/invite.png +0 -0
- package/images/test/live-zan.png +0 -0
- package/images/test/live.png +0 -0
- package/images/test/member.png +0 -0
- package/images/test/msg_back.png +0 -0
- package/images/test/new_user.png +0 -0
- package/images/test/notice-2.png +0 -0
- package/images/test/openai-icon.png +0 -0
- package/images/test/precise-user.png +0 -0
- package/images/test/private-2.png +0 -0
- package/images/test/qingsong.png +0 -0
- package/images/test/robot.png +0 -0
- package/images/test/rocket.png +0 -0
- package/images/test/score_live.png +0 -0
- package/images/test/sett.png +0 -0
- package/images/test/show.png +0 -0
- package/images/test/show_password.png +0 -0
- package/images/test/speech-say.png +0 -0
- package/images/test/statistics.png +0 -0
- package/images/test/task.png +0 -0
- package/images/test/team-buy.png +0 -0
- package/images/test/tuandui.png +0 -0
- package/images/test/user-get.png +0 -0
- package/images/test/vertical.png +0 -0
- package/images/test/weixin.png +0 -0
- package/images/test/xhs-fans.png +0 -0
- package/images/test/xhs-wanneng.png +0 -0
- package/images/test/xhs-zan.png +0 -0
- package/images/test/zan-1.png +0 -0
- package/images/test/zan.png +0 -0
- package/init +0 -32
- package/init.lock +0 -0
- package/music/music.mp3 +0 -0
- package/script/index.js +0 -1
- package/script/statistics/statistics.js +0 -120
- package/script/task/douyin_zan.js +0 -89
- package/script/task/dy.js +0 -14
- package/script/task/dyApp.js +0 -7
- package/script/task/dyCity.js +0 -1
- package/script/task/exec_js.js +0 -4
- package/script/task/tool.js +0 -19
- package/script/task.html +0 -4
- package/src/index.js +0 -1
- package/test.json +0 -133
- package/uglify-config.json +0 -16
- package/update-types.js +0 -137
- /package/{images → src/images}/test/ai.png +0 -0
- /package/{images → src/images}/test/app.png +0 -0
- /package/{images → src/images}/test/cancel_focus.png +0 -0
- /package/{images → src/images}/test/cancel_zan.png +0 -0
- /package/{images → src/images}/test/city.png +0 -0
- /package/{images → src/images}/test/clear.png +0 -0
- /package/{images → src/images}/test/finger.png +0 -0
- /package/{images → src/images}/test/home-top.png +0 -0
- /package/{images → src/images}/test/home.png +0 -0
- /package/{images → src/images}/test/jubao.png +0 -0
- /package/{images → src/images}/test/kefu.png +0 -0
- /package/{images → src/images}/test/manual.png +0 -0
- /package/{images → src/images}/test/notice.png +0 -0
- /package/{images → src/images}/test/score.png +0 -0
- /package/{images → src/images}/test/setting-top.png +0 -0
- /package/{images → src/images}/test/setting.png +0 -0
- /package/{images → src/images}/test/speech.png +0 -0
- /package/{images → src/images}/test/tool.png +0 -0
- /package/{images → src/images}/test/update.png +0 -0
- /package/{images → src/images}/test/upload.png +0 -0
- /package/{images → src/images}/test/view_back.png +0 -0
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* 控件对象
|
|
4
|
-
*/
|
|
5
|
-
declare global {
|
|
6
|
-
interface UiObject {
|
|
7
|
-
/**
|
|
8
|
-
* 点击控件
|
|
9
|
-
*/
|
|
10
|
-
public click(): boolean;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 长按控件
|
|
14
|
-
*/
|
|
15
|
-
public longClick(): boolean;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* 向前滚动控件(手指向下或者向右移动)
|
|
19
|
-
*/
|
|
20
|
-
public scrollForward(): boolean;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* 向后滚动控件(手指往上或者往左移动)
|
|
24
|
-
*/
|
|
25
|
-
public scrollBackward(): boolean;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 选中文本
|
|
29
|
-
* @param start 起始位置
|
|
30
|
-
* @param end 结束位置
|
|
31
|
-
*/
|
|
32
|
-
public setSelection(start: number, end: number): boolean;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* 复制控制内容,结合setSelection使用
|
|
36
|
-
*/
|
|
37
|
-
public copy(): boolean;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* 剪切控件内容,结合setSelection使用
|
|
41
|
-
*/
|
|
42
|
-
public cut(): boolean;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* 粘贴内容到文本框
|
|
46
|
-
*/
|
|
47
|
-
public paste(): boolean;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* 让控件获取焦点
|
|
51
|
-
*/
|
|
52
|
-
public focus(): boolean;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* 给文本框输入内容
|
|
56
|
-
* @param text 文本内容
|
|
57
|
-
*/
|
|
58
|
-
public setText(text: string): boolean;
|
|
59
|
-
/**
|
|
60
|
-
* 在当前控件或者所有子控件中查找某些控件
|
|
61
|
-
* 如果使用了children() 方法,则只搜索子控件
|
|
62
|
-
* @param obj 搜索条件
|
|
63
|
-
*/
|
|
64
|
-
public find(obj: UiSelector): UiObject[];
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* 在当前控件或者所有子控件中查找某个控件
|
|
68
|
-
* 如果使用了children() 方法,则只搜索子控件
|
|
69
|
-
* @param obj 搜索条件
|
|
70
|
-
*/
|
|
71
|
-
public findOne(obj: UiSelector): UiObject;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* 获取控件的位置
|
|
75
|
-
*/
|
|
76
|
-
public bounds(): Rect;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* 获取控件的文本内容
|
|
80
|
-
*/
|
|
81
|
-
public text(): string;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* 获取控件的描述内容
|
|
85
|
-
*/
|
|
86
|
-
public desc(): string;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* 获取控件的id
|
|
90
|
-
*/
|
|
91
|
-
public id(): string;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* 获取当前控件的子控件
|
|
95
|
-
*/
|
|
96
|
-
public children(): this;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* 获取当前控件的子控件数量,必须在children() 方法之后调用
|
|
100
|
-
*/
|
|
101
|
-
public length(): number;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* 获取子控件数量
|
|
105
|
-
*/
|
|
106
|
-
public getChildCount(): number;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* 获取子控件
|
|
110
|
-
*/
|
|
111
|
-
public getChildren(index): UiObject;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* 获取父控件
|
|
115
|
-
*/
|
|
116
|
-
public parent(): UiObject;
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* 获取控件的绘制顺序
|
|
120
|
-
*/
|
|
121
|
-
public getDrawingOrder(): number;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* 判断控件是否被选中
|
|
125
|
-
*/
|
|
126
|
-
public isSelected(): boolean;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* 判断控件是否可以点击
|
|
130
|
-
*/
|
|
131
|
-
public isClickable(): boolean;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* 判断控件是否可以长按
|
|
135
|
-
*/
|
|
136
|
-
public isLongClickable(): boolean;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* 判断控件是否可以选中
|
|
140
|
-
*/
|
|
141
|
-
public isCheckable(): boolean;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* 判断控件是否被选中
|
|
145
|
-
*/
|
|
146
|
-
public isChecked(): boolean;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* 判断控件是否可用
|
|
150
|
-
*/
|
|
151
|
-
public isEnabled(): boolean;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* 判断控件是否获得焦点
|
|
155
|
-
*/
|
|
156
|
-
public isFocusable(): boolean;
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* 获取控件是否获得焦点
|
|
160
|
-
*/
|
|
161
|
-
public isFocused(): boolean;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* 判断控件是否可以滚动
|
|
166
|
-
*/
|
|
167
|
-
public isScrollable(): boolean;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* 判断控件是否对用户可见
|
|
172
|
-
*/
|
|
173
|
-
public isVisibleToUser(): boolean;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* 判断控件是否可以编辑
|
|
178
|
-
*/
|
|
179
|
-
public isEditable(): boolean;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* 判断控件是否是密码控件
|
|
183
|
-
*/
|
|
184
|
-
public isPassword(): boolean;
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* 获取控件的className
|
|
188
|
-
*/
|
|
189
|
-
public className(): string;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* 获取控件的包名
|
|
193
|
-
*/
|
|
194
|
-
public getPackageName(): string;
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* 获取控件的提示文本
|
|
198
|
-
*/
|
|
199
|
-
public getHintText(): string;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
export { };
|
package/README.md
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# DeekeScript 应用开发模板
|
|
2
|
-
|
|
3
|
-
## 📖 项目简介
|
|
4
|
-
|
|
5
|
-
**DeekeScript** 是一个专为Android自动化脚本开发设计的强大框架,核心能力是为开发者快速打造一站式商业化自动化应用
|
|
6
|
-
|
|
7
|
-
本项目是DeekeScript的初始库demo,为您提供了一个完整的开发模板,帮助您快速上手DeekeScript开发。
|
|
8
|
-
|
|
9
|
-
## 🌟 主要特性
|
|
10
|
-
|
|
11
|
-
- **模拟点击操作** - 精确模拟用户点击、滑动等操作
|
|
12
|
-
- **图像识别** - 基于图像匹配的智能识别功能
|
|
13
|
-
- **多线程支持** - 支持并发任务处理
|
|
14
|
-
- **丰富的API** - 提供完整的设备控制、网络请求、存储等API
|
|
15
|
-
- **TypeScript支持** - 完整的类型定义,提供智能代码提示
|
|
16
|
-
- **模块化设计** - 支持模块化开发,代码结构清晰
|
|
17
|
-
|
|
18
|
-
## 🔗 相关链接
|
|
19
|
-
|
|
20
|
-
### 官方资源
|
|
21
|
-
- **官方网站**: [https://deeke.cn](https://deeke.cn)
|
|
22
|
-
- **官方文档**: [https://doc.deeke.cn](https://doc.deeke.cn)
|
|
23
|
-
|
|
24
|
-
- **完整应用示例**: [https://github.com/DeekeScript/ad-deeke](https://github.com/DeekeScript/ad-deeke)
|
|
25
|
-
|
|
26
|
-
## 🚀 快速开始
|
|
27
|
-
|
|
28
|
-
### 环境准备
|
|
29
|
-
|
|
30
|
-
在开始使用之前,请确保您已经:
|
|
31
|
-
|
|
32
|
-
1. 阅读了官方文档:[https://doc.deeke.cn](https://doc.deeke.cn)
|
|
33
|
-
2. 安装了相关软件和依赖
|
|
34
|
-
3. 配置了Android开发环境
|
|
35
|
-
|
|
36
|
-
### 安装方式
|
|
37
|
-
|
|
38
|
-
#### 方式一:npm安装(推荐)
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npm i deeke-script-app
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
#### 方式二:Git克隆
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
git clone https://github.com/DeekeScript/deekeScript.git ./
|
|
48
|
-
npm install
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### 项目结构
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
Typescript/
|
|
55
|
-
├── @deekeScript/ # TypeScript类型定义文件(请勿删除)
|
|
56
|
-
│ └── @type/
|
|
57
|
-
├── src/ # 源代码目录
|
|
58
|
-
│ ├── index.js # 主入口文件
|
|
59
|
-
│ ├── task/ # 任务相关代码
|
|
60
|
-
│ └── statistics/ # 统计相关代码
|
|
61
|
-
├── script/ # 编译后的脚本文件
|
|
62
|
-
├── test/ # 测试文件
|
|
63
|
-
└── images/ # 图片资源
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
**开始您的DeekeScript开发之旅吧!** 🎉
|
package/deekeScriptZipBuild
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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();
|
package/images/test/ad.png
DELETED
|
Binary file
|
package/images/test/add.png
DELETED
|
Binary file
|
package/images/test/ai-back.png
DELETED
|
Binary file
|
|
Binary file
|
package/images/test/auto-2.png
DELETED
|
Binary file
|
package/images/test/back.png
DELETED
|
Binary file
|
package/images/test/barrage.png
DELETED
|
Binary file
|
|
Binary file
|
package/images/test/close.png
DELETED
|
Binary file
|
|
Binary file
|
package/images/test/delete.png
DELETED
|
Binary file
|
package/images/test/edit.png
DELETED
|
Binary file
|
package/images/test/fans-inc.png
DELETED
|
Binary file
|
package/images/test/fans.png
DELETED
|
Binary file
|
package/images/test/friend.png
DELETED
|
Binary file
|
package/images/test/grab.png
DELETED
|
Binary file
|
package/images/test/hot.png
DELETED
|
Binary file
|
package/images/test/into.png
DELETED
|
Binary file
|
package/images/test/invite.png
DELETED
|
Binary file
|
package/images/test/live-zan.png
DELETED
|
Binary file
|
package/images/test/live.png
DELETED
|
Binary file
|
package/images/test/member.png
DELETED
|
Binary file
|
package/images/test/msg_back.png
DELETED
|
Binary file
|
package/images/test/new_user.png
DELETED
|
Binary file
|
package/images/test/notice-2.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/images/test/qingsong.png
DELETED
|
Binary file
|
package/images/test/robot.png
DELETED
|
Binary file
|
package/images/test/rocket.png
DELETED
|
Binary file
|
|
Binary file
|
package/images/test/sett.png
DELETED
|
Binary file
|
package/images/test/show.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/images/test/task.png
DELETED
|
Binary file
|
package/images/test/team-buy.png
DELETED
|
Binary file
|
package/images/test/tuandui.png
DELETED
|
Binary file
|
package/images/test/user-get.png
DELETED
|
Binary file
|
package/images/test/vertical.png
DELETED
|
Binary file
|
package/images/test/weixin.png
DELETED
|
Binary file
|
package/images/test/xhs-fans.png
DELETED
|
Binary file
|
|
Binary file
|
package/images/test/xhs-zan.png
DELETED
|
Binary file
|
package/images/test/zan-1.png
DELETED
|
Binary file
|
package/images/test/zan.png
DELETED
|
Binary file
|
package/init
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
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/init.lock
DELETED
|
File without changes
|
package/music/music.mp3
DELETED
|
Binary file
|
package/script/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//这个文件不用编写代码
|
|
@@ -1,120 +0,0 @@
|
|
|
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
|
-
}
|