U 列表界面的图片懒加载

master
educoder_weapp 4 years ago
parent 80b7d665e4
commit 4bfdae765b

7
.gitignore vendored

@ -5,6 +5,13 @@ res/
docs/
pandocs
push-git.cmd
cloudfunctionTemplate/
# node
node_modules
# Windows
[Dd]esktop.ini

@ -1,3 +1,7 @@
## v0.19.3
* U 列表界面的图片懒加载
* F 修复带Cookie请求的bug
## v0.19.2
* F 课堂邀请页面小程序码获取失败
* F 每日签到完后按钮没有变灰

@ -0,0 +1 @@
trigger_function/

@ -136,6 +136,7 @@ exports.main = async (event, context) => {
isCrawl: data.scene==1129,
sceneDesc: sceneDescMap[data.scene],
time: now,
createdAt:now,
timestamp: Date.now(),
openid: wxContext.OPENID,
_openid: wxContext.OPENID

@ -14,11 +14,7 @@
{
"name": "clearPageHistory",
"type":"timer",
"config":"0 0 3 1 * * *"
},{
"name":"attendance",
"type":"timer",
"config":"0 0 4 * * * *"
"config":"0 0 1 1 * * *"
}
]
}

@ -103,15 +103,3 @@ async function clearPageHistory({Time}){
console.log("remove page History result: ", res);
return {code: 0, message:"success", data:res};
}
async function attandance({Time}){
/**let postResponse = await got(url, {
method: 'GET', //post请求
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
})
})**/
}

@ -13,6 +13,9 @@ Page({
this.loaded = 1;
})
},
onReady(){
app.reportPageHistory();
},
onShow(){
console.log("show", Date.now());
if(this.loaded)

@ -5,6 +5,7 @@
font-size: 13px;
white-space: nowrap;
flex: none;
-webkit-overflow-scrolling: touch;
}
.view.common{
color: dimgray;

@ -12,7 +12,7 @@
<text class="type" style="color:{{color}};border-color:{{color}}">{{type}}</text>
</view>
<view class="body">
<image class="avatar" src="{{eduImgDir}}{{author.img}}" mode="aspectFill" />
<image lazy-load="1" class="avatar" src="{{eduImgDir}}{{author.img}}" mode="aspectFill" />
<view class="content">{{text}}</view>
</view>
</view>

@ -4,7 +4,7 @@
<text class="tip" style="{{data.time_status>=5?'background:#FC2B6A':''}}" wx:for="{{data.status}}">{{item}}</text>
</view>
<view class="author">
<image class="avatar" src="{{eduImgDir}}{{data.author_img}}" mode="aspectFill"></image>
<image lazy-load="1" class="avatar" src="{{eduImgDir}}{{data.author_img}}" mode="aspectFill"></image>
<text class="author-name">{{data.author}}</text>
<text class="time">{{data.status_time}}</text>
</view>

@ -1,6 +1,6 @@
<mp-slideview disable="{{!ext.course_identity||ext.course_identity==5}}" buttons="{{buttons}}" bindbuttontap="onButtonTap">
<view class="student thin-border-bottom">
<image class="avatar" src="{{eduImgDir}}{{data.image_url}}"></image>
<image class="avatar" lazy-load="1" src="{{eduImgDir}}{{data.image_url}}"></image>
<view class="detail">
<view class="name">{{data.name}}</view>
<view class="student-id" wx:if="{{data.student_id}}">学号:{{data.student_id}}</view>

@ -1,6 +1,6 @@
<mp-slideview disable="{{!ext.course_identity||ext.course_identity>2||data.role=='管理员'}}" buttons="{{buttons}}" bindbuttontap="onButtonTap">
<view class="teacher thin-border-bottom">
<image class="avatar" src="{{eduImgDir}}{{data.image_url}}"></image>
<image class="avatar" lazy-load="1" src="{{eduImgDir}}{{data.image_url}}"></image>
<view class="detail">
<view class="name">{{data.name}}</view>
<view class="school">{{data.school}}</view>

@ -28,7 +28,7 @@ export class Session{
return wx.request({
...options,
url,
header: {...header, "Cookie": this.cookies},
header: {"Cookie": this.cookies,...header,},
success: (res) => {
console.debug("request success", res);
if (res.cookies && res.cookies.length>0)
@ -37,7 +37,7 @@ export class Session{
this.setCookies(this.splitCookies(res.header["Set-Cookie"]));
else if(res.header["set-cookie"])
this.setCookies(this.splitCookies(res.header["set-Cookie"]));
success(res);
success&&success(res);
if(url.indexOf("login.json")!=-1&&!res.data.status&&!this.cookies){
wx.reportMonitor("0", 2);
global.realTimeLog.error(res, "login fail: fail parse cookies!!", res);

@ -217,7 +217,8 @@ Page({
data:{
...res,
name: "users.attendance",
createAt: db.serverDate()
createdAt: db.serverDate(),
createAt: db.serverDate() //@deprecated
}
})
this.setData({"user.attendance_signed": true});

@ -4,7 +4,7 @@
<mp-icon icon="more" type="field" color="white"/>
</view>
<view class="body">
<image class="avatar" src="{{eduImgDir}}{{data.avatar_url}}" />
<image lazy-load="1" class="avatar" src="{{eduImgDir}}{{data.avatar_url}}" />
<view class="course-info">
<view class="course-name">{{data.name}}</view>
<view class="info">

@ -1,5 +1,5 @@
<view class="tiding" bindtap="enterDetail">
<image class="avatar" mode="scaleToFill" src="{{eduImgDir}}{{data.trigger_user.image_url}}"></image>
<image lazy-load="1" class="avatar" mode="scaleToFill" src="{{eduImgDir}}{{data.trigger_user.image_url}}"></image>
<view class="tiding-info">
<view class="name">
{{data.trigger_user.name}} {{data.time}}<text wx:if="{{data.tiding_type=='Apply'}}" class="todo-tip {{data.status?'finish':''}}">{{data.status?'已处理':'待审批'}}</text>

@ -225,7 +225,7 @@
"id": 22,
"name": "course_invite",
"pathName": "course/pages/course_invite/course_invite",
"query": "course_id=8275",
"query": "course_id=3821",
"scene": null
},
{

Loading…
Cancel
Save