Showing
3 changed files
with
27 additions
and
15 deletions
| ... | @@ -31,7 +31,6 @@ declare module '@vue/runtime-core' { | ... | @@ -31,7 +31,6 @@ declare module '@vue/runtime-core' { |
| 31 | NutCheckboxGroup: typeof import('@nutui/nutui-taro')['CheckboxGroup'] | 31 | NutCheckboxGroup: typeof import('@nutui/nutui-taro')['CheckboxGroup'] |
| 32 | NutConfigProvider: typeof import('@nutui/nutui-taro')['ConfigProvider'] | 32 | NutConfigProvider: typeof import('@nutui/nutui-taro')['ConfigProvider'] |
| 33 | NutDialog: typeof import('@nutui/nutui-taro')['Dialog'] | 33 | NutDialog: typeof import('@nutui/nutui-taro')['Dialog'] |
| 34 | - NutField: typeof import('@nutui/nutui-taro')['Field'] | ||
| 35 | NutForm: typeof import('@nutui/nutui-taro')['Form'] | 34 | NutForm: typeof import('@nutui/nutui-taro')['Form'] |
| 36 | NutFormItem: typeof import('@nutui/nutui-taro')['FormItem'] | 35 | NutFormItem: typeof import('@nutui/nutui-taro')['FormItem'] |
| 37 | NutInput: typeof import('@nutui/nutui-taro')['Input'] | 36 | NutInput: typeof import('@nutui/nutui-taro')['Input'] | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2023-03-24 09:19:27 | 2 | * @Date: 2023-03-24 09:19:27 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-04-04 15:55:41 | 4 | + * @LastEditTime: 2023-04-04 18:09:30 |
| 5 | * @FilePath: /custom_form/src/pages/table/index.vue | 5 | * @FilePath: /custom_form/src/pages/table/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -73,7 +73,7 @@ const ruleForm = ref(null); | ... | @@ -73,7 +73,7 @@ const ruleForm = ref(null); |
| 73 | 73 | ||
| 74 | // // 获取表单设置 | 74 | // // 获取表单设置 |
| 75 | const store = mainStore(); | 75 | const store = mainStore(); |
| 76 | -const { formSetting, formInfo } = storeToRefs(store); | 76 | +const { formSetting, formInfo, callIndex } = storeToRefs(store); |
| 77 | 77 | ||
| 78 | // web端判断封面图片高度 | 78 | // web端判断封面图片高度 |
| 79 | const is_pc = computed(() => process.env.TARO_ENV === 'h5' && wxInfo().isPC); | 79 | const is_pc = computed(() => process.env.TARO_ENV === 'h5' && wxInfo().isPC); |
| ... | @@ -188,6 +188,15 @@ const onSubmitPwd = async () => { | ... | @@ -188,6 +188,15 @@ const onSubmitPwd = async () => { |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | onMounted(async () => { | 190 | onMounted(async () => { |
| 191 | + // 检查是否从首页跳转 | ||
| 192 | + if (!callIndex.value) { | ||
| 193 | + // 翻状态 | ||
| 194 | + store.changeCallIndex(true); | ||
| 195 | + // 跳转index页面 | ||
| 196 | + Taro.redirectTo({ | ||
| 197 | + url: `../index/index?code=${form_code}&model=${model}` | ||
| 198 | + }) | ||
| 199 | + } | ||
| 191 | // TAG: 全局背景色 | 200 | // TAG: 全局背景色 |
| 192 | // $('body').css('background-color', styleColor.backgroundColor) | 201 | // $('body').css('background-color', styleColor.backgroundColor) |
| 193 | const { data } = await queryFormAPI({ form_code }); | 202 | const { data } = await queryFormAPI({ form_code }); | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Date: 2022-04-18 15:59:42 | 2 | * @Date: 2022-04-18 15:59:42 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-03-24 14:04:54 | 4 | + * @LastEditTime: 2023-04-04 18:07:56 |
| 5 | * @FilePath: /custom_form/src/stores/index.js | 5 | * @FilePath: /custom_form/src/stores/index.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -12,13 +12,14 @@ export const mainStore = defineStore('main', { | ... | @@ -12,13 +12,14 @@ export const mainStore = defineStore('main', { |
| 12 | state: () => { | 12 | state: () => { |
| 13 | return { | 13 | return { |
| 14 | fieldName: '', | 14 | fieldName: '', |
| 15 | + callIndex: false, // 是否访问过index页面 | ||
| 15 | formInfo: {}, // 表单字段信息 | 16 | formInfo: {}, // 表单字段信息 |
| 16 | formSetting: {}, // 表单数据收集设置 | 17 | formSetting: {}, // 表单数据收集设置 |
| 17 | successInfo: {}, // 表单提交返回值 | 18 | successInfo: {}, // 表单提交返回值 |
| 18 | - }; | 19 | + } |
| 19 | }, | 20 | }, |
| 20 | getters: { | 21 | getters: { |
| 21 | - getKeepPages () { | 22 | + getKeepPages() { |
| 22 | return this.keepPages | 23 | return this.keepPages |
| 23 | }, | 24 | }, |
| 24 | // getTestStoreList () { | 25 | // getTestStoreList () { |
| ... | @@ -26,17 +27,20 @@ export const mainStore = defineStore('main', { | ... | @@ -26,17 +27,20 @@ export const mainStore = defineStore('main', { |
| 26 | // } | 27 | // } |
| 27 | }, | 28 | }, |
| 28 | actions: { | 29 | actions: { |
| 29 | - changeFieldName (v) { | 30 | + changeFieldName(v) { |
| 30 | - this.fieldName = v; | 31 | + this.fieldName = v |
| 31 | }, | 32 | }, |
| 32 | - changeFormInfo (v) { | 33 | + changeCallIndex(v) { |
| 33 | - this.formInfo = v; | 34 | + this.callIndex = v |
| 34 | }, | 35 | }, |
| 35 | - changeFormSetting (v) { | 36 | + changeFormInfo(v) { |
| 36 | - this.formSetting = v; | 37 | + this.formInfo = v |
| 37 | }, | 38 | }, |
| 38 | - changeSuccessInfo (v) { | 39 | + changeFormSetting(v) { |
| 39 | - this.successInfo = v; | 40 | + this.formSetting = v |
| 41 | + }, | ||
| 42 | + changeSuccessInfo(v) { | ||
| 43 | + this.successInfo = v | ||
| 40 | }, | 44 | }, |
| 41 | }, | 45 | }, |
| 42 | -}); | 46 | +}) | ... | ... |
-
Please register or login to post a comment