Showing preview only (904K chars total). Download the full file or copy to clipboard to get everything.
Repository: GreenPomelo/Undergraduate
Branch: master
Commit: 588a71f801d0
Files: 127
Total size: 827.6 KB
Directory structure:
gitextract_xiig83cc/
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .github/
│ └── ISSUE_TEMPLATE/
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── .prettierrc
├── CHANGELOG.md
├── LICENSE
├── README-zh_CN.md
├── README.md
├── package.json
├── src/
│ ├── app.wpy
│ ├── campus-card-page/
│ │ ├── components/
│ │ │ ├── consumption-detail-card.wpy
│ │ │ ├── pay-flow.wpy
│ │ │ ├── pwdfield.wpy
│ │ │ └── wxcharts-min.js
│ │ └── pages/
│ │ ├── add-room.wpy
│ │ ├── campus-card-charge.wpy
│ │ ├── campus-card-index.wpy
│ │ ├── campus-card-loss.wpy
│ │ ├── campus-card-lossPage.wpy
│ │ ├── consumption-detail.wpy
│ │ ├── electric-charge.wpy
│ │ ├── money-log.wpy
│ │ ├── net-charge.wpy
│ │ └── select-room.wpy
│ ├── components/
│ │ ├── baseContainer.wpy
│ │ ├── qy-container.wpy
│ │ ├── qy-datetime-select.wpy
│ │ ├── qy-input.wpy
│ │ ├── qy-listitem.wpy
│ │ ├── qy-modal.wpy
│ │ ├── qy-navigation.wpy
│ │ ├── qy-popup.wpy
│ │ ├── qy-swiper.wpy
│ │ └── qy-tip.wpy
│ ├── css/
│ │ ├── global-style.styl
│ │ ├── loading.styl
│ │ ├── normal-input.styl
│ │ └── search-input.styl
│ ├── edu-admin-page/
│ │ ├── components/
│ │ │ ├── card.wpy
│ │ │ ├── grade-card.wpy
│ │ │ └── subject-card.wpy
│ │ └── pages/
│ │ ├── check-grade.wpy
│ │ ├── course.wpy
│ │ ├── credit.wpy
│ │ ├── cut-down.wpy
│ │ ├── score-inquire.wpy
│ │ ├── search-course.wpy
│ │ └── supplement-and-tutorials.wpy
│ ├── mixins/
│ │ ├── Gpa/
│ │ │ ├── Gpa.js
│ │ │ └── utils.js
│ │ ├── all-search-thing.js
│ │ ├── class.js
│ │ ├── get-div-info.js
│ │ ├── module.js
│ │ └── test.js
│ ├── mock/
│ │ ├── campusCard.js
│ │ ├── common.js
│ │ ├── education.js
│ │ ├── index.js
│ │ ├── library.js
│ │ └── notification.js
│ ├── others-edu-page/
│ │ ├── components/
│ │ │ ├── GpaCard.wpy
│ │ │ ├── GpaCustomScore.wpy
│ │ │ └── pe-card.wpy
│ │ ├── graduatePages/
│ │ │ ├── clear-memory.wpy
│ │ │ ├── index.wpy
│ │ │ ├── memory-choose.wpy
│ │ │ ├── memory-mode.wpy
│ │ │ └── say-goodbye.wpy
│ │ └── pages/
│ │ ├── GpaCalculator.wpy
│ │ ├── calendar.wpy
│ │ └── pe-score.wpy
│ ├── others-page/
│ │ ├── components/
│ │ │ ├── bus-card.wpy
│ │ │ ├── changeLogItem.wpy
│ │ │ ├── information-card.wpy
│ │ │ └── seats-card.wpy
│ │ ├── mixins/
│ │ │ ├── all-search-thing.js
│ │ │ └── page-jump.js
│ │ ├── pages/
│ │ │ ├── advertisement.wpy
│ │ │ ├── associationPages/
│ │ │ │ ├── association-detail.wpy
│ │ │ │ ├── association-register.wpy
│ │ │ │ ├── association.wpy
│ │ │ │ ├── club-personal.wpy
│ │ │ │ └── register-success.wpy
│ │ │ ├── auth.wpy
│ │ │ ├── close.wpy
│ │ │ ├── display-webview.wpy
│ │ │ ├── feedbackPages/
│ │ │ │ ├── feedback.wpy
│ │ │ │ ├── historyfeedback.wpy
│ │ │ │ └── myfeedback.wpy
│ │ │ ├── information-box.wpy
│ │ │ ├── libraryPages/
│ │ │ │ ├── library-history.wpy
│ │ │ │ ├── library-recommened.wpy
│ │ │ │ └── library.wpy
│ │ │ ├── login.wpy
│ │ │ ├── more.wpy
│ │ │ ├── news.wpy
│ │ │ ├── nicpPages/
│ │ │ │ ├── nicp-check-in.wpy
│ │ │ │ ├── nicp-more.wpy
│ │ │ │ └── nicp-vote.wpy
│ │ │ ├── personalPages/
│ │ │ │ ├── aboutus.wpy
│ │ │ │ ├── change-password.wpy
│ │ │ │ ├── change-phone.wpy
│ │ │ │ ├── changelog.wpy
│ │ │ │ └── protocol.wpy
│ │ │ ├── questionnairePages/
│ │ │ │ ├── questionnaire-homepage.wpy
│ │ │ │ └── questionnaire.wpy
│ │ │ ├── run.wpy
│ │ │ ├── school-bus.wpy
│ │ │ ├── search.wpy
│ │ │ └── tuition.wpy
│ │ └── wxs/
│ │ └── filter.wxs
│ ├── pages/
│ │ ├── index.wpy
│ │ ├── news-list.wpy
│ │ └── profile.wpy
│ ├── store/
│ │ ├── actions/
│ │ │ └── index.js
│ │ ├── index.js
│ │ ├── reducers/
│ │ │ ├── graduate.js
│ │ │ ├── index.js
│ │ │ └── visitor-mode.js
│ │ └── types/
│ │ ├── graduate.js
│ │ └── visitor-mode.js
│ └── utils/
│ └── Crypto.js
└── wepy.config.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
================================================
FILE: .eslintignore
================================================
/src/campus-card-page/components/wxcharts-min.js
================================================
FILE: .eslintrc.js
================================================
module.exports = {
root: true,
parser: "babel-eslint",
parserOptions: {
sourceType: "module"
},
env: {
browser: true
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: ["prettier"],
// required to lint *.wpy files
plugins: ["html", "prettier"],
settings: {
"html/html-extensions": [".html", ".wpy"]
},
// add your custom rules here
rules: {
"prettier/prettier": "error",
// allow paren-stylus arrow functions
"arrow-parens": 0,
// allow async-await
"generator-star-spacing": 0,
// allow debugger during development
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
"space-before-function-paren": 0,
"standard/computed-property-even-spacing": 0
},
prettier: {
singleQuote: true,
semi: false
},
globals: {
getCurrentPages: true
}
};
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .gitignore
================================================
dist/*
node_modules/*
src/config/*
.DS_Store
.idea/*
.vscode/*
.wepycache
src/api/*
================================================
FILE: .prettierrc
================================================
{
"singleQuote": false,
"semi": true,
"overrides": [
{
"files": "*.wpy",
"options": {
"parser": "babylon"
}
}
]
}
================================================
FILE: CHANGELOG.md
================================================
### 3.4.6 (2018-12-25)
- 添加电费余额查询
### 3.4.5 (2018-12-22)
- 添加 `wx.updateManager`
### 3.4.4 (2018-12-21)
- 添加金额操作记录页面
### 3.4.3 (2018-12-16)
- 更改一卡通支付逻辑
- 修复电费充值的若干 bug
### 3.4.2 (2018-12-07)
- module 接口改为到具体页面接入,让首页顶部的 icon 加载更快
### 3.4.1 (2018-12-04)
- 将体育部,问卷页面和 userInfo 解耦
- 问卷,考试倒计时,体育部页面添加 Loading
### 3.4.0 (2018-11-10)
- 消息盒子的提示红点
- 资讯 TabBar 的小红点
- 拦截器的 API 替换
- 校园卡拾取的匿名
### 3.3.4 (2018-10-23)
- 修复消息盒子不提示的 bug
- 优化图书馆模块的代码
- 修复淘宝口令会弹出社团招新模态框的 bug 以及添加可以关闭模态框
### 3.3.1 (2018-10-17)
- 增加 `wx-axios` 模块以及拦截器的整合,重构 API 列表
- 修复来回登录的 bug 以及更新错误处理
- 首页的逻辑,代码优化
### 3.3.0 (2018-10-16)
- 整合开源版本
- 修复充值组件需要嵌套 `$parent` 的 bug
### 3.2.2 (2018-10-01)
- 导航栏切换为迎国庆
### 3.2.1 (2018-09-07)
- 导航栏切换为开学季
### 3.2.0 (2018-8-13)
- 修改注册登录的逻辑
- 增加了修改绑定手机功能
- 更新了一卡通的页面风格
- 增加了电费充值绑定宿舍的功能
- 增加了学费查询功能
- 添加跳转到校谈的入口
- 微调了一些 ui,修复了一些 bug
- 运营在痛骂程序员不给力
### 3.0.1 (2018-4-20)
- 登录注册添加友好错误提示
- 修复图书馆搜索结果 bug
- 修复反馈对话界面的消息排版出错 bug
- 修复挂失列表加载问题
- 完成考试倒计时
### 3.0.0 (2018-4-8)
- 新增绑定用户手机号功能
- 新增电费、网费充值
- 新增用户消息系统
- 新增搜索功能页
- 新增 GPA 计算器
- 完善课表查询
- 完善考试倒计时
- 祭天了一个产品经理
### 2.4.0 (2017-10-12)
- 增加了青柚工作室招新
- 更改了欢迎页面
- 增加了我的反馈页面,大家可以看到自己的反馈状态
- 程序员已经快要祭不动了
### 2.3.0 (2017-9-1)
- 修复社团招新的一些 bug
- 校园卡功能恢复
- 新增了欢迎页面
- 体育部功能恢复正常使用
- 祭天的程序员被拉出来又祭了一次
### 2.0.0 (2017-8-10)
- 新增更多功能入口
- 新增考试查询、补考查询,等级考试,补考辅导课查询功能
- 新增查学费功能
- 新增图书馆荐购功能
- 新增校园卡挂失,解挂失,发布挂失消息功能
- 新增资讯详情页附件在线预览功能
- 完善更新密码的方式
- 完善课表查询功能
================================================
FILE: LICENSE
================================================
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Undergraduate
Copyright (C) 2018 GreenPomelo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.
================================================
FILE: README-zh_CN.md
================================================
## 南京邮电大学小程序
[English](./README.md) | 简体中文
### 介绍
南京邮电大学小程序是由南京邮电大学青柚工作室开发,一款方便快捷,无需下载安装即可在微信客户端即开即用的 APP,有别于一般需要下载安装的 APP,也不同于微信公众号,具有方便快捷的特点。
<p align="center">
<img src="https://static.airbob.org/under-graduate/undergraduate-qrcode.jpg" alt="菊花码" width="200" height="200">
</p>
### 学习本项目
整套前端使用 [Wepy](https://github.com/tencent/wepy) 开发,提倡前端组件化工程化,高效的完成前端项目。
#### 项目文件结构
```
project
│
└───src
│ │ assets 静态图片
│ │
│ └───campus-card-page
│ │ │ components 校园卡模块组件
│ │ │ pages 校园卡模块页面
│ │
│ └───components 全局组件
│ │ │ qy-container.wpy
│ │ │ qy-navigation.wpy
│ │ │ ...
│ │
│ └───css 全局样式
│ │ │ global-style.styl
│ │ │ loading.styl
│ │ │ ...
│ │
│ └───edu-admin-page
│ │ │ components 正方模块组件
│ │ │ pages 正方模块页面
│ │
│ └───mixins 混入
│ │ │ Gpa Gpa 计算器的 mixin
│ │ │ class.js 课表的 mixin
│ │ │ all-search-thing.js 模块开关的控制
│ │ │ ...
│ │
│ └───others-edu-page
│ │ │ components 体育部模块组件
│ │ │ pages 体育部模块页面
│ │
│ └───others-page
│ │ │ components 其他模块组件
│ │ │ pages 其他模块页面
│ │
│ └───pages 三个主页面
│ │ │ index.wpy 首页
│ │ │ news-list.wpy 资讯页
│ │ │ profile.wpy 个人中心页
│ │
│ └───store 状态管理
│ │
│ └───utils 工具辅助函数
│ │
│ └───app.wpy 项目配置
│
│ .editorconfig
│ .eslintignore
│ .eslintrc.js
│ .gitignore
│ .prettierrc
│ CHANGELOG.md
│ LICENSE
│ README.md
│ package.json
│ wepy.config.js
```
#### 安装(更新) wepy 命令行工具
> node >= 8.9
```bash
$ npm install -g wepy-cli
```
#### 安装依赖 & 开发实时编译
```
$ cd [project]
$ npm install
$ npm run dev
```
------
### 青柚工作室
[青柚工作室的主页](https://qingyou.njupt.edu.cn)
青柚工作室是由南京邮电大学信息办指导建设,以学生开发为核心的互联网工作团队。
倡导使用新技术、优秀的技术去实现智慧校园,服务同学。
本项目至少会持续维护到南京邮电大学本科生 3.x 版本结束。
------
### 开源许可
本项目使用开源许可证 `License AGPLv3` ,代码开源仅供学习。
请认真阅读并遵守以下开源协议
`AGPLv3` [GNU Affero General Public License v3.0](https://github.com/GreenPomelo/Undergraduate/blob/master/LICENSE)
#### 青柚工作室开源计划:
希望能够将实战中的技术成果回报社区,并且鼓励社区为这个项目做出贡献,大家可以通过 `Pull Requests` 的方式帮我们解决目前存在的不足,或者通过 `Issues` 告知我们。
------
### 青柚工作室招新计划:
青柚工作室持续招新,对象为南京邮电大学全日制本科生,主要以大二大三在校学生为主,大一能力强者亦可。招新岗位为技术、外联、运营、办公、程序员鼓励师......希望有兴趣的同学能投递简历至`qingyou@njupt.edu.cn`,一起来用爱发电,为南邮做出更多方便师生的项目。
------
### 更新日志
[CHANGELOG](./CHANGELOG.md)
<table>
<tr>
<td align="center"><a href="https://github.com/solojiang"><img src="https://github.com/solojiang.png?s=64" width="100px;"/><br /><sub><b>狒狒神</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/Bosspwn"><img src="https://github.com/Bosspwn.png?s=64" width="100px;"/><br /><sub><b>Boss Pwn</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/flytam"><img src="https://github.com/flytam.png?s=64" width="100px;"/><br /><sub><b>Flytam</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/GooeyNyan"><img src="https://github.com/GooeyNyan.png?s=64" width="100px;"/><br /><sub><b>GooeyNyan</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/UZIhuhuhu"><img src="https://github.com/UZIhuhuhu.png?s=64" width="100px;"/><br /><sub><b>WynnXin</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/niffler-bkkkk"><img src="https://github.com/niffler-bkkkkk.png?s=64" width="100px;"/><br /><sub><b>niffler-bkkkk</b></sub></a><br /></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/kishivn"><img src="https://github.com/kishivn.png?s=64" width="100px;"/><br /><sub><b>kishivn</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/ChenKS12138"><img src="https://github.com/ChenKS12138.png?s=64" width="100px;"/><br /><sub><b>ChenKS12138</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/cucu6"><img src="https://github.com/cucu6.png?s=64" width="100px;"/><br /><sub><b>cucu6</b></sub></a><br /></td>
</tr>
</table>
================================================
FILE: README.md
================================================
## MiniProgram of Nanjing University of Posts and Telecommunications
English | [简体中文](./README-zh_CN.md)
### Introduction
The MiniProgram of Nanjing University of Posts and Telecommunications(hereinafter called NJUPT MiniProgram), developed by QingYou Studio of NJUPT, which is a convenient and swift application that can launch in WeChat client immediately dispense with download and install. Different from the common applications that need to download and install and WeChat Official Account, it is convenient and efficient.
<p align="center">
<img src="https://static.airbob.org/under-graduate/undergraduate-qrcode.jpg" alt="菊花码" width="200" height="200">
</p>
### Learn this Project
Advocating componentization and engineering of front-end, this project is developed by [Wepy](https://github.com/tencent/wepy), to finish front-end project efficiently.
### Files Structure
```
project
│
└───src
│ │ assets static images
│ │
│ └───campus-card-page
│ │ │ components components of Campus-card module
│ │ │ pages pages of Campus-card module
│ │
│ └───components global components
│ │ │ qy-container.wpy
│ │ │ qy-navigation.wpy
│ │ │ ...
│ │
│ └───css global css style
│ │ │ global-style.styl
│ │ │ loading.styl
│ │ │ ...
│ │
│ └───edu-admin-page
│ │ │ components components of ZHENGFANG module
│ │ │ pages pages of ZHENGFANG module
│ │
│ └───mixins
│ │ │ Gpa mixin of GPA Calculator
│ │ │ class.js mixin of Curriculum
│ │ │ all-search-thing.js controller of modules
│ │ │ ...
│ │
│ └───others-edu-page
│ │ │ components components of PE module
│ │ │ pages pages of PE module
│ │
│ └───others-page
│ │ │ components components of other modules
│ │ │ pages pages of other modules
│ │
│ └───pages Main Pages
│ │ │ index.wpy Homepage
│ │ │ news-list.wpy Information Page
│ │ │ profile.wpy Personal Page
│ │
│ └───store state management
│ │
│ └───utils auxiliary functions
│ │
│ └───app.wpy project config
│
│ .editorconfig
│ .eslintignore
│ .eslintrc.js
│ .gitignore
│ .prettierrc
│ CHANGELOG.md
│ LICENSE
│ README.md
│ package.json
│ wepy.config.js
```
### Install (Update) Wepy-Cli
> node >= 8.9
```bash
$ npm install -g wepy-cli
```
### Install Dependencies & Serve with Hot Reload
```
$ cd [project]
$ npm install
$ npm run dev
```
------
### QingYou Studio
[Homepage of QingYou Studio](https://qingyou.njupt.edu.cn)
Built up by Information Office of NJUPT, QingYou Studio is an Internet working team with student developement as its core.
We advocate to use new and excellent technologies to achieve the Smart Campus and to serve students.
This project will be maintained at least until the end of the 3.x version of NJUPT-Undergraduate.
------
### License
This project uses the license `License AGPLv3`,and the code is open source for learning.
Please read and abide by the following open source agreements:
`AGPLv3` [GNU Affero General Public License v3.0](https://github.com/GreenPomelo/Undergraduate/blob/master/LICENSE)
### QingYou Studio Open Source
We hope that we can return the technical achievements to the community, and we encourage the community to contribute to this project. You can help us resolve the existing deficiencises through `Pull Request`, or tell us through `Issue`.
------
### QingYou Studio Recruitment
Mainly in the sophomore and junior students, QingYou Studio is recruiting new members from the full-time undergraduates in NJUPT, and the freshman who has excellent ability can be also recruited. Our posts contain technology, outreach, operations, office and ...... We hope anyone interested in can submit your resume to `qingyou@njupt.edu.cn`, together with us to do more projects for teachers and students in NJUPT.
------
### Update Log
[CHANGELOG](./CHANGELOG.md)
-----
### Core Team(Contributors)
<table>
<tr>
<td align="center"><a href="https://github.com/solojiang"><img src="https://github.com/solojiang.png?s=64" width="100px;"/><br /><sub><b>狒狒神</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/Bosspwn"><img src="https://github.com/Bosspwn.png?s=64" width="100px;"/><br /><sub><b>Boss Pwn</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/flytam"><img src="https://github.com/flytam.png?s=64" width="100px;"/><br /><sub><b>Flytam</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/GooeyNyan"><img src="https://github.com/GooeyNyan.png?s=64" width="100px;"/><br /><sub><b>GooeyNyan</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/UZIhuhuhu"><img src="https://github.com/UZIhuhuhu.png?s=64" width="100px;"/><br /><sub><b>WynnXin</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/niffler-bkkkk"><img src="https://github.com/niffler-bkkkkk.png?s=64" width="100px;"/><br /><sub><b>niffler-bkkkk</b></sub></a><br /></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/kishivn"><img src="https://github.com/kishivn.png?s=64" width="100px;"/><br /><sub><b>kishivn</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/ChenKS12138"><img src="https://github.com/ChenKS12138.png?s=64" width="100px;"/><br /><sub><b>ChenKS12138</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/cucu6"><img src="https://github.com/cucu6.png?s=64" width="100px;"/><br /><sub><b>cucu6</b></sub></a><br /></td>
</tr>
</table>
================================================
FILE: package.json
================================================
{
"name": "undergraduate",
"version": "3.4.24",
"description": "NJUPT wechat app for undergraduate students",
"main": "dist/app.js",
"file": [
"src"
],
"scripts": {
"dev": "wepy build --watch",
"build": "cross-env NODE_ENV=production wepy build --no-cache",
"lint": "./node_modules/.bin/eslint --fix src/**",
"precommit": "lint-staged",
"format": "prettier-eslint --write *.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/GreenPomelo/Undergraduate"
},
"bugs": {
"url": "https://github.com/GreenPomelo/Undergraduate/issues"
},
"keywords": [
"wechat-app"
],
"author": "GreenPomelo <qingyou@njupt.edu.cn>",
"license": "AGPL",
"lint-staged": {
"*.{js,wpy}": [
"./node_modules/.bin/eslint --fix",
"git add"
]
},
"dependencies": {
"@types/crypto-js": "^3.1.43",
"crypto-js": "^3.1.9-1",
"qs": "^6.5.2",
"redux": "^3.7.2",
"redux-actions": "^2.2.1",
"redux-promise": "^0.5.3",
"stylus": "^0.54.5",
"we-rich": "^1.0.2",
"wepy": "^1.7.1",
"wepy-async-function": "^1.4.4",
"wepy-redux": "^1.5.3",
"wx-axios": "^0.0.7"
},
"devDependencies": {
"babel-eslint": "^7.2.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-export-extensions": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-1": "^6.24.1",
"cross-env": "^5.1.1",
"eslint": ">=4.18.2",
"eslint-config-prettier": "^2.9.0",
"eslint-friendly-formatter": "^2.0.7",
"eslint-plugin-html": "^3.2.2",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-promise": "^3.5.0",
"husky": "^0.14.3",
"lint-staged": "^4.3.0",
"prettier": "^1.7.4",
"prettier-eslint-cli": "^4.7.0",
"wepy-compiler-babel": "^1.5.1",
"wepy-compiler-pug": "^1.4.7",
"wepy-compiler-stylus": "^1.3.10",
"wepy-eslint": "^1.5.2",
"wepy-plugin-autoprefixer": "^1.5.10",
"wepy-plugin-imagemin": "^1.5.2",
"wepy-plugin-uglifyjs": "^1.3.6"
},
"homepage": "https://qingyou.njupt.edu.cn"
}
================================================
FILE: src/app.wpy
================================================
<style lang="stylus">
.container
font-family -apple-system-font, Helvetica Neue, Helvetica, sans-serif
</style>
<script>
import wepy from "wepy";
import { setStore } from "wepy-redux";
import configStore from "./store/index";
// 抽离api
import "wepy-async-function";
// redux store
const store = configStore();
setStore(store);
wepy.$store = store;
// override showToast
export default class extends wepy.app {
config = {
pages: ["pages/index", "pages/news-list", "pages/profile"],
subPackages: [
{
root: "others-page/",
pages: [
"pages/search",
"pages/login",
"pages/news",
"pages/information-box",
"pages/libraryPages/library",
"pages/libraryPages/library-recommened",
"pages/libraryPages/library-history",
"pages/run",
"pages/feedbackPages/feedback",
"pages/feedbackPages/myfeedback",
"pages/feedbackPages/historyfeedback",
"pages/more",
"pages/personalPages/changelog",
"pages/personalPages/aboutus",
"pages/close",
"pages/personalPages/protocol",
"pages/advertisement",
"pages/display-webview",
"pages/tuition",
"pages/personalPages/change-phone",
"pages/personalPages/change-password",
"pages/associationPages/association",
"pages/associationPages/association-detail",
"pages/associationPages/association-register",
"pages/associationPages/register-success",
"pages/associationPages/club-personal",
"pages/auth",
"pages/questionnairePages/questionnaire-homepage",
"pages/questionnairePages/questionnaire",
"pages/nicpPages/nicp-check-in",
"pages/nicpPages/nicp-vote",
"pages/nicpPages/nicp-more",
"pages/school-bus"
]
},
{
root: "edu-admin-page/",
pages: [
"pages/supplement-and-tutorials",
"pages/check-grade",
"pages/cut-down",
"pages/course",
"pages/search-course",
"pages/score-inquire",
"pages/credit"
]
},
{
root: "others-edu-page/",
pages: [
"pages/pe-score",
"pages/GpaCalculator",
"pages/calendar",
"graduatePages/index",
"graduatePages/memory-choose",
"graduatePages/memory-mode",
"graduatePages/clear-memory",
"graduatePages/say-goodbye"
// "pages/avatar"
]
},
{
root: "campus-card-page/",
pages: [
"pages/campus-card-index",
"pages/campus-card-charge",
"pages/campus-card-loss",
"pages/money-log",
"pages/campus-card-lossPage",
"pages/consumption-detail",
"pages/electric-charge",
"pages/net-charge",
"pages/select-room",
"pages/add-room"
]
}
],
window: {
backgroundTextStyle: "dark",
navigationBarBackgroundColor: "#ffffff",
navigationBarTitleText: "NJUPT",
navigationBarTextStyle: "black",
navigationStyle: "custom"
},
tabBar: {
color: "#353535",
selectedColor: "#47CFF5",
backgroundColor: "#ffffff",
list: [
{
pagePath: "pages/index",
text: "首页",
iconPath: "assets/index.png",
selectedIconPath: "assets/index-active.png"
},
{
pagePath: "pages/news-list",
text: "资讯",
iconPath: "assets/news-list.png",
selectedIconPath: "assets/news-list-active.png"
},
{
pagePath: "pages/profile",
text: "我的",
iconPath: "assets/profile.png",
selectedIconPath: "assets/profile-active.png"
}
]
},
navigateToMiniProgramAppIdList: ["wx7d66d77988bbeab3", "wxf8b4559a02c8266d"]
};
globalData = {
cancelTokenData: {
name: "123"
},
userInfo: null,
associationUserTableInfo: {},
associationStatus: [],
modules: [
{
name: "课表",
path: "../edu-admin-page/pages/course",
src: "https://static.airbob.org/under-graduate/more/timetable.png",
isIndex: true,
id: 16,
isOpen: true,
isNew: false,
module: "正方"
},
{
name: "成绩查询",
path: "../edu-admin-page/pages/score-inquire",
src: "https://static.airbob.org/under-graduate/more/results query.png",
isIndex: true,
id: 9,
isOpen: true,
isNew: false,
module: "正方"
},
{
name: "一卡通",
path: "../campus-card-page/pages/campus-card-index",
src: "https://static.airbob.org/under-graduate/more/card.png",
isIndex: true,
id: 4,
isOpen: true,
isNew: false,
module: "一卡通"
},
{
name: "图书馆",
path: "../others-page/pages/libraryPages/library",
src: "https://static.airbob.org/under-graduate/more/library.png",
isIndex: true,
id: 0,
isOpen: true,
isNew: false,
module: "图书馆"
},
{
name: "晨跑",
path: "../others-page/pages/run",
src: "https://static.airbob.org/under-graduate/more/run.png",
isIndex: true,
id: 19,
isOpen: true,
isNew: false,
module: "晨跑"
},
{
name: "体育部",
path: "../others-edu-page/pages/pe-score",
src: "https://static.airbob.org/under-graduate/more/sport.png",
isIndex: true,
id: 10,
isOpen: true,
isNew: false,
module: "体育部"
},
{
name: "GPA计算器",
src: "https://static.airbob.org/under-graduate/more/gpa.png",
isIndex: true,
id: 21,
path: "../others-edu-page/pages/GpaCalculator",
module: "正方",
isOpen: true,
isNew: false
},
{
name: "更多",
path: "../others-page/pages/more",
src: "https://static.airbob.org/under-graduate/more/more.png",
isIndex: true,
id: -1,
isNew: false
}
]
};
constructor() {
super();
this.use("requestfix");
this.use("promisify");
}
onLaunch() {
const updateManager = wx.getUpdateManager();
updateManager.onUpdateReady(function() {
wepy
.showModal({
title: "更新提示",
content: "新版本已经准备好,是否重启应用?"
})
.then(res => {
if (res.confirm) {
updateManager.applyUpdate();
}
});
});
}
showTip(title = "请求发生错误") {
wepy.showToast({
title,
icon: "none"
});
}
timeToDate(timestamp) {
const date = new Date(timestamp);
const Y = date.getFullYear() + "-";
const M =
(date.getMonth() + 1 < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1) + "-";
const D = date.getDate() + " ";
return Y + M + D;
}
}
</script>
================================================
FILE: src/campus-card-page/components/consumption-detail-card.wpy
================================================
<template>
<view class="card-container">
<view class="time">{{occTime}}</view>
<repeat for="{{list}}" key="index">
<view class="card-list">
<view class="list-item" >{{item.mercname}}</view>
<view class="list-item">{{item.tranname}}</view>
<view class="list-item {{item.tranamt>0?'add':'des'}}">{{item.tranamt}}</view>
</view>
</repeat>
</view>
</template>
<script>
import wepy from "wepy";
export default class ConsumptionDetail extends wepy.component {
props = {
list: {
default: [],
type: Array
},
occTime: {
default: "",
type: String
}
};
}
</script>
<style lang="stylus" scoped>
.card-container
color #353535
display flex
flex-direction column
align-items center
.time
font-size 24rpx
font-weight bold
height 60rpx
line-height 60rpx
color #888
.card-list
display flex
width 100%
background-color rgb(255,255,255)
& + .card-list
border-top 2rpx solid #E3E3E3
.list-item
width 33%
font-size 28rpx
text-align center
word-break keep-all
white-space nowrap
overflow hidden
text-overflow ellipsis
height 84rpx
line-height 84rpx
.add
color #09BB07
font-weight bold
.des
color #E64340
font-weight bold
</style>
================================================
FILE: src/campus-card-page/components/pay-flow.wpy
================================================
<template>
<view class="mask-container" hidden="{{!open}}" animation="{{coverAnimation}}">
<view class="pay-container" style="height: {{soterPay ? '635rpx' : '770rpx'}}">
<image
@tap.stop="closeModal"
mode="widthFix"
src="https://static.airbob.org/under-graduate/charge/btu_close.png"
class="close"
/>
<view class="confirm">确认充值</view>
<view class="change-pay-type" @tap="changePayType" wx:if="{{isSoterAble && failPayTimes < 5}}">{{ soterPay ? "输入密码" : "使用指纹" }}</view>
<block>
<view class="charge-text">¥ {{showCharge}}</view>
<view class="small-list">
<view class="text1">操作内容</view>
<view class="text2">{{operateContent}}</view>
</view>
<view class="small-list">
<view class="text1">充值方式</view>
<view class="text2">{{payWay}}</view>
</view>
<view wx:if="{{open && soterPay}}" class="confirm-button">
<button class="pay-button" @tap.stop="handlePay">确认支付</button>
</view>
<view wx:if="{{open && !soterPay}}">
<Pw color="black"/>
</view>
</block>
</view>
</view>
</template>
<script>
// 支付流程
import wepy from "wepy";
import Pw from "./pwdfield";
import {
transferCard,
transferNet,
transferEle,
verifyFingerPrint
} from "@/api/campusCard";
export default class PayFlow extends wepy.component {
props = {
charge: {
default: 0,
type: [Number, String],
twoWay: true
},
payWay: String,
operateContent: String,
open: {
default: false,
type: Boolean,
twoWay: true
},
electricURL: {
type: String,
twoWay: true,
default: "" // 只有电费才用这个
},
type: String // 充值的类型 card net electric
};
components = {
Pw
};
data = {
coverAnimation: {},
password: "",
showCharge: 0,
// 是否支持生物认证
isSoterAble: false,
// 支付方式
soterPay: false,
// 识别失败次数,大于5次后使用密码支付
failPayTimes: 0
};
watch = {
open: next => {
const coverAnimation = wepy.createAnimation({
timingFunction: "ease-in-out"
});
if (next) {
this.coverAnimation = coverAnimation
.backgroundColor("rgba(0,0,0,0.5)")
.step()
.export();
} else {
this.coverAnimation = coverAnimation
.backgroundColor("rgba(0,0,0,0)")
.step()
.export();
}
this.$invoke("Pw", "clear");
this.$apply();
},
charge: next => {
if (typeof next === "number") {
this.showCharge = next.toFixed(2);
this.$apply();
}
}
};
events = {
value: val => {
// 发起支付
this.password = val;
this.enterPay();
this.$apply();
}
};
methods = {
closeModal() {
this.handleGG();
},
handlePay() {
wx.startSoterAuthentication({
requestAuthModes: ["facial", "fingerPrint"],
challenge: wepy.getStorageSync("token"),
authContent: "验证身份进行支付",
success: async res => {
const { resultJSON, resultJSONSignature } = res;
// 验证指纹
wepy.showLoading({
title: "正在验证"
});
const { code } = await wepy.login();
verifyFingerPrint(resultJSON, resultJSONSignature, code).then(
verifyResponse => {
const {
data: { data, success }
} = verifyResponse;
wepy.hideLoading();
if (success && data.is_ok) {
// 密码赋值,调支付接口
this.password = data.password;
this.enterPay();
} else {
if (++this.failPayTimes >= 5) {
wepy.showToast({
title: "失败次数过多,请使用密码支付",
icon: "none",
duration: 1500
});
} else {
wepy.showToast({
title: "验证失败,请重试!",
icon: "none",
duration: 1500
});
++this.failPayTimes;
}
}
this.$apply();
}
);
},
fail: res => {
const { errCode } = res;
switch (errCode) {
// 重试次数过多冻结
case 90010:
wepy.showToast({
title: "失败次数过多,请使用密码支付",
icon: "none",
duration: 1500
});
this.failPayTimes = 999;
this.soterPay = false;
break;
// 识别失败
case 90009:
if (++this.failPayTimes >= 5) {
wepy.showToast({
title: "失败次数过多,请使用密码支付",
icon: "none",
duration: 1500
});
this.soterPay = false;
} else {
wepy.showToast({
title: "识别失败,请重试",
icon: "none",
duration: 1500
});
}
break;
// 用户取消授权
case 90008:
this.handleGG();
break;
// 锁屏
case 90007:
wepy.showToast({
title: "验证已取消,请重新支付",
icon: "none",
duration: 1500
});
break;
// 内部错误
default:
wepy.showToast({
title: "未知错误,请使用密码支付",
icon: "none",
duration: 1500
});
this.soterPay = false;
}
this.$apply();
}
});
},
changePayType() {
this.soterPay = !this.soterPay;
}
};
handleGG() {
this.open = false;
this.soterPay = this.isSoterAble && this.failPayTimes < 5;
this.charge = "";
this.$invoke("Pw", "clear");
this.$apply();
}
chargeCard() {
// 充值校园卡
transferCard(this.charge * 100, this.password).then(res => {
wepy.hideLoading();
if (res.data) {
// 充值成功
const resData = JSON.parse(res.data.data);
if (resData.transfer.retcode === "0") {
wepy.showToast({
title: "充值成功",
icon: "success",
duration: 2000
});
this.handleGG();
} else {
// 余额不足之类的
wepy
.showModal({
content: resData.transfer.errmsg,
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
})
.then(res => {
this.handleGG();
});
}
}
this.$apply();
});
}
chargeNet() {
// 充值网费
transferNet(this.charge * 100, this.password).then(res => {
wepy.hideLoading();
if (res.data) {
// 密码正确的情况
const resData = JSON.parse(res.data.data);
if (resData.pay_net_gdc.retcode === "0") {
// 充值成功
wepy.showToast({
title: "充值成功",
icon: "success",
duration: 2000
});
this.handleGG();
} else {
// 余额不足之类的
wepy
.showModal({
content: resData.pay_net_gdc.errmsg,
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
})
.then(res => {
this.handleGG();
});
}
}
});
}
async chargeEle() {
//充值电费
transferEle(this.electricURL, this.charge * 100, this.password).then(
res => {
wepy.hideLoading();
if (res.data) {
// 密码正确的情况
const resData = JSON.parse(res.data.data);
if (resData.pay_elec_gdc.retcode === "0") {
// 充值成功
wepy.showToast({
title: "充值成功",
icon: "success",
duration: 2000
});
this.handleGG();
} else {
// 余额不足之类
wepy
.showModal({
content: resData.pay_elec_gdc.errmsg,
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
})
.then(res => {
this.handleGG();
});
}
}
}
);
}
enterPay() {
wepy.showLoading({
title: "正在发起支付"
});
switch (this.type) {
case "card":
this.chargeCard();
break;
case "net":
this.chargeNet();
break;
case "electric":
this.chargeEle();
break;
}
}
onLoad() {
if (wx.canIUse("checkIsSupportSoterAuthentication")) {
wx.checkIsSupportSoterAuthentication({
success: res => {
// 检查设备是否支持人脸识别/指纹,优先人脸
const soterType = res.supportMode.includes("facial")
? "facial"
: res.supportMode.includes("fingerPrint")
? "fingerPrint"
: "";
if (soterType) {
// 检查设备是否录入信息
wx.checkIsSoterEnrolledInDevice({
checkAuthMode: soterType,
success: res => {
if (res.isEnrolled) {
this.isSoterAble = this.soterPay = true;
} else {
this.isSoterAble = this.soterPay = false;
}
}
});
} else {
this.isSoterAble = this.soterPay = false;
}
},
fail: () => {
this.isSoterAble = this.soterPay = false;
}
});
} else {
this.isSoterAble = this.soterPay = false;
}
}
}
</script>
<style lang="stylus" scoped>
.mask-container
width 100vw
height 100vh
position fixed
bottom 0
background-color rgba(0, 0, 0, 0.5)
z-index 100
.pay-container
position absolute
bottom 0
height 770rpx
background-color rgb(255, 255, 255)
display flex
flex-direction column
align-items center
width 100%
.confirm-button
width 100vw
margin-top 60rpx
.pay-button
margin 16rpx auto
background-color #47cff5
color #fff
width 38%
border-radius 48rpx
.close
width 35rpx
position absolute
top 25rpx
left 22rpx
.change-pay-type
position absolute
top 41rpx
right 22rpx
transform translateY(-50%)
color #47cff5
.charge-text
font-size 80rpx
color #353535
font-weight bold
margin 35rpx 0 60rpx
.confirm
width 100%
height 82rpx
line-height 82rpx
// text-align center
justify-content center
display flex
border-bottom 2rpx solid #E3E3E3
.input-password
font-size 27rpx
border-bottom 2rpx solid black
width 438rpx
text-align center
margin-top 84rpx
.small-list
display flex
justify-content space-between
width 90%
border-bottom 2rpx solid #E3E3E3
height 60rpx
line-height 60rpx
.text1
font-size 30rpx
color #888888
.text2
font-size 30rpx
color #353535
</style>
================================================
FILE: src/campus-card-page/components/pwdfield.wpy
================================================
<template>
<view class="band-pwdfield" style="border-color:{{color}};">
<input focus="{{focus}}" type="number" class="band-pwdfield-input" maxlength="6" password="{{!display}}" @input="handleInput" selection-start="-100" selection-end="-100" />
<repeat for="{{6}}" item="i">
<view class="band-pwdfield-item">
{{display ? currentValue[i] : secret[i]}}
</view>
</repeat>
</view>
</template>
<script>
import wepy from "wepy";
export default class PwdField extends wepy.component {
props = {
display: {
type: Boolean,
default: false
},
color: String
};
data = {
currentValue: "",
secret: "",
focus: true
};
watch = {
currentValue: val => {
// 6位触发支付
if (val.length === 0) return (this.secret = "");
const l = val => (val === 1 ? "●" : "●" + l(val - 1));
this.secret = l(val.length);
if (val.length === 6) {
this.$emit("value", val);
}
}
};
onLoad() {}
methods = {
handleInput(e) {
if (e.detail.value.length <= 6) {
this.currentValue = e.detail.value;
}
}
};
clear() {
this.currentValue = "";
this.$apply();
}
}
</script>
<style lang="stylus" scoped>
.band-pwdfield
position relative
display flex
flex-direction row
align-items center
margin-top 76rpx
.band-pwdfield-input
z-index: 0
position: absolute
top 0
left -100%
width 200%
height 100%
opacity 0
font-size 1rpx
color transparent
caret-color transparent
text-align left
.band-pwdfield-item
flex 1
display flex
align-items center
justify-content center
border-radius 8rpx
margin-right 8rpx
border 1rpx solid #999ca0
color inherit
width 90rpx
height 90rpx
.band-pwdfield-item:last-child
margin-right 0
</style>
================================================
FILE: src/campus-card-page/components/wxcharts-min.js
================================================
"use strict";function assign(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),a=1;a<arguments.length;a++){var n=arguments[a];if(null!=n)for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(i[o]=n[o])}return i}function findRange(t,e,i){if(isNaN(t))throw new Error("[wxCharts] unvalid series data!");i=i||10,e=e||"upper";for(var a=1;i<1;)i*=10,a*=10;for(t="upper"===e?Math.ceil(t*a):Math.floor(t*a);t%i!=0;)"upper"===e?t++:t--;return t/a}function calValidDistance(t,e,i,a){var n=a.width-i.padding-e.xAxisPoints[0],o=e.eachSpacing*a.categories.length,r=t;return t>=0?r=0:Math.abs(t)>=o-n&&(r=n-o),r}function isInAngleRange(t,e,i){function a(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}return t=a(t),e=a(e),i=a(i),e>i&&(i+=2*Math.PI,t<e&&(t+=2*Math.PI)),t>=e&&t<=i}function calRotateTranslate(t,e,i){var a=t,n=i-e,o=a+(i-n-a)/Math.sqrt(2);return o*=-1,{transX:o,transY:(i-n)*(Math.sqrt(2)-1)-(i-n-a)/Math.sqrt(2)}}function createCurveControlPoints(t,e){function i(t,e){return!(!t[e-1]||!t[e+1])&&(t[e].y>=Math.max(t[e-1].y,t[e+1].y)||t[e].y<=Math.min(t[e-1].y,t[e+1].y))}var a=null,n=null,o=null,r=null;if(e<1?(a=t[0].x+.2*(t[1].x-t[0].x),n=t[0].y+.2*(t[1].y-t[0].y)):(a=t[e].x+.2*(t[e+1].x-t[e-1].x),n=t[e].y+.2*(t[e+1].y-t[e-1].y)),e>t.length-3){var s=t.length-1;o=t[s].x-.2*(t[s].x-t[s-1].x),r=t[s].y-.2*(t[s].y-t[s-1].y)}else o=t[e+1].x-.2*(t[e+2].x-t[e].x),r=t[e+1].y-.2*(t[e+2].y-t[e].y);return i(t,e+1)&&(r=t[e+1].y),i(t,e)&&(n=t[e].y),{ctrA:{x:a,y:n},ctrB:{x:o,y:r}}}function convertCoordinateOrigin(t,e,i){return{x:i.x+t,y:i.y-e}}function avoidCollision(t,e){if(e)for(;util.isCollision(t,e);)t.start.x>0?t.start.y--:t.start.x<0?t.start.y++:t.start.y>0?t.start.y++:t.start.y--;return t}function fillSeriesColor(t,e){var i=0;return t.map(function(t){return t.color||(t.color=e.colors[i],i=(i+1)%e.colors.length),t})}function getDataRange(t,e){var i=0,a=e-t;return i=a>=1e4?1e3:a>=1e3?100:a>=100?10:a>=10?5:a>=1?1:a>=.1?.1:.01,{minRange:findRange(t,"lower",i),maxRange:findRange(e,"upper",i)}}function measureText(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;t=String(t);var t=t.split(""),i=0;return t.forEach(function(t){/[a-zA-Z]/.test(t)?i+=7:/[0-9]/.test(t)?i+=5.5:/\./.test(t)?i+=2.7:/-/.test(t)?i+=3.25:/[\u4e00-\u9fa5]/.test(t)?i+=10:/\(|\)/.test(t)?i+=3.73:/\s/.test(t)?i+=2.5:/%/.test(t)?i+=8:i+=10}),i*e/10}function dataCombine(t){return t.reduce(function(t,e){return(t.data?t.data:t).concat(e.data)},[])}function getSeriesDataItem(t,e){var i=[];return t.forEach(function(t){if(null!==t.data[e]&&void 0!==t.data[e]){var a={};a.color=t.color,a.name=t.name,a.data=t.format?t.format(t.data[e]):t.data[e],i.push(a)}}),i}function getMaxTextListLength(t){var e=t.map(function(t){return measureText(t)});return Math.max.apply(null,e)}function getRadarCoordinateSeries(t){for(var e=2*Math.PI/t,i=[],a=0;a<t;a++)i.push(e*a);return i.map(function(t){return-1*t+Math.PI/2})}function getToolTipData(t,e,i,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=t.map(function(t){return{text:n.format?n.format(t,a[i]):t.name+": "+t.data,color:t.color}}),r=[],s={x:0,y:0};return e.forEach(function(t){void 0!==t[i]&&null!==t[i]&&r.push(t[i])}),r.forEach(function(t){s.x=Math.round(t.x),s.y+=t.y}),s.y/=r.length,{textList:o,offset:s}}function findCurrentIndex(t,e,i,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=-1;return isInExactChartArea(t,i,a)&&e.forEach(function(e,i){t.x+n>e&&(o=i)}),o}function isInExactChartArea(t,e,i){return t.x<e.width-i.padding&&t.x>i.padding+i.yAxisWidth+i.yAxisTitleWidth&&t.y>i.padding&&t.y<e.height-i.legendHeight-i.xAxisHeight-i.padding}function findRadarChartCurrentIndex(t,e,i){var a=2*Math.PI/i,n=-1;if(isInExactPieChartArea(t,e.center,e.radius)){var o=function(t){return t<0&&(t+=2*Math.PI),t>2*Math.PI&&(t-=2*Math.PI),t},r=Math.atan2(e.center.y-t.y,t.x-e.center.x);r*=-1,r<0&&(r+=2*Math.PI);e.angleList.map(function(t){return t=o(-1*t)}).forEach(function(t,e){var i=o(t-a/2),s=o(t+a/2);s<i&&(s+=2*Math.PI),(r>=i&&r<=s||r+2*Math.PI>=i&&r+2*Math.PI<=s)&&(n=e)})}return n}function findPieChartCurrentIndex(t,e){var i=-1;if(isInExactPieChartArea(t,e.center,e.radius)){var a=Math.atan2(e.center.y-t.y,t.x-e.center.x);a=-a;for(var n=0,o=e.series.length;n<o;n++){var r=e.series[n];if(isInAngleRange(a,r._start_,r._start_+2*r._proportion_*Math.PI)){i=n;break}}}return i}function isInExactPieChartArea(t,e,i){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<=Math.pow(i,2)}function splitPoints(t){var e=[],i=[];return t.forEach(function(t,a){null!==t?i.push(t):(i.length&&e.push(i),i=[])}),i.length&&e.push(i),e}function calLegendData(t,e,i){if(!1===e.legend)return{legendList:[],legendHeight:0};var a=[],n=0,o=[];return t.forEach(function(t){var i=30+measureText(t.name||"undefined");n+i>e.width?(a.push(o),n=i,o=[t]):(n+=i,o.push(t))}),o.length&&a.push(o),{legendList:a,legendHeight:a.length*(i.fontSize+8)+5}}function calCategoriesData(t,e,i){var a={angle:0,xAxisHeight:i.xAxisHeight},n=getXAxisPoints(t,e,i),o=n.eachSpacing,r=t.map(function(t){return measureText(t)}),s=Math.max.apply(this,r);return s+2*i.xAxisTextPadding>o&&(a.angle=45*Math.PI/180,a.xAxisHeight=2*i.xAxisTextPadding+s*Math.sin(a.angle)),a}function getRadarDataPoints(t,e,i,a,n){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,r=n.extra.radar||{};r.max=r.max||0;var s=Math.max(r.max,Math.max.apply(null,dataCombine(a))),l=[];return a.forEach(function(a){var n={};n.color=a.color,n.data=[],a.data.forEach(function(a,r){var l={};l.angle=t[r],l.proportion=a/s,l.position=convertCoordinateOrigin(i*l.proportion*o*Math.cos(l.angle),i*l.proportion*o*Math.sin(l.angle),e),n.data.push(l)}),l.push(n)}),l}function getPieDataPoints(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=0,a=0;return t.forEach(function(t){t.data=null===t.data?0:t.data,i+=t.data}),t.forEach(function(t){t.data=null===t.data?0:t.data,t._proportion_=t.data/i*e}),t.forEach(function(t){t._start_=a,a+=2*t._proportion_*Math.PI}),t}function getPieTextMaxLength(t){t=getPieDataPoints(t);var e=0;return t.forEach(function(t){var i=t.format?t.format(+t._proportion_.toFixed(2)):util.toFixed(100*t._proportion_)+"%";e=Math.max(e,measureText(i))}),e}function fixColumeData(t,e,i,a,n,o){return t.map(function(t){return null===t?null:(t.width=(e-2*n.columePadding)/i,o.extra.column&&o.extra.column.width&&+o.extra.column.width>0?t.width=Math.min(t.width,+o.extra.column.width):t.width=Math.min(t.width,25),t.x+=(a+.5-i/2)*t.width,t)})}function getXAxisPoints(t,e,i){var a=i.yAxisWidth+i.yAxisTitleWidth,n=e.width-2*i.padding-a,o=e.enableScroll?Math.min(5,t.length):t.length,r=n/o,s=[],l=i.padding+a,h=e.width-i.padding;return t.forEach(function(t,e){s.push(l+e*r)}),!0===e.enableScroll?s.push(l+t.length*r):s.push(h),{xAxisPoints:s,startX:l,endX:h,eachSpacing:r}}function getDataPoints(t,e,i,a,n,o,r){var s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,l=[],h=o.height-2*r.padding-r.xAxisHeight-r.legendHeight;return t.forEach(function(t,c){if(null===t)l.push(null);else{var d={};d.x=a[c]+Math.round(n/2);var x=h*(t-e)/(i-e);x*=s,d.y=o.height-r.xAxisHeight-r.legendHeight-Math.round(x)-r.padding,l.push(d)}}),l}function getYAxisTextList(t,e,i){var a=dataCombine(t);a=a.filter(function(t){return null!==t});var n=Math.min.apply(this,a),o=Math.max.apply(this,a);if("number"==typeof e.yAxis.min&&(n=Math.min(e.yAxis.min,n)),"number"==typeof e.yAxis.max&&(o=Math.max(e.yAxis.max,o)),n===o){var r=o||1;n-=r,o+=r}for(var s=getDataRange(n,o),l=s.minRange,h=s.maxRange,c=[],d=(h-l)/i.yAxisSplit,x=0;x<=i.yAxisSplit;x++)c.push(l+d*x);return c.reverse()}function calYAxisData(t,e,i){var a=getYAxisTextList(t,e,i),n=i.yAxisWidth,o=a.map(function(t){return t=util.toFixed(t,2),t=e.yAxis.format?e.yAxis.format(Number(t)):t,n=Math.max(n,measureText(t)+5),t});return!0===e.yAxis.disabled&&(n=0),{rangesFormat:o,ranges:a,yAxisWidth:n}}function drawPointShape(t,e,i,a){a.beginPath(),a.setStrokeStyle("#ffffff"),a.setLineWidth(1),a.setFillStyle(e),"diamond"===i?t.forEach(function(t,e){null!==t&&(a.moveTo(t.x,t.y-4.5),a.lineTo(t.x-4.5,t.y),a.lineTo(t.x,t.y+4.5),a.lineTo(t.x+4.5,t.y),a.lineTo(t.x,t.y-4.5))}):"circle"===i?t.forEach(function(t,e){null!==t&&(a.moveTo(t.x+3.5,t.y),a.setLineWidth(1),a.setStrokeStyle("rgb(102,209,255)"),a.arc(t.x,t.y,3,0,2*Math.PI,!1),a.stroke())}):"rect"===i?t.forEach(function(t,e){null!==t&&(a.moveTo(t.x-3.5,t.y-3.5),a.rect(t.x-3.5,t.y-3.5,7,7))}):"triangle"===i&&t.forEach(function(t,e){null!==t&&(a.moveTo(t.x,t.y-4.5),a.lineTo(t.x-4.5,t.y+4.5),a.lineTo(t.x+4.5,t.y+4.5),a.lineTo(t.x,t.y-4.5))}),a.closePath(),a.setFillStyle("white"),a.fill(),a.setFillStyle("rgba(223,249,255,1)"),a.stroke()}function drawRingTitle(t,e,i){var a=t.title.fontSize||e.titleFontSize,n=t.subtitle.fontSize||e.subtitleFontSize,o=t.title.name||"",r=t.subtitle.name||"",s=t.title.color||e.titleColor,l=t.subtitle.color||e.subtitleColor,h=o?a:0,c=r?n:0;if(r){var d=measureText(r,n),x=(t.width-d)/2+(t.subtitle.offsetX||0),f=(t.height-e.legendHeight+n)/2;o&&(f-=(h+5)/2),i.beginPath(),i.setFontSize(n),i.setFillStyle(l),i.fillText(r,x,f),i.stroke(),i.closePath()}if(o){var g=measureText(o,a),u=(t.width-g)/2+(t.title.offsetX||0),p=(t.height-e.legendHeight+a)/2;r&&(p+=(c+5)/2),i.beginPath(),i.setFontSize(a),i.setFillStyle(s),i.fillText(o,u,p),i.stroke(),i.closePath()}}function drawPointText(t,e,i,a){var n=e.data;a.beginPath(),a.setFontSize(i.fontSize),a.setFillStyle("#666666"),t.forEach(function(t,i){if(null!==t){var o=e.format?e.format(n[i]):n[i];a.fillText(o,t.x-measureText(o)/2,t.y-2)}}),a.closePath(),a.stroke()}function drawRadarLabel(t,e,i,a,n,o){var r=a.extra.radar||{};e+=n.radarLabelTextMargin,o.beginPath(),o.setFontSize(n.fontSize),o.setFillStyle(r.labelColor||"#666666"),t.forEach(function(t,r){var s={x:e*Math.cos(t),y:e*Math.sin(t)},l=convertCoordinateOrigin(s.x,s.y,i),h=l.x,c=l.y;util.approximatelyEqual(s.x,0)?h-=measureText(a.categories[r]||"")/2:s.x<0&&(h-=measureText(a.categories[r]||"")),o.fillText(a.categories[r]||"",h,c+n.fontSize/2)}),o.stroke(),o.closePath()}function drawPieText(t,e,i,a,n,o){var r=n+i.pieChartLinePadding,s=(i.pieChartTextPadding,[]),l=null;t.map(function(t){return{arc:2*Math.PI-(t._start_+2*Math.PI*t._proportion_/2),text:t.format?t.format(+t._proportion_.toFixed(2)):util.toFixed(100*t._proportion_)+"%",color:t.color}}).forEach(function(t){var e=Math.cos(t.arc)*r,a=Math.sin(t.arc)*r,o=Math.cos(t.arc)*n,h=Math.sin(t.arc)*n,c=e>=0?e+i.pieChartTextPadding:e-i.pieChartTextPadding,d=a,x=measureText(t.text),f=d;l&&util.isSameXCoordinateArea(l.start,{x:c})&&(f=c>0?Math.min(d,l.start.y):e<0?Math.max(d,l.start.y):d>0?Math.max(d,l.start.y):Math.min(d,l.start.y)),c<0&&(c-=x);var g={lineStart:{x:o,y:h},lineEnd:{x:e,y:a},start:{x:c,y:f},width:x,height:i.fontSize,text:t.text,color:t.color};l=avoidCollision(g,l),s.push(l)}),s.forEach(function(t){var e=convertCoordinateOrigin(t.lineStart.x,t.lineStart.y,o),n=convertCoordinateOrigin(t.lineEnd.x,t.lineEnd.y,o),r=convertCoordinateOrigin(t.start.x,t.start.y,o);a.setLineWidth(1),a.setFontSize(i.fontSize),a.beginPath(),a.setStrokeStyle(t.color),a.setFillStyle(t.color),a.moveTo(e.x,e.y);var s=t.start.x<0?r.x+t.width:r.x,l=t.start.x<0?r.x-5:r.x+5;a.quadraticCurveTo(n.x,n.y,s,r.y),a.moveTo(e.x,e.y),a.stroke(),a.closePath(),a.beginPath(),a.moveTo(r.x+t.width,r.y),a.arc(s,r.y,2,0,2*Math.PI),a.closePath(),a.fill(),a.beginPath(),a.setFillStyle("#666666"),a.fillText(t.text,l,r.y+3),a.closePath(),a.stroke(),a.closePath()})}function drawToolTipSplitLine(t,e,i,a){var n=i.padding,o=e.height-i.padding-i.xAxisHeight-i.legendHeight;a.beginPath(),a.setStrokeStyle("#cccccc"),a.setLineWidth(1),a.moveTo(t,n),a.lineTo(t,o),a.stroke(),a.closePath()}function drawToolTip(t,e,i,a,n){var o=!1;e=assign({x:0,y:0},e),e.y-=8;var r=t.map(function(t){return measureText(t.text)}),s=9+4*a.toolTipPadding+Math.max.apply(null,r),l=2*a.toolTipPadding+t.length*a.toolTipLineHeight;e.x-Math.abs(i._scrollDistance_)+8+s>i.width&&(o=!0),n.beginPath(),n.setFillStyle(i.tooltip.option.background||a.toolTipBackground),n.setGlobalAlpha(a.toolTipOpacity),o?(n.moveTo(e.x,e.y+10),n.lineTo(e.x-8,e.y+10-5),n.lineTo(e.x-8,e.y+10+5),n.moveTo(e.x,e.y+10),n.fillRect(e.x-s-8,e.y,s,l)):(n.moveTo(e.x,e.y+10),n.lineTo(e.x+8,e.y+10-5),n.lineTo(e.x+8,e.y+10+5),n.moveTo(e.x,e.y+10),n.fillRect(e.x+8,e.y,s,l)),n.closePath(),n.fill(),n.setGlobalAlpha(1),t.forEach(function(t,i){n.beginPath(),n.setFillStyle(t.color);var r=e.x+8+2*a.toolTipPadding,l=e.y+(a.toolTipLineHeight-a.fontSize)/2+a.toolTipLineHeight*i+a.toolTipPadding;o&&(r=e.x-s-8+2*a.toolTipPadding),n.fillRect(r,l,4,a.fontSize),n.closePath()}),n.beginPath(),n.setFontSize(a.fontSize),n.setFillStyle("#ffffff"),t.forEach(function(t,i){var r=e.x+8+2*a.toolTipPadding+4+5;o&&(r=e.x-s-8+2*a.toolTipPadding+4+5);var l=e.y+(a.toolTipLineHeight-a.fontSize)/2+a.toolTipLineHeight*i+a.toolTipPadding;n.fillText(t.text,r,l+a.fontSize)}),n.stroke(),n.closePath()}function drawYAxisTitle(t,e,i,a){var n=i.xAxisHeight+(e.height-i.xAxisHeight-measureText(t))/2;a.save(),a.beginPath(),a.setFontSize(i.fontSize),a.setFillStyle(e.yAxis.titleFontColor||"#333333"),a.translate(0,e.height),a.rotate(-90*Math.PI/180),a.fillText(t,n,i.padding+.5*i.fontSize),a.stroke(),a.closePath(),a.restore()}function drawColumnDataPoints(t,e,i,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=calYAxisData(t,e,i),r=o.ranges,s=getXAxisPoints(e.categories,e,i),l=s.xAxisPoints,h=s.eachSpacing,c=r.pop(),d=r.shift();e.height,i.padding,i.xAxisHeight,i.legendHeight;return a.save(),e._scrollDistance_&&0!==e._scrollDistance_&&!0===e.enableScroll&&a.translate(e._scrollDistance_,0),t.forEach(function(o,r){var s=o.data,x=getDataPoints(s,c,d,l,h,e,i,n);x=fixColumeData(x,h,t.length,r,i,e),a.beginPath(),a.setFillStyle(o.color),x.forEach(function(t,n){if(null!==t){var o=t.x-t.width/2+1,r=e.height-t.y-i.padding-i.xAxisHeight-i.legendHeight;a.moveTo(o,t.y),a.rect(o,t.y,t.width-2,r)}}),a.closePath(),a.fill()}),t.forEach(function(o,r){var s=o.data,x=getDataPoints(s,c,d,l,h,e,i,n);x=fixColumeData(x,h,t.length,r,i,e),!1!==e.dataLabel&&1===n&&drawPointText(x,o,i,a)}),a.restore(),{xAxisPoints:l,eachSpacing:h}}function drawAreaDataPoints(t,e,i,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=calYAxisData(t,e,i),r=o.ranges,s=getXAxisPoints(e.categories,e,i),l=s.xAxisPoints,h=s.eachSpacing,c=r.pop(),d=r.shift(),x=e.height-i.padding-i.xAxisHeight-i.legendHeight,f=[];return a.save(),e._scrollDistance_&&0!==e._scrollDistance_&&!0===e.enableScroll&&a.translate(e._scrollDistance_,0),e.tooltip&&e.tooltip.textList&&e.tooltip.textList.length&&1===n&&drawToolTipSplitLine(e.tooltip.offset.x,e,i,a),t.forEach(function(t,o){var r=t.data,s=getDataPoints(r,c,d,l,h,e,i,n);(f.push(s),splitPoints(s).forEach(function(t){if(a.beginPath(),a.setStrokeStyle("rgb(102,209,255)"),a.setFillStyle("rgba(223,249,255,1)"),a.setLineWidth(2),t.length>1){var i=t[0],n=t[t.length-1];a.moveTo(i.x,i.y),"curve"===e.extra.lineStyle?t.forEach(function(e,i){if(i>0){var n=createCurveControlPoints(t,i-1);a.bezierCurveTo(n.ctrA.x,n.ctrA.y,n.ctrB.x,n.ctrB.y,e.x,e.y)}}):t.forEach(function(t,e){e>0&&a.lineTo(t.x,t.y)}),a.stroke(),a.lineTo(n.x,x),a.lineTo(i.x,x),a.lineTo(i.x,i.y)}else{var o=t[0];a.moveTo(o.x-h/2,o.y),a.lineTo(o.x+h/2,o.y),a.lineTo(o.x+h/2,x),a.lineTo(o.x-h/2,x),a.moveTo(o.x-h/2,o.y)}a.closePath(),a.fill(),a.setGlobalAlpha(1)}),!1!==e.dataPointShape)&&(i.dataPointShape[o%i.dataPointShape.length],drawPointShape(s,t.color,"circle",a))}),!1!==e.dataLabel&&1===n&&t.forEach(function(t,o){drawPointText(getDataPoints(t.data,c,d,l,h,e,i,n),t,i,a)}),a.restore(),{xAxisPoints:l,calPoints:f,eachSpacing:h}}function drawLineDataPoints(t,e,i,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=calYAxisData(t,e,i),r=o.ranges,s=getXAxisPoints(e.categories,e,i),l=s.xAxisPoints,h=s.eachSpacing,c=r.pop(),d=r.shift(),x=[];return a.save(),e._scrollDistance_&&0!==e._scrollDistance_&&!0===e.enableScroll&&a.translate(e._scrollDistance_,0),e.tooltip&&e.tooltip.textList&&e.tooltip.textList.length&&1===n&&drawToolTipSplitLine(e.tooltip.offset.x,e,i,a),t.forEach(function(t,o){var r=t.data,s=getDataPoints(r,c,d,l,h,e,i,n);if(x.push(s),splitPoints(s).forEach(function(i,n){a.beginPath(),a.setStrokeStyle(t.color),a.setLineWidth(2),1===i.length?(a.moveTo(i[0].x,i[0].y),a.arc(i[0].x,i[0].y,1,0,2*Math.PI)):(a.moveTo(i[0].x,i[0].y),"curve"===e.extra.lineStyle?i.forEach(function(t,e){if(e>0){var n=createCurveControlPoints(i,e-1);a.bezierCurveTo(n.ctrA.x,n.ctrA.y,n.ctrB.x,n.ctrB.y,t.x,t.y)}}):i.forEach(function(t,e){e>0&&a.lineTo(t.x,t.y)}),a.moveTo(i[0].x,i[0].y)),a.closePath(),a.stroke()}),!1!==e.dataPointShape){var f=i.dataPointShape[o%i.dataPointShape.length];drawPointShape(s,t.color,f,a)}}),!1!==e.dataLabel&&1===n&&t.forEach(function(t,o){drawPointText(getDataPoints(t.data,c,d,l,h,e,i,n),t,i,a)}),a.restore(),{xAxisPoints:l,calPoints:x,eachSpacing:h}}function drawToolTipBridge(t,e,i,a){i.save(),t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&i.translate(t._scrollDistance_,0),t.tooltip&&t.tooltip.textList&&t.tooltip.textList.length&&1===a&&drawToolTip(t.tooltip.textList,t.tooltip.offset,t,e,i),i.restore()}function drawXAxis(t,e,i,a){var n=getXAxisPoints(t,e,i),o=n.xAxisPoints,r=n.eachSpacing,s=e.height-i.padding-i.xAxisHeight-i.legendHeight;i.xAxisLineHeight;a.save(),e._scrollDistance_&&0!==e._scrollDistance_&&a.translate(e._scrollDistance_,0),a.beginPath(),a.setStrokeStyle(e.xAxis.gridColor||"#cccccc"),!0!==e.xAxis.disableGrid&&(e.xAxis.type,o.forEach(function(t,e){})),a.closePath(),a.stroke();var l=e.width-2*i.padding-i.yAxisWidth-i.yAxisTitleWidth,h=Math.min(t.length,Math.ceil(l/i.fontSize/1.5)),c=Math.ceil(t.length/h);t=t.map(function(t,e){return e%c!=0?"":t}),0===i._xAxisTextAngle_?(a.beginPath(),a.setFontSize(i.fontSize),a.setFillStyle(e.xAxis.fontColor||"#666666"),t.forEach(function(t,e){var n=r/2-measureText(t)/2;a.fillText(t,o[e]+n,s+i.fontSize+5)}),a.closePath(),a.stroke()):t.forEach(function(t,n){a.save(),a.beginPath(),a.setFontSize(i.fontSize),a.setFillStyle(e.xAxis.fontColor||"#666666");var l=measureText(t),h=r/2-l,c=calRotateTranslate(o[n]+r/2,s+i.fontSize/2+5,e.height),d=c.transX,x=c.transY;a.rotate(-1*i._xAxisTextAngle_),a.translate(d,x),a.fillText(t,o[n]+h,s+i.fontSize+5),a.closePath(),a.stroke(),a.restore()}),a.restore()}function drawYAxisGrid(t,e,i){for(var a=t.height-2*e.padding-e.xAxisHeight-e.legendHeight,n=Math.floor(a/e.yAxisSplit),o=e.yAxisWidth+e.yAxisTitleWidth,r=e.padding+o,s=t.width-e.padding,l=[],h=0;h<e.yAxisSplit;h++)l.push(e.padding+n*h);l.push(e.padding+n*e.yAxisSplit+2),i.beginPath(),i.setStrokeStyle(t.yAxis.gridColor||"#cccccc"),i.setLineWidth(1),l.forEach(function(t,e){i.moveTo(r,t),i.lineTo(s,t)}),i.closePath(),i.stroke()}function drawYAxis(t,e,i,a){if(!0!==e.yAxis.disabled){var n=calYAxisData(t,e,i),o=n.rangesFormat,r=i.yAxisWidth+i.yAxisTitleWidth,s=e.height-2*i.padding-i.xAxisHeight-i.legendHeight,l=Math.floor(s/i.yAxisSplit),h=i.padding+r,c=e.width-i.padding,d=(i.padding,e.height-i.padding-i.xAxisHeight-i.legendHeight);a.setFillStyle(e.background||"#ffffff"),e._scrollDistance_<0&&a.fillRect(0,0,h,d+i.xAxisHeight+5),a.fillRect(c,0,e.width,d+i.xAxisHeight+5);for(var x=[],f=0;f<=i.yAxisSplit;f++)x.push(i.padding+l*f);a.stroke(),a.beginPath(),a.setFontSize(i.fontSize),a.setFillStyle(e.yAxis.fontColor||"#666666"),o.forEach(function(t,e){var n=x[e]?x[e]:d;a.fillText(t,i.padding+i.yAxisTitleWidth,n+i.fontSize/2)}),a.closePath(),a.stroke(),e.yAxis.title&&drawYAxisTitle(e.yAxis.title,e,i,a)}}function drawLegend(t,e,i,a){if(e.legend){var n=calLegendData(t,e,i),o=n.legendList;o.forEach(function(t,n){var o=0;t.forEach(function(t){t.name=t.name||"undefined",o+=15+measureText(t.name)+15});var r=(e.width-o)/2+5,s=e.height-i.padding-i.legendHeight+n*(i.fontSize+8)+5+8;a.setFontSize(i.fontSize),t.forEach(function(t){switch(e.type){case"line":a.beginPath(),a.setLineWidth(1),a.setStrokeStyle(t.color),a.moveTo(r-2,s+5),a.lineTo(r+17,s+5),a.stroke(),a.closePath(),a.beginPath(),a.setLineWidth(1),a.setStrokeStyle("#ffffff"),a.setFillStyle(t.color),a.moveTo(r+7.5,s+5),a.arc(r+7.5,s+5,4,0,2*Math.PI),a.fill(),a.stroke(),a.closePath();break;case"pie":case"ring":a.beginPath(),a.setFillStyle(t.color),a.moveTo(r+7.5,s+5),a.arc(r+7.5,s+5,7,0,2*Math.PI),a.closePath(),a.fill();break;default:a.beginPath(),a.setFillStyle(t.color),a.moveTo(r,s),a.rect(r,s,15,10),a.closePath(),a.fill()}r+=20,a.beginPath(),a.setFillStyle(e.extra.legendTextColor||"#333333"),a.fillText(t.name,r,s+9),a.closePath(),a.stroke(),r+=measureText(t.name)+10})})}}function drawPieDataPoints(t,e,i,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=e.extra.pie||{};t=getPieDataPoints(t,n);var r={x:e.width/2,y:(e.height-i.legendHeight)/2},s=Math.min(r.x-i.pieChartLinePadding-i.pieChartTextPadding-i._pieTextMaxLength_,r.y-i.pieChartLinePadding-i.pieChartTextPadding);if(e.dataLabel?s-=10:s-=2*i.padding,t=t.map(function(t){return t._start_+=(o.offsetAngle||0)*Math.PI/180,t}),t.forEach(function(t){a.beginPath(),a.setLineWidth(2),a.setStrokeStyle("#ffffff"),a.setFillStyle(t.color),a.moveTo(r.x,r.y),a.arc(r.x,r.y,s,t._start_,t._start_+2*t._proportion_*Math.PI),a.closePath(),a.fill(),!0!==e.disablePieStroke&&a.stroke()}),"ring"===e.type){var l=.6*s;"number"==typeof e.extra.ringWidth&&e.extra.ringWidth>0&&(l=Math.max(0,s-e.extra.ringWidth)),a.beginPath(),a.setFillStyle(e.background||"#ffffff"),a.moveTo(r.x,r.y),a.arc(r.x,r.y,l,0,2*Math.PI),a.closePath(),a.fill()}if(!1!==e.dataLabel&&1===n){for(var h=!1,c=0,d=t.length;c<d;c++)if(t[c].data>0){h=!0;break}h&&drawPieText(t,e,i,a,s,r)}return 1===n&&"ring"===e.type&&drawRingTitle(e,i,a),{center:r,radius:s,series:t}}function drawRadarDataPoints(t,e,i,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=e.extra.radar||{},r=getRadarCoordinateSeries(e.categories.length),s={x:e.width/2,y:(e.height-i.legendHeight)/2},l=Math.min(s.x-(getMaxTextListLength(e.categories)+i.radarLabelTextMargin),s.y-i.radarLabelTextMargin);l-=i.padding,a.beginPath(),a.setLineWidth(1),a.setStrokeStyle(o.gridColor||"#cccccc"),r.forEach(function(t){var e=convertCoordinateOrigin(l*Math.cos(t),l*Math.sin(t),s);a.moveTo(s.x,s.y),a.lineTo(e.x,e.y)}),a.stroke(),a.closePath();for(var h=1;h<=i.radarGridCount;h++)!function(t){var e={};a.beginPath(),a.setLineWidth(1),a.setStrokeStyle(o.gridColor||"#cccccc"),r.forEach(function(n,o){var r=convertCoordinateOrigin(l/i.radarGridCount*t*Math.cos(n),l/i.radarGridCount*t*Math.sin(n),s);0===o?(e=r,a.moveTo(r.x,r.y)):a.lineTo(r.x,r.y)}),a.lineTo(e.x,e.y),a.stroke(),a.closePath()}(h);return getRadarDataPoints(r,s,l,t,e,n).forEach(function(t,n){if(a.beginPath(),a.setFillStyle(t.color),a.setGlobalAlpha(.6),t.data.forEach(function(t,e){0===e?a.moveTo(t.position.x,t.position.y):a.lineTo(t.position.x,t.position.y)}),a.closePath(),a.fill(),a.setGlobalAlpha(1),!1!==e.dataPointShape){var o=i.dataPointShape[n%i.dataPointShape.length];drawPointShape(t.data.map(function(t){return t.position}),t.color,o,a)}}),drawRadarLabel(r,l,s,e,i,a),{center:s,radius:l,angleList:r}}function drawCanvas(t,e){e.draw()}function Animation(t){this.isStop=!1,t.duration=void 0===t.duration?1e3:t.duration,t.timing=t.timing||"linear";var e=function(){return"undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setTimeout?function(t,e){setTimeout(function(){var e=+new Date;t(e)},e)}:function(t){t(null)}}(),i=null,a=function(n){if(null===n||!0===this.isStop)return t.onProcess&&t.onProcess(1),void(t.onAnimationFinish&&t.onAnimationFinish());if(null===i&&(i=n),n-i<t.duration){var o=(n-i)/t.duration;o=(0,Timing[t.timing])(o),t.onProcess&&t.onProcess(o),e(a,17)}else t.onProcess&&t.onProcess(1),t.onAnimationFinish&&t.onAnimationFinish()};a=a.bind(this),e(a,17)}function drawCharts(t,e,i,a){var n=this,o=e.series,r=e.categories;o=fillSeriesColor(o,i);var s=calLegendData(o,e,i),l=s.legendHeight;i.legendHeight=l;var h=calYAxisData(o,e,i),c=h.yAxisWidth;if(i.yAxisWidth=c,r&&r.length){var d=calCategoriesData(r,e,i),x=d.xAxisHeight,f=d.angle;i.xAxisHeight=x,i._xAxisTextAngle_=f}"pie"!==t&&"ring"!==t||(i._pieTextMaxLength_=!1===e.dataLabel?0:getPieTextMaxLength(o));var g=e.animation?1e3:0;switch(this.animationInstance&&this.animationInstance.stop(),t){case"line":this.animationInstance=new Animation({timing:"easeIn",duration:g,onProcess:function(t){drawYAxisGrid(e,i,a);var s=drawLineDataPoints(o,e,i,a,t),l=s.xAxisPoints,h=s.calPoints,c=s.eachSpacing;n.chartData.xAxisPoints=l,n.chartData.calPoints=h,n.chartData.eachSpacing=c,drawXAxis(r,e,i,a),drawLegend(e.series,e,i,a),drawYAxis(o,e,i,a),drawToolTipBridge(e,i,a,t),drawCanvas(e,a)},onAnimationFinish:function(){n.event.trigger("renderComplete")}});break;case"column":this.animationInstance=new Animation({timing:"easeIn",duration:g,onProcess:function(t){drawYAxisGrid(e,i,a);var s=drawColumnDataPoints(o,e,i,a,t),l=s.xAxisPoints,h=s.eachSpacing;n.chartData.xAxisPoints=l,n.chartData.eachSpacing=h,drawXAxis(r,e,i,a),drawLegend(e.series,e,i,a),drawYAxis(o,e,i,a),drawCanvas(e,a)},onAnimationFinish:function(){n.event.trigger("renderComplete")}});break;case"area":this.animationInstance=new Animation({timing:"easeIn",duration:g,onProcess:function(t){drawYAxisGrid(e,i,a);var s=drawAreaDataPoints(o,e,i,a,t),l=s.xAxisPoints,h=s.calPoints,c=s.eachSpacing;n.chartData.xAxisPoints=l,n.chartData.calPoints=h,n.chartData.eachSpacing=c,drawXAxis(r,e,i,a),drawLegend(e.series,e,i,a),drawYAxis(o,e,i,a),drawToolTipBridge(e,i,a,t),drawCanvas(e,a)},onAnimationFinish:function(){n.event.trigger("renderComplete")}});break;case"ring":case"pie":this.animationInstance=new Animation({timing:"easeInOut",duration:g,onProcess:function(t){n.chartData.pieData=drawPieDataPoints(o,e,i,a,t),drawLegend(e.series,e,i,a),drawCanvas(e,a)},onAnimationFinish:function(){n.event.trigger("renderComplete")}});break;case"radar":this.animationInstance=new Animation({timing:"easeInOut",duration:g,onProcess:function(t){n.chartData.radarData=drawRadarDataPoints(o,e,i,a,t),drawLegend(e.series,e,i,a),drawCanvas(e,a)},onAnimationFinish:function(){n.event.trigger("renderComplete")}})}}function Event(){this.events={}}var config={yAxisWidth:15,yAxisSplit:5,xAxisHeight:15,xAxisLineHeight:15,legendHeight:15,yAxisTitleWidth:15,padding:12,columePadding:3,fontSize:10,dataPointShape:["diamond","circle","triangle","rect"],colors:["rgba(109,209,255,1)","#f7a35c","#434348","#90ed7d","#f15c80","#8085e9"],pieChartLinePadding:25,pieChartTextPadding:15,xAxisTextPadding:3,titleColor:"#333333",titleFontSize:20,subtitleColor:"#999999",subtitleFontSize:15,toolTipPadding:3,toolTipBackground:"#000000",toolTipOpacity:.7,toolTipLineHeight:14,radarGridCount:3,radarLabelTextMargin:15},util={toFixed:function(t,e){return e=e||2,this.isFloat(t)&&(t=t.toFixed(e)),t},isFloat:function(t){return t%1!=0},approximatelyEqual:function(t,e){return Math.abs(t-e)<1e-10},isSameSign:function(t,e){return Math.abs(t)===t&&Math.abs(e)===e||Math.abs(t)!==t&&Math.abs(e)!==e},isSameXCoordinateArea:function(t,e){return this.isSameSign(t.x,e.x)},isCollision:function(t,e){return t.end={},t.end.x=t.start.x+t.width,t.end.y=t.start.y-t.height,e.end={},e.end.x=e.start.x+e.width,e.end.y=e.start.y-e.height,!(e.start.x>t.end.x||e.end.x<t.start.x||e.end.y>t.start.y||e.start.y<t.end.y)}},Timing={easeIn:function(t){return Math.pow(t,3)},easeOut:function(t){return Math.pow(t-1,3)+1},easeInOut:function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},linear:function(t){return t}};Animation.prototype.stop=function(){this.isStop=!0},Event.prototype.addEventListener=function(t,e){this.events[t]=this.events[t]||[],this.events[t].push(e)},Event.prototype.trigger=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];var a=e[0],n=e.slice(1);this.events[a]&&this.events[a].forEach(function(t){try{t.apply(null,n)}catch(t){console.error(t)}})};var Charts=function(t){t.title=t.title||{},t.subtitle=t.subtitle||{},t.yAxis=t.yAxis||{},t.xAxis=t.xAxis||{},t.extra=t.extra||{},t.legend=!1!==t.legend,t.animation=!1!==t.animation;var e=assign({},config);e.yAxisTitleWidth=!0!==t.yAxis.disabled&&t.yAxis.title?e.yAxisTitleWidth:0,e.pieChartLinePadding=!1===t.dataLabel?0:e.pieChartLinePadding,e.pieChartTextPadding=!1===t.dataLabel?0:e.pieChartTextPadding,this.opts=t,this.config=e,this.context=wx.createCanvasContext(t.canvasId),this.chartData={},this.event=new Event,this.scrollOption={currentOffset:0,startTouchX:0,distance:0},drawCharts.call(this,t.type,t,e,this.context)};Charts.prototype.updateData=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts.series=t.series||this.opts.series,this.opts.categories=t.categories||this.opts.categories,this.opts.title=assign({},this.opts.title,t.title||{}),this.opts.subtitle=assign({},this.opts.subtitle,t.subtitle||{}),drawCharts.call(this,this.opts.type,this.opts,this.config,this.context)},Charts.prototype.stopAnimation=function(){this.animationInstance&&this.animationInstance.stop()},Charts.prototype.addEventListener=function(t,e){this.event.addEventListener(t,e)},Charts.prototype.getCurrentDataIndex=function(t){var e=t.touches&&t.touches.length?t.touches:t.changedTouches;if(e&&e.length){var i=e[0],a=i.x,n=i.y;return"pie"===this.opts.type||"ring"===this.opts.type?findPieChartCurrentIndex({x:a,y:n},this.chartData.pieData):"radar"===this.opts.type?findRadarChartCurrentIndex({x:a,y:n},this.chartData.radarData,this.opts.categories.length):findCurrentIndex({x:a,y:n},this.chartData.xAxisPoints,this.opts,this.config,Math.abs(this.scrollOption.currentOffset))}return-1},Charts.prototype.showToolTip=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("line"===this.opts.type||"area"===this.opts.type){var i=this.getCurrentDataIndex(t),a=this.scrollOption.currentOffset,n=assign({},this.opts,{_scrollDistance_:a,animation:!1});if(i>-1){var o=getSeriesDataItem(this.opts.series,i);if(0!==o.length){var r=getToolTipData(o,this.chartData.calPoints,i,this.opts.categories,e),s=r.textList,l=r.offset;n.tooltip={textList:s,offset:l,option:e}}}drawCharts.call(this,n.type,n,this.config,this.context)}},Charts.prototype.scrollStart=function(t){t.touches[0]&&!0===this.opts.enableScroll&&(this.scrollOption.startTouchX=t.touches[0].x)},Charts.prototype.scroll=function(t){if(t.touches[0]&&!0===this.opts.enableScroll){var e=t.touches[0].x-this.scrollOption.startTouchX,i=this.scrollOption.currentOffset,a=calValidDistance(i+e,this.chartData,this.config,this.opts);this.scrollOption.distance=e=a-i;var n=assign({},this.opts,{_scrollDistance_:i+e,animation:!1});drawCharts.call(this,n.type,n,this.config,this.context)}},Charts.prototype.scrollEnd=function(t){if(!0===this.opts.enableScroll){var e=this.scrollOption,i=e.currentOffset,a=e.distance;this.scrollOption.currentOffset=i+a,this.scrollOption.distance=0}},module.exports=Charts;
================================================
FILE: src/campus-card-page/pages/add-room.wpy
================================================
<template>
<BaseContainer :navTitle.sync="navigationBarTitleText">
<view slot="qy-content">
<view>
<qy-tip :content.sync="tipContent" :on.sync="tipOn"/>
<view class="container">
<picker range="{{campusArray}}" @change="changeCampus">
<view class="room-information">
<view class="arrow"></view>
<view class="information-name">校区</view>
<view class="information-item">{{campusArray[campusIndex]}}</view>
</view>
</picker>
<picker range="{{buildingArray[campusIndex]}}" value="{{areaIndex}}" @change="changeArea">
<view class="room-information">
<view class="arrow"></view>
<view class="information-name">苑区</view>
<view class="information-item">{{buildingArray[campusIndex][areaIndex]}}</view>
</view>
</picker>
<picker range="{{campusIndex == 1 ? roomArray[0] : roomArray[areaIndex]}}" value="{{buildingIndex}}" @change="changeBuilding">
<view class="room-information">
<view class="arrow"></view>
<view class="information-name">楼栋</view>
<view class="information-item">{{campusIndex == 1 ? roomArray[0][buildingIndex] : roomArray[areaIndex][buildingIndex]}}栋</view>
</view>
</picker>
<view class="room-information">
<view class="information-name">大寝号</view>
<input placeholder="请输入大寝号,格式如101" value="{{bigRoom}}" @input="getBigRoom"/>
</view>
<view class="room-information">
<view class="information-name">小寝号</view>
<input placeholder="{{!queryElec ? '请输入小寝号,格式如1(三牌楼不填)' : '请输入小寝号,格式如1(查大寝不填)'}}" value="{{smallRoom}}" @input="getSmallRoom"/>
</view>
<view class="save {{(campusIndex == 0 && bigRoom !== '' && (queryElec || (!queryElec && smallRoom !== ''))) || (campusIndex == 1 && bigRoom !== '') ? 'active' : ''}}" @tap="queryRoom">
{{queryElec ? '查询' : '保存'}}
</view>
</view>
</view>
</view>
</BaseContainer>
</template>
<script>
import wepy from "wepy";
import QyTip from "@/components/qy-tip";
import { changeDefaultDorm } from "@/api/common";
import { getDorm, getRemainEle } from "@/api/campusCard";
import BaseContainer from "@/components/baseContainer";
export default class addRoom extends wepy.page {
data = {
campusArray: ["仙林", "三牌楼"],
queryElec: false,
buildingArray: [
[
"梅苑",
"兰苑",
"竹苑",
"菊苑",
"桃苑",
"李苑",
"柳苑",
"桂苑",
"荷苑",
"青教"
],
["学一楼", "学二楼", "学三楼", "学四楼", "学五楼", "学六楼"]
],
roomArray: [
[1, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 12],
[13, 14, 15],
[16, 17, 18, 19, 20, 21],
[22, 23, 24, 25, 26, 27],
[28, 29, 30, 31, 32, 33],
[34, 35, 36, 37, 38, 39],
[40, 41, 42, 43, 44, 45],
[46, 47, 48, 49],
[7, 8, 9, 10, 11, 12]
],
campusIndex: 0,
areaIndex: 0,
buildingIndex: 0,
youngTeacher: false,
bigRoom: "",
smallRoom: "",
tipOn: false,
tipContent: "",
storageIndex: -1,
visitorModeStatus: false,
navigationBarTitleText: "新增宿舍地址"
};
components = {
"qy-tip": QyTip,
BaseContainer
};
methods = {
changeCampus(e) {
this.campusIndex = e.detail.value;
},
changeArea(e) {
this.areaIndex = e.detail.value;
if (this.campusIndex == 1) {
this.buildingIndex = e.detail.value;
}
},
changeBuilding(e) {
this.buildingIndex = e.detail.value;
if (this.campusIndex == 1) {
this.areaIndex = e.detail.value;
}
},
getBigRoom(e) {
this.bigRoom = e.detail.value;
},
getSmallRoom(e) {
this.smallRoom = e.detail.value;
},
async queryRoom() {
if (this.visitorModeStatus) {
return this.$invoke("BaseContainer", "showVisitorTips");
}
const roomIndex = this.campusIndex == 1 ? 0 : this.areaIndex;
const roomId =
this.campusIndex === 1 || this.campusIndex === "1"
? "0" + this.bigRoom
: this.bigRoom + this.smallRoom;
const building =
this.areaIndex === 9 || this.areaIndex === "9"
? Number(
this.roomArray[roomIndex][this.buildingIndex] + 48
).toString()
: this.roomArray[roomIndex][this.buildingIndex].toString();
const buildingId =
new Array(Number(4 - building.length)).fill(0).join("") + building;
if (this.queryElec) {
if (this.campusIndex === "1" || this.campusIndex === 1) {
return wepy.showModal({
title: "无法查询",
content: "三牌楼电费暂时无法查询,请耐心等待一段时间哟~",
confirmColor: "#47CFF5",
showCancel: false,
confirmText: "知道了"
});
}
const newRoomId =
this.smallRoom === ""
? this.bigRoom + "0"
: this.bigRoom + this.smallRoom;
const {
data: { data }
} = await getRemainEle(buildingId, newRoomId);
wepy.hideLoading();
return wepy.showModal({
title: data.bdName + "" + data.rmName,
content:
data.remain + "度\r\n" + "(电费充值成功后查询会有五分钟延迟哟~)",
confirmColor: "#47CFF5",
showCancel: false,
confirmText: "知道了"
});
}
if (
((this.campusIndex === 0 || this.campusIndex === "0") &&
this.bigRoom !== "" &&
this.smallRoom !== "") ||
((this.campusIndex === 1 || this.campusIndex === "1") &&
this.bigRoom !== "")
) {
wepy.showLoading();
const res = await getDorm(this.campusIndex, roomId, buildingId);
if (
JSON.parse(res.data.data).query_elec_roominfo.retcode === 0 ||
JSON.parse(res.data.data).query_elec_roominfo.retcode === "0"
) {
let item = {
campus: this.campusIndex,
roomId: roomId,
buildingId: buildingId,
campusName: this.campusArray[this.campusIndex],
areaName: this.buildingArray[this.campusIndex][this.areaIndex],
buildingName: this.roomArray[roomIndex][this.buildingIndex],
bigRoom: this.bigRoom,
smallRoom: this.smallRoom,
buildingIndex: this.buildingIndex,
default: false,
thisTime: false
};
if (this.storageIndex !== -1) {
let storage = wepy.getStorageSync("selectRoom");
if (storage[this.storageIndex].default) {
item.default = true;
let changeRoom = {};
const rowDefaultRoom = storage.find(room => room.default);
Object.entries(rowDefaultRoom).forEach(([key, value]) => {
if (
[
"campus",
"areaName",
"buildingId",
"bigRoom",
"smallRoom"
].includes(key)
) {
if (rowDefaultRoom[key] !== item[key]) {
changeRoom[key] = item[key];
}
}
});
if (Object.keys(changeRoom).length) {
console.log(changeRoom);
const { studentId } =
wepy.getStorageSync("userInfo") ||
wepy.getStorageSync("User");
const {
data: { data, success }
} = await changeDefaultDorm(changeRoom, studentId);
if (!success || !data) {
return wepy.showToast({
title: "不知道为什么失败了呢~",
icon: "none",
duration: 2000
});
}
}
}
storage[this.storageIndex] = item;
wepy.setStorageSync("selectRoom", storage);
this.backToPrePage();
} else {
if (!wepy.getStorageSync("selectRoom")) {
wepy.setStorageSync("selectRoom", [item]);
} else {
let rooms = wepy.getStorageSync("selectRoom");
rooms.push(item);
wepy.setStorageSync("selectRoom", rooms);
}
this.backToPrePage();
}
} else {
this.tipOn = true;
this.tipContent = JSON.parse(
res.data.data
).query_elec_roominfo.errmsg;
wepy.hideLoading();
this.$apply();
}
} else {
this.tipOn = true;
this.tipContent = "信息未填全哦!";
}
}
};
backToPrePage() {
wepy.showToast({
title: "成功",
icon: "success",
duration: 2000
});
setTimeout(() => {
wepy.hideLoading();
wepy.navigateBack({
delta: 1
});
}, 2000);
}
onLoad(e) {
this.visitorModeStatus = this.$com.BaseContainer.visitorModeStatus;
if (e.method === "query-elec") {
this.navigationBarTitleText = "电费查询";
this.queryElec = true;
}
if (e.item) {
e.item = JSON.parse(e.item);
this.campusIndex = e.item.campus;
let area = this.buildingArray[this.campusIndex]
.map(
(item, index) =>
(item = {
name: item,
index: index
})
)
.filter((item, index) => item.name === e.item.areaName);
// if (this.campusIndex === 1 || this.campusIndex === "1") {
// area = [
// {
// name: "三牌楼",
// index: 0
// }
// ];
// }
this.areaIndex = area[0].index;
this.buildingIndex = e.item.buildingIndex
? e.item.buildingIndex
: this.roomArray[this.areaIndex].indexOf(e.item.buildingName);
this.bigRoom = e.item.bigRoom;
this.smallRoom = e.item.smallRoom;
this.storageIndex = Number(e.index);
}
}
}
</script>
<style lang="stylus" scoped>
.container
width 680rpx
margin 0 auto
min-height 100vh
font-family PingFangSC-Regular
font-size 30rpx
color #353535
.room-information
position relative
display flex
align-items center
height 102rpx
line-height 102rpx
border-bottom 1rpx solid #e3e3e3
.information-name
width 177rpx
input
width 500rpx
height 30rpx
line-height 30rpx
.arrow
position absolute
right 0
background-image url('https://static.airbob.org/under-graduate/button_right.png')
background-size contain
background-repeat no-repeat
background-position center
width 30rpx
height 30rpx
.save
height 85rpx
line-height 85rpx
text-align center
color #ffffff
border-radius 50rpx
background-image linear-gradient(45deg, #abdcff 0%, #6ae4ff 100%)
margin-top 60rpx
&.active
background #47cff5
</style>
================================================
FILE: src/campus-card-page/pages/campus-card-charge.wpy
================================================
<template>
<BaseContainer navTitle="校园卡充值">
<view slot="qy-content">
<view class="container">
<view class="head-bg">
<view class="head-bg-title">账户余额(元)</view>
<view class="head-bg-remain">{{accountBalance}}</view>
</view>
<view class="main-container">
<view class="pay-account">充值账号:{{sno}}</view>
<view class="pay-way">支付方式:银行卡绑定校园卡</view>
<view class="quick-pay-container">
<view class="quick-pay-item" @tap.stop="fastPay" data-charge="50">50元</view>
<view class="quick-pay-item" @tap.stop="fastPay" data-charge="100">100元</view>
<view class="quick-pay-item" @tap.stop="fastPay" data-charge="200">200元</view>
<view class="quick-pay-item" @tap.stop="fastPay" data-charge="300">300元</view>
</view>
<view class="list">
<view class="list-item-quick">
<view class="list-item-text item">充值金额</view>
<input
class="list-item-text input"
type="digit"
@input="put"
value="{{charge}}"
placeholder="可输入1-300元整数金额"
placeholder-style="font-size:30rpx;color:#888888"
cursor-spacing="130"
>
</view>
</view>
<button
@tap.stop="openPayModal"
class="enter-button {{(charge==='' || charge === 'NAN' || charge === NAN || !charge) ? 'button-click' : ''}}"
hover-class="button-click"
disabled="{{(charge==='' || charge === 'NAN' || charge === NAN || !charge)?true:false}}"
>确认充值{{(charge && charge !== '') ? ' ¥' + charge : ''}}</button>
</view>
<PayFlow
:open.sync="isPayModalOpen"
:charge.sync="charge"
type="card"
payWay="银行卡绑定校园卡"
operateContent="校园卡/银行卡转账"
/>
</view>
</view>
</BaseContainer>
</template>
<script>
import wepy from "wepy";
import PayFlow from "../components/pay-flow";
import { campusCardRequestInfo } from "@/api/campusCard";
import { mockCampusCardRequestInfo } from "@/mock/campusCard";
import JudgeStatus from "@/mixins/module";
import BaseContainer from "@/components/baseContainer";
import { connect } from "wepy-redux";
@connect({
graduateIdentity(state) {
return state.graduateReducer.graduateIdentity;
}
})
export default class CampusCardCharge extends wepy.page {
data = {
accountBalance: 0, // 账户余额
cardBalance: 0, // 卡内余额
transitionBalance: 0, // 过度余额
charge: "",
// isPageUp: false, // 控制输入时按钮不被遮挡
isPayModalOpen: false,
sno: "",
visitorModeStatus: false
};
components = {
PayFlow,
BaseContainer
};
mixins = [JudgeStatus];
config = {
navigationBarTitleText: "校园卡充值",
enablePullDownRefresh: true
};
onLoad(op) {
this.visitorModeStatus = this.$com.BaseContainer.visitorModeStatus;
this.judgeStatus(op.name).then(() => {
if (!this.visitorModeStatus) {
const moduleStatus = wepy.getStorageSync("moduleStatus")[0].open;
if (!moduleStatus) {
// 一卡通维护中
wepy.redirectTo({
url: "../../others-page/pages/close"
});
}
}
this.getRemain();
});
}
async getRemain() {
let yktInfoCache = wepy.getStorageSync("yktInfo");
const fromYktIndex =
getCurrentPages().findIndex(
page => page.route === "campus-card-page/pages/campus-card-index"
) !== -1;
if (!fromYktIndex || !yktInfoCache || !yktInfoCache.data) {
const { data: balance } = !this.visitorModeStatus
? await campusCardRequestInfo(this.graduateIdentity)
: await mockCampusCardRequestInfo();
yktInfoCache = { data: balance.data, time: new Date() };
wepy.setStorageSync("yktInfo", yktInfoCache);
}
const { data: balance } = yktInfoCache;
this.accountBalance = this.graduateIdentity
? (Number(balance.db_balance) + Number(balance.unset_balance)) / 100
: (Number(balance.db_balance) + Number(balance.unsettle_amount)) / 100;
this.cardBalance = balance.db_balance / 100;
this.sno = balance.sno;
this.$apply();
}
async onPullDownRefresh() {
await this.getRemain();
wepy.stopPullDownRefresh();
wepy.showToast({
title: "刷新成功",
icon: "success",
duration: 1000
});
}
methods = {
showWhy() {
wepy.showModal({
content: "过度余额多度余额xxxxxx",
confirmText: "知道了",
showCancel: false,
confirmColor: "#47CFF5"
});
},
closePayModal() {
this.isPayModalOpen = false;
},
pageUp() {
this.isPageUp = true;
},
noPageUp() {
this.isPageUp = false;
},
put(e) {
const value = Number(e.detail.value);
this.putCharge(value);
},
fastPay(e) {
const value = Number(e.target.dataset.charge);
this.putCharge(value);
this.openPayModal();
},
openPayModal() {
// 校验
if (this.visitorModeStatus) {
this.charge = "";
return this.$invoke("BaseContainer", "showVisitorTips");
}
if (!isNaN(this.charge) && this.charge > 0) {
this.isPayModalOpen = true; // 输入密码
} else {
wepy
.showModal({
content: "金额错误",
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
})
.then(res => {
this.charge = "";
});
}
}
};
openPayModal() {
// 校验
if (this.visitorModeStatus) {
this.charge = "";
return this.$invoke("BaseContainer", "showVisitorTips");
}
if (!isNaN(this.charge) && this.charge > 0) {
this.isPayModalOpen = true; // 输入密码
} else {
wepy
.showModal({
content: "金额错误",
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
})
.then(res => {
this.charge = "";
});
}
}
events = {
closePayModal: () => {
this.isPayModalOpen = false;
this.$apply();
}
};
putCharge(number) {
this.charge = number;
}
}
</script>
<style lang="stylus" scoped>
.container
display flex
flex-direction column
margin-top 38rpx
.head-bg
background-image url('https://static.airbob.org/under-graduate/campus-card/card.png')
width 100%
height 243rpx
background-size cover
margin 0 auto
display flex
flex-direction column
text-align center
color #fff
.head-bg-title
margin-top 45rpx
height 40rpx
line-height 40rpx
font-size 28rpx
font-family PingFangSC-Regular
.head-bg-remain
font-size 80rpx
font-family PingFangSC-Medium
height 112rpx
line-height 112rpx
.main-container
margin 50rpx 35rpx 0 35rpx
font-family PingFangSC-Regular
.pay-account
font-family PingFangSC-Medium
color #353535
height 45rpx
line-height 45rpx
font-size 32rpx
.pay-way
font-size 24rpx
margin-top 9rpx
height 33rpx
line-height 33rpx
color #888888
.quick-pay-container
display flex
justify-content space-between
margin-top 50rpx
.quick-pay-item
height 100rpx
width 150rpx
border-radius 10rpx
border 1rpx solid #47cff5
color #47cff5
font-family PingFangSC-Medium
font-size 36rpx
line-height 100rpx
text-align center
&:hover
background-color #47cff5
color #fff
.list
margin-top 60rpx
font-size 30rpx
color #353535
font-family PingFangSC-Regular
.list-item
display flex
align-items center
position relative
.why
position absolute
width 30rpx
border-radius 50%
top 21rpx
left 167rpx
& + .list-item
border-top 2rpx solid #E3E3E3
.list-item-text
margin 0rpx 0 15rpx 0
&:first-of-type
margin-left 34rpx
margin-right 100rpx
.list-item-quick
display flex
align-items center
border-bottom 2rpx solid #E3E3E3
.money-list
display flex
align-items center
.money-item
border-radius 60rpx
width 93rpx
height 45rpx
line-height 45rpx
color #47CFF5
text-align center
border 2rpx solid #47CFF5
margin-right 30rpx
.input
z-index auto
.list-item-text
display flex
margin 15rpx 0
&.item
width 177rpx
&.input
width 500rpx
&:first-of-type
color #353535
.enter-button
background #47cff5
border-radius 100rpx
width 100%
height 85rpx
line-height 85rpx
color rgb(255, 255, 255)
margin-top 60rpx
&:after
border 0
.button-click
background-image none
background-color #D0F5FF
</style>
================================================
FILE: src/campus-card-page/pages/campus-card-index.wpy
================================================
<template>
<BaseContainer navTitle="一卡通" placeholder="6位校园卡密码" :passwordModelOptions.sync="passwordModelOptions">
<view slot="qy-content">
<YktBindModal :maskClosable="maskClosable" width="500rpx" :visible.sync="yktBindModalVisible">
<view slot="content" class="bind-container">
<input
class="bind-input"
placeholder="请输入一卡通卡号"
password="{{false}}"
@input="bindCardID"
placeholder-style="color: #999CA0"
>
<input
class="bind-input"
placeholder="请输入一卡通查询密码"
password="{{true}}"
@input="bindCardPassword"
placeholder-style="color: #999CA0"
>
<button class="bind-button" @tap.stop="goBindCard" hover-class="button-click">立即绑定</button>
</view>
</YktBindModal>
<view class="container">
<view class="bg"/>
<view class="head">
<view class="tip">余额(元)</view>
<view class="balance">{{balance}}</view>
<view class="tip">截止时间:{{time}}</view>
<view class="card-text">卡号:{{cardNumber}}</view>
</view>
<view class="list">
<block wx:for="{{listitems1}}" wx:key="index">
<view
class="item-container"
@tap.stop="navigate"
data-path="{{item.navigateURL}}"
data-name="{{item.text}}"
>
<image class="iconx" src="{{item.thumb}}" mode="widthFix">
<view class="content" style="justify-content:space-between;">
<text>{{item.text}}</text>
<view class="iconright"></view>
</view>
</view>
</block>
</view>
<view class="list">
<block wx:for="{{listitems2}}" wx:key="index">
<view
class="item-container"
@tap.stop="navigate"
data-path="{{item.navigateURL}}"
data-name="{{item.text}}"
>
<image class="iconx" src="{{item.thumb}}" mode="widthFix">
<view class="content" style="justify-content:space-between;">
<text>{{item.text}}</text>
<view class="iconright"></view>
</view>
</view>
</block>
</view>
<view class="chart-container" style="height:{{chartContainerHeight}}">
<text class="title">消费水平</text>
<view class="tab-list">
<view class="tab {{chartTab==='week'?'active':'unactive'}}" @tap.stop="changeToWeek">近7天</view>
<view
class="tab {{chartTab==='halfYear'?'active':'unactive'}}"
@tap.stop="changeToYear"
>近半年</view>
</view>
<canvas
class="canvas"
disable-scroll="true"
canvas-id="chartCanvas"
style="width:{{width}}px;height:{{height}}px"
></canvas>
</view>
</view>
</view>
</BaseContainer>
</template>
<script>
import wepy from "wepy";
import Chart from "../components/wxcharts-min.js";
import BaseContainer from "@/components/baseContainer";
import JudgeStatus from "@/mixins/module";
import {
campusCardRequestInfo,
sevenDayTurnOver,
yearTurnOver,
yktBind
} from "@/api/campusCard";
import {
mockCampusCardRequestInfo,
mockSevenDayTurnOver,
mockYearTurnOver
} from "@/mock/campusCard";
import { changeSecretCode } from "@/api/common";
import { connect } from "wepy-redux";
import QyModal from "@/components/qy-modal";
@connect({
graduateIdentity(state) {
return state.graduateReducer.graduateIdentity;
}
})
export default class CampusCard extends wepy.page {
components = {
BaseContainer,
YktBindModal: QyModal
};
mixins = [JudgeStatus];
config = {
navigationBarTitleText: "一卡通",
enablePullDownRefresh: true
};
data = {
navTitle: "一卡通",
balance: 0,
cardNumber: 0,
time: "",
listitems1: [
{
text: "校园卡充值",
thumb:
"https://static.airbob.org/under-graduate/card_icon_bank%20transfer.png",
navigateURL: "./campus-card-charge"
},
{
text: "电费充值",
thumb:
"https://static.airbob.org/under-graduate/card_icon_electricity.png",
navigateURL: "./electric-charge"
},
{
text: "校园网充值",
thumb: "https://static.airbob.org/under-graduate/card_icon_net.png",
navigateURL: "./net-charge"
}
],
listitems2: [
{
text: "消费明细",
thumb: "https://static.airbob.org/under-graduate/card_icon_detail.png",
navigateURL: "./consumption-detail"
},
{
text: "校园卡挂失",
thumb: "https://static.airbob.org/under-graduate/card_icon_lost.png",
navigateURL: "./campus-card-loss"
},
{
text: "金额操作记录",
thumb:
"https://static.airbob.org/under-graduate/campus-card/jiao-yi-ming-xi@2x.png",
navigateURL: "./money-log"
}
],
chartCanvasStyle: {},
canvasConfig: {},
chartdata1: [],
labels1: [],
chartdata2: [],
labels2: [],
chartTab: "week", // or halfYear
height: 400,
width: 750,
chartInstance: {},
maskClosable: false,
bindInputPassword: "",
chartContainerHeight: "auto",
yktStatus: true,
placeholder: "",
passwordModelOptions: {
placeholder: "6位校园卡密码",
passwordModelProps: false,
bindInfo: { username: "", domainType: "7" },
checkPassword: function(pwd) {
return /^[0-9]*$/.test(pwd) && pwd.length === 6;
},
checkErrMsg: "一卡通密码必须6位数字",
refreshData: function() {
return null;
}
},
visitorModeStatus: false,
yktBindModalVisible: false,
yktBindModalCardID: "",
yktBindModalPassword: ""
};
watch = {
chartTab(val) {
if (Object.keys(this.chartInstance).length !== 0) {
if (val === "week") {
this.chartInstance.updateData({
series: [
{
data: this.chartdata1
}
],
categories: this.labels1
});
} else {
this.chartInstance.updateData({
series: [
{
data: this.chartdata2
}
],
categories: this.labels2
});
}
}
},
maskClosable(next) {
if (next) {
this.chartContainerHeight = 0;
} else {
this.chartContainerHeight = "auto";
}
this.$apply();
}
};
async onPullDownRefresh() {
if (this.yktStatus) {
await this.init();
wepy.stopPullDownRefresh();
wepy.showToast({
title: "刷新成功",
icon: "success",
duration: 1000
});
}
}
onLoad(op) {
this.visitorModeStatus = this.$com.BaseContainer.visitorModeStatus;
this.judgeStatus(op.name).then(async () => {
wepy.showLoading({
title: "正在加载"
});
this.passwordModelOptions.refreshData = this.init.bind(this);
await this.init();
wepy.hideLoading();
});
}
methods = {
changeToWeek() {
if (this.chartTab !== "week") {
this.chartTab = "week";
}
},
changeToYear() {
if (this.chartTab !== "halfYear") {
this.chartTab = "halfYear";
}
},
bindCardID(e) {
this.yktBindModalCardID = e.detail.value;
},
bindCardPassword(e) {
this.yktBindModalPassword = e.detail.value;
},
navigate(e) {
const name = e.currentTarget.dataset.name;
wepy.navigateTo({
url: `${e.currentTarget.dataset.path}?name=${name}`
});
},
async goBindCard() {
wepy.showLoading({
title: "绑定中...", //提示的内容,
mask: true //显示透明蒙层,防止触摸穿透,
});
const { data: response } = await yktBind(
this.yktBindModalCardID,
this.yktBindModalPassword
);
wepy.hideLoading();
if (response) {
if (response.data) {
wepy.showToast({
title: "成功绑定一卡通",
icon: "success",
duration: 2000
});
this.yktBindModalVisible = false;
this.$apply();
this.init();
} else {
this.$parent.showTip("绑定失败,请重试");
}
}
}
};
async init() {
// 初始化页面
const systemInfo = await wepy.getSystemInfo();
this.width = Math.floor(systemInfo.windowWidth);
this.height = Math.floor(this.width / 1.6);
this.chartContainerHeight = "auto";
const tempDate = new Date();
const formatTimeString = raw =>
raw.toString().length < 2 ? "0" + raw.toString() : raw.toString();
this.time = this.graduateIdentity
? `2019-6-20 毕业典礼`
: `${tempDate.getFullYear()}-${tempDate.getMonth() +
1}-${tempDate.getDate()} ${formatTimeString(
tempDate.getHours()
)}:${formatTimeString(tempDate.getMinutes())}:${formatTimeString(
tempDate.getSeconds()
)}`;
const { data: response } = !this.visitorModeStatus
? await campusCardRequestInfo(this.graduateIdentity)
: await mockCampusCardRequestInfo();
if (response) {
if (response.data) {
const yktInfoCache = { data: response.data, time: new Date() };
wepy.setStorageSync("yktInfo", yktInfoCache);
this.balance =
(Number(response.data.db_balance) +
Number(response.data.unsettle_amount)) /
100 ||
(Number(response.data.db_balance) +
Number(response.data.unset_balance)) /
100;
this.cardNumber = response.data.sno;
this.getWeek();
this.getYear();
this.$apply();
} else if (response.errCode === 24) {
this.chartContainerHeight = 0;
this.placeholder = "6位校园卡密码";
this.passwordModelOptions.passwordModelProps = true;
this.$apply();
} else if (response.errCode === 34) {
this.yktBindModalVisible = true;
this.$apply();
}
}
}
async getWeek() {
// 获取6天流水
this.labels1 = [];
const now = Date.now();
for (let i = 6; i >= 0; i--) {
this.labels1.push(new Date(now - i * 1000 * 3600 * 24).getDate());
}
const { data: week } = this.visitorModeStatus
? await mockSevenDayTurnOver()
: await sevenDayTurnOver();
if (week.data && week.data.slice) {
this.chartdata1 = week.data.slice().reverse();
if (Object.keys(this.chartInstance).length === 0) {
// 初始化
this.chartInstance = new Chart({
canvasId: "chartCanvas",
type: "area",
categories: this.labels1,
series: [
{
data: this.chartdata1
}
],
yAxis: {
min: 0,
gridColor: "rgba(255,255,255,0)"
},
xAxis: {},
legend: false,
width: this.width,
height: this.height
});
} else {
this.chartInstance.updateData({
series: [
{
data: this.chartdata1
}
],
categories: this.labels1
});
}
}
}
async getYear() {
// 获取月流水
const { data: now_month } = !this.visitorModeStatus
? await yearTurnOver()
: await mockYearTurnOver();
if (now_month.data) {
this.labels2 = [];
this.labels2 = now_month.data.resmonth.slice(-6);
this.chartdata2 = now_month.data.amt.slice(-6).map(_ => Number(_));
}
}
}
</script>
<style lang="stylus" scoped>
.container
display flex
flex-direction column
align-items center
.bg
position fixed
width 100vw
height 100vh
background-color rgb(245, 245, 245)
z-index -1000
.head
background-image url('https://static.airbob.org/under-graduate/card_pic.png')
width 100%
background-repeat no-repeat
background-size contain
height 400rpx
display flex
flex-direction column
align-items center
color #353535
background-color rgb(255, 255, 255)
.tip
font-size 24rpx
&:first-child
margin-top 49rpx
.balance
font-size 90rpx
font-weight bold
.card-text
font-size 30rpx
font-weight bold
margin-top 50rpx
.list
width 100%
margin 20rpx 0
.chart-container
background-color white
overflow hidden
padding-top 26rpx
width 100%
.title
font-size 32rpx
color #353535
font-weight bold
margin 30rpx 0 0 20rpx
.tab-list
display flex
margin 15rpx 0 0 20rpx
.tab
border-radius 60rpx
font-size 24rpx
padding 4rpx 16rpx
&+.tab
margin-left 30rpx
.active
color #fff
background-color #47CFF5
.unactive
color #999CA0
border 2rpx solid #999CA0
.bind-container
display flex
flex-direction column
align-items center
background-image url('https://static.airbob.org/under-graduate/model_pic_password.png')
background-repeat no-repeat
height 785rpx
border-radius 30rpx
background-size cover
.bind-input
font-size 26rpx
margin 221rpx 0 56rpx
width 438rpx
border-bottom 2rpx solid #999CA0
.bind-button
margin-top 26rpx
background-color #6AE4FF
text-align center
width 410rpx
height 80rpx
line-height 80rpx
color #ffffff
border-radius 50px
.button-click
background-image none
background-color #D0F5FF
.item-container
display flex
height 98rpx
background-color rgb(255, 255, 255)
position relative
align-items center
margin-right 16rpx
&:last-child > .content
border-style none !important
.iconx
width 38rpx
margin 0 45rpx 0 25rpx
.iconright
width 35rpx
height 35rpx
background-image url('https://static.airbob.org/under-graduate/%E5%8F%B3%E7%AE%AD%E5%A4%B4.png')
background-position center
background-repeat no-repeat
background-size contain
.content
width 100%
height 96rpx
display flex
align-items center
margin-right 20rpx
border-bottom 2rpx solid #E3E3E3
.text
font-size 32rpx
color #353535
.bind-container
display flex
flex-direction column
align-items center
background-image url('https://static.airbob.org/under-graduate/model_pic_password.png')
background-repeat no-repeat
height 285rpx
border-radius 30rpx
background-size cover
padding-top 200rpx;
.bind-input
font-size 26rpx
margin 21rpx 0
width 438rpx
border-bottom 2rpx solid #999CA0
.bind-button
margin-top 26rpx
background-color #6AE4FF
text-align center
width 410rpx
height 80rpx
line-height 80rpx
color #ffffff
border-radius 50px
</style>
================================================
FILE: src/campus-card-page/pages/campus-card-loss.wpy
================================================
<template>
<BaseContainer navTitle="校园卡挂失">
<view slot="qy-content">
<view class="container">
<image class="loss-bg" mode="aspectFill" src="https://static.airbob.org/loss/loss.png"/>
<view class="loss-list">
<repeat for="{{items}}" key="index">
<view class="list-item" @tap="toLossPage" data-index="{{index}}">
<image class="card-pic" mode="aspectFit" src="https://static.airbob.org/loss/card{{index+1}}.png"/>
<view class="card-detail-container">
<view class="card-text">{{item}}</view>
<image class="card-arrow" mode="aspectFit" src="https://static.airbob.org/loss/arrow.png"/>
</view>
</view>
</repeat>
</view>
</view>
</view>
</BaseContainer>
</template>
<script>
import wepy from "wepy";
import JudgeStatus from "@/mixins/module";
import BaseContainer from "@/components/baseContainer";
export default class CampusCardLoss extends wepy.page {
components = {
BaseContainer
};
config = {
navigationBarTitleText: "校园卡挂失"
};
mixins = [JudgeStatus];
data = {
items: ["校园卡丢失", "拾到校园卡", "挂失信息", "失物招领", "挂失解除"]
};
methods = {
toLossPage(e) {
let index = e.currentTarget.dataset.index;
wepy.navigateTo({
url: "../../campus-card-page/pages/campus-card-lossPage?index=" + index
});
}
};
onLoad(op) {
this.judgeStatus(op.name);
}
}
</script>
<style lang="stylus" scoped>
.container
display flex
flex-direction column
align-items center
margin-top 38rpx
width 100%
font-family PingFangSC-Regular
.loss-bg
width 100%
height 243rpx
margin 0 auto
.loss-list
display flex
flex-direction column
padding 0 20rpx
width 100%
margin-top 50rpx
.list-item
display flex
flex-direction row
align-items center
height 100rpx
margin 0 20rpx 0 40rpx
.card-pic
width 50rpx
height 50rpx
.card-detail-container
height 100%
width 100%
margin-left 50rpx
display flex
align-items center
flex-direction row
justify-content space-between
border-bottom solid 2rpx #e3e3e3
.card-text
font-size 32rpx
color #353535
.card-arrow
width 60rpx
</style>
================================================
FILE: src/campus-card-page/pages/campus-card-lossPage.wpy
================================================
<template>
<BaseContainer navTitle="校园卡挂失">
<view slot="qy-content">
<view class="container">
<QyModal height="329rpx" width="434rpx">
<view slot="content" class="info-container">
<view class="info-title">你可以通过下面的方式联系{{cardIndex===2?"失主":"拾卡人"}}</view>
<view class="info-content">{{info}}</view>
<button class="info-button" style="color:{{cardIndex===2?'#408175':'#e66c10'}};" @tap.stop="copy">复制信息</button>
</view>
</QyModal>
<view class="loss-header">
<image class="card-pic" mode="aspectFit" src="{{cardUrl}}"/>
<view class="card-text">{{ items[cardIndex] }}</view>
</view>
<view class="loss-content">
<view class="input-container" wx:if="{{cardIndex===0||cardIndex===4}}">
<view class="input-text">校园卡密码</view>
<input placeholder="输入你的校园卡密码" type="password" @input="inputCampusPassword" value="{{campusPassword}}"/>
</view>
<view class="input-container" wx:if="{{cardIndex===1}}">
<view class="input-text">校园卡卡号</view>
<input placeholder="输入你拾到的校园卡卡号" @input="inputCampusNumber" value="{{campusNumber}}"/>
</view>
<view class="input-container" wx:if="{{cardIndex===0||cardIndex===1}}">
<view class="input-text">备注</view>
<input placeholder="你的联系方式" @input="inputCampusDescription" value="{{description}}"/>
</view>
<scroll-view class="table-container" wx:if="{{cardIndex===2}}" scroll-y @scrolltolower="loadMoreLossInfoList">
<view class="tr" style="background:#6bdec9;">
<view class="th">挂失时间</view>
<view class="th">姓名</view>
<view class="th">卡号后四位</view>
<view class="th">备注</view>
</view>
<repeat for="{{ lossInfoData }}" index="index" key="key" item="item">
<view class="tr">
<view class="td">{{ item.times }}</view>
<view class="td">{{ item.name }}</view>
<view class="td">{{ item.card }}</view>
<view class="td" style="color:#408175;" @tap.stop="showModal" data-tips="{{item.remark?item.remark:'无'}}">详情</view>
</view>
</repeat>
</scroll-view>
<scroll-view class="table-container" wx:if="{{cardIndex===3}}" scroll-y @scrolltolower="loadMoreLossObjectList">
<view class="tr" style="background:#fc9d57;">
<view class="th">挂失时间</view>
<view class="th">姓名</view>
<view class="th">卡号后四位</view>
<view class="th">备注</view>
</view>
<repeat for="{{ lossObjectData }}" index="index" key="key" item="item">
<view class="tr">
<view class="td">{{ item.times }}</view>
<view class="td">{{ item.name }}</view>
<view class="td">{{ item.card }}</view>
<view class="td" style="color:#e66c10;" @tap.stop="showModal" data-tips="{{item.remark?item.remark:'无'}}">详情</view>
</view>
</repeat>
</scroll-view>
</view>
<button class="submitBtn" style="background:{{colors[cardIndex]}};" wx:if="{{cardIndex===0||cardIndex===1||cardIndex===4}}" @tap="submitInformation">提交</button>
</view>
</view>
</BaseContainer>
</template>
<script>
import wepy from "wepy";
import QyModal from "@/components/qy-modal";
import BaseContainer from "@/components/baseContainer";
import {
campusLostCard,
campusFindCard,
campusUnlostCard,
getLossInfo,
getLossObject
} from "@/api/campusCard";
export default class CampusCardLoss extends wepy.page {
components = {
QyModal,
BaseContainer
};
config = {
navigationBarTitleText: "校园卡挂失"
};
data = {
// 页面
items: ["校园卡丢失", "拾到校园卡", "挂失信息", "失物招领", "挂失解除"],
colors: ["#3891ff", "#ed53e3", "", "", "#26c4ef"],
cardUrl: "",
cardIndex: 0,
campusPassword: "",
campusDescription: "",
campusNumber: "",
// 挂失信息
lossInfoPage: 1,
lossInfoData: [],
lossInfoLoading: false,
// 失物招领
lossObjectPage: 1,
lossObjectData: [],
lossObjectLoading: false,
// modal
info: "",
card: 0
};
methods = {
inputCampusPassword(e) {
this.campusPassword = e.detail.value;
},
inputCampusNumber(e) {
this.campusNumber = e.detail.value;
},
inputCampusDescription(e) {
this.campusDescription = e.detail.value;
},
showModal(e) {
this.info = e.target.dataset.tips === null ? "无" : e.target.dataset.tips;
this.card = e.target.dataset.card;
this.$invoke("QyModal", "open");
},
async submitInformation() {
if (this.visitorModeStatus) {
return this.$invoke("BaseContainer", "showVisitorTips");
}
if (this.cardIndex === 0) {
let psd = this.campusPassword;
let des = this.campusDescription;
const res = await campusLostCard(psd, des);
if (res.data) {
await wepy.showModal({
content: res.data.data,
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
});
}
this.campusPassword = "";
this.campusDescription = "";
this.campusNumber = "";
} else if (this.cardIndex === 1) {
let num = this.campusNumber;
let des = this.campusDescription;
const res = await campusFindCard(num, des);
this.campusPassword = "";
this.campusDescription = "";
this.campusNumber = "";
if (res.data) {
await wepy.showToast({
title: "提交成功",
icon: "success",
duration: 1500
});
} else {
switch (res.data.errCode) {
case 29:
await wepy.showToast({
title: "单个用户一天最多找到4张卡",
icon: "none",
duration: 1500
});
break;
case 30:
await wepy.showToast({
title: "非常遗憾,您输入的卡号没有使用小程序",
icon: "none",
duration: 1500
});
break;
default:
await wepy.showToast({
title: "未知错误",
icon: "none",
duration: 1500
});
}
}
this.$invoke("UpLoadModal", "close");
} else if (this.cardIndex === 4) {
let psd = this.campusPassword;
const res = await campusUnlostCard(psd);
if (res.data) {
await wepy.showModal({
content: res.data.data,
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
});
}
this.campusPassword = "";
this.campusDescription = "";
this.campusNumber = "";
}
}
};
async getLossInfoList(page) {
// 获取挂失信息
page = page || this.lossInfoPage;
wepy.showLoading({
title: "正在加载"
});
if (page === 1) {
this.lossInfoData = [];
// 初次请求的时候请求20条
const resArr = ["1", "2"].map(page => getLossInfo(page));
await Promise.all(resArr).then(resDatas => {
for (let res of resDatas) {
if (res.data && res.data.data.length > 0) {
this.lossInfoData = [...this.lossInfoData, ...res.data.data];
}
}
});
this.lossInfoPage = 3;
wepy.hideLoading();
} else {
// 非初始状态
const res = await getLossInfo(page);
if (res.data && res.data.data.length > 0) {
this.lossInfoData = [...this.lossInfoData, ...res.data.data];
this.lossInfoPage = this.lossInfoPage + 1;
wepy.hideLoading();
} else {
wepy.hideLoading();
wepy.showToast({
title: "无更多数据",
icon: "success",
duration: 1000
});
}
}
this.lossInfoLoading = false;
this.$apply();
}
async getLossObjectList(page) {
// 获取失物招领列表
page = page || this.lossObjectPage;
wepy.showLoading({
title: "正在加载"
});
if (page === 1) {
this.lossObjectData = [];
const resArr = ["1", "2"].map(page => getLossObject(page));
await Promise.all(resArr).then(resDatas => {
for (let res of resDatas) {
if (res.data && res.data.data.length > 0) {
this.lossObjectData = [
...this.lossObjectData,
...res.data.data.map(_ => {
return _.card
? {
..._,
card: _.card.slice(-4)
}
: _;
})
];
}
}
});
this.lossObjectPage = 3;
wepy.hideLoading();
} else {
const res = await getLossObject(page);
if (res.data && res.data.data.length > 0) {
this.lossObjectData = [
...this.lossObjectData,
...res.data.data.map(_ => {
return _.card
? {
..._,
card: _.card.slice(-4)
}
: _;
})
];
this.lossObjectPage = this.lossObjectPage + 1;
wepy.hideLoading();
} else {
wepy.hideLoading();
wepy.showToast({
title: "无更多数据",
icon: "success",
duration: 1000
});
}
}
this.lossObjectLoading = false;
this.$apply();
}
loadMoreLossInfoList() {
if (!this.lossInfoLoading) {
this.lossInfoLoading = true;
this.getLossInfoList();
}
}
loadMoreLossObjectList() {
if (!this.lossObjectLoading) {
this.lossObjectLoading = true;
this.getLossObjectList();
}
}
onLoad(options) {
this.visitorModeStatus = this.$com.BaseContainer.visitorModeStatus;
let cardIndex = Number(options.index);
this.cardUrl =
"https://static.airbob.org/loss/card" + Number(cardIndex + 1) + ".png";
this.cardIndex = cardIndex;
if (cardIndex === 2) {
this.getLossInfoList(1);
} else if (cardIndex === 3) {
this.getLossObjectList(1);
}
this.$apply();
}
}
</script>
<style lang="stylus" scoped>
.container
font-family PingFangSC-Regular
font-size 32rpx
color #353535
.loss-header
display flex
flex-direction row
align-items center
height 100rpx
margin 30rpx 0 40rpx 0
.card-pic
width 50rpx
height 50rpx
margin 0 56rpx 0 40rpx
.card-text
font-family PingFangSC-Medium
.loss-content
display flex
flex-direction column
align-items center
margin 0 34rpx
.input-container
width 100%
display flex
flex-direction row
align-items center
height 100rpx
border-bottom solid 2rpx #e3e3e3
.input-text
white-space nowrap
width 240rpx
input
width 100%
.table-container
display flex
flex-direction column
width 100%
height calc(100vh - 100rpx)
.tr
min-height 76rpx
padding 10rpx 0
display flex
flex-direction row
align-items center
border-bottom solid 2rpx #e0e0e0
color #353535
.th, .td
display inline-block
font-family PingFangSC-Medium
line-height 32rpx
min-width 128rpx
max-width 164rpx
margin 0 30rpx
.tr:first-child
color #fff
border none
border-radius 6rpx
white-space nowrap
.tr:last-child
margin-bottom 30rpx
.submitBtn
position absolute
bottom 64rpx
right 0
left 0
color #fff
border-radius 50rpx
margin 0 34rpx
button:after
border none
.info-container
display flex
flex-direction column
align-items center
justify-content space-around
height 329rpx
.info-title
font-size 24rpx
color rgb(156, 153, 153)
.info-content
font-size 36rpx
margin 0 30rpx
.info-button
width 204rpx
height 51rpx
border-radius 10rpx
text-align center
line-height 51rpx
border 2rpx solid black
font-size 26rpx
</style>
================================================
FILE: src/campus-card-page/pages/consumption-detail.wpy
================================================
<template>
<BaseContainer :navTitle="navTitle">
<view slot="qy-content">
<view class="container">
<view class="bg"/>
<view class="head-container">
<view class="head-item">地点</view>
<view class="head-item">交易方式</view>
<view class="head-item">收支</view>
</view>
<scroll-view class="scroll-container" scroll-y @scrolltolower="loadMore">
<repeat for="{{detailsKeys}}" key="index">
<ConsumptionDetailCard :occTime="item" :list="details[item]"/>
</repeat>
</scroll-view>
</view>
</view>
</BaseContainer>
</template>
<script>
import wepy from "wepy";
import ConsumptionDetailCard from "../components/consumption-detail-card";
import BaseContainer from "@/components/baseContainer";
import { oneDayTurnOver } from "@/api/campusCard";
import { mockOneDayTurnOver } from "@/mock/campusCard";
import navigation from "@/components/qy-navigation";
export default class ConsumptionDetail extends wepy.page {
components = {
ConsumptionDetailCard,
BaseContainer
};
data = {
navTitle: "消费明细",
details: {},
detailsKeys: [],
page: 1,
loadingStatus: false, // 当前是否在加载数据
visitorModeStatus: false
};
config = {
navigationBarTitleText: "消费明细",
enablePullDownRefresh: true
};
async onLoad() {
this.visitorModeStatus = this.$com.BaseContainer.visitorModeStatus;
// 默认获取15条
this.getDetails();
}
// onPullDownRefresh(){
// this.page =1;
// this.getDetails();
// wepy.stopPullDownRefresh();
// };
async getDetails() {
wepy.showLoading({
title: "正在加载"
});
if (this.page === 1) {
this.detailsKeys = [];
this.details = {};
}
const res = !this.visitorModeStatus
? await oneDayTurnOver(this.page)
: await mockOneDayTurnOver();
if (res.data) {
res.data.data.forEach(item => {
if (this.details[item.occtime.slice(0, 10)]) {
this.details[item.occtime.slice(0, 10)] = [
...this.details[item.occtime.slice(0, 10)],
item
];
} else {
this.details[item.occtime.slice(0, 10)] = [item];
}
});
this.detailsKeys = Object.keys(this.details);
wepy.hideLoading();
this.loadingStatus = false;
this.page = this.page + 1;
this.$apply();
}
// this.$apply();
}
methods = {
loadMore() {
if (!this.loadingStatus) {
this.loadingStatus = true;
this.getDetails();
}
}
};
}
</script>
<style lang="stylus" scoped>
.container
display flex
flex-direction column
.bg
width 100vw
height 100vh
position fixed
background-color #F5F5F5
z-index -1000
.scroll-container
height 100vh
.head-container
background-color white
height 89rpx
width 100%
background-size contain
display flex
background-image url('https://static.airbob.org/under-graduate/card_list_detail_bg.png')
justify-content space-around
font-size 32rpx
font-weight bold
color #353535
align-items center
.head-item
width 33%
height 67rpx
line-height 67rpx
text-align center
& + .head-item
border-left 2rpx solid #e3e3e3
</style>
================================================
FILE: src/campus-card-page/pages/electric-charge.wpy
================================================
<template>
<BaseContainer navTitle="电费充值">
<view slot="qy-content">
<view class="container">
<view class="header-tip">
<view class="image-container"></view>
<view class="tip-font">肖辰旭提示你:剩余电量数据可能存在5min的延迟,请耐心等待哦~</view>
</view>
<view class="head-bg">
<view class="head-bg-container" @tap="goSelectRoom">
<view class="image" wx:if="{{dorm === '点击添加宿舍地址'}}"></view>
<view class="dorm" wx:if="{{dorm === '点击添加宿舍地址'}}">{{dorm}}</view>
<view class="remain-electricity" wx:if="{{dorm !== '点击添加宿舍地址'}}">
<view class="title">{{dorm}}剩余电量(度)</view>
<view class="remains">{{remainEle}}</view>
</view>
<view class="arrow"></view>
</view>
</view>
<view class="main-container">
<view class="pay-account">本次充值宿舍:{{dormRoom}}</view>
<view class="pay-way">支付方式:银行卡绑定校园卡</view>
<picker range="{{modeArray}}" value="0" @change="changeMode" wx:if="{{dormItem.campus === 0}}">
<view class="list">
<view class="arrow"></view>
<view class="list-item-quick">
<view class="list-item-text item">充值类型</view>
<view class="list-item-text">{{modeArray[modeIndex]}}</view>
</view>
</view>
</picker>
<view class="quick-pay-container">
<view class="quick-pay-item" @tap.stop="fastPay" data-charge="10">10元</view>
<view class="quick-pay-item" @tap.stop="fastPay" data-charge="20">20元</view>
<view class="quick-pay-item" @tap.stop="fastPay" data-charge="30">30元</view>
<view class="quick-pay-item" @tap.stop="fastPay" data-charge="50">50元</view>
</view>
<view class="list">
<view class="list-item-quick">
<view class="list-item-text item">充值金额</view>
<input
class="list-item-text input"
type="digit"
@input="putMoney"
value="{{charge}}"
placeholder="可输入1-300元整数金额"
placeholder-style="font-size:30rpx;color:#888888"
cursor-spacing="130"
>
</view>
</view>
<view class="button-container">
<button
@tap.stop="openPayModal"
class="enter-button {{(charge === '' || charge === 'NAN' || charge === NAN || !charge) ? 'button-click' : ''}}"
hover-class="button-click"
disabled="{{(charge==='' || charge === 'NAN' || charge === NAN || !charge)?true:false}}"
>确认充值{{(charge && charge !== '') ? ' ¥' + charge : ''}}</button>
<button @tap.stop="getQueryElec" class="get-query-elec">电费查询</button>
</view>
</view>
<PayFlow
:electricURL.sync="electricURL"
:open.sync="isPayModalOpen"
type="electric"
:charge.sync="charge"
payWay="校园卡电费转账"
:operateContent="modeArray[modeIndex]"
/>
</view>
</view>
</BaseContainer>
</template>
<script>
import wepy from "wepy";
import PayFlow from "../components/pay-flow";
import JudgeStatus from "@/mixins/module";
import { getRemainEle } from "@/api/campusCard";
import { getDefaultDorm } from "@/api/common";
import BaseContainer from "@/components/baseContainer";
export default class ElectricCharge extends wepy.page {
data = {
charge: "",
remainEle: 0,
isPayModalOpen: false,
isPageUp: false,
modeArray: ["小寝电费充值", "大寝电费充值"],
modeIndex: "0", // 0 大寝室、 1 小寝室
electricURL: "",
useOnce: -1,
dorm: "点击添加宿舍地址",
dormRoom: "请先添加宿舍",
dormItem: {},
visitorModeStatus: false
};
components = {
PayFlow,
BaseContainer
};
mixins = [JudgeStatus];
config = {
navigationBarTitleText: "电费充值"
};
computed = {
downButtonClick() {
return (
this.charge === "" ||
this.bigNumber === "" ||
(this.modeIndex === 1 && this.smallNumber === "")
);
}
};
watch = {
modeIndex(newValue, oldValue) {
if (this.selectRoom !== "" && this.selectRoom) {
this.dormRoom =
this.dormItem.campusName +
"校区 " +
this.dormItem.areaName +
" " +
this.dormItem.buildingName +
"栋 " +
this.dormItem.bigRoom;
if (newValue === 0 || newValue === "0") {
this.dormRoom +=
this.dormItem.campus === 1 || this.dormItem.campus === "1"
? ""
: "-" + this.dormItem.smallRoom;
}
}
}
};
methods = {
getQueryElec() {
this.$navigate({
url: "./add-room?method=query-elec"
});
},
closePayModal() {
this.isPayModalOpen = false;
},
putMode(e) {
this.modeIndex = e.detail.value;
},
goSelectRoom() {
this.$navigate({
url: "./select-room"
});
},
putMoney(e) {
// 校验金额
const value = Number(e.detail.value);
this.putCharge(value);
},
fastPay(e) {
const value = Number(e.target.dataset.charge);
this.putCharge(value);
this.openPayModal();
},
async changeMode(e) {
this.modeIndex = e.detail.value;
if (this.modeIndex === "1" || this.modeIndex === 1) {
const publicEle = this.dormItem.roomId.substr(0, 3) + "0";
const data = await this.queryEleRemain(
this.dormItem.buildingId,
publicEle
);
this.dorm =
this.dormItem.campusName + "校区 " + data.bdName + " " + data.rmName;
this.$apply();
} else if (this.modeIndex === "0" || this.modeIndex === 0) {
const data = await this.queryEleRemain(
this.dormItem.buildingId,
this.dormItem.roomId
);
this.dorm =
this.dormItem.campusName + "校区 " + data.bdName + " " + data.rmName;
this.$apply();
}
}
};
events = {
closePayModal: () => {
this.isPayModalOpen = false;
this.$apply();
}
};
async queryEleRemain(buildingId, roomId) {
if (this.dormItem.campus === "1" || this.dormItem.campus === 1) {
this.remainEle = "无法查询";
this.$apply();
} else {
const {
data: { data: remainEle }
} = await getRemainEle(buildingId, roomId);
this.remainEle = remainEle.remain || "";
this.$apply();
return remainEle;
}
}
openCheckModal() {
return wepy.showModal({
title: "金额确认",
content: `确定充值 ¥${this.charge} 到电费中吗?`,
showCancel: true,
cancelText: "否",
cancelColor: "#FF0000",
confirmText: "是",
confirmColor: "#3CC51F"
});
}
async openPayModal() {
if (this.visitorModeStatus) {
this.charge = "";
return this.$invoke("BaseContainer", "showVisitorTips");
}
const roomId =
(this.dormItem.campus === 1 || this.dormItem.campus === "1" ? "0" : "") +
this.dormItem.bigRoom +
(this.dormItem.campus === 1 || this.dormItem.campus === "1"
? ""
: this.modeIndex === "0" || this.modeIndex === 0
? this.dormItem.smallRoom
: "0");
// const buildingId =
// this.dormItem.areaName === "青教"
// ? Number(this.dormItem.buildingName + 48).toString()
// : this.dormItem.buildingName.toString();
if (
this.dormItem &&
roomId &&
this.dormItem.buildingId &&
(this.dormItem.campus == 0 || this.dormItem.campus == 1)
) {
this.electricURL = `campus=${
this.dormItem.campus
}&roomId=${roomId}&buildingId=${this.dormItem.buildingId}`; // 用来在PayFlow中拼接 金额和密码
if (this.charge > 0) {
if (this.charge > 50) {
const res = await this.openCheckModal();
if (res.confirm) {
this.isPayModalOpen = true;
this.$apply();
}
} else {
this.isPayModalOpen = true;
}
} else {
wepy
.showModal({
content: "金额错误",
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
})
.then(res => {
this.charge = "";
});
}
} else {
wepy.showModal({
content: "请先添加宿舍",
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
});
}
}
putCharge(number) {
this.charge = number;
}
setDormText() {
this.dorm =
this.dormItem.campusName +
"校区 " +
this.dormItem.areaName +
" " +
this.dormItem.buildingName +
"栋 " +
this.dormItem.bigRoom +
(this.dormItem.campus === 1 || this.dormItem.campus === "1"
? ""
: "-" + this.dormItem.smallRoom);
this.dormRoom = this.dorm;
}
async init() {
const page = getCurrentPages();
const nowPage = page[page.length - 1];
this.useOnce = nowPage.data.useOnce;
this.selectRoom = wepy.getStorageSync("selectRoom");
if (this.selectRoom !== "" && this.selectRoom) {
if (this.useOnce !== -1 && this.useOnce !== "-1") {
this.dormItem = this.selectRoom[this.useOnce];
} else {
this.dormItem = this.selectRoom.find(item => item.default);
}
this.setDormText();
await this.queryEleRemain(this.dormItem.buildingId, this.dormItem.roomId);
} else {
const {
data: { data, success }
} = await getDefaultDorm();
if (success && data) {
const {
area: campus,
yuanqu: areaName,
louhao: buildingId,
fanghao: bigRoom,
shihao: smallRoom
} = data;
const tempObj = {
areaName,
buildingId,
buildingName: parseInt(buildingId),
bigRoom,
smallRoom,
default: true,
thisTime: false
};
this.dormItem =
campus === "XL"
? {
campusName: "仙林",
campus: 0,
roomId: bigRoom + smallRoom,
...tempObj
}
: {
campusName: "三牌楼",
campus: 1,
roomId: "0" + bigRoom,
...tempObj
};
wepy.setStorageSync("selectRoom", [this.dormItem]);
this.setDormText();
await this.queryEleRemain(
this.dormItem.buildingId,
this.dormItem.roomId
);
}
}
}
onShow() {
this.visitorModeStatus = this.$com.BaseContainer.visitorModeStatus;
this.init();
if (!this.visitorModeStatus) {
const moduleStatus = wepy.getStorageSync("moduleStatus")[0].open;
if (!moduleStatus) {
// 一卡通维护中
wepy.redirectTo({
url: "../../others-page/pages/close"
});
}
}
}
onLoad(op) {
this.judgeStatus(op.name);
}
}
</script>
<style lang="stylus" scoped>
.container
display flex
flex-direction column
margin-top 38rpx
.header-tip
display flex
font-family PingFangSC-Regular
font-size 24rpx
color #888888
margin 0 35rpx 16rpx 35rpx
.image-container
width 46rpx
height 46rpx
background-size contain
background-repeat no-repeat
background-image url('https://static.airbob.org/under-graduate/campus-card/notice%21@2x.png')
.head-bg
background-image url('https://static.airbob.org/under-graduate/campus-card/elec.png')
width 100%
height 243rpx
background-size cover
margin 0 auto
display flex
text-align center
align-items center
justify-content center
color #fff
.head-bg-container
display flex
justify-content center
align-items center
.image
background-image url('https://static.airbob.org/under-graduate/campus-card/position.png')
background-size contain
background-repeat no-repeat
background-position center
width 50rpx
height 50rpx
margin-right 30rpx
.arrow
margin-left 10rpx
background-image url('https://static.airbob.org/under-graduate/campus-card/arrow-right.png')
background-size contain
background-repeat no-repeat
background-position center
width 25rpx
height 25rpx
.dorm
height 50rpx
line-height 50rpx
color #fff
font-size 34rpx
font-family PingFangSC-Medium
.remain-electricity
display flex
flex-direction column
justify-content space-between
align-items center
color #fff
height 152rpx
.title
font-family PingFangSC-Regular
font-size 28rpx
.remains
font-family PingFangSC-Medium
font-size 80rpx
.main-container
margin 50rpx 35rpx 0 35rpx
font-family PingFangSC-Regular
.pay-account
font-family PingFangSC-Medium
color #353535
height 45rpx
line-height 45rpx
font-size 32rpx
.pay-way
font-size 24rpx
margin-top 9rpx
height 33rpx
line-height 33rpx
color #888888
.quick-pay-container
display flex
justify-content space-between
margin-top 50rpx
.quick-pay-item
height 100rpx
width 150rpx
border-radius 10rpx
border 1rpx solid #47cff5
color #47cff5
font-family PingFangSC-Medium
font-size 36rpx
line-height 100rpx
text-align center
&:hover
background-color #47cff5
color #fff
.list
margin-top 60rpx
font-size 30rpx
color #353535
font-family PingFangSC-Regular
position relative
.arrow
position absolute
right 0
top 21rpx
background-image url('https://static.airbob.org/under-graduate/button_right.png')
background-size contain
background-repeat no-repeat
background-position center
width 30rpx
height 30rpx
.list-item
display flex
align-items center
position relative
.why
position absolute
width 30rpx
border-radius 50%
top 21rpx
left 167rpx
& + .list-item
border-top 2rpx solid #E3E3E3
.list-item-text
margin 0rpx 0 15rpx 0
&:first-of-type
margin-left 34rpx
margin-right 100rpx
.list-item-quick
display flex
align-items center
border-bottom 2rpx solid #E3E3E3
.money-list
display flex
align-items center
.money-item
border-radius 60rpx
width 93rpx
height 45rpx
line-height 45rpx
color #47CFF5
text-align center
border 2rpx solid #47CFF5
margin-right 30rpx
.input
z-index auto
.list-item-text
display flex
margin 15rpx 0
&.item
width 177rpx
&.input
width 500rpx
&:first-of-type
color #353535
.button-container
display flex
justify-content space-between
.get-query-elec
background #F3A930
border-radius 100rpx
width 32%
height 85rpx
line-height 85rpx
color rgb(255, 255, 255)
margin-top 60rpx
.enter-button
background #47cff5
border-radius 100rpx
width 62%
height 85rpx
line-height 85rpx
color rgb(255, 255, 255)
margin-top 60rpx
&:after
border 0
.button-click
background-image none
background-color #D0F5FF
</style>
================================================
FILE: src/campus-card-page/pages/money-log.wpy
================================================
<template>
<BaseContainer navTitle="金额操作记录">
<view slot="qy-content">
<view class="container">
<view class="header-tip">
<view class="image-container"></view>
<view class="tip-font">
肖辰旭提示你:此表格只代表在小程序端的操作记录,不一定表示交易成功哦~
</view>
</view>
<scroll-view scroll-x style="position:relative;width:750rpx;">
<view class="main-container">
<view class="main-container-header">
<view class="header-item">项目</view>
<view class="header-item">金额</view>
<view class="header-item">时间</view>
<view class="header-item">备注</view>
</view>
<view class="main-container-item" wx:for="{{records}}" wx:key="index" wx:index="index">
<view class="main-item">{{item.type}}</view>
<view class="main-item">{{item.money / 100}} 元</view>
<view class="main-item">{{item.time}}</view>
<view class="main-item longer">{{item.extra || '无'}}</view>
</view>
</view>
</scroll-view>
<view class="rectangle"></view>
</view>
</view>
</BaseContainer>
</template>
<script>
import wepy from "wepy";
import { getMoneyLog } from "@/api/campusCard";
import { mockGetMoneyLog } from "@/mock/campusCard";
import BaseContainer from "@/components/baseContainer";
export default class MoneyLog extends wepy.page {
data = {
records: [],
pageNumber: 1,
visitorModeStatus: false
};
components = {
BaseContainer
};
config = {
navigationBarTitleText: "金额操作记录"
};
async getData(pageNum) {
const { data } = !this.visitorModeStatus
? await getMoneyLog(pageNum, 30)
: await mockGetMoneyLog();
const result = data.data;
result.map(item => {
const time = new Date(item.createTime);
return (item.time =
time.getFullYear() +
"." +
Number(time.getMonth() + 1) +
"." +
time.getDate());
});
this.records.push(...result);
this.$apply();
}
async onLoad() {
this.visitorModeStatus = this.$com.BaseContainer.visitorModeStatus;
await this.getData(1);
}
async onReachBottom() {
if (!this.visitorModeStatus) {
await this.getData(++this.pageNumber);
}
}
}
</script>
<style lang="stylus" scoped>
.container
min-height 100vh
margin 0 0 0 26rpx
width 724rpx
position absolute
.rectangle
position absolute
top 186rpx
width 108rpx
right 0
height calc(100% - 170rpx)
background-image linear-gradient(90deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.98) 100%)
.header-tip
display flex
font-family PingFangSC-Regular
font-size 24rpx
color #888888
margin-bottom 16rpx
width calc(100% - 52rpx)
.image-container
width 46rpx
height 46rpx
background-size contain
background-repeat no-repeat
background-image url('https://static.airbob.org/under-graduate/campus-card/notice%21@2x.png')
.main-container
min-width 1000rpx
.main-container-header
background #6BDEC9
display flex
align-items center
height 96rpx
border-radius 6rpx
.header-item
font-family PingFangSC-Medium
font-size 32rpx
padding-left 23rpx
width 185rpx
color #ffffff
.main-container-item
position relative
display flex
font-family PingFangSC-Regular
font-size 32rpx
height 98rpx
align-items center
color #353535
border-bottom 1px solid #D7D7D7
.main-item
overflow hidden
padding-left 23rpx
width 185rpx
.longer
flex 1
width 100%
</style>
================================================
FILE: src/campus-card-page/pages/net-charge.wpy
================================================
<template>
<BaseContainer navTitle="校园网充值">
<view slot="qy-content">
<view class="container">
<view class="head-bg">
<view class="head-bg-title">账户余额(元)</view>
<view class="head-bg-remain">{{balance}}</view>
</view>
<view class="main-container">
<view class="pay-account">充值账号:{{sno}}</view>
<view class="pay-way">支付方式:银行卡绑定校园卡</view>
<view class="quick-pay-container">
<view class="quick-pay-item" @tap.stop="fastPay" data-charge="5">5元</view>
<view class="quick-pay-item" @tap.stop="fastPay" data-charge="10">10元</view>
<view class="quick-pay-item" @tap.stop="fastPay" data-charge="20">20元</view>
<view class="quick-pay-item" @tap.stop="fastPay" data-charge="30">30元</view>
</view>
<view class="list">
<view class="list-item-quick">
<view class="list-item-text item">充值金额</view>
<input
class="list-item-text input"
type="digit"
@input="put"
value="{{charge}}"
placeholder="可输入1-300元整数金额"
placeholder-style="font-size:30rpx;color:#888888"
cursor-spacing="130"
/>
</view>
</view>
<button
@tap.stop="openPayModal"
class="enter-button {{(charge==='' || charge === 'NAN' || charge === NAN || !charge) ? 'button-click' : ''}}"
hover-class="button-click"
disabled="{{(charge==='' || charge === 'NAN' || charge === NAN || !charge)?true:false}}"
>确认充值{{(charge && charge !== '') ? ' ¥' + charge : ''}}</button>
</view>
<PayFlow
:open.sync="isPayModalOpen"
:charge.sync="charge"
type="net"
payWay="银行卡绑定校园卡"
operateContent="校园卡/银行卡转账"
/>
</view>
</view>
</BaseContainer>
</template>
<script>
import wepy from "wepy";
import PayFlow from "../components/pay-flow";
import JudgeStatus from "@/mixins/module";
import { internetRemain } from "@/api/campusCard";
import { mockInternetRemain } from "@/mock/campusCard";
import BaseContainer from "@/components/baseContainer";
export default class NetCharge extends wepy.page {
data = {
balance: "0.00",
charge: "",
isPayModalOpen: false,
sno: "",
visitorModeStatus: false
};
config = {
navigationBarTitleText: "校园网充值",
enablePullDownRefresh: true
};
components = {
PayFlow,
BaseContainer
};
mixins = [JudgeStatus];
onLoad(op) {
this.visitorModeStatus = this.$com.BaseContainer.visitorModeStatus;
if (this.visitorModeStatus) {
this.getRemain();
} else {
const moduleStatus = wepy.getStorageSync("moduleStatus")[0].open;
if (!moduleStatus) {
// 一卡通维护中
wepy.redirectTo({
url: "../../others-page/pages/close"
});
}
this.judgeStatus(op.name).then(() => {
this.getRemain();
});
}
}
onShow() {
this.getRemain();
}
onPullDownRefresh() {
this.getRemain();
wepy.stopPullDownRefresh();
wepy.showToast({
title: "刷新成功",
icon: "success",
duration: 1000
});
}
judgeRemain() {
return this.visitorModeStatus ? mockInternetRemain() : internetRemain();
}
getRemain() {
this.judgeRemain().then(res => {
if (res.data) {
this.balance = res.data.data / 100;
this.sno = wepy.getStorageSync("sno");
this.$apply();
}
});
}
openCheckModal() {
return wepy.showModal({
title: "金额确认",
content: `确定充值 ¥${this.charge} 到网费中吗?`,
showCancel: true,
cancelText: "否",
cancelColor: "#FF0000",
confirmText: "是",
confirmColor: "#3CC51F"
});
}
methods = {
closePayModal() {
this.isPayModalOpen = false;
},
put(e) {
const value = Number(e.detail.value);
this.putCharge(value);
},
fastPay(e) {
const value = Number(e.target.dataset.charge);
this.putCharge(value);
this.openPayModal();
},
async openPayModal() {
if (this.visitorModeStatus) {
this.charge = "";
return this.$invoke("BaseContainer", "showVisitorTips");
}
if (this.charge > 0) {
if (this.charge > 30) {
const res = await this.openCheckModal();
if (res.confirm) {
this.isPayModalOpen = true;
this.$apply();
}
} else {
this.isPayModalOpen = true;
}
} else {
wepy
.showModal({
content: "金额错误",
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
})
.then(res => {
this.charge = "";
});
}
}
};
events = {
closePayModal: () => {
this.isPayModalOpen = false;
this.$apply();
}
};
async openPayModal() {
if (this.visitorModeStatus) {
this.charge = "";
return this.$invoke("BaseContainer", "showVisitorTips");
}
if (this.charge > 0) {
if (this.charge > 30) {
const res = await this.openCheckModal();
if (res.confirm) {
this.isPayModalOpen = true;
this.$apply();
}
} else {
this.isPayModalOpen = true;
}
} else {
wepy
.showModal({
content: "金额错误",
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
})
.then(res => {
this.charge = "";
});
}
}
putCharge(number) {
this.charge = number;
}
}
</script>
<style lang="stylus" scoped>
.container
display flex
flex-direction column
margin-top 38rpx
.head-bg
background-image url('https://static.airbob.org/under-graduate/campus-card/net.png')
width 100%
height 243rpx
background-size cover
margin 0 auto
display flex
flex-direction column
text-align center
color #fff
.head-bg-title
margin-top 45rpx
height 40rpx
line-height 40rpx
font-size 28rpx
font-family PingFangSC-Regular
.head-bg-remain
font-size 80rpx
font-family PingFangSC-Medium
height 112rpx
line-height 112rpx
.main-container
margin 50rpx 35rpx 0 35rpx
font-family PingFangSC-Regular
.pay-account
font-family PingFangSC-Medium
color #353535
height 45rpx
line-height 45rpx
font-size 32rpx
.pay-way
font-size 24rpx
margin-top 9rpx
height 33rpx
line-height 33rpx
color #888888
.quick-pay-container
display flex
justify-content space-between
margin-top 50rpx
.quick-pay-item
height 100rpx
width 150rpx
border-radius 10rpx
border 1rpx solid #47cff5
color #47cff5
font-family PingFangSC-Medium
font-size 36rpx
line-height 100rpx
text-align center
&:hover
background-color #47cff5
color #fff
.list
margin-top 60rpx
font-size 30rpx
color #353535
font-family PingFangSC-Regular
.list-item
display flex
align-items center
position relative
.why
position absolute
width 30rpx
border-radius 50%
top 21rpx
left 167rpx
& + .list-item
border-top 2rpx solid #E3E3E3
.list-item-text
margin 0rpx 0 15rpx 0
&:first-of-type
margin-left 34rpx
margin-right 100rpx
.list-item-quick
display flex
align-items center
border-bottom 2rpx solid #E3E3E3
.money-list
display flex
align-items center
.money-item
border-radius 60rpx
width 93rpx
height 45rpx
line-height 45rpx
color #47CFF5
text-align center
border 2rpx solid #47CFF5
margin-right 30rpx
.input
z-index auto
.list-item-text
display flex
margin 15rpx 0
&.item
width 177rpx
&.input
width 500rpx
&:first-of-type
color #353535
.enter-button
background #47cff5
border-radius 100rpx
width 100%
height 85rpx
line-height 85rpx
color rgb(255, 255, 255)
margin-top 60rpx
&:after
border 0
.button-click
background-image none
background-color #D0F5FF
</style>
================================================
FILE: src/campus-card-page/pages/select-room.wpy
================================================
<template>
<BaseContainer navTitle="管理宿舍地址">
<view slot="qy-content">
<view class="container">
<view wx:if="{{rooms.length === 0}}" class="not-used">你还没充过电费呢~</view>
<view wx:else class="room-container">
<view class="room-item-container" wx:for="{{rooms}}" index="index" item="item" wx:key="index">
<view class="room-item">
<view class="room-name-container">
<view
class="room-name"
>{{item.campusName}}校区 {{item.areaName}} {{item.buildingName}} {{item.bigRoom}}{{item.smallRoom ? '-' + item.smallRoom : ''}}</view>
<view class="use-once" @tap="useOnce({{index}})">本次使用</view>
</view>
<view class="opera-container">
<view class="opera-default-container" @tap="changeDefult({{index}})">
<view
class="opera-default"
style="background-image:url({{item.default ? 'https://static.airbob.org/under-graduate/btn_circle_hightlight.png' : 'https://static.airbob.org/under-graduate/btn_circle_disable.png'}})"
></view>
<span>设为默认</span>
</view>
<view class="opera">
<view
class="opera-item"
@tap="edit({{item}},{{index}})"
style="background-image:url('https://static.airbob.org/under-graduate/edit.png');"
></view>
<view
class="opera-item"
@tap="Delete({{index}})"
style="background-image:url('https://static.airbob.org/under-graduate/campus-card/delete.png');"
></view>
</view>
</view>
</view>
<view class="divide"></view>
</view>
</view>
<view class="rectangle" @tap="addNewAddress">+ 添加新地址</view>
</view>
</view>
</BaseContainer>
</template>
<script>
import wepy from "wepy";
import { changeDefaultDorm } from "@/api/common";
import BaseContainer from "@/components/baseContainer";
export default class selectRoom extends wepy.page {
data = {
rooms: []
};
components = {
BaseContainer
};
onShow() {
this.rooms = wepy.getStorageSync("selectRoom")
? wepy.getStorageSync("selectRoom")
: [];
if (this.rooms.length === 1) {
this.rooms[0].default = true;
wepy.setStorageSync("selectRoom", this.rooms);
}
}
methods = {
addNewAddress() {
this.$navigate({
url: "./add-room"
});
},
async changeDefult(index) {
wepy.showLoading();
let changeRoom = {};
const rowDefaultRoom = this.rooms.find(room => room.default);
Object.entries(rowDefaultRoom).forEach(([key, value]) => {
if (
["campus", "areaName", "buildingId", "bigRoom", "smallRoom"].includes(
key
)
) {
if (rowDefaultRoom[key] !== this.rooms[index][key]) {
if (key === "campus") {
changeRoom[key] = this.rooms[index][key] === 0 ? "XL" : "SPL";
} else {
changeRoom[key] = this.rooms[index][key];
}
}
}
});
if (Object.keys(changeRoom).length) {
const { studentId } =
wepy.getStorageSync("userInfo") || wepy.getStorageSync("User");
console.log(changeRoom);
const {
data: { data, success }
} = await changeDefaultDorm(changeRoom, studentId);
wepy.hideLoading();
if (success && data) {
this.rooms.forEach(item => {
item.default = false;
});
this.rooms[index].default = true;
wepy.setStorageSync("selectRoom", this.rooms);
this.methods.useOnce(index);
} else {
wepy.showToast({
title: "不知道为什么失败了呢~",
icon: "none",
duration: 2000
});
}
} else {
this.methods.useOnce(index);
}
},
Delete(index) {
this.rooms.splice(index, 1);
wepy.setStorageSync("selectRoom", this.rooms);
},
useOnce(index) {
const page = getCurrentPages();
const prevPage = page[page.length - 2];
prevPage.data.useOnce = index;
wepy.navigateBack({
delta: 1
});
},
edit(item, index) {
this.$navigate({
url: `./add-room?item=${JSON.stringify(item)}&&index=${index}`
});
}
};
}
</script>
<style lang="stylus" scoped>
.container
// position relative
// min-height 100vh
font-family PingFangSC-Regular
font-size 32rpx
.room-container
.room-item-container
padding 20rpx 0 0 0
height 170rpx
font-family PingFangSC-Regular
color #353535
.room-item
padding 0 0 20rpx 0
margin 0 20rpx 0 20rpx
.room-name-container
display flex
height 97rpx
font-size 30rpx
.room-name
width 550rpx
.use-once
color #47cff5
border-radius 50rpx
width 150rpx
height 50rpx
line-height 50rpx
text-align center
font-size 28rpx
border 1rpx solid #47cff5
.opera-container
font-size 24rpx
height 33rpx
line-height 33rpx
display flex
.opera-default-container
width 550rpx
display flex
.opera-default
height 33rpx
width 33rpx
margin-right 10rpx
background-repeat no-repeat
background-size contain
background-position center
.opera
width 110rpx
margin 0 20rpx
display flex
justify-content space-between
.opera-item
height 33rpx
width 33rpx
background-repeat no-repeat
background-size contain
background-position center
.not-used
position fixed
color #9b9b9b
height 100vh
width 100vw
line-height 100vh
text-align center
.rectangle
position absolute
bottom 24rpx
width 90%
left 5%
height 85rpx
line-height 85rpx
text-align center
color #fff
background-color #47cff5
border-radius 50rpx
.divide
width 750rpx
height 20rpx
background-color #f5f5f5
</style>
================================================
FILE: src/components/baseContainer.wpy
================================================
<template>
<view>
<view wx:if="{{navStatus}}">
<QyNavigation :title.sync="navTitle" :background.sync="background"></QyNavigation>
</view>
<QyModal :maskClosable="maskClosable" width="500rpx" :visible.sync="passwordModelStatus">
<view slot="content" class="bind-container">
<input
class="bind-input"
placeholder="{{passwordModelOptions.passwordModelProps ? placeholder:''}}"
password="true"
@input="passwordInput"
placeholder-style="color: #999CA0"
>
<button class="bind-button" @tap.stop="bindPassword" hover-class="button-click">立即绑定</button>
</view>
</QyModal>
<QyModalGraduate width="500rpx" :visible.sync="graduateModalStatus">
<view slot="content" class="bind-graduate-container">
<view class="graduate-content">
<view class="content-detail">
<view>亲爱的{{name}},</view>
<view>你已经离开南邮{{leaveDate}}天,</view>
<view>你所请求的数据</view>
<view>已经无法再次被刷新。</view>
</view>
<view class="content-detail">
<view>记忆可以保留,</view>
<view>青春无法再来。</view>
</view>
<view>祝好。</view>
</view>
<button class="bind-button" @tap.stop="closeGraduateModel" hover-class="button-click">知道了</button>
</view>
</QyModalGraduate>
<view>
<slot name="qy-content"></slot>
</view>
</view>
</template>
<script>
import wepy from "wepy";
import QyNavigation from "./qy-navigation";
import QyModal from "./qy-modal";
import QyModalGraduate from "./qy-modal";
import { changeSecretCode, changeSecretCodeLower } from "@/api/common";
import { getGraduateTime } from "@/api/graduateMode";
import { connect } from "wepy-redux";
@connect({
graduateModalStatus(state) {
return state.graduateReducer.graduateModalStatus;
},
visitorModeStatus(state) {
return state.visitorReducer.visitorModeStatus;
}
})
export default class BaseContainer extends wepy.component {
components = {
QyNavigation,
QyModal,
QyModalGraduate
};
data = {
password: "",
name: "",
graduateModelStatus: false,
passwordModelStatus: false,
placeholder: "",
navStatus: true,
leaveDate: parseInt((Date.now() - 1560960000000) / 86400000)
};
props = {
navTitle: {
type: String,
default: "NJUPT"
},
openPage: {
type: Boolean,
default: true
},
background: {
type: String,
default: "#fff"
},
passwordModelOptions: {
type: Object,
twoWay: true,
default: {
passwordModelProps: false,
placeholder: "",
bindInfo: { username: "", domainType: "" },
checkPassword: function() {
return null;
},
checkErrMsg: "",
refreshData: function() {
return null;
}
}
}
};
watch = {
passwordModelOptions(next) {
const { passwordModelProps } = next;
this.passwordModelStatus = passwordModelProps;
this.$apply();
},
openPage(next) {
this.navStatus = !next;
this.$apply();
},
// modal 显示的时候再接数据
graduateModalStatus(next) {
if (next) {
this.calcGraduateTime();
}
}
};
methods = {
passwordInput({ detail: { value } }) {
this.password = value;
},
closeGraduateModel() {
wepy.$store.dispatch({ type: `HIDE_GRADUATE_MODAL` });
wepy.navigateBack();
this.graduateModelStatus = false;
},
bindPassword() {
const {
bindInfo: { username, domainType },
checkPassword,
checkErrMsg
} = this.passwordModelOptions;
const bindPasswordInfo = [username, this.password, domainType];
if (checkPassword) {
if (checkPassword(this.password)) {
this.updatePasswordRequest(bindPasswordInfo);
} else {
wepy.showModal({
content: checkErrMsg,
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
});
}
} else {
this.updatePasswordRequest(bindPasswordInfo);
}
}
};
async updatePasswordRequest(bindPasswordInfo) {
wepy.showLoading({
title: "正在更新密码",
mask: true,
success: res => {}
});
const secretInfo = await changeSecretCode.apply(this, bindPasswordInfo);
wepy.hideLoading();
if (secretInfo.data && secretInfo.data.data) {
this.closePasswordModel();
} else {
wepy.showModal({
content: "密码错误",
confirmText: "知道了",
showCancel: false,
confirmColor: "#353535"
});
}
}
closePasswordModel() {
this.passwordModelStatus = false;
this.placeholder = "";
this.passwordModelOptions.refreshData();
this.$apply();
}
getCurrentPage() {
const pages = getCurrentPages();
const pageLength = pages.length;
return pageLength ? pages[pageLength - 1].route : null;
}
goBack() {
// 离开页面的打点
wepy.navigateBack();
}
async calcGraduateTime() {
const {
data: { data }
} = await getGraduateTime();
const date = new Date(data);
this.leaveDate = `${date.getFullYear()}-${date.getMonth() +
1}-${date.getDate()}`;
}
showVisitorTips() {
return wepy.showModal({
title: "小贴士",
content: "游客模式下无法使用哦~",
confirmColor: "#47CFF5",
showCancel: false,
confirmText: "知道了"
});
}
onLoad() {
const { placeholder } = this.passwordMo
gitextract_xiig83cc/ ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .github/ │ └── ISSUE_TEMPLATE/ │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .prettierrc ├── CHANGELOG.md ├── LICENSE ├── README-zh_CN.md ├── README.md ├── package.json ├── src/ │ ├── app.wpy │ ├── campus-card-page/ │ │ ├── components/ │ │ │ ├── consumption-detail-card.wpy │ │ │ ├── pay-flow.wpy │ │ │ ├── pwdfield.wpy │ │ │ └── wxcharts-min.js │ │ └── pages/ │ │ ├── add-room.wpy │ │ ├── campus-card-charge.wpy │ │ ├── campus-card-index.wpy │ │ ├── campus-card-loss.wpy │ │ ├── campus-card-lossPage.wpy │ │ ├── consumption-detail.wpy │ │ ├── electric-charge.wpy │ │ ├── money-log.wpy │ │ ├── net-charge.wpy │ │ └── select-room.wpy │ ├── components/ │ │ ├── baseContainer.wpy │ │ ├── qy-container.wpy │ │ ├── qy-datetime-select.wpy │ │ ├── qy-input.wpy │ │ ├── qy-listitem.wpy │ │ ├── qy-modal.wpy │ │ ├── qy-navigation.wpy │ │ ├── qy-popup.wpy │ │ ├── qy-swiper.wpy │ │ └── qy-tip.wpy │ ├── css/ │ │ ├── global-style.styl │ │ ├── loading.styl │ │ ├── normal-input.styl │ │ └── search-input.styl │ ├── edu-admin-page/ │ │ ├── components/ │ │ │ ├── card.wpy │ │ │ ├── grade-card.wpy │ │ │ └── subject-card.wpy │ │ └── pages/ │ │ ├── check-grade.wpy │ │ ├── course.wpy │ │ ├── credit.wpy │ │ ├── cut-down.wpy │ │ ├── score-inquire.wpy │ │ ├── search-course.wpy │ │ └── supplement-and-tutorials.wpy │ ├── mixins/ │ │ ├── Gpa/ │ │ │ ├── Gpa.js │ │ │ └── utils.js │ │ ├── all-search-thing.js │ │ ├── class.js │ │ ├── get-div-info.js │ │ ├── module.js │ │ └── test.js │ ├── mock/ │ │ ├── campusCard.js │ │ ├── common.js │ │ ├── education.js │ │ ├── index.js │ │ ├── library.js │ │ └── notification.js │ ├── others-edu-page/ │ │ ├── components/ │ │ │ ├── GpaCard.wpy │ │ │ ├── GpaCustomScore.wpy │ │ │ └── pe-card.wpy │ │ ├── graduatePages/ │ │ │ ├── clear-memory.wpy │ │ │ ├── index.wpy │ │ │ ├── memory-choose.wpy │ │ │ ├── memory-mode.wpy │ │ │ └── say-goodbye.wpy │ │ └── pages/ │ │ ├── GpaCalculator.wpy │ │ ├── calendar.wpy │ │ └── pe-score.wpy │ ├── others-page/ │ │ ├── components/ │ │ │ ├── bus-card.wpy │ │ │ ├── changeLogItem.wpy │ │ │ ├── information-card.wpy │ │ │ └── seats-card.wpy │ │ ├── mixins/ │ │ │ ├── all-search-thing.js │ │ │ └── page-jump.js │ │ ├── pages/ │ │ │ ├── advertisement.wpy │ │ │ ├── associationPages/ │ │ │ │ ├── association-detail.wpy │ │ │ │ ├── association-register.wpy │ │ │ │ ├── association.wpy │ │ │ │ ├── club-personal.wpy │ │ │ │ └── register-success.wpy │ │ │ ├── auth.wpy │ │ │ ├── close.wpy │ │ │ ├── display-webview.wpy │ │ │ ├── feedbackPages/ │ │ │ │ ├── feedback.wpy │ │ │ │ ├── historyfeedback.wpy │ │ │ │ └── myfeedback.wpy │ │ │ ├── information-box.wpy │ │ │ ├── libraryPages/ │ │ │ │ ├── library-history.wpy │ │ │ │ ├── library-recommened.wpy │ │ │ │ └── library.wpy │ │ │ ├── login.wpy │ │ │ ├── more.wpy │ │ │ ├── news.wpy │ │ │ ├── nicpPages/ │ │ │ │ ├── nicp-check-in.wpy │ │ │ │ ├── nicp-more.wpy │ │ │ │ └── nicp-vote.wpy │ │ │ ├── personalPages/ │ │ │ │ ├── aboutus.wpy │ │ │ │ ├── change-password.wpy │ │ │ │ ├── change-phone.wpy │ │ │ │ ├── changelog.wpy │ │ │ │ └── protocol.wpy │ │ │ ├── questionnairePages/ │ │ │ │ ├── questionnaire-homepage.wpy │ │ │ │ └── questionnaire.wpy │ │ │ ├── run.wpy │ │ │ ├── school-bus.wpy │ │ │ ├── search.wpy │ │ │ └── tuition.wpy │ │ └── wxs/ │ │ └── filter.wxs │ ├── pages/ │ │ ├── index.wpy │ │ ├── news-list.wpy │ │ └── profile.wpy │ ├── store/ │ │ ├── actions/ │ │ │ └── index.js │ │ ├── index.js │ │ ├── reducers/ │ │ │ ├── graduate.js │ │ │ ├── index.js │ │ │ └── visitor-mode.js │ │ └── types/ │ │ ├── graduate.js │ │ └── visitor-mode.js │ └── utils/ │ └── Crypto.js └── wepy.config.js
SYMBOL INDEX (101 symbols across 15 files)
FILE: src/campus-card-page/components/wxcharts-min.js
function assign (line 1) | function assign(t,e){if(null==t)throw new TypeError("Cannot convert unde...
function findRange (line 1) | function findRange(t,e,i){if(isNaN(t))throw new Error("[wxCharts] unvali...
function calValidDistance (line 1) | function calValidDistance(t,e,i,a){var n=a.width-i.padding-e.xAxisPoints...
function isInAngleRange (line 1) | function isInAngleRange(t,e,i){function a(t){for(;t<0;)t+=2*Math.PI;for(...
function calRotateTranslate (line 1) | function calRotateTranslate(t,e,i){var a=t,n=i-e,o=a+(i-n-a)/Math.sqrt(2...
function createCurveControlPoints (line 1) | function createCurveControlPoints(t,e){function i(t,e){return!(!t[e-1]||...
function convertCoordinateOrigin (line 1) | function convertCoordinateOrigin(t,e,i){return{x:i.x+t,y:i.y-e}}
function avoidCollision (line 1) | function avoidCollision(t,e){if(e)for(;util.isCollision(t,e);)t.start.x>...
function fillSeriesColor (line 1) | function fillSeriesColor(t,e){var i=0;return t.map(function(t){return t....
function getDataRange (line 1) | function getDataRange(t,e){var i=0,a=e-t;return i=a>=1e4?1e3:a>=1e3?100:...
function measureText (line 1) | function measureText(t){var e=arguments.length>1&&void 0!==arguments[1]?...
function dataCombine (line 1) | function dataCombine(t){return t.reduce(function(t,e){return(t.data?t.da...
function getSeriesDataItem (line 1) | function getSeriesDataItem(t,e){var i=[];return t.forEach(function(t){if...
function getMaxTextListLength (line 1) | function getMaxTextListLength(t){var e=t.map(function(t){return measureT...
function getRadarCoordinateSeries (line 1) | function getRadarCoordinateSeries(t){for(var e=2*Math.PI/t,i=[],a=0;a<t;...
function getToolTipData (line 1) | function getToolTipData(t,e,i,a){var n=arguments.length>4&&void 0!==argu...
function findCurrentIndex (line 1) | function findCurrentIndex(t,e,i,a){var n=arguments.length>4&&void 0!==ar...
function isInExactChartArea (line 1) | function isInExactChartArea(t,e,i){return t.x<e.width-i.padding&&t.x>i.p...
function findRadarChartCurrentIndex (line 1) | function findRadarChartCurrentIndex(t,e,i){var a=2*Math.PI/i,n=-1;if(isI...
function findPieChartCurrentIndex (line 1) | function findPieChartCurrentIndex(t,e){var i=-1;if(isInExactPieChartArea...
function isInExactPieChartArea (line 1) | function isInExactPieChartArea(t,e,i){return Math.pow(t.x-e.x,2)+Math.po...
function splitPoints (line 1) | function splitPoints(t){var e=[],i=[];return t.forEach(function(t,a){nul...
function calLegendData (line 1) | function calLegendData(t,e,i){if(!1===e.legend)return{legendList:[],lege...
function calCategoriesData (line 1) | function calCategoriesData(t,e,i){var a={angle:0,xAxisHeight:i.xAxisHeig...
function getRadarDataPoints (line 1) | function getRadarDataPoints(t,e,i,a,n){var o=arguments.length>5&&void 0!...
function getPieDataPoints (line 1) | function getPieDataPoints(t){var e=arguments.length>1&&void 0!==argument...
function getPieTextMaxLength (line 1) | function getPieTextMaxLength(t){t=getPieDataPoints(t);var e=0;return t.f...
function fixColumeData (line 1) | function fixColumeData(t,e,i,a,n,o){return t.map(function(t){return null...
function getXAxisPoints (line 1) | function getXAxisPoints(t,e,i){var a=i.yAxisWidth+i.yAxisTitleWidth,n=e....
function getDataPoints (line 1) | function getDataPoints(t,e,i,a,n,o,r){var s=arguments.length>7&&void 0!=...
function getYAxisTextList (line 1) | function getYAxisTextList(t,e,i){var a=dataCombine(t);a=a.filter(functio...
function calYAxisData (line 1) | function calYAxisData(t,e,i){var a=getYAxisTextList(t,e,i),n=i.yAxisWidt...
function drawPointShape (line 1) | function drawPointShape(t,e,i,a){a.beginPath(),a.setStrokeStyle("#ffffff...
function drawRingTitle (line 1) | function drawRingTitle(t,e,i){var a=t.title.fontSize||e.titleFontSize,n=...
function drawPointText (line 1) | function drawPointText(t,e,i,a){var n=e.data;a.beginPath(),a.setFontSize...
function drawRadarLabel (line 1) | function drawRadarLabel(t,e,i,a,n,o){var r=a.extra.radar||{};e+=n.radarL...
function drawPieText (line 1) | function drawPieText(t,e,i,a,n,o){var r=n+i.pieChartLinePadding,s=(i.pie...
function drawToolTipSplitLine (line 1) | function drawToolTipSplitLine(t,e,i,a){var n=i.padding,o=e.height-i.padd...
function drawToolTip (line 1) | function drawToolTip(t,e,i,a,n){var o=!1;e=assign({x:0,y:0},e),e.y-=8;va...
function drawYAxisTitle (line 1) | function drawYAxisTitle(t,e,i,a){var n=i.xAxisHeight+(e.height-i.xAxisHe...
function drawColumnDataPoints (line 1) | function drawColumnDataPoints(t,e,i,a){var n=arguments.length>4&&void 0!...
function drawAreaDataPoints (line 1) | function drawAreaDataPoints(t,e,i,a){var n=arguments.length>4&&void 0!==...
function drawLineDataPoints (line 1) | function drawLineDataPoints(t,e,i,a){var n=arguments.length>4&&void 0!==...
function drawToolTipBridge (line 1) | function drawToolTipBridge(t,e,i,a){i.save(),t._scrollDistance_&&0!==t._...
function drawXAxis (line 1) | function drawXAxis(t,e,i,a){var n=getXAxisPoints(t,e,i),o=n.xAxisPoints,...
function drawYAxisGrid (line 1) | function drawYAxisGrid(t,e,i){for(var a=t.height-2*e.padding-e.xAxisHeig...
function drawYAxis (line 1) | function drawYAxis(t,e,i,a){if(!0!==e.yAxis.disabled){var n=calYAxisData...
function drawLegend (line 1) | function drawLegend(t,e,i,a){if(e.legend){var n=calLegendData(t,e,i),o=n...
function drawPieDataPoints (line 1) | function drawPieDataPoints(t,e,i,a){var n=arguments.length>4&&void 0!==a...
function drawRadarDataPoints (line 1) | function drawRadarDataPoints(t,e,i,a){var n=arguments.length>4&&void 0!=...
function drawCanvas (line 1) | function drawCanvas(t,e){e.draw()}
function Animation (line 1) | function Animation(t){this.isStop=!1,t.duration=void 0===t.duration?1e3:...
function drawCharts (line 1) | function drawCharts(t,e,i,a){var n=this,o=e.series,r=e.categories;o=fill...
function Event (line 1) | function Event(){this.events={}}
FILE: src/mixins/Gpa/Gpa.js
class GpaMixin (line 10) | class GpaMixin extends wepy.mixin {
method handleScores (line 15) | handleScores(scores) {
method handleModifyScore (line 46) | handleModifyScore(sumOfCreditMultiplyPoint, credits) {
method processScoreInput (line 51) | processScoreInput({ value: score }, type) {
method discardUnnecessaryChars (line 59) | discardUnnecessaryChars(value) {
method limitScore (line 63) | limitScore(score) {
method hasData (line 75) | hasData() {
FILE: src/mixins/all-search-thing.js
class allSearch (line 3) | class allSearch extends wepy.mixin {
method allSearchThing (line 4) | allSearchThing() {
FILE: src/mixins/class.js
class ClassMixin (line 3) | class ClassMixin extends wepy.mixin {
method getColor (line 4) | getColor(data) {
method getElementHeight (line 26) | getElementHeight(courseItem) {
method getElementTop (line 40) | getElementTop(courseItem) {
method getCourseItemAtSameTimeIndex (line 50) | getCourseItemAtSameTimeIndex(courseItem, courses) {
method handleCourses (line 68) | handleCourses(courses, chosenWeek, onlyShowThisWeek) {
FILE: src/mixins/get-div-info.js
class getDivInfoMixin (line 3) | class getDivInfoMixin extends wepy.mixin {
method getDivInfo (line 11) | getDivInfo(id) {
FILE: src/mixins/module.js
class module (line 3) | class module extends wepy.mixin {
method judgeStatus (line 4) | judgeStatus(name) {
FILE: src/mixins/test.js
class testMixin (line 3) | class testMixin extends wepy.mixin {}
FILE: src/others-page/mixins/all-search-thing.js
class allSearch (line 3) | class allSearch extends wepy.mixin {
method allSearchThing (line 4) | allSearchThing() {
FILE: src/others-page/mixins/page-jump.js
class allSearch (line 3) | class allSearch extends wepy.mixin {
method toAssociationHome (line 5) | toAssociationHome() {
FILE: src/store/index.js
function configStore (line 6) | function configStore() {
FILE: src/store/reducers/graduate.js
method [SHOW_GRADUATE_MODAL] (line 12) | [SHOW_GRADUATE_MODAL](state) {
method [HIDE_GRADUATE_MODAL] (line 18) | [HIDE_GRADUATE_MODAL](state) {
method [SET_GRADUATE_FALSE] (line 24) | [SET_GRADUATE_FALSE](state) {
method [JUDGE_MEMORY_MODE_STATUS] (line 30) | [JUDGE_MEMORY_MODE_STATUS](state, action) {
method [SET_ISGRADUTE] (line 36) | [SET_ISGRADUTE](state, action) {
FILE: src/store/reducers/visitor-mode.js
method [ENTER_VISITOR_MODE] (line 6) | [ENTER_VISITOR_MODE](state) {
method [EXIT_VISITOR_MODE] (line 12) | [EXIT_VISITOR_MODE](state) {
FILE: src/store/types/graduate.js
constant SHOW_GRADUATE_MODAL (line 1) | const SHOW_GRADUATE_MODAL = `SHOW_GRADUATE_MODAL`;
constant HIDE_GRADUATE_MODAL (line 3) | const HIDE_GRADUATE_MODAL = `HIDE_GRADUATE_MODAL`;
constant JUDGE_MEMORY_MODE_STATUS (line 5) | const JUDGE_MEMORY_MODE_STATUS = `JUDGE_MEMORY_MODE_STATUS`;
constant SET_GRADUATE_FALSE (line 7) | const SET_GRADUATE_FALSE = `SET_GRADUATE_FALSE`;
constant SET_ISGRADUTE (line 9) | const SET_ISGRADUTE = `SET_ISGRADUTE`;
FILE: src/store/types/visitor-mode.js
constant ENTER_VISITOR_MODE (line 1) | const ENTER_VISITOR_MODE = `ENTER_VISITOR_MODE`;
constant EXIT_VISITOR_MODE (line 3) | const EXIT_VISITOR_MODE = `EXIT_VISITOR_MODE`;
FILE: src/utils/Crypto.js
class Crypto (line 8) | class Crypto {
method constructor (line 9) | constructor(key, iv) {
method utf8Encode (line 14) | static utf8Encode(x) {
method random (line 18) | static random() {
method encrypt (line 25) | encrypt(data) {
method jsonEncrypt (line 31) | jsonEncrypt(data) {
method decrypt (line 40) | decrypt(data) {
method jsonDecrypt (line 46) | jsonDecrypt(data) {
Condensed preview — 127 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (930K chars).
[
{
"path": ".editorconfig",
"chars": 156,
"preview": "root = true\r\n\r\n[*]\r\ncharset = utf-8\r\nindent_style = space\r\nindent_size = 2\r\nend_of_line = lf\r\ninsert_final_newline = tru"
},
{
"path": ".eslintignore",
"chars": 50,
"preview": "/src/campus-card-page/components/wxcharts-min.js\r\n"
},
{
"path": ".eslintrc.js",
"chars": 923,
"preview": "module.exports = {\r\n root: true,\r\n parser: \"babel-eslint\",\r\n parserOptions: {\r\n sourceType: \"module\"\r\n },\r\n env:"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 704,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the b"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 595,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Is your fea"
},
{
"path": ".gitignore",
"chars": 90,
"preview": "dist/*\r\nnode_modules/*\r\nsrc/config/*\r\n.DS_Store\r\n.idea/*\r\n.vscode/*\r\n.wepycache\r\nsrc/api/*"
},
{
"path": ".prettierrc",
"chars": 168,
"preview": "{\r\n \"singleQuote\": false,\r\n \"semi\": true,\r\n \"overrides\": [\r\n {\r\n \"files\": \"*.wpy\",\r\n \"options\": {\r\n "
},
{
"path": "CHANGELOG.md",
"chars": 1403,
"preview": "### 3.4.6 (2018-12-25)\n\n- 添加电费余额查询\n\n### 3.4.5 (2018-12-22)\n\n- 添加 `wx.updateManager`\n\n### 3.4.4 (2018-12-21)\n\n- 添加金额操作记录页"
},
{
"path": "LICENSE",
"chars": 34455,
"preview": " GNU AFFERO GENERAL PUBLIC LICENSE\n Version 3, 19 November 2007\n\n Copyright (C)"
},
{
"path": "README-zh_CN.md",
"chars": 3981,
"preview": "## 南京邮电大学小程序\n\n[English](./README.md) | 简体中文\n\n### 介绍\n\n南京邮电大学小程序是由南京邮电大学青柚工作室开发,一款方便快捷,无需下载安装即可在微信客户端即开即用的 APP,有别于一般需要下载安装"
},
{
"path": "README.md",
"chars": 5945,
"preview": "## MiniProgram of Nanjing University of Posts and Telecommunications\n\nEnglish | [简体中文](./README-zh_CN.md)\n\n### Introduct"
},
{
"path": "package.json",
"chars": 2218,
"preview": "{\n \"name\": \"undergraduate\",\n \"version\": \"3.4.24\",\n \"description\": \"NJUPT wechat app for undergraduate students\",\n \"m"
},
{
"path": "src/app.wpy",
"chars": 7074,
"preview": "<style lang=\"stylus\">\n.container\n font-family -apple-system-font, Helvetica Neue, Helvetica, sans-serif\n</style>\n\n<scri"
},
{
"path": "src/campus-card-page/components/consumption-detail-card.wpy",
"chars": 1390,
"preview": "<template>\n <view class=\"card-container\">\n <view class=\"time\">{{occTime}}</view>\n <repeat for=\"{{list}}"
},
{
"path": "src/campus-card-page/components/pay-flow.wpy",
"chars": 11241,
"preview": "<template>\n <view class=\"mask-container\" hidden=\"{{!open}}\" animation=\"{{coverAnimation}}\">\n <view class=\"pay-contai"
},
{
"path": "src/campus-card-page/components/pwdfield.wpy",
"chars": 1848,
"preview": "<template>\n <view class=\"band-pwdfield\" style=\"border-color:{{color}};\">\n <input focus=\"{{focus}}\" type=\"number\" cla"
},
{
"path": "src/campus-card-page/components/wxcharts-min.js",
"chars": 30969,
"preview": "\"use strict\";function assign(t,e){if(null==t)throw new TypeError(\"Cannot convert undefined or null to object\");for(var i"
},
{
"path": "src/campus-card-page/pages/add-room.wpy",
"chars": 11010,
"preview": "<template>\n <BaseContainer :navTitle.sync=\"navigationBarTitleText\">\n <view slot=\"qy-content\">\n <view>\n <"
},
{
"path": "src/campus-card-page/pages/campus-card-charge.wpy",
"chars": 9134,
"preview": "<template>\n <BaseContainer navTitle=\"校园卡充值\">\n <view slot=\"qy-content\">\n <view class=\"container\">\n <view "
},
{
"path": "src/campus-card-page/pages/campus-card-index.wpy",
"chars": 14793,
"preview": "<template>\n <BaseContainer navTitle=\"一卡通\" placeholder=\"6位校园卡密码\" :passwordModelOptions.sync=\"passwordModelOptions\">\n "
},
{
"path": "src/campus-card-page/pages/campus-card-loss.wpy",
"chars": 2373,
"preview": "<template>\n <BaseContainer navTitle=\"校园卡挂失\">\n <view slot=\"qy-content\">\n <view class=\"container\">\n <image"
},
{
"path": "src/campus-card-page/pages/campus-card-lossPage.wpy",
"chars": 12232,
"preview": "<template>\n <BaseContainer navTitle=\"校园卡挂失\">\n <view slot=\"qy-content\">\n <view class=\"container\">\n <QyMod"
},
{
"path": "src/campus-card-page/pages/consumption-detail.wpy",
"chars": 3239,
"preview": "<template>\n <BaseContainer :navTitle=\"navTitle\">\n <view slot=\"qy-content\">\n <view class=\"container\">\n <v"
},
{
"path": "src/campus-card-page/pages/electric-charge.wpy",
"chars": 15743,
"preview": "<template>\n <BaseContainer navTitle=\"电费充值\">\n <view slot=\"qy-content\">\n <view class=\"container\">\n <view c"
},
{
"path": "src/campus-card-page/pages/money-log.wpy",
"chars": 3745,
"preview": "<template>\n <BaseContainer navTitle=\"金额操作记录\">\n <view slot=\"qy-content\">\n <view class=\"container\">\n <view"
},
{
"path": "src/campus-card-page/pages/net-charge.wpy",
"chars": 8621,
"preview": "<template>\n <BaseContainer navTitle=\"校园网充值\">\n <view slot=\"qy-content\">\n <view class=\"container\">\n <view "
},
{
"path": "src/campus-card-page/pages/select-room.wpy",
"chars": 6504,
"preview": "<template>\n <BaseContainer navTitle=\"管理宿舍地址\">\n <view slot=\"qy-content\">\n <view class=\"container\">\n <view"
},
{
"path": "src/components/baseContainer.wpy",
"chars": 6946,
"preview": "<template>\n <view>\n <view wx:if=\"{{navStatus}}\">\n <QyNavigation :title.sync=\"navTitle\" :background.sync=\"backgr"
},
{
"path": "src/components/qy-container.wpy",
"chars": 4587,
"preview": "<!--\n下拉刷新函数形如:\nonPullRefresh(stop) {\n return function() {\n setTimeout(() => {\n stop();\n }, 1000);\n };\n}\n原因是"
},
{
"path": "src/components/qy-datetime-select.wpy",
"chars": 2897,
"preview": "<template>\n\t<view class=\"picker-container input\" style=\"{{style}}\">\n\t\t<picker class=\"item\" mode=\"date\" value=\"{{date}}\" "
},
{
"path": "src/components/qy-input.wpy",
"chars": 2503,
"preview": "<!--\n-PlaceHolder 输入框的placeholder\n-Image 输入框的靠前的图片\n-putValue 输入框的值\n-inputType 输入框的input-type,默认number\n-verification 输入框靠"
},
{
"path": "src/components/qy-listitem.wpy",
"chars": 1188,
"preview": "<template>\n\t<view class=\"item-container\" @tap.stop=\"navigate\">\n\t\t<image class=\"iconx\" src=\"{{item.thumb}}\" mode=\"widthFi"
},
{
"path": "src/components/qy-modal.wpy",
"chars": 2796,
"preview": "<!-- closable 点击蒙层是否允许关闭\nwidth Modal宽度\nheight Modal高度\nzIndex\nvisible Modal是否可见。通过触发组件内的open 和 close方法切换\nbackgroundColor "
},
{
"path": "src/components/qy-navigation.wpy",
"chars": 3343,
"preview": "<!--\n- background 导航栏背景色\n- showBackBtn 强制显示回退按钮(除非是产生Bug的时候,不然不建议使用)\n- backBtnColor 回退按钮的颜色\n- title ios居中,android位于左边\n- "
},
{
"path": "src/components/qy-popup.wpy",
"chars": 1902,
"preview": "<template>\n <view\n class=\"pop-up-container\"\n style=\"{{ displayStatus && !openPage ? 'display:flex' : 'display:non"
},
{
"path": "src/components/qy-swiper.wpy",
"chars": 1968,
"preview": "<style lang=\"stylus\" scoped>\n.swiper-wrap {\n display: inline-block;\n width: 100vw;\n}\n.container {\n width: 750rpx;\n h"
},
{
"path": "src/components/qy-tip.wpy",
"chars": 1829,
"preview": "<!--\n- on 控制提示开关\n- LastTime 控制tips显示时间,单位毫秒\n-->\n<template>\n <view class=\"tips-container\" style=\"z-index:{{showIndex}}\">"
},
{
"path": "src/css/global-style.styl",
"chars": 418,
"preview": ".hide-page\r\n position fixed\r\n width 100%\r\n height 100%\r\n background rgba(0, 0, 0, 0.5)\r\n display flex\r\n justify-co"
},
{
"path": "src/css/loading.styl",
"chars": 1013,
"preview": ".boxLoading\r\n width 100rpx\r\n height 100rpx\r\n margin 0 auto\r\n position relative\r\n left 0\r\n right 0\r\n top 0\r\n bott"
},
{
"path": "src/css/normal-input.styl",
"chars": 221,
"preview": ".input\r\n\tborder-radius 30rpx\r\n\tbackground-color rgb(238, 238, 238)\r\n\twidth 545rpx\r\n\theight 72rpx\r\n\tpadding 0 30rpx\r\n\tbox"
},
{
"path": "src/css/search-input.styl",
"chars": 216,
"preview": ".search-input\r\n position relative\r\n z-index 0\r\n height 60rpx\r\n box-sizing border-box\r\n padding-left 60rpx\r\n backgr"
},
{
"path": "src/edu-admin-page/components/card.wpy",
"chars": 2064,
"preview": "<template>\r\n <view class=\"container\">\r\n <view class=\"head\" style=\"background-image:url({{bg}});\">\r\n <image clas"
},
{
"path": "src/edu-admin-page/components/grade-card.wpy",
"chars": 1803,
"preview": "<template>\n <view class=\"container\">\n <view class=\"head\" @tap.stop=\"toggleShow\">{{result.title}}</view>\n <view cl"
},
{
"path": "src/edu-admin-page/components/subject-card.wpy",
"chars": 5295,
"preview": "<template>\n\t<view class=\"container {{isFinished ?'finished-container':''}}\" style=\"{{isFinished&&!show?'height:86rpx;':'"
},
{
"path": "src/edu-admin-page/pages/check-grade.wpy",
"chars": 8041,
"preview": "<template>\n <BaseContainer navTitle=\"等级考试\">\n <view slot=\"qy-content\">\n <view class=\"container\">\n <view c"
},
{
"path": "src/edu-admin-page/pages/course.wpy",
"chars": 33804,
"preview": "<template>\n<BaseContainer :navTitle.sync=\"navTitle\" :passwordModelOptions.sync=\"passwordModelOptions\">\n <view slot=\"qy-"
},
{
"path": "src/edu-admin-page/pages/credit.wpy",
"chars": 7047,
"preview": "\n<template>\n <BaseContainer :navTitle=\"navTitle\">\n <view slot=\"qy-content\">\n <QyModal width=\"500rpx\">\n <"
},
{
"path": "src/edu-admin-page/pages/cut-down.wpy",
"chars": 21823,
"preview": "<template>\n <BaseContainer navTitle=\"考试倒计时\">\n <view slot=\"qy-content\">\n <view>\n <QyModal containerClass="
},
{
"path": "src/edu-admin-page/pages/score-inquire.wpy",
"chars": 16673,
"preview": "<template>\n <BaseContainer navTitle=\"成绩查询\" :passwordModelOptions.sync=\"passwordModelOptions\">\n <view slot=\"qy-conten"
},
{
"path": "src/edu-admin-page/pages/search-course.wpy",
"chars": 8489,
"preview": "<template>\n <view class=\"container\">\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <view class=\"search-bar\""
},
{
"path": "src/edu-admin-page/pages/supplement-and-tutorials.wpy",
"chars": 7716,
"preview": "<template>\n <BaseContainer navTitle=\"辅导课\">\n <view slot=\"qy-content\">\n <view>\n <view class=\"head\">\n "
},
{
"path": "src/mixins/Gpa/Gpa.js",
"chars": 1809,
"preview": "import wepy from \"wepy\";\nimport {\n sumCredits,\n termReducer,\n sumCreditMultiplyPoint,\n handleSum,\n handleTerm\n} fro"
},
{
"path": "src/mixins/Gpa/utils.js",
"chars": 3178,
"preview": "// 延迟计算\nconst curry = (fn, ...optionalArgs) => {\n const cache = [];\n return (...args) => {\n if (args.length === 0) "
},
{
"path": "src/mixins/all-search-thing.js",
"chars": 5997,
"preview": "import wepy from \"wepy\";\n\nexport default class allSearch extends wepy.mixin {\n allSearchThing() {\n const AllSearhes "
},
{
"path": "src/mixins/class.js",
"chars": 4148,
"preview": "import wepy from \"wepy\";\n\nexport default class ClassMixin extends wepy.mixin {\n getColor(data) {\n var all = data;\n "
},
{
"path": "src/mixins/get-div-info.js",
"chars": 917,
"preview": "import wepy from \"wepy\";\n\nexport default class getDivInfoMixin extends wepy.mixin {\n // id 为字符串\"#XXX\"形式\n // 调用方式:\n //"
},
{
"path": "src/mixins/module.js",
"chars": 555,
"preview": "import wepy from \"wepy\";\n\nexport default class module extends wepy.mixin {\n judgeStatus(name) {\n return new Promise("
},
{
"path": "src/mixins/test.js",
"chars": 79,
"preview": "import wepy from \"wepy\";\n\nexport default class testMixin extends wepy.mixin {}\n"
},
{
"path": "src/mock/campusCard.js",
"chars": 927,
"preview": "import { mockRequest as request } from \"@/api/request\";\nimport qs from \"qs\";\n\nexport const mockCampusCardRequestInfo = ("
},
{
"path": "src/mock/common.js",
"chars": 652,
"preview": "import { mockRequest as request } from \"@/api/request\";\n\nexport const mockGetUserPEGrade = (semester = \"1\") => {\n retur"
},
{
"path": "src/mock/education.js",
"chars": 777,
"preview": "import { mockRequest as request } from \"@/api/request\";\n\nexport const mockClassSchedule = () => {\n return request.get(\""
},
{
"path": "src/mock/index.js",
"chars": 63,
"preview": "import wepy from \"wepy\";\n\nconsole.log(wepy.$store.getState());\n"
},
{
"path": "src/mock/library.js",
"chars": 1097,
"preview": "import { mockRequest as request } from \"@/api/request\";\n\nexport const mockCheckBookHistory = () => {\n return request.ge"
},
{
"path": "src/mock/notification.js",
"chars": 342,
"preview": "import { mockRequest as request } from \"@/api/request\";\n\nexport const mockGetNotification = () => {\n return request.get"
},
{
"path": "src/others-edu-page/components/GpaCard.wpy",
"chars": 7568,
"preview": "<template lang=\"pug\">\nview.card\n view.header( @tap=\"toggleCardFolded\")\n text.title {{termScores.title}}\n image.an"
},
{
"path": "src/others-edu-page/components/GpaCustomScore.wpy",
"chars": 3325,
"preview": "<template lang=\"pug\">\nview.custom-score\n view.course-name-wrapper\n input( @input=\"handleCourseNameInput\" value=\"{{sc"
},
{
"path": "src/others-edu-page/components/pe-card.wpy",
"chars": 2043,
"preview": "<template>\n <view\n class=\"container\"\n style=\"background-color:{{titleBgColor}};\"\n @tap.stop=\"toggle\"\n data-"
},
{
"path": "src/others-edu-page/graduatePages/clear-memory.wpy",
"chars": 1914,
"preview": "<template>\n <view>\n <view class=\"background\">\n <view class=\"content\">\n <view class=\"content-text\">\n "
},
{
"path": "src/others-edu-page/graduatePages/index.wpy",
"chars": 1851,
"preview": "<template>\n <view>\n <view class=\"background\">\n <view class=\"content\">\n <view class=\"content-text\">\n "
},
{
"path": "src/others-edu-page/graduatePages/memory-choose.wpy",
"chars": 2250,
"preview": "<template>\n <view>\n <qy-navigation title=\"\" background=\"transparent\"></qy-navigation>\n <view class=\"background\">\n"
},
{
"path": "src/others-edu-page/graduatePages/memory-mode.wpy",
"chars": 1985,
"preview": "<template>\n <view>\n <view class=\"background\">\n <view class=\"content\">\n <view class=\"content-text\">\n "
},
{
"path": "src/others-edu-page/graduatePages/say-goodbye.wpy",
"chars": 1092,
"preview": "<template>\n <view>\n <view class=\"background\"></view>\n </view>\n</template>\n\n<script>\n import wepy from \"wepy\";\n ex"
},
{
"path": "src/others-edu-page/pages/GpaCalculator.wpy",
"chars": 8235,
"preview": "<template lang=\"pug\">\nBaseContainer(navTitle=\"GPA计算器\")\n view(slot=\"qy-content\")\n view.gpa\n view.header\n "
},
{
"path": "src/others-edu-page/pages/calendar.wpy",
"chars": 670,
"preview": "<template>\n <view>\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <image src=\"https://static.airbob.org/2019"
},
{
"path": "src/others-edu-page/pages/pe-score.wpy",
"chars": 11770,
"preview": "<template>\n <BaseContainer navTitle=\"体育部\" :passwordModelOptions.sync=\"passwordModelOptions\">\n <view slot=\"qy-content"
},
{
"path": "src/others-page/components/bus-card.wpy",
"chars": 5650,
"preview": "<template>\n <view class=\"bus-container\">\n <view class=\"bus-during\">{{during}}</view>\n <view class=\"bus-sites-wrap"
},
{
"path": "src/others-page/components/changeLogItem.wpy",
"chars": 996,
"preview": "<template>\n <view>\n <view class=\"item-header\">\n <image src=\"https://static.airbob.org/under-graduate/circle.png"
},
{
"path": "src/others-page/components/information-card.wpy",
"chars": 3740,
"preview": "<template>\n <view class=\"info-container\" id=\"tag{{id}}\">\n <view wx:if=\"{{info.length !== 0}}\">\n <repeat for=\"{{"
},
{
"path": "src/others-page/components/seats-card.wpy",
"chars": 3357,
"preview": "<template>\n <view class=\"floor-contanier\">\n <view class=\"floor-head\">{{lib.floor}}层</view>\n <view class=\"floor-ro"
},
{
"path": "src/others-page/mixins/all-search-thing.js",
"chars": 6001,
"preview": "import wepy from \"wepy\";\n\nexport default class allSearch extends wepy.mixin {\n allSearchThing() {\n const AllSearhes "
},
{
"path": "src/others-page/mixins/page-jump.js",
"chars": 662,
"preview": "import wepy from \"wepy\";\n\nexport default class allSearch extends wepy.mixin {\n methods = {\n toAssociationHome() {\n "
},
{
"path": "src/others-page/pages/advertisement.wpy",
"chars": 2478,
"preview": "<template>\n <view class=\"container\">\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <image src=\"{{ adDetail."
},
{
"path": "src/others-page/pages/associationPages/association-detail.wpy",
"chars": 18678,
"preview": "<template>\n <view class=\"container\">\n <BaseContainer :navTitle=\"navTitle\">\n <view slot=\"qy-content\">\n <v"
},
{
"path": "src/others-page/pages/associationPages/association-register.wpy",
"chars": 20650,
"preview": "<template>\n <BaseContainer navTitle=\"社团报名\">\n <view slot=\"qy-content\" class=\"container\" style=\"{{perfectInfoStatus =="
},
{
"path": "src/others-page/pages/associationPages/association.wpy",
"chars": 17170,
"preview": "<template>\n <BaseContainer :navTitle=\"navTitle\" :background.sync=\"backgroundStatus\">\n <view slot=\"qy-content\">\n "
},
{
"path": "src/others-page/pages/associationPages/club-personal.wpy",
"chars": 27993,
"preview": "<template>\n <BaseContainer :navTitle=\"navTitle\" :background.sync=\"backgroundStatus\">\n <view slot=\"qy-content\" "
},
{
"path": "src/others-page/pages/associationPages/register-success.wpy",
"chars": 3314,
"preview": "<template>\n <view class=\"container\">\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <view class=\"header\"></v"
},
{
"path": "src/others-page/pages/auth.wpy",
"chars": 6793,
"preview": "<template>\n <view class=\"auth\">\n <qy-navigation :title=\"navTitle\" :background=\"background\"></qy-navigation>\n <vie"
},
{
"path": "src/others-page/pages/close.wpy",
"chars": 1125,
"preview": "<template>\n <view>\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <view class=\"container\">\n <view>\n "
},
{
"path": "src/others-page/pages/display-webview.wpy",
"chars": 749,
"preview": "<template>\n <view>\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <block wx:hidden=\"{{token === ''}}\">\n "
},
{
"path": "src/others-page/pages/feedbackPages/feedback.wpy",
"chars": 9961,
"preview": "<template>\n <BaseContainer :navTitle=\"navTitle\">\n <view slot=\"qy-content\">\n <view style=\"width:750rpx;margin-bo"
},
{
"path": "src/others-page/pages/feedbackPages/historyfeedback.wpy",
"chars": 21875,
"preview": "<template>\n <view>\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <qy-tip :content.sync=\"errMsg\" :on.sync=\"e"
},
{
"path": "src/others-page/pages/feedbackPages/myfeedback.wpy",
"chars": 13620,
"preview": "<template>\n <view>\n <qy-tip :content.sync=\"errMsg\" :on.sync=\"errRequest\"/>\n <qy-navigation :title=\"navTitle\"></qy"
},
{
"path": "src/others-page/pages/information-box.wpy",
"chars": 15395,
"preview": "<template>\n <BaseContainer :navTitle=\"navTitle\">\n <view slot=\"qy-content\">\n <view class=\"box-container\" hidden="
},
{
"path": "src/others-page/pages/libraryPages/library-history.wpy",
"chars": 4590,
"preview": "<template>\n <BaseContainer :navTitle=\"navTitle\">\n <view slot=\"qy-content\">\n <view class=\"container\">\n <r"
},
{
"path": "src/others-page/pages/libraryPages/library-recommened.wpy",
"chars": 7046,
"preview": "<template>\n <view>\n <!-- <view slot=\"qy-content\"> -->\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <vie"
},
{
"path": "src/others-page/pages/libraryPages/library.wpy",
"chars": 39337,
"preview": "<template>\n <BaseContainer navTitle=\"图书馆\" :passwordModelOptions.sync=\"passwordModelOptions\">\n <view slot=\"qy-content"
},
{
"path": "src/others-page/pages/login.wpy",
"chars": 13644,
"preview": "<template>\n <view>\n <view class=\"content\">\n <view hidden=\"{{initFinish}}\" class=\"toggle-body {{centerBody}}\">\n "
},
{
"path": "src/others-page/pages/more.wpy",
"chars": 25331,
"preview": "<template>\n <view>\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <qy-tip :on.sync=\"tipsOn\" :content.sync=\"t"
},
{
"path": "src/others-page/pages/news.wpy",
"chars": 4742,
"preview": "<template>\n <view>\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <view class=\"container\">\n <view style"
},
{
"path": "src/others-page/pages/nicpPages/nicp-check-in.wpy",
"chars": 7632,
"preview": "<template>\n <view class=\"nicp-check-in\">\n <!-- <qy-navigation :title=\"navTitle\" :background=\"background\"></qy-naviga"
},
{
"path": "src/others-page/pages/nicpPages/nicp-more.wpy",
"chars": 668,
"preview": "<template>\n<view class=\"nicp-more\">\n <qy-navigation :title=\"navTitle\" :background=\"background\"></qy-navigation>\n <web-"
},
{
"path": "src/others-page/pages/nicpPages/nicp-vote.wpy",
"chars": 3576,
"preview": "<template>\n <view class=\"nicp-vote\">\n <qy-navigation :title=\"navTitle\" :background=\"background\"></qy-navigation>\n "
},
{
"path": "src/others-page/pages/personalPages/aboutus.wpy",
"chars": 2518,
"preview": "<template>\n <view>\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <view class=\"header\">\n <image mode=\"a"
},
{
"path": "src/others-page/pages/personalPages/change-password.wpy",
"chars": 10338,
"preview": "<template>\n <BaseContainer :navTitle=\"navTitle\">\n <view slot=\"qy-content\" class=\"container\">\n <view class=\"cont"
},
{
"path": "src/others-page/pages/personalPages/change-phone.wpy",
"chars": 6377,
"preview": "<template>\n <view class=\"container\">\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <view class=\"content\">\n "
},
{
"path": "src/others-page/pages/personalPages/changelog.wpy",
"chars": 1569,
"preview": "<template>\n <view>\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <view style=\"box-sizing: border-box;width:"
},
{
"path": "src/others-page/pages/personalPages/protocol.wpy",
"chars": 3143,
"preview": "<template>\n <view>\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <view class=\"protocol-container\">\n <v"
},
{
"path": "src/others-page/pages/questionnairePages/questionnaire-homepage.wpy",
"chars": 7249,
"preview": "<template>\n <BaseContainer :navTitle=\"navTitle\">\n <view slot=\"qy-content\">\n <view class=\"container\">\n <v"
},
{
"path": "src/others-page/pages/questionnairePages/questionnaire.wpy",
"chars": 13127,
"preview": "<template>\n <view class=\"container\">\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <view class=\"questionnai"
},
{
"path": "src/others-page/pages/run.wpy",
"chars": 18149,
"preview": "<template>\n <BaseContainer :navTitle=\"navTitle\" :passwordModelOptions.sync=\"passwordModelOptions\">\n <view slot=\"qy-c"
},
{
"path": "src/others-page/pages/school-bus.wpy",
"chars": 11232,
"preview": "<template>\n <BaseContainer :navTitle=\"navTitle\">\n <view slot=\"qy-content\">\n <view class=\"cover-container {{isMo"
},
{
"path": "src/others-page/pages/search.wpy",
"chars": 7697,
"preview": "<template>\n <view>\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <view class=\"search-bar\">\n <image src"
},
{
"path": "src/others-page/pages/tuition.wpy",
"chars": 9964,
"preview": "<template>\n <BaseContainer :navTitle=\"navTitle\">\n <view slot=\"qy-content\">\n <view class=\"container\">\n <i"
},
{
"path": "src/others-page/wxs/filter.wxs",
"chars": 377,
"preview": "module.exports = {\n filter: function(name) {\n if (name.indexOf(\"doc\") > -1) {\n return \"https://static.airbob.or"
},
{
"path": "src/pages/index.wpy",
"chars": 47160,
"preview": "<template>\n <BaseContainer navTitle=\"NJUPT\" :openPage.sync=\"openPage\">\n <view slot=\"qy-content\">\n <view wx:if=\""
},
{
"path": "src/pages/news-list.wpy",
"chars": 8628,
"preview": "<template>\n <view class=\"container\">\n <qy-navigation :title=\"navTitle\"></qy-navigation>\n <qy-tip :on.sync=\"isWron"
},
{
"path": "src/pages/profile.wpy",
"chars": 8623,
"preview": "<template>\n <BaseContainer navTitle=\"我的\">\n <view slot=\"qy-content\">\n <view class=\"container\" slot=\"qy-content\">"
},
{
"path": "src/store/actions/index.js",
"chars": 1383,
"preview": "import {\n SHOW_GRADUATE_MODAL,\n HIDE_GRADUATE_MODAL,\n JUDGE_MEMORY_MODE_STATUS,\n SET_ISGRADUTE\n} from \"../types/grad"
},
{
"path": "src/store/index.js",
"chars": 378,
"preview": "import { createStore, applyMiddleware } from \"redux\";\nimport promiseMiddleware from \"redux-promise\";\nimport { createLogg"
},
{
"path": "src/store/reducers/graduate.js",
"chars": 986,
"preview": "import { handleActions } from \"redux-actions\";\nimport {\n SHOW_GRADUATE_MODAL,\n HIDE_GRADUATE_MODAL,\n JUDGE_MEMORY_MOD"
},
{
"path": "src/store/reducers/index.js",
"chars": 198,
"preview": "import { combineReducers } from \"redux\";\nimport graduateReducer from \"./graduate\";\nimport visitorReducer from \"./visitor"
},
{
"path": "src/store/reducers/visitor-mode.js",
"chars": 435,
"preview": "import { handleActions } from \"redux-actions\";\nimport { ENTER_VISITOR_MODE, EXIT_VISITOR_MODE } from \"../types/visitor-m"
},
{
"path": "src/store/types/graduate.js",
"chars": 290,
"preview": "export const SHOW_GRADUATE_MODAL = `SHOW_GRADUATE_MODAL`;\n\nexport const HIDE_GRADUATE_MODAL = `HIDE_GRADUATE_MODAL`;\n\nex"
},
{
"path": "src/store/types/visitor-mode.js",
"chars": 111,
"preview": "export const ENTER_VISITOR_MODE = `ENTER_VISITOR_MODE`;\n\nexport const EXIT_VISITOR_MODE = `EXIT_VISITOR_MODE`;\n"
},
{
"path": "src/utils/Crypto.js",
"chars": 926,
"preview": "import CryptoJS from \"crypto-js\";\n\n/**\n * base on crypto-js\n * 后端用的是 AES/CBC/PKCS5Padding\n * key 和 iv 为 utf8 编码\n */\nexpo"
},
{
"path": "wepy.config.js",
"chars": 1368,
"preview": "const path = require(\"path\");\r\nvar prod = process.env.NODE_ENV === \"production\";\r\n\r\nmodule.exports = {\r\n wpyExt: \".wpy\""
}
]
About this extraction
This page contains the full source code of the GreenPomelo/Undergraduate GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 127 files (827.6 KB), approximately 234.4k tokens, and a symbol index with 101 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.