Commit e7ca62de by Chao Sun

job页selected

parent 5a811422
......@@ -88,6 +88,7 @@ export class AgeComponent implements OnInit {
// console.log(this.curPageData);
this.commonService.addAnswer(this.pageAnswers);
this.closeToast();
console.log(this.pageAnswers)
}
showToast(question, idx) {
......
......@@ -14,7 +14,7 @@
max-width: 55%;
}
.option_item li img.selected {
border: 1px solid #ff0000;
border: 2px solid #ff0000;
border-radius: 50%;
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
<div class="questionTitle">{{ this.curPageData?.pageName }}</div>
<ul class="jobContent">
<li
[ngClass]="{ selected: selectedOptionId == options.optionId }"
[ngClass]="{ selected: options['selected'] }"
*ngFor="let options of this.curPageData?.questions[0].options"
(click)="selectedJob(options)"
>
......
......@@ -58,9 +58,14 @@ export class JobComponent implements OnInit {
}
selectedJob(option) {
console.log(this.curPageData['pageId'])
this.selectedOptionId = option.optionId;
option.selected = true;
const options = this.curPageData['questions'][0]['options']
for (let i = 0; i < options.length; i++) {
if (option['optionId'] == options[i]['optionId']) {
options[i]['selected'] = true;
} else {
options[i]['selected'] = false;
}
}
this.pageAnswers = {
pageId: this.curPageData['pageId'],
questions: [{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment