更新 健康问卷 列表

main
鹿和sa0ChunLuyu 1 year ago
parent 2677391c49
commit 9603d363e3

@ -78,6 +78,7 @@ class ApiMapController extends Controller
'QuestionLogList' => $base_url . '/api/H5/QuestionLog/list',// 问卷列表
'QuestionLogDelete' => $base_url . '/api/H5/QuestionLog/delete',// 问卷删除记录
'QuestionLogPush' => $base_url . '/api/H5/QuestionLog/push',// 上次答题记录
'QuestionChoose' => $base_url . '/api/H5/Question/choose',// 健康问卷列表
];
}

@ -8,6 +8,29 @@ use Illuminate\Support\Facades\DB;
class QuestionnaireController extends Controller
{
public function list(Request $request)
{
$list = [[
'id' => 3,
'title' => '健康问卷完整版',
'icon' => '/assets/h5/question1.png',
'desc' => '共20道题约3分钟',
], [
'id' => 3,
'title' => '健康问卷简易版',
'icon' => '/assets/h5/question1.png',
'desc' => '共10道题约1分钟',
], [
'id' => 3,
'title' => '心理健康评估问卷',
'icon' => '/assets/h5/question2.png',
'desc' => '共15道题约2分钟',
]];
return \Yz::Return(true, '操作完成', [
'list' => $list
]);
}
public function get(Request $request)
{
$id = $request->post('id');

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

@ -4,6 +4,7 @@ use Illuminate\Support\Facades\Route;
Route::any('/api/test', 'App\Http\Controllers\TestController@ApiTest');
Route::any("/api/H5/Question/choose", [\App\Http\Controllers\API\H5\QuestionnaireController::class, 'list']);
Route::any("/api/H5/QuestionLog/push", [\App\Http\Controllers\API\H5\QuestionnairesLogsController::class, 'push']);
Route::any("/api/H5/QuestionLog/delete", [\App\Http\Controllers\API\H5\QuestionnairesLogsController::class, 'delete']);
Route::any("/api/H5/QuestionLog/list", [\App\Http\Controllers\API\H5\QuestionnairesLogsController::class, 'list']);

@ -255,6 +255,13 @@
"style": {
"navigationBarTitleText": ""
}
},
{
"path" : "pages/main/question/choose/choose",
"style" :
{
"navigationBarTitleText" : ""
}
}
],

@ -0,0 +1,125 @@
<script setup>
/**
* name
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import {
ref
} from 'vue'
import {
$api,
$image,
$response
} from '@/api'
import {
onShow
} from '@dcloudio/uni-app'
import {
useStore
} from '@/store'
const $store = useStore()
const mountedAction = () => {
getQuestionChoose()
}
const question_list = ref([])
const getQuestionChoose = async () => {
const response = await $api('QuestionChoose')
$response(response, () => {
question_list.value = response.data.list
})
}
const toQuestion = (info) => {
uni.navigateTo({
url: '/pages/main/question/question/question?id=' + info.id
})
}
const config_ref = ref(null)
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e
mountedAction()
}
}
onShow(() => {
if (!!config_ref.value) {
mountedAction()
}
})
</script>
<template>
<view>
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
<view class="question_list_wrapper">
<view @click="toQuestion(i)" class="question_item_wrapper" v-for="(i,k) in question_list" :key="k">
<view class="question_icon_wrapper">
<image :src="$image(i.icon)"></image>
</view>
<view class="question_content_wrapper">
<view class="question_title_wrapper">{{ i.title }}</view>
<view class="question_desc_wrapper">{{ i.desc }}</view>
</view>
<view class="question_right_wrapper">
<uni-icons type="right" size="20"></uni-icons>
</view>
</view>
</view>
</view>
</template>
<style scoped>
.question_right_wrapper {
margin-right: 61rpx;
}
.question_content_wrapper {}
.question_desc_wrapper {
font-weight: 400;
font-size: 22rpx;
color: #5C5C5C;
line-height: 1;
margin-top: 19rpx;
}
.question_title_wrapper {
font-weight: 500;
font-size: 30rpx;
color: #000000;
line-height: 1;
}
.question_icon_wrapper {
width: 59rpx;
height: 57rpx;
margin-left: 56rpx;
}
.question_icon_wrapper image {
width: 59rpx;
height: 57rpx;
display: block;
object-fit: contain;
}
.question_item_wrapper {
display: flex;
align-items: center;
justify-content: space-between;
width: 550rpx;
height: 160rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04);
border-radius: 15rpx;
margin: 60rpx auto 0;
}
.question_list_wrapper {
margin-top: 65rpx;
}
</style>
Loading…
Cancel
Save