hookehuyr

✨ feat: 表格页直接进入,需要再进入首页一次

......@@ -31,7 +31,6 @@ declare module '@vue/runtime-core' {
NutCheckboxGroup: typeof import('@nutui/nutui-taro')['CheckboxGroup']
NutConfigProvider: typeof import('@nutui/nutui-taro')['ConfigProvider']
NutDialog: typeof import('@nutui/nutui-taro')['Dialog']
NutField: typeof import('@nutui/nutui-taro')['Field']
NutForm: typeof import('@nutui/nutui-taro')['Form']
NutFormItem: typeof import('@nutui/nutui-taro')['FormItem']
NutInput: typeof import('@nutui/nutui-taro')['Input']
......
<!--
* @Date: 2023-03-24 09:19:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-04-04 15:55:41
* @LastEditTime: 2023-04-04 18:09:30
* @FilePath: /custom_form/src/pages/table/index.vue
* @Description: 文件描述
-->
......@@ -73,7 +73,7 @@ const ruleForm = ref(null);
// // 获取表单设置
const store = mainStore();
const { formSetting, formInfo } = storeToRefs(store);
const { formSetting, formInfo, callIndex } = storeToRefs(store);
// web端判断封面图片高度
const is_pc = computed(() => process.env.TARO_ENV === 'h5' && wxInfo().isPC);
......@@ -188,6 +188,15 @@ const onSubmitPwd = async () => {
}
onMounted(async () => {
// 检查是否从首页跳转
if (!callIndex.value) {
// 翻状态
store.changeCallIndex(true);
// 跳转index页面
Taro.redirectTo({
url: `../index/index?code=${form_code}&model=${model}`
})
}
// TAG: 全局背景色
// $('body').css('background-color', styleColor.backgroundColor)
const { data } = await queryFormAPI({ form_code });
......
/*
* @Date: 2022-04-18 15:59:42
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-03-24 14:04:54
* @LastEditTime: 2023-04-04 18:07:56
* @FilePath: /custom_form/src/stores/index.js
* @Description: 文件描述
*/
......@@ -12,13 +12,14 @@ export const mainStore = defineStore('main', {
state: () => {
return {
fieldName: '',
callIndex: false, // 是否访问过index页面
formInfo: {}, // 表单字段信息
formSetting: {}, // 表单数据收集设置
successInfo: {}, // 表单提交返回值
};
}
},
getters: {
getKeepPages () {
getKeepPages() {
return this.keepPages
},
// getTestStoreList () {
......@@ -26,17 +27,20 @@ export const mainStore = defineStore('main', {
// }
},
actions: {
changeFieldName (v) {
this.fieldName = v;
changeFieldName(v) {
this.fieldName = v
},
changeFormInfo (v) {
this.formInfo = v;
changeCallIndex(v) {
this.callIndex = v
},
changeFormSetting (v) {
this.formSetting = v;
changeFormInfo(v) {
this.formInfo = v
},
changeSuccessInfo (v) {
this.successInfo = v;
changeFormSetting(v) {
this.formSetting = v
},
changeSuccessInfo(v) {
this.successInfo = v
},
});
},
})
......