"use strict";const o=require("../../common/vendor.js"),e=require("../../gen/Apis.js"),i=require("./model.js");require("../../common/libraries/request.js");const l=require("../../common/store/useWeAppAuthStore.js");require("../../common/store/useWorkStore.js");const n=require("../../common/libraries/apiLoading.js"),t=require("../../common/libraries/userUserLogin.js"),s=require("../../common/libraries/naviHelper.js"),a=l.useWeAppAuthStore(),u={getShow(o){n.getApiLoading(e.Apis.Activity.Activities.Show,{id:o}).then((l=>{i.useModel.showData.value=null==l?void 0:l.data,(o=>{n.getApiLoading(e.Apis.Activity.ActivityEnrolls.GetCustomerEnroll,{activities_id:o}).then((o=>{i.useModel.showData.value={...i.useModel.showData.value,...null==o?void 0:o.data},console.log(o)}))})(o),console.log(l)}))},handleSignUp(){var l,u,r,d,c,v,g;if(null==(l=t.getUserLogin)?void 0:l.onBindPhone()){if(!(null==(u=null==a?void 0:a.data)?void 0:u.house_occupant))return o.index.showModal({title:"提示",content:"未绑定房屋，请先绑定房屋！",confirmText:"去绑定",confirmColor:"#0082FA",success:function(e){e.confirm?(o.index.navigateTo({url:"/INDEX/binding/index"}),console.log("用户点击确定")):e.cancel&&console.log("用户点击取消")}}),!1;n.getApiLoading(e.Apis.Activity.ActivityEnrolls.Store,{activities_id:null==(r=i.useModel.showData.value)?void 0:r.id,customer_name:(null==(c=null==(d=null==a?void 0:a.data)?void 0:d.user)?void 0:c.name)||"",customer_phone:null==(g=null==(v=null==a?void 0:a.data)?void 0:v.user)?void 0:g.phone}).then((o=>{s.showToastBack("报名成功",1,!0),console.log(o)}))}},handleCancelSignUp(l){var t,a,u,r,d,c;o.index.showModal({title:"提示",content:"Cancelled"===l?`您将取消 [${null==(u=null==(a=null==(t=i.useModel)?void 0:t.showData)?void 0:a.value)?void 0:u.title}]活动，取消后释放名额?`:`您将重新报名 [${null==(c=null==(d=null==(r=i.useModel)?void 0:r.showData)?void 0:d.value)?void 0:c.title}]，活动?`,success(o){var t,a,u,r;o.confirm?(n.getApiLoading(e.Apis.Activity.ActivityEnrolls.Cancelled,{id:null==(r=null==(u=null==(a=null==(t=i.useModel)?void 0:t.showData)?void 0:a.value)?void 0:u.result)?void 0:r.id,status:l}).then((o=>{s.showToastBack("Cancelled"===l?"取消报名成功":"重新报名成功",1,!0),console.log(o)})),console.log("用户点击确定")):o.cancel&&console.log("用户点击取消")}})}};exports.method=u;
