chore: 首次纳入版本控制(审查前基线,v1.2.0)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
const api = require("../../utils/api");
|
||||
|
||||
Page({
|
||||
data: { a: false, b: false, ok: false, loading: false },
|
||||
|
||||
onLoad() {
|
||||
if (!api.requireLogin()) return;
|
||||
},
|
||||
|
||||
toggle(e) {
|
||||
const key = e.currentTarget.dataset.k;
|
||||
const next = {};
|
||||
next[key] = !this.data[key];
|
||||
this.setData(next, () => this.setData({ ok: this.data.a && this.data.b }));
|
||||
},
|
||||
|
||||
onOk() {
|
||||
if (!this.data.ok || this.data.loading) return;
|
||||
this.setData({ loading: true });
|
||||
api
|
||||
.post("/api/consent", { version: "v1" })
|
||||
.then(() => wx.reLaunch({ url: "/pages/children/children" }))
|
||||
.catch((e) => {
|
||||
api.toastError(e);
|
||||
this.setData({ loading: false });
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user