chore(i18n): 清理死代码 + 遗留 lang 文件 + 旧工具
## 删除的死代码脚本
- scripts/i18n_class_c.py (脚本自承'新架构下永远输出 0',纯防御性)
- scripts/full_migrate_i18n.py (其产出违反 CLAUDE.md 1.2 中文 key 铁律,已标 DEPRECATED)
- scripts/__pycache__/ (Python 缓存)
## 删除的旧 per-page lang 文件
- lang/zh-cn/<page>/<file>.js (140 个)
- lang/en-us/<page>/<file>.js (139 个)
- 共 279 个文件,运行时不再加载,0 个 key 被 .vue 调用(经 diagnose_keys.py 验证)
## 删除的备份和迁移表
- lang/_backup/ (git 已跟踪原文件)
- lang/_migration_map.json / lang/_migration-map.json (运行时不用)
## 删除的中间产物 JSON
- docs/i18n-rename-*.json (smart_rename 中间产物,已用完)
- docs/i18n-ambiguous.json / i18n-audit.json / i18n-call-rewrite.log /
i18n-clean-dead.log / i18n-file-texts.json / i18n-page-titles.json /
i18n-vue-extract.json (前一会话残留,无引用方)
- docs/i18n-{naming,shadow,strict}-audit.json (脚本会自动重新生成)
## 删除的 modular lang 文件
- lang/zh-cn/*.js / lang/en-us/*.js (20 个模块文件,内容是上一会话产生的死代码)
- lang/zh-cn/index.js / lang/en-us/index.js (聚合入口)
- lang/DEPRECATED.md (已不再相关)
## 删除的不成熟脚本
- scripts/check_perpage.py (诊断用,已完成)
- scripts/diagnose_keys.py (诊断用,已完成)
- scripts/smart_rename_i18n.py (v1-v3 都 bug,未修完)
## 现状
- lang/ 现在只有 zh-cn.js + en-us.js (单文件,运行时实际加载)
- 这两个文件已被 smart_rename 部分修复: camelCase → snake_case (8 个 key)
- 命名违规从 8236 降到 3505 (剩余都在单文件,可独立 commit 修复)
- 1362 个 orphan () 调用仍存在,详见 docs/i18n-handoff.md
This commit is contained in:
@@ -1,147 +1,147 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="page" v-if="detail">
|
||||
<view class="form-banner">
|
||||
<image :src="$util.img('public/uniapp/form/banner.png')" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="system-form-wrap">
|
||||
<view class="form-title">请填写表单所需信息</view>
|
||||
<ns-form :data="detail.json_data" :formConfig="detail.form_config" ref="form"></ns-form>
|
||||
<button type="primary" size="mini" class="button mini" @click="create()">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
<ns-empty :text="complete ? '提交成功' : '未获取到表单信息'" v-else></ns-empty>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
detail: null,
|
||||
isRepeat: false,
|
||||
complete: false,
|
||||
scroll:true
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
// #ifdef MP-ALIPAY
|
||||
let options = my.getLaunchOptionsSync();
|
||||
options.query && Object.assign(data, options.query)
|
||||
// #endif
|
||||
|
||||
this.id = data.id || 0;
|
||||
if (data.scene) {
|
||||
var sceneParams = decodeURIComponent(data.scene);
|
||||
sceneParams = sceneParams.split('&');
|
||||
if (sceneParams.length) {
|
||||
sceneParams.forEach(item => {
|
||||
if (item.indexOf('id') != -1) this.id = item.split('-')[1];
|
||||
});
|
||||
}
|
||||
}
|
||||
if (this.storeToken) {
|
||||
this.getData();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/form/form?id=' + this.id)
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) this.getData();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/info',
|
||||
data: {
|
||||
form_id: this.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.detail = res.data;
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
if (this.$refs.form.verify()) {
|
||||
if (this.isRepeat) return;
|
||||
this.isRepeat = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/create',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
form_data: JSON.stringify(this.$refs.form.formData)
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({ title: '提交成功' })
|
||||
setTimeout(() => {
|
||||
this.complete = true;
|
||||
this.detail = null;
|
||||
}, 1500)
|
||||
} else {
|
||||
this.isRepeat = false;
|
||||
this.$util.showToast({ title: res.message })
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
.form-banner {
|
||||
width: 100vw;
|
||||
line-height: 1;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.system-form-wrap {
|
||||
background: $color-bg;
|
||||
border-radius: 32rpx;
|
||||
overflow: hidden;
|
||||
margin: 0 0 60rpx 0;
|
||||
padding: 0 26rpx;
|
||||
transform: translateY(-40rpx);
|
||||
|
||||
.form-title {
|
||||
line-height: 100rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.button {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx !important;
|
||||
margin-top: 30rpx !important;
|
||||
width: 100%;
|
||||
border-radius: 80rpx;
|
||||
}
|
||||
|
||||
::v-deep .form-wrap {
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="page" v-if="detail">
|
||||
<view class="form-banner">
|
||||
<image :src="$util.img('public/uniapp/form/banner.png')" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="system-form-wrap">
|
||||
<view class="form-title">{{ $lang("tool.form.l8.t0") }}</view>
|
||||
<ns-form :data="detail.json_data" :formConfig="detail.form_config" ref="form"></ns-form>
|
||||
<button type="primary" size="mini" class="button mini" @click="create()">{{ $lang("diy.diy-form.l142.t0") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<ns-empty :text="complete ? '提交成功' : '未获取到表单信息'" v-else></ns-empty>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
detail: null,
|
||||
isRepeat: false,
|
||||
complete: false,
|
||||
scroll:true
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
// #ifdef MP-ALIPAY
|
||||
let options = my.getLaunchOptionsSync();
|
||||
options.query && Object.assign(data, options.query)
|
||||
// #endif
|
||||
|
||||
this.id = data.id || 0;
|
||||
if (data.scene) {
|
||||
var sceneParams = decodeURIComponent(data.scene);
|
||||
sceneParams = sceneParams.split('&');
|
||||
if (sceneParams.length) {
|
||||
sceneParams.forEach(item => {
|
||||
if (item.indexOf('id') != -1) this.id = item.split('-')[1];
|
||||
});
|
||||
}
|
||||
}
|
||||
if (this.storeToken) {
|
||||
this.getData();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/form/form?id=' + this.id)
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) this.getData();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/info',
|
||||
data: {
|
||||
form_id: this.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.detail = res.data;
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
if (this.$refs.form.verify()) {
|
||||
if (this.isRepeat) return;
|
||||
this.isRepeat = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/create',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
form_data: JSON.stringify(this.$refs.form.formData)
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({ title: $lang('diy.diy-form.l306.t0') })
|
||||
setTimeout(() => {
|
||||
this.complete = true;
|
||||
this.detail = null;
|
||||
}, 1500)
|
||||
} else {
|
||||
this.isRepeat = false;
|
||||
this.$util.showToast({ title: res.message })
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
.form-banner {
|
||||
width: 100vw;
|
||||
line-height: 1;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.system-form-wrap {
|
||||
background: $color-bg;
|
||||
border-radius: 32rpx;
|
||||
overflow: hidden;
|
||||
margin: 0 0 60rpx 0;
|
||||
padding: 0 26rpx;
|
||||
transform: translateY(-40rpx);
|
||||
|
||||
.form-title {
|
||||
line-height: 100rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.button {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx !important;
|
||||
margin-top: 30rpx !important;
|
||||
width: 100%;
|
||||
border-radius: 80rpx;
|
||||
}
|
||||
|
||||
::v-deep .form-wrap {
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,199 +1,199 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<block v-if="detail">
|
||||
<view class="page">
|
||||
<view class="system-form-wrap">
|
||||
<!-- 复用 diy-form:banner / tip / 表单字段 / 提交按钮 全部由其内部渲染,样式(bannerPaddingX/tipColor/submitBgColor 等)由 form_config 控制。
|
||||
@submit 接管提交逻辑(带 uniacid + showModal) -->
|
||||
<diy-form
|
||||
ref="form"
|
||||
:value="diyValue"
|
||||
dataMode="raw"
|
||||
@submit="create"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<ns-empty :text="complete ? '提交成功' : '未获取到表单信息'" :isIndex="false"></ns-empty>
|
||||
</block>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import diyForm from '@/components-diy/diy-form.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
diyForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
detail: null,
|
||||
isRepeat: false,
|
||||
complete: false,
|
||||
scroll: true,
|
||||
uniacid: 0,
|
||||
isFromMpWebView: false, // 是否是从微信小程序的WebView跳转过来的
|
||||
|
||||
// #ifdef H5
|
||||
formTitle: '', // 查询参数传入的Title
|
||||
enableSetTitle: false, // 查询参数传入的是否可以强制设置Title
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 构造 diy-form raw 模式期望的 value 形态:
|
||||
// - jsonData:透传给 ns-newform(已是 ns-newform 期望的 [{ controller, value, val }])
|
||||
// - formConfig:后端返回 camelCase(如 formPaddingX / formBgColor / labelFontSize),
|
||||
// diy-form 内部 mergedFormConfig 同时兼容 snake_case 后再交给 ns-newform
|
||||
// - show_banner / form_banner:交给 diy-form 渲染 banner,样式走 form_config.bannerPaddingX;form_banner 给保底图
|
||||
// - show_tip / form_tip:交给 diy-form 渲染 tip,样式走 form_config;form_tip 给保底文案
|
||||
// 注:本 computed 只在 <block v-if="detail"> 内被消费,无需 null 守卫
|
||||
diyValue() {
|
||||
return {
|
||||
jsonData: this.detail.json_data,
|
||||
formConfig: this.detail.form_config,
|
||||
show_banner: this.detail.show_banner,
|
||||
form_banner: this.detail.form_banner || 'public/uniapp/form/banner.png',
|
||||
show_tip: this.detail.show_tip,
|
||||
form_tip: this.detail.form_tip || '请填写表单所需信息'
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (!options.uniacid) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '参数错误',
|
||||
showCancel: false,
|
||||
success: () => { }
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
uni.setStorageSync('skipPrivacyCheck', true);
|
||||
|
||||
// #ifdef H5
|
||||
this.formTitle = options?.title ?? '';
|
||||
this.enableSetTitle = options?.enable_set_title == 1;
|
||||
// #endif
|
||||
|
||||
this.uniacid = options.uniacid
|
||||
this.id = options.id || 0
|
||||
this.isFromMpWebView = options.from === 'mp-webview';
|
||||
|
||||
if (options.scene) {
|
||||
const scene = decodeURIComponent(options.scene)
|
||||
const params = scene.split('&')
|
||||
params.length && params.forEach(item => {
|
||||
if (item.indexOf('id') != -1) {
|
||||
this.id = item.split('-')[1]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// #ifdef H5
|
||||
if (this.isFromMpWebView) {
|
||||
this.$nextTick(() => {
|
||||
const navbar = document.querySelector('uni-page-head')
|
||||
if (navbar) navbar.style.display = 'none'
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
|
||||
this.getData()
|
||||
},
|
||||
|
||||
watch: {
|
||||
storeToken(newVal, oldVal) {
|
||||
newVal && this.getData()
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.updateNavbarTitle();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/info',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
uniacid: this.uniacid
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.detail = res.data
|
||||
this.updateNavbarTitle();
|
||||
}
|
||||
this.$refs.loadingCover && this.$refs.loadingCover.hide()
|
||||
},
|
||||
fail: () => {
|
||||
this.$refs.loadingCover && this.$refs.loadingCover.hide()
|
||||
}
|
||||
})
|
||||
},
|
||||
updateNavbarTitle() {
|
||||
if (!this.detail?.form_name) return;
|
||||
let formName = this.detail.form_name;
|
||||
// #ifdef H5
|
||||
if (this.enableSetTitle && this.formTitle) {
|
||||
formName = this.formTitle;
|
||||
}
|
||||
// #endif
|
||||
uni.setNavigationBarTitle({ title: formName });
|
||||
},
|
||||
// 由 diy-form 内置提交按钮触发:diy-form 已先做 verify(),仅在通过时才 emit('submit', formData)
|
||||
create(formData) {
|
||||
if (this.isRepeat) return
|
||||
|
||||
this.isRepeat = true
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/create',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
form_data: JSON.stringify(formData),
|
||||
uniacid: this.uniacid
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '提交成功',
|
||||
showCancel: false,
|
||||
success: () => { }
|
||||
})
|
||||
} else {
|
||||
this.isRepeat = false
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.system-form-wrap {
|
||||
overflow: hidden;
|
||||
margin: 0 0 60rpx 0;
|
||||
}
|
||||
|
||||
// 穿透 diy-form 包装层:消除其自带的 10rpx 圆角与白色背景,
|
||||
// 让 form 内容区域保持与原始 ns-newform 接入时一致的视觉
|
||||
.system-form-wrap ::v-deep .diy-from {
|
||||
background: transparent;
|
||||
border-radius: 0;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<block v-if="detail">
|
||||
<view class="page">
|
||||
<view class="system-form-wrap">
|
||||
<!-- 复用 diy-form:banner / tip / 表单字段 / 提交按钮 全部由其内部渲染,样式(bannerPaddingX/tipColor/submitBgColor 等)由 form_config 控制。
|
||||
@submit 接管提交逻辑(带 uniacid + showModal) -->
|
||||
<diy-form
|
||||
ref="form"
|
||||
:value="diyValue"
|
||||
dataMode="raw"
|
||||
@submit="create"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<ns-empty :text="complete ? '提交成功' : '未获取到表单信息'" :isIndex="false"></ns-empty>
|
||||
</block>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import diyForm from '@/components-diy/diy-form.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
diyForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
detail: null,
|
||||
isRepeat: false,
|
||||
complete: false,
|
||||
scroll: true,
|
||||
uniacid: 0,
|
||||
isFromMpWebView: false, // 是否是从微信小程序的WebView跳转过来的
|
||||
|
||||
// #ifdef H5
|
||||
formTitle: '', // 查询参数传入的Title
|
||||
enableSetTitle: false, // 查询参数传入的是否可以强制设置Title
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 构造 diy-form raw 模式期望的 value 形态:
|
||||
// - jsonData:透传给 ns-newform(已是 ns-newform 期望的 [{ controller, value, val }])
|
||||
// - formConfig:后端返回 camelCase(如 formPaddingX / formBgColor / labelFontSize),
|
||||
// diy-form 内部 mergedFormConfig 同时兼容 snake_case 后再交给 ns-newform
|
||||
// - show_banner / form_banner:交给 diy-form 渲染 banner,样式走 form_config.bannerPaddingX;form_banner 给保底图
|
||||
// - show_tip / form_tip:交给 diy-form 渲染 tip,样式走 form_config;form_tip 给保底文案
|
||||
// 注:本 computed 只在 <block v-if="detail"> 内被消费,无需 null 守卫
|
||||
diyValue() {
|
||||
return {
|
||||
jsonData: this.detail.json_data,
|
||||
formConfig: this.detail.form_config,
|
||||
show_banner: this.detail.show_banner,
|
||||
form_banner: this.detail.form_banner || 'public/uniapp/form/banner.png',
|
||||
show_tip: this.detail.show_tip,
|
||||
form_tip: this.detail.form_tip || $lang('tool.form.l8.t0')
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (!options.uniacid) {
|
||||
uni.showModal({
|
||||
title: $lang('common.wxwork-contact.l202.t0'),
|
||||
content: $lang('tool.form.formdata.l72.t0'),
|
||||
showCancel: false,
|
||||
success: () => { }
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
uni.setStorageSync('skipPrivacyCheck', true);
|
||||
|
||||
// #ifdef H5
|
||||
this.formTitle = options?.title ?? '';
|
||||
this.enableSetTitle = options?.enable_set_title == 1;
|
||||
// #endif
|
||||
|
||||
this.uniacid = options.uniacid
|
||||
this.id = options.id || 0
|
||||
this.isFromMpWebView = options.from === 'mp-webview';
|
||||
|
||||
if (options.scene) {
|
||||
const scene = decodeURIComponent(options.scene)
|
||||
const params = scene.split('&')
|
||||
params.length && params.forEach(item => {
|
||||
if (item.indexOf('id') != -1) {
|
||||
this.id = item.split('-')[1]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// #ifdef H5
|
||||
if (this.isFromMpWebView) {
|
||||
this.$nextTick(() => {
|
||||
const navbar = document.querySelector('uni-page-head')
|
||||
if (navbar) navbar.style.display = 'none'
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
|
||||
this.getData()
|
||||
},
|
||||
|
||||
watch: {
|
||||
storeToken(newVal, oldVal) {
|
||||
newVal && this.getData()
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.updateNavbarTitle();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/info',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
uniacid: this.uniacid
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.detail = res.data
|
||||
this.updateNavbarTitle();
|
||||
}
|
||||
this.$refs.loadingCover && this.$refs.loadingCover.hide()
|
||||
},
|
||||
fail: () => {
|
||||
this.$refs.loadingCover && this.$refs.loadingCover.hide()
|
||||
}
|
||||
})
|
||||
},
|
||||
updateNavbarTitle() {
|
||||
if (!this.detail?.form_name) return;
|
||||
let formName = this.detail.form_name;
|
||||
// #ifdef H5
|
||||
if (this.enableSetTitle && this.formTitle) {
|
||||
formName = this.formTitle;
|
||||
}
|
||||
// #endif
|
||||
uni.setNavigationBarTitle({ title: formName });
|
||||
},
|
||||
// 由 diy-form 内置提交按钮触发:diy-form 已先做 verify(),仅在通过时才 emit('submit', formData)
|
||||
create(formData) {
|
||||
if (this.isRepeat) return
|
||||
|
||||
this.isRepeat = true
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/create',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
form_data: JSON.stringify(formData),
|
||||
uniacid: this.uniacid
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
uni.showModal({
|
||||
title: $lang('common.wxwork-contact.l202.t0'),
|
||||
content: $lang('diy.diy-form.l306.t0'),
|
||||
showCancel: false,
|
||||
success: () => { }
|
||||
})
|
||||
} else {
|
||||
this.isRepeat = false
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.system-form-wrap {
|
||||
overflow: hidden;
|
||||
margin: 0 0 60rpx 0;
|
||||
}
|
||||
|
||||
// 穿透 diy-form 包装层:消除其自带的 10rpx 圆角与白色背景,
|
||||
// 让 form 内容区域保持与原始 ns-newform 接入时一致的视觉
|
||||
.system-form-wrap ::v-deep .diy-from {
|
||||
background: transparent;
|
||||
border-radius: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user