Compare commits
20
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fab73f00ab | ||
|
|
edb26b3d8b | ||
|
|
443f82ea75 | ||
|
|
75adb97abb | ||
|
|
b36996e352 | ||
|
|
6bef08f12e | ||
|
|
1f24a59bd9 | ||
|
|
14d0c9c123 | ||
|
|
b99a3412e2 | ||
|
|
63300f68f8 | ||
|
|
acf4f94798 | ||
|
|
87f4d220e5 | ||
|
|
cf4dd727c5 | ||
|
|
49055e892c | ||
|
|
afedb81633 | ||
|
|
04b8bf365f | ||
|
|
874c64829a | ||
|
|
82e1c0941e | ||
|
|
3119c862b1 | ||
|
|
7a5d43281b |
@@ -0,0 +1,75 @@
|
|||||||
|
import { API, HTTPMethod, IParamSetting, GeneralCallbackResult} from "../core/Api";
|
||||||
|
|
||||||
|
interface IScheduleInput {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* session
|
||||||
|
*/
|
||||||
|
cookie: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学期
|
||||||
|
*/
|
||||||
|
semester: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IScheduleOutput {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IScheduleEvent {
|
||||||
|
/**
|
||||||
|
* session 过期
|
||||||
|
*/
|
||||||
|
expire: GeneralCallbackResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录失败
|
||||||
|
*/
|
||||||
|
unauthorized: GeneralCallbackResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未知的问题
|
||||||
|
*/
|
||||||
|
error: GeneralCallbackResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据损坏或丢失
|
||||||
|
*/
|
||||||
|
badData: GeneralCallbackResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Schedule API
|
||||||
|
* 需要session与semester
|
||||||
|
* 此 API 用来向教务处发起获取课程表的请求
|
||||||
|
* 请求成功后将获得教务处返回的课程表JSON文件
|
||||||
|
*/
|
||||||
|
class Schedlue extends API<IScheduleInput, IScheduleOutput, IScheduleEvent> {
|
||||||
|
|
||||||
|
public override baseUrl: string = "jwc.2333.pub";
|
||||||
|
|
||||||
|
public override url = "/course_timetable";
|
||||||
|
|
||||||
|
public override method: HTTPMethod = HTTPMethod.GET;
|
||||||
|
|
||||||
|
public override params: IParamSetting<IScheduleInput> = {
|
||||||
|
|
||||||
|
cookie: {
|
||||||
|
mapKey: "cookie",
|
||||||
|
isHeader: true
|
||||||
|
},
|
||||||
|
|
||||||
|
semester: {
|
||||||
|
mapKey: "semester",
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public constructor() {
|
||||||
|
super();
|
||||||
|
this.initDebugLabel("Schedule");
|
||||||
|
|
||||||
|
this.addFailedCallBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -168,17 +168,18 @@ class API<
|
|||||||
> {
|
> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基础 URL
|
* 默认调试标签
|
||||||
* TODO: 这里可能涉及负载均衡
|
|
||||||
*/
|
*/
|
||||||
public static get baseUrl():string {
|
|
||||||
return "https://jwc.nogg.cn";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static defaultLogLabel:LogLabel = new LogLabel(
|
public static defaultLogLabel:LogLabel = new LogLabel(
|
||||||
`API:API`, colorRadio(200, 120, 222)
|
`API:API`, colorRadio(200, 120, 222)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础 URL
|
||||||
|
* TODO: 这里可能涉及负载均衡
|
||||||
|
*/
|
||||||
|
public baseUrl: string = "https://jwc.nogg.cn";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logger 使用的标签
|
* Logger 使用的标签
|
||||||
*/
|
*/
|
||||||
@@ -319,7 +320,7 @@ class API<
|
|||||||
|
|
||||||
// 重置请求数据
|
// 重置请求数据
|
||||||
const requestData:IWxRequestOption<O> = this.requestData = {
|
const requestData:IWxRequestOption<O> = this.requestData = {
|
||||||
url: API.baseUrl + this.url,
|
url: this.baseUrl + this.url,
|
||||||
data: {}, header: {},
|
data: {}, header: {},
|
||||||
timeout: this.timeout,
|
timeout: this.timeout,
|
||||||
method: this.method,
|
method: this.method,
|
||||||
|
|||||||
@@ -491,6 +491,27 @@ class Manager<WXC extends AnyWXContext = AnyWXContext> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步页面加载
|
||||||
|
*
|
||||||
|
* *注意*
|
||||||
|
* 页面模块加载后,必须手动执行 loadAllModule
|
||||||
|
* loadAllModule Modular 才会真正的被加载
|
||||||
|
* 模块加载后可以处理逻辑绑定
|
||||||
|
*/
|
||||||
|
public static async PageAsync(): Promise<{
|
||||||
|
manager: Manager<AnyWXContext>,
|
||||||
|
query: Record<string, string | undefined>
|
||||||
|
}> {
|
||||||
|
return new Promise((solve) => {
|
||||||
|
Page({
|
||||||
|
async onLoad(query) {
|
||||||
|
let manager = new Manager(this);
|
||||||
|
await solve({ manager, query });
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { Manager, Modular, AnyWXContext, WXContext, ILifetime}
|
export { Manager, Modular, AnyWXContext, WXContext, ILifetime}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
@import "../../app.scss";
|
||||||
|
|
||||||
|
view.mask {
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba($color: #000000, $alpha: .2);
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
view.mask.block {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
view.mask.none {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
view.mask.show {
|
||||||
|
animation: show .1s cubic-bezier(0, 0, 1, 1) both;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
view.mask.hide {
|
||||||
|
animation: hide .1s cubic-bezier(0, 0, 1, 1) both;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes show{
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes hide{
|
||||||
|
from {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
import { Modular, Manager } from "../../core/Module";
|
||||||
|
|
||||||
|
class Mask<M extends Manager> extends Modular<M> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动画运行时间
|
||||||
|
*/
|
||||||
|
public static readonly animateTime: number = 100;
|
||||||
|
|
||||||
|
public data? = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 蒙版的层级
|
||||||
|
*/
|
||||||
|
zIndex: 1,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 蒙版是否显示
|
||||||
|
*/
|
||||||
|
isDisplay: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 蒙版是否显示
|
||||||
|
*/
|
||||||
|
isShow: false
|
||||||
|
};
|
||||||
|
|
||||||
|
private disappearTimer?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示蒙版
|
||||||
|
*/
|
||||||
|
public showMask() {
|
||||||
|
this.setData({
|
||||||
|
isShow: true,
|
||||||
|
isDisplay: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 隐藏蒙版
|
||||||
|
*/
|
||||||
|
public hideMask() {
|
||||||
|
this.setData({
|
||||||
|
isShow: false
|
||||||
|
});
|
||||||
|
|
||||||
|
this.disappearTimer = setTimeout(() => {
|
||||||
|
this.setData({
|
||||||
|
isDisplay: false
|
||||||
|
});
|
||||||
|
}, Mask.animateTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override onLoad() {
|
||||||
|
this.setFunc(this.handleClickMask, "handleClickMask");
|
||||||
|
// Do something
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleClickMask() {
|
||||||
|
this.hideMask();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Mask };
|
||||||
|
export default Mask;
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
// pages/Account/Account.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad: function (options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
@import "./UserCard.scss";
|
@import "./UserCard.scss";
|
||||||
@import "./MainFunction.scss";
|
@import "./MainFunction.scss";
|
||||||
@import "./FunctionList.scss";
|
@import "./FunctionList.scss";
|
||||||
|
@import "../../modular/Mask/Mask.scss";
|
||||||
|
|
||||||
view.container{
|
view.container{
|
||||||
padding-top: 50rpx;
|
padding-top: 50rpx;
|
||||||
|
|||||||
@@ -2,9 +2,25 @@ import { Manager } from "../../core/Module";
|
|||||||
import { UserCard } from "./UserCard";
|
import { UserCard } from "./UserCard";
|
||||||
import { MainFunction } from "./MainFunction";
|
import { MainFunction } from "./MainFunction";
|
||||||
import { FunctionList } from "./FunctionList";
|
import { FunctionList } from "./FunctionList";
|
||||||
|
import { Mask } from "../../modular/Mask/Mask";
|
||||||
|
|
||||||
Manager.Page((manager) => {
|
(async () => {
|
||||||
manager.addModule(UserCard, "userCard");
|
|
||||||
|
// 初始化页面
|
||||||
|
const { manager, query } = await Manager.PageAsync();
|
||||||
|
|
||||||
|
// 添加蒙版 Modular
|
||||||
|
const mask = manager.addModule(Mask, "mask");
|
||||||
|
|
||||||
|
// 添加 UserCard Modular
|
||||||
|
manager.addModule(UserCard, "userCard", { mask });
|
||||||
|
|
||||||
|
// 添加 MainFunction Modular
|
||||||
manager.addModule(MainFunction, "mainFunction");
|
manager.addModule(MainFunction, "mainFunction");
|
||||||
|
|
||||||
|
// 添加 FunctionList Modular
|
||||||
manager.addModule(FunctionList, "functionList");
|
manager.addModule(FunctionList, "functionList");
|
||||||
});
|
|
||||||
|
// 初始化全部 Modular
|
||||||
|
await manager.loadAllModule(query);
|
||||||
|
})();
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
<!-- 蒙版 -->
|
||||||
|
<view class="mask {{ mask$isShow ? 'show' : 'hide' }} {{ mask$isDisplay ? 'block' : 'none' }}"
|
||||||
|
bindtap="mask$handleClickMask"></view>
|
||||||
|
|
||||||
<!-- 顶部的阴影 -->
|
<!-- 顶部的阴影 -->
|
||||||
<view class="top-shadow"></view>
|
<view class="top-shadow"></view>
|
||||||
@@ -14,8 +17,10 @@
|
|||||||
|
|
||||||
<!-- 主题变换按钮 -->
|
<!-- 主题变换按钮 -->
|
||||||
<view class="theme">
|
<view class="theme">
|
||||||
|
<view bindtap="userCard$changeTheme">
|
||||||
<image class="icon-sub" src="../../image/account/Account_Theme.svg" />
|
<image class="icon-sub" src="../../image/account/Account_Theme.svg" />
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 用户昵称 -->
|
<!-- 用户昵称 -->
|
||||||
<view class="nick h1">
|
<view class="nick h1">
|
||||||
@@ -27,7 +32,7 @@
|
|||||||
<view class="name">秦浩轩</view>
|
<view class="name">秦浩轩</view>
|
||||||
<view class="certified">
|
<view class="certified">
|
||||||
<view class="certifi-info">已认证</view>
|
<view class="certifi-info">已认证</view>
|
||||||
<view class="text-icon">√</view>
|
<image class="text-icon" src="../../image/account/Account_OK.svg"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -40,74 +45,27 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!--主要功能-->
|
<!--主要功能-->
|
||||||
<view class="card main-function"><!--四个功能合在一起的容器-->
|
<view class="card main-function">
|
||||||
<view class="branch-funtion">
|
|
||||||
<view><!--每个功能的容器-->
|
|
||||||
<image class="icon" src="../../image/account/Account_UserInfo.svg"></image><!--每个功能的图片-->
|
|
||||||
<view>账号信息</view><!--每个功能的文字-->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="branch-funtion">
|
<!--每个功能的容器-->
|
||||||
<view>
|
<view class="branch-funtion" wx:for="{{ mainFunction$mainFunctionList }}" wx:key="index">
|
||||||
<image class="icon" src="../../image/account/Account_DateList.svg"></image>
|
<view style="{{ index == (mainFunction$mainFunctionList - 1) ? 'border-bottom: 0px' : '' }}">
|
||||||
<view>课表缓存</view>
|
<!--每个功能的图片-->
|
||||||
</view>
|
<image class="icon" src="../../image/account/Account_{{ item.iconUrl }}.svg"></image>
|
||||||
</view>
|
<!--每个功能的文字-->
|
||||||
|
<view>{{ item.displayName }}</view>
|
||||||
<view class="branch-funtion">
|
|
||||||
<view>
|
|
||||||
<image class="icon" src="../../image/account/Account_Customer.svg"></image>
|
|
||||||
<view>功能定制</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="branch-funtion">
|
|
||||||
<view style="border-right: 0px;">
|
|
||||||
<image class="icon" src="../../image/account/Account_Settings.svg"></image>
|
|
||||||
<view>更多设置</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 功能列表 -->
|
<!-- 功能列表 -->
|
||||||
<view class="card function-list">
|
<view class="card function-list">
|
||||||
<view class="function">
|
|
||||||
<view>
|
|
||||||
<image class="icon func-icon" src="../../image/account/Account_Sponsor.svg" />
|
|
||||||
<view>赞助计划</view>
|
|
||||||
<image class="icon-sub arrow" src="../../image/account/Account_Arrow.svg" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="function">
|
<!-- 每一行 -->
|
||||||
<view>
|
<view class="function" wx:for="{{ functionList$functionList }}" wx:key="index">
|
||||||
<image class="icon func-icon" src="../../image/account/Account_PubilcAccount.svg" />
|
<view style="{{ index == (functionList$functionList.length - 1) ? 'border-bottom: 0px' : '' }}">
|
||||||
<view>公众号</view>
|
<image class="icon func-icon" src="../../image/account/Account_{{ item.iconUrl }}.svg" />
|
||||||
<image class="icon-sub arrow" src="../../image/account/Account_Arrow.svg" />
|
<view>{{ item.displayName }}</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="function">
|
|
||||||
<view>
|
|
||||||
<image class="icon func-icon" src="../../image/account/Account_FAQ.svg" />
|
|
||||||
<view>自助问答</view>
|
|
||||||
<image class="icon-sub arrow" src="../../image/account/Account_Arrow.svg" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="function">
|
|
||||||
<view>
|
|
||||||
<image class="icon func-icon" src="../../image/account/Account_AboutUs.svg" />
|
|
||||||
<view>关于我们</view>
|
|
||||||
<image class="icon-sub arrow" src="../../image/account/Account_Arrow.svg" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="function">
|
|
||||||
<view style="border-bottom: 0px;">
|
|
||||||
<image class="icon func-icon" src="../../image/account/Account_Support.svg" />
|
|
||||||
<view>联系客服</view>
|
|
||||||
<image class="icon-sub arrow" src="../../image/account/Account_Arrow.svg" />
|
<image class="icon-sub arrow" src="../../image/account/Account_Arrow.svg" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -1,7 +1,32 @@
|
|||||||
import { Modular, Manager } from "../../core/Module";
|
import { Modular, Manager } from "../../core/Module";
|
||||||
|
|
||||||
|
interface IFunctionListItem {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示名称
|
||||||
|
*/
|
||||||
|
displayName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图标路径
|
||||||
|
*/
|
||||||
|
iconUrl: string;
|
||||||
|
}
|
||||||
|
|
||||||
class FunctionList<M extends Manager> extends Modular<M> {
|
class FunctionList<M extends Manager> extends Modular<M> {
|
||||||
|
|
||||||
|
public static readonly functionList: IFunctionListItem[] = [
|
||||||
|
{ displayName: "赞助计划", iconUrl: "Sponsor" },
|
||||||
|
{ displayName: "公众号", iconUrl: "PubilcAccount" },
|
||||||
|
{ displayName: "自助问答", iconUrl: "FAQ" },
|
||||||
|
{ displayName: "关于我们", iconUrl: "AboutUs" },
|
||||||
|
{ displayName: "联系客服", iconUrl: "Support" }
|
||||||
|
];
|
||||||
|
|
||||||
|
public data = {
|
||||||
|
functionList: FunctionList.functionList
|
||||||
|
};
|
||||||
|
|
||||||
public override onLoad() {
|
public override onLoad() {
|
||||||
// Do something
|
// Do something
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,31 @@
|
|||||||
import { Modular, Manager } from "../../core/Module";
|
import { Modular, Manager } from "../../core/Module";
|
||||||
|
|
||||||
|
interface IMainFunctionItem {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示名称
|
||||||
|
*/
|
||||||
|
displayName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图标路径
|
||||||
|
*/
|
||||||
|
iconUrl: string;
|
||||||
|
}
|
||||||
|
|
||||||
class MainFunction<M extends Manager> extends Modular<M> {
|
class MainFunction<M extends Manager> extends Modular<M> {
|
||||||
|
|
||||||
|
public static readonly MainFunctionList: IMainFunctionItem[] = [
|
||||||
|
{ displayName: "账号信息", iconUrl: "UserInfo" },
|
||||||
|
{ displayName: "课表缓存", iconUrl: "DateList" },
|
||||||
|
{ displayName: "功能定制", iconUrl: "Customer" },
|
||||||
|
{ displayName: "更多设置", iconUrl: "Settings" }
|
||||||
|
];
|
||||||
|
|
||||||
|
public data? = {
|
||||||
|
mainFunctionList: MainFunction.MainFunctionList
|
||||||
|
}
|
||||||
|
|
||||||
public override onLoad() {
|
public override onLoad() {
|
||||||
// Do something
|
// Do something
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,9 +27,17 @@ view.user-card {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
|
||||||
image {
|
view {
|
||||||
width: 23px;
|
width: 23px;
|
||||||
height: 23px;
|
height: 23px;
|
||||||
|
padding: 20px;
|
||||||
|
margin: -20px;
|
||||||
|
border-radius: 20px;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,6 +49,7 @@ view.user-card {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 学生信息
|
||||||
view.student {
|
view.student {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -57,8 +66,10 @@ view.user-card {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
view.text-icon {
|
image.text-icon {
|
||||||
margin-left: .3em;
|
margin-left: .25em;
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,21 @@
|
|||||||
import { Modular, Manager } from "../../core/Module";
|
import { Modular, Manager } from "../../core/Module";
|
||||||
|
import { Mask } from "../../modular/Mask/Mask";
|
||||||
|
|
||||||
class UserCard<M extends Manager> extends Modular<M> {
|
type IUserCardDependent<M extends Manager> = {
|
||||||
|
mask: Mask<M>
|
||||||
|
}
|
||||||
|
|
||||||
|
class UserCard<M extends Manager> extends Modular<M, IUserCardDependent<M>> {
|
||||||
|
|
||||||
public override onLoad() {
|
public override onLoad() {
|
||||||
// Do something
|
this.setFunc(this.handleChangeTheme, "changeTheme")
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理主题更换
|
||||||
|
*/
|
||||||
|
private handleChangeTheme() {
|
||||||
|
this.depends?.mask.showMask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
// pages/Information/Information.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad: function (options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -28,7 +28,7 @@ implements Partial<ILifetime> {
|
|||||||
s.set("be", 12);
|
s.set("be", 12);
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
new Login().param({studentId: "1806240113", password: "qazxsw123"})
|
new Login().param({studentId: "2017060129", password: "hch2000210%"})
|
||||||
.request().wait({
|
.request().wait({
|
||||||
ok: (w) => {console.log("ok", w)},
|
ok: (w) => {console.log("ok", w)},
|
||||||
no: (w) => {console.log("no", w)},
|
no: (w) => {console.log("no", w)},
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
// pages/Timetable/Timetable.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad: function (options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -6,7 +6,17 @@ import { TestCore } from "./TestCore";
|
|||||||
* 此页面使用 Manager 进行模块化管理
|
* 此页面使用 Manager 进行模块化管理
|
||||||
* 若要添加先功能请先定义 Modular 并添加至 Manager
|
* 若要添加先功能请先定义 Modular 并添加至 Manager
|
||||||
*/
|
*/
|
||||||
Manager.Page((manager)=>{
|
(async () => {
|
||||||
|
|
||||||
|
// 初始化页面
|
||||||
|
const { manager, query } = await Manager.PageAsync();
|
||||||
|
|
||||||
|
// 添加 StatusBar Modular
|
||||||
manager.addModule(StatusBar, "statusBar");
|
manager.addModule(StatusBar, "statusBar");
|
||||||
|
|
||||||
|
// 添加 TestCore Modular
|
||||||
manager.addModule(TestCore, "testCore");
|
manager.addModule(TestCore, "testCore");
|
||||||
})
|
|
||||||
|
// 初始化全部 Modular
|
||||||
|
await manager.loadAllModule(query);
|
||||||
|
})()
|
||||||
+4
-9
@@ -25,7 +25,6 @@
|
|||||||
"checkSiteMap": true,
|
"checkSiteMap": true,
|
||||||
"uploadWithSourceMap": true,
|
"uploadWithSourceMap": true,
|
||||||
"compileHotReLoad": false,
|
"compileHotReLoad": false,
|
||||||
"lazyloadPlaceholderEnable": false,
|
|
||||||
"useMultiFrameRuntime": true,
|
"useMultiFrameRuntime": true,
|
||||||
"useApiHook": true,
|
"useApiHook": true,
|
||||||
"useApiHostProcess": true,
|
"useApiHostProcess": true,
|
||||||
@@ -35,18 +34,14 @@
|
|||||||
"outputPath": ""
|
"outputPath": ""
|
||||||
},
|
},
|
||||||
"enableEngineNative": false,
|
"enableEngineNative": false,
|
||||||
|
"bundle": false,
|
||||||
"useIsolateContext": false,
|
"useIsolateContext": false,
|
||||||
|
"useCompilerModule": true,
|
||||||
|
"userConfirmedUseCompilerModuleSwitch": false,
|
||||||
"userConfirmedBundleSwitch": false,
|
"userConfirmedBundleSwitch": false,
|
||||||
"packNpmManually": false,
|
"packNpmManually": false,
|
||||||
"packNpmRelationList": [],
|
"packNpmRelationList": [],
|
||||||
"minifyWXSS": true,
|
"minifyWXSS": true
|
||||||
"disableUseStrict": false,
|
|
||||||
"minifyWXML": true,
|
|
||||||
"showES6CompileOption": false,
|
|
||||||
"useCompilerPlugins": [
|
|
||||||
"typescript",
|
|
||||||
"sass"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"simulatorType": "wechat",
|
"simulatorType": "wechat",
|
||||||
"simulatorPluginLibVersion": {},
|
"simulatorPluginLibVersion": {},
|
||||||
|
|||||||
Reference in New Issue
Block a user