feat: 打包异常问题修复

This commit is contained in:
duanshuwen
2026-01-31 17:48:34 +08:00
parent 7dd245095e
commit 89953466c1
3 changed files with 15 additions and 22 deletions

View File

@@ -3,8 +3,7 @@
<template #title>{{ questionnaire.title }}</template> <template #title>{{ questionnaire.title }}</template>
<van-form @submit="onSubmit"> <van-form @submit="onSubmit">
<van-cell-group :title="`${index + 1}. ${item.question}`" v-for="(item, index) in questionnaire.questions" <van-cell-group :title="`${index + 1}. ${item.question}`" v-for="(item, index) in questionnaire.questions" :key="item.id">
:key="item.id">
<!-- 单选框 --> <!-- 单选框 -->
<van-field v-if="item.type === 'radio'" name="radio"> <van-field v-if="item.type === 'radio'" name="radio">
<template #input> <template #input>
@@ -20,8 +19,7 @@
<van-field v-if="item.type === 'checkbox'" name="checkboxGroup"> <van-field v-if="item.type === 'checkbox'" name="checkboxGroup">
<template #input> <template #input>
<van-checkbox-group v-model="item.answer" shape="square"> <van-checkbox-group v-model="item.answer" shape="square">
<van-checkbox v-for="(option, index) in item.options" :key="item.id + index" :name="option.id" <van-checkbox v-for="(option, index) in item.options" :key="item.id + index" :name="option.id" class="mb-12">
class="mb-12">
{{ option.text }} {{ option.text }}
</van-checkbox> </van-checkbox>
</van-checkbox-group> </van-checkbox-group>
@@ -32,14 +30,11 @@
<van-field v-if="item.type === 'text'" v-model="item.answer" placeholder="请填写内容" /> <van-field v-if="item.type === 'text'" v-model="item.answer" placeholder="请填写内容" />
<!-- 文本域 --> <!-- 文本域 -->
<van-field v-if="item.type === 'textarea'" type="textarea" v-model="item.answer" placeholder="请填写内容" <van-field v-if="item.type === 'textarea'" type="textarea" v-model="item.answer" placeholder="请填写内容" maxlength="100" show-word-limit />
maxlength="100" show-word-limit />
</van-cell-group> </van-cell-group>
<div class="m-16"> <div class="m-16">
<van-button round block type="primary" native-type="submit"> <van-button round block type="primary" native-type="submit"> 提交 </van-button>
提交
</van-button>
</div> </div>
</van-form> </van-form>
</Layout> </Layout>
@@ -47,7 +42,7 @@
<script setup name="home"> <script setup name="home">
import { getSurveyQuestionnaireUsingGet, submitSurveyQuestionnaireAnswerUsingPost } from '@api' import { getSurveyQuestionnaireUsingGet, submitSurveyQuestionnaireAnswerUsingPost } from '@api'
import { showToast } from 'vant'; import { showToast } from 'vant'
const form = ref({ const form = ref({
surveyId: '', surveyId: '',

View File

@@ -4,13 +4,9 @@
<van-icon name="success" color="#fff" size="70" /> <van-icon name="success" color="#fff" size="70" />
</div> </div>
<div class="fz-26 mb-12">提交成功</div> <div class="fz-26 mb-12">提交成功</div>
<div class="color-66 fz-14 line-height-21 mb-12 text-center mb-30">感谢您参与息烽南山天沐温泉的客户调研问卷, 您的宝贵意见将帮助我们不断提升服务质量, <div class="color-66 fz-14 line-height-21 mb-12 text-center mb-30">感谢您参与息烽南山天沐温泉的客户调研问卷, 您的宝贵意见将帮助我们不断提升服务质量, 请凭此截图于前台兑换精美礼品一份!</div>
请凭此截图于前台兑换精美礼品一份!
</div>
<van-button class="fz-14 w-200" round block type="primary" @click="handleClick"> <van-button class="fz-14 w-200" round block type="primary" @click="handleClick"> 完成 </van-button>
完成
</van-button>
</section> </section>
</template> </template>
@@ -19,8 +15,8 @@ const handleClick = () => {
// 确保在wx.ready中调用 // 确保在wx.ready中调用
wx.ready(() => { wx.ready(() => {
// 关闭当前H5页面 // 关闭当前H5页面
wx.miniProgram.navigateBack({}); wx.miniProgram.navigateBack({})
}); })
} }
</script> </script>
@@ -32,4 +28,4 @@ section {
align-items: center; align-items: center;
padding: 100px 30px 0; padding: 100px 30px 0;
} }
</style> </style>

View File

@@ -20,17 +20,19 @@ export default defineConfig(({ mode }) => {
return { return {
base: isProd ? './' : './', // 是否是生产环境 base: isProd ? './' : './', // 是否是生产环境
build: { build: {
target: 'es2020',
cssCodeSplit: false, cssCodeSplit: false,
chunkSizeWarningLimit: 2048, chunkSizeWarningLimit: 2048,
sourcemap: isProd sourcemap: isProd
}, },
esbuild: { esbuild: {
target: 'es2020',
drop: isProd ? ['console', 'debugger'] : undefined drop: isProd ? ['console', 'debugger'] : undefined
}, },
plugins: [ plugins: [
legacy({ // legacy({
targets: ['defaults', 'not IE 11'] // targets: ['> 0.5%', 'last 2 versions', 'not dead', 'not safari < 12']
}), // }),
vue(), vue(),
VueSetupExtend(), VueSetupExtend(),
Components({ Components({