"use strict";const e=require("../../common/libraries/apiLoading.js"),o=require("../../common/libraries/day.js"),l=require("../../common/libraries/naviHelper.js"),i=require("../../gen/Apis.js"),a=require("./model.js"),s=l=>{e.getApiLoading(i.Apis.Visitor.VisitorApplies.Show,l).then(e=>{var l,i,s,d,n,r;a.useModel.showData.value=null==e?void 0:e.data,(null==(i=null==(l=null==e?void 0:e.data)?void 0:l.renovation_workers)?void 0:i.length)&&(a.useModel.userInfo.value=null==(d=null==(s=null==e?void 0:e.data)?void 0:s.renovation_workers)?void 0:d[0]),(null==(n=null==e?void 0:e.data)?void 0:n.code_expired_at)&&(a.useModel.isExpired.value=o.isDatePassed(null==(r=null==e?void 0:e.data)?void 0:r.code_expired_at)),console.log(e)})},d={init(e){a.useModel.formData.value=e,console.log(e,a.useModel.formData.value,"sncd"),s(e)},handleSubmit(o){var d,n,r,u,t;e.getApiLoading(i.Apis.Visitor.VisitorApplies.Scan,{code:null==(r=null==(n=null==(d=a.useModel)?void 0:d.showData)?void 0:n.value)?void 0:r.visitor_code,scan_type:o,...null==(t=null==(u=a.useModel)?void 0:u.formData)?void 0:t.value}).then(e=>{l.showToast("操作成功！",()=>{s(a.useModel.formData.value)}),console.log(e)})}};exports.method=d;
