更新 满意度调查 改成 检前问卷。问卷 去掉星号。问卷 姓名 手机号 自动填充。

main
鹿和sa0ChunLuyu 1 year ago
parent a2fe429677
commit 3b964e0ddf

@ -310,10 +310,39 @@
</view> </view>
<view v-if="question_list.length !== 0"> <view v-if="question_list.length !== 0">
<view> <view>
<view class="banner_wrapper"> <view v-if="question_info.type === '检前评估'" class="banner_wrapper">
<view @click="getQuestionLogPush()" class="push_log_wrapper">带入上次答题记录</view> <view @click="getQuestionLogPush()" class="push_log_wrapper">带入上次答题记录</view>
<image src="@/static/assets/question/banner.png"></image> <image src="@/static/assets/question/banner.png"></image>
</view> </view>
<view v-else>
<view class="q2_banner_wrapper">
<view class="q2_banner_text_wrapper">健康问卷</view>
<image src="@/static/assets/question/q2banner.png"></image>
</view>
<view class="user_wrapper">
<view class="user_box_wrapper">
<view class="user_info_wrapper">
<view class="user_name_wrapper">{{ $store.user.name }}</view>
<view class="user_sex_wrapper">{{ Number($store.user.sex) === 1 ? '男士' : '女士' }}</view>
</view>
<view @click="changeUserClick()" class="change_user_button_wrapper">切换用户</view>
</view>
</view>
<view class="qr_title_wrapper">
<view class="qr_title_icon_wrapper">
<image src="@/static/assets/question/icon.png"></image>
</view>
<view class="qr_title_text_wrapper">
<view class="qr_title_title_wrapper">体检中心健康问卷</view>
<view class="qr_title_tip_wrapper">尊敬的先生/女士,为了能够更好地为您进行健康评估,请您认真填写以下问卷</view>
</view>
</view>
<view class="question_index_wrapper">
<text></text>
<text class="question_count_wrapper">{{ question_list.length }}</text>
<text></text>
</view>
</view>
<view v-for="(i,k) in question_list" :key="k"> <view v-for="(i,k) in question_list" :key="k">
<QuestionComponent @setValue="setValue" :info="i" :index="String(k + 1)"></QuestionComponent> <QuestionComponent @setValue="setValue" :info="i" :index="String(k + 1)"></QuestionComponent>
</view> </view>

@ -118,7 +118,6 @@
$props.index.includes('-') ? '' : 'question_block_wrapper' $props.index.includes('-') ? '' : 'question_block_wrapper'
]"> ]">
<view class="question_title_wrapper"> <view class="question_title_wrapper">
<text class="must_dot_wrapper">*</text>
<text v-if="$props.index.includes('-')" class="question_index_wrapper"> <text v-if="$props.index.includes('-')" class="question_index_wrapper">
<text v-if="$props.index.split('-').length === 2">({{ $props.index.split('-')[1] }}).</text> <text v-if="$props.index.split('-').length === 2">({{ $props.index.split('-')[1] }}).</text>
<text v-else>{{ convertToRoman(Number($props.index.split('-')[$props.index.split('-').length - 1])) }}.</text> <text v-else>{{ convertToRoman(Number($props.index.split('-')[$props.index.split('-').length - 1])) }}.</text>

@ -33,9 +33,23 @@ const getmyddcSelect = async () => {
$response(response, () => { $response(response, () => {
uni.hideLoading(); uni.hideLoading();
topicList.value = response.data.list.map((val) => { topicList.value = response.data.list.map((val) => {
let answer = val.type != 1 ? [] : ""
let content = val.content
if(val.type === 1){
if(val.content === '${name}'){
console.log('myddc_list.value',$store.user)
answer = $store.user.name
content = ''
}
if(val.content === '${phone}'){
answer = $store.user.phone
content = ''
}
}
return { return {
...val, ...val,
answer: val.type != 1 ? [] : "", content: content,
answer: answer,
more: val.type == 1 ? "" : Array(val.content.length).fill(""), more: val.type == 1 ? "" : Array(val.content.length).fill(""),
isInputList: val.type == 1 ? "" : Array(val.content.length).fill(""), isInputList: val.type == 1 ? "" : Array(val.content.length).fill(""),
index: [], index: [],
@ -45,9 +59,9 @@ const getmyddcSelect = async () => {
}); });
}; };
const getContent = () => { const getContent = (item) => {
// / // /
let contentArr = topicList.value[topicIndex.value]?.content.map((val) => { let contentArr = item?.content.map((val) => {
if (val.includes("{{MORE}}")) { if (val.includes("{{MORE}}")) {
let valParse = val.split("{{MORE}}"); let valParse = val.split("{{MORE}}");
return { return {
@ -153,8 +167,15 @@ const checkHospital = () => {
} }
hospital_active.value = hospital_id; hospital_active.value = hospital_id;
getmyddcSelect(); getUserInfo();
}; };
const getUserInfo = async () => {
const response = await $api('UserInfo')
$response(response, () => {
$store.setUser(response.data.info);
getmyddcSelect();
})
}
const config_ref = ref(null); const config_ref = ref(null);
const configRef = (e) => { const configRef = (e) => {
@ -272,18 +293,18 @@ onShow(() => {
</view> </view>
</view> </view>
</view> </view>
<view class="text-#0E0E0E text-26rpx px-80rpx box-border text-right"> <view class="text-#0E0E0E mt-10rpx text-26rpx px-80rpx box-border text-right">
<text class="text-#239ea3">{{ topicList.length }}</text> / <text class="text-#239ea3">{{ topicList.length }}</text>
<text class="text-#239ea3">{{ topicIndex + 1 }}</text>
</view> </view>
<view class="px-30rpx box-border mt-40rpx" v-if="topicList.length"> <view class="px-30rpx box-border mt-40rpx" v-if="topicList.length">
<view <view
class="bg-#fff shadow-[0rpx_0rpx_10rpx_0rpx_rgba(0,0,0,0.04)] px-45rpx py40rpx box-border rounded-15rpx" v-for="(i,topicIndex) in topicList" :key="k"
class="bg-#fff mb-4 shadow-[0rpx_0rpx_10rpx_0rpx_rgba(0,0,0,0.04)] px-45rpx py40rpx box-border rounded-15rpx"
> >
<view class="text-#000000 text-30rpx" <view class="text-#000000 text-30rpx"
>{{ topicList[topicIndex]?.question }}</view >{{ topicList[topicIndex]?.question }}</view
> >
<view class="my-35rpx pb-120rpx b-0 b-b-1 b-solid b-#DEDEDF"> <view class="my-35rpx b-0">
<uni-easyinput <uni-easyinput
v-if="topicList[topicIndex]?.type == 1" v-if="topicList[topicIndex]?.type == 1"
type="textarea" type="textarea"
@ -291,7 +312,7 @@ onShow(() => {
:placeholder="topicList[topicIndex]?.content" :placeholder="topicList[topicIndex]?.content"
/> />
<view v-if="topicList[topicIndex]?.type != 1"> <view v-if="topicList[topicIndex]?.type != 1">
<view v-for="(val, index) in getContent()" :key="index"> <view v-for="(val, index) in getContent(topicList[topicIndex])" :key="index">
<view <view
class="flex items-center mt-30rpx" class="flex items-center mt-30rpx"
@click="checkItem(val, index)" @click="checkItem(val, index)"
@ -333,32 +354,6 @@ onShow(() => {
</view> </view>
</view> </view>
</view> </view>
<view class="center">
<view
@click="topicIndex--"
v-if="topicIndex > 0"
class="center text-26rpx mr-auto text-#0E0E0E"
>
<uni-icons
type="left"
size="14"
class="line-height-[1]"
></uni-icons>
<text>上一题</text>
</view>
<view
@click="next()"
class="center text-26rpx ml-auto"
v-if="topicIndex + 1 !== topicList.length"
>
<text>下一题</text>
<uni-icons
type="right"
size="14"
class="line-height-[1]"
></uni-icons>
</view>
</view>
</view> </view>
</view> </view>
<view <view

Loading…
Cancel
Save