职业素养功能修改
This commit is contained in:
@@ -158,7 +158,7 @@
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.getHistoryTitle();
|
||||
this.getTitle();
|
||||
},
|
||||
methods: {
|
||||
// 返回
|
||||
@@ -179,16 +179,6 @@
|
||||
});
|
||||
//uni.navigateBack(-1);
|
||||
},
|
||||
//获取答题记录
|
||||
getHistoryTitle(){
|
||||
api.getTestRecordProcessList(11).then(res => {
|
||||
if (res.Result === 1) {
|
||||
let data = res.Data;
|
||||
this.historyTitle = data;
|
||||
this.getTitle();
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取题目
|
||||
getTitle() {
|
||||
uni.showLoading({
|
||||
@@ -200,26 +190,7 @@
|
||||
let list = res.Data;
|
||||
list.forEach(item => {
|
||||
item.Value = 0
|
||||
this.historyTitle.forEach(ritem=>{
|
||||
if(item.Id == ritem.TestTitleId){
|
||||
item.Value = Number(ritem.TestResult);
|
||||
}
|
||||
})
|
||||
})
|
||||
if(this.historyTitle.length > 180){
|
||||
let len = this.historyTitle.length - 180;
|
||||
for(let i = 0; i < len; i++){
|
||||
this.checkTitleList[i].Value = this.historyTitle[i + 180];
|
||||
this.checkTitleList[i].Checked = true;
|
||||
}
|
||||
}
|
||||
if(this.historyTitle.length == 0){
|
||||
this.pageIndex = 0;
|
||||
}else if(this.historyTitle.length == list.length){
|
||||
this.pageIndex = list.length - 1;
|
||||
}else {
|
||||
this.pageIndex = this.historyTitle.length;
|
||||
}
|
||||
this.allNum = list.length + 3;
|
||||
this.list = list;
|
||||
}
|
||||
@@ -241,11 +212,8 @@
|
||||
// 处理单击事件
|
||||
this.lastTapTime = now;
|
||||
this.list[INDEX].Value = NUM;
|
||||
this.saveTestRecordProcess(this.list[INDEX].Id,NUM);
|
||||
setTimeout(()=>{
|
||||
if(this.pageIndex != this.allNum - 1){
|
||||
this.pageIndex = INDEX + 1;
|
||||
}
|
||||
},400)
|
||||
}
|
||||
},
|
||||
@@ -260,7 +228,6 @@
|
||||
this.firstDescVal = ITEM.Value;
|
||||
this.secondDescVal = "";
|
||||
this.thirdDescVal = "";
|
||||
this.saveTestRecordProcess(181,ITEM.Value);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
@@ -272,13 +239,11 @@
|
||||
this.checkTitleList[INDEX].Checked = true;
|
||||
this.secondDescVal = ITEM.Value;
|
||||
this.thirdDescVal = "";
|
||||
this.saveTestRecordProcess(182,ITEM.Value);
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
this.checkTitleList[INDEX].Checked = true;
|
||||
this.thirdDescVal = ITEM.Value;
|
||||
this.saveTestRecordProcess(183,ITEM.Value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -289,27 +254,8 @@
|
||||
},400)
|
||||
|
||||
},
|
||||
//存储答题记录
|
||||
saveTestRecordProcess(ID,VALUE){
|
||||
let data = {
|
||||
testType: 11,
|
||||
testTitleId: ID,
|
||||
testResult: VALUE
|
||||
}
|
||||
api.saveTestRecordProcess(data).then(res => {
|
||||
if (res.Result === 1) {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交题目
|
||||
submitTitle() {
|
||||
|
||||
// uni.showToast({
|
||||
// title: "请选择三个特质描述",
|
||||
// icon: "none"
|
||||
// })
|
||||
// return;
|
||||
|
||||
let testStr = "";
|
||||
this.list.forEach(item => {
|
||||
testStr += `${item.Id}|${item.Value - 1},`
|
||||
@@ -319,9 +265,7 @@
|
||||
title: "提交中"
|
||||
})
|
||||
let data = {testStr}
|
||||
api.removeTestRecordProcess(11).then((res) => {
|
||||
return api.saveInterestTestResult(data);
|
||||
}).then((res) => {
|
||||
api.saveInterestTestResult(data).then((res) => {
|
||||
uni.hideLoading();
|
||||
if (res.Result === 1) {
|
||||
uni.showToast({
|
||||
|
||||
Reference in New Issue
Block a user