├── .gitignore ├── frontend ├── README.md ├── image │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── 7.png │ ├── banner.png │ └── wxcode.jpg ├── sitemap.json ├── pages │ ├── book │ │ ├── book.wxss │ │ ├── book-wxa-auto-dark.wxss │ │ ├── book.json │ │ ├── book.wxml │ │ └── book.js │ ├── index │ │ ├── index.json │ │ ├── index-wxa-auto-dark.wxss │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── index.js │ ├── mybooks │ │ ├── mybooks-wxa-auto-dark.wxss │ │ ├── mybooks.json │ │ ├── mybooks.wxss │ │ ├── mybooks.wxml │ │ └── mybooks.js │ ├── admin │ │ ├── admin-wxa-auto-dark.wxss │ │ ├── admin.json │ │ ├── admin.wxss │ │ ├── admin.wxml │ │ └── admin.js │ └── admin_verify │ │ ├── admin_verify-wxa-auto-dark.wxss │ │ ├── admin_verify.wxss │ │ ├── admin_verify.wxml │ │ ├── admin_verify.json │ │ ├── admin_verify.js │ │ └── md5.js ├── app-wxa-auto-dark.wxss ├── app.wxss ├── package-lock.json ├── utils │ └── util.js ├── app.json ├── project.config.json └── app.js ├── backend ├── data │ ├── tickets_open.json │ ├── tickets_closed.json │ ├── dynamic.json │ └── settings.json ├── README.md ├── new.py └── server.py ├── .github ├── trigger.json └── workflows │ └── python-app.yml ├── .gitattributes ├── README.md ├── checkpoint.py └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | secrets.* -------------------------------------------------------------------------------- /frontend/README.md: -------------------------------------------------------------------------------- 1 | ### 微信小程序 -------------------------------------------------------------------------------- /backend/data/tickets_open.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /backend/data/tickets_closed.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.github/trigger.json: -------------------------------------------------------------------------------- 1 | { 2 | "trigger": 0 3 | } 4 | -------------------------------------------------------------------------------- /backend/README.md: -------------------------------------------------------------------------------- 1 | ### 后端服务器 2 | 3 | **Python** Flask -------------------------------------------------------------------------------- /backend/data/dynamic.json: -------------------------------------------------------------------------------- 1 | {"off_days": [], "blocked": []} -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.wxml linguist-language=html 2 | *.wxss linguist-language=css 3 | -------------------------------------------------------------------------------- /frontend/image/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muhac/hitsz-appointment-scheduling/HEAD/frontend/image/1.png -------------------------------------------------------------------------------- /frontend/image/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muhac/hitsz-appointment-scheduling/HEAD/frontend/image/2.png -------------------------------------------------------------------------------- /frontend/image/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muhac/hitsz-appointment-scheduling/HEAD/frontend/image/3.png -------------------------------------------------------------------------------- /frontend/image/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muhac/hitsz-appointment-scheduling/HEAD/frontend/image/4.png -------------------------------------------------------------------------------- /frontend/image/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muhac/hitsz-appointment-scheduling/HEAD/frontend/image/5.png -------------------------------------------------------------------------------- /frontend/image/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muhac/hitsz-appointment-scheduling/HEAD/frontend/image/6.png -------------------------------------------------------------------------------- /frontend/image/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muhac/hitsz-appointment-scheduling/HEAD/frontend/image/7.png -------------------------------------------------------------------------------- /frontend/image/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muhac/hitsz-appointment-scheduling/HEAD/frontend/image/banner.png -------------------------------------------------------------------------------- /frontend/image/wxcode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muhac/hitsz-appointment-scheduling/HEAD/frontend/image/wxcode.jpg -------------------------------------------------------------------------------- /frontend/sitemap.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", 3 | "rules": [{ 4 | "action": "allow", 5 | "page": "*" 6 | }] 7 | } -------------------------------------------------------------------------------- /frontend/pages/book/book.wxss: -------------------------------------------------------------------------------- 1 | /* pages/book/book.wxss */ 2 | 3 | .weui-agree .weui-agree__text { 4 | display: inline; 5 | } 6 | 7 | .weui-form__opr-area { 8 | margin-bottom: 0; 9 | } 10 | 11 | @import 'book-wxa-auto-dark.wxss' -------------------------------------------------------------------------------- /frontend/pages/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarBackgroundColor": "#ffffff", 3 | "navigationBarTextStyle": "black", 4 | "navigationBarTitleText": "心理咨询预约", 5 | "backgroundColor": "#eeeeee", 6 | "backgroundTextStyle": "light" 7 | } -------------------------------------------------------------------------------- /frontend/app-wxa-auto-dark.wxss: -------------------------------------------------------------------------------- 1 | /* 2 | 此文件为开发者工具生成,生成时间: 2021/3/6 下午2:08:58 3 | 使用方法: 4 | 在 app.wxss 文件末尾引入样式 5 | ``` 6 | @import "./app-wxa-auto-dark.wxss"; 7 | ``` 8 | */ 9 | 10 | @media (prefers-color-scheme: dark) { 11 | :root {} 12 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 哈尔滨工业大学(深圳)
     心理咨询预约系统 2 | 3 | #### 已接入学院 4 | 5 | - [电子与信息工程学院](http://eie.hitsz.edu.cn/) 6 | - [土木与环境工程学院](http://sce.hitsz.edu.cn/) 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /frontend/pages/book/book-wxa-auto-dark.wxss: -------------------------------------------------------------------------------- 1 | /* 2 | 此文件为开发者工具生成,生成时间: 2021/3/6 上午12:18:25 3 | 使用方法: 4 | 在 book.wxss 文件末尾引入样式 5 | ``` 6 | @import "./book-wxa-auto-dark.wxss"; 7 | ``` 8 | */ 9 | 10 | @media (prefers-color-scheme: dark) { 11 | :root {} 12 | } -------------------------------------------------------------------------------- /frontend/pages/mybooks/mybooks-wxa-auto-dark.wxss: -------------------------------------------------------------------------------- 1 | /* 2 | 此文件为开发者工具生成,生成时间: 2021/3/6 下午2:08:58 3 | 使用方法: 4 | 在 mybooks.wxss 文件末尾引入样式 5 | ``` 6 | @import "./mybooks-wxa-auto-dark.wxss"; 7 | ``` 8 | */ 9 | 10 | @media (prefers-color-scheme: dark) { 11 | :root {} 12 | } -------------------------------------------------------------------------------- /frontend/pages/admin/admin-wxa-auto-dark.wxss: -------------------------------------------------------------------------------- 1 | /* 2 | 此文件为开发者工具生成,生成时间: 2021/3/6 上午12:19:08 3 | 使用方法: 4 | 在 admin.wxss 文件末尾引入样式 5 | ``` 6 | @import "./admin-wxa-auto-dark.wxss"; 7 | ``` 8 | */ 9 | 10 | @media (prefers-color-scheme: dark) { 11 | :root { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /frontend/app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss**/ 2 | .container { 3 | height: 100%; 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | justify-content: space-between; 8 | padding: 200rpx 0; 9 | box-sizing: border-box; 10 | } 11 | 12 | @import 'app-wxa-auto-dark.wxss' -------------------------------------------------------------------------------- /frontend/pages/admin_verify/admin_verify-wxa-auto-dark.wxss: -------------------------------------------------------------------------------- 1 | /* 2 | 此文件为开发者工具生成,生成时间: 2021/3/6 上午12:19:12 3 | 使用方法: 4 | 在 admin_verify.wxss 文件末尾引入样式 5 | ``` 6 | @import "./admin_verify-wxa-auto-dark.wxss"; 7 | ``` 8 | */ 9 | 10 | @media (prefers-color-scheme: dark) { 11 | .password-input { 12 | border-color: rgb(83, 83, 83); 13 | } 14 | } -------------------------------------------------------------------------------- /frontend/pages/admin/admin.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarBackgroundColor": "#ffffff", 3 | "navigationBarTextStyle": "black", 4 | "navigationBarTitleText": "管理后台", 5 | "backgroundColor": "#eeeeee", 6 | "backgroundTextStyle": "light", 7 | "component": true, 8 | "usingComponents": { 9 | "mp-dialog": "weui-miniprogram/dialog/dialog" 10 | } 11 | } -------------------------------------------------------------------------------- /frontend/pages/admin_verify/admin_verify.wxss: -------------------------------------------------------------------------------- 1 | /* pages/admin_verify/admin_verify.wxss */ 2 | 3 | .password-input { 4 | margin-top: 50%; 5 | margin: 50rpx; 6 | padding: 20rpx 50rpx; 7 | border-style: solid; 8 | border-width: 1rpx; 9 | border-color: #aaa; 10 | border-radius: 20rpx; 11 | } 12 | 13 | @import 'admin_verify-wxa-auto-dark.wxss' -------------------------------------------------------------------------------- /frontend/pages/mybooks/mybooks.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarBackgroundColor": "#ffffff", 3 | "navigationBarTextStyle": "black", 4 | "navigationBarTitleText": "我的预约", 5 | "backgroundColor": "#eeeeee", 6 | "backgroundTextStyle": "light", 7 | "component": true, 8 | "usingComponents": { 9 | "mp-dialog": "weui-miniprogram/dialog/dialog" 10 | } 11 | } -------------------------------------------------------------------------------- /checkpoint.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | sess = requests.session() 4 | sess.headers.update({'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 ' 5 | '(KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36'}) 6 | response = sess.get('https://www.bugstop.site/checkpoint/') 7 | 8 | print(response.json()) 9 | print('data force save') 10 | -------------------------------------------------------------------------------- /frontend/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "requires": true, 3 | "lockfileVersion": 1, 4 | "dependencies": { 5 | "weui-miniprogram": { 6 | "version": "1.0.7", 7 | "resolved": "https://registry.npmjs.org/weui-miniprogram/-/weui-miniprogram-1.0.7.tgz", 8 | "integrity": "sha512-tXpLnUyaN1jEZHlYAWid3q+Rbov6a90t7QX4uunEa9E2+IUrVLqxo1Q1CfT1uTtjE5hqg6ABGU0NA819Ga1D3g==" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /frontend/pages/index/index-wxa-auto-dark.wxss: -------------------------------------------------------------------------------- 1 | /* 2 | 此文件为开发者工具生成,生成时间: 2021/3/6 上午12:18:57 3 | 使用方法: 4 | 在 index.wxss 文件末尾引入样式 5 | ``` 6 | @import "./index-wxa-auto-dark.wxss"; 7 | ``` 8 | */ 9 | 10 | @media (prefers-color-scheme: dark) { 11 | .userinfo-nickname { 12 | color: rgb(83, 83, 83); 13 | } 14 | 15 | .button { 16 | border-color: rgb(83, 83, 83); 17 | } 18 | 19 | .buttonHover { 20 | border-color: rgb(83, 83, 83); 21 | background: rgb(11, 57, 68); 22 | color: rgb(17, 17, 17); 23 | } 24 | } -------------------------------------------------------------------------------- /frontend/utils/util.js: -------------------------------------------------------------------------------- 1 | const formatTime = date => { 2 | const year = date.getFullYear() 3 | const month = date.getMonth() + 1 4 | const day = date.getDate() 5 | const hour = date.getHours() 6 | const minute = date.getMinutes() 7 | const second = date.getSeconds() 8 | 9 | return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}` 10 | } 11 | 12 | const formatNumber = n => { 13 | n = n.toString() 14 | return n[1] ? n : `0${n}` 15 | } 16 | 17 | module.exports = { 18 | formatTime 19 | } 20 | -------------------------------------------------------------------------------- /frontend/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/index/index", 4 | "pages/mybooks/mybooks", 5 | "pages/admin_verify/admin_verify", 6 | "pages/book/book", 7 | "pages/admin/admin" 8 | ], 9 | "window": { 10 | "backgroundTextStyle": "light", 11 | "navigationBarBackgroundColor": "#fff", 12 | "navigationBarTitleText": "心理咨询预约", 13 | "navigationBarTextStyle": "black", 14 | "enablePullDownRefresh": false 15 | }, 16 | "style": "v2", 17 | "sitemapLocation": "sitemap.json", 18 | "useExtendedLib": { 19 | "weui": true 20 | } 21 | } -------------------------------------------------------------------------------- /backend/new.py: -------------------------------------------------------------------------------- 1 | import os 2 | import json 3 | 4 | if not os.path.isdir('data'): 5 | os.mkdir('data') 6 | 7 | with open('data/tickets_open.json', 'w') as f: 8 | json.dump({}, f) 9 | 10 | with open('data/tickets_closed.json', 'w') as f: 11 | json.dump({}, f) 12 | 13 | dynamic = { 14 | 'off_days': [], # 特殊休息日 15 | 'blocked': [] # 封禁用户名单 16 | } 17 | 18 | with open('data/dynamic.json', 'w') as f: 19 | json.dump(dynamic, f) 20 | 21 | # written in secrets.py 22 | with open('data/settings.json', 'w') as f: 23 | json.dump({}, f) 24 | 25 | # written in secrets.py 26 | with open('data/secrets.json', 'w') as f: 27 | json.dump({}, f) 28 | -------------------------------------------------------------------------------- /frontend/pages/admin_verify/admin_verify.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /frontend/pages/book/book.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarBackgroundColor": "#ffffff", 3 | "navigationBarTextStyle": "black", 4 | "navigationBarTitleText": "信息填写", 5 | "backgroundColor": "#eeeeee", 6 | "backgroundTextStyle": "light", 7 | "component": true, 8 | "usingComponents": { 9 | "mp-cells": "weui-miniprogram/cells/cells", 10 | "mp-cell": "weui-miniprogram/cell/cell", 11 | "mp-checkbox": "weui-miniprogram/checkbox/checkbox", 12 | "mp-checkbox-group": "weui-miniprogram/checkbox-group/checkbox-group", 13 | "mp-form": "weui-miniprogram/form/form", 14 | "mp-form-page": "weui-miniprogram/form-page/form-page", 15 | "mp-toptips": "weui-miniprogram/toptips/toptips" 16 | } 17 | } -------------------------------------------------------------------------------- /.github/workflows/python-app.yml: -------------------------------------------------------------------------------- 1 | name: Automatic Checkpoint 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: "30 10 * * *" 7 | - cron: "30 22 * * *" 8 | 9 | jobs: 10 | Checkpoint: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Set up Python environment 16 | uses: actions/setup-python@v2 17 | with: 18 | python-version: 3.9 19 | 20 | - name: Install Python dependencies 21 | run: | 22 | python -m pip install --upgrade pip 23 | pip install urllib3==1.25.11 24 | pip install requests 25 | 26 | - name: Checkpoint Save 27 | shell: bash 28 | run: python checkpoint.py 29 | -------------------------------------------------------------------------------- /frontend/pages/admin_verify/admin_verify.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarBackgroundColor": "#ffffff", 3 | "navigationBarTextStyle": "black", 4 | "navigationBarTitleText": "管理中心", 5 | "backgroundColor": "#eeeeee", 6 | "backgroundTextStyle": "light", 7 | "component": true, 8 | "usingComponents": { 9 | "mp-cells": "weui-miniprogram/cells/cells", 10 | "mp-cell": "weui-miniprogram/cell/cell", 11 | "mp-checkbox": "weui-miniprogram/checkbox/checkbox", 12 | "mp-checkbox-group": "weui-miniprogram/checkbox-group/checkbox-group", 13 | "mp-form": "weui-miniprogram/form/form", 14 | "mp-form-page": "weui-miniprogram/form-page/form-page", 15 | "mp-toptips": "weui-miniprogram/toptips/toptips" 16 | } 17 | } -------------------------------------------------------------------------------- /frontend/pages/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Have a Great Day! 6 | 7 | 8 | 9 | 10 | 管理后台 11 | 12 | 13 | 14 | © 2021·v2.2.2
15 | Yjh&Lmh 16 |
17 |
-------------------------------------------------------------------------------- /frontend/pages/index/index.wxss: -------------------------------------------------------------------------------- 1 | /**index.wxss**/ 2 | .userinfo { 3 | display: flex; 4 | flex-direction: column; 5 | align-items: center; 6 | } 7 | 8 | .userinfo-avatar { 9 | width: 128rpx; 10 | height: 128rpx; 11 | margin: 20rpx; 12 | border-radius: 50%; 13 | } 14 | 15 | .userinfo-nickname { 16 | color: #aaa; 17 | } 18 | 19 | .welcome { 20 | margin: 15rpx; 21 | color: #666; 22 | font-size: 28rpx; 23 | } 24 | 25 | .banner { 26 | margin-top: 20rpx; 27 | width: 256rpx; 28 | height: 256rpx; 29 | } 30 | 31 | .usermotto { 32 | position: absolute; 33 | bottom: 10rpx; 34 | text-align: center; 35 | color: #666666; 36 | font-size: 24rpx; 37 | } 38 | 39 | .adminbutton { 40 | margin: 70rpx; 41 | text-align: center; 42 | font-size: 28rpx; 43 | /* text-decoration-line: underline; */ 44 | color: rgb(59, 151, 182); 45 | } 46 | 47 | .adminbuttonHover { 48 | text-decoration-line: underline; 49 | color: rgb(38, 95, 114); 50 | } 51 | 52 | .options { 53 | margin-top: 80rpx; 54 | } 55 | 56 | .footer { 57 | position: absolute; 58 | bottom: 30rpx; 59 | } 60 | 61 | .sep { 62 | padding: 2rpx; 63 | } 64 | 65 | @import 'index-wxa-auto-dark.wxss' -------------------------------------------------------------------------------- /frontend/pages/admin/admin.wxss: -------------------------------------------------------------------------------- 1 | /* pages/admin/admin.wxss */ 2 | 3 | .weui-form-preview { 4 | margin-bottom: 50rpx; 5 | } 6 | 7 | .empty { 8 | display: flex; 9 | flex-direction: column; 10 | align-items: center; 11 | margin-top: 100rpx; 12 | margin: 20rpx; 13 | font-size: 30rpx; 14 | color: #666666; 15 | position: relative; 16 | /*脱离文档流*/ 17 | margin-top: 45%; 18 | /*偏移*/ 19 | } 20 | 21 | .weui-tab__content { 22 | padding-top: 120rpx; 23 | text-align: center; 24 | } 25 | 26 | #top { 27 | height: 15rpx; 28 | background: linear-gradient(180deg, #ffffff, #fcfcfc); 29 | } 30 | 31 | .weui-navbar { 32 | background: linear-gradient(180deg, #fcfcfc, #f9f9f9); 33 | } 34 | 35 | .weui-navbar__item { 36 | margin: 0rpx 50rpx 15rpx 50rpx; 37 | padding: 20rpx !important; 38 | } 39 | 40 | .weui-navbar__title { 41 | padding: 0; 42 | color: dimgray; 43 | } 44 | 45 | .weui-bar__item_on { 46 | border-radius: 15rpx; 47 | background: linear-gradient(145deg, #ffffff, #fafafa); 48 | box-shadow: 3rpx 3rpx 6rpx #d9d9d9, 49 | -3rpx -3rpx 6rpx #ffffff; 50 | } 51 | 52 | .weui-navbar__item::after { 53 | width: 0 !important; 54 | border-right-width: 0 !important; 55 | } 56 | 57 | @import 'admin-wxa-auto-dark.wxss' -------------------------------------------------------------------------------- /frontend/pages/mybooks/mybooks.wxss: -------------------------------------------------------------------------------- 1 | /* pages/mybooks/mybooks.wxss */ 2 | 3 | .weui-form-preview { 4 | margin-bottom: 50rpx; 5 | } 6 | 7 | .empty { 8 | display: flex; 9 | flex-direction: column; 10 | align-items: center; 11 | margin-top: 100rpx; 12 | margin: 20rpx; 13 | font-size: 30rpx; 14 | color: #666666; 15 | position: relative; 16 | /*脱离文档流*/ 17 | margin-top: 45%; 18 | /*偏移*/ 19 | } 20 | 21 | .weui-tab__content { 22 | padding-top: 120rpx; 23 | text-align: center; 24 | } 25 | 26 | #top { 27 | height: 15rpx; 28 | background: linear-gradient(180deg, #ffffff, #fcfcfc); 29 | } 30 | 31 | .weui-navbar { 32 | background: linear-gradient(180deg, #fcfcfc, #f9f9f9); 33 | } 34 | 35 | .weui-navbar__item { 36 | margin: 0rpx 50rpx 15rpx 50rpx; 37 | padding: 20rpx !important; 38 | } 39 | 40 | .weui-navbar__title { 41 | padding: 0; 42 | color: dimgray; 43 | } 44 | 45 | .weui-bar__item_on { 46 | border-radius: 15rpx; 47 | background: linear-gradient(145deg, #ffffff, #fafafa); 48 | box-shadow: 3rpx 3rpx 6rpx #d9d9d9, 49 | -3rpx -3rpx 6rpx #ffffff; 50 | } 51 | 52 | .weui-navbar__item::after { 53 | width: 0 !important; 54 | border-right-width: 0 !important; 55 | } 56 | 57 | @import 'mybooks-wxa-auto-dark.wxss' -------------------------------------------------------------------------------- /frontend/pages/index/index.js: -------------------------------------------------------------------------------- 1 | // index.js 2 | // 获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | mask_show: true, 8 | motto: 'Hello World', 9 | userInfo: {}, 10 | hasUserInfo: false, 11 | canIUse: wx.canIUse('button.open-type.getUserInfo'), 12 | code: [], 13 | banner: 1, 14 | }, 15 | // 事件处理函数 16 | onLoad() { 17 | var i = Math.ceil(Math.random() * 7) 18 | this.setData({ 19 | banner: i 20 | }) 21 | }, 22 | changebanner() { 23 | var i = this.data.banner; 24 | i = i + 1; 25 | if (i > 7) { 26 | i = 1; 27 | } 28 | this.setData({ 29 | banner: i 30 | }) 31 | }, 32 | bindViewTap() { 33 | wx.navigateTo({ 34 | url: '../logs/logs' 35 | }) 36 | }, 37 | gotoAdmin() { 38 | wx.navigateTo({ 39 | url: '../admin_verify/admin_verify' 40 | }) 41 | }, 42 | gotoBook() { 43 | wx.navigateTo({ 44 | url: '../book/book' 45 | }) 46 | }, 47 | gotomyBooks() { 48 | wx.navigateTo({ 49 | url: '../mybooks/mybooks' 50 | }) 51 | }, 52 | /** 53 | * 用户点击右上角分享 54 | */ 55 | onShareAppMessage: function () { 56 | 57 | }, 58 | }) -------------------------------------------------------------------------------- /frontend/project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件", 3 | "packOptions": { 4 | "ignore": [] 5 | }, 6 | "setting": { 7 | "urlCheck": false, 8 | "es6": true, 9 | "enhance": false, 10 | "postcss": true, 11 | "preloadBackgroundData": false, 12 | "minified": true, 13 | "newFeature": false, 14 | "coverView": true, 15 | "nodeModules": false, 16 | "autoAudits": false, 17 | "showShadowRootInWxmlPanel": true, 18 | "scopeDataCheck": false, 19 | "uglifyFileName": false, 20 | "checkInvalidKey": true, 21 | "checkSiteMap": true, 22 | "uploadWithSourceMap": true, 23 | "compileHotReLoad": false, 24 | "useMultiFrameRuntime": true, 25 | "useApiHook": true, 26 | "useApiHostProcess": false, 27 | "babelSetting": { 28 | "ignore": [], 29 | "disablePlugins": [], 30 | "outputPath": "" 31 | }, 32 | "enableEngineNative": false, 33 | "bundle": false, 34 | "useIsolateContext": true, 35 | "useCompilerModule": true, 36 | "userConfirmedUseCompilerModuleSwitch": false, 37 | "userConfirmedBundleSwitch": false, 38 | "packNpmManually": false, 39 | "packNpmRelationList": [], 40 | "minifyWXSS": true 41 | }, 42 | "compileType": "miniprogram", 43 | "libVersion": "2.15.0", 44 | "appid": "wxdefe17992df5e3fb", 45 | "projectname": "miniprogram-2", 46 | "debugOptions": { 47 | "hidedInDevtools": [] 48 | }, 49 | "scripts": {}, 50 | "staticServerOptions": { 51 | "baseURL": "", 52 | "servePath": "" 53 | }, 54 | "isGameTourist": false, 55 | "simulatorType": "wechat", 56 | "simulatorPluginLibVersion": {}, 57 | "condition": { 58 | "search": { 59 | "list": [] 60 | }, 61 | "conversation": { 62 | "list": [] 63 | }, 64 | "game": { 65 | "list": [] 66 | }, 67 | "plugin": { 68 | "list": [] 69 | }, 70 | "gamePlugin": { 71 | "list": [] 72 | }, 73 | "miniprogram": { 74 | "list": [] 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /frontend/app.js: -------------------------------------------------------------------------------- 1 | // app.js 2 | App({ 3 | onLaunch() { 4 | var that = this 5 | wx.showLoading({ 6 | title: "登陆中", 7 | mask: true, 8 | }); 9 | // 登录 10 | wx.login({ 11 | 12 | success: res => { 13 | // 发送 res.code 到后台换取 openId, sessionKey, unionId 14 | 15 | wx.request({ 16 | url: 'https://www.bugstop.site/user/id/', 17 | headers: { 18 | 'Content-Type': 'application/json' 19 | }, 20 | data: res, 21 | method: "POST", 22 | timeout: 10000, 23 | success(res) { 24 | console.log(res.data) 25 | if (res.statusCode == 200) { 26 | wx.hideLoading(); 27 | that.globalData.wx = res.data.wx 28 | } else { 29 | wx.hideLoading(); 30 | wx.showToast({ 31 | title: "登录失败", 32 | icon: 'error', //如果要纯文本,不要icon,将值设为'none' 33 | mask: true, 34 | duration: 3000 35 | }) 36 | } 37 | }, 38 | fail() { 39 | wx.hideLoading(); 40 | wx.showToast({ 41 | title: "连接超时", 42 | icon: 'error', //如果要纯文本,不要icon,将值设为'none' 43 | mask: true, 44 | duration: 3000 45 | }) 46 | } 47 | }) 48 | } 49 | }) 50 | // 获取用户信息 51 | wx.getSetting({ 52 | success: res => { 53 | if (res.authSetting['scope.userInfo']) { 54 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 55 | wx.getUserInfo({ 56 | success: res => { 57 | // 可以将 res 发送给后台解码出 unionId 58 | this.globalData.userInfo = res.userInfo 59 | 60 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 61 | // 所以此处加入 callback 以防止这种情况 62 | if (this.userInfoReadyCallback) { 63 | this.userInfoReadyCallback(res) 64 | } 65 | } 66 | }) 67 | } 68 | } 69 | }) 70 | }, 71 | globalData: { 72 | userInfo: null, 73 | wx: null, 74 | admin_password: null 75 | } 76 | }) -------------------------------------------------------------------------------- /frontend/pages/admin_verify/admin_verify.js: -------------------------------------------------------------------------------- 1 | // pages/admin_verify/admin_verify.js 2 | 3 | var md5 = require("md5.js") 4 | const app = getApp() 5 | Page({ 6 | 7 | /** 8 | * 页面的初始数据 9 | */ 10 | data: { 11 | password: [], 12 | }, 13 | 14 | /** 15 | * 生命周期函数--监听页面加载 16 | */ 17 | onLoad: function (options) { 18 | var that = this 19 | wx.getStorage({ 20 | key: 'password', 21 | success(res) { 22 | that.setData({ 23 | password: res.data 24 | }); 25 | if (that.password != "") { 26 | that.login(); 27 | } 28 | } 29 | }) 30 | 31 | }, 32 | 33 | /** 34 | * 生命周期函数--监听页面初次渲染完成 35 | */ 36 | onReady: function () { 37 | 38 | }, 39 | 40 | /** 41 | * 生命周期函数--监听页面显示 42 | */ 43 | onShow: function () { 44 | 45 | }, 46 | 47 | /** 48 | * 生命周期函数--监听页面隐藏 49 | */ 50 | onHide: function () { 51 | 52 | }, 53 | 54 | /** 55 | * 生命周期函数--监听页面卸载 56 | */ 57 | onUnload: function () { 58 | 59 | }, 60 | 61 | /** 62 | * 页面相关事件处理函数--监听用户下拉动作 63 | */ 64 | onPullDownRefresh: function () { 65 | 66 | }, 67 | 68 | /** 69 | * 页面上拉触底事件的处理函数 70 | */ 71 | onReachBottom: function () { 72 | 73 | }, 74 | 75 | formInputChange(e) { 76 | wx.setStorage({ 77 | key: "password", 78 | data: e.detail.value, 79 | }); 80 | this.setData({ 81 | password: e.detail.value, 82 | }); 83 | }, 84 | 85 | login() { 86 | var that = this 87 | if (this.data.password == "") { 88 | this.setData({ 89 | error: "请输入密码" 90 | }) 91 | } else { 92 | wx.showLoading({ 93 | title: "登陆中", 94 | mask: true, 95 | }); 96 | wx.request({ 97 | url: 'https://www.bugstop.site/user/verify/', 98 | headers: { 99 | 'Content-Type': 'application/json' 100 | }, 101 | data: { 102 | password: md5.md5(this.data.password) 103 | }, 104 | method: "POST", 105 | success(res) { 106 | if (res.data.statusCode == 200) { 107 | wx.hideLoading(); 108 | app.globalData.admin_password = md5.md5(that.data.password); 109 | wx.redirectTo({ 110 | url: '../admin/admin' 111 | }) 112 | } else { 113 | wx.hideLoading(); 114 | that.setData({ 115 | error: "管理密码错误,请联系开发者", 116 | password: "" 117 | }) 118 | } 119 | }, 120 | fail() { 121 | wx.hideLoading(); 122 | that.setData({ 123 | error: "登录超时,请稍候重试", 124 | }) 125 | } 126 | }) 127 | } 128 | } 129 | }) -------------------------------------------------------------------------------- /backend/data/settings.json: -------------------------------------------------------------------------------- 1 | {"checkpoint_frequency": 600, "school": {"\u7535\u5b50\u4e0e\u4fe1\u606f\u5de5\u7a0b\u5b66\u9662": {"\u5730\u70b9": "L1103", "\u8f85\u5bfc\u5458": ["\u718a\u6676\u73b2", "\u5e94\u68a6\u5a34", "\u7530\u8587", "\u6881\u7fa1\u98de", "\u674e\u5a1c"], "\u6700\u8fdc\u53ef\u9884\u7ea6\u5929\u6570": 15, "\u63d0\u524d\u9884\u7ea6\u5c0f\u65f6\u6570": 1}, "\u571f\u6728\u4e0e\u73af\u5883\u5de5\u7a0b\u5b66\u9662": {"\u5730\u70b9": "E425", "\u8f85\u5bfc\u5458": ["\u8d75\u7af9\u9752", "\u6768\u78ca", "\u66f2\u4e30\u6210", "\u5415\u4fca\u5b8f", "\u5218\u6587\u4e9a", "\u674e\u70e8", "\u66f9\u7f61"], "\u6700\u8fdc\u53ef\u9884\u7ea6\u5929\u6570": 30, "\u63d0\u524d\u9884\u7ea6\u5c0f\u65f6\u6570": 1}}, "teacher": {"\u7535\u5b50\u4e0e\u4fe1\u606f\u5de5\u7a0b\u5b66\u9662": {"\u718a\u6676\u73b2": {"\u90ae\u7bb1": "821300030@qq.com", "\u65f6\u95f4": [[9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [], []]}, "\u5e94\u68a6\u5a34": {"\u90ae\u7bb1": "916720619@qq.com", "\u65f6\u95f4": [[9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [], []]}, "\u7530\u8587": {"\u90ae\u7bb1": "635661409@qq.com", "\u65f6\u95f4": [[9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [], []]}, "\u6881\u7fa1\u98de": {"\u90ae\u7bb1": "2695998275@qq.com", "\u65f6\u95f4": [[9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [], []]}, "\u674e\u5a1c": {"\u90ae\u7bb1": "2076505738@qq.com", "\u65f6\u95f4": [[9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [9, 10, 11, 14, 15, 16], [], []]}}, "\u571f\u6728\u4e0e\u73af\u5883\u5de5\u7a0b\u5b66\u9662": {"\u8d75\u7af9\u9752": {"\u90ae\u7bb1": "zhaozhuqing@hit.edu.cn", "\u65f6\u95f4": [[], [], [], [], [15, 16], [], []]}, "\u6768\u78ca": {"\u90ae\u7bb1": "yanglei2020@hit.edu.cn", "\u65f6\u95f4": [[], [], [], [], [10], [], []]}, "\u66f2\u4e30\u6210": {"\u90ae\u7bb1": "694591705@qq.com", "\u65f6\u95f4": [[], [], [], [15], [], [], []]}, "\u5415\u4fca\u5b8f": {"\u90ae\u7bb1": "lvjunhong@hit.edu.cn", "\u65f6\u95f4": [[], [], [], [], [9], [], []]}, "\u5218\u6587\u4e9a": {"\u90ae\u7bb1": "liuwenya@hit.edu.cn", "\u65f6\u95f4": [[], [], [], [10], [], [], []]}, "\u674e\u70e8": {"\u90ae\u7bb1": "liye@hit.edu.cn", "\u65f6\u95f4": [[16], [], [], [], [], [], []]}, "\u66f9\u7f61": {"\u90ae\u7bb1": "caogang@hit.edu.cn", "\u65f6\u95f4": [[10], [], [], [], [], [], []]}}}, "date_format": "%Y \u5e74 %m \u6708 %d \u65e5 \u00b7 %A", "hour_format": ["{:02d}:00 \u00b7 \u5927\u7ea6 30 \u5206\u949f", "{:02d}:30 \u00b7 \u5927\u7ea6 30 \u5206\u949f"], "time_format": "%Y \u5e74 %m \u6708 %d \u65e5 \u00b7 %A%H:%M \u00b7 \u5927\u7ea6 30 \u5206\u949f", "ticket_format": "{:05d}@{}", "timestamp": "%Y-%m-%d %H:%M:%S", "must_fill": ["wx", "id", "name", "sex", "mobile", "school", "teacher", "date", "hour"], "languages": {"en": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], "zh": ["\u5468\u4e00", "\u5468\u4e8c", "\u5468\u4e09", "\u5468\u56db", "\u5468\u4e94", "\u5468\u516d", "\u5468\u65e5"], "zh_cn": ["\u661f\u671f\u4e00", "\u661f\u671f\u4e8c", "\u661f\u671f\u4e09", "\u661f\u671f\u56db", "\u661f\u671f\u4e94", "\u661f\u671f\u516d", "\u661f\u671f\u65e5"]}} -------------------------------------------------------------------------------- /frontend/pages/book/book.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | {{sex[sexIndex]}} 13 | 请选择性别 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | {{dataSchool.schools[schoolIndex]}} 25 | 请选择所在学院 26 | 27 | 28 | 29 | 30 | {{teacher_available[teacherIndex]}} 31 | 请选择辅导员 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | {{dataSchedule.dates[dateIndex]}} 40 | 请选择日期 41 | 42 | 43 | 44 | 45 | {{hour_available[hourIndex]}} 46 | 请选择时间 47 | 48 | 49 | 50 | 51 | 52 | 53 |