├── 微信小程序前端 ├── pages │ ├── index │ │ ├── help.json │ │ ├── next.json │ │ ├── help.wxss │ │ ├── next.wxss │ │ ├── ini.json │ │ ├── help.js │ │ ├── help.wxml │ │ ├── index.wxml │ │ ├── next.wxml │ │ ├── next.js │ │ ├── index.wxss │ │ ├── ini.wxml │ │ ├── ini.wxss │ │ ├── index.js │ │ └── ini.js │ ├── logs │ │ ├── logs.json │ │ ├── logs.wxml │ │ ├── logs.js │ │ └── logs.wxss │ ├── register │ │ ├── register.json │ │ ├── register.wxss │ │ ├── register.wxml │ │ └── register.js │ ├── Detial_Message │ │ ├── Detial_Message.json │ │ ├── Detial_Message.wxml │ │ ├── Detial_Message.js │ │ └── Detial_Message.wxss │ ├── Message_1Form │ │ ├── Message_1Form.json │ │ ├── Message_1Form.wxml │ │ ├── Message_1Form.wxss │ │ └── Message_1Form.js │ └── Message_2Form │ │ ├── Message_2Form.json │ │ ├── Message_2Form.wxml │ │ ├── Message_2Form.wxss │ │ └── Message_2Form.js ├── assets │ ├── logs.png │ ├── plus.png │ ├── icon0.png │ ├── icon1.png │ ├── icon2.png │ ├── icon3.png │ ├── icon4.png │ ├── icon5.png │ ├── icon6.png │ ├── todos.png │ ├── logs-active.png │ └── todos-active.png ├── app.wxss ├── project.config.json ├── app.js ├── app.json ├── utils │ └── util.js └── weui.wxss ├── 软件设计文档.pdf ├── 软件需求规格说明书.pdf ├── 小组分工与贡献率说明.pdf ├── README.md ├── 安装部署说明.md ├── 后端php ├── login.php ├── participate.php ├── register.php ├── launchsignin.php ├── delete.php ├── lookupdetail.php ├── lookup.php └── lookparticipate.php └── LICENSE /微信小程序前端/pages/index/help.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /微信小程序前端/pages/index/next.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /微信小程序前端/pages/index/help.wxss: -------------------------------------------------------------------------------- 1 | /* pages/index/help.wxss */ -------------------------------------------------------------------------------- /微信小程序前端/pages/index/next.wxss: -------------------------------------------------------------------------------- 1 | /* pages/index/next.wxss */ -------------------------------------------------------------------------------- /微信小程序前端/pages/index/ini.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "发起签到" 3 | } -------------------------------------------------------------------------------- /微信小程序前端/pages/logs/logs.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "查看启动日志" 3 | } -------------------------------------------------------------------------------- /软件设计文档.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/软件设计文档.pdf -------------------------------------------------------------------------------- /软件需求规格说明书.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/软件需求规格说明书.pdf -------------------------------------------------------------------------------- /小组分工与贡献率说明.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/小组分工与贡献率说明.pdf -------------------------------------------------------------------------------- /微信小程序前端/assets/logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/微信小程序前端/assets/logs.png -------------------------------------------------------------------------------- /微信小程序前端/assets/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/微信小程序前端/assets/plus.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 微信小程序扫码签到 2 | 扫码签到是一个基于微信平台的小程序,通过微信扫一扫,可以实现自动签到功能,免去了手工签到的麻烦。扫码签到主要用在课堂签到,并且支持扩展,以便应用到其它需要签到的场景。 3 | -------------------------------------------------------------------------------- /微信小程序前端/assets/icon0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/微信小程序前端/assets/icon0.png -------------------------------------------------------------------------------- /微信小程序前端/assets/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/微信小程序前端/assets/icon1.png -------------------------------------------------------------------------------- /微信小程序前端/assets/icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/微信小程序前端/assets/icon2.png -------------------------------------------------------------------------------- /微信小程序前端/assets/icon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/微信小程序前端/assets/icon3.png -------------------------------------------------------------------------------- /微信小程序前端/assets/icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/微信小程序前端/assets/icon4.png -------------------------------------------------------------------------------- /微信小程序前端/assets/icon5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/微信小程序前端/assets/icon5.png -------------------------------------------------------------------------------- /微信小程序前端/assets/icon6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/微信小程序前端/assets/icon6.png -------------------------------------------------------------------------------- /微信小程序前端/assets/todos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/微信小程序前端/assets/todos.png -------------------------------------------------------------------------------- /微信小程序前端/assets/logs-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/微信小程序前端/assets/logs-active.png -------------------------------------------------------------------------------- /微信小程序前端/assets/todos-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwincai/Wechat_Qrcode_sign_in/HEAD/微信小程序前端/assets/todos-active.png -------------------------------------------------------------------------------- /微信小程序前端/pages/logs/logs.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{data.useNname}} 5 | {{data.key}} -------------------------------------------------------------------------------- /安装部署说明.md: -------------------------------------------------------------------------------- 1 | ## 安装部署说明 2 | 1. 本应用是基于微信环境的微信小程序。发布后可以在微信扫码,扫描小程序码即可自动安装。 3 | 2. 由于审核尚未通过,电脑端展示需要通过微信开发者工具模拟运行。新建一个小程序,将github里面“微信小程序前端”部分代码复制到本地对应目录即可运行。 4 | -------------------------------------------------------------------------------- /微信小程序前端/pages/index/help.js: -------------------------------------------------------------------------------- 1 | // This is our App Service. 2 | // This is our data 3 | // Register a Page. 4 | Page({ 5 | onLoad: function (option) { 6 | console.log(option.query) 7 | } 8 | 9 | }) -------------------------------------------------------------------------------- /微信小程序前端/pages/register/register.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarBackgroundColor": "#ffffff", 3 | "navigationBarTextStyle": "black", 4 | "navigationBarTitleText": "注册用户", 5 | "backgroundColor": "#eeeeee", 6 | "backgroundTextStyle": "light" 7 | } -------------------------------------------------------------------------------- /微信小程序前端/pages/Detial_Message/Detial_Message.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarBackgroundColor": "#000000", 3 | "navigationBarTextStyle": "white", 4 | "navigationBarTitleText": "签到信息", 5 | "backgroundColor": "#eeeeee", 6 | "backgroundTextStyle": "light"} -------------------------------------------------------------------------------- /微信小程序前端/pages/Message_1Form/Message_1Form.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarBackgroundColor": "#000000", 3 | "navigationBarTextStyle": "white", 4 | "navigationBarTitleText": "签到信息", 5 | "backgroundColor": "#eeeeee", 6 | "backgroundTextStyle": "light" 7 | } -------------------------------------------------------------------------------- /微信小程序前端/pages/Message_2Form/Message_2Form.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarBackgroundColor": "#000000", 3 | "navigationBarTextStyle": "white", 4 | "navigationBarTitleText": "签到信息", 5 | "backgroundColor": "#eeeeee", 6 | "backgroundTextStyle": "light" 7 | 8 | } -------------------------------------------------------------------------------- /微信小程序前端/app.wxss: -------------------------------------------------------------------------------- 1 | @import "weui.wxss" 2 | /**app.wxss**/ 3 | .container { 4 | height: 100%; 5 | display: flex; 6 | flex-direction: column; 7 | align-items: center; 8 | justify-content: space-between; 9 | padding: 200rpx 0; 10 | box-sizing: border-box; 11 | } 12 | -------------------------------------------------------------------------------- /微信小程序前端/pages/index/help.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 扫码签到工具 4 | 签到小工具,适用于培训,会议,旅游,投票的签到。 5 | 使用方法如下: 6 | 1.发起者点击发起签到,输入签到名称,获得二维码 7 | 2.发起者将二维码发送给需签到的人,参与者通过扫 8 | 二维码即可完成签到 9 | 3.发起者可以查看并导出已签到名单 10 | 4.签到者可以修改自己的签到信息 11 | 12 | 13 | 14 | 15 | 16 | 作者: 17 | 白露 马楷强 崔书宇 蔡冠文 18 | 周蕊雨 吴志慧 李文轩 蔡凡 19 | -------------------------------------------------------------------------------- /微信小程序前端/pages/Detial_Message/Detial_Message.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 签到总人数为:{{list.length}} 4 | 5 | {{item.studentID}} 6 | {{item.studentName}} 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /微信小程序前端/pages/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | hello! 4 | 5 | 6 | 7 | 8 | 9 | 发起签到 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 扫码签到 19 | 20 | -------------------------------------------------------------------------------- /微信小程序前端/pages/logs/logs.js: -------------------------------------------------------------------------------- 1 | // pages/leftSwiperDel/index.js 2 | Page({ 3 | data: { 4 | 5 | }, 6 | onLoad: function (options) { 7 | // 页面初始化 options为页面跳转所带来的参数 8 | 9 | }, 10 | onReady: function () { 11 | // 页面渲染完成 12 | }, 13 | onShow: function () { 14 | // 页面显示 15 | }, 16 | onHide: function () { 17 | // 页面隐藏 18 | }, 19 | onUnload: function () { 20 | // 页面关闭 21 | } 22 | //测试临时数据 23 | 24 | 25 | 26 | }) 27 | -------------------------------------------------------------------------------- /微信小程序前端/pages/Message_2Form/Message_2Form.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 签到总人数为:{{list.length}} 7 | 8 | {{item.topic}} 9 | {{item.startTime}} 10 | {{item.endTime}} 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /微信小程序前端/pages/index/next.wxml: -------------------------------------------------------------------------------- 1 | 2 | 发起签到成功! 3 | \n 4 | 签到主题: 5 | {{temp}} 6 | 签到二维码: 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 扫码签到步骤: 15 | 1.从微信小程序中搜索“扫码签到工具” 16 | 2.打开“扫码签到工具”,点击“扫码签到”,扫码。 17 | 18 | 说明: 19 | 点击“获取二维码”预览图片,保存图片到相册后 20 | 即可分享给他人扫码签到 -------------------------------------------------------------------------------- /微信小程序前端/pages/index/next.js: -------------------------------------------------------------------------------- 1 | // This is our App Service. 2 | // This is our data 3 | // Register a Page. 4 | var app = getApp() 5 | Page({ 6 | data: { 7 | imgalist: [/*二维码地址*/], 8 | tempFilePaths: app.globalData.url 9 | }, 10 | /** 11 | * 预览图片 12 | */ 13 | previewImage:function (e) { 14 | var current = e.target.dataset.src; 15 | wx.previewImage({ 16 | current: current, // 当前显示图片的http链接 17 | urls: this.data.imgalist // 需要预览的图片http链接列表 18 | }) 19 | }, 20 | 21 | onLoad: function (option) { 22 | //console.log(option.query) 23 | this.setData({ 24 | tempFilePaths: app.globalData.url 25 | }) 26 | } 27 | 28 | }) -------------------------------------------------------------------------------- /微信小程序前端/pages/Message_1Form/Message_1Form.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 发起了{{list.length}}个签到 7 | 8 | 9 | 10 | {{item.state}} {{item.txt}} 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /微信小程序前端/project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件。", 3 | "packOptions": { 4 | "ignore": [] 5 | }, 6 | "setting": { 7 | "urlCheck": false, 8 | "es6": true, 9 | "postcss": true, 10 | "minified": true, 11 | "newFeature": true 12 | }, 13 | "compileType": "miniprogram", 14 | "libVersion": "2.0.8", 15 | "appid": "wx6c521c83fe3494ca", 16 | "projectname": "%E6%89%AB%E7%A0%81%E7%AD%BE%E5%88%B0", 17 | "condition": { 18 | "search": { 19 | "current": -1, 20 | "list": [] 21 | }, 22 | "conversation": { 23 | "current": -1, 24 | "list": [] 25 | }, 26 | "game": { 27 | "currentL": -1, 28 | "list": [] 29 | }, 30 | "miniprogram": { 31 | "current": -1, 32 | "list": [] 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /微信小程序前端/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 | .usermotto { 20 | margin-top: 200px; 21 | } 22 | 23 | .item-icon{ 24 | width: 64rpx; 25 | vertical-align: middle; 26 | margin-right: 16rpx; 27 | display: flex; 28 | justify-content: center; 29 | } 30 | 31 | .item { 32 | display: flex; 33 | justify-content: center; 34 | } 35 | 36 | .text{ 37 | width: 100%; 38 | height: 100%; 39 | display: flex; 40 | justify-content: center; 41 | } -------------------------------------------------------------------------------- /后端php/login.php: -------------------------------------------------------------------------------- 1 | connect_error) { 13 | die("连接失败: " . $conn->connect_error); 14 | } 15 | $conn->query("set names utf8"); //设置php连接数据库用utf8编码,不然中文乱码 16 | $sql = "SELECT * FROM registeruser 17 | WHERE name='$_POST[name]' AND id='$_POST[id]'"; 18 | 19 | $result = $conn->query($sql); 20 | 21 | if ($resul) 22 | echo "t"; 23 | else 24 | echo "f"; 25 | 26 | var_dump($result); 27 | ?> -------------------------------------------------------------------------------- /后端php/participate.php: -------------------------------------------------------------------------------- 1 | connect_error) { 13 | die("连接失败: " . $conn->connect_error); 14 | } 15 | $conn->query("set names utf8"); //设置php连接数据库用utf8编码,不然中文乱码 16 | $sql = "INSERT INTO signinrecord 17 | VALUES ('$_POST[FormID]', '$_POST[studentID]', '$_POST[studentName]', '$_POST[topic]')"; 18 | 19 | $result = $conn->query($sql); 20 | //echo $result; 21 | //var_dump($result); 22 | echo json_encode($_POST); 23 | ?> -------------------------------------------------------------------------------- /后端php/register.php: -------------------------------------------------------------------------------- 1 | connect_error) { 13 | die("连接失败: " . $conn->connect_error); 14 | } 15 | $conn->query("set names utf8"); //设置php连接数据库用utf8编码,不然中文乱码 16 | $sql = "INSERT INTO registeruser (name, id, university) 17 | VALUES ('$_POST[name]', '$_POST[id]', '$_POST[university]')"; 18 | //var_dump($_POST); 19 | $result = $conn->query($sql); 20 | 21 | if ($result) 22 | echo "t"; 23 | else 24 | echo "f"; 25 | ?> -------------------------------------------------------------------------------- /后端php/launchsignin.php: -------------------------------------------------------------------------------- 1 | connect_error) { 13 | die("连接失败: " . $conn->connect_error); 14 | } 15 | $conn->query("set names utf8"); //设置php连接数据库用utf8编码,不然中文乱码 16 | $sql = "INSERT INTO signin 17 | VALUES ('$_POST[FormID]', '$_POST[startTime]', '$_POST[endTime]', '$_POST[FormerID]', '$_POST[topic]', '$_POST[content]')"; 18 | 19 | $result = $conn->query($sql); 20 | var_dump($result); 21 | var_dump($_POST); 22 | echo $_POST; 23 | ?> -------------------------------------------------------------------------------- /微信小程序前端/pages/register/register.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 | .usermotto { 20 | margin-top: 200px; 21 | } 22 | 23 | .login_info{ 24 | z-index: 999; 25 | position:absolute; 26 | } 27 | .login_form{ 28 | border-radius:5px; 29 | margin-left:8%; 30 | background-color: rgba(255,255,255,0.2); 31 | } 32 | 33 | .login_info{ 34 | z-index: 999; 35 | position:absolute; 36 | } 37 | .login_form{ 38 | border-radius:5px; 39 | margin-left:8%; 40 | background-color: rgba(255,255,255,0.2); 41 | } -------------------------------------------------------------------------------- /后端php/delete.php: -------------------------------------------------------------------------------- 1 | connect_error) { 13 | die("连接失败: " . $conn->connect_error); 14 | } 15 | $conn->query("set names utf8"); //设置php连接数据库用utf8编码,不然中文乱码 16 | 17 | //删除signin表中一条记录 18 | $sql = "DELETE FROM signin WHERE FormID='$_POST[FormID]'"; 19 | $result1 = $conn->query($sql); 20 | 21 | //var_dump(FormID); 22 | 23 | //删除表signinrecord中所有FormID的记录 24 | $sql = "DELETE FROM signinrecord WHERE FormID='$_POST[FormID]'"; 25 | $result2 = $conn->query($sql); 26 | 27 | echo $result1 && $result2; 28 | ?> -------------------------------------------------------------------------------- /后端php/lookupdetail.php: -------------------------------------------------------------------------------- 1 | connect_error) { 13 | die("连接失败: " . $conn->connect_error); 14 | } 15 | $conn->query("set names utf8"); //设置php连接数据库用utf8编码,不然中文乱码 16 | $sql = "SELECT * FROM signinrecord 17 | WHERE FormID='$_POST[FormID]'"; 18 | 19 | //查询数据库,结果集保存在result中 20 | $result = $conn->query($sql); 21 | 22 | //json化此数组,返回数据给微信 23 | $arr = []; 24 | //var_dump($arr); 25 | 26 | //把数据库拿到的结果集转化成数组 27 | if ($result){ 28 | while ($row = $result->fetch_assoc()) 29 | $arr[] = $row; 30 | } 31 | 32 | //返回给微信的json数据,注意json接受的参数只能是数组或者对象 33 | echo json_encode($arr); 34 | ?> -------------------------------------------------------------------------------- /微信小程序前端/pages/logs/logs.wxss: -------------------------------------------------------------------------------- 1 | /* pages/leftSwiperDel/index.wxss */ 2 | view{ 3 | box-sizing: border-box; 4 | } 5 | .item-box{ 6 | width: 700rpx; 7 | margin: 0 auto; 8 | padding:40rpx 0; 9 | } 10 | .items{ 11 | width: 100%; 12 | } 13 | .item{ 14 | position: relative; 15 | border-top: 2rpx solid #eee; 16 | height: 120rpx; 17 | line-height: 120rpx; 18 | overflow: hidden; 19 | 20 | } 21 | .item:last-child{ 22 | border-bottom: 2rpx solid #eee; 23 | } 24 | .inner{ 25 | position: absolute; 26 | top:0; 27 | } 28 | .inner.txt{ 29 | background-color: #fff; 30 | width: 100%; 31 | z-index: 5; 32 | padding:0 10rpx; 33 | transition: left 0.2s ease-in-out; 34 | white-space:nowrap; 35 | overflow:hidden; 36 | text-overflow:ellipsis; 37 | } 38 | .inner.del{ 39 | background-color: #e64340; 40 | width: 180rpx;text-align: center; 41 | z-index: 4; 42 | right: 0; 43 | color: #fff 44 | } 45 | .item-icon{ 46 | width: 64rpx; 47 | vertical-align: middle; 48 | margin-right: 16rpx 49 | } 50 | .thumb{ 51 | width: 200px; 52 | height: 200px; 53 | -webkit-overflow-scrolling: touch; 54 | overflow: scroll; 55 | } -------------------------------------------------------------------------------- /微信小程序前端/app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | App({ 3 | onLaunch: function () { 4 | // 展示本地存储能力 5 | var logs = wx.getStorageSync('logs') || [] 6 | logs.unshift(Date.now()) 7 | wx.setStorageSync('logs', logs) 8 | 9 | // 登录 10 | wx.login({ 11 | success: res => { 12 | // 发送 res.code 到后台换取 openId, sessionKey, unionId 13 | } 14 | }) 15 | // 获取用户信息 16 | wx.getSetting({ 17 | success: res => { 18 | if (res.authSetting['scope.userInfo']) { 19 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 20 | wx.getUserInfo({ 21 | success: res => { 22 | // 可以将 res 发送给后台解码出 unionId 23 | this.globalData.userInfo = res.userInfo 24 | 25 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 26 | // 所以此处加入 callback 以防止这种情况 27 | if (this.userInfoReadyCallback) { 28 | this.userInfoReadyCallback(res) 29 | } 30 | } 31 | }) 32 | } 33 | } 34 | }) 35 | }, 36 | globalData: { 37 | userInfo: null, 38 | wxId: 123, 39 | name: "", 40 | num: "", 41 | school: "", 42 | test:0, 43 | inner:"", 44 | url:"", 45 | }, 46 | User: { 47 | 48 | } 49 | }) -------------------------------------------------------------------------------- /微信小程序前端/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/index/index", 4 | "pages/logs/logs", 5 | "pages/Message_1Form/Message_1Form", 6 | "pages/Message_2Form/Message_2Form", 7 | "pages/index/ini", 8 | "pages/index/next", 9 | "pages/index/help", 10 | "pages/Detial_Message/Detial_Message", 11 | "pages/register/register" 12 | ], 13 | "window": { 14 | "backgroundTextStyle": "light", 15 | "navigationBarBackgroundColor": "#fff", 16 | "navigationBarTitleText": "WeChat", 17 | "navigationBarTextStyle": "black" 18 | }, 19 | "tabBar": { 20 | "color": "#999", 21 | "selectedColor": "#222", 22 | "backgroundColor": "#f8f9fb", 23 | "borderStyle": "white", 24 | "list": [ 25 | { 26 | "pagePath": "pages/index/index", 27 | "text": "主页", 28 | "iconPath": "assets/todos.png", 29 | "selectedIconPath": "assets/todos-active.png" 30 | }, 31 | { 32 | "pagePath": "pages/Message_1Form/Message_1Form", 33 | "text": "已发起", 34 | "iconPath": "assets/logs.png", 35 | "selectedIconPath": "assets/logs-active.png" 36 | }, 37 | { 38 | "pagePath": "pages/Message_2Form/Message_2Form", 39 | "text": "已签到", 40 | "iconPath": "assets/logs.png", 41 | "selectedIconPath": "assets/logs-active.png" 42 | }, 43 | { 44 | "pagePath": "pages/index/help", 45 | "text": "帮助", 46 | "iconPath": "assets/logs.png", 47 | "selectedIconPath": "assets/logs-active.png" 48 | } 49 | ] 50 | } 51 | } -------------------------------------------------------------------------------- /后端php/lookup.php: -------------------------------------------------------------------------------- 1 | connect_error) { 13 | die("连接失败: " . $conn->connect_error); 14 | } 15 | $conn->query("set names utf8"); //设置php连接数据库用utf8编码,不然中文乱码 16 | //$date = date("Y/m/d H:i:s", time() + 3600 * 6); //时间比本地时间慢了6个小时,加上 17 | //var_dump($date); 18 | /* $sql = "INSERT INTO sign (name, date) 19 | VALUES ('语文', '$date')"; 20 | $result = $conn->query($sql); */ 21 | //var_dump($result); 22 | 23 | /* $conn = new mysqli($servername, $username, $password, $dbname); 24 | $sql = "SELECT * FROM Myguests"; 25 | $result = $conn->query($sql); */ 26 | 27 | $sql = "SELECT * FROM signin 28 | WHERE FormerID='$_POST[FormerID]'"; 29 | //var_dump($_POST); 30 | 31 | //查询数据库,结果集保存在result中 32 | $result = $conn->query($sql); 33 | 34 | //json化此数组,返回数据给微信 35 | $arr = []; 36 | //var_dump($arr); 37 | 38 | //把数据库拿到的结果集转化成数组 39 | if ($result){ 40 | while ($row = $result->fetch_assoc()) 41 | $arr[] = $row; 42 | } 43 | //echo $arr[]; 44 | //var_dump($arr); 45 | //var_dump(json_encode($arr)); 46 | //$a = ['1'=>1, '2'=>['2'=>34, '3a'=>'da'], '3v'=>'bgf']; 47 | //var_dump($a); 48 | //var_dump(json_encode($a)); 49 | 50 | //返回给微信的json数据,注意json接受的参数只能是数组或者对象 51 | echo json_encode($arr); 52 | $conn->close(); 53 | ?> -------------------------------------------------------------------------------- /微信小程序前端/pages/Detial_Message/Detial_Message.js: -------------------------------------------------------------------------------- 1 | // pages/Detial_Message/Detial_Message.js 2 | Page({ 3 | 4 | /** 5 | * 页面的初始数据 6 | */ 7 | data: { 8 | str: '', 9 | key: '', 10 | list : "" 11 | }, 12 | 13 | /** 14 | * 生命周期函数--监听页面加载 15 | */ 16 | onLoad: function (options) { 17 | this.setData({ 18 | str: options.detail 19 | }) 20 | var str = this.data.str; 21 | var that = this; 22 | 23 | wx.request({ 24 | url: 'http://172.18.159.50/lookupdetail.php', 25 | data: { 26 | FormID: str, 27 | }, 28 | method: 'POST', 29 | header: { 30 | "Content-Type": "application/x-www-form-urlencoded" 31 | }, 32 | success: function (res) { 33 | var list = new Array(); 34 | list = res.data; 35 | that.setData({ 36 | list: list 37 | }); 38 | } 39 | }) 40 | }, 41 | 42 | /** 43 | * 生命周期函数--监听页面初次渲染完成 44 | */ 45 | onReady: function () { 46 | 47 | }, 48 | 49 | /** 50 | * 生命周期函数--监听页面显示 51 | */ 52 | onShow: function () { 53 | 54 | }, 55 | 56 | /** 57 | * 生命周期函数--监听页面隐藏 58 | */ 59 | onHide: function () { 60 | 61 | }, 62 | 63 | /** 64 | * 生命周期函数--监听页面卸载 65 | */ 66 | onUnload: function () { 67 | 68 | }, 69 | 70 | /** 71 | * 页面相关事件处理函数--监听用户下拉动作 72 | */ 73 | onPullDownRefresh: function () { 74 | 75 | }, 76 | 77 | /** 78 | * 页面上拉触底事件的处理函数 79 | */ 80 | onReachBottom: function () { 81 | 82 | }, 83 | 84 | /** 85 | * 用户点击右上角分享 86 | */ 87 | onShareAppMessage: function () { 88 | 89 | } 90 | }) 91 | -------------------------------------------------------------------------------- /微信小程序前端/pages/index/ini.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 签到主题 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 签到结束时间 26 | 27 | 28 | 29 | 30 | 31 | 当前选择: {{endtime}} 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 签到活动 41 | 42 | 43 | 44 | 45 |