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) });
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user