pages-app-sign.7dad5d98.js 6.9 KB

1
  1. import{s,z as e,Z as a,bM as t,f as l,g as n,w as c,bN as i,m as o,k as d,u,v as r,l as f,r as _,F as y,i as g,H as m,q as w,j as p,I as k,J as h,n as b,x as v,y as x}from"./index-ba48620e.js";import{_ as S}from"./s-empty.a75760f9.js";import{_ as D}from"./phone-international-input.dd3ca29e.js";import{_ as M}from"./s-layout.04b95866.js";import{_ as j}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css */import"./useGoods.edb8879f.js";const A=j({__name:"sign",setup(j){m((s=>({"4a859b65":v(A)})));const A=s.$url.css("/static/images/sign.png"),I=e({data:{days:[],rules:{}},cur_year:0,cur_month:0,cur_day:0,weeks_ch:[{title:"日",value:"0"},{title:"一",value:"1"},{title:"二",value:"2"},{title:"三",value:"3"},{title:"四",value:"4"},{title:"五",value:"5"},{title:"六",value:"6"}],showModel:!1,continue_days:0,signin:{},showRetroactive:!1,date:"",isSign:0,loading:!0});async function Y(){const{code:s,data:e}=await i.createSignInRecord();0===s&&(I.showModel=!0,I.signin=e,I.isSign=1,w("isSign",!0))}function R(){I.showModel=!1,E({month:C(new Date).substring(0,7)})}function C(s){let e=new Date(s);return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}async function E(s){const{code:e,data:a}=await i.getOwnSignInMoon(s);0===e?(a.days.forEach(((s,e)=>{"SUNDAY"==s.week?s.week=0:"MONDAY"==s.week?s.week=1:"TUESDAY"==s.week?s.week=2:"WEDNESDAY"==s.week?s.week=3:"THURSDAY"==s.week?s.week=4:"FRIDAY"==s.week?s.week=5:"SATURDAY"==s.week&&(s.week=6),s.date=C(s.date)})),I.data=a):I.data=null,I.loading=!1,I.data&&(I.data.days.forEach(((s,e)=>{if(e<s.week){e++;I.data.days.unshift({day:null,isSign:!1})}if(1==e){let e=s.date.split("-");I.cur_year=e[0],I.cur_month=e[1]}})),null==I.data.days[0].day&&I.data.days.forEach(((s,e)=>{"today"==s.current&&(I.isSign=s.isSign)})),I.continue_days=a.continueDays)}a((()=>I.showModel),(s=>{s&&setTimeout(R,3e3)})),t((()=>{E({month:C(new Date).substring(0,7)})}));const N=s=>{const e=parseInt(I.cur_year),a=parseInt(I.cur_month);var t;console.log(e,a);var l=e;0===s?(t=a-1)<1?(l=e-1,t=12):t<10&&(t="0"+t):(t=a+1)>12?(l=e+1,t="01"):t<10&&(t="0"+t),console.log(l+"-"+t),E({month:l+"-"+t})};return(e,a)=>{const t=p,i=k,m=x,w=h,j=o(b("s-empty"),S),A=o(b("su-popup"),D),C=o(b("s-layout"),M);return l(),n(C,{title:"签到有礼"},{default:c((()=>[I.loading?(l(),n(t,{key:0})):I.data&&!I.loading?(l(),n(t,{key:1,class:"sign-wrap"},{default:c((()=>[d(t,{class:"content-box calendar"},{default:c((()=>[d(t,{class:"sign-everyday ss-flex ss-col-center ss-row-between ss-p-x-30"},{default:c((()=>[d(i,{class:"sign-everyday-title"},{default:c((()=>[u("签到日历")])),_:1}),d(t,{class:"sign-num-box"},{default:c((()=>[u(" 已连续签到 "),d(i,{class:"sign-num"},{default:c((()=>[u(r(I.continue_days),1)])),_:1}),u(" 天 ")])),_:1})])),_:1}),d(t,{class:"bar ss-flex ss-col-center ss-row-center"},{default:c((()=>[d(t,{class:"previous",onClick:a[0]||(a[0]=s=>N(0))},{default:c((()=>[d(i,{class:"cicon-back"})])),_:1}),d(t,{class:"date ss-m-x-20"},{default:c((()=>[u(r(I.cur_year||"--")+" 年 "+r(I.cur_month||"--")+" 月",1)])),_:1}),d(t,{class:"next",onClick:a[1]||(a[1]=s=>N(1))},{default:c((()=>[d(i,{class:"cicon-forward"})])),_:1})])),_:1}),d(t,{class:"week ss-flex"},{default:c((()=>[(l(!0),f(y,null,_(I.weeks_ch,((s,e)=>(l(),n(t,{class:"week-item ss-flex ss-row-center",key:e},{default:c((()=>[u(r(s.title),1)])),_:2},1024)))),128))])),_:1}),d(t,{class:"myDateTable"},{default:c((()=>[(l(!0),f(y,null,_(I.data.days,((e,a)=>(l(),n(t,{key:a,class:"dateCell ss-flex ss-row-center ss-col-center"},{default:c((()=>[d(t,{class:"ss-flex ss-row-center ss-col-center"},{default:c((()=>[d(i,{decode:!0},{default:c((()=>[u("  ")])),_:1})])),_:1}),d(t,null,{default:c((()=>[e.isSign?(l(),n(t,{key:0,class:"is-sign ss-flex ss-row-center"},{default:c((()=>[d(t,{class:"is-sign-num"},{default:c((()=>[u(r(e.day<10?"0"+e.day:e.day),1)])),_:2},1024),d(m,{class:"is-sign-image",src:v(s).$url.static("/static/images/correct.png")},null,8,["src"])])),_:2},1024)):g("",!0),1==e.isReplenish?(l(),n(t,{key:1,class:"is-sign ss-flex ss-row-center"},{default:c((()=>[d(t,{class:"cell-num"},{default:c((()=>[u(r(e.day<10?"0"+e.day:e.day),1)])),_:2},1024),d(i,{class:"cicon-title"})])),_:2},1024)):g("",!0),0!=e.isReplenish||e.isSign?g("",!0):(l(),n(t,{key:2,class:"is-sign ss-flex ss-row-center"},{default:c((()=>[d(t,{class:"cell-num"},{default:c((()=>[u(r(e.day<10?"0"+e.day:e.day),1)])),_:2},1024)])),_:2},1024))])),_:2},1024)])),_:2},1024)))),128)),d(t,{class:"ss-flex ss-col-center ss-row-center sign-box ss-m-y-40"},{default:c((()=>[0===I.isSign?(l(),n(w,{key:0,class:"ss-reset-button sign-btn",onClick:Y},{default:c((()=>[u("签到")])),_:1})):g("",!0),1===I.isSign?(l(),n(w,{key:1,class:"ss-reset-button already-btn",disabled:""},{default:c((()=>[u("已签到")])),_:1})):g("",!0)])),_:1})])),_:1})])),_:1}),d(t,{class:"bg-white ss-m-t-16 ss-p-t-30 ss-p-b-60 ss-p-x-40"},{default:c((()=>{var s;return[d(t,{class:"activity-title ss-m-b-30"},{default:c((()=>[u("签到说明")])),_:1}),d(t,{class:"activity-des"},{default:c((()=>[u(" 1、每日签到固定 "+r(I.data.signInSocialStatus)+" 身价 ",1)])),_:1}),(null==(s=I.data.rules.discounts)?void 0:s.length)>0?(l(),n(t,{key:0,class:"activity-des"},{default:c((()=>[u(" 2、"),(l(!0),f(y,null,_(I.data.rules.discounts,(s=>(l(),n(i,{class:"",key:s},{default:c((()=>[u(" 连续签到 "+r(s.full)+" 天,奖励 "+r(s.value)+" 身价; ",1)])),_:2},1024)))),128))])),_:1})):g("",!0),"1"==I.data.rules.is_replenish?(l(),n(t,{key:1,class:"activity-des"},{default:c((()=>{var s;return[u(r((null==(s=I.data.rules.discounts)?void 0:s.length)>0?"3":"2")+"、用户在 "+r(I.data.rules.replenish_limit)+" 天内,可补签 "+r(I.data.rules.replenish_days)+" 天,每次补签消耗 "+r(I.data.rules.replenish_num)+"身价 ",1)]})),_:1})):g("",!0)]})),_:1})])),_:1})):I.data||I.loading?g("",!0):(l(),n(j,{key:2,icon:"/static/data-empty.png",text:"签到活动还未开始"})),d(A,{show:I.showModel,type:"center",round:"10",isMaskClick:!1},{default:c((()=>[d(t,{class:"model-box ss-flex-col"},{default:c((()=>[d(t,{class:"ss-m-t-56 ss-flex-col ss-col-center"},{default:c((()=>[d(i,{class:"cicon-check-round"}),d(t,{class:"score-title"},{default:c((()=>[u("恭喜签到成功")])),_:1}),d(t,{class:"model-title ss-flex ss-col-center ss-m-t-22 ss-m-b-30"},{default:c((()=>[u(" 获得每日签到"+r(I.signin.social)+"点身价 ",1)])),_:1}),(null==I?void 0:I.upgradeOrNot)?(l(),n(t,{key:0,class:"model-title ss-flex ss-col-center ss-m-b-30"},{default:c((()=>[u(" 您已升级等级为"+r(null==I?void 0:I.socialStatusName),1)])),_:1})):g("",!0)])),_:1}),d(t,{class:"model-bg ss-flex-col ss-col-center ss-row-right"},{default:c((()=>[d(t,{class:"ss-m-b-40"},{default:c((()=>[d(w,{class:"ss-reset-button confirm-btn",onClick:a[2]||(a[2]=s=>R())},{default:c((()=>[u("确认")])),_:1})])),_:1})])),_:1})])),_:1})])),_:1},8,["show"])])),_:1})}}},[["__scopeId","data-v-e644637f"]]);export{A as default};