Showing
1 changed file
with
9 additions
and
14 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-07-18 10:22:22 | 2 | * @Date: 2022-07-18 10:22:22 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-12-07 15:08:29 | 4 | + * @LastEditTime: 2022-12-07 16:12:26 |
| 5 | * @FilePath: /data-table/src/views/index.vue | 5 | * @FilePath: /data-table/src/views/index.vue |
| 6 | * @Description: 首页 | 6 | * @Description: 首页 |
| 7 | --> | 7 | --> |
| ... | @@ -84,15 +84,14 @@ import { | ... | @@ -84,15 +84,14 @@ import { |
| 84 | useTitle, | 84 | useTitle, |
| 85 | } from "@/utils/generatePackage.js"; | 85 | } from "@/utils/generatePackage.js"; |
| 86 | import { useRoute } from "vue-router"; | 86 | import { useRoute } from "vue-router"; |
| 87 | -import { queryFormAPI } from "@/api/form.js"; | 87 | +import { queryFormAPI, getFormSettingAPI } from "@/api/form.js"; |
| 88 | import { addFormDataAPI } from "@/api/data.js"; | 88 | import { addFormDataAPI } from "@/api/data.js"; |
| 89 | import { showSuccessToast, showFailToast } from "vant"; | 89 | import { showSuccessToast, showFailToast } from "vant"; |
| 90 | import { wxInfo, getUrlParams } from "@/utils/tools"; | 90 | import { wxInfo, getUrlParams } from "@/utils/tools"; |
| 91 | import { styleColor } from "@/constant.js"; | 91 | import { styleColor } from "@/constant.js"; |
| 92 | -import { getFormSettingAPI } from "@/api/form.js"; | ||
| 93 | 92 | ||
| 94 | -const store = mainStore(); | ||
| 95 | // 获取表单设置 | 93 | // 获取表单设置 |
| 94 | +const store = mainStore(); | ||
| 96 | const { formSetting } = storeToRefs(store); | 95 | const { formSetting } = storeToRefs(store); |
| 97 | // web端判断封面图片高度 | 96 | // web端判断封面图片高度 |
| 98 | const is_pc = computed(() => wxInfo().isPC); | 97 | const is_pc = computed(() => wxInfo().isPC); |
| ... | @@ -164,7 +163,7 @@ const formatData = (data) => { | ... | @@ -164,7 +163,7 @@ const formatData = (data) => { |
| 164 | }; | 163 | }; |
| 165 | 164 | ||
| 166 | // 处理没有绑定值的组件的赋值 | 165 | // 处理没有绑定值的组件的赋值 |
| 167 | -// 图片上传,文件上传,电子签名,评分组件 | 166 | +// 省市区选择,图片上传,文件上传,电子签名,评分组件 |
| 168 | const area_picker = ref([]); | 167 | const area_picker = ref([]); |
| 169 | const image_uploader = ref([]); | 168 | const image_uploader = ref([]); |
| 170 | const file_uploader = ref([]); | 169 | const file_uploader = ref([]); |
| ... | @@ -190,7 +189,10 @@ const setRefMap = (el, item) => { | ... | @@ -190,7 +189,10 @@ const setRefMap = (el, item) => { |
| 190 | } | 189 | } |
| 191 | } | 190 | } |
| 192 | }; | 191 | }; |
| 192 | + | ||
| 193 | const notice_text = ref(""); | 193 | const notice_text = ref(""); |
| 194 | +const show = ref(false); | ||
| 195 | +const qr_url = ref(""); | ||
| 194 | 196 | ||
| 195 | onMounted(async () => { | 197 | onMounted(async () => { |
| 196 | // TAG: 全局背景色 | 198 | // TAG: 全局背景色 |
| ... | @@ -259,8 +261,8 @@ onMounted(async () => { | ... | @@ -259,8 +261,8 @@ onMounted(async () => { |
| 259 | } | 261 | } |
| 260 | }); | 262 | }); |
| 261 | 263 | ||
| 264 | +// 打开轮询用户是否关注 | ||
| 262 | const onTap = () => { | 265 | const onTap = () => { |
| 263 | - // 打开轮询用户是否关注 | ||
| 264 | if (localStorage.getItem('weixin_subscribe') === '0') { | 266 | if (localStorage.getItem('weixin_subscribe') === '0') { |
| 265 | setInterval(() => { | 267 | setInterval(() => { |
| 266 | checkUserSubscribe() | 268 | checkUserSubscribe() |
| ... | @@ -268,8 +270,8 @@ const onTap = () => { | ... | @@ -268,8 +270,8 @@ const onTap = () => { |
| 268 | } | 270 | } |
| 269 | } | 271 | } |
| 270 | 272 | ||
| 273 | +// 检查数据收集设置 | ||
| 271 | const checkUserSubscribe = async () => { | 274 | const checkUserSubscribe = async () => { |
| 272 | - // 数据收集设置 | ||
| 273 | const code = getUrlParams(location.href) ? getUrlParams(location.href).code : ''; | 275 | const code = getUrlParams(location.href) ? getUrlParams(location.href).code : ''; |
| 274 | const { data } = await getFormSettingAPI({ form_code: code }); | 276 | const { data } = await getFormSettingAPI({ form_code: code }); |
| 275 | const form_setting = {}; | 277 | const form_setting = {}; |
| ... | @@ -293,12 +295,6 @@ const checkUserSubscribe = async () => { | ... | @@ -293,12 +295,6 @@ const checkUserSubscribe = async () => { |
| 293 | } | 295 | } |
| 294 | } | 296 | } |
| 295 | 297 | ||
| 296 | -const show = ref(false); | ||
| 297 | -const qr_url = ref(""); | ||
| 298 | -const onClose = () => { | ||
| 299 | - show.value = false; | ||
| 300 | -}; | ||
| 301 | - | ||
| 302 | // 操作绑定自定义字段回调 | 298 | // 操作绑定自定义字段回调 |
| 303 | const onActive = (item) => { | 299 | const onActive = (item) => { |
| 304 | if (item.key === "area_picker") { | 300 | if (item.key === "area_picker") { |
| ... | @@ -388,7 +384,6 @@ const validOther = () => { | ... | @@ -388,7 +384,6 @@ const validOther = () => { |
| 388 | }; | 384 | }; |
| 389 | 385 | ||
| 390 | const onSubmit = async (values) => { | 386 | const onSubmit = async (values) => { |
| 391 | - console.warn(postData.value); | ||
| 392 | // 合并自定义字段到提交表单字段 | 387 | // 合并自定义字段到提交表单字段 |
| 393 | postData.value = _.assign(postData.value, values); | 388 | postData.value = _.assign(postData.value, values); |
| 394 | // 检查非表单输入项 | 389 | // 检查非表单输入项 | ... | ... |
-
Please register or login to post a comment