Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Commit

Permalink
v2.6.8
Browse files Browse the repository at this point in the history
  • Loading branch information
lolisaikou committed Aug 21, 2020
1 parent edc5fae commit c04864b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 15 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 当前程序版本:2.6.7
## 当前程序版本:2.6.8
**为部分组件增加了随机性,所以学习时间可能会增加哦**
**增加了清空文章列表的功能方便两个账号的用户使用**
**现在满分为42哦(除了每日和专项答题)**
因为刚刚上线,所以`commit`有点多,更新也比较频繁,经常是想到哪改到哪,所以请多包涵,有问题可以提`issue`

Expand Down Expand Up @@ -33,6 +34,13 @@


## 版本更新
- 2020.08.21
修复了上个版本的报错(~~因为太懒直接复制粘贴另一个版本的代码~~)
题库页面增加了清空文章列表的按钮,方便有两个账号的用户使用
为文章阅读增加了一个循环,直到循环次数大于3次或阅读文章满分停止
为配合上面的功能,对获取积分和阅读文章的模块做了相应调整
调整随机背景的透明度
***
- 2020.08.16
主页增加随机背景 [#29](https://github.com/lolisaikou/LazyStudy/issues/29)
为部分函数增加了随机性(提高安全性)
Expand Down
13 changes: 11 additions & 2 deletions UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ui.layout(
</appbar>
<viewpager id="viewpager">
<frame>
<img src={"https://api.ixiaowai.cn/gqapi/gqapi.php?" + new Date().getTime()} scaleType="centerCrop" alpha="0.3" />
<text textSize="16sp" textColor="red" text="v2.6.7" />
<img src={"https://api.ixiaowai.cn/gqapi/gqapi.php?" + new Date().getTime()} scaleType="centerCrop" alpha="0.2" />
<text textSize="16sp" textColor="red" text="v2.6.8" />
<button id="amsw" text="阅读模式选择" layout_gravity="right|top" w="auto" h="auto" circle="true"/>
<button id="showFloating" text="打开悬浮窗" w="150" h="60" circle="true" layout_gravity="center" style="Widget.AppCompat.Button.Colored" />
</frame>
Expand Down Expand Up @@ -65,6 +65,7 @@ ui.layout(
<horizontal gravity="center">
<button id="daochu" text="导出文章列表" />
<button id="daoru" text="导入文章列表" />
<button id="listdel" text="清空文章列表" />
</horizontal>
</vertical>
</frame>
Expand Down Expand Up @@ -319,6 +320,14 @@ ui.updateTikuNet.click(() => {
});

var path = files.path("list.db")
ui.listdel.click(() => {
var db = SQLiteDatabase.openOrCreateDatabase(path, null);
var Deletelistable = "DELETE FROM learnedArticles";
db.execSQL(Deletelistable);
db.close();
toastLog("已清空文章阅读记录!");
})

ui.daochu.click(() => {
dialogs.build({
title: "提示",
Expand Down
44 changes: 32 additions & 12 deletions xxqg_v3.1.3.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,14 @@ function getYestardayDateString() {
* @param: null
* @return: null
*/
function articleStudy() {
function articleStudy(x) {
while (!desc("学习").exists());//等待加载出主页
desc("学习").click();//点击主页正下方的"学习"按钮
delay(2);
var listView = className("ListView");//获取文章ListView控件用于翻页
click(aCatlog);
if (x == 0) {
desc("学习").click();//点击主页正下方的"学习"按钮
delay(2);
click(aCatlog);
}
delay(2);
var zt_flag = false;//判断进入专题界面标志
var fail = 0;//点击失败次数
Expand Down Expand Up @@ -482,7 +484,7 @@ function localChannel() {
* @param: null
* @return: null
*/
function getScores() {
function getScores(i) {
while (!desc("学习").exists());//等待加载出主页
console.log("正在获取积分...");
while (!text("积分明细").exists()) {
Expand Down Expand Up @@ -511,6 +513,19 @@ function getScores() {
console.log(myScores);

aCount = Math.ceil((12 - myScores["我要选读文章"]) / 2); //文章个数
if (i == 1) {
console.info("检查阅读文章是否满分!")
aCount = 12 - myScores["我要选读文章"];
if (aCount != 0) {
console.log("还需要阅读:" + aCount.toString() + "篇!");
} else {
console.info("已满分!");
}
delay(1);
back();
delay(1);
return;
}
if (aCount != 0) {
aCount = aCount + randomNum(0, 1)
}
Expand Down Expand Up @@ -639,21 +654,26 @@ function main() {
start_app();//启动app
var path = files.path("list.db");
var start = new Date().getTime();//程序开始时间
getScores();//获取积分
getScores(0);//获取积分
if (rTime != 0) {
listenToRadio();//听电台广播
}
var r_start = new Date().getTime();//广播开始时间
if (myScores['订阅'] != 2) {
sub();//订阅
}
if (myScores['挑战答题'] != 6) {
challengeQuestion();//挑战答题
}
if (myScores['每日答题'] != 6) {
dailyQuestion();//每日答题
while (aCount != 0) {
var x = 0;
articleStudy(x);//学习文章,包含点赞、分享和评论
console.info("等待十秒,然后确认文章是否已满分。");
delay(10);
getScores(1);
x++;
if (x > 2) {//尝试三次
console.info("尝试3次未满分,暂时跳过。");
break;
}
}
articleStudy();//学习文章,包含点赞、分享和评论
var end = new Date().getTime();//广播结束时间
var radio_time = (parseInt((end - r_start) / 1000));//广播已经收听的时间
radio_timing(parseInt((end - r_start) / 1000), rTime - radio_time);//广播剩余需收听时间
Expand Down

0 comments on commit c04864b

Please sign in to comment.