acdr-ui/dist/build/mp-weixin/pages/my/index.js

2 lines
4.1 KiB
JavaScript

"use strict";var e=Object.defineProperty,t=Object.defineProperties,a=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,i=(t,a,r)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[a]=r,s=(e,t,a)=>new Promise(((r,n)=>{var o=e=>{try{s(a.next(e))}catch(t){n(t)}},i=e=>{try{s(a.throw(e))}catch(t){n(t)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,i);s((a=a.apply(e,t)).next())}));const c=require("../../common/vendor.js"),l=require("../../store/user.js"),d=require("../../utils/commUtils.js"),p=require("../../utils/http.js");if(!Array){(c.resolveComponent("wd-img")+c.resolveComponent("w-avatar")+c.resolveComponent("wd-icon")+c.resolveComponent("layout-default-uni"))()}Math||((()=>"../../node-modules/wot-design-uni/components/wd-img/wd-img.js")+(()=>"../../node-modules/wot-design-uni/components/wd-icon/wd-icon.js")+u)();const u=()=>"../../components/Tabbar.js",g={__name:"index",setup(e){const u=l.useUserStore(),g=u.userInfo,m=c.ref([{number:0,label:"粉丝"},{number:0,label:"关注"},{number:0,label:"收藏"},{number:0,label:"获赞"}]),b=[{icon:"@/static/my/order.png",label:"我的订单",path:"/pages/order/index"},{icon:"@/static/my/pet.png",label:"我的服务",path:"/pages/service/my-service"},{icon:"@/static/my/wash.png",label:"我的评价",path:"/pages/order/index"},{icon:"@/static/my/service.png",label:"售后服务",path:"/pages/order/index"}],f=c.ref([]);c.onShow((()=>s(this,null,(function*(){yield h(),yield y()}))));const h=()=>s(this,null,(function*(){try{const e=yield p.httpGet("/posts/community");if(200==e.code){const t=0;for(const a in e.data)e.data[a]&&(m.value[t]={number:e.data[a],label:a})}}catch(e){}})),y=()=>s(this,null,(function*(){try{const e=yield p.httpGet("/petInfo/select",{userId:u.userInfo.id});f.value=e.records.map((e=>{return s=((e,t)=>{for(var a in t||(t={}))n.call(t,a)&&i(e,a,t[a]);if(r)for(var a of r(t))o.call(t,a)&&i(e,a,t[a]);return e})({},e),c={icon:d.baseUrl+e.profileUrl},t(s,a(c));var s,c}))}catch(e){c.index.showToast({title:"网络错误,请重试",icon:"error"})}})),v=[{icon:"@/static/my/send.png",label:"我的发布",to:"/pages/publish/index"},{icon:"@/static/my/handshake.png",label:"帮助中心",to:"/pages/others/official-account"},{icon:"@/static/my/feedback.png",label:"建议反馈",to:"/pages/others/official-account"},{icon:"@/static/my/badge.png",label:"宠托师认证",to:"/pages/certification/index"},{icon:"@/static/my/address.png",label:"我的地址",to:"/pages/address/index"},{icon:"@/static/my/settings.png",label:"设置",to:"/pages/settings/index"},{icon:"@/static/my/address.png",label:"地址",to:"/pages/map/index"}],w=e=>{c.index.navigateTo({url:e})};return(e,t)=>c.e({a:`url(${c.unref(d.imgUrl)("@/static/my/my-bg.png")})`,b:c.unref(d.imgUrl)("@/static/my/cat-dog.png"),c:c.p({width:100,height:100,round:!0,mode:"aspectFill",src:""==c.unref(g).avatar?c.unref(d.imgUrl)("@/static/my/avatar.jpg"):c.unref(d.imgUrl)(c.unref(g).avatar)}),d:c.t(c.unref(g).nickname),e:c.f(m.value,((e,t,a)=>({a:c.t(e.number),b:c.t(e.label),c:t}))),f:c.f(b,((e,t,a)=>c.e({a:"我的服务"==e.label},"我的服务"==e.label?{b:"7122a8c9-2-"+a+",7122a8c9-0",c:c.p({width:42,height:40,src:c.unref(d.imgUrl)(e.icon)})}:{d:"7122a8c9-3-"+a+",7122a8c9-0",e:c.p({width:38,height:40,src:c.unref(d.imgUrl)(e.icon)})},{f:c.t(e.label),g:c.o((t=>w(e.path)),t),h:t}))),g:c.unref(g).isPetNursery},c.unref(g).isPetNursery?{h:c.o((e=>w("/pages/order/take")))}:{},{i:c.f(f.value,((e,t,a)=>({a:"7122a8c9-4-"+a+",7122a8c9-0",b:c.p({width:60,height:60,round:!0,src:e.icon}),c:c.t(e.name),d:c.o((t=>(e=>{c.index.navigateTo({url:`/pages/pet/pet-add-page?id=${e.id}&name=${e.name}&icon=${e.icon}&breed=${e.breed}&color=${e.color}&birthday=${e.birthday}&gender=${e.gender}&userId=${e.userId}`})})(e)),t),e:t}))),j:c.p({size:80}),k:c.o((e=>w("/pages/pet/pet-add-page"))),l:c.f(v,((e,t,a)=>({a:c.unref(d.imgUrl)(e.icon),b:c.t(e.label),c:"7122a8c9-6-"+a+",7122a8c9-0",d:c.o((t=>w(e.to)),t),e:t}))),m:c.p({name:"arrow-right"})})}},m=c._export_sfc(g,[["__scopeId","data-v-7122a8c9"]]);wx.createPage(m);