2 lines
2.8 KiB
JavaScript
2 lines
2.8 KiB
JavaScript
|
"use strict";var e=(e,t,a)=>new Promise(((s,n)=>{var o=e=>{try{c(a.next(e))}catch(t){n(t)}},r=e=>{try{c(a.throw(e))}catch(t){n(t)}},c=e=>e.done?s(e.value):Promise.resolve(e.value).then(o,r);c((a=a.apply(e,t)).next())}));const t=require("../../../common/vendor.js"),a=require("../../../utils/http.js"),s=require("../../../utils/commUtils.js");if(!Array){(t.resolveComponent("wd-icon")+t.resolveComponent("wd-img")+t.resolveComponent("layout-default-uni"))()}Math||((()=>"../../../node-modules/wot-design-uni/components/wd-icon/wd-icon.js")+(()=>"../../../node-modules/wot-design-uni/components/wd-img/wd-img.js")+n+o)();const n=()=>"./components/UserPost.js",o=()=>"../../../components/Tabbar.js",r={__name:"index",setup(n){const o=t.ref(["推荐","关注"]),r=t.ref(0),c=t.ref([]),i=t.ref(null);t.ref({name:"王小样",avatar:"/static/my/pet-auatar.jpg",location:"不拉多尔-泡芙"}),t.ref({time:"1分钟前",images:["/static/my/pet-auatar.jpg","/static/my/pet-auatar-2.jpg","/static/my/pet-auatar.jpg","/static/my/pet-auatar-2.jpg","/static/my/pet-auatar.jpg"],content:"狗狗是人类的最好的朋友,它们忠诚可靠,守护着他们的主人不离不弃。甚至,比生命更为重要。",likes:289,comments:36,shares:14});const l=()=>e(this,null,(function*(){try{const e=yield a.httpGet("/posts/followed-users");200==e.code?c.value=e.data:s.toast(e.message||"数据获取失败")}catch(e){s.toast(e.data.message||"获取关注博主数据失败")}})),u=()=>e(this,null,(function*(){try{const e=yield a.httpGet("/posts/list");200==e.code?i.value=e.data:s.toast(e.message||"数据获取失败")}catch(e){s.toast(e.data.message||"获取关注博主数据失败")}})),p=()=>{},m=()=>{},d=()=>{t.index.navigateTo({url:"/modules/pet/push/share"})};return t.onLoad((()=>e(this,null,(function*(){yield l(),yield u()})))),(e,a)=>t.e({a:t.unref(s.imgUrl)("@/static/space/bg.png"),b:t.unref(s.imgUrl)("@/static/space/ai-space-button.png"),c:t.p({name:"arrow-right"}),d:t.o((e=>{return a="/modules/pet/ai/ai-interactive-space",void t.index.navigateTo({url:a});var a})),e:t.o(p),f:t.unref(s.imgUrl)("@/static/space/doctor.png"),g:t.o(p),h:t.unref(s.imgUrl)("@/static/space/talent.png"),i:t.unref(s.imgUrl)("@/static/space/calendar-number.png"),j:t.unref(s.imgUrl)("@/static/space/calendar.png"),k:t.f(o.value,((e,a,s)=>t.e({a:t.t(e),b:r.value===a},(r.value,{}),{c:a,d:t.n({active:r.value===a}),e:t.o((e=>(e=>{r.value=e})(a)),a)}))),l:t.o(m),m:t.p({name:"camera"}),n:t.o(d),o:c.value.length>0},c.value.length>0?{p:t.f(c.value,((e,a,n)=>({a:"cf7e5f8a-3-"+n+",cf7e5f8a-0",b:t.p({round:!0,src:t.unref(s.imgUrl)(e.avatar)}),c:t.t(e.name),d:a})))}:{},{q:i.value},i.value?{r:t.f(i.value[0==r.value?"posts":"followedPosts"],((e,a,s)=>({a:"cf7e5f8a-4-"+s+",cf7e5f8a-0",b:t.p({post:e})})))}:{})}},c=t._export_sfc(r,[["__scopeId","data-v-cf7e5f8a"]]);wx.createPage(c);
|