"use strict"; const common_vendor = require("../../common/vendor.js"); const _sfc_main = { data() { return { formData: { name: "", idCard: "" }, isAgreed: false }; }, computed: { canSubmit() { return this.formData.name.trim() && this.formData.idCard.trim() && this.isAgreed; } }, methods: { toggleAgreement() { this.isAgreed = !this.isAgreed; }, submitForm() { if (!this.canSubmit) { let message = ""; if (!this.formData.name.trim()) { message = "请输入姓名"; } else if (!this.formData.idCard.trim()) { message = "请输入身份证号"; } else if (!this.isAgreed) { message = "请阅读并同意相关协议"; } common_vendor.index.showToast({ title: message, icon: "none" }); return; } const idCardReg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; if (!idCardReg.test(this.formData.idCard)) { common_vendor.index.showToast({ title: "请输入正确的身份证号", icon: "none" }); return; } common_vendor.index.showLoading({ title: "验证中..." }); setTimeout(() => { common_vendor.index.hideLoading(); common_vendor.index.navigateTo({ url: "/pages/face-photo/face-photo", fail: (err) => { console.error("页面跳转失败:", err); common_vendor.index.showToast({ title: "页面跳转失败", icon: "none" }); } }); }, 1500); } } }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return { a: $data.formData.name, b: common_vendor.o(($event) => $data.formData.name = $event.detail.value), c: $data.formData.idCard, d: common_vendor.o(($event) => $data.formData.idCard = $event.detail.value), e: $data.isAgreed, f: common_vendor.o((...args) => $options.toggleAgreement && $options.toggleAgreement(...args)), g: !$options.canSubmit, h: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args)) }; } const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]); wx.createPage(MiniProgramPage);