Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 46 additions & 11 deletions miniprogram/app.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,54 @@
//app.js
App({
onLaunch: function () {
if (!wx.cloud) {
console.error('请使用 2.2.3 或以上的基础库以使用云能力')
} else {
//调用API从本地缓存中获取数据
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
//初始化云开发环境
if (wx.cloud) {
wx.cloud.init({
// env 参数说明:
// env 参数决定接下来小程序发起的云开发调用(wx.cloud.xxx)会默认请求到哪个云环境的资源
// 此处请填入环境 ID, 环境 ID 可打开云控制台查看
// 如不填则使用默认环境(第一个创建的环境)
// env: 'my-env-id',
traceUser: true,
traceUser: true
})
}

this.globalData = {}
//获取系统信息
wx.getSystemInfo({
success: e => {
this.globalData.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect(); //右上角胶囊按钮坐标信息
this.globalData.Custom = custom;
this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
}
})
},
//全局变量
globalData: {
openid:'',
username:'',
startTimeText: '',
endTimeText: '',
room: ''
},

getUserInfo:function(cb){
var that = this
if(this.globalData.userInfo){
typeof cb == "function" && cb(this.globalData.userInfo)
}else{
//调用登录接口
wx.login({
success: function () {
wx.getUserInfo({
success: function (res) {
that.globalData.userInfo = res.userInfo
typeof cb == "function" && cb(that.globalData.userInfo)
}
})
}
})
}
},
globalData:{
userInfo:null
}
})
18 changes: 11 additions & 7 deletions miniprogram/app.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
{
"pages": [
"pages/logs1/logs",
"pages/check/check",
"pages/order/order",
"pages/appointment_apply/appointment_apply",
"pages/index/index",
"pages/user_page/user_page",
"pages/fill_info/fill_info",
"pages/my_records/my_records",
"pages/my_record/my_record",
"pages/administrator/administrator",
"pages/appointment_page/appointment_page",
"pages/appointment_guide/appointment_guide",
"pages/appointment_apply/appointment_apply",
"pages/room_overview/room_overview"
"pages/room_overview/room_overview",
"pages/log/log"
],
"window": {
"backgroundColor": "#F6F6F6",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#F6F6F6",
"navigationBarTitleText": "云开发 QuickStart",
"navigationBarTitleText": "会议室预约",
"navigationBarTextStyle": "black"
},
"sitemapLocation": "sitemap.json",
"style": "v2"
}
"sitemapLocation": "sitemap.json"

}
155 changes: 7 additions & 148 deletions miniprogram/app.wxss
Original file line number Diff line number Diff line change
@@ -1,156 +1,15 @@
/**app.wxss**/
@import "/style/main.wxss";
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
}

button {
background: initial;
}

button:focus{
outline: 0;
}

button::after{
border: none;
}


page {
background: #f6f6f6;
display: flex;
flex-direction: column;
justify-content: flex-start;
}

.userinfo, .uploader, .tunnel {
margin-top: 40rpx;
height: 140rpx;
width: 100%;
background: #fff;
border: 1px solid rgba(0, 0, 0, 0.1);
border-left: none;
border-right: none;
display: flex;
flex-direction: row;
align-items: center;
transition: all 300ms ease;
}

.userinfo-avatar {
width: 100rpx;
height: 100rpx;
margin: 20rpx;
border-radius: 50%;
background-size: cover;
background-color: white;
}

.userinfo-avatar:after {
border: none;
}

.userinfo-nickname {
font-size: 32rpx;
color: #007aff;
background-color: white;
background-size: cover;
}

.userinfo-nickname::after {
border: none;
}

.uploader, .tunnel {
height: auto;
padding: 0 0 0 40rpx;
flex-direction: column;
align-items: flex-start;
box-sizing: border-box;
}

.uploader-text, .tunnel-text {
width: 100%;
line-height: 52px;
font-size: 34rpx;
color: #007aff;
}

.uploader-container {
width: 100%;
height: 400rpx;
padding: 20rpx 20rpx 20rpx 0;
display: flex;
align-content: center;
justify-content: center;
box-sizing: border-box;
border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.uploader-image {
width: 100%;
height: 360rpx;
}

.tunnel {
padding: 0 0 0 40rpx;
}

.tunnel-text {
position: relative;
color: #222;
display: flex;
flex-direction: row;
align-content: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.tunnel-text:first-child {
border-top: none;
}

.tunnel-switch {
position: absolute;
right: 20rpx;
top: -2rpx;
}

.disable {
color: #888;
}

.service {
position: fixed;
right: 40rpx;
bottom: 40rpx;
width: 140rpx;
height: 140rpx;
border-radius: 50%;
background: linear-gradient(#007aff, #0063ce);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
display: flex;
align-content: center;
justify-content: center;
transition: all 300ms ease;
}

.service-button {
position: absolute;
top: 40rpx;
}

.service:active {
box-shadow: none;
}
}

.request-text {
padding: 20rpx 0;
font-size: 24rpx;
line-height: 36rpx;
word-break: break-all;
}
input{font-size: 32rpx}
button{font-size: 36rpx}
text{font-size: 28rpx}
110 changes: 110 additions & 0 deletions miniprogram/pages/check/check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// pages/check.js
const db = wx.cloud.database()
Page({

/**
* 页面的初始数据
*/
data: {

},
jobNumberInput:function(e){
console.log(e.detail.value)
this.setData({
jobNumber:parseInt(e.detail.value)
})
},
check:function(e){
var jobNumber = this.data.jobNumber
console.log(jobNumber)
console.log(typeof(jobNumber))
db.collection('teacherInfo').where({
jobNumber:jobNumber
})
.get({
success: function(res) {
// res.data 是包含以上定义的两条记录的数组
console.log(res.data)
if(res.data.length!=0){
wx.redirectTo({
url: '../fill_info/fill_info',
})
}else if(res.data.length==0){
console.log(1)
wx.showModal({
content:"不存在该用户",
cancelText:"完善信息",
confirmText:"重写输入",
success (res) {
if (res.confirm) {
} else if (res.cancel) {
wx.redirectTo({
url: '../fill_info/fill_info',
})
}
}
})
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
jobNumber:""
})
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
jobNumber:""
})
},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})
3 changes: 3 additions & 0 deletions miniprogram/pages/check/check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"usingComponents": {}
}
10 changes: 10 additions & 0 deletions miniprogram/pages/check/check.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<view class="cu-form-group margin-top">
<view class="title">职工号:</view>
<input placeholder="请输入职工号以验证" bindinput="jobNumberInput"></input>
</view>


<view class="padding flex flex-direction">
<button class="cu-btn bg-blue margin-tb-sm lg button-hover" role="button" aria-disabled="false" bindtap='check'>验证登陆</button>

</view>
1 change: 1 addition & 0 deletions miniprogram/pages/check/check.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* pages/check.wxss */
Loading