|
|
@@ -0,0 +1,103 @@
|
|
|
+<template>
|
|
|
+ <view class="task-form">
|
|
|
+ <view class="workbench-notice" v-if="showNotice">
|
|
|
+ <wd-notice-bar
|
|
|
+ :text="noticeText"
|
|
|
+ prefix="warn-bold"
|
|
|
+ type="info "
|
|
|
+ color="#f90"
|
|
|
+ background-color="#fdf6ec "
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import { computed, ref } from 'vue'
|
|
|
+
|
|
|
+import { onLoad } from '@dcloudio/uni-app'
|
|
|
+
|
|
|
+import { getTaskContentConfigByTaskTypeIdApi } from '@/services/modules/task/taskFrom/index.ts'
|
|
|
+
|
|
|
+interface DynamicFormState {
|
|
|
+ values: {
|
|
|
+ [key: string]: {
|
|
|
+ label: string
|
|
|
+ value: string | number | boolean
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const form = ref<DynamicFormState>({
|
|
|
+ values: {},
|
|
|
+})
|
|
|
+
|
|
|
+const getTaskContentConfigByTaskTypeId = async (id: string) => {
|
|
|
+ const res = await getTaskContentConfigByTaskTypeIdApi(id)
|
|
|
+ console.log('res', res)
|
|
|
+}
|
|
|
+
|
|
|
+type PageLoadOptions = {
|
|
|
+ taskTitle?: string
|
|
|
+ taskId?: string
|
|
|
+}
|
|
|
+
|
|
|
+const setNavigationTitle = (title?: string) => {
|
|
|
+ if (!title) return
|
|
|
+
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title,
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const showNotice = ref(false)
|
|
|
+const noticeText = ref('')
|
|
|
+
|
|
|
+const setNotice = () => {
|
|
|
+ const showNoticeTaskIds = ['13', '14', '81', '99999']
|
|
|
+
|
|
|
+ let text = ''
|
|
|
+ if (!showNoticeTaskIds.includes(taskId.value)) return
|
|
|
+ switch (taskId.value) {
|
|
|
+ case '13':
|
|
|
+ text = '请以合法方式获取任务所需信息且不得侵犯任何商业秘密,否则将因此承担民/刑事责任。'
|
|
|
+ break
|
|
|
+ case '14':
|
|
|
+ text = '请勿统方,否则您将可能被医疗机构处罚并反馈至相关企业且被企业追究法律责任。'
|
|
|
+ break
|
|
|
+ case '81':
|
|
|
+ text = '注意该任务仅支持采集已购买产品的终端!'
|
|
|
+ break
|
|
|
+ case '99999':
|
|
|
+ text = '测试qaqaq'
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ break
|
|
|
+ }
|
|
|
+
|
|
|
+ showNotice.value = true
|
|
|
+ noticeText.value = text
|
|
|
+}
|
|
|
+
|
|
|
+const taskId = ref('')
|
|
|
+
|
|
|
+onLoad(async (options: PageLoadOptions = {}) => {
|
|
|
+ setNavigationTitle(options.taskTitle)
|
|
|
+ taskId.value = options.taskId ?? ''
|
|
|
+
|
|
|
+ setNotice()
|
|
|
+
|
|
|
+ await getTaskContentConfigByTaskTypeId('99999')
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.task-form {
|
|
|
+ background: #f2f2f2;
|
|
|
+ min-height: 100vh;
|
|
|
+ padding: 20rpx 28rpx;
|
|
|
+
|
|
|
+ .workbench-notice {
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|