chore: 首次纳入版本控制(审查前基线,v1.2.0)
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
const api = require("../../utils/api");
|
||||
|
||||
Page({
|
||||
data: {
|
||||
numbers: null,
|
||||
weakest: [],
|
||||
oneLine: "",
|
||||
printUrl: "",
|
||||
loading: true,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
if (!api.requireChild()) return;
|
||||
this.load();
|
||||
},
|
||||
|
||||
load() {
|
||||
const child = getApp().globalData.child;
|
||||
api
|
||||
.get("/api/report/weekly?child_id=" + child.id)
|
||||
.then((d) => {
|
||||
this.setData({
|
||||
numbers: d.numbers,
|
||||
weakest: d.weakest || [],
|
||||
oneLine: d.one_line || "",
|
||||
printUrl:
|
||||
getApp().globalData.apiBase +
|
||||
"/api/print/weekly?child_id=" +
|
||||
child.id +
|
||||
"&token=" +
|
||||
encodeURIComponent(api.token()),
|
||||
loading: false,
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
api.toastError(e);
|
||||
this.setData({ loading: false });
|
||||
});
|
||||
},
|
||||
|
||||
onPrint() {
|
||||
wx.navigateTo({ url: "/pages/print/print?url=" + encodeURIComponent(this.data.printUrl) });
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "这周"
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<view class="wrap">
|
||||
<block wx:if="{{numbers}}">
|
||||
<view class="card">
|
||||
<view class="card-title">这周</view>
|
||||
<view class="grid">
|
||||
<view class="g">
|
||||
<view class="gv">{{numbers.graduated_this_week}}</view>
|
||||
<view class="gl">毕业</view>
|
||||
</view>
|
||||
<view class="g">
|
||||
<view class="gv">{{numbers.new_this_week}}</view>
|
||||
<view class="gl">新进</view>
|
||||
</view>
|
||||
<view class="g">
|
||||
<view class="gv">{{numbers.review_days}}</view>
|
||||
<view class="gl">复习天数</view>
|
||||
</view>
|
||||
<view class="g">
|
||||
<view class="gv">{{numbers.kill_rate}}%</view>
|
||||
<view class="gl">消灭率</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="one">{{oneLine}}</view>
|
||||
</view>
|
||||
|
||||
<view class="card" wx:if="{{weakest.length}}">
|
||||
<view class="card-title">最弱的三个知识点</view>
|
||||
<view class="li" wx:for="{{weakest}}" wx:key="code">
|
||||
<text class="l">{{item.zh}}</text>
|
||||
<text class="r">{{item.count}} 道</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<button class="btn" bindtap="onPrint">打开周日那张纸</button>
|
||||
<view class="muted" style="margin-top:10px;text-align:center">
|
||||
纸上留了答题区,答案折叠在下面,底下是家长签字。
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<view class="empty" wx:elif="{{!loading}}">这周还没有记录</view>
|
||||
</view>
|
||||
@@ -0,0 +1,8 @@
|
||||
.grid { display: flex; margin: 6px 0 12px; }
|
||||
.g { flex: 1; text-align: center; }
|
||||
.gv { font-size: 24px; font-weight: 700; color: var(--brand); }
|
||||
.gl { margin-top: 2px; font-size: 11px; color: var(--muted); }
|
||||
.one {
|
||||
padding: 11px 13px; background: var(--paper); border-radius: 10px;
|
||||
font-size: 12px; color: #7a6440; line-height: 1.7;
|
||||
}
|
||||
Reference in New Issue
Block a user