点击提交按钮时 首先获取到进入接口所需要的值 定义pjid answer student score 为接口所需要的字段
console.log(this.data.answer);
console.log(this.data.score);
console.log(_score);
console.log(this.data.pj.pjid);
console.log(this.data.pj.testpaperid);
console.log(this.data.student);
data:{
pjid: this.data.pj.pjid,
testpaperid: this.data.pj.testpaperid,
answer: JSON.stringify(this.data.answer),
student: JSON.stringify(this.data.student),
score: _score
},
计算score 调接口url: url,
//计算分值{4:'10',5:'8'}
var _score = 0;
for (var i in this.data.score) {
_score += parseInt(this.data.score[i]);
}
//判断分数值
if(_score<this.data.