acdr-ui/dist/build/mp-weixin/modules/pet/certification/index.js
2024-10-01 09:15:35 +08:00

2 lines
2.3 KiB
JavaScript

"use strict";var e=(e,t,r)=>new Promise(((o,i)=>{var n=e=>{try{u(r.next(e))}catch(t){i(t)}},s=e=>{try{u(r.throw(e))}catch(t){i(t)}},u=e=>e.done?o(e.value):Promise.resolve(e.value).then(n,s);u((r=r.apply(e,t)).next())}));const t=require("../../../common/vendor.js");require("../../../store/index.js");const r=require("../../../utils/http.js"),o=require("../../../utils/commUtils.js"),i=require("../../../service/userService.js"),n=require("../../../store/user.js");if(!Array){(t.resolveComponent("wd-popup")+t.resolveComponent("layout-default-uni"))()}Math||(s+u+(()=>"../../../node-modules/wot-design-uni/components/wd-popup/wd-popup.js"))();const s=()=>"../../../components/TopBar.js",u=()=>"./components/certPopup.js",a={__name:"index",setup(s){const u=n.useUserStore(),a=t.ref({}),c=t.ref(!u.userInfo.isPetNursery&&!1),l=t.ref(!1),p=t.ref(""),f=()=>{c.value=!1,t.index.navigateBack()},d=()=>{c.value=!1},v=()=>e(this,null,(function*(){const e=yield r.httpGet("/petInfo/getExpertInfo");if(200==e.code)a.value=e.data,u.userInfo.isPetNursery||(yield i.getUserInfo());else{const e=yield r.httpGet("/petInfo/getApplyState");if(200==e.code&&(l.value=!0,p.value=e.data,"已通过"==e.data)){if((yield i.getUserInfo()).isPetNursery){const e=yield r.httpGet("/petInfo/getExpertInfo");200==e.code&&(a.value=e.data)}}}})),m=e=>new Date(e).toLocaleDateString();t.onLoad((()=>e(this,null,(function*(){yield v()}))));const g=()=>{t.index.navigateTo({url:"/modules/pet/certification/pet-sitter"})};return(e,r)=>t.e({a:t.unref(o.imgUrl)("@/static/certification/certification_bg.png"),b:!l.value||t.unref(u).userInfo.isPetNursery},!l.value||t.unref(u).userInfo.isPetNursery?t.e({c:!t.unref(u).userInfo.isPetNursery},t.unref(u).userInfo.isPetNursery?{j:t.unref(o.imgUrl)("@/static/certification/cert.png"),k:t.t(a.value.cardId),l:t.t(a.value.type||"宠托师"),m:t.t(a.value.serviceNumber),n:t.t(m(a.value.createTime)),o:t.t(m(a.value.expiredTime)),p:t.t(m(a.value.updateTime))}:{d:t.unref(o.imgUrl)("@/static/certification/wy.png"),e:t.o(g),f:t.unref(o.imgUrl)("@/static/certification/wyl.png"),g:t.o(g),h:t.unref(o.imgUrl)("@/static/certification/mr.png"),i:t.o(g)}):{q:t.t(p.value)},{r:t.o(d),s:t.o(f),t:t.o((e=>c.value=e)),v:t.p({"close-on-click-modal":!1,position:"center",modelValue:c.value})})}},c=t._export_sfc(a,[["__scopeId","data-v-620636d0"]]);wx.createPage(c);