|
@@ -23,6 +23,12 @@ Page({
|
|
|
changeValue:'',//
|
|
changeValue:'',//
|
|
|
comScore: 0,
|
|
comScore: 0,
|
|
|
comScoreStatus: '',
|
|
comScoreStatus: '',
|
|
|
|
|
+ input1Value: '',
|
|
|
|
|
+ input2Value: '',
|
|
|
|
|
+ input3Value: '',
|
|
|
|
|
+ input4Value: '',
|
|
|
|
|
+ input5Value: '',
|
|
|
|
|
+ input6Value: '',
|
|
|
},
|
|
},
|
|
|
// drawCircle: function() {
|
|
// drawCircle: function() {
|
|
|
// // 创建 canvas 上下文
|
|
// // 创建 canvas 上下文
|
|
@@ -132,6 +138,34 @@ bindInput2: function(e) {
|
|
|
this.setData({
|
|
this.setData({
|
|
|
input2Value: e.detail.value
|
|
input2Value: e.detail.value
|
|
|
})
|
|
})
|
|
|
|
|
+},
|
|
|
|
|
+bindInput3: function(e) {
|
|
|
|
|
+ // 你可以通过 e.detail.value 获取到输入框的值
|
|
|
|
|
+ // 使用 this.setData() 方法更新数据
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ input3Value: e.detail.value
|
|
|
|
|
+ })
|
|
|
|
|
+},
|
|
|
|
|
+bindInput4: function(e) {
|
|
|
|
|
+ // 你可以通过 e.detail.value 获取到输入框的值
|
|
|
|
|
+ // 使用 this.setData() 方法更新数据
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ input4Value: e.detail.value
|
|
|
|
|
+ })
|
|
|
|
|
+},
|
|
|
|
|
+bindInput5: function(e) {
|
|
|
|
|
+ // 你可以通过 e.detail.value 获取到输入框的值
|
|
|
|
|
+ // 使用 this.setData() 方法更新数据
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ input5Value: e.detail.value
|
|
|
|
|
+ })
|
|
|
|
|
+},
|
|
|
|
|
+bindInput6: function(e) {
|
|
|
|
|
+ // 你可以通过 e.detail.value 获取到输入框的值
|
|
|
|
|
+ // 使用 this.setData() 方法更新数据
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ input6Value: e.detail.value
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
nextq: function (e) {
|
|
nextq: function (e) {
|
|
|
if (!this.data.checkboxes[0].checked) {
|
|
if (!this.data.checkboxes[0].checked) {
|
|
@@ -141,18 +175,74 @@ bindInput2: function(e) {
|
|
|
});
|
|
});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ let idInput = e.currentTarget.dataset.id;
|
|
|
|
|
+ console.log('idInput====='+idInput)
|
|
|
console.log('input1Value=='+this.data.input1Value);
|
|
console.log('input1Value=='+this.data.input1Value);
|
|
|
console.log('input2Value=='+this.data.input2Value);
|
|
console.log('input2Value=='+this.data.input2Value);
|
|
|
- // let input1 = e.detail.value.input1;
|
|
|
|
|
- // let input2 = e.detail.value.input2;
|
|
|
|
|
|
|
+ console.log('input3Value=='+this.data.input3Value);
|
|
|
|
|
+ console.log('input4Value=='+this.data.input4Value);
|
|
|
|
|
+ console.log('input5Value=='+this.data.input5Value);
|
|
|
|
|
+ console.log('input6Value=='+this.data.input6Value);
|
|
|
let input1 = this.data.input1Value;
|
|
let input1 = this.data.input1Value;
|
|
|
let input2 = this.data.input2Value;
|
|
let input2 = this.data.input2Value;
|
|
|
- if(!input1 || !input2){
|
|
|
|
|
- wx.showToast({
|
|
|
|
|
- title: '输入框不能为空',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ let input3 = this.data.input3Value;
|
|
|
|
|
+ let input4 = this.data.input4Value;
|
|
|
|
|
+ let input5 = this.data.input5Value;
|
|
|
|
|
+ let input6 = this.data.input6Value;
|
|
|
|
|
+ if(idInput == 0){
|
|
|
|
|
+ if(!input1 || !input2){
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: '输入框不能为空',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(input1){
|
|
|
|
|
+ if(!(input1>=0 && input1<=24) || !(input2>=0 && input2<=60)){
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: '输入框时间填写错误',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(idInput == 2){
|
|
|
|
|
+ if(!input3 || !input4){
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: '输入框不能为空',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(input1){
|
|
|
|
|
+ if(!(input3>=0 && input3<=24) || !(input4>=0 && input4<=60)){
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: '输入框时间填写错误',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(idInput == 3){
|
|
|
|
|
+ if(!input5 || !input6){
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: '输入框不能为空',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(input1){
|
|
|
|
|
+ if(!(input5>=0 && input5<=24) || !(input6>=0 && input6<=60)){
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: '输入框时间填写错误',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (this.data.id < 23) {
|
|
if (this.data.id < 23) {
|
|
@@ -202,28 +292,48 @@ bindInput2: function(e) {
|
|
|
// let input2 = e.detail.value.input2;
|
|
// let input2 = e.detail.value.input2;
|
|
|
let input1 = this.data.input1Value;
|
|
let input1 = this.data.input1Value;
|
|
|
let input2 = this.data.input2Value;
|
|
let input2 = this.data.input2Value;
|
|
|
- if(!input1 || !input2){
|
|
|
|
|
- wx.showToast({
|
|
|
|
|
- title: '输入框不能为空',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if(!(input1>=0 && input1<=24) || !(input2>=0 && input2<=60)){
|
|
|
|
|
- wx.showToast({
|
|
|
|
|
- title: '输入框时间填写错误',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ let input3 = this.data.input3Value;
|
|
|
|
|
+ let input4 = this.data.input4Value;
|
|
|
|
|
+ let input5 = this.data.input5Value;
|
|
|
|
|
+ let input6 = this.data.input6Value;
|
|
|
|
|
+ // if(!input1 || !input2){
|
|
|
|
|
+ // wx.showToast({
|
|
|
|
|
+ // title: '输入框不能为空',
|
|
|
|
|
+ // icon: 'none'
|
|
|
|
|
+ // });
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
var a = "";
|
|
var a = "";
|
|
|
let _id = e.currentTarget.dataset.id;
|
|
let _id = e.currentTarget.dataset.id;
|
|
|
|
|
+ var id = this.data.id-1;
|
|
|
|
|
+ console.log('id==+=='+id);
|
|
|
if(e.detail.value.answer){
|
|
if(e.detail.value.answer){
|
|
|
a = e.detail.value.answer;
|
|
a = e.detail.value.answer;
|
|
|
}else{
|
|
}else{
|
|
|
- a = input1+":"+input2
|
|
|
|
|
|
|
+ if(id == 0){
|
|
|
|
|
+ if(input1 && input2){
|
|
|
|
|
+ a = input1+":"+input2
|
|
|
|
|
+ }else{
|
|
|
|
|
+ // a = "";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(id == 2){
|
|
|
|
|
+ if(input3 && input4){
|
|
|
|
|
+ a = input3+":"+input4
|
|
|
|
|
+ }else{
|
|
|
|
|
+ // a = "";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(id == 3){
|
|
|
|
|
+ if(input5 && input6){
|
|
|
|
|
+ a = input5+":"+input6
|
|
|
|
|
+ }else{
|
|
|
|
|
+ // a = "";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- var id = this.data.id-1;
|
|
|
|
|
|
|
+
|
|
|
var obj = {};
|
|
var obj = {};
|
|
|
obj.type = e.detail.value.answer?'answer':'input'
|
|
obj.type = e.detail.value.answer?'answer':'input'
|
|
|
obj.value = a
|
|
obj.value = a
|
|
@@ -290,7 +400,7 @@ bindInput2: function(e) {
|
|
|
success (res) {
|
|
success (res) {
|
|
|
_this.answer2db(_this.data.answerJson);
|
|
_this.answer2db(_this.data.answerJson);
|
|
|
wx.navigateBack({
|
|
wx.navigateBack({
|
|
|
- delta: 1
|
|
|
|
|
|
|
+ delta: i
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|