xinelu-applet-ui/questionnaire/HistoryQuestionnaire/HistoryQuestionnaire.vue

106 lines
1.9 KiB
Vue
Raw Normal View History

2023-10-27 14:06:52 +08:00
<template>
<view class="app">
<view class="item" v-for="(item,index) in infoslist" :key="index">
<view class="title">
{{Number(index)+1}}{{item.questionName}}
</view>
<view class="text">
{{item.optionContent}}
</view>
</view>
</view>
</template>
<script>
import {
answer,
} from '@/api/questionnaire/index.js'
import {
surveylist
} from '@/api/pagesC/healthtest/index.js'
export default {
data() {
return {
infoslist: null,
item: null,
query: {
pageNum: 1,
pageSize: 10,
}
};
},
methods: {
infos() {
surveylist(this.query).then(res => {
res.rows.forEach(e => {
if (e.surveySubject == this.item.surveySubject) {
e.questions.forEach(el => el.optionContent = '')
this.infoslist = e.questions
this.info(this.item.recordId)
}
})
})
},
info(id) {
answer(id).then(res => {
res.data.forEach(e => {
this.infoslist.forEach(el => {
el.optionContent = e.optionContent
})
})
})
},
},
onLoad(options) {
this.infos()
this.item = JSON.parse(options.item)
}
}
</script>
<style lang="scss">
.app {
width: 96%;
margin: 16rpx auto;
background: #FFFFFF;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 5rpx;
padding-bottom: 200rpx;
.btns {
width: 90%;
margin: 100rpx auto;
background-color: #26A888;
text-align: center;
line-height: 60rpx;
height: 60rpx;
color: #fff;
}
.item {
width: 90%;
margin: 0 auto;
padding: 30rpx 0;
::v-deep .u-radio {
padding: 20rpx;
}
.title {
padding: 40rpx 0 20rpx;
font-size: 28rpx;
font-weight: 400;
color: #333333;
}
::v-deep .uni-picker-container {
width: 100%;
height: 63rpx;
background: #A7A7A7;
line-height: 63rpx;
opacity: 0.1;
border-radius: 5rpx;
}
}
}
</style>