性能优化
取消无用的setData方法,提升运算性能
This commit is contained in:
parent
1ee3712add
commit
3b4ba85b9d
24
app.js
24
app.js
@ -12,11 +12,25 @@ App({
|
||||
*/
|
||||
onLaunch: function () {
|
||||
var dbPost = new DBPost();
|
||||
var chose = dbPost.getxuehaoData();
|
||||
if (chose) {
|
||||
wx.switchTab({
|
||||
url: 'pages/post/post'
|
||||
})
|
||||
var loginTime=dbPost.getloginTimeData();//获取上次登陆时间,没有记录为0
|
||||
if(loginTime){
|
||||
var timestamp = + new Date();
|
||||
timestamp = timestamp / 1000;
|
||||
timestamp = parseInt(timestamp);
|
||||
var difference=timestamp-loginTime;//两次时间差
|
||||
if(difference>=86400){
|
||||
wx.clearStorageSync();
|
||||
wx.redirectTo({ url: 'welcome/login/login' })
|
||||
console.log("登录超时")
|
||||
}else{
|
||||
wx.switchTab({
|
||||
url: 'pages/post/post'
|
||||
})
|
||||
console.log("校验通过")
|
||||
}
|
||||
}else{
|
||||
wx.redirectTo({ url: 'welcome/login/login' })
|
||||
console.log("无登录记录")
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -8,6 +8,7 @@ var jiaoshi = "";
|
||||
var renyuan1 = "";
|
||||
var renyuan2 = "";
|
||||
var shijiancuo = "";
|
||||
var loginTime = "";
|
||||
|
||||
|
||||
module.exports = {
|
||||
@ -21,6 +22,5 @@ module.exports = {
|
||||
renyuan1: renyuan1,
|
||||
renyuan2: renyuan2,
|
||||
shijianchuo: shijiancuo,
|
||||
|
||||
|
||||
loginTime: loginTime,
|
||||
}
|
16
db/DBpost.js
16
db/DBpost.js
@ -12,6 +12,7 @@ class DBPost {
|
||||
this.storageKeyName12 = 'renyuan2';
|
||||
this.storageKeyName13 = 'shijianchuo';
|
||||
this.storageKeyName15 = 'admin';
|
||||
this.storageKeyName16 = 'loginTime';
|
||||
|
||||
|
||||
}
|
||||
@ -86,7 +87,13 @@ class DBPost {
|
||||
}
|
||||
return res13;
|
||||
}
|
||||
|
||||
getloginTimeData(){
|
||||
var res16 = wx.getStorageSync(this.storageKeyName16);
|
||||
if(!res16) {
|
||||
res16=0
|
||||
}
|
||||
return res16;
|
||||
}
|
||||
|
||||
|
||||
execSetStorageSync1(data) {
|
||||
@ -125,7 +132,9 @@ class DBPost {
|
||||
execSetStorageSync15(data) {
|
||||
wx.setStorageSync(this.storageKeyName15, data);
|
||||
}
|
||||
|
||||
execSetStorageSync16(data) {
|
||||
wx.setStorageSync(this.storageKeyName16, data);
|
||||
}
|
||||
|
||||
|
||||
newdianming(num,newdianming) {
|
||||
@ -165,6 +174,9 @@ class DBPost {
|
||||
newadmin(a) {
|
||||
this.execSetStorageSync15(a);
|
||||
}
|
||||
newloginTime(a) {
|
||||
this.execSetStorageSync16(a);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
// manage/absent/absent.js
|
||||
var app = getApp();
|
||||
import { DBPost } from '../../db/DBpost.js';
|
||||
import {
|
||||
DBPost
|
||||
} from '../../db/DBpost.js';
|
||||
Page({
|
||||
|
||||
/**
|
||||
@ -13,76 +15,76 @@ Page({
|
||||
['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30']
|
||||
],
|
||||
multiIndex: [0, 0, 0],
|
||||
yuanyinArray: [['事假', '病假', '正常']],
|
||||
yuanyinArray: [
|
||||
['事假', '病假', '正常']
|
||||
],
|
||||
yuanyinIndex: [0],
|
||||
yuanyin: 0,
|
||||
newxuehao: 0,
|
||||
xuehaonum:0,
|
||||
yuanyinnum:0,
|
||||
disabled: true,//添加班级
|
||||
xuehaonum: 0,
|
||||
yuanyinnum: 0,
|
||||
disabled: true, //添加班级
|
||||
opacity: 0.4
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
onLoad: function(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
onReady: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
onShow: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
onHide: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
onUnload: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
onPullDownRefresh: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
onReachBottom: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
onShareAppMessage: function() {
|
||||
|
||||
},
|
||||
bindMultiPickerChange1: function (e) {
|
||||
this.setData({
|
||||
xuehaonum:1
|
||||
})
|
||||
if (this.data.xuehaonum && this.data.yuanyinnum){
|
||||
bindMultiPickerChange1: function(e) {
|
||||
this.data.xuehaonum= 1;
|
||||
if (this.data.xuehaonum && this.data.yuanyinnum) {
|
||||
this.setData({
|
||||
disabled: false
|
||||
})
|
||||
@ -90,28 +92,18 @@ Page({
|
||||
opacity: 1
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.setData({
|
||||
multiIndex: e.detail.value
|
||||
})
|
||||
this.setData({
|
||||
xueyuan: this.data.multiArray[0][this.data.multiIndex[0]] //学院号!!!!!
|
||||
})
|
||||
this.setData({
|
||||
banji: this.data.multiArray[1][this.data.multiIndex[1]]
|
||||
})
|
||||
this.setData({
|
||||
geren: this.data.multiArray[2][this.data.multiIndex[2]]
|
||||
})
|
||||
this.data.xueyuan = this.data.multiArray[0][this.data.multiIndex[0]] //学院号!!!!!
|
||||
this.data.banji = this.data.multiArray[1][this.data.multiIndex[1]]
|
||||
this.data.geren = this.data.multiArray[2][this.data.multiIndex[2]]
|
||||
console.log('学院号', this.data.xueyuan);
|
||||
console.log('班级号', this.data.banji);
|
||||
console.log('学号', this.data.geren);
|
||||
},
|
||||
bindMultiPickerColumnChange: function (e) {
|
||||
bindMultiPickerColumnChange: function(e) {
|
||||
console.log('修改的列为', e.detail.column, ',值为', e.detail.value);
|
||||
var data = {
|
||||
multiArray: this.data.multiArray,
|
||||
@ -122,11 +114,11 @@ Page({
|
||||
switch (e.detail.column) {
|
||||
case 0:
|
||||
switch (data.multiIndex[0]) { //判断第一列目前的值
|
||||
case 0://1705
|
||||
case 0: //1705
|
||||
data.multiArray[1] = ['111', '112', '113', '114', '115', '116', '117', '121', '122', '211', '212', '213', '221', '222']; //1.2
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30']; //1.2.1
|
||||
break;
|
||||
case 1://1805
|
||||
case 1: //1805
|
||||
data.multiArray[1] = ['112', '113', '114', '115', '116', '117', '121', '122', '123', '211', '212', '213', '214', '221', '222']; //1.2
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39']; //1.2.1
|
||||
break;
|
||||
@ -137,7 +129,7 @@ Page({
|
||||
case 1:
|
||||
switch (data.multiIndex[0]) {
|
||||
case 0:
|
||||
switch (data.multiIndex[1]) {//选择班级
|
||||
switch (data.multiIndex[1]) { //选择班级
|
||||
case 0:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38'];
|
||||
break;
|
||||
@ -187,51 +179,51 @@ Page({
|
||||
break;
|
||||
|
||||
case 1:
|
||||
switch (data.multiIndex[1]) {//选择班级
|
||||
switch (data.multiIndex[1]) { //选择班级
|
||||
case 0:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39']; //1805112
|
||||
break;
|
||||
case 1:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40'];//1805113
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40']; //1805113
|
||||
break;
|
||||
case 2:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41'];//1805114
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41']; //1805114
|
||||
break;
|
||||
case 3:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39'];//1805115
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39']; //1805115
|
||||
break;
|
||||
case 4:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39'];//1805116
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39']; //1805116
|
||||
break;
|
||||
case 5:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39'];//1805117
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39']; //1805117
|
||||
break;
|
||||
case 6:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37'];//1805121
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37']; //1805121
|
||||
break;
|
||||
case 7:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37'];//1805122
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37']; //1805122
|
||||
break;
|
||||
case 8:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36'];//1805123
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36']; //1805123
|
||||
break;
|
||||
case 9:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37'];//1805211
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37']; //1805211
|
||||
break;
|
||||
case 10:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37'];//1805212
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37']; //1805212
|
||||
break;
|
||||
case 11:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36'];//1805213
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36']; //1805213
|
||||
break;
|
||||
case 12:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36'];//1805214
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36']; //1805214
|
||||
break;
|
||||
case 13:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38'];//1805221
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38']; //1805221
|
||||
break;
|
||||
case 14:
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37'];//1805222
|
||||
data.multiArray[2] = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37']; //1805222
|
||||
break;
|
||||
|
||||
}
|
||||
@ -244,10 +236,8 @@ Page({
|
||||
|
||||
this.setData(data);
|
||||
},
|
||||
bindMultiPickerChange2: function (e) {
|
||||
this.setData({
|
||||
yuanyinnum: 1
|
||||
})
|
||||
bindMultiPickerChange2: function(e) {
|
||||
this.data.yuanyinnum= 1;
|
||||
if (this.data.xuehaonum && this.data.yuanyinnum) {
|
||||
this.setData({
|
||||
disabled: false
|
||||
@ -256,40 +246,35 @@ Page({
|
||||
opacity: 1
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.setData({
|
||||
yuanyinIndex: e.detail.value
|
||||
})
|
||||
this.setData({
|
||||
yuanyin: this.data.yuanyinArray[0][this.data.yuanyinIndex[0]] //原因!!!!!
|
||||
})
|
||||
this.data.yuanyin= this.data.yuanyinArray[0][this.data.yuanyinIndex[0]] //原因!!!!!
|
||||
console.log('原因', this.data.yuanyin);
|
||||
},
|
||||
sumit1: function () {
|
||||
sumit1: function() {
|
||||
var a = this.data.xueyuan
|
||||
var b = this.data.banji
|
||||
var c = this.data.geren
|
||||
this.setData({
|
||||
newxuehao: (a + b + c)
|
||||
})
|
||||
console.log("学号为",this.data.newxuehao)
|
||||
this.data.newxuehao= (a + b + c)
|
||||
console.log("学号为", this.data.newxuehao)
|
||||
console.log("原因为", this.data.yuanyin)
|
||||
var dbPost = new DBPost();
|
||||
dbPost.newdianming(this.data.newxuehao, this.data.yuanyin);
|
||||
console.log(this.data.newxuehao, this.data.yuanyin)
|
||||
|
||||
|
||||
|
||||
wx.showToast({
|
||||
title: '录入成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
},
|
||||
sumit2:function(){
|
||||
wx.redirectTo({ url: '../select/select' })
|
||||
sumit2: function() {
|
||||
wx.redirectTo({
|
||||
url: '../select/select'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
128
manage/manage.js
128
manage/manage.js
@ -1,5 +1,7 @@
|
||||
// welcome/signin/signin.js
|
||||
import { DBPost } from '../db/DBpost.js';
|
||||
import {
|
||||
DBPost
|
||||
} from '../db/DBpost.js';
|
||||
var app = getApp();
|
||||
Page({
|
||||
|
||||
@ -7,92 +9,96 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
multiArray: [['第一周', '第二周', '第三周', '第四周', '第五周', '第六周', '第七周', '第八周', '第九周', '第十周', '十一周', '十二周', '十三周', '十四周', '十五周', '十六周', '十七周', '十八周', '十九周'], ['周一', '周二', '周三', '周四', '周五'], ['一二节', '三四节', '五六节', '七八节', '九十节']],
|
||||
multiArray: [
|
||||
['第一周', '第二周', '第三周', '第四周', '第五周', '第六周', '第七周', '第八周', '第九周', '第十周', '十一周', '十二周', '十三周', '十四周', '十五周', '十六周', '十七周', '十八周', '十九周'],
|
||||
['周一', '周二', '周三', '周四', '周五'],
|
||||
['一二节', '三四节', '五六节', '七八节', '九十节']
|
||||
],
|
||||
multiIndex: [0, 0, 0],
|
||||
renyuanArray: [['老师本人', '白正奇', '韩湛瑶', '辛原旭', '赵英博', '刚蔚杰', '高源东', '张震', '李英男', '王宁'], ['', '白正奇', '韩湛瑶', '辛原旭', '赵英博', '刚蔚杰', '高源东', '张震', '李英男', '王宁']],
|
||||
renyuanArray: [
|
||||
['老师本人', '白正奇', '韩湛瑶', '辛原旭', '赵英博', '刚蔚杰', '高源东', '张震', '李英男', '王宁'],
|
||||
['', '白正奇', '韩湛瑶', '辛原旭', '赵英博', '刚蔚杰', '高源东', '张震', '李英男', '王宁']
|
||||
],
|
||||
renyuanIndex: [0, 0],
|
||||
disabled: true, //是否可用
|
||||
opacity: 0.4, //不透明度
|
||||
newzhoushu: 0, //周数
|
||||
newxingqi: 0, //星期
|
||||
newjieshu: 0, //节数
|
||||
newshijian:0, //时间
|
||||
newrenyuan1: 0, //查课人员1
|
||||
newrenyuan2: 0 , //查课人员2
|
||||
newdidian:0, //地点
|
||||
newjiaoshi:0, //教师
|
||||
newshijianchuo:0 //时间戳
|
||||
disabled: true, //是否可用
|
||||
opacity: 0.4, //不透明度
|
||||
newzhoushu: 0, //周数
|
||||
newxingqi: 0, //星期
|
||||
newjieshu: 0, //节数
|
||||
newshijian: 0, //时间
|
||||
newrenyuan1: 0, //查课人员1
|
||||
newrenyuan2: 0, //查课人员2
|
||||
newdidian: 0, //地点
|
||||
newjiaoshi: 0, //教师
|
||||
newshijianchuo: 0 //时间戳
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
onLoad: function(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
onReady: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
onShow: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
onHide: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
onUnload: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
onPullDownRefresh: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
onReachBottom: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
onShareAppMessage: function() {
|
||||
|
||||
},
|
||||
|
||||
bindKeyInput1: function (e) { //输入地点
|
||||
bindKeyInput1: function(e) { //输入地点
|
||||
var dbPost = new DBPost();
|
||||
this.setData({
|
||||
newdidian: e.detail.value
|
||||
})
|
||||
this.data.newdidian = e.detail.value;
|
||||
dbPost.newdidian(this.data.newdidian);
|
||||
this.setData({
|
||||
didian: dbPost.getdidianData()
|
||||
});
|
||||
console.log('填写地点为', this.data.newdidian);
|
||||
|
||||
if (this.data.newdidian !=0 && this.data.newjiaoshi != 0) { //判断点击态
|
||||
this.setData({
|
||||
if (this.data.newdidian != 0 && this.data.newjiaoshi != 0) { //判断点击态
|
||||
this.setData({
|
||||
disabled: false,
|
||||
opacity: 1
|
||||
})
|
||||
@ -103,17 +109,13 @@ Page({
|
||||
})
|
||||
}
|
||||
},
|
||||
bindKeyInput2: function (e) { //输入教师
|
||||
|
||||
bindKeyInput2: function(e) { //输入教师
|
||||
var dbPost = new DBPost();
|
||||
this.setData({
|
||||
newjiaoshi: e.detail.value
|
||||
})
|
||||
this.data.newjiaoshi = e.detail.value;
|
||||
dbPost.newjiaoshi(this.data.newjiaoshi);
|
||||
this.setData({
|
||||
jiaoshi: dbPost.getjiaoshiData()
|
||||
});
|
||||
console.log('填写教师为', this.data.newjiaoshi);
|
||||
if (this.data.newdidian != 0 && this.data.newjiaoshi != 0) { //判断点击态
|
||||
if (this.data.newdidian != 0 && this.data.newjiaoshi != 0) { //判断点击态
|
||||
this.setData({
|
||||
disabled: false,
|
||||
opacity: 1
|
||||
@ -126,13 +128,7 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bindMultiPickerChange1: function (e) {
|
||||
bindMultiPickerChange1: function(e) {
|
||||
console.log('picker1发送选择改变,携带值为', e.detail.value)
|
||||
this.setData({
|
||||
multiIndex: e.detail.value
|
||||
@ -149,59 +145,31 @@ Page({
|
||||
console.log('周数:', this.data.newzhoushu);
|
||||
console.log('星期:', this.data.newxingqi);
|
||||
console.log('节数:', this.data.newjieshu);
|
||||
this.setData({
|
||||
newshijian: this.data.newzhoushu + "_" + this.data.newxingqi + "_" +this.data.newjieshu
|
||||
})
|
||||
this.data.newshijian = this.data.newzhoushu + "_" + this.data.newxingqi + "_" + this.data.newjieshu
|
||||
var dbPost = new DBPost();
|
||||
dbPost.newshijian(this.data.newshijian);
|
||||
this.setData({
|
||||
shijian: dbPost.getshijianData()
|
||||
});
|
||||
console.log('填写时间为', this.data.newshijian);
|
||||
},
|
||||
|
||||
|
||||
bindMultiPickerChange2: function (e) {
|
||||
bindMultiPickerChange2: function(e) {
|
||||
console.log('picker2发送选择改变,携带值为', e.detail.value)
|
||||
this.setData({
|
||||
renyuanIndex: e.detail.value
|
||||
})
|
||||
this.setData({
|
||||
newrenyuan1: this.data.renyuanArray[0][this.data.renyuanIndex[0]]
|
||||
})
|
||||
this.setData({
|
||||
newrenyuan2: this.data.renyuanArray[1][this.data.renyuanIndex[1]]
|
||||
})
|
||||
this.data.newrenyuan1 = this.data.renyuanArray[0][this.data.renyuanIndex[0]]
|
||||
this.data.newrenyuan2 = this.data.renyuanArray[1][this.data.renyuanIndex[1]]
|
||||
var dbPost = new DBPost();
|
||||
dbPost.newrenyuan1(this.data.newrenyuan1);
|
||||
this.setData({
|
||||
renyuan1: dbPost.getrenyuan1Data()
|
||||
});
|
||||
dbPost.newrenyuan2(this.data.newrenyuan2);
|
||||
this.setData({
|
||||
renyuan2: dbPost.getrenyuan2Data()
|
||||
});
|
||||
console.log('填写人员1为', this.data.newrenyuan1);
|
||||
console.log('填写人员2为', this.data.newrenyuan2);
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//提交按钮确认
|
||||
sumit: function () {
|
||||
wx.redirectTo({ url: 'rollcall/rollcall' })
|
||||
sumit: function() {
|
||||
wx.redirectTo({
|
||||
url: 'rollcall/rollcall'
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
File diff suppressed because it is too large
Load Diff
@ -24,6 +24,7 @@ Page({
|
||||
zhuanye: dbPost.getzhuanyeData(),
|
||||
xueyuan: dbPost.getxueyuanData(),
|
||||
admin: dbPost.getadminData(),
|
||||
loginTime:dbPost.getloginTimeData(),
|
||||
});
|
||||
this.setData({
|
||||
jiaoshi: dbPost.getjiaoshiData()
|
||||
@ -155,6 +156,7 @@ Page({
|
||||
dbPost.newzhuanye(that.data.zhuanye);
|
||||
dbPost.newxueyuan(that.data.xueyuan);
|
||||
dbPost.newadmin(that.data.admin);
|
||||
dbPost.newloginTime(that.data.loginTime);
|
||||
wx.switchTab({ url: '../../pages/post/post' });
|
||||
console.log(res.data);
|
||||
|
||||
|
@ -99,16 +99,10 @@ Page({
|
||||
console.log(this.data.type)
|
||||
},
|
||||
fankui(e) { //反馈内容输入
|
||||
this.setData({
|
||||
feedBack: e.detail.value
|
||||
})
|
||||
console.log(this.data.feedBack)
|
||||
this.data.feedBack = e.detail.value
|
||||
},
|
||||
qqNum(e) { //qq号码输入
|
||||
console.log(e.detail.value)
|
||||
this.setData({
|
||||
qqNum: e.detail.value
|
||||
})
|
||||
this.data.qqNum = e.detail.value
|
||||
},
|
||||
submit() {
|
||||
var qqNUm_ok = 0;
|
||||
@ -141,14 +135,14 @@ Page({
|
||||
feedBack_error: true
|
||||
})
|
||||
}
|
||||
console.log("类型为", this.data.type)
|
||||
console.log("反馈内容为", this.data.feedBack)
|
||||
console.log("qq号码为", this.data.qqNum)
|
||||
console.log("反馈", feedBack_ok)
|
||||
console.log("qq", qqNUm_ok)
|
||||
// console.log("类型为", this.data.type)
|
||||
// console.log("反馈内容为", this.data.feedBack)
|
||||
// console.log("qq号码为", this.data.qqNum)
|
||||
// console.log("反馈", feedBack_ok)
|
||||
// console.log("qq", qqNUm_ok)
|
||||
wx.showLoading();
|
||||
wx.hideLoading();
|
||||
if(qqNUm_ok&&feedBack_ok){
|
||||
if (qqNUm_ok && feedBack_ok) {
|
||||
wx.switchTab({
|
||||
url: '../user/user'
|
||||
})
|
||||
|
@ -17,18 +17,8 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
wx.checkIsSupportSoterAuthentication({
|
||||
success(res) {
|
||||
console.log(res.supportMode);
|
||||
// res.supportMode = [] 不具备任何被SOTER支持的生物识别方式
|
||||
// res.supportMode = ['fingerPrint'] 只支持指纹识别
|
||||
// res.supportMode = ['fingerPrint', 'facial'] 支持指纹识别和人脸识别
|
||||
}
|
||||
})
|
||||
var dbPost = new DBPost();
|
||||
this.setData({
|
||||
admin: dbPost.getadminData(),
|
||||
});
|
||||
this.data.admin= dbPost.getadminData(),
|
||||
wx.setScreenBrightness({
|
||||
value: 0.5
|
||||
})
|
||||
@ -83,20 +73,17 @@ Page({
|
||||
|
||||
},
|
||||
sumit: function() {
|
||||
|
||||
var timestamp = + new Date();
|
||||
timestamp = timestamp / 1000;
|
||||
timestamp =parseInt(timestamp);
|
||||
console.log("当前时间戳为:" + timestamp);
|
||||
this.data.newshijianchuo= timestamp;
|
||||
var dbPost = new DBPost();
|
||||
dbPost.newshijianchuo(this.data.newshijianchuo);
|
||||
wx.navigateTo({
|
||||
url: 'QRcode/QRcode'
|
||||
})
|
||||
var timestamp = Date.parse(new Date());
|
||||
timestamp = timestamp / 1000;
|
||||
console.log("当前时间戳为:" + timestamp);
|
||||
this.setData({
|
||||
newshijianchuo: timestamp + 0
|
||||
})
|
||||
var dbPost = new DBPost();
|
||||
dbPost.newshijianchuo(this.data.newshijianchuo);
|
||||
this.setData({
|
||||
shijianchuo: dbPost.getshijianchuoData()
|
||||
});
|
||||
},
|
||||
|
||||
guanli: function() {
|
||||
|
@ -96,6 +96,10 @@ Page({
|
||||
dbPost.newadmin(result.data.admin);
|
||||
that.data.xuehao = result.data.xueHao;
|
||||
console.log(that.data.xuehao);
|
||||
var timestamp = + new Date();
|
||||
timestamp = timestamp / 1000;
|
||||
timestamp = parseInt(timestamp);
|
||||
dbPost.newloginTime(timestamp);
|
||||
}
|
||||
if (!that.data.xuehao) {
|
||||
wx.hideLoading()
|
||||
|
Loading…
x
Reference in New Issue
Block a user