├── .gitignore
├── LICENSE
├── README.md
├── app.js
├── app.json
├── app.wxss
├── images
├── core
│ ├── bbq.png
│ ├── bbq@disabled.png
│ ├── cj.png
│ ├── cj@disabled.png
│ ├── common
│ │ ├── down.png
│ │ ├── down_w.png
│ │ ├── left_g.png
│ │ ├── right_g.png
│ │ └── up.png
│ ├── es.png
│ ├── es@disabled.png
│ ├── jz.png
│ ├── jz@disabled.png
│ ├── kb.png
│ ├── kb@disabled.png
│ ├── kjs.png
│ ├── kjs
│ │ ├── building-icon.png
│ │ ├── classTime-icon.png
│ │ ├── classroom-icon.png
│ │ ├── day-icon.png
│ │ └── week-icon.png
│ ├── kjs@disabled.png
│ ├── ks.png
│ ├── ks@disabled.png
│ ├── new
│ │ ├── bbq.png
│ │ ├── bbq@disabled.png
│ │ ├── cj.png
│ │ ├── cj@disabled.png
│ │ ├── kb.png
│ │ ├── kb@disabled.png
│ │ ├── kjs.png
│ │ ├── kjs@disabled.png
│ │ ├── ks.png
│ │ ├── ks@disabled.png
│ │ ├── tb.png
│ │ ├── tb@disabled.png
│ │ ├── tsg.png
│ │ ├── tsg@disabled.png
│ │ ├── xyk.png
│ │ └── xyk@disabled.png
│ ├── sdf
│ │ └── sdf-bg.png
│ ├── sw.png
│ ├── sw@disabled.png
│ ├── tb.png
│ ├── tb@disabled.png
│ ├── ts.png
│ ├── ts@disabled.png
│ ├── tsg.png
│ ├── tsg
│ │ ├── green.png
│ │ ├── purple.png
│ │ ├── red.png
│ │ └── yellow.png
│ ├── tsg@disabled.png
│ ├── wm.png
│ ├── wm@disabled.png
│ ├── xs
│ │ ├── clear.png
│ │ └── search-sign.png
│ ├── xyk.png
│ ├── xyk
│ │ ├── card-bg.png
│ │ └── logo.png
│ └── xyk@disabled.png
├── index
│ ├── hj.png
│ ├── index.png
│ ├── index@active.png
│ ├── jy-book.png
│ ├── loading.gif
│ ├── more.png
│ ├── more@active.png
│ ├── news.png
│ ├── news@active.png
│ ├── nothing.png
│ ├── pen.png
│ └── tri.png
├── more
│ ├── about.png
│ ├── append.png
│ ├── close.png
│ ├── enter.png
│ ├── help.png
│ ├── higk.png
│ ├── issue.png
│ ├── lanshan.png
│ ├── logo.png
│ ├── logo2.png
│ ├── title.png
│ └── wave.png
└── news
│ ├── all.png
│ ├── all@colour.png
│ ├── all@gray.png
│ ├── file.png
│ ├── gkdt.png
│ ├── hy.png
│ ├── hy@colour.png
│ ├── hy@gray.png
│ ├── jw.png
│ ├── jw@colour.png
│ ├── jw@gray.png
│ ├── jz.png
│ ├── jz@colour.png
│ ├── jz@gray.png
│ ├── new.png
│ ├── new@colour.png
│ ├── new@gray.png
│ ├── oa.png
│ ├── oa@colour.png
│ └── oa@gray.png
├── pages
├── core
│ ├── bbq
│ │ ├── bbq.js
│ │ ├── bbq.json
│ │ ├── bbq.wxml
│ │ └── bbq.wxss
│ ├── cj
│ │ ├── cj.js
│ │ ├── cj.json
│ │ ├── cj.wxml
│ │ └── cj.wxss
│ ├── detail
│ │ ├── detail.js
│ │ ├── detail.json
│ │ ├── detail.wxml
│ │ └── detail.wxss
│ ├── kb
│ │ ├── kb.js
│ │ ├── kb.json
│ │ ├── kb.wxml
│ │ └── kb.wxss
│ ├── kjs
│ │ ├── kjs.js
│ │ ├── kjs.json
│ │ ├── kjs.wxml
│ │ └── kjs.wxss
│ ├── ks
│ │ ├── ks.js
│ │ ├── ks.json
│ │ ├── ks.wxml
│ │ └── ks.wxss
│ ├── tb
│ │ ├── tb.js
│ │ ├── tb.json
│ │ ├── tb.wxml
│ │ └── tb.wxss
│ ├── ts
│ │ ├── detail
│ │ │ ├── detail.js
│ │ │ ├── detail.json
│ │ │ ├── detail.wxml
│ │ │ └── detail.wxss
│ │ ├── ts.js
│ │ ├── ts.json
│ │ ├── ts.wxml
│ │ └── ts.wxss
│ ├── tsg
│ │ ├── tsg.js
│ │ ├── tsg.json
│ │ ├── tsg.wxml
│ │ └── tsg.wxss
│ └── xyk
│ │ ├── xyk.js
│ │ ├── xyk.json
│ │ ├── xyk.wxml
│ │ └── xyk.wxss
├── index
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── more
│ ├── about.js
│ ├── about.json
│ ├── about.wxml
│ ├── about.wxss
│ ├── append.js
│ ├── append.json
│ ├── append.wxml
│ ├── append.wxss
│ ├── issues.js
│ ├── issues.json
│ ├── issues.wxml
│ ├── issues.wxss
│ ├── login.js
│ ├── login.json
│ ├── login.wxml
│ ├── login.wxss
│ ├── more.js
│ ├── more.json
│ ├── more.wxml
│ └── more.wxss
└── news
│ ├── detail
│ ├── detail.js
│ ├── detail.wxml
│ └── detail.wxss
│ ├── hy
│ ├── hy_detail.js
│ ├── hy_detail.json
│ ├── hy_detail.wxml
│ └── hy_detail.wxss
│ ├── jw
│ ├── jw_detail.js
│ ├── jw_detail.json
│ ├── jw_detail.wxml
│ └── jw_detail.wxss
│ ├── jz
│ ├── jz_detail.js
│ ├── jz_detail.json
│ ├── jz_detail.wxml
│ └── jz_detail.wxss
│ ├── new
│ ├── new_detail.js
│ ├── new_detail.json
│ ├── new_detail.wxml
│ └── new_detail.wxss
│ ├── news.js
│ ├── news.json
│ ├── news.wxml
│ ├── news.wxss
│ └── oa
│ ├── oa_detail.js
│ ├── oa_detail.json
│ ├── oa_detail.wxml
│ └── oa_detail.wxss
└── utils
├── base64.min.js
├── md5.min.js
└── util.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Hi广科微信小程序
2 | * Hi广科,前端源码fork自重庆邮电大学We重邮微信小程序,修改并适配Hi广科后端程序,由广科贴吧技术组开发并运营的微信小程序。
3 | * 广东科学技术职业学院学子的贴心助手,专注于校园服务,主要功能有:成绩查询、快递查询、借阅查询、课表查询、表白墙、校园活动、新闻等。
4 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | App({
3 | version: 'v0.0.1', //版本号
4 | /**
5 | *
6 | */
7 | onLaunch: function() {
8 | var _this = this;
9 | //读取缓存
10 | try {
11 | // 读取缓存
12 | var data = wx.getStorageInfoSync();
13 | if (data && data.keys.length) {
14 | // 读取当前缓存 中所有的key
15 | data.keys.forEach(function(key) {
16 | var value = wx.getStorageSync(key);
17 | if (value) {
18 | _this.cache[key] = value;
19 | }
20 | });
21 | // 判断当前版本与缓存中的版本是否相同,不同 清除本地数据缓存
22 | if (_this.cache.version !== _this.version) {
23 | _this.cache = {};
24 | wx.clearStorage();
25 | } else {
26 | _this._user.wx = _this.cache.userinfo.userInfo || {};
27 | _this.processData(_this.cache.userdata);
28 | }
29 | }
30 | } catch(e) { console.warn('获取缓存失败'); }
31 | },
32 | //保存缓存
33 | saveCache: function(key, value) {
34 | if(!key || !value){return;}
35 | var _this = this;
36 | _this.cache[key] = value;
37 | wx.setStorage({
38 | key: key,
39 | data: value
40 | });
41 | },
42 | //清除缓存
43 | removeCache: function(key) {
44 | if(!key){return;}
45 | var _this = this;
46 | _this.cache[key] = '';
47 | wx.removeStorage({
48 | key: key
49 | });
50 | },
51 | //后台切换至前台时
52 | onShow: function(){
53 |
54 | },
55 | //判断是否有登录信息,让分享时自动登录
56 | loginLoad: function(onLoad){
57 | var _this = this;
58 | if(!_this._user.is_bind){ //无登录信息
59 | _this.getUser(function(e){
60 | typeof onLoad == "function" && onLoad(e);
61 | });
62 | }else{ //有登录信息
63 | typeof onLoad == "function" && onLoad();
64 | }
65 | },
66 | //getUser函数,在index中调用
67 | getUser: function(response) {
68 | var _this = this;
69 | wx.showNavigationBarLoading();
70 | wx.login({
71 | success: function(res){
72 | if(res.code){
73 | //调用函数获取微信用户信息
74 | _this.getUserInfo(
75 | function(info){
76 | // 缓存微信用户信息
77 | _this.saveCache('userinfo', info);
78 | _this._user.wx = info.userInfo;
79 | if(!info.encryptedData || !info.iv){
80 | _this.g_status = '无关联AppID';
81 | typeof response == "function" && response(_this.g_status);
82 | return;
83 | }
84 | //发送code与微信用户信息,获取学生数据
85 | wx.request({
86 | method: 'POST',
87 | url: _this._server + '/GetInfo',
88 | data: {
89 | code: res.code,
90 | key: info.encryptedData,
91 | iv: info.iv
92 | },header: {
93 | 'content-type': 'application/x-www-form-urlencoded'
94 | },
95 | success: function(res){
96 | if(res.data && res.data.status >= 200 && res.data.status < 400){
97 | var status = false, data = res.data.data;
98 | //判断缓存是否有更新
99 | if(_this.cache.version !== _this.version || _this.cache.userdata !== data){
100 | _this.saveCache('version', _this.version);
101 | _this.saveCache('userdata', data);
102 | _this.processData(data);
103 | status = true;
104 | }
105 | if(!_this._user.is_bind){
106 | wx.navigateTo({
107 | url: '/pages/more/login'
108 | });
109 | }
110 | //如果缓存有更新,则执行回调函数
111 | if(status){
112 | typeof response == "function" && response();
113 | }
114 | }else{
115 | //清除缓存
116 | if(_this.cache){
117 | _this.cache = {};
118 | wx.clearStorage();
119 | }
120 | typeof response == "function" && response(res.data.message || '加载失败');
121 | }
122 | },
123 | fail: function(res){
124 | var status = '';
125 | // 判断是否有缓存
126 | if(_this.cache.version === _this.version){
127 | status = '离线缓存模式';
128 | }else{
129 | status = '网络错误';
130 | }
131 | _this.g_status = status;
132 | typeof response == "function" && response(status);
133 | console.warn(status);
134 | },
135 | complete: function(){
136 | wx.hideNavigationBarLoading();
137 | }
138 | });
139 | });
140 | }
141 | }
142 | });
143 | },
144 | /**
145 | * 处理数据
146 | * 解析json数据
147 | * */
148 | processData: function(key){
149 | var _this = this;
150 | var data = JSON.parse(_this.util.base64.decode(key));
151 | _this._user.is_bind = data.is_bind;
152 | _this._user.openid = data.user.openid;
153 | _this._user.teacher = (data.user.type == '教职工');
154 | _this._user.we = data.user;
155 | _this._time = data.time;
156 | return data;
157 | },
158 | getUserInfo: function(cb){
159 | var _this = this;
160 | //获取微信用户信息
161 | wx.getUserInfo({
162 | success: function(res){
163 | typeof cb == "function" && cb(res);
164 | },
165 | fail: function(res){
166 | _this.showErrorModal('拒绝授权将导致无法关联学校帐号并影响使用,请重新打开Hi广科再点击允许授权!', '授权失败');
167 | _this.g_status = '未授权';
168 | }
169 | });
170 | },
171 | //完善信息
172 | appendInfo: function(data){
173 | var _this = this;
174 | _this.cache = {};
175 | wx.clearStorage();
176 | _this._user.we.build = data.build || '';
177 | _this._user.we.room = data.room || '';
178 | },
179 | showErrorModal: function(content, title){
180 | wx.showModal({
181 | title: title || '加载失败',
182 | content: content || '未知错误',
183 | showCancel: false
184 | });
185 | },
186 | showLoadToast: function(title, duration){
187 | wx.showToast({
188 | title: title || '加载中',
189 | icon: 'loading',
190 | mask: true,
191 | duration: duration || 20000
192 | });
193 | },
194 | util: require('./utils/util'),
195 | key: function(data){ return this.util.key(data) },
196 | cache: {},
197 | // _server: 'https://we.cqu.pt',
198 | _server: 'https://gktieba.natapp4.cc/higk',
199 | _user: {
200 | //微信数据
201 | wx: {},
202 | //学生\老师数据
203 | we: {}
204 | },
205 | _time: {} //当前学期周数
206 | });
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index",
4 | "pages/news/news",
5 | "pages/news/jw/jw_detail",
6 | "pages/news/oa/oa_detail",
7 | "pages/news/hy/hy_detail",
8 | "pages/news/jz/jz_detail",
9 | "pages/news/new/new_detail",
10 | "pages/more/login",
11 | "pages/more/append",
12 | "pages/more/more",
13 | "pages/more/issues",
14 | "pages/more/about",
15 | "pages/core/kb/kb",
16 | "pages/core/cj/cj",
17 | "pages/core/ts/ts",
18 | "pages/core/ts/detail/detail",
19 | "pages/core/kjs/kjs",
20 | "pages/core/xyk/xyk",
21 | "pages/core/tsg/tsg",
22 | "pages/core/bbq/bbq",
23 | "pages/core/tb/tb"
24 | ],
25 | "window": {
26 | "navigationBarBackgroundColor": "#72b4ee",
27 | "navigationBarTextStyle": "white",
28 | "navigationBarTitleText": "Hi广科",
29 | "backgroundColor": "#72b4ee",
30 | "backgroundTextStyle": "light",
31 | "enablePullDownRefresh": true
32 | },
33 | "tabBar": {
34 | "color": "#7f848a",
35 | "selectedColor": "#72b4ee",
36 | "backgroundColor": "#f7f6fb",
37 | "list": [
38 | {
39 | "pagePath": "pages/index/index",
40 | "text": "首页",
41 | "iconPath": "images/index/index.png",
42 | "selectedIconPath": "images/index/index@active.png"
43 | },
44 | {
45 | "pagePath": "pages/news/news",
46 | "text": "资讯",
47 | "iconPath": "images/index/news.png",
48 | "selectedIconPath": "images/index/news@active.png"
49 | },
50 | {
51 | "pagePath": "pages/more/more",
52 | "text": "更多",
53 | "iconPath": "images/index/more.png",
54 | "selectedIconPath": "images/index/more@active.png"
55 | }
56 | ]
57 | },
58 | "networkTimeout": {
59 | "request": 20000,
60 | "uploadFile": 30000,
61 | "downloadFile": 30000
62 | }
63 | }
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | page{
3 | font-family: -apple-system-font, Helvetica Neue, Helvetica, sans-serif;
4 | font-size: 10pt;
5 | line-height: 150%;
6 | color: #666;
7 | min-height: 100%;
8 | position: relative;
9 | display: flex;
10 | flex-direction: column;
11 | align-items: stretch;
12 | }
13 | .container {
14 | position: relative;
15 | flex: 1;
16 | display: flex;
17 | flex-direction: column;
18 | min-height: 100%;
19 | padding-bottom: 100rpx;
20 | box-sizing: border-box;
21 | }
22 |
23 | .remind-box {
24 | flex: 1;
25 | display: flex;
26 | flex-direction: column;
27 | align-items: center;
28 | justify-content: center;
29 | padding-bottom: 300rpx;
30 | }
31 | .remind-img {
32 | width: 230rpx;
33 | height: 230rpx;
34 | padding-bottom: 25rpx;
35 | }
36 | .remind-text {
37 | font-size: 12pt;
38 | line-height: 150%;
39 | }
40 | .remind-btn {
41 | margin-top: 20rpx;
42 | font-size: 9pt;
43 | padding: 5rpx 20rpx;
44 | text-align: center;
45 | background-color: #7acfa6;
46 | border-radius: 3px;
47 | border-bottom: 2px solid #4fc08d;
48 | color: #fff;
49 | }
50 |
51 | .fix_tip{
52 | position: fixed;
53 | bottom: 50rpx;
54 | left: 0;
55 | width: 100%;
56 | text-align: center;
57 | opacity: 0;
58 | transform: translate3d(0, 80rpx, 0);
59 | transition: all .5s cubic-bezier(0.19, 1, 0.22, 1)
60 | }
61 | .fix_tip.active{
62 | opacity: 1;
63 | transform: translate3d(0, 0, 0);
64 | }
65 | .fix_tip text{
66 | font-size: 9pt;
67 | line-height: 100%;
68 | padding: 10rpx 20rpx;
69 | border-radius: 10rpx;
70 | background: rgba(66,66,66,.6);
71 | color: #fff;
72 | }
73 |
74 | .lanshan-studio{
75 | position: absolute;
76 | left: 0;
77 | right: 0;
78 | bottom: 0;
79 | width: 100%;
80 | font-size: 9pt;
81 | line-height: 100%;
82 | padding: 9pt 0;
83 | text-align: center;
84 | opacity: 0.15;
85 | }
--------------------------------------------------------------------------------
/images/core/bbq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/bbq.png
--------------------------------------------------------------------------------
/images/core/bbq@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/bbq@disabled.png
--------------------------------------------------------------------------------
/images/core/cj.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/cj.png
--------------------------------------------------------------------------------
/images/core/cj@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/cj@disabled.png
--------------------------------------------------------------------------------
/images/core/common/down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/common/down.png
--------------------------------------------------------------------------------
/images/core/common/down_w.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/common/down_w.png
--------------------------------------------------------------------------------
/images/core/common/left_g.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/common/left_g.png
--------------------------------------------------------------------------------
/images/core/common/right_g.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/common/right_g.png
--------------------------------------------------------------------------------
/images/core/common/up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/common/up.png
--------------------------------------------------------------------------------
/images/core/es.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/es.png
--------------------------------------------------------------------------------
/images/core/es@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/es@disabled.png
--------------------------------------------------------------------------------
/images/core/jz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/jz.png
--------------------------------------------------------------------------------
/images/core/jz@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/jz@disabled.png
--------------------------------------------------------------------------------
/images/core/kb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/kb.png
--------------------------------------------------------------------------------
/images/core/kb@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/kb@disabled.png
--------------------------------------------------------------------------------
/images/core/kjs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/kjs.png
--------------------------------------------------------------------------------
/images/core/kjs/building-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/kjs/building-icon.png
--------------------------------------------------------------------------------
/images/core/kjs/classTime-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/kjs/classTime-icon.png
--------------------------------------------------------------------------------
/images/core/kjs/classroom-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/kjs/classroom-icon.png
--------------------------------------------------------------------------------
/images/core/kjs/day-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/kjs/day-icon.png
--------------------------------------------------------------------------------
/images/core/kjs/week-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/kjs/week-icon.png
--------------------------------------------------------------------------------
/images/core/kjs@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/kjs@disabled.png
--------------------------------------------------------------------------------
/images/core/ks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/ks.png
--------------------------------------------------------------------------------
/images/core/ks@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/ks@disabled.png
--------------------------------------------------------------------------------
/images/core/new/bbq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/bbq.png
--------------------------------------------------------------------------------
/images/core/new/bbq@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/bbq@disabled.png
--------------------------------------------------------------------------------
/images/core/new/cj.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/cj.png
--------------------------------------------------------------------------------
/images/core/new/cj@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/cj@disabled.png
--------------------------------------------------------------------------------
/images/core/new/kb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/kb.png
--------------------------------------------------------------------------------
/images/core/new/kb@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/kb@disabled.png
--------------------------------------------------------------------------------
/images/core/new/kjs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/kjs.png
--------------------------------------------------------------------------------
/images/core/new/kjs@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/kjs@disabled.png
--------------------------------------------------------------------------------
/images/core/new/ks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/ks.png
--------------------------------------------------------------------------------
/images/core/new/ks@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/ks@disabled.png
--------------------------------------------------------------------------------
/images/core/new/tb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/tb.png
--------------------------------------------------------------------------------
/images/core/new/tb@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/tb@disabled.png
--------------------------------------------------------------------------------
/images/core/new/tsg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/tsg.png
--------------------------------------------------------------------------------
/images/core/new/tsg@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/tsg@disabled.png
--------------------------------------------------------------------------------
/images/core/new/xyk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/xyk.png
--------------------------------------------------------------------------------
/images/core/new/xyk@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/new/xyk@disabled.png
--------------------------------------------------------------------------------
/images/core/sdf/sdf-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/sdf/sdf-bg.png
--------------------------------------------------------------------------------
/images/core/sw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/sw.png
--------------------------------------------------------------------------------
/images/core/sw@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/sw@disabled.png
--------------------------------------------------------------------------------
/images/core/tb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/tb.png
--------------------------------------------------------------------------------
/images/core/tb@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/tb@disabled.png
--------------------------------------------------------------------------------
/images/core/ts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/ts.png
--------------------------------------------------------------------------------
/images/core/ts@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/ts@disabled.png
--------------------------------------------------------------------------------
/images/core/tsg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/tsg.png
--------------------------------------------------------------------------------
/images/core/tsg/green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/tsg/green.png
--------------------------------------------------------------------------------
/images/core/tsg/purple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/tsg/purple.png
--------------------------------------------------------------------------------
/images/core/tsg/red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/tsg/red.png
--------------------------------------------------------------------------------
/images/core/tsg/yellow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/tsg/yellow.png
--------------------------------------------------------------------------------
/images/core/tsg@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/tsg@disabled.png
--------------------------------------------------------------------------------
/images/core/wm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/wm.png
--------------------------------------------------------------------------------
/images/core/wm@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/wm@disabled.png
--------------------------------------------------------------------------------
/images/core/xs/clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/xs/clear.png
--------------------------------------------------------------------------------
/images/core/xs/search-sign.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/xs/search-sign.png
--------------------------------------------------------------------------------
/images/core/xyk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/xyk.png
--------------------------------------------------------------------------------
/images/core/xyk/card-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/xyk/card-bg.png
--------------------------------------------------------------------------------
/images/core/xyk/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/xyk/logo.png
--------------------------------------------------------------------------------
/images/core/xyk@disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/core/xyk@disabled.png
--------------------------------------------------------------------------------
/images/index/hj.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/index/hj.png
--------------------------------------------------------------------------------
/images/index/index.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/index/index.png
--------------------------------------------------------------------------------
/images/index/index@active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/index/index@active.png
--------------------------------------------------------------------------------
/images/index/jy-book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/index/jy-book.png
--------------------------------------------------------------------------------
/images/index/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/index/loading.gif
--------------------------------------------------------------------------------
/images/index/more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/index/more.png
--------------------------------------------------------------------------------
/images/index/more@active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/index/more@active.png
--------------------------------------------------------------------------------
/images/index/news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/index/news.png
--------------------------------------------------------------------------------
/images/index/news@active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/index/news@active.png
--------------------------------------------------------------------------------
/images/index/nothing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/index/nothing.png
--------------------------------------------------------------------------------
/images/index/pen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/index/pen.png
--------------------------------------------------------------------------------
/images/index/tri.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/index/tri.png
--------------------------------------------------------------------------------
/images/more/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/more/about.png
--------------------------------------------------------------------------------
/images/more/append.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/more/append.png
--------------------------------------------------------------------------------
/images/more/close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/more/close.png
--------------------------------------------------------------------------------
/images/more/enter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/more/enter.png
--------------------------------------------------------------------------------
/images/more/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/more/help.png
--------------------------------------------------------------------------------
/images/more/higk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/more/higk.png
--------------------------------------------------------------------------------
/images/more/issue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/more/issue.png
--------------------------------------------------------------------------------
/images/more/lanshan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/more/lanshan.png
--------------------------------------------------------------------------------
/images/more/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/more/logo.png
--------------------------------------------------------------------------------
/images/more/logo2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/more/logo2.png
--------------------------------------------------------------------------------
/images/more/title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/more/title.png
--------------------------------------------------------------------------------
/images/more/wave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/more/wave.png
--------------------------------------------------------------------------------
/images/news/all.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/all.png
--------------------------------------------------------------------------------
/images/news/all@colour.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/all@colour.png
--------------------------------------------------------------------------------
/images/news/all@gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/all@gray.png
--------------------------------------------------------------------------------
/images/news/file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/file.png
--------------------------------------------------------------------------------
/images/news/gkdt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/gkdt.png
--------------------------------------------------------------------------------
/images/news/hy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/hy.png
--------------------------------------------------------------------------------
/images/news/hy@colour.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/hy@colour.png
--------------------------------------------------------------------------------
/images/news/hy@gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/hy@gray.png
--------------------------------------------------------------------------------
/images/news/jw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/jw.png
--------------------------------------------------------------------------------
/images/news/jw@colour.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/jw@colour.png
--------------------------------------------------------------------------------
/images/news/jw@gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/jw@gray.png
--------------------------------------------------------------------------------
/images/news/jz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/jz.png
--------------------------------------------------------------------------------
/images/news/jz@colour.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/jz@colour.png
--------------------------------------------------------------------------------
/images/news/jz@gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/jz@gray.png
--------------------------------------------------------------------------------
/images/news/new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/new.png
--------------------------------------------------------------------------------
/images/news/new@colour.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/new@colour.png
--------------------------------------------------------------------------------
/images/news/new@gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/new@gray.png
--------------------------------------------------------------------------------
/images/news/oa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/oa.png
--------------------------------------------------------------------------------
/images/news/oa@colour.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/oa@colour.png
--------------------------------------------------------------------------------
/images/news/oa@gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/higuangke/Higk/ef8654010550ec34d96660c6b5528ff07e4e0617/images/news/oa@gray.png
--------------------------------------------------------------------------------
/pages/core/bbq/bbq.js:
--------------------------------------------------------------------------------
1 | // bbq.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function (options) {
15 |
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面初次渲染完成
20 | */
21 | onReady: function () {
22 |
23 | },
24 |
25 | /**
26 | * 生命周期函数--监听页面显示
27 | */
28 | onShow: function () {
29 |
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面隐藏
34 | */
35 | onHide: function () {
36 |
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面卸载
41 | */
42 | onUnload: function () {
43 |
44 | },
45 |
46 | /**
47 | * 页面相关事件处理函数--监听用户下拉动作
48 | */
49 | onPullDownRefresh: function () {
50 |
51 | },
52 |
53 | /**
54 | * 页面上拉触底事件的处理函数
55 | */
56 | onReachBottom: function () {
57 |
58 | },
59 |
60 | /**
61 | * 用户点击右上角分享
62 | */
63 | onShareAppMessage: function () {
64 |
65 | }
66 | })
--------------------------------------------------------------------------------
/pages/core/bbq/bbq.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#e994b5",
3 | "navigationBarTitleText": "表白墙",
4 | "backgroundColor": "#e994b5"
5 | }
--------------------------------------------------------------------------------
/pages/core/bbq/bbq.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 该功能正在维护中···
7 |
8 |
9 |
--------------------------------------------------------------------------------
/pages/core/bbq/bbq.wxss:
--------------------------------------------------------------------------------
1 | /* bbq.wxss */
2 | .container {
3 | padding-left: 30rpx;
4 | padding-right: 30rpx;
5 | background-color: #f7f7f7;
6 | }
--------------------------------------------------------------------------------
/pages/core/cj/cj.js:
--------------------------------------------------------------------------------
1 | //cj.js
2 | //获取应用实例
3 | var app = getApp();
4 | Page({
5 | data: {
6 | remind: '加载中',
7 | cjInfo : [
8 | ],
9 | year:'',
10 | term:'',
11 | currentDate:''
12 | },
13 | getcj:function(){
14 | var _this = this;
15 | if(!app._user.we.ykth){
16 | _this.setData({
17 | remind: '未绑定'
18 | });
19 | return false;
20 | }
21 | _this.setData({
22 | id: app._user.we.ykth,
23 | name: app._user.we.more.name
24 | });
25 | //判断并读取缓存
26 | if(app.cache.cj){ cjRender(app.cache.cj); }
27 | function cjRender(_data){
28 | var year = _data.year; // 当前学年
29 | var term = _data.term; // 当前学期
30 | var currentDate = app.util.formatTime(new Date,'');
31 | _this.setData({
32 | cjInfo: _data,
33 | year: year,
34 | term: term,
35 | remind: '',
36 | currentDate:currentDate
37 | });
38 | // getdate();
39 | }
40 | wx.showNavigationBarLoading();
41 | wx.request({
42 | url: app._server + "/QueryGradeServlet",
43 | method: 'POST',
44 | data: {
45 | openid: app._user.openid,
46 | id: app._user.we.ykth
47 | },
48 | header: {
49 | 'content-type': 'application/x-www-form-urlencoded'
50 | },
51 | success: function(res) {
52 | if(res.data && res.data.status >= 200 && res.data.status < 400) {
53 | var _data = res.data.data;
54 | if(_data) {
55 | //保存成绩缓存
56 | app.saveCache('cj', _data);
57 | cjRender(_data);
58 | } else { _this.setData({ remind: '官网暂无成绩数据' }); }
59 |
60 | } else {
61 | app.removeCache('cj');
62 | _this.setData({
63 | remind: res.data.message || '未知错误'
64 | });
65 | }
66 |
67 | },
68 | fail: function(res) {
69 | if(_this.data.remind == '加载中'){
70 | _this.setData({
71 | remind: '网络错误'
72 | });
73 | }
74 | console.warn('网络错误');
75 | },
76 | complete: function() {
77 | wx.hideNavigationBarLoading();
78 | }
79 | });
80 |
81 | function changeNum(num){
82 | var china = ['零','一','二','三','四','五','六','七','八','九'];
83 | var arr = [];
84 | var n = ''.split.call(num,'');
85 | for(var i = 0; i < n.length; i++){
86 | arr[i] = china[n[i]];
87 | }
88 | return arr.join("")
89 | }
90 | },
91 | //下拉更新
92 | /*
93 | onPullDownRefresh: function(){
94 | this.getcj();
95 | },
96 | */
97 | onLoad: function(){
98 | this.getcj();
99 | }
100 | });
--------------------------------------------------------------------------------
/pages/core/cj/cj.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#e78ab0",
3 | "navigationBarTitleText": "成绩查询" ,
4 | "backgroundColor": "#e78ab0",
5 | "enablePullDownRefresh": false
6 | }
--------------------------------------------------------------------------------
/pages/core/cj/cj.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{remind}}
8 |
9 |
10 |
11 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | {{year}}学年第{{term}}学期
26 |
29 |
30 |
31 |
32 |
33 |
34 | {{row[0]}}
35 | {{row[1]}}
36 |
37 |
38 |
39 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/pages/core/cj/cj.wxss:
--------------------------------------------------------------------------------
1 | /**cj.wxss**/
2 | .container{
3 | padding-left: 30rpx;
4 | padding-right: 30rpx;
5 | background-color: #f7f7f7;
6 | }
7 | .cj-header{
8 | display: flex;
9 | flex-flow: row nowrap;
10 | justify-content: space-between;
11 | align-items: center;
12 | padding: 50rpx 0;
13 | }
14 | .cj-text{
15 | display: flex;
16 | flex-flow: column nowrap;
17 | justify-content: flex-start;
18 | padding-left: 25rpx;
19 | }
20 | .cj-header-title{
21 | font-size: 20pt;
22 | font-weight: bold;
23 | line-height: 150%;
24 | margin-bottom: 15rpx;
25 | color: #222;
26 | }
27 | .cj-header-info{
28 | font-size: 11pt;
29 | line-height: 160%;
30 | color: #888;
31 | }
32 |
33 | .cj-bg{
34 | display: block;
35 | width: 200rpx;
36 | height: 200rpx;
37 | padding-right: 5rpx;
38 | opacity: .3;
39 | }
40 |
41 | .cj-info-ctn{
42 | display: flex;
43 | flex-flow: column nowrap;
44 | align-items: stretch;
45 | border-radius: 3px;
46 | background: #fff;
47 | margin-bottom: 50rpx;
48 | }
49 | .cj-grade{
50 | display: flex;
51 | flex-flow: row nowrap;
52 | align-items: center;
53 | padding: 25rpx 30rpx;
54 | }
55 | .cj-grade-logo{
56 | width: 100rpx;
57 | height: 100rpx;
58 | }
59 |
60 | .cj-grade-term{
61 | flex: 1;
62 | padding-left: 30rpx;
63 | color: #666;
64 | font-size: 11pt;
65 | line-height: 160%;
66 | }
67 | .cj-grade-fst{
68 | display: flex;
69 | flex-flow: column nowrap;
70 | }
71 |
72 | .grade-comment{
73 | color: #999;
74 | font-size: 26rpx;
75 | }
76 |
77 | .cj-info-box{
78 | display: flex;
79 | flex-flow: column nowrap;
80 | align-items: stretch;
81 | padding: 5rpx 30rpx 15rpx;
82 | }
83 | .cj-info{
84 | background: #fff;
85 | font-size: 11pt;
86 | display: flex;
87 | flex-flow: row nowrap;
88 | justify-content: space-between;
89 | align-items: center;
90 | border-top: 1px solid #eee;
91 | padding: 25rpx 10rpx 20rpx 5rpx;
92 | }
93 | .cj-info-socre{
94 | padding-left: 100rpx;
95 | }
--------------------------------------------------------------------------------
/pages/core/detail/detail.js:
--------------------------------------------------------------------------------
1 | // pages/core/detail/detail.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function (options) {
15 |
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面初次渲染完成
20 | */
21 | onReady: function () {
22 |
23 | },
24 |
25 | /**
26 | * 生命周期函数--监听页面显示
27 | */
28 | onShow: function () {
29 |
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面隐藏
34 | */
35 | onHide: function () {
36 |
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面卸载
41 | */
42 | onUnload: function () {
43 |
44 | },
45 |
46 | /**
47 | * 页面相关事件处理函数--监听用户下拉动作
48 | */
49 | onPullDownRefresh: function () {
50 |
51 | },
52 |
53 | /**
54 | * 页面上拉触底事件的处理函数
55 | */
56 | onReachBottom: function () {
57 |
58 | },
59 |
60 | /**
61 | * 用户点击右上角分享
62 | */
63 | onShareAppMessage: function () {
64 |
65 | }
66 | })
--------------------------------------------------------------------------------
/pages/core/detail/detail.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/core/detail/detail.wxml:
--------------------------------------------------------------------------------
1 |
2 | pages/core/detail/detail.wxml
3 |
--------------------------------------------------------------------------------
/pages/core/detail/detail.wxss:
--------------------------------------------------------------------------------
1 | /* pages/core/detail/detail.wxss */
--------------------------------------------------------------------------------
/pages/core/kb/kb.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#79d0a6",
3 | "navigationBarTitleText": "我的课表",
4 | "backgroundColor": "#79d0a6",
5 | "enablePullDownRefresh": false
6 | }
--------------------------------------------------------------------------------
/pages/core/kjs/kjs.js:
--------------------------------------------------------------------------------
1 | //kjs.js
2 | Page({
3 | data: {
4 |
5 | }
6 | })
--------------------------------------------------------------------------------
/pages/core/kjs/kjs.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#9d89ea",
3 | "navigationBarTitleText": "空教室",
4 | "backgroundColor": "#9d89ea"
5 | }
--------------------------------------------------------------------------------
/pages/core/kjs/kjs.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 该功能正在维护中···
7 |
8 |
9 |
10 |
11 |
12 |
14 |
15 |
23 |
24 |
25 |
26 |
27 |
36 |
37 |
46 |
47 |
56 |
57 |
67 |
--------------------------------------------------------------------------------
/pages/core/kjs/kjs.wxss:
--------------------------------------------------------------------------------
1 | /**kjs.wxss**/
2 |
3 | page {
4 | position: relative;
5 | height: 100%;
6 | }
7 |
8 | .container {
9 | background: #fff;
10 | padding-left: 30rpx;
11 | padding-right: 30rpx;
12 | /*padding-bottom: 480rpx;*/
13 | box-sizing: border-box;
14 | }
15 |
16 |
17 | /* ==========================================================================
18 | main-roomUl
19 | ============================================================================ */
20 | .main-roomUl {
21 |
22 | display: flex;
23 | flex-flow: column nowrap;
24 | padding: 30rpx 45rpx;
25 | }
26 | .roomUl-floor {
27 |
28 | display: flex;
29 | width: 600rpx;
30 | flex-flow: column nowrap;
31 | margin-top: 20rpx;
32 | padding: 0 0 0 65rpx;
33 | /*background: url('/images/core/kjs/classroom-icon.png') no-repeat;*/
34 | /*微信暂不支持静态bgimg文件,改用服务器url*/
35 | background: url('https://we.cqu.pt/app/images/core/kjs/classroom-icon.png') no-repeat;
36 | background-size: 30rpx 25rpx;
37 | background-position: 15rpx 8rpx;
38 | }
39 | .floor {
40 |
41 | flex: 1;
42 | width: 600rpx;
43 | display: flex;
44 | flex-wrap: wrap;
45 | }
46 | .floor text {
47 |
48 | padding-bottom: 25rpx;
49 | width: 120rpx;
50 | font-size: 11pt;
51 | letter-spacing: 0.1rem;
52 | text-align: center;
53 | }
54 |
55 | /* ==========================================================================
56 | main-condition
57 | ============================================================================ */
58 | .main-condition {
59 |
60 | position: fixed;
61 | bottom: 0;
62 | left: 0;
63 | z-index: 100;
64 | display: flex;
65 | flex-flow: column wrap;
66 | width: 100%;
67 | height: 480rpx;
68 | border-top: 1rpx solid #F1F1F2;
69 | }
70 | .condition {
71 |
72 | display: flex;
73 | box-sizing: border-box;
74 | padding: 0;
75 | width: 100%;
76 | height: 120rpx;
77 | white-space: nowrap;
78 | }
79 | .condition-li {
80 |
81 | display: inline-block;
82 | width: 111rpx;
83 | height: 120rpx;
84 | line-height: 120rpx;
85 | text-align: center;
86 | }
87 | .building-condition .condition-li {
88 | width: 115rpx;
89 | }
90 | .day-condition .condition-li {
91 | width: 115rpx;
92 | }
93 | .week-active,
94 | .day-active,
95 | .classTime-active,
96 | .building-active {
97 | color: #FFF;
98 | font-weight: 900;
99 | }
100 | .scroll-space {
101 |
102 | display: inline-block;
103 | width: 30rpx;
104 | height: 30rpx;
105 | }
106 |
107 |
108 | /* main-condition > condition-week
109 | ============================================================================ */
110 | .condition-week {
111 |
112 | background-color: #FBFAF8;
113 | }
114 | .week-active {
115 |
116 | /*background: url('/images/core/kjs/week-icon.png') no-repeat;*/
117 | /*微信暂不支持静态bgimg文件,改用服务器url*/
118 | background: url('https://we.cqu.pt/app/images/core/kjs/week-icon.png') no-repeat;
119 | background-size: 100rpx 100rpx;
120 | background-position: 50% 50%;
121 | }
122 |
123 |
124 | /* main-condition > condition-day
125 | ============================================================================ */
126 | .condition-day {
127 |
128 | background-color: #F1F1F2;
129 | }
130 | .day-active {
131 |
132 | /*background: url('/images/core/kjs/day-icon.png') no-repeat;*/
133 | /*微信暂不支持静态bgimg文件,改用服务器url*/
134 | background: url('https://we.cqu.pt/app/images/core/kjs/day-icon.png') no-repeat;
135 | background-size: 100rpx 100rpx;
136 | background-position: 50% 50%;
137 | }
138 |
139 | /* main-condition > condition-classTime
140 | ============================================================================ */
141 | .condition-classTime {
142 |
143 | background-color: #FBFAF8;
144 | overflow: hidden;
145 | }
146 | .classTime-active {
147 |
148 | /*background: url('/images/core/kjs/classTime-icon.png') no-repeat;*/
149 | /*微信暂不支持静态bgimg文件,改用服务器url*/
150 | background: url('https://we.cqu.pt/app/images/core/kjs/classTime-icon.png') no-repeat;
151 | background-size: 100rpx 100rpx;
152 | background-position: 50% 50%;
153 | }
154 |
155 | /* main-condition > condition-building
156 | ============================================================================ */
157 | .condition-building {
158 |
159 | background-color: #F1F1F2;
160 | overflow: hidden;
161 | }
162 | .building-active {
163 |
164 | /*background: url('/images/core/kjs/building-icon.png') no-repeat;*/
165 | /*微信暂不支持静态bgimg文件,改用服务器url*/
166 | background: url('https://we.cqu.pt/app/images/core/kjs/building-icon.png') no-repeat;
167 | background-size: 100rpx 100rpx;
168 | background-position: 50% 50%;
169 | }
170 |
--------------------------------------------------------------------------------
/pages/core/ks/ks.js:
--------------------------------------------------------------------------------
1 | //ks.js
2 | //获取应用实例
3 |
4 | var app = getApp();
5 | Page({
6 | /*
7 | data: {
8 | remind: '加载中',
9 | list: [],
10 | first: 1
11 | },
12 | togglePage: function (e) {
13 | var id = e.currentTarget.id, data = {};
14 | data.show = [];
15 | for (var i = 0, len = this.data.class.length; i < len; i++) {
16 | data.show[i] = false;
17 | }
18 | if(this.data.first){
19 | this.setData(data);
20 | this.data.first = 0;
21 | }
22 | data.show[id] = !this.data.show[id];
23 | this.setData(data);
24 | },
25 | //分享
26 | onShareAppMessage: function(){
27 | var name = this.data.name || app._user.we.info.name,
28 | id = this.data.id || app._user.we.info.id;
29 | return {
30 | title: name + '的考试安排',
31 | desc: 'Hi广科 - 考试安排',
32 | path: '/pages/core/ks/ks?id='+id+'&name='+name
33 | };
34 | },
35 | //下拉更新
36 | onPullDownRefresh: function(){
37 | var _this = this;
38 | _this.loginHandler({
39 | id: _this.data.id || app._user.we.info.id,
40 | name: _this.data.name || app._user.we.info.name
41 | });
42 | },
43 | onLoad: function(options){
44 | var _this = this;
45 | app.loginLoad(function(){
46 | _this.loginHandler.call(_this, options);
47 | });
48 | },
49 | //让分享时自动登录
50 | loginHandler: function(options){
51 | var _this = this;
52 | var id, name;
53 | if(options.id && options.name){
54 | id = options.id;
55 | name = options.name;
56 | _this.setData({
57 | teacher: false
58 | });
59 | }else{
60 | id = app._user.we.info.id,
61 | name = app._user.we.info.name;
62 | _this.setData({
63 | teacher: app._user.teacher
64 | });
65 | }
66 | if(!id || !name){
67 | _this.setData({
68 | remind: '未绑定'
69 | });
70 | return false;
71 | }
72 | _this.setData({
73 | id: id,
74 | name: name
75 | });
76 | var data = {
77 | openid: app._user.openid,
78 | id: id
79 | };
80 | if(app._user.teacher && !options.name){ data.type = 'teacher'; }
81 |
82 | //判断并读取缓存
83 | if(app.cache.ks && !options.name){ ksRender(app.cache.ks); }
84 | function ksRender(list){
85 | if(!list || !list.length){
86 | _this.setData({
87 | remind: '无考试安排'
88 | });
89 | return false;
90 | }
91 | var days = ['一','二','三','四','五','六','日'];
92 | for (var i = 0, len = list.length; i < len; ++i) {
93 | list[i].open = false;
94 | list[i].index = i;
95 | list[i].day = days[list[i].day - 1];
96 | list[i].time = list[i].time.trim().replace('—','~');
97 | list[i].lesson = list[i].lesson.replace(',','-');
98 | //倒计时提醒
99 | if(list[i].days > 0){
100 | list[i].countdown = '还有' + list[i].days + '天考试';
101 | list[i].place = '('+list[i].time+')'+list[i].room;
102 | if(!app._user.teacher){
103 | list[i].place += '#'+list[i].number;
104 | }
105 | }else if(list[i].days < 0){
106 | list[i].countdown = '考试已过了' + (-list[i].days) + '天';
107 | list[i].place = '';
108 | }else{
109 | list[i].countdown = '今天考试';
110 | list[i].place = '('+list[i].time+')'+list[i].room;
111 | if(!app._user.teacher){
112 | list[i].place += '#'+list[i].number;
113 | }
114 | }
115 | }
116 | list[0].open = true;
117 | _this.setData({
118 | list: list,
119 | remind: ''
120 | });
121 | }
122 | wx.showNavigationBarLoading();
123 | wx.request({
124 | url: app._server + "/api/get_ks.php",
125 | method: 'POST',
126 | data: app.key(data),
127 | success: function(res) {
128 | if (res.data && res.data.status === 200){
129 | var list = res.data.data;
130 | if(list) {
131 | if(!options.name){
132 | //保存考试缓存
133 | app.saveCache('ks', list);
134 | }
135 | ksRender(list);
136 | } else { _this.setData({ remind: '暂无数据' }); }
137 |
138 | } else {
139 | app.removeCache('ks');
140 | _this.setData({
141 | remind: res.data.message || '未知错误'
142 | });
143 | }
144 | },
145 | fail: function(res) {
146 | if(_this.data.remind == '加载中'){
147 | _this.setData({
148 | remind: '网络错误'
149 | });
150 | }
151 | console.warn('网络错误');
152 | },
153 | complete: function() {
154 | wx.hideNavigationBarLoading();
155 | wx.stopPullDownRefresh();
156 | }
157 | });
158 | },
159 | // 展示考试详情
160 | slideDetail: function(e) {
161 | var id = e.currentTarget.dataset.id,
162 | list = this.data.list;
163 | // 每次点击都将当前open换为相反的状态并更新到视图,视图根据open的值来切换css
164 | for (var i = 0, len = list.length; i < len; ++i) {
165 | if (i == id) {
166 | list[i].open = !list[i].open;
167 | } else {
168 | list[i].open = false;
169 | }
170 | }
171 | this.setData({
172 | list: list
173 | });
174 | }
175 | */
176 | });
177 |
178 |
--------------------------------------------------------------------------------
/pages/core/ks/ks.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#7acfa6",
3 | "navigationBarTitleText": "考试安排",
4 | "backgroundColor": "#7acfa6"
5 | }
--------------------------------------------------------------------------------
/pages/core/ks/ks.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 该功能正在维护中···
7 |
8 |
9 |
10 |
85 |
86 |
--------------------------------------------------------------------------------
/pages/core/ks/ks.wxss:
--------------------------------------------------------------------------------
1 | /**ks.wxss**/
2 | .container{
3 | padding-left: 30rpx;
4 | padding-right: 30rpx;
5 | background-color: #f7f7f7;
6 | }
7 | .ks-header{
8 | display: flex;
9 | flex-flow: row nowrap;
10 | justify-content: space-between;
11 | align-items: center;
12 | padding: 50rpx 0;
13 | }
14 | .ks-text{
15 | display: flex;
16 | flex-flow: column nowrap;
17 | justify-content: flex-start;
18 | padding-left: 25rpx;
19 | }
20 | .ks-header-title{
21 | font-size: 20pt;
22 | font-weight: bold;
23 | line-height: 150%;
24 | margin-bottom: 15rpx;
25 | color: #222;
26 | }
27 | .ks-header-info, .ks-header-info-ksName{
28 | font-size: 11pt;
29 | line-height: 160%;
30 | color: #888;
31 | }
32 |
33 | .ks-bg{
34 | display: block;
35 | width: 200rpx;
36 | height: 200rpx;
37 | padding-right: 5rpx;
38 | opacity: .3;
39 | }
40 |
41 | .ks-class-ctn{
42 | display: flex;
43 | flex-flow: column nowrap;
44 | align-items: stretch;
45 | }
46 |
47 | .ks-class-item {
48 | display: flex;
49 | flex-direction: column;
50 | font-size: 11pt;
51 | padding: 0 40rpx;
52 | margin-bottom: 20rpx;
53 | background-color: #fff;
54 | border-radius: 3px;
55 | }
56 | .ks-hd {
57 | display: flex;
58 | align-items: center;
59 | justify-content: space-between;
60 | height: 145rpx;
61 | }
62 |
63 | .ks-hd-left {
64 | flex: 1;
65 | display: flex;
66 | flex-direction: column;
67 | overflow: hidden;
68 | padding-right: 30rpx;
69 | }
70 |
71 | /**列表展开时标题的颜色变化 **/
72 | .ks-hd-name {
73 | font-size: 12pt;
74 | line-height: 225%;
75 | letter-spacing: 1px;
76 | transition: color .15s ease-in-out;
77 | overflow: hidden;
78 | white-space: nowrap;
79 | text-overflow: ellipsis;
80 | }
81 | .ks-item-show .ks-hd-name {
82 | transition: color .15s ease-in-out;
83 | color: #7acfa6;
84 | }
85 | .ks-hd-other {
86 | font-size: 10pt;
87 | line-height: 100%;
88 | color: #aaa;
89 | }
90 | .ks-item-show .ks-hd-place {
91 | display: none;
92 | }
93 |
94 | /**列表展开的icon旋转 **/
95 | .ks-item-icon{
96 | flex-shrink: 0;
97 | width: 30rpx;
98 | height: 30rpx;
99 | transition: transform .2s;
100 | transform: rotate(0deg);
101 | }
102 | .ks-item-show .ks-item-icon{
103 | transform: rotate(180deg);
104 | }
105 |
106 | .ks-detail {
107 | display: none;
108 | flex-direction: column;
109 | overflow: hidden;
110 | padding: 0;
111 | }
112 | .ks-item-show .ks-detail {
113 | display: flex;
114 | padding: 5rpx 0 15rpx;
115 | }
116 | .ks-detail-item {
117 | display: flex;
118 | align-items: center;
119 | padding: 25rpx 5rpx 20rpx;
120 | border-top: 1px solid #eee;
121 | }
122 | .ks-detail-label {
123 | color: #888;
124 | width: 55pt;
125 | }
126 | .ks-detail-content {
127 | flex: 1;
128 | }
129 | .ks-jxb {
130 | /*background: url('/images/core/xs.png') no-repeat;*/
131 | /*微信暂不支持静态bgimg文件,改用服务器url*/
132 | background: url('https://we.cqu.pt/app/images/core/xs.png') no-repeat;
133 | background-size: 30rpx 30rpx;
134 | background-position: 0 50%;
135 | padding-left: 40rpx;
136 | color: #888;
137 | }
--------------------------------------------------------------------------------
/pages/core/tb/tb.js:
--------------------------------------------------------------------------------
1 | // tb.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function (options) {
15 |
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面初次渲染完成
20 | */
21 | onReady: function () {
22 |
23 | },
24 |
25 | /**
26 | * 生命周期函数--监听页面显示
27 | */
28 | onShow: function () {
29 |
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面隐藏
34 | */
35 | onHide: function () {
36 |
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面卸载
41 | */
42 | onUnload: function () {
43 |
44 | },
45 |
46 | /**
47 | * 页面相关事件处理函数--监听用户下拉动作
48 | */
49 | onPullDownRefresh: function () {
50 |
51 | },
52 |
53 | /**
54 | * 页面上拉触底事件的处理函数
55 | */
56 | onReachBottom: function () {
57 |
58 | },
59 |
60 | /**
61 | * 用户点击右上角分享
62 | */
63 | onShareAppMessage: function () {
64 |
65 | }
66 | })
--------------------------------------------------------------------------------
/pages/core/tb/tb.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#72b4ee",
3 | "navigationBarTitleText": "广科贴吧",
4 | "backgroundColor": "#72b4ee"
5 | }
--------------------------------------------------------------------------------
/pages/core/tb/tb.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 该功能正在维护中···
7 |
8 |
9 |
--------------------------------------------------------------------------------
/pages/core/tb/tb.wxss:
--------------------------------------------------------------------------------
1 | /* tb.wxss */
2 | .container {
3 | padding-left: 30rpx;
4 | padding-right: 30rpx;
5 | background-color: #f7f7f7;
6 | }
--------------------------------------------------------------------------------
/pages/core/ts/detail/detail.js:
--------------------------------------------------------------------------------
1 | //detail.js
2 | //获取应用实例
3 | var app = getApp();
4 | Page({
5 | data: {
6 | remind: '加载中',
7 | xfData: [], // 书籍数据
8 | listAnimation: {} // 列表动画
9 | },
10 | //分享
11 | onShareAppMessage: function () {
12 | return {
13 | title: this.data.book_name + ' - 书籍详情 - Hi广科',
14 | desc: '广东科学技术职业学院唯一的小程序',
15 | path: '/pages/core/ts/detail/detail?url=' + this.data.book_url + '&name=' + this.data.book_name
16 | };
17 | },
18 | // 页面加载
19 | onLoad: function (options) {
20 | var _this = this;
21 | _this.setData({
22 | book_name: options.name,
23 | book_url: options.url
24 | });
25 | //判断并读取缓存
26 | //if (app.cache.xf) { xfRender(app.cache.xf); }
27 | function xfRender(info) {
28 | // 为每一本书设置是否显示当前数据详情的标志open, false表示不显示
29 | var list = info.rows;
30 | for (var i = 0, len = list.length; i < len; ++i) {
31 | list[i].open = false;
32 | }
33 | list[0].open = true;
34 | _this.setData({
35 | remind: '',
36 | xfData: list,
37 | catalog: info.catalog
38 | });
39 | }
40 | wx.showNavigationBarLoading();
41 | wx.request({
42 | url: app._server + "/SearchBookDetailServelt",
43 | method: 'POST',
44 | data: {
45 | // session_id: app.user.id,
46 | url: options.url
47 | }, header: {
48 | 'content-type': 'application/x-www-form-urlencoded'
49 | },
50 | success: function (res) {
51 |
52 | if (res.data && res.data.status === 200) {
53 | var info = res.data.data;
54 | if (info) {
55 | xfRender(info);
56 | } else { _this.setData({ remind: '暂无数据' }); }
57 |
58 | } else {
59 | app.removeCache('xf');
60 | _this.setData({
61 | remind: res.data.message || '未知错误'
62 | });
63 | }
64 |
65 | },
66 | fail: function (res) {
67 | if (_this.data.remind == '加载中') {
68 | _this.setData({
69 | remind: '网络错误'
70 | });
71 | }
72 | console.warn('网络错误');
73 | },
74 | complete: function () {
75 | wx.hideNavigationBarLoading();
76 | }
77 | });
78 | },
79 |
80 | // 展示书籍详情
81 | slideDetail: function (e) {
82 |
83 | var id = e.currentTarget.id,
84 | list = this.data.xfData;
85 |
86 | // 每次点击都将当前open换为相反的状态并更新到视图,视图根据open的值来切换css
87 | for (var i = 0, len = list.length; i < len; ++i) {
88 | if (list[i].barcode == id) {
89 | list[i].open = !list[i].open;
90 | } else {
91 | list[i].open = false;
92 | }
93 | }
94 | this.setData({
95 | xfData: list
96 | });
97 | }
98 | });
--------------------------------------------------------------------------------
/pages/core/ts/detail/detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#79d0a6",
3 | "navigationBarTitleText": "书籍详情",
4 | "backgroundColor": "#79d0a6",
5 | "enablePullDownRefresh": false
6 | }
--------------------------------------------------------------------------------
/pages/core/ts/detail/detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{remind}}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | {{book_name}}
17 |
18 |
19 | {{itemName}}
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | {{itemName.book_name}}
33 |
34 |
35 |
36 |
37 | 索书号
38 | {{itemName.callno}}
39 |
40 |
41 | 条码号
42 | {{itemName.barcode}}
43 |
44 |
50 |
51 | 藏书部门
52 | {{itemName.collect_dept}}
53 |
54 |
55 | 流通状态
56 | {{itemName.status}}
57 |
58 |
59 | 应还日期
60 | {{itemName.deadline}}
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/pages/core/ts/detail/detail.wxss:
--------------------------------------------------------------------------------
1 | /**xf.wxss**/
2 |
3 | .container {
4 | padding-left: 30rpx;
5 | padding-right: 30rpx;
6 | background-color: #f7f7f7;
7 | }
8 |
9 | /** 学费title **/
10 |
11 | .xf-title-wraper {
12 | display: flex;
13 | justify-content: space-between;
14 | padding: 50rpx 0;
15 | }
16 |
17 | .xf-title-info {
18 | display: flex;
19 | flex-direction: column;
20 | justify-content: center;
21 | padding-left: 25rpx;
22 | }
23 |
24 | .xf-stu-info {
25 | display: flex;
26 | flex-direction: column;
27 | }
28 |
29 | .xf-stu-info text {
30 | font-size: 11pt;
31 | line-height: 160%;
32 | color: #888;
33 | }
34 |
35 | .xf-title {
36 | font-size: 20pt;
37 | font-weight: bold;
38 | line-height: 150%;
39 | margin-bottom: 15rpx;
40 | color: #222;
41 | }
42 |
43 | .xf-title-icon {
44 | display: block;
45 | width: 200rpx;
46 | height: 200rpx;
47 | padding-right: 5rpx;
48 | opacity: 0.3;
49 | }
50 |
51 | /** 学费类型 **/
52 |
53 | .xf-types {
54 | display: flex;
55 | flex-direction: column;
56 | }
57 |
58 | .xf-type-item {
59 | display: flex;
60 | flex-direction: column;
61 | font-size: 11pt;
62 | padding: 0 40rpx;
63 | margin-bottom: 20rpx;
64 | background-color: #fff;
65 | border-radius: 3px;
66 | }
67 |
68 | .xf-head {
69 | display: flex;
70 | align-items: center;
71 | justify-content: space-between;
72 | height: 145rpx;
73 | }
74 |
75 | .xf-detail {
76 | display: none;
77 | flex-direction: column;
78 | overflow: hidden;
79 | padding: 0;
80 | }
81 |
82 | .xf-item-show .xf-detail {
83 | display: flex;
84 | padding: 5rpx 0 15rpx;
85 | }
86 |
87 | .xf-detail-item {
88 | display: flex;
89 | align-items: center;
90 | padding: 25rpx 5rpx 20rpx;
91 | border-top: 1px solid #eee;
92 | }
93 |
94 | .xf-detail-label {
95 | color: #888;
96 | width: 75pt;
97 | }
98 |
99 | .xf-detail-content {
100 | flex: 1;
101 | }
102 |
103 | /**列表展开的icon旋转 **/
104 |
105 | .xf-item-icon {
106 | width: 30rpx;
107 | height: 30rpx;
108 | transition: transform 0.2s;
109 | transform: rotate(0deg);
110 | }
111 |
112 | .xf-item-show .xf-item-icon {
113 | transform: rotate(180deg);
114 | }
115 |
116 | /**列表展开时标题的颜色变化 **/
117 |
118 | .xf-type-name {
119 | font-size: 12pt;
120 | letter-spacing: 1px;
121 | transition: color 0.15s ease-in-out;
122 | white-space: nowrap;
123 | text-overflow: ellipsis;
124 | overflow: hidden;
125 | }
126 |
127 | .xf-item-show .xf-type-name {
128 | transition: color 0.15s ease-in-out;
129 | color: #8271bf;
130 | }
131 |
132 | .xf-TotalTuition, .xf-ApartmentPay, .xf-CollectingPay {
133 | margin-left: 25rpx;
134 | }
135 |
136 | .xf-MajorTuition, .xf-GradeTuition, .xf-SecMajorTuition {
137 | margin-left: 50rpx;
138 | }
139 |
--------------------------------------------------------------------------------
/pages/core/ts/ts.js:
--------------------------------------------------------------------------------
1 | //xs.js
2 | //获取应用实例
3 | var app = getApp();
4 |
5 | Page({
6 | data: {
7 | header: {
8 | defaultValue: '',
9 | inputValue: '',
10 | help_status: false
11 | },
12 | main: {
13 | mainDisplay: true, // main 显示的变化标识
14 | total: 0,
15 | sum: 0,
16 | page: 0,
17 | message: '上滑加载更多'
18 | },
19 | testData: [],
20 | messageObj: { // 查询失败的提示信息展示对象
21 | messageDisplay: true,
22 | message: ''
23 | }
24 | },
25 |
26 | bindClearSearchTap: function (e) {
27 | this.setData({
28 | 'main.mainDisplay': true,
29 | 'main.total': 0,
30 | 'main.sum': 0,
31 | 'main.page': 0,
32 | 'main.message': '上滑加载更多',
33 | 'testData': [],
34 | 'header.inputValue': ''
35 | });
36 | },
37 |
38 | bindSearchInput: function (e) {
39 | this.setData({
40 | 'header.inputValue': e.detail.value,
41 | 'main.total': 0,
42 | 'main.sum': 0,
43 | 'main.page': 0,
44 | 'main.message': '上滑加载更多',
45 | 'testData': []
46 | });
47 | if (!this.data.messageObj.messageDisplay) {
48 | this.setData({
49 | 'messageObj.messageDisplay': true,
50 | 'messageObj.message': ''
51 | });
52 | }
53 | return e.detail.value;
54 | },
55 |
56 | // 点击搜索
57 | bindConfirmSearchTap: function () {
58 | this.setData({
59 | 'main.total': 0,
60 | 'main.sum': 0,
61 | 'main.page': 0,
62 | 'main.message': '上滑加载更多',
63 | 'testData': []
64 | });
65 | this.search();
66 | },
67 |
68 | // 上滑加载更多
69 | onReachBottom: function () {
70 | if (this.data.main.message != '已全部加载' && this.data.main.message != '正在加载中') {
71 | this.search();
72 | }
73 | },
74 |
75 | // 搜索
76 | search: function (key) {
77 |
78 | var that = this,
79 | inputValue = key || that.data.header.inputValue,
80 | messageDisplay = false,
81 | message = '',
82 | reDdata = null,
83 | numberSign = false; // 用户输入的是姓名还是学号的标识
84 |
85 | // 消除字符串首尾的空格
86 | function trim(str) {
87 |
88 | return str.replace(/(^\s*)|(\s*$)/g, '');
89 | }
90 |
91 | inputValue = trim(inputValue);
92 |
93 | // 抽离对messageObj的设置成一个单独的函数
94 | function setMessageObj(messageDisplay, message) {
95 |
96 | that.setData({
97 | 'messageObj.messageDisplay': messageDisplay,
98 | 'messageObj.message': message
99 | });
100 | }
101 |
102 | // 对输入的是空格或未进行输入进行处理
103 | if (inputValue === '') {
104 |
105 | this.setData({
106 | 'main.mainDisplay': true
107 | });
108 |
109 | return false;
110 | }
111 |
112 | // 防止注入攻击
113 | function checkData(v) {
114 |
115 | var temp = v;
116 |
117 | v = v.replace(/\\|\/|\.|\'|\"|\<|\>/g, function (str) { return ''; });
118 | v = trim(v);
119 |
120 | messageDisplay = v.length < temp.length ? false : true;
121 | message = '请勿输入非法字符!';
122 |
123 | return v;
124 | }
125 |
126 | // 对输入进行过滤
127 | inputValue = checkData(inputValue);
128 |
129 | setMessageObj(messageDisplay, message);
130 | this.setData({
131 | 'header.inputValue': inputValue
132 | });
133 |
134 | // 存在非法输入只会提示错误消息而不会发送搜索请求
135 | if (messageDisplay === false) {
136 | return false;
137 | }
138 |
139 | // 对输入类型进行处理 inputValue:String
140 | if (!isNaN(parseInt(inputValue, 10))) {
141 |
142 | numberSign = true;
143 | }
144 |
145 | // 处理成功返回的数据
146 | function doSuccess(data, messageDisplay) {
147 |
148 | var rows = data.rows;
149 | // 对数据进行自定义加工 给每个数据对象添加一些自定义属性
150 | function doData(data) {
151 |
152 | var curData = null,
153 | curXm = null,
154 | curXh = null,
155 | len = data.length;
156 |
157 | // 若查询没有查出结果,则直接显示提示信息并退出
158 | if (len === 0) {
159 | doFail();
160 | return false;
161 | }
162 |
163 | for (var i = 0; i < len; i++) {
164 | curData = data[i];
165 | curData.display = false; // 添加控制隐藏列表信息显示的标识
166 | curData.headImg = curData.headImg || '/images/core/ts.png';
167 | }
168 |
169 | return data;
170 | }
171 |
172 | reDdata = doData(rows);
173 |
174 | // 若reDdata===false, 查询没有结果
175 | if (reDdata === false) {
176 | return false;
177 | }
178 |
179 | that.setData({
180 | 'testData': that.data.testData.concat(reDdata),
181 | 'main.mainDisplay': false,
182 | 'main.total': data.total,
183 | 'main.sum': that.data.main.sum + data.rows.length,
184 | 'messageObj.messageDisplay': messageDisplay,
185 | 'main.message': '上滑加载更多'
186 | });
187 | wx.hideToast();
188 |
189 | if (reDdata.length === 1) {
190 | that.bindOpenList(0);
191 | }
192 |
193 | if (data.total <= that.data.main.sum) {
194 | that.setData({
195 | 'main.message': '已全部加载'
196 | });
197 | }
198 |
199 | }
200 |
201 | // 处理没找到搜索到结果或错误情况
202 | function doFail(err) {
203 |
204 | var message = typeof err === 'undefined' ? '未搜索到相关结果' : err;
205 |
206 | setMessageObj(false, message);
207 | wx.hideToast();
208 | }
209 |
210 | that.setData({
211 | 'main.message': '正在加载中',
212 | 'main.page': that.data.main.page + 1
213 | });
214 | app.showLoadToast();
215 | wx.request({
216 | url: app._server + '/SearchBookServlet',
217 | method: 'POST',
218 | data: {
219 | // session_id: app.user.id,
220 | key: inputValue,
221 | page: that.data.main.page
222 | },header: {
223 | 'content-type': 'application/x-www-form-urlencoded'
224 | },
225 | success: function (res) {
226 |
227 | if (res.data && res.data.status === 200) {
228 |
229 | doSuccess(res.data.data, true);
230 | } else {
231 |
232 | app.showErrorModal(res.data.message);
233 | doFail(res.data.message);
234 | }
235 | },
236 | fail: function (res) {
237 |
238 | app.showErrorModal(res.errMsg);
239 | doFail(res.errMsg);
240 | }
241 | });
242 |
243 | },
244 |
245 | // main——最优
246 | bindOpenList: function (e) {
247 | var index = !isNaN(e) ? e : parseInt(e.currentTarget.dataset.index),
248 | data = {};
249 | data['testData[' + index + '].display'] = !this.data.testData[index].display;
250 | this.setData(data);
251 | },
252 |
253 | onLoad: function (options) {
254 | var _this = this;
255 | app.loginLoad(function () {
256 | _this.loginHandler.call(_this, options);
257 | });
258 | },
259 | //让分享时自动登录
260 | loginHandler: function (options) {
261 | if (options.key) {
262 | this.setData({
263 | 'main.mainDisplay': false,
264 | 'header.defaultValue': options.key,
265 | 'header.inputValue': options.key
266 | });
267 | this.search();
268 | }
269 | },
270 |
271 | tapHelp: function (e) {
272 | if (e.target.id == 'help') {
273 | this.hideHelp();
274 | }
275 | },
276 | showHelp: function (e) {
277 | this.setData({
278 | 'header.help_status': true
279 | });
280 | },
281 | hideHelp: function (e) {
282 | this.setData({
283 | 'header.help_status': false
284 | });
285 | }
286 | });
--------------------------------------------------------------------------------
/pages/core/ts/ts.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#79d0a6",
3 | "navigationBarTitleText": "图书查询",
4 | "backgroundColor": "#79d0a6",
5 | "enablePullDownRefresh": false
6 | }
--------------------------------------------------------------------------------
/pages/core/ts/ts.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | 书籍信息:{{main.total}}本
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | {{item.title}}
53 |
54 | 作者:{{item.author}}
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | 出版社
68 | {{item.press}}
69 |
70 |
71 | 出版年
72 | {{item.pub_year}}
73 |
74 |
75 | 详情
76 | 点击查看
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | {{main.message}}
85 |
86 |
87 |
88 |
89 |
90 | 帮助
91 |
92 |
93 |
94 | 1.根据题名/作者/主题词等查询
95 |
96 | 例如:围城,可搜索到所有带有围城字样的书籍
97 |
98 | 2.图书馆开放时间
99 |
100 | 周一至周日 8:00-22:00
101 |
102 | 温馨提示:
103 | 周四下午2:30-5:30总服务台停止服务,阅览室照常开放
104 | 寒暑假、法定假日开馆时间另行通知。
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 | {{messageObj.message}}
113 |
114 |
--------------------------------------------------------------------------------
/pages/core/ts/ts.wxss:
--------------------------------------------------------------------------------
1 | /**xs.wxss**/
2 |
3 | .container {
4 | background: #f7f7f7;
5 | }
6 |
7 | .container.home {
8 | align-items: center;
9 | }
10 |
11 | /**首屏**/
12 |
13 | .home .xs-logo {
14 | width: 180rpx;
15 | height: 180rpx;
16 | opacity: 0.9;
17 | margin: 100rpx 0 30rpx;
18 | }
19 |
20 | .home .search-input {
21 | position: relative;
22 | display: flex;
23 | width: 92%;
24 | margin: 0 4%;
25 | height: 75rpx;
26 | box-shadow: 5rpx 5rpx 15rpx #e2e2e2;
27 | transition: all 0.15s ease-in-out;
28 | }
29 |
30 | .home .search-input:focus {
31 | box-shadow: 5rpx 5rpx 20rpx #d2d2d2;
32 | }
33 |
34 | .home .search-icon-box {
35 | position: absolute;
36 | z-index: 1;
37 | top: 50%;
38 | left: 20rpx;
39 | width: 38rpx;
40 | height: 38rpx;
41 | margin-top: -16rpx;
42 | }
43 |
44 | .home .input-form {
45 | position: relative;
46 | background: #fff;
47 | flex: 1;
48 | display: flex;
49 | height: 100%;
50 | padding-right: 110rpx;
51 | }
52 |
53 | .home .input-text {
54 | position: absolute;
55 | left: 0;
56 | right: 0;
57 | flex: 1;
58 | display: flex;
59 | height: 100%;
60 | padding: 0 160rpx 0 70rpx;
61 | font-size: 11pt;
62 | line-height: 150%;
63 | }
64 |
65 | .input-placeholder {
66 | color: #ccc;
67 | font-size: 11pt;
68 | line-height: 150%;
69 | }
70 |
71 | button {
72 | font-size: 11pt;
73 | background: transparent;
74 | line-height: 150%;
75 | border-radius: 0;
76 | padding: 0;
77 | border: none;
78 | }
79 |
80 | button::after {
81 | display: none;
82 | }
83 |
84 | .home .input-clear-button {
85 | position: absolute;
86 | z-index: 1;
87 | top: 50%;
88 | right: 115rpx;
89 | padding: 15rpx;
90 | margin-top: -30rpx;
91 | }
92 |
93 | .home .input-clear-button:active {
94 | opacity: 0.8;
95 | }
96 |
97 | .home .clear-icon {
98 | width: 30rpx;
99 | height: 30rpx;
100 | }
101 |
102 | .home .input-confirm-button {
103 | position: absolute;
104 | z-index: 1;
105 | top: 0;
106 | bottom: 0;
107 | right: 0;
108 | height: 75rpx;
109 | width: 110rpx;
110 | background: #79d0a6 ;
111 | color: #fff;
112 | display: flex;
113 | align-items: center;
114 | justify-content: center;
115 | opacity: 1;
116 | }
117 |
118 | .home .input-confirm-button:active {
119 | opacity: 0.8;
120 | }
121 |
122 | /* ==========================================================================
123 | header
124 | ============================================================================ */
125 |
126 | .header {
127 | width: 100%;
128 | display: flex;
129 | flex-direction: column;
130 | align-items: center;
131 | }
132 |
133 | .active .header {
134 | position: fixed;
135 | top: 0;
136 | left: 0;
137 | min-height: 85rpx;
138 | background-color: #fff;
139 | }
140 |
141 | .active .xs-logo {
142 | display: none;
143 | }
144 |
145 | /* search-input
146 | ============================================================================ */
147 |
148 | .active .search-input {
149 | position: absolute;
150 | z-index: 100;
151 | display: flex;
152 | justify-content: center;
153 | align-items: center;
154 | width: 100%;
155 | height: 85rpx;
156 | }
157 |
158 | .active .search-icon-box {
159 | position: absolute;
160 | top: 0;
161 | left: 0;
162 | display: flex;
163 | align-items: center;
164 | justify-content: center;
165 | padding: 0 20rpx;
166 | height: 85rpx;
167 | }
168 |
169 | .active .input-form {
170 | flex: 1;
171 | display: flex;
172 | position: relative;
173 | height: 85rpx;
174 | }
175 |
176 | .active .input-text {
177 | flex: 1;
178 | position: absolute;
179 | left: 0;
180 | right: 0;
181 | font-size: 11pt;
182 | line-height: 150%;
183 | box-sizing: border-box;
184 | width: 100%;
185 | height: 85rpx;
186 | padding: 0 180rpx 0 70rpx;
187 | }
188 |
189 | .active .input-clear-button {
190 | position: absolute;
191 | top: 0;
192 | right: 105rpx;
193 | display: flex;
194 | align-items: center;
195 | justify-content: center;
196 | padding: 0 20rpx;
197 | height: 85rpx;
198 | opacity: 0.95;
199 | }
200 |
201 | .active .input-clear-button .clear-icon {
202 | width: 30rpx;
203 | height: 30rpx;
204 | }
205 |
206 | .active .input-confirm-button {
207 | position: absolute;
208 | top: 0;
209 | right: 0;
210 | display: flex;
211 | align-items: center;
212 | justify-content: center;
213 | padding: 0 20rpx 0 10rpx;
214 | height: 85rpx;
215 | opacity: 0.95;
216 | }
217 |
218 | .active .input-confirm-button text {
219 | font-size: 10pt;
220 | background: #79d0a6;
221 | color: #fff;
222 | border-radius: 3px;
223 | padding: 3rpx 15rpx;
224 | }
225 |
226 | .active .input-confirm-button:active {
227 | opacity: 0.8;
228 | }
229 |
230 | /* search-state
231 | ============================================================================ */
232 |
233 | .search-state {
234 | flex: 1;
235 | display: flex;
236 | justify-content: center;
237 | align-items: center;
238 | }
239 |
240 | .search-icon {
241 | width: 30rpx;
242 | height: 30rpx;
243 | }
244 |
245 | .state-text {
246 | margin-left: 20rpx;
247 | color: #b1b1b1;
248 | text-align: center;
249 | }
250 |
251 | /* ==========================================================================
252 | search-message
253 | ============================================================================ */
254 |
255 | .search-message {
256 | display: flex;
257 | align-items: center;
258 | justify-content: center;
259 | height: 100rpx;
260 | }
261 |
262 | .message-title {
263 | color: #aaa;
264 | }
265 |
266 | /* ==========================================================================
267 | main
268 | ============================================================================ */
269 |
270 | .main {
271 | display: flex;
272 | width: 100%;
273 | flex-flow: column nowrap;
274 | overflow: hidden;
275 | margin-top: 85rpx;
276 | }
277 |
278 | /* main-title
279 | ============================================================================ */
280 |
281 | .main-title {
282 | flex: 1;
283 | margin: 35rpx 0 20rpx 25rpx;
284 | }
285 |
286 | .title-text {
287 | color: #999;
288 | }
289 |
290 | /* main-list
291 | ============================================================================ */
292 |
293 | .main-list {
294 | display: flex;
295 | flex: 1;
296 | flex-flow: column nowrap;
297 | align-items: stretch;
298 | }
299 |
300 | .list-item {
301 | display: flex;
302 | margin-bottom: 20rpx;
303 | padding: 0 20rpx;
304 | flex-flow: column nowrap;
305 | align-items: stretch;
306 | background-color: #fff;
307 | font-size: 11pt;
308 | }
309 |
310 | /* main-list > item
311 | ============================================================================ */
312 |
313 | .item {
314 | display: flex;
315 | padding: 20rpx;
316 | padding-right: 0;
317 | align-items: center;
318 | }
319 |
320 | .item-content {
321 | flex: 1;
322 | display: flex;
323 | flex-flow: row nowrap;
324 | justify-content: flex-start;
325 | align-items: center;
326 | }
327 |
328 | .item-content-image {
329 | display: flex;
330 | width: 100rpx;
331 | height: 100rpx;
332 | }
333 |
334 | .item-content-state {
335 | margin-left: 20rpx;
336 | display: flex;
337 | flex-flow: column nowrap;
338 | justify-content: center;
339 | align-content: flex-start;
340 | width:calc(100vw - 130px);
341 | }
342 |
343 | .content-state-name {
344 | font-size: 12pt;
345 | line-height: 175%;
346 | letter-spacing: 1px;
347 | width: 100%;
348 | white-space: nowrap;
349 | text-overflow: ellipsis;
350 | overflow: hidden;
351 | }
352 |
353 | .state-name-active {
354 | color: #8271bf;
355 | }
356 |
357 | .content-state-stuId {
358 | color: #999;
359 | }
360 |
361 | /* main-list > item > list-sign
362 | ============================================================================ */
363 |
364 | .list-sign {
365 | display: flex;
366 | justify-content: center;
367 | align-items: center;
368 | }
369 |
370 | .list-sign-icon {
371 | width: 30rpx;
372 | height: 30rpx;
373 | padding: 20rpx;
374 | transition: transform 0.2s;
375 | transform: rotate(0deg);
376 | }
377 |
378 | .list-sign-icon-show {
379 | transform: rotate(180deg);
380 | }
381 |
382 | /* main-list > item > item-ul
383 | ============================================================================ */
384 |
385 | .item-ul {
386 | display: flex;
387 | flex: 1;
388 | flex-flow: column nowrap;
389 | padding: 10rpx 30rpx 15rpx;
390 | overflow: hidden;
391 | }
392 |
393 | .item-ul-li {
394 | display: flex;
395 | border-top: 1px solid #eee;
396 | padding: 25rpx 5rpx 20rpx;
397 | }
398 |
399 | .ul-li-label {
400 | color: #888;
401 | width: 48pt;
402 | }
403 |
404 | .ul-li-content {
405 | flex: 1;
406 | }
407 |
408 | .ul-li-more {
409 | color: #888;
410 | font-size: 10pt;
411 | padding-left: 40rpx;
412 | }
413 |
414 | .ul-li-kb {
415 | /*background: url('/images/core/zs.png') no-repeat;*//*微信暂不支持静态bgimg文件,改用服务器url*/
416 | background: url('https://gktieba.natapp4.cc/higk/images/core/ts/ts.png') no-repeat;
417 | background-size: 30rpx 30rpx;
418 | background-position: 0 50%;
419 | }
420 |
421 | .ul-li-ks {
422 | /*background: url('/images/core/ks.png') no-repeat;*//*微信暂不支持静态bgimg文件,改用服务器url*/
423 | background: url('https://wxapp.gxgk.cc/images/core/ks.png') no-repeat;
424 | background-size: 30rpx 30rpx;
425 | background-position: 0 50%;
426 | }
427 |
428 | .container.active .header-more {
429 | display: none;
430 | }
431 |
432 | .header-more {
433 | display: flex;
434 | flex-direction: column;
435 | width: 92%;
436 | margin: 0 4%;
437 | padding-bottom: 20rpx;
438 | }
439 |
440 | .login-help {
441 | display: flex;
442 | align-items: center;
443 | justify-content: flex-end;
444 | font-size: 10pt;
445 | color: #bbb;
446 | opacity: 0.8;
447 | }
448 |
449 | .login-help-img {
450 | width: 11pt;
451 | height: 11pt;
452 | margin: 0 5rpx;
453 | }
454 |
455 | .help {
456 | position: absolute;
457 | z-index: 100;
458 | top: 0;
459 | left: 0;
460 | width: 100%;
461 | height: 100%;
462 | display: flex;
463 | align-items: center;
464 | justify-content: center;
465 | }
466 |
467 | .box {
468 | position: relative;
469 | display: flex;
470 | flex-direction: column;
471 | align-items: stretch;
472 | width: 80%;
473 | background: #fff;
474 | border-radius: 10px;
475 | box-shadow: 0 0 50px rgba(22, 22, 22, 0.35);
476 | }
477 |
478 | .box-hd {
479 | display: flex;
480 | align-items: center;
481 | justify-content: center;
482 | height: 100rpx;
483 | border-bottom: 1px solid #eee;
484 | }
485 |
486 | .box-title {
487 | font-size: 13pt;
488 | }
489 |
490 | .box-close {
491 | position: absolute;
492 | right: 20rpx;
493 | width: 35rpx;
494 | height: 35rpx;
495 | padding: 15rpx;
496 | }
497 |
498 | .box-bd {
499 | flex: 1;
500 | display: flex;
501 | flex-direction: column;
502 | padding: 15rpx 40rpx 30rpx;
503 | }
504 |
505 | .help-q {
506 | color: #999;
507 | font-size: 11pt;
508 | line-height: 200%;
509 | margin-top: 5rpx;
510 | }
511 |
512 | .help-a {
513 | text-indent: 1em;
514 | line-height: 160%;
515 | display: flex;
516 | flex-direction: column;
517 | }
518 |
519 | .help-a text {
520 | word-break: break-all;
521 | }
522 |
--------------------------------------------------------------------------------
/pages/core/tsg/tsg.js:
--------------------------------------------------------------------------------
1 | //tsg.js
2 | //获取应用实例
3 | var app = getApp();
4 | Page({
5 | data: {
6 | remind: '加载中',
7 | tsgData: {
8 | book_list: [], //当前借阅列表
9 | books_num: 0, //当前借阅量
10 | books_sum: 0, //历史借阅量
11 | dbet: 0, //欠费
12 | nothing: true //当前是否有借阅
13 | },
14 | tsgHistoryTap: false //点击历史借阅
15 | },
16 | onLoad: function() {
17 | this.getData();
18 | },
19 | onPullDownRefresh: function(){
20 | this.getData();
21 | },
22 | getData: function() {
23 | var _this = this;
24 | if(!app._user.we.ykth){
25 | _this.setData({
26 | remind: '未绑定'
27 | });
28 | return false;
29 | }
30 | //判断并读取缓存
31 | if(app.cache.tsg){ tsgRender(app.cache.tsg); }
32 | function tsgRender(info){
33 | info.nothing = !parseInt(info.books_num) || !info.book_list || !info.book_list.length;
34 | var colors = ['green','yellow','red','purple'],
35 | nowTime = new Date().getTime();
36 | if(!info.nothing){
37 | info.book_list.map(function(e){
38 | var jDate = e.jsrq.split('-'), hDate = e.yhrq.split('-'),
39 | jTime = new Date(jDate[0], jDate[1]-1, jDate[2]).getTime(),
40 | hTime = new Date(hDate[0], hDate[1]-1, hDate[2]).getTime();
41 | var sum = parseInt((hTime - jTime) / 1000 / 60 / 60 / 24),
42 | timing = parseInt((hTime - nowTime) / 1000 / 60 / 60 / 24),
43 | k = 1 - timing/sum, n = 0;
44 | if(k < 0.3) { n = 0; }
45 | else if(k < 0.7) { n = 1; }
46 | else if(k <= 1) { n = 2; }
47 | else if(k > 1) { n = 3; }
48 | e.color = colors[n];
49 | return e;
50 | });
51 | }
52 | _this.setData({
53 | tsgData: info,
54 | remind: ''
55 | });
56 | }
57 | wx.showNavigationBarLoading();
58 | wx.request({
59 | url: app._server + "/QueryBookServlet",
60 | method: 'POST',
61 | data:{
62 | openid: app._user.openid
63 | },header: {
64 | 'content-type': 'application/x-www-form-urlencoded'
65 | },
66 | success: function(res) {
67 | if(res.data && res.data.status >= 200 && res.data.status < 400) {
68 | var info = res.data.data;
69 | if(info) {
70 | //保存借阅缓存
71 | app.saveCache('tsg', info);
72 | tsgRender(info);
73 | }else{ _this.setData({ remind: '暂无数据' }); }
74 |
75 | }else{
76 | app.removeCache('tsg');
77 | _this.setData({
78 | remind: res.data.message || '未知错误'
79 | });
80 | }
81 | },
82 | fail: function(res) {
83 | if(_this.data.remind == '加载中'){
84 | _this.setData({
85 | remind: '网络错误'
86 | });
87 | }
88 | console.warn('网络错误');
89 | },
90 | complete: function() {
91 | wx.hideNavigationBarLoading();
92 | }
93 | });
94 | },
95 | tsgHistory: function(){
96 | var _this = this;
97 | if(!_this.data.tsgHistoryTap){
98 | _this.setData({
99 | tsgHistoryTap: true
100 | });
101 | setTimeout(function(){
102 | _this.setData({
103 | tsgHistoryTap: false
104 | });
105 | }, 2000);
106 | }
107 | }
108 |
109 | });
--------------------------------------------------------------------------------
/pages/core/tsg/tsg.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#9d89ea",
3 | "navigationBarTitleText": "借阅信息" ,
4 | "backgroundColor": "#9d89ea",
5 | "enablePullDownRefresh": false
6 | }
--------------------------------------------------------------------------------
/pages/core/tsg/tsg.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{remind}}
8 |
9 |
10 |
11 |
12 |
13 | 可借阅数
14 |
15 | {{tsgData.books_num}}
16 | 本
17 |
18 |
19 |
20 | 历史借阅
21 |
22 | {{tsgData.books_sum}}
23 | 本
24 |
25 |
26 |
27 | 欠费
28 |
29 | {{tsgData.dbet}}
30 | 元
31 |
32 |
33 |
34 |
35 |
36 | 当前无借阅
37 |
38 |
39 | 当前借阅记录
40 |
41 |
42 |
43 | {{itemName.book}}
44 |
45 |
46 |
47 | 借阅日期:
48 | {{itemName.jsrq}}
49 |
50 |
51 | 应还日期:
52 | {{itemName.yhrq}}
53 |
54 |
55 |
56 |
57 |
58 |
59 | 暂不能查看历史借阅详情哦~
60 |
61 |
62 |
--------------------------------------------------------------------------------
/pages/core/tsg/tsg.wxss:
--------------------------------------------------------------------------------
1 | /**tsg.wxss**/
2 | .container {
3 | background-color: #f7f7f7;
4 | }
5 | .user-tsg {
6 | display: flex;
7 | background: #fefefe;
8 | border-bottom: 1rpx solid #eee;
9 | }
10 | .user-tsg-item {
11 | flex: 1;
12 | display: flex;
13 | flex-direction: column;
14 | justify-content: center;
15 | font-size: 11pt;
16 | line-height: 150%;
17 | height: 150rpx;
18 | padding: 20rpx;
19 | border-right: 1rpx solid #eee;
20 | }
21 | .user-tsg-dbet {
22 | border: none;
23 | }
24 | .user-tsg-hd {
25 | color: #777;
26 | }
27 | .user-tsg-bd {
28 | display: flex;
29 | justify-content: center;
30 | }
31 | .user-tsg-value {
32 | font-size: 28pt;
33 | color: #9d89ea;
34 | font-weight: bold;
35 | line-height: 150%;
36 | padding: 0 20rpx 0 30rpx;
37 | }
38 | .user-tsg-text {
39 | color: #999;
40 | font-size: 10pt;
41 | line-height: 200%;
42 | align-self: flex-end;
43 | }
44 | .book-list {
45 | display: flex;
46 | flex-direction: column;
47 | align-items: stretch;
48 | padding: 25rpx 30rpx;
49 | }
50 | .current-type {
51 | color: #777;
52 | font-size: 10pt;
53 | line-height: 200%;
54 | margin-bottom: 15rpx;
55 | }
56 | .book-wraper {
57 | display: flex;
58 | flex-direction: column;
59 | align-items: stretch;
60 | justify-content: space-between;
61 | overflow: hidden;
62 | padding: 35rpx 30rpx 10rpx;
63 | margin-bottom: 20rpx;
64 | background: #fff;
65 | border-radius: 3px;
66 | }
67 | .book-name {
68 | font-size: 15pt;
69 | line-height: 135%;
70 | word-break: break-all;
71 | }
72 | .book-date {
73 | display: flex;
74 | align-items: flex-end;
75 | justify-content: space-between;
76 | margin-top: 25rpx;
77 | font-size: 9pt;
78 | color: #888;
79 | }
80 | .yhrq-value{
81 | font-size: 13pt;
82 | }
83 |
84 | .book-img {
85 | height: 13pt;
86 | width: 13pt;
87 | margin-top: 2pt;
88 | margin-right: 10rpx;
89 | }
--------------------------------------------------------------------------------
/pages/core/xyk/xyk.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#ffcb63",
3 | "navigationBarTitleText": "校园卡" ,
4 | "backgroundColor": "#ffcb63",
5 | "enablePullDownRefresh": false
6 | }
--------------------------------------------------------------------------------
/pages/core/xyk/xyk.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{remind}}
8 |
9 |
10 |
11 |
12 |
13 |
14 | 广东科学技术职业学院
15 |
16 |
17 |
18 | 余额
19 |
20 | {{balance}}元
21 |
22 |
23 |
26 |
27 |
28 |
29 | 卡号:{{xyk_id}}
30 |
31 |
32 |
33 |
34 |
35 |
36 | 校园卡详情
37 |
38 |
39 | 卡片状态:{{status}}
40 |
41 |
42 | 卡片余额:{{balance}}元
43 |
44 |
45 | 昨日消费:{{yesterdayconsume}}
46 |
47 |
48 | 一周消费:{{weekconsume}}
49 |
50 |
51 | 截至时间:{{lasttime}}
52 |
53 |
54 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/pages/core/xyk/xyk.wxss:
--------------------------------------------------------------------------------
1 | /**xyk.wxss**/
2 | .container {
3 | background-color: #f7f7f7;
4 | padding-left: 30rpx;
5 | padding-right: 30rpx;
6 | }
7 |
8 | /* 余额卡片 */
9 | .xyk-card {
10 | display: flex;
11 | flex-direction: column;
12 | height: 350rpx;
13 | margin:15rpx 50rpx 60rpx;
14 | /* background: #ffcc61; */
15 | background: -webkit-linear-gradient(bottom left, #ffcc99,#ffcc66, #ffcc33, #ffcc00);
16 | border-radius: 15rpx;
17 | box-shadow: 5rpx 5rpx 15rpx #ccc;
18 | }
19 | .xyk-hd {
20 | display: flex;
21 | flex-direction: row;
22 | /* justify-content: space-between; */
23 | font-size: 10pt;
24 | padding: 25rpx;
25 | }
26 | /* .xyk-chip {
27 | width: 100rpx;
28 | height: 80rpx;
29 | border-radius: 10rpx;
30 | margin: 40rpx 40rpx 0;
31 | background: #e6e8fa;
32 | } */
33 | /* .xyk-title {
34 | font-size: 30px;
35 | text-align: right;
36 | margin: 40rpx 40rpx 0;
37 | } */
38 | .xyk-content {
39 | flex: 1;
40 | display: flex;
41 | align-items: center;
42 | justify-content: space-between;
43 | margin-left: 80rpx;
44 | }
45 | .xyk-ye {
46 | flex: 1;
47 | display: flex;
48 | flex-direction: column;
49 | padding-right: 50rpx;
50 | color: #777;
51 | }
52 | .xyk-ye-name {
53 | font-size: 11pt;
54 | line-height: 50rpx;
55 | padding-left: 30rpx;
56 | }
57 | .xyk-ye-money {
58 | text-align: center;
59 | font-size: 10pt;
60 | margin-right: 10rpx;
61 | }
62 | .xyk-ye-value {
63 | font-size: 36pt;
64 | font-weight: bold;
65 | line-height: 80rpx;
66 | padding-right: 25prx;
67 | }
68 | .xyk-card-more {
69 | display: flex;
70 | justify-content: space-between;
71 | align-items: flex-end;
72 | margin: 5rpx 25rpx 10rpx 25rpx;
73 | line-height: 100%;
74 | opacity: .6;
75 | z-index: 1;
76 | }
77 | .tblogo {
78 | height: 80rpx;
79 | width: 160rpx;
80 | }
81 | .xyk-ye-time {
82 | font-size: 9pt;
83 | }
84 | .xyk-ye-id {
85 | font-size: 10pt;
86 | }
87 |
88 | /* 今日余额 */
89 | /*
90 | .xyk-card {
91 | display: flex;
92 | flex-direction: column;
93 | height: 350rpx;
94 | margin: 15rpx 50rpx 60rpx;
95 | background: #ffcb63;
96 | border-radius: 15rpx;
97 | box-shadow: 5rpx 5rpx 15rpx #ccc;
98 | }
99 | .xyk-black-line {
100 | width: 100%;
101 | height: 80rpx;
102 | margin: 40rpx 0 0;
103 | background: #7b7b7b;
104 | }
105 | .xyk-content {
106 | flex: 1;
107 | display: flex;
108 | align-items: center;
109 | justify-content: space-between;
110 | }
111 | .xyk-ye {
112 | flex: 1;
113 | display: flex;
114 | flex-direction: column;
115 | padding-right: 50rpx;
116 | color: #777;
117 | }
118 | .xyk-ye-name {
119 | font-size: 11pt;
120 | line-height: 50rpx;
121 | padding-left: 30rpx;
122 | }
123 | .xyk-ye-money {
124 | text-align: center;
125 | font-size: 10pt;
126 | }
127 | .xyk-ye-value {
128 | font-size: 36pt;
129 | font-weight: bold;
130 | line-height: 80rpx;
131 | padding-right: 25rpx;
132 | }
133 | .xyk-img {
134 | display: flex;
135 | align-items: center;
136 | justify-content: center;
137 | width: 200rpx;
138 | }
139 | .xyk-img image {
140 | width: 125rpx;
141 | height: 125rpx;
142 | padding: 20rpx 30rpx;
143 | }
144 | .xyk-card-more {
145 | display: flex;
146 | justify-content: space-between;
147 | align-items: flex-end;
148 | margin: 5rpx 25rpx 10rpx 25rpx;
149 | line-height: 100%;
150 | opacity: .6;
151 | }
152 | .xyk-ye-time {
153 | font-size: 9pt;
154 | }
155 | .xyk-ye-id {
156 | font-size: 10pt;
157 | }
158 | */
159 |
160 | /* 详细信息 */
161 | .xyk-xx {
162 | display: flex;
163 | margin: 0 auto;
164 | flex-direction: column;
165 | /* height: 500rpx; */
166 | width: 650rpx;
167 | background: #fff;
168 | /* border: 1rpx solid #aaa; */
169 | border-radius: 10rpx;
170 | /* box-shadow: 5rpx 5rpx 15rpx #ccc; */
171 | }
172 | .xyk-xx-hd {
173 | font-size: 18px;
174 | text-align: center;
175 | color: #777;
176 | padding-top: 20rpx;
177 | }
178 | .xyk-xx-content {
179 | font-size: 14px;
180 | color:#777;
181 | border-top: 1px solid #ddd;
182 | padding-left: 25rpx;
183 | padding-bottom: 15rpx;
184 | margin:0 40rpx 15rpx;
185 | }
186 |
187 |
188 | /* canvas */
189 | .grid-remind {
190 | padding-left: 40rpx;
191 | color: #999;
192 | margin-bottom: 25rpx;
193 | }
194 |
195 | /* 余额、消费切换按钮 */
196 | .balance-consumption {
197 | display: flex;
198 | margin: 0 45rpx 10rpx;
199 | border-radius: 5px;
200 | box-shadow: 0 0 10rpx #ddd;
201 | overflow: hidden;
202 | }
203 | .balance-consumption text {
204 | flex: 1;
205 | flex-shrink: 0;
206 | line-height: 150%;
207 | font-size: 10pt;
208 | padding: 12rpx 0;
209 | font-weight: bold;
210 | text-align: center;
211 | background: #fff;
212 | }
213 | .balance-consumption .current-btn {
214 | color: #fff;
215 | background: #ffcb63;
216 | }
217 |
218 | /* 网格 */
219 | .grid-wraper {
220 | display: flex;
221 | align-items: center;
222 | justify-content: center;
223 | position: relative;
224 | margin-top: 50rpx;
225 | width: 100%;
226 | height: 300px;
227 | }
228 | #xyk-canvas {
229 | position: absolute;
230 | top: 0;
231 | right: 0;
232 | left: 0;
233 | bottom: 0;
234 | z-index: 1;
235 | width: 100%;
236 | height: 100%;
237 | }
238 |
239 | /* 详情竖线 */
240 | .line {
241 | position: absolute;
242 | z-index: 999;
243 | top: 15px;
244 | height: 265px;
245 | width: 3px;
246 | background: #e78ab0;
247 | }
248 |
249 | /* 横纵坐标的含义 */
250 | .y-text {
251 | position: absolute;
252 | left: 15rpx;
253 | top: -40rpx;
254 | padding: 0 10rpx;
255 | font-size: 24rpx;
256 | color: #999;
257 | }
258 | .x-text{
259 | position: absolute;
260 | right: 25rpx;
261 | bottom: -10rpx;
262 | padding: 0 10rpx;
263 | font-size: 24rpx;
264 | color: #999;
265 | }
266 |
267 | /* 详情盒子 */
268 | .detail-remind {
269 | font-size: 9pt;
270 | line-height: 100%;
271 | color: #aaa;
272 | text-align: center;
273 | margin: 30rpx 5rpx;
274 | }
275 | .xyk-detail-wraper {
276 | display: flex;
277 | flex-direction: column;
278 | margin: 0 30rpx 30rpx;
279 | background: #fff;
280 | border-radius: 3px;
281 | }
282 | .xyk-detail {
283 | display: flex;
284 | flex-direction: column;
285 | padding: 0 10rpx;
286 | overflow: hidden;
287 | }
288 | .xyk-head {
289 | display: flex;
290 | justify-content: center;
291 | align-items: center;
292 | height: 120rpx;
293 | }
294 | .xyk-type-name {
295 | font-size: 11pt;
296 | }
297 | .detail-list {
298 | display: flex;
299 | flex-direction: column;
300 | align-items: stretch;
301 | padding: 0 35rpx 10rpx;
302 | }
303 | .detail-item {
304 | display: flex;
305 | justify-content: space-between;
306 | align-items: center;
307 | padding: 25rpx 5rpx 20rpx;
308 | border-top: 1px solid #eee;
309 | }
310 | .detail-item-label {
311 | color: #888;
312 | width: 60pt;
313 | }
314 | .detail-item-value {
315 | flex: 1;
316 | }
--------------------------------------------------------------------------------
/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 离线缓存模式
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | {{item.name}}
13 |
14 |
15 |
16 | {{item.name}}
17 |
18 |
19 |
20 | 请先绑定帐号
21 | {{(user.teacher && !offline) ? '无权限' : '该服务不可用'}}
22 |
23 |
24 |
25 |
26 |
27 |
28 | {{remind}}
29 | 前往绑定
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | 今日课表
41 |
42 |
43 | 今天居然没有课~
44 |
45 |
46 |
47 |
48 |
49 | {{item.what}}
50 | {{item.when}}
51 |
52 | {{item.where}}
53 |
54 |
55 |
56 | 查看完整课表
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | 校园卡
67 |
68 |
69 |
70 |
71 | 余额:
72 |
73 |
74 | 截至时间:{{card.xyk.data.lasttime}}
75 |
76 |
77 |
78 | {{card.xyk.data.balance}}
79 | 元
80 |
81 |
82 | 今日消费:
83 |
84 |
85 | {{item}}
86 | +
87 |
88 | =
89 | {{card.xyk.data.today_cost.total}}
90 | 元
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 | 图书馆
103 |
104 |
105 |
106 |
107 | {{user.we.info.name}}
108 | {{user.we.info.id}}
109 |
110 |
111 | 当前借阅:{{card.tsg.data.books_num}}
112 |
113 |
114 |
115 |
116 |
117 |
118 | {{item.jsrq}}
119 | 借
120 |
121 | {{item.book}}
122 |
123 |
124 | {{item.yhrq}}
125 | 还
126 |
127 |
128 | 还有
129 | 已超过
130 | {{item.timing>=0?item.timing:-item.timing}}
131 | 天
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
175 |
176 |
177 |
182 |
183 |
184 |
--------------------------------------------------------------------------------
/pages/more/about.js:
--------------------------------------------------------------------------------
1 | //about.js
2 | //获取应用实例
3 | var app = getApp();
4 | Page({
5 | data: {
6 | version: '',
7 | showLog: false
8 | },
9 | onLoad: function(){
10 | this.setData({
11 | version: app.version,
12 | year: new Date().getFullYear()
13 | });
14 | },
15 | toggleLog: function(){
16 | this.setData({
17 | showLog: !this.data.showLog
18 | });
19 | }
20 | });
--------------------------------------------------------------------------------
/pages/more/about.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "关于",
3 | "enablePullDownRefresh": false
4 | }
--------------------------------------------------------------------------------
/pages/more/about.wxss:
--------------------------------------------------------------------------------
1 | /**about.wxss**/
2 | .container{
3 | background: #f4f4f4;
4 | padding: 0;
5 | font-size: 11pt;
6 | }
7 | .header{
8 | position: relative;
9 | width: 100%;
10 | height: 400rpx;
11 | text-align: center;
12 | box-sizing: border-box;
13 | overflow: hidden;
14 | display: flex;
15 | align-items: center;
16 | justify-content: center;
17 | }
18 | .header .title{
19 | position: relative;
20 | width: 600rpx;
21 | height: 200rpx;
22 | z-index: 3;
23 | opacity: .95;
24 | }
25 | .black-cover{
26 | position: absolute;
27 | z-index: 2;
28 | top:0;
29 | left: 0;
30 | width: 100%;
31 | height: 100%;
32 | background: #888;
33 | opacity: .18;
34 | }
35 | .logo{
36 | position: absolute;
37 | top:0;
38 | left: 0;
39 | z-index: 1;
40 | width: 100%;
41 | height: 750rpx;
42 | border-radius: 10rpx;
43 | margin-top: -175rpx;
44 | filter: blur(15px);
45 | }
46 | .content{
47 | flex: 1;
48 | }
49 | .version{
50 | height: 100rpx;
51 | background: #fff;
52 | display: flex;
53 | align-items: center;
54 | padding: 0 45rpx;
55 | box-sizing: border-box;
56 | font-size: 13pt;
57 | color: #666;
58 | border-bottom: 1px #e5e5e5 solid;
59 | }
60 | .version-title{
61 | flex: 1;
62 | display: flex;
63 | align-items: center;
64 | }
65 | .title-name{
66 | padding-right: 10rpx;
67 | }
68 | .version-text{
69 | font-size: 10pt;
70 | line-height: 100%;
71 | color: #7acfa6;
72 | border: 1px solid #7acfa6;
73 | padding: 5rpx 10rpx;
74 | border-radius: 5rpx;
75 | margin-left: 10rpx;
76 | text-align: center;
77 | }
78 | .version-log-link{
79 | position: relative;
80 | font-size: 12pt;
81 | color: #7acfa6;
82 | }
83 | .version-log-link:active{
84 | opacity: .8;
85 | }
86 | .update-log::after{
87 | content: '';
88 | position: absolute;
89 | right: -3px;
90 | top: -1px;
91 | width: 5px;
92 | height: 5px;
93 | border-radius: 50%;
94 | background: #e55c5c;
95 | }
96 | .log-list{
97 | display: flex;
98 | flex-direction: column;
99 | align-items: stretch;
100 | }
101 | .describe{
102 | width: 100%;
103 | box-sizing: border-box;
104 | padding: 20rpx 45rpx 30rpx;
105 | display: flex;
106 | flex-flow: column nowrap;
107 | color: #545454;
108 | line-height: 175%;
109 | background: #fff;
110 | margin-top: 15rpx;
111 | border-top: 1px #e5e5e5 solid;
112 | border-bottom: 1px #e5e5e5 solid;
113 | }
114 | .desc-title{
115 | display: flex;
116 | font-size: 13pt;
117 | line-height: 200%;
118 | margin-bottom: 15rpx;
119 | }
120 | .desc-v{
121 | flex: 1;
122 | }
123 | .desc-time{
124 | font-size: 11pt;
125 | color: #888;
126 | }
127 | .desc-list{
128 | display: flex;
129 | flex-direction: column;
130 | border-left: 8rpx solid #ddd;
131 | padding-left: 15rpx;
132 | color: #777;
133 | margin-bottom: 15rpx;
134 | font-size: 10pt;
135 | }
136 | .desc-content{
137 | padding-bottom: 15rpx;
138 | }
139 | .footer{
140 | display: flex;
141 | flex-direction: column;
142 | font-size: 9pt;
143 | line-height: 150%;
144 | text-align: center;
145 | padding: 100rpx 0 15rpx;
146 | color: #c2c2c2;
147 | }
148 | .footer-lanshan{
149 | font-size: 10pt;
150 | height: 10pt;
151 | line-height: 10pt;
152 | display: flex;
153 | align-items: center;
154 | justify-content: center;
155 | margin-bottom: 8rpx;
156 | }
157 | .footer-lanshan image{
158 | width: 10pt;
159 | height: 10pt;
160 | margin-right: 5rpx;
161 | }
162 |
--------------------------------------------------------------------------------
/pages/more/append.js:
--------------------------------------------------------------------------------
1 | //append.js
2 | //获取应用实例
3 | var app = getApp();
4 | Page({
5 | data: {
6 | remind: '加载中',
7 | building_list: ['1','2','3','4','5','6','8','9',
8 | '10','11','12','15','16','17','18','19',
9 | '20','21','22','23A','23B','24','25','26','27','28','29',
10 | '30','31','32','33','34','35','36','37','39'], //寝室楼栋
11 | buildings: ['1栋(知行苑1舍)', '2栋(知行苑2舍)', '3栋(知行苑3舍)', '4栋(知行苑4舍)', '5栋(知行苑5舍)', '6栋(知行苑6舍)', '8栋(宁静苑1舍)', '9栋(宁静苑2舍)',
12 | '10栋(宁静苑3舍)', '11栋(宁静苑4舍)', '12栋(宁静苑5舍)', '15栋(知行苑7舍)', '16栋(知行苑8舍)', '17栋(兴业苑1舍)', '18栋(兴业苑2舍)', '19栋(兴业苑3舍)',
13 | '20栋(兴业苑4舍)', '21栋(兴业苑5舍)', '22栋(兴业苑6舍)', '23A栋(兴业苑7舍)', '23B栋(兴业苑8舍)', '24栋(明理苑1舍)', '25栋(明理苑2舍)', '26栋(明理苑3舍)', '27栋(明理苑4舍)', '28栋(明理苑5舍)', '29栋(明理苑6舍)',
14 | '30栋(明理苑7舍)', '31栋(明理苑8舍)', '32栋(宁静苑6舍)', '33栋(宁静苑7舍)', '34栋(宁静苑8舍)', '35栋(宁静苑9舍)', '36栋(四海苑1舍)', '37栋(四海苑2舍)', '39栋(明理苑9舍)'], // picker-range
15 | ibuilding: false, // picker-index
16 | room_focus: false,
17 | room: '',
18 | angle: 0
19 | },
20 | onLoad: function(){
21 | var _this = this;
22 | if(app._user.we.build){
23 | _this.data.buildings.forEach(function(e,i){
24 | if(e.split("栋")[0] == app._user.we.build){
25 | _this.setData({
26 | ibuilding: i
27 | });
28 | }
29 | });
30 | }
31 | if(app._user.we.room){
32 | _this.setData({
33 | 'room': app._user.we.room
34 | });
35 | }
36 | wx.onAccelerometerChange(function(res) {
37 | var angle = -(res.x*30).toFixed(1);
38 | if(angle>14){ angle=14; }
39 | else if(angle<-14){ angle=-14; }
40 | if(_this.data.angle !== angle){
41 | _this.setData({
42 | angle: angle
43 | });
44 | }
45 | });
46 | },
47 | onReady: function(){
48 | var _this = this;
49 | setTimeout(function(){
50 | _this.setData({
51 | remind: ''
52 | });
53 | }, 1000);
54 | },
55 | buildingPicker: function(e) {
56 | this.setData({
57 | ibuilding: e.detail.value
58 | });
59 | },
60 | inputFocus: function(e){
61 | if(e.target.id == 'room'){
62 | this.setData({
63 | 'room_focus': true
64 | });
65 | }
66 | },
67 | inputBlur: function(e){
68 | if(e.target.id == 'room'){
69 | this.setData({
70 | 'room_focus': false
71 | });
72 | }
73 | },
74 | roomInput: function(e){
75 | this.setData({
76 | 'room': e.detail.value
77 | });
78 | if(e.detail.value.length >= 3){
79 | wx.hideKeyboard();
80 | }
81 | },
82 | confirm: function(){
83 | var _this = this;
84 | if(app.g_status){
85 | app.showErrorModal(app.g_status, '提交失败');
86 | return;
87 | }
88 | var data = {
89 | openid: app._user.openid
90 | };
91 | if(!_this.data.ibuilding || !_this.data.room){
92 | app.showErrorModal('请填写完整的表单信息', '提醒');
93 | return false;
94 | }
95 | var buildText = _this.data.buildings[_this.data.ibuilding];
96 | var build = buildText.split("栋")[0];
97 | data.build = build;
98 | data.room = _this.data.room;
99 | app.showLoadToast();
100 | wx.request({
101 | url: app._server + '/api/users/set_info.php',
102 | data: app.key(data),
103 | method: 'POST',
104 | success: function(res){
105 | if(res.data && res.data.status === 200){
106 | app.appendInfo(data);
107 | wx.showToast({
108 | title: '保存成功',
109 | icon: 'success',
110 | duration: 2000
111 | });
112 | wx.navigateBack();
113 | }else{
114 | wx.hideToast();
115 | app.showErrorModal(res.data.message);
116 | }
117 | },
118 | fail: function(res) {
119 | wx.hideToast();
120 | app.showErrorModal(res.errMsg);
121 | }
122 | })
123 | }
124 | });
--------------------------------------------------------------------------------
/pages/more/append.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": " ",
3 | "enablePullDownRefresh": false,
4 | "disableScroll": true
5 | }
--------------------------------------------------------------------------------
/pages/more/append.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | 完善信息
16 |
29 |
30 | 保存
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/pages/more/append.wxss:
--------------------------------------------------------------------------------
1 | /**append.wxss**/
2 | @import './login.wxss';
3 | .append-title {
4 | position: absolute;
5 | top: 75rpx;
6 | width: 100%;
7 | color: #777;
8 | font-size: 22pt;
9 | line-height: 200%;
10 | text-align: center;
11 | }
12 | .append-form {
13 | padding: 150rpx 0 50rpx;
14 | }
15 | .append-form .input-group {
16 | padding: 20rpx 8rpx;
17 | margin: 30rpx 3%;
18 | }
19 | .append-form .input-label {
20 | font-size: 11pt;
21 | height: 20rpx;
22 | line-height: 20rpx;
23 | padding: 0 20rpx;
24 | }
25 | .append-form .input-group input,
26 | .append-form .input-group picker {
27 | font-size: 11pt;
28 | padding: 0 20rpx;
29 | }
--------------------------------------------------------------------------------
/pages/more/issues.js:
--------------------------------------------------------------------------------
1 | //issues.js
2 | //获取应用实例
3 | var app = getApp();
4 | Page({
5 | data: {
6 | list_remind: '加载中',
7 | list: {
8 | status: false, //是否显示列表
9 | count: '-', //次数
10 | data: [], //列表内容
11 | open: 0 //被展示的序号
12 | },
13 | title: '',
14 | content: '',
15 | info: '',
16 | imgs: [],
17 | imgLen: 0,
18 | upload: false,
19 | uploading: false,
20 | qiniu: '',
21 | showError: false
22 | },
23 | onLoad: function(){
24 | var _this = this;
25 | wx.getSystemInfo({
26 | success: function(res) {
27 | var info = '---\r\n**用户信息**\r\n';
28 | info += '用户名:' + app._user.wx.nickName;
29 | if(app._user.we.type){
30 | info += '(' + app._user.we.type + '-' + app._user.we.info.name + '-' + app._user.we.info.id + ')';
31 | }
32 | info += '\r\n手机型号:' + res.model;
33 | info += '('+res.platform+' - '+res.windowWidth+'x'+res.windowHeight+ ')';
34 | info += '\r\n微信版本号:' + res.version;
35 | //info += '\r\nWe重邮版本号:' + app.version;
36 | info += '\r\nHi广科版本号:' + app.version;
37 | _this.setData({
38 | info: info
39 | });
40 | }
41 | });
42 | if(app.g_status){ return; }
43 | wx.showNavigationBarLoading();
44 | wx.request({
45 | url: app._server + '/api/get_feedback.php',
46 | method: 'POST',
47 | data: app.key({
48 | openid: app._user.openid
49 | }),
50 | success: function(res){
51 | if(res.data.status === 200){
52 | var list = res.data.data;
53 | if(list && list.length){
54 | _this.setData({
55 | 'list.count': list.length,
56 | 'list.data': list,
57 | 'list_remind': ''
58 | });
59 | }else{
60 | _this.setData({
61 | 'list_remind': '暂无反馈记录',
62 | 'list.count': 0
63 | });
64 | }
65 | }else{
66 | _this.setData({
67 | 'list_remind': '加载失败'
68 | });
69 | }
70 | },
71 | fail: function(){
72 | _this.setData({
73 | 'list_remind': '加载失败'
74 | });
75 | },
76 | complete: function() {
77 | wx.hideNavigationBarLoading();
78 | }
79 | });
80 | wx.request({
81 | url: app._server + '/api/upload/get_upload_token.php',
82 | method: 'POST',
83 | data: app.key({
84 | openid: app._user.openid
85 | }),
86 | success: function(res){
87 | if(res.data.status === 200){
88 | _this.setData({
89 | upload: true,
90 | qiniu: res.data.data.token
91 | });
92 | }
93 | },
94 | complete: function() {
95 | wx.hideNavigationBarLoading();
96 | }
97 | });
98 | },
99 | getIssue: function(id, index) {
100 | var _this = this, thedata = _this.data.list.data[index];
101 | if(!thedata.content){
102 | _this.setData({
103 | 'item_remind': '加载中...'
104 | });
105 | }else{ return; }
106 | wx.showNavigationBarLoading();
107 | wx.request({
108 | url: 'https://api.github.com/repos/higuangke/higk/issues' + id,
109 | //url: 'https://api.github.com/repos/lanshan-studio/wecqupt/issues/' + id,
110 | success: function(res){
111 | var data = {}, content = res.data;
112 | content.body = content.body.split('\r\n\r\n---\r\n**用户信息**\r\n')[0];
113 | data['list.data['+index+'].content'] = content;
114 | data['item_remind'] = '';
115 | _this.setData(data);
116 | },
117 | fail: function() {
118 | _this.setData({
119 | 'item_remind': '加载失败'
120 | });
121 | },
122 | complete: function() {
123 | wx.hideNavigationBarLoading();
124 | }
125 | });
126 | wx.request({
127 | //url: 'https://api.github.com/repos/lanshan-studio/wecqupt/issues/' + id + '/comments',
128 | url: 'https://api.github.com/repos/higuangke/higk/issues' + id + '/comments',
129 | success: function(res){
130 | var data = {};
131 | data['list.data['+index+'].comments'] = res.data;
132 | _this.setData(data);
133 | },
134 | complete: function() {
135 | wx.hideNavigationBarLoading();
136 | }
137 | });
138 | },
139 | openList: function(e) {
140 | var _this = this, list = _this.data.list;
141 | if(!list.status && list.count){
142 | _this.getIssue(list.data[0].issues, 0);
143 | }
144 | _this.setData({
145 | 'list.status': !list.status
146 | });
147 | },
148 | openItem: function(e) {
149 | var _this = this, index = e.currentTarget.dataset.index, list = _this.data.list;
150 | if(index != list.open){
151 | _this.getIssue(list.data[index].issues, index);
152 | _this.setData({
153 | 'list.open': index
154 | });
155 | }
156 | },
157 | listenerTitle: function(e){
158 | this.setData({
159 | 'title': e.detail.value
160 | });
161 | },
162 | listenerTextarea: function(e){
163 | this.setData({
164 | 'content': e.detail.value
165 | });
166 | },
167 | choosePhoto: function() {
168 | var _this = this;
169 | wx.showModal({
170 | title: '提示',
171 | content: '上传图片需要消耗流量,是否继续?',
172 | confirmText: '继续',
173 | success: function(res) {
174 | if (res.confirm) {
175 | wx.chooseImage({
176 | count: 4,
177 | sourceType: ['album'],
178 | success: function (res) {
179 | var tempFilePaths = res.tempFilePaths, imgLen = tempFilePaths.length;
180 | _this.setData({
181 | uploading: true,
182 | imgLen: _this.data.imgLen + imgLen
183 | });
184 | tempFilePaths.forEach(function(e){
185 | _this.uploadImg(e);
186 | });
187 | }
188 | });
189 | }
190 | }
191 | });
192 | },
193 | uploadImg: function(path){
194 | var _this = this;
195 | if(app.g_status){
196 | app.showErrorModal(app.g_status, '上传失败');
197 | return;
198 | }
199 | wx.showNavigationBarLoading();
200 | // 上传图片
201 | wx.uploadFile({
202 | url: 'https://up.qbox.me',
203 | header: {
204 | 'Content-Type': 'multipart/form-data'
205 | },
206 | filePath: path,
207 | name: 'file',
208 | formData:{
209 | token: _this.data.qiniu
210 | },
211 | success: function(res){
212 | var data = JSON.parse(res.data);
213 | if(data.key){
214 | _this.setData({
215 | imgs: _this.data.imgs.concat('http://wecqupt.congm.in/'+data.key)
216 | });
217 | }
218 | if(_this.data.imgs.length === _this.data.imgLen){
219 | _this.setData({
220 | uploading: false
221 | });
222 | }
223 | },
224 | fail: function(res){
225 | _this.setData({
226 | imgLen: _this.data.imgLen - 1
227 | });
228 | },
229 | complete: function() {
230 | wx.hideNavigationBarLoading();
231 | }
232 | });
233 | },
234 | previewPhoto: function(e){
235 | var _this = this;
236 | //预览图片
237 | if(_this.data.uploading){
238 | app.showErrorModal('正在上传图片', '预览失败');
239 | return false;
240 | }
241 | wx.previewImage({
242 | current: _this.data.imgs[e.target.dataset.index],
243 | urls: _this.data.imgs
244 | });
245 | },
246 | submit: function(){
247 | var _this = this, title = '', content = '', imgs = '';
248 | if(app.g_status){
249 | app.showErrorModal(app.g_status, '提交失败');
250 | return;
251 | }
252 | _this.setData({
253 | showError: true
254 | });
255 | if(_this.data.uploading || !_this.data.title || !_this.data.content){
256 | return false;
257 | }
258 | wx.showModal({
259 | title: '提示',
260 | content: '是否确认提交反馈?',
261 | success: function(res) {
262 | if (res.confirm) {
263 | title = '【' + app._user.wx.nickName + '】' + _this.data.title;
264 | content = _this.data.content + '\r\n\r\n' + _this.data.info;
265 | if(_this.data.imgLen){
266 | _this.data.imgs.forEach(function(e){
267 | imgs += '\r\n\r\n' + '';
268 | });
269 | content += imgs;
270 | }
271 | app.showLoadToast();
272 | wx.request({
273 | url: app._server + '/api/feedback.php',
274 | data: app.key({
275 | openid: app._user.openid,
276 | title: title,
277 | body: content
278 | }),
279 | method: 'POST',
280 | success: function(res){
281 | if(res.data.status === 200){
282 | var text = '反馈成功,您可通过访问 ' + res.data.data.html_url + ' 了解反馈动态';
283 | wx.showModal({
284 | title: '反馈成功',
285 | content: text,
286 | showCancel: false,
287 | success: function(res) {
288 | wx.navigateBack();
289 | }
290 | });
291 | }else{
292 | app.showErrorModal(res.data.message, '提交失败');
293 | }
294 | },
295 | fail: function(res) {
296 | app.showErrorModal(res.errMsg, '提交失败');
297 | },
298 | complete: function() {
299 | wx.hideToast();
300 | }
301 | });
302 | }
303 | }
304 | });
305 | }
306 | });
--------------------------------------------------------------------------------
/pages/more/issues.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "反馈",
3 | "enablePullDownRefresh": false
4 | }
--------------------------------------------------------------------------------
/pages/more/issues.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 我的反馈记录({{list.count}}次)
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | #{{item.issues}}
17 |
18 |
19 | {{label.name}}
20 |
21 | 已解决
22 | 进行中
23 |
24 |
25 |
26 | {{item.title}}
27 |
28 |
29 |
30 |
31 |
32 | {{item_remind ? item_remind : item.content.body}}
33 |
40 |
41 |
42 |
43 | 该反馈记录仅显示了反馈及回复的内容摘要,若要了解反馈详细,请访问 https://github.com/lanshan-studio/wecqupt/issues We重邮-Github。
44 |
45 | {{list_remind}}
46 |
47 |
48 |
49 | 新建反馈
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | 选择图片(可选)
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | 您的反馈将会以Issues的形式提交至Hi广科的Github,您可通过访问(暂未开放) 来了解反馈动态;此外,您还可以加入Hi广科用户反馈QQ群:13759433 进行即时反馈。另注:频繁恶意反馈的用户将取消其反馈资格。
71 |
72 | 提交反馈
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/pages/more/issues.wxss:
--------------------------------------------------------------------------------
1 | /**issuse.wxss**/
2 | .container{
3 | background-color: #f6f6f6;
4 | padding: 0;
5 | padding-top: 30rpx;
6 | font-size: 11pt;
7 | box-sizing: border-box;
8 | }
9 | .list-btn {
10 | align-items: center;
11 | font-size: 11pt;
12 | padding: 0 30rpx 0 10px;
13 | margin-bottom: 10rpx;
14 | display: flex;
15 | background-color: #fff;
16 | min-height: 85rpx;
17 | border-top: 1px solid #e5e5e5;
18 | border-bottom: 1px solid #e5e5e5;
19 | }
20 | .list-btn:active {
21 | background-color: #fcfcfc;
22 | }
23 | .btn-icon {
24 | width: 45rpx;
25 | height: 45rpx;
26 | margin-right: 15rpx;
27 | }
28 | .btn-text{
29 | flex: 1;
30 | margin: 20rpx 0 15rpx;
31 | }
32 | .btn-open {
33 | flex-shrink: 0;
34 | display: flex;
35 | align-items: center;
36 | justify-content: flex-end;
37 | margin-left: 10rpx;
38 | }
39 | .btn-open-img {
40 | width: 30rpx;
41 | height: 30rpx;
42 | }
43 | .issues-list{
44 | display: flex;
45 | flex-direction: column;
46 | align-items: stretch;
47 | margin-top: 10rpx;
48 | }
49 | .item-labels{
50 | flex: 1;
51 | }
52 | .item-label{
53 | flex: 1;
54 | background: #7acfa6;
55 | color: #fff;
56 | font-size: 9pt;
57 | padding: 4rpx 10rpx;
58 | border-radius: 3px;
59 | margin: 0 5rpx;
60 | }
61 | .item-status{
62 | font-size: 10pt;
63 | color: #999;
64 | }
65 | .issues-item{
66 | position: relative;
67 | display: flex;
68 | flex-direction: column;
69 | align-items: stretch;
70 | background-color: #fff;
71 | margin: 10rpx 30rpx;
72 | font-size: 11pt;
73 | padding: 15rpx 25rpx;
74 | min-height: 100rpx;
75 | border-radius: 3px;
76 | box-shadow: 1px 2px 3px #ddd;
77 | }
78 | .issues-item.close {
79 | flex-direction: row;
80 | align-items: center;
81 | }
82 | .issues-item.close:active{
83 | background-color: #fcfcfc;
84 | opacity: .8;
85 | }
86 | .item-hd{
87 | display: flex;
88 | align-items: center;
89 | }
90 | .btn-id {
91 | flex-shrink: 0;
92 | color: #aaa;
93 | font-size: 10pt;
94 | margin-right: 10rpx;
95 | }
96 | .issues-item.close .btn-text{
97 | flex: 1 1 auto;
98 | white-space: nowrap;
99 | text-overflow: ellipsis;
100 | overflow: hidden;
101 | margin: 0;
102 | }
103 | .item-bd{
104 | display: flex;
105 | flex-direction: column;
106 | align-items: stretch;
107 | padding: 0 10rpx 15rpx;
108 | font-size: 10pt;
109 | }
110 | .item-content {
111 | padding-bottom: 20rpx;
112 | }
113 | .item-comment{
114 | display: flex;
115 | border-top: 1rpx solid #eee;
116 | padding: 10rpx 5rpx;
117 | }
118 | .item-comment-img{
119 | flex-shrink: 0;
120 | width: 50rpx;
121 | height: 50rpx;
122 | margin: 10rpx 20rpx 10rpx 10rpx;
123 | border-radius: 3px;
124 | }
125 | .item-comment-bd{
126 | flex: 1;
127 | display: flex;
128 | flex-direction: column;
129 | align-items: stretch;
130 | }
131 | .item-comment-name{
132 | font-size: 9pt;
133 | color: #999;
134 | }
135 |
136 | .issues-label{
137 | font-size: 10pt;
138 | line-height: 100%;
139 | color: #999;
140 | margin: 25rpx 20rpx 15rpx;
141 | }
142 | .issues-panel{
143 | display: flex;
144 | flex-direction: column;
145 | align-items: stretch;
146 | background-color: #fff;
147 | border-top: 1px solid #e5e5e5;
148 | border-bottom: 1px solid #e5e5e5;
149 | }
150 | .issues-img-panel{
151 | display: flex;
152 | flex-wrap: wrap;
153 | background-color: #fff;
154 | border-top: 1px solid #e5e5e5;
155 | border-bottom: 1px solid #e5e5e5;
156 | padding: 15rpx 25rpx;
157 | }
158 | .issues-img-panel.error{
159 | background: rgba(231, 138, 176, 0.06);
160 | }
161 | .issues-input{
162 | border-bottom: 1px solid #e5e5e5;
163 | padding: 15rpx 25rpx;
164 | }
165 | .issues-input.error{
166 | background: rgba(231, 138, 176, 0.06);
167 | }
168 | .issues-textarea{
169 | width: 100%;
170 | padding: 25rpx;
171 | min-height: 225rpx;
172 | box-sizing: border-box;
173 | }
174 | .issues-textarea.error{
175 | background: rgba(231, 138, 176, 0.06);
176 | }
177 | .issues-photo-item {
178 | position: relative;
179 | display: flex;
180 | align-items: center;
181 | justify-content: center;
182 | color: #888;
183 | margin: 20rpx;
184 | margin-right: 0;
185 | width: 135rpx;
186 | height: 135rpx;
187 | border: 1rpx solid #e5e5e5;
188 | border-radius: 5rpx;
189 | }
190 | .issues-photo-item:active{
191 | opacity: .8;
192 | }
193 | .issues-photo-item .remind-img{
194 | padding: 0;
195 | }
196 | .issues-photo-item image{
197 | width: 100%;
198 | height: 100%;
199 | }
200 | .add-photo:active {
201 | background: #f0f0f0;
202 | }
203 | .add-photo::before, .add-photo::after{
204 | content: '';
205 | position: absolute;
206 | top: 50%;
207 | left: 50%;
208 | background: #e5e5e5;
209 | }
210 | .add-photo:active::before, .add-photo:active::after{
211 | background: #ddd;
212 | }
213 | .add-photo::before {
214 | width: 10rpx;
215 | height: 80rpx;
216 | margin-top: -40rpx;
217 | margin-left: -5rpx;
218 | }
219 | .add-photo::after {
220 | width: 80rpx;
221 | height: 10rpx;
222 | margin-top: -5rpx;
223 | margin-left: -40rpx;
224 | }
225 | .issues-remind {
226 | flex: 1;
227 | font-size: 9pt;
228 | line-height: 135%;
229 | color: #ccc;
230 | padding: 0 30rpx;
231 | word-break: break-all;
232 | text-indent: 1em;
233 | padding-top: 30rpx;
234 | }
235 | .issues-remind.text-center{
236 | text-align: center;
237 | }
238 | .submit-btn {
239 | display: flex;
240 | align-items: center;
241 | justify-content: center;
242 | margin: 40rpx 3%;
243 | height: 80rpx;
244 | border-radius: 3px;
245 | text-align: center;
246 | background-color: #7acfa6;
247 | color: #fff;
248 | font-size: 12pt;
249 | line-height: 150%;
250 | padding: 0;
251 | border: none;
252 | }
253 | .submit-btn.disabled{
254 | opacity: .7;
255 | }
256 | .submit-btn:active{
257 | opacity: .7;
258 | }
--------------------------------------------------------------------------------
/pages/more/login.js:
--------------------------------------------------------------------------------
1 | //login.js
2 | //获取应用实例
3 | var app = getApp();
4 | Page({
5 | data: {
6 | remind: '加载中',
7 | help_status: false,
8 | userid_focus: false,
9 | passwd_focus: false,
10 | userid: '',
11 | passwd: '',
12 | angle: 0
13 | },
14 | /* onLoad: function(){
15 |
16 | },*/
17 | onReady: function(){
18 | var _this = this;
19 | setTimeout(function(){
20 | _this.setData({
21 | remind: ''
22 | });
23 | }, 1000);
24 | wx.onAccelerometerChange(function(res) {
25 | var angle = -(res.x*30).toFixed(1);
26 | if(angle>14){ angle=14; }
27 | else if(angle<-14){ angle=-14; }
28 | if(_this.data.angle !== angle){
29 | _this.setData({
30 | angle: angle
31 | });
32 | }
33 | });
34 | },
35 | bind: function() {
36 | var _this = this;
37 | if(app.g_status){
38 | app.showErrorModal(app.g_status, '绑定失败');
39 | return;
40 | }
41 | if(!_this.data.userid || !_this.data.passwd){
42 | app.showErrorModal('账号及密码不能为空', '提醒');
43 | return false;
44 | }
45 | /*
46 | if(!app._user.openid){
47 | app.showErrorModal('未能成功登录', '错误');
48 | return false;
49 | }
50 | */
51 | app.showLoadToast('绑定中');
52 | wx.request({
53 | method: 'POST',
54 | url: app._server + '/BindServlet',// 请求绑定api
55 | // 无法解决加密问题,不进行加密
56 | data: {
57 | openid: app._user.openid,
58 | yktid: _this.data.userid,
59 | passwd: _this.data.passwd
60 | },
61 | header: {
62 | 'content-type': 'application/x-www-form-urlencoded'
63 | },
64 | success: function(res){
65 | if(res.data && res.data.status >= 200 && res.data.status < 400){
66 | app.showLoadToast('请稍候');
67 | //清除缓存
68 | app.cache = {};
69 | wx.clearStorage();// 清理本地数据缓存。
70 | app.getUser(function(){
71 | wx.showToast({
72 | title: '绑定成功',
73 | icon: 'success',
74 | duration: 1500
75 | });
76 | // 添加信息的,暂时不需要
77 | /*
78 | if(!app._user.teacher){
79 | setTimeout(function(){
80 | wx.showModal({
81 | title: '提示',
82 | content: '部分功能需要完善信息才能正常使用,是否前往完善信息?',
83 | cancelText: '以后再说',
84 | confirmText: '完善信息',
85 | success: function(res) {
86 | if (res.confirm) {
87 | wx.redirectTo({
88 | url: 'append'
89 | });
90 | } else {
91 | wx.navigateBack();
92 | }
93 | }
94 | });
95 | }, 1500);
96 | }else{
97 | wx.navigateBack();
98 | }
99 | */
100 | wx.navigateBack();
101 | });
102 | }else{
103 | wx.hideToast();
104 | // app.showErrorModal(res.data.message, '绑定失败');
105 | app.showErrorModal('您输入的账号或密码错误,请重新输入','绑定失败');
106 | }
107 | },
108 | fail: function(res){
109 | wx.hideToast();
110 | app.showErrorModal(res.errMsg, '绑定失败');
111 | }
112 | });
113 | },
114 | useridInput: function(e) {
115 | this.setData({
116 | userid: e.detail.value
117 | });
118 | if(e.detail.value.length >= 10){
119 | wx.hideKeyboard();
120 | }
121 | },
122 | passwdInput: function(e) {
123 | this.setData({
124 | passwd: e.detail.value
125 | });
126 | },
127 | inputFocus: function(e){
128 | if(e.target.id == 'userid'){
129 | this.setData({
130 | 'userid_focus': true
131 | });
132 | }else if(e.target.id == 'passwd'){
133 | this.setData({
134 | 'passwd_focus': true
135 | });
136 | }
137 | },
138 | inputBlur: function(e){
139 | if(e.target.id == 'userid'){
140 | this.setData({
141 | 'userid_focus': false
142 | });
143 | }else if(e.target.id == 'passwd'){
144 | this.setData({
145 | 'passwd_focus': false
146 | });
147 | }
148 | },
149 | tapHelp: function(e){
150 | if(e.target.id == 'help'){
151 | this.hideHelp();
152 | }
153 | },
154 | showHelp: function(e){
155 | this.setData({
156 | 'help_status': true
157 | });
158 | },
159 | hideHelp: function(e){
160 | this.setData({
161 | 'help_status': false
162 | });
163 | }
164 | });
--------------------------------------------------------------------------------
/pages/more/login.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": " ",
3 | "enablePullDownRefresh": false,
4 | "disableScroll": true
5 | }
--------------------------------------------------------------------------------
/pages/more/login.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
29 |
30 | 确认绑定
31 |
32 |
33 |
34 |
35 |
36 |
37 | 帮助
38 |
39 |
40 |
41 | 1、帐号和密码是什么?
42 |
43 | 帐号:学生证上面的10位学号
44 | 密码:初始密码或者已更改密码
45 | 其中初始密码与个人身份证号码相关,采用以下规则:①身份证号码:取最后6位作为密码;②身份证号码最后一位是x的默认大写;③无居民身份证的人员(如国外留学生等),密码与统一认证码相同
46 |
47 | 2、忘记密码?
48 |
49 | 请访问统一身份认证平台(http://ids.gdit.edu.cn/authserver)进行忘记密码操作
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/pages/more/login.wxss:
--------------------------------------------------------------------------------
1 | /**login.wxss**/
2 | .container {
3 | background: #72b4ee;
4 | align-items: stretch;
5 | padding: 0;
6 | height: 100%;
7 | overflow: hidden;
8 | }
9 | .content{
10 | flex: 1;
11 | display: flex;
12 | position: relative;
13 | z-index: 10;
14 | flex-direction: column;
15 | align-items: stretch;
16 | justify-content: center;
17 | width: 100%;
18 | height: 100%;
19 | padding-bottom: 450rpx;
20 | background: -webkit-gradient(linear, left top, left bottom, from(rgba(244,244,244,0)), color-stop(0.1, #f4f4f4), to(#f4f4f4));
21 | opacity: 0;
22 | transform: translate3d(0,100%,0);
23 | animation: rise 3s cubic-bezier(0.19, 1, 0.22, 1) .25s forwards;
24 | }
25 | @keyframes rise{
26 | 0% {opacity: 0;transform: translate3d(0,100%,0);}
27 | 50% {opacity: 1;}
28 | 100% {opacity: 1;transform: translate3d(0,450rpx,0);}
29 | }
30 | .title{
31 | position: absolute;
32 | top: 30rpx;
33 | left: 50%;
34 | width: 600rpx;
35 | height: 200rpx;
36 | margin-left: -300rpx;
37 | opacity: 0;
38 | animation: show 2.5s cubic-bezier(0.19, 1, 0.22, 1) .5s forwards;
39 | }
40 | @keyframes show{
41 | 0% {opacity: 0;}
42 | 100% {opacity: .95;}
43 | }
44 |
45 | .hd {
46 | position: absolute;
47 | top: 0;
48 | left: 50%;
49 | width: 1000rpx;
50 | margin-left: -500rpx;
51 | height: 200rpx;
52 | transition: all .35s ease;
53 | }
54 | .logo {
55 | position: absolute;
56 | z-index: 2;
57 | left: 50%;
58 | bottom: 200rpx;
59 | width: 160rpx;
60 | height: 160rpx;
61 | margin-left: -80rpx;
62 | border-radius: 160rpx;
63 | animation: sway 10s ease-in-out infinite;
64 | opacity: .95;
65 | }
66 | @keyframes sway{
67 | 0% {transform: translate3d(0,20rpx,0) rotate(-15deg); }
68 | 17% {transform: translate3d(0,0rpx,0) rotate(25deg); }
69 | 34% {transform: translate3d(0,-20rpx,0) rotate(-20deg); }
70 | 50% {transform: translate3d(0,-10rpx,0) rotate(15deg); }
71 | 67% {transform: translate3d(0,10rpx,0) rotate(-25deg); }
72 | 84% {transform: translate3d(0,15rpx,0) rotate(15deg); }
73 | 100% {transform: translate3d(0,20rpx,0) rotate(-15deg); }
74 | }
75 | .wave {
76 | position: absolute;
77 | z-index: 3;
78 | right: 0;
79 | bottom: 0;
80 | opacity: 0.725;
81 | height: 260rpx;
82 | width: 2250rpx;
83 | animation: wave 10s linear infinite;
84 | }
85 | .wave-bg {
86 | z-index: 1;
87 | animation: wave-bg 10.25s linear infinite;
88 | }
89 | @keyframes wave{
90 | from {transform: translate3d(125rpx,0,0);}
91 | to {transform: translate3d(1125rpx,0,0);}
92 | }
93 | @keyframes wave-bg{
94 | from {transform: translate3d(375rpx,0,0);}
95 | to {transform: translate3d(1375rpx,0,0);}
96 | }
97 |
98 | .bd {
99 | position: relative;
100 | flex: 1;
101 | display: flex;
102 | flex-direction: column;
103 | align-items: stretch;
104 | animation: bd-rise 2s cubic-bezier(0.23,1,0.32,1) .75s forwards;
105 | opacity: 0;
106 | }
107 | @keyframes bd-rise{
108 | from {opacity: 0; transform: translate3d(0,60rpx,0); }
109 | to {opacity: 1; transform: translate3d(0,0,0); }
110 | }
111 | form {
112 | flex: 1;
113 | display: flex;
114 | flex-direction: column;
115 | align-items: stretch;
116 | justify-content: center;
117 | }
118 | .input-group {
119 | display: flex;
120 | align-items: center;
121 | padding: 25rpx 10rpx;
122 | margin: 40rpx 3%;
123 | background: #fff;
124 | border-radius: 5px;
125 | border: 2px solid #f4f4f4;
126 | transition: all .25s ease-in-out;
127 | }
128 | .input-group.active {
129 | border: 2px solid #72b4ee;
130 | }
131 | .input-label {
132 | color: #888;
133 | font-size: 13pt;
134 | height: 25rpx;
135 | line-height: 25rpx;
136 | padding: 0 25rpx;
137 | border-right: 1px solid #d8d8d8;
138 | }
139 | .input-group input,
140 | .input-group picker {
141 | flex: 1;
142 | font-size: 13pt;
143 | min-height: 52rpx;
144 | height: 52rpx;
145 | line-height: 52rpx;
146 | padding: 0 25rpx;
147 | }
148 | .input-placeholder,
149 | .input-group picker.placeholder {
150 | color: #ccc;
151 | }
152 | .login-help {
153 | display: flex;
154 | align-items: center;
155 | justify-content: flex-end;
156 | padding: 0 30rpx;
157 | font-size: 10pt;
158 | color: #bbb;
159 | }
160 | .login-help-img {
161 | width: 11pt;
162 | height: 11pt;
163 | margin: 0 5rpx;
164 | }
165 | .confirm-btn {
166 | font-size: 13pt;
167 | line-height: 85rpx;
168 | height: 85rpx;
169 | background: #72b4ee;
170 | color: #fff;
171 | text-align: center;
172 | border-radius: 5px;
173 | margin: 50rpx 3%;
174 | }
175 | .confirm-btn:active {
176 | opacity: .8;
177 | }
178 | .help {
179 | position: absolute;
180 | z-index: 100;
181 | top: 0;
182 | left: 0;
183 | width: 100%;
184 | height: 100%;
185 | display: flex;
186 | align-items: center;
187 | justify-content: center;
188 | }
189 | .box {
190 | position: relative;
191 | display: flex;
192 | flex-direction: column;
193 | align-items: stretch;
194 | width: 80%;
195 | background: #fff;
196 | border-radius: 10px;
197 | box-shadow: 0 0 50px rgba(22,22,22,.35);
198 | transform: translate3d(0,-400rpx,0);
199 | }
200 | .box-hd {
201 | display: flex;
202 | align-items: center;
203 | justify-content: center;
204 | height: 100rpx;
205 | border-bottom: 1px solid #eee;
206 | }
207 | .box-title {
208 | font-size: 13pt;
209 | }
210 | .box-close {
211 | position: absolute;
212 | right: 20rpx;
213 | width: 35rpx;
214 | height: 35rpx;
215 | padding: 15rpx;
216 | }
217 | .box-bd {
218 | flex: 1;
219 | display: flex;
220 | flex-direction: column;
221 | padding: 15rpx 40rpx 30rpx;
222 | }
223 | .help-q {
224 | color: #999;
225 | font-size: 11pt;
226 | line-height: 200%;
227 | margin-top: 5rpx;
228 | }
229 | .help-a {
230 | text-indent: 1em;
231 | line-height: 160%;
232 | display: flex;
233 | flex-direction: column;
234 | }
235 | .help-a text{
236 | word-break: break-all;
237 | }
238 | /**登录动画**/
239 | .login_video{
240 | position: absolute;
241 | z-index: 1;
242 | top: 50%;
243 | left: 50%;
244 | width: 750rpx;
245 | margin-left: -375rpx;
246 | height: 1334rpx;
247 | margin-top: -667rpx;
248 | }
249 | .video_hidden{
250 | visibility: hidden;
251 | }
252 | page .wx-video-bar{
253 | display: none;
254 | }
--------------------------------------------------------------------------------
/pages/more/more.js:
--------------------------------------------------------------------------------
1 | //more.js
2 | //获取应用实例
3 | var app = getApp();
4 | Page({
5 | data: {
6 | user: {}
7 | },
8 | onShow: function(){
9 | this.getData();
10 | },
11 | getData: function(){
12 | var _this = this;
13 | var days = ['一','二','三','四','五','六','日'];
14 | _this.setData({
15 | 'user': app._user,
16 | 'time': {
17 | 'term': app._time.term,
18 | 'week': app._time.week,
19 | 'day': days[app._time.day - 1]
20 | },
21 | 'is_bind': !!app._user.is_bind
22 | });
23 | }
24 | });
--------------------------------------------------------------------------------
/pages/more/more.json:
--------------------------------------------------------------------------------
1 | {
2 | "enablePullDownRefresh": false
3 | }
--------------------------------------------------------------------------------
/pages/more/more.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{user.we.more.name}}
11 | {{}}
12 |
13 |
14 | {{time.term}}
15 | 第{{time.week}}周 - 星期{{time.day}}
16 |
17 |
18 |
19 |
20 | 性别:{{user.we.more.sex}}
21 | 年级:{{user.we.more.nj}}级
22 | 班级:{{user.we.more.bj}}班
23 |
24 |
25 | 学号:{{user.we.ykth}}
26 |
28 | 学院:{{user.we.more.yxm}}
29 | 专业:{{user.we.more.zym}}
30 |
31 |
32 |
33 |
34 | 学号:{{user.we.ykth}}
35 |
37 | 学院:{{user.we.more.yxm}}
38 |
39 |
40 |
41 |
42 |
51 |
52 |
53 |
54 |
55 |
56 | {{user.wx.nickName}}
57 | 未绑定
58 |
59 | 前往绑定
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | 反馈
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | 关于
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 | 切换绑定
90 | 立即绑定
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/pages/more/more.wxss:
--------------------------------------------------------------------------------
1 | /**more.wxss**/
2 | .container{
3 | background-color: #f6f6f6;
4 | padding: 0;
5 | }
6 | .user-info, .more-btn {
7 | display: flex;
8 | background-color: #fff;
9 | min-height: 85rpx;
10 | border-top: 1px solid #e5e5e5;
11 | border-bottom: 1px solid #e5e5e5;
12 | }
13 | /**user-info**/
14 | .user-info-box{
15 | margin-bottom: 40rpx;
16 | }
17 | .user-info {
18 | flex-direction: column;
19 | margin: 30rpx 0 -1px;
20 | padding: 25rpx 30rpx 20rpx;
21 | }
22 | .info-hd {
23 | display: flex;
24 | align-items: center;
25 | }
26 | .bind-btn {
27 | color: #aaa;
28 | }
29 | .user-avatar {
30 | width: 120rpx;
31 | height: 120rpx;
32 | border-radius: 5px;
33 | }
34 | .user-title {
35 | flex: 1;
36 | display: flex;
37 | flex-direction: column;
38 | padding-left: 25rpx;
39 | }
40 | .time-box {
41 | display: flex;
42 | flex-direction: column;
43 | align-items: center;
44 | font-size: 10pt;
45 | line-height: 140%;
46 | color: #aaa;
47 | }
48 | .user-name {
49 | font-size: 16pt;
50 | line-height: 160%;
51 | letter-spacing: 1px;
52 | }
53 | .user-id {
54 | font-size: 11pt;
55 | color: #8b8b8b;
56 | }
57 | .info-bd {
58 | display: flex;
59 | justify-content: space-between;
60 | padding: 25rpx 15rpx 0 5rpx;
61 | font-size: 11pt;
62 | line-height: 150%;
63 | color: #8b8b8b;
64 | }
65 | .info-bd-left, .info-bd-right {
66 | display: flex;
67 | flex-direction: column;
68 | }
69 | .info-bd-left{
70 | flex-shrink: 0;
71 | padding-right: 30rpx;
72 | }
73 | /**more-list**/
74 | .more-list {
75 | flex: 1;
76 | display: flex;
77 | flex-direction: column;
78 | }
79 | .more-btn {
80 | align-items: center;
81 | font-size: 13pt;
82 | padding: 0 30rpx;
83 | }
84 | .issue-link, .about-link {
85 | margin-bottom: 20rpx;
86 | }
87 | .btn-icon {
88 | width: 45rpx;
89 | height: 45rpx;
90 | margin-right: 15rpx;
91 | }
92 | .btn-text {
93 | flex: 1;
94 | }
95 | .btn-open {
96 | display: flex;
97 | align-items: center;
98 | justify-content: flex-end;
99 | margin-left: 10rpx;
100 | }
101 | .btn-enter {
102 | width: 18rpx;
103 | height: 27rpx;
104 | }
105 | .login-btn {
106 | font-size: 13pt;
107 | line-height: 85rpx;
108 | height: 85rpx;
109 | background: #e55c5c;
110 | color: #fff;
111 | text-align: center;
112 | border-radius: 5px;
113 | margin: 40rpx 3%;
114 | }
--------------------------------------------------------------------------------
/pages/news/detail/detail.js:
--------------------------------------------------------------------------------
1 | //detail.js (common)
2 | var app = getApp();
3 | module.exports.ipage = {
4 | data: {
5 | remind: "加载中",
6 | id: "",
7 | title: "", // 新闻标题
8 | date: "", // 发布日期
9 | author: "", // 发布作者
10 | reading: "", // 阅读量
11 | content: "", // 新闻内容
12 | files_len: 0, // 附件数量
13 | files_list: [],
14 | file_loading: false, //下载状态
15 | source: '', // 附件来源
16 | sources: {
17 | 'jw': '教务在线',
18 | 'oa': 'OA系统',
19 | 'hy': 'OA系统',
20 | 'jz': 'OA系统',
21 | 'new': '新闻中心'
22 | }
23 | },
24 | //分享
25 | onShareAppMessage: function () {
26 | var _this = this;
27 | return {
28 | title: _this.data.title,
29 | desc: 'We重邮 - 资讯详情',
30 | path: 'pages/news/'+_this.data.type+'/'+_this.data.type+'_detail?type='+_this.data.type+'&id='+_this.data.id
31 | }
32 | },
33 |
34 | convertHtmlToText: function(inputText){
35 | var returnText = "" + inputText;
36 | returnText = returnText.replace(/<\/?[^>]*>/g, '').replace(/[ | ]*\n/g, '\n').replace(/ /ig, '')
37 | .replace(/&mdash/gi,'-').replace(/&ldquo/gi,'“').replace(/&rdquo/gi,'”');
38 | return returnText;
39 | },
40 |
41 | onLoad: function(options){
42 | var _this = this;
43 | app.loginLoad(function(){
44 | _this.loginHandler.call(_this, options);
45 | });
46 | },
47 | loginHandler: function(options){
48 | var _this = this;
49 |
50 | if(!options.type || !options.id) {
51 | _this.setData({
52 | remind: '404'
53 | });
54 | return false;
55 | }
56 | _this.setData({
57 | 'type': options.type,
58 | id: options.id
59 | });
60 | options.openid = app._user.openid;
61 | wx.request({
62 | url: app._server + '/api/get_news_detail.php',
63 | data: options,
64 | success: function(res){
65 | if(res.data && res.data.status === 200){
66 | var info = res.data.data;
67 | // 提取信息中的时间,作者,阅读量
68 | var author_info = [];
69 | if(info.author){
70 | author_info = info.author.split(' ').map(function(e){
71 | return e.split(':')[1];
72 | });
73 | }
74 | _this.setData({
75 | date: author_info[0] || info.time || "", // 发布日期
76 | author: author_info[1] || "", // 发布作者
77 | reading: author_info[2] || "", // 阅读量
78 | title: info.title, //新闻标题
79 | content: _this.convertHtmlToText(info.body), // 新闻内容
80 | source: _this.data.sources[options.type],
81 | remind: ''
82 | });
83 |
84 | // 如果存在附件则提取附件里面的信息
85 | if(info.fjlist && info.fjlist.length){
86 | info.fjlist.map(function(e){
87 | //判断是否支持预览
88 | e.preview = (e.fjtitle.search(/\.doc|.xls|.ppt|.pdf|.docx|.xlsx|.pptx$/) !== -1);
89 | return e;
90 | });
91 | _this.setData({
92 | files_len: info.fjlist.length,
93 | files_list: info.fjlist
94 | });
95 | }
96 | }else{
97 | app.showErrorModal(res.data.message);
98 | _this.setData({
99 | remind: res.data.message || '未知错误'
100 | });
101 | }
102 | },
103 | fail: function(){
104 | app.showErrorModal(res.errMsg);
105 | _this.setData({
106 | remind: '网络错误'
107 | });
108 | }
109 | })
110 | },
111 |
112 | getFj: function(e){
113 | var _this = this;
114 | if(!e.currentTarget.dataset.preview){
115 | app.showErrorModal('不支持该格式文件预览!', '无法预览');
116 | return;
117 | }
118 | wx.showModal({
119 | title: '提示',
120 | content: '预览或下载附件需要消耗流量,是否继续?',
121 | confirmText: '继续',
122 | success: function(res) {
123 | if (res.confirm) {
124 | app.showLoadToast('下载中,请稍候');
125 | wx.showNavigationBarLoading();
126 | _this.setData({
127 | file_loading: true
128 | });
129 | //下载
130 | wx.downloadFile({
131 | url: e.currentTarget.dataset.url,
132 | success: function(res) {
133 | var filePath = res.tempFilePath;
134 | //预览
135 | wx.openDocument({
136 | filePath: filePath,
137 | success: function (res) {
138 | console.info('预览成功');
139 | },
140 | fail: function (res) {
141 | app.showErrorModal(res.errMsg, '预览失败');
142 | },
143 | complete: function(){
144 | wx.hideNavigationBarLoading();
145 | wx.hideToast();
146 | _this.setData({
147 | file_loading: false
148 | });
149 | }
150 | });
151 | },
152 | fail: function(res){
153 | app.showErrorModal(res.errMsg, '下载失败');
154 | wx.hideNavigationBarLoading();
155 | wx.hideToast();
156 | _this.setData({
157 | file_loading: false
158 | });
159 | }
160 | });
161 | }
162 | }
163 | });
164 | }
165 | };
--------------------------------------------------------------------------------
/pages/news/detail/detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{remind}}
8 |
9 |
10 |
11 |
12 | {{title}}
13 |
14 |
15 | 发布时间:{{date}}
16 | 作者:{{author}}
17 | 阅读量:{{reading}}
18 |
19 | {{content}}
20 |
21 |
22 |
23 |
24 |
25 | {{item.fjtitle}}
26 | {{source}}
27 |
28 |
29 |
30 | {{item.preview ? '点击预览' : '无法预览'}}
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/pages/news/detail/detail.wxss:
--------------------------------------------------------------------------------
1 | /**detail.wxss (common)**/
2 | .container{
3 | background: #fff;
4 | padding: 0 30rpx;
5 | }
6 | .title{
7 | font-size: 18pt;
8 | font-weight: bold;
9 | margin-top: 40rpx;
10 | line-height: 140%;
11 | word-break: break-all;
12 | }
13 | .info{
14 | margin-top: 30rpx;
15 | color: #b2b2b2;
16 | }
17 | .info text{
18 | padding: 0 20rpx 0 5rpx;
19 | }
20 | .detail{
21 | font-size: 11pt;
22 | line-height: 150%;
23 | padding: 50rpx 15rpx 200rpx;
24 | word-break: break-all;
25 | text-align: justify;
26 | }
27 | .files_list {
28 | position: fixed;
29 | bottom: -10rpx;
30 | left: 0;
31 | right: 0;
32 | height: 190rpx;
33 | display: flex;
34 | flex-direction: column;
35 | align-items: stretch;
36 | }
37 | .file{
38 | padding: 0 30rpx 0 50rpx;
39 | height: 140rpx;
40 | margin: 0 30rpx;
41 | background-color: #fcfcfc;
42 | border: 1rpx solid #ececec;
43 | border-radius: 3px;
44 | display: flex;
45 | justify-content: space-between;
46 | align-items: center;
47 | }
48 | .file:active{
49 | background-color: #fff;
50 | }
51 | .fileNameSource{
52 | flex: 1 1 auto;
53 | display: flex;
54 | flex-direction: column;
55 | overflow: hidden;
56 | padding-left: 40rpx;
57 | }
58 | .file-name{
59 | font-size: 11pt;
60 | line-height: 150%;
61 | white-space: nowrap;
62 | text-overflow: ellipsis;
63 | width: 100%;
64 | overflow: hidden;
65 | }
66 | .file-source{
67 | font-size: 10pt;
68 | color: #919191;
69 | }
70 | .file-remind{
71 | flex: 0 0 25pt;
72 | width: 25pt;
73 | height: 25pt;
74 | font-size: 10pt;
75 | text-align: center;
76 | padding: 0 10rpx;
77 | }
78 | .file-remind image {
79 | width: 100%;
80 | height: 100%;
81 | }
82 | .file-img{
83 | flex: 0 0 39rpx;
84 | width: 39rpx;
85 | height: 48rpx;
86 | }
--------------------------------------------------------------------------------
/pages/news/hy/hy_detail.js:
--------------------------------------------------------------------------------
1 | //hy_detail.js
2 | var detail = require('../detail/detail.js');
3 | //获取应用实例
4 | var app = getApp();
5 | Page(detail.ipage);
--------------------------------------------------------------------------------
/pages/news/hy/hy_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#ffcb63",
3 | "navigationBarTitleText": "会议通知",
4 | "backgroundColor": "#ffcb63",
5 | "enablePullDownRefresh": false
6 | }
--------------------------------------------------------------------------------
/pages/news/hy/hy_detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/pages/news/hy/hy_detail.wxss:
--------------------------------------------------------------------------------
1 | /**hy_detail.wxss**/
2 | @import "../detail/detail.wxss";
--------------------------------------------------------------------------------
/pages/news/jw/jw_detail.js:
--------------------------------------------------------------------------------
1 | //jw_detail.js
2 | var detail = require('../detail/detail.js');
3 | //获取应用实例
4 | var app = getApp();
5 | Page(detail.ipage);
--------------------------------------------------------------------------------
/pages/news/jw/jw_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#9f8bea",
3 | "navigationBarTitleText": "教务公告",
4 | "backgroundColor": "#9f8bea",
5 | "enablePullDownRefresh": false
6 | }
--------------------------------------------------------------------------------
/pages/news/jw/jw_detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/pages/news/jw/jw_detail.wxss:
--------------------------------------------------------------------------------
1 | /**jw_detail.wxss**/
2 | @import "../detail/detail.wxss";
--------------------------------------------------------------------------------
/pages/news/jz/jz_detail.js:
--------------------------------------------------------------------------------
1 | //jz_detail.js
2 | var detail = require('../detail/detail.js');
3 | //获取应用实例
4 | var app = getApp();
5 | Page(detail.ipage);
--------------------------------------------------------------------------------
/pages/news/jz/jz_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#e78ab0",
3 | "navigationBarTitleText": "学术讲座",
4 | "backgroundColor": "#e78ab0",
5 | "enablePullDownRefresh": false
6 | }
--------------------------------------------------------------------------------
/pages/news/jz/jz_detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/pages/news/jz/jz_detail.wxss:
--------------------------------------------------------------------------------
1 | /**jz_detail.wxss**/
2 | @import "../detail/detail.wxss";
--------------------------------------------------------------------------------
/pages/news/new/new_detail.js:
--------------------------------------------------------------------------------
1 | //new_detail.js
2 | var detail = require('../detail/detail.js');
3 | //获取应用实例
4 | var app = getApp();
5 | Page(detail.ipage);
--------------------------------------------------------------------------------
/pages/news/new/new_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#7acfa6",
3 | "navigationBarTitleText": "综合新闻",
4 | "backgroundColor": "#7acfa6",
5 | "enablePullDownRefresh": false
6 | }
--------------------------------------------------------------------------------
/pages/news/new/new_detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/pages/news/new/new_detail.wxss:
--------------------------------------------------------------------------------
1 | /**new_detail.wxss**/
2 | @import "../detail/detail.wxss";
--------------------------------------------------------------------------------
/pages/news/news.js:
--------------------------------------------------------------------------------
1 | //news.js
2 | //获取应用实例
3 | var app = getApp();
4 | Page({
5 | data: {
6 | /*
7 | page: 0,
8 | list: [
9 | { id: 0, 'type': 'all', name: '头条',storage:[], url: 'get_newslist.php', enabled: {guest:false, student:true, teacher:true} },
10 | { id: 1, 'type': 'jw', name: '教务公告',storage:[], url: 'news/jw_list.php', enabled: {guest:false, student:true, teacher:true} },
11 | { id: 2, 'type': 'oa', name: 'OA公告',storage:[], url: 'news/oa_list.php', enabled: {guest:false, student:true, teacher:true} },
12 | { id: 3, 'type': 'hy', name: '会议通知',storage:[], url: 'news/hy_list.php', enabled: {guest:false, student:false, teacher:true} },
13 | { id: 4, 'type': 'jz', name: '学术讲座',storage:[], url: 'news/jz_list.php', enabled: {guest:true, student:true, teacher:true} },
14 | { id: 5, 'type': 'new', name: '综合新闻',storage:[], url: 'news/new_list.php', enabled: {guest:true, student:true, teacher:true} },
15 | ],
16 | 'active': {
17 | id: 0,
18 | 'type': 'all',
19 | data: [],
20 | showMore: true,
21 | remind: '上滑加载更多'
22 | },
23 | loading: false,
24 | user_type: 'guest',
25 | disabledRemind: false
26 | },
27 | onLoad: function(){
28 | if(app._user.is_bind){
29 | this.setData({
30 | user_type: !app._user.teacher ? 'student' : 'teacher'
31 | });
32 | }else{
33 | this.setData({
34 | user_type: 'guest',
35 | 'active.id': 5,
36 | 'active.type': 'new'
37 | });
38 | }
39 | this.setData({
40 | 'loading': true,
41 | 'active.data': [],
42 | 'active.showMore': true,
43 | 'active.remind': '上滑加载更多',
44 | 'page': 0
45 | });
46 | this.getNewsList();
47 | },
48 | //下拉更新
49 | onPullDownRefresh: function(){
50 | var _this = this;
51 | _this.setData({
52 | 'loading': true,
53 | 'active.data': [],
54 | 'active.showMore': true,
55 | 'active.remind': '上滑加载更多',
56 | 'page': 0
57 | });
58 | _this.getNewsList();
59 | },
60 | //上滑加载更多
61 | onReachBottom: function(){
62 | var _this = this;
63 | if(_this.data.active.showMore){
64 | _this.getNewsList();
65 | }
66 | },
67 | //获取新闻列表
68 | getNewsList: function(typeId){
69 | var _this = this;
70 | if(app.g_status){
71 | _this.setData({
72 | 'active.showMore': false,
73 | 'active.remind': app.g_status,
74 | loading: false
75 | });
76 | wx.stopPullDownRefresh();
77 | return;
78 | }
79 | typeId = typeId || _this.data.active.id;
80 | if (_this.data.page >= 5){
81 | _this.setData({
82 | 'active.showMore': false,
83 | 'active.remind': '没有更多啦'
84 | });
85 | return false;
86 | }
87 | if(!_this.data.page){
88 | _this.setData({
89 | 'active.data': _this.data.list[typeId].storage
90 | });
91 | }
92 | _this.setData({
93 | 'active.remind': '正在加载中'
94 | });
95 | wx.showNavigationBarLoading();
96 | wx.request({
97 | url: app._server + '/api/' + _this.data.list[typeId].url,
98 | data: {
99 | page: _this.data.page + 1,
100 | openid: app._user.openid
101 | },
102 | success: function(res){
103 | if(res.data && res.data.status === 200){
104 | if(_this.data.active.id != typeId){ return false; }
105 | if(res.data.data){
106 | if(!_this.data.page){
107 | if(!_this.data.list[typeId].storage.length || app.util.md5(JSON.stringify(res.data.data)) != app.util.md5(JSON.stringify(_this.data.list[typeId].storage))){
108 | var data = {
109 | 'page': _this.data.page + 1,
110 | 'active.data': res.data.data,
111 | 'active.showMore': true,
112 | 'active.remind': '上滑加载更多',
113 | };
114 | data['list['+typeId+'].storage'] = res.data.data;
115 | _this.setData(data);
116 | }else{
117 | _this.setData({
118 | 'page': _this.data.page + 1,
119 | 'active.showMore': true,
120 | 'active.remind': '上滑加载更多'
121 | });
122 | }
123 | }else{
124 | _this.setData({
125 | 'page': _this.data.page + 1,
126 | 'active.data': _this.data.active.data.concat(res.data.data),
127 | 'active.showMore': true,
128 | 'active.remind': '上滑加载更多',
129 | });
130 | }
131 | }else{
132 | _this.setData({
133 | 'active.showMore': false,
134 | 'active.remind': '没有更多啦'
135 | });
136 | }
137 | }else{
138 | app.showErrorModal(res.data.message);
139 | _this.setData({
140 | 'active.remind': '加载失败'
141 | });
142 | }
143 | },
144 | fail: function(res){
145 | app.showErrorModal(res.errMsg);
146 | _this.setData({
147 | 'active.remind': '网络错误'
148 | });
149 | },
150 | complete: function(){
151 | wx.hideNavigationBarLoading();
152 | wx.stopPullDownRefresh();
153 | _this.setData({
154 | loading: false
155 | });
156 | }
157 | });
158 | },
159 | //获取焦点
160 | changeFilter: function(e){
161 | this.setData({
162 | 'active': {
163 | 'id': e.target.dataset.id,
164 | 'type': e.target.id,
165 | data: [],
166 | showMore: true,
167 | remind: '上滑加载更多'
168 | },
169 | 'page': 0
170 | });
171 | this.getNewsList(e.target.dataset.id);
172 | },
173 | //无权限查询
174 | changeFilterDisabled: function(){
175 | var _this = this;
176 | if(!_this.data.disabledRemind){
177 | _this.setData({
178 | disabledRemind: true
179 | });
180 | setTimeout(function(){
181 | _this.setData({
182 | disabledRemind: false
183 | });
184 | }, 2000);
185 | }
186 | */
187 | }
188 | });
--------------------------------------------------------------------------------
/pages/news/news.json:
--------------------------------------------------------------------------------
1 | {
2 | "backgroundColor": "#ffffff",
3 | "backgroundTextStyle": "dark",
4 | "enablePullDownRefresh": false
5 | }
--------------------------------------------------------------------------------
/pages/news/news.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
24 |
25 |
26 |
42 |
43 |
44 |
45 |
48 |
49 |
--------------------------------------------------------------------------------
/pages/news/news.wxss:
--------------------------------------------------------------------------------
1 | /**news.wxss**/
2 | .container{
3 | background-color: #fff;
4 | padding-bottom: 20rpx;
5 | }
6 |
7 | /* 广科地图 */
8 | .gkdt {
9 | position: fixed;
10 | top: 50px;
11 | left: 0;
12 | width: 100%;
13 | height: 100%;
14 | }
15 | .gkdt-content {
16 | width: 150%;
17 | height: 70%;
18 | margin-left: -85px;
19 | margin-top: 40px;
20 | transform: rotate(90deg);
21 | }
22 |
23 | .filter{
24 | position: fixed;
25 | z-index: 1;
26 | width: 100%;
27 | height: 160rpx;
28 | white-space: nowrap;
29 | background: -webkit-gradient(linear, left top, left bottom, from(rgba(255,255,255,1)), color-stop(0.93, rgba(255,255,255,.93)), to(rgba(255,255,255,0)));
30 | }
31 | .filter-item{
32 | width: 120rpx;
33 | height: 120rpx;
34 | margin: 20rpx;
35 | margin-left: 0;
36 | border-radius: 5rpx;
37 | box-shadow: 1px 2px 3px #e5e5e5;
38 | opacity: .66;
39 | }
40 | .filter-item#all{
41 | margin-left: 20rpx;
42 | }
43 | .filter-item.active{
44 | opacity: 1;
45 | transform: scale(1.08,1.08);
46 | box-shadow: 1px 2px 3px #ddd;
47 | }
48 | .loader{
49 | display: inline-block;
50 | width: 100%;
51 | height: 160rpx;
52 | line-height: 160rpx;
53 | margin-top: -160rpx;
54 | letter-spacing: 10rpx;
55 | text-align: center;
56 | box-sizing: border-box;
57 | padding-top: 40rpx;
58 | }
59 | .loader image{
60 | height: 80rpx;
61 | width: 80rpx;
62 | }
63 | .content{
64 | display: flex;
65 | flex-direction: column;
66 | padding: 160rpx 20rpx 0;
67 | }
68 | .content-ending{
69 | width: 100%;
70 | color: #bbb;
71 | text-align: center;
72 | margin: 30rpx auto;
73 | }
74 | .list-item{
75 | display: flex;
76 | align-items: center;
77 | justify-content: space-between;
78 | height: 120rpx;
79 | margin-bottom: 20rpx;
80 | border-radius: 3px;
81 | box-shadow: 1px 2px 3px #ddd;
82 | padding: 0 30rpx;
83 | color: #fff;
84 | }
85 | .list-item.jw{
86 | background-color: #9f8bea;
87 | }
88 | .list-item.oa{
89 | background-color: #73b4ef;
90 | }
91 | .list-item.hy{
92 | background-color: #ffcb63;
93 | }
94 | .list-item.jz{
95 | background-color: #e78ab0;
96 | }
97 | .list-item.new{
98 | background-color: #7acfa6;
99 | }
100 | .list-item-left{
101 | flex: 1 1 auto;
102 | display: flex;
103 | flex-direction: column;
104 | overflow: hidden;
105 | padding-right: 10rpx;
106 | }
107 | .list-item-title{
108 | font-size: 13pt;
109 | line-height: 175%;
110 | white-space: nowrap;
111 | text-overflow: ellipsis;
112 | width: 100%;
113 | overflow: hidden;
114 | }
115 | .list-item-time{
116 | font-size: 10pt;
117 | line-height: 125%;
118 | opacity: 0.6;
119 | }
120 | .list-item-icon{
121 | flex: 0 0 60rpx;
122 | height: 60rpx;
123 | width: 60rpx;
124 | border-left: 1px solid #fff;
125 | padding-left: 25rpx;
126 | }
--------------------------------------------------------------------------------
/pages/news/oa/oa_detail.js:
--------------------------------------------------------------------------------
1 | //oa_detail.js
2 | var detail = require('../detail/detail.js');
3 | //获取应用实例
4 | var app = getApp();
5 | Page(detail.ipage);
--------------------------------------------------------------------------------
/pages/news/oa/oa_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#73b4ef",
3 | "navigationBarTitleText": "OA公告",
4 | "backgroundColor": "#73b4ef",
5 | "enablePullDownRefresh": false
6 | }
--------------------------------------------------------------------------------
/pages/news/oa/oa_detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/pages/news/oa/oa_detail.wxss:
--------------------------------------------------------------------------------
1 | /**oa_detail.wxss**/
2 | @import "../detail/detail.wxss";
--------------------------------------------------------------------------------
/utils/base64.min.js:
--------------------------------------------------------------------------------
1 | /* base64.js v2.1.9
2 | * https://github.com/dankogai/js-base64
3 | * (做出了一些修改用以适应小程序, 此外请勿擅自修改 @ Cong Min)
4 | */
5 | (function(global){"use strict";var version="2.1.9";var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var b64tab=function(bin){var t={};for(var i=0,l=bin.length;i>>6)+fromCharCode(128|cc&63):fromCharCode(224|cc>>>12&15)+fromCharCode(128|cc>>>6&63)+fromCharCode(128|cc&63)}else{var cc=65536+(c.charCodeAt(0)-55296)*1024+(c.charCodeAt(1)-56320);return fromCharCode(240|cc>>>18&7)+fromCharCode(128|cc>>>12&63)+fromCharCode(128|cc>>>6&63)+fromCharCode(128|cc&63)}};var re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;var utob=function(u){return u.replace(re_utob,cb_utob)};var cb_encode=function(ccc){var padlen=[0,2,1][ccc.length%3],ord=ccc.charCodeAt(0)<<16|(ccc.length>1?ccc.charCodeAt(1):0)<<8|(ccc.length>2?ccc.charCodeAt(2):0),chars=[b64chars.charAt(ord>>>18),b64chars.charAt(ord>>>12&63),padlen>=2?"=":b64chars.charAt(ord>>>6&63),padlen>=1?"=":b64chars.charAt(ord&63)];return chars.join("")};var btoa=function(b){return b.replace(/[\s\S]{1,3}/g,cb_encode)};var _encode=function(u){return btoa(utob(u))};var encode=function(u,urisafe){return!urisafe?_encode(String(u)):_encode(String(u)).replace(/[+\/]/g,function(m0){return m0=="+"?"-":"_"}).replace(/=/g,"")};var encodeURI=function(u){return encode(u,true)};var re_btou=new RegExp(["[À-ß][-¿]","[à-ï][-¿]{2}","[ð-÷][-¿]{3}"].join("|"),"g");var cb_btou=function(cccc){switch(cccc.length){case 4:var cp=(7&cccc.charCodeAt(0))<<18|(63&cccc.charCodeAt(1))<<12|(63&cccc.charCodeAt(2))<<6|63&cccc.charCodeAt(3),offset=cp-65536;return fromCharCode((offset>>>10)+55296)+fromCharCode((offset&1023)+56320);case 3:return fromCharCode((15&cccc.charCodeAt(0))<<12|(63&cccc.charCodeAt(1))<<6|63&cccc.charCodeAt(2));default:return fromCharCode((31&cccc.charCodeAt(0))<<6|63&cccc.charCodeAt(1))}};var btou=function(b){return b.replace(re_btou,cb_btou)};var cb_decode=function(cccc){var len=cccc.length,padlen=len%4,n=(len>0?b64tab[cccc.charAt(0)]<<18:0)|(len>1?b64tab[cccc.charAt(1)]<<12:0)|(len>2?b64tab[cccc.charAt(2)]<<6:0)|(len>3?b64tab[cccc.charAt(3)]:0),chars=[fromCharCode(n>>>16),fromCharCode(n>>>8&255),fromCharCode(n&255)];chars.length-=[0,0,2,1][padlen];return chars.join("")};var atob=function(a){return a.replace(/[\s\S]{1,4}/g,cb_decode)};var _decode=function(a){return btou(atob(a))};var decode=function(a){return _decode(String(a).replace(/[-_]/g,function(m0){return m0=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))};var base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode};"function"==typeof define&&define.amd?define(function(){return base64}):"object"==typeof module&&module.exports?module.exports=base64:global.base64=base64})(this);
--------------------------------------------------------------------------------
/utils/md5.min.js:
--------------------------------------------------------------------------------
1 | /* JavaScript MD5 v2.4.0
2 | * https://github.com/blueimp/JavaScript-MD5
3 | */
4 | !function(n){"use strict";function t(n,t){var r=(65535&n)+(65535&t),e=(n>>16)+(t>>16)+(r>>16);return e<<16|65535&r}function r(n,t){return n<>>32-t}function e(n,e,o,u,c,f){return t(r(t(t(e,n),t(u,f)),c),o)}function o(n,t,r,o,u,c,f){return e(t&r|~t&o,n,t,u,c,f)}function u(n,t,r,o,u,c,f){return e(t&o|r&~o,n,t,u,c,f)}function c(n,t,r,o,u,c,f){return e(t^r^o,n,t,u,c,f)}function f(n,t,r,o,u,c,f){return e(r^(t|~o),n,t,u,c,f)}function i(n,r){n[r>>5]|=128<>>9<<4)+14]=r;var e,i,a,h,d,l=1732584193,g=-271733879,v=-1732584194,m=271733878;for(e=0;e>5]>>>t%32&255);return r}function h(n){var t,r=[];for(r[(n.length>>2)-1]=void 0,t=0;t>5]|=(255&n.charCodeAt(t/8))<16&&(o=i(o,8*n.length)),r=0;r<16;r+=1)u[r]=909522486^o[r],c[r]=1549556828^o[r];return e=i(u.concat(h(t)),512+8*t.length),a(i(c.concat(e),640))}function g(n){var t,r,e="0123456789abcdef",o="";for(r=0;r>>4&15)+e.charAt(15&t);return o}function v(n){return unescape(encodeURIComponent(n))}function m(n){return d(v(n))}function p(n){return g(m(n))}function s(n,t){return l(v(n),v(t))}function C(n,t){return g(s(n,t))}function A(n,t,r){return t?r?s(t,n):C(t,n):r?m(n):p(n)}"function"==typeof define&&define.amd?define(function(){return A}):"object"==typeof module&&module.exports?module.exports=A:n.md5=A}(this);
--------------------------------------------------------------------------------
/utils/util.js:
--------------------------------------------------------------------------------
1 | //格式化时间
2 | function formatTime(date, t) {
3 | var year = date.getFullYear();
4 | var month = date.getMonth() + 1;
5 | var day = date.getDate();
6 | var hour = date.getHours();
7 | var minute = date.getMinutes();
8 | var second = date.getSeconds();
9 | if(t === 'h:m') { return [hour, minute].map(formatNumber).join(':'); }
10 | else { return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':'); }
11 | }
12 | function formatNumber(n) {
13 | n = n.toString();
14 | return n[1] ? n : '0' + n;
15 | }
16 |
17 | //判断是否为纯粹对象a
18 | function isPlainObject(obj){
19 | if(!obj || obj.toString() !== "[object Object]" || obj.nodeType || obj.setInterval){
20 | return false;
21 | }
22 | if(obj.constructor && !obj.hasOwnProperty("constructor") && !obj.constructor.prototype.hasOwnProperty("isPrototypeOf")){
23 | return false;
24 | }
25 | for(var key in obj){}
26 | return key === undefined || obj.hasOwnProperty(key);
27 | }
28 | function cloneObj(obj){
29 | if(!isPlainObject(obj)){ return false; }
30 | return JSON.parse(JSON.stringify(obj));
31 | }
32 |
33 | //md5&base64
34 | var md5 = require('md5.min.js'), base64 = require('base64.min.js'),
35 | sign = function(data) {
36 | var _data = cloneObj(data);
37 | _data['\x74\x6f\x6b\x65\x6e'] = base64.decode(getApp()['\x5f\x74']);
38 | return md5(JSON.stringify(_data));
39 | },
40 | key = function(data) {
41 | if(!isPlainObject(data)){ return false; }
42 | data.timestamp = parseInt(new Date().getTime().toString().substr(0,10));
43 | data.sign = sign(data);
44 | return {
45 | key: base64.encode(JSON.stringify(data))
46 | };
47 | }
48 |
49 | module.exports = {
50 | formatTime: formatTime,
51 | md5: md5,
52 | base64: base64,
53 | key: key
54 | }
--------------------------------------------------------------------------------