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

2 lines
2.8 KiB
JavaScript

"use strict";var e=(e,a,t)=>new Promise(((s,n)=>{var o=e=>{try{i(t.next(e))}catch(a){n(a)}},r=e=>{try{i(t.throw(e))}catch(a){n(a)}},i=e=>e.done?s(e.value):Promise.resolve(e.value).then(o,r);i((t=t.apply(e,a)).next())}));const a=require("../../common/vendor.js"),t=require("../../utils/http.js"),s=require("../../utils/commUtils.js");if(!Array){(a.resolveComponent("wd-icon")+a.resolveComponent("wd-img")+a.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=a.ref(["推荐","关注"]),r=a.ref(0),i=a.ref([]),c=a.ref(null);a.ref({name:"王小样",avatar:"/static/my/pet-auatar.jpg",location:"不拉多尔-泡芙"}),a.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 t.httpGet("/posts/followed-users");200==e.code?i.value=e.data:s.toast(e.message||"数据获取失败")}catch(e){s.toast(e.data.message||"获取关注博主数据失败")}})),u=()=>e(this,null,(function*(){try{const e=yield t.httpGet("/posts/list");200==e.code?c.value=e.data:s.toast(e.message||"数据获取失败")}catch(e){s.toast(e.data.message||"获取关注博主数据失败")}})),p=()=>{},m=()=>{},d=()=>{a.index.navigateTo({url:"/pages/push/share"})};return a.onLoad((()=>e(this,null,(function*(){yield l(),yield u()})))),(e,t)=>a.e({a:a.unref(s.imgUrl)("@/static/space/bg.png"),b:a.unref(s.imgUrl)("@/static/space/ai-space-button.png"),c:a.p({name:"arrow-right"}),d:a.o((e=>{return t="/pages/ai/ai-interactive-space",void a.index.navigateTo({url:t});var t})),e:a.o(p),f:a.unref(s.imgUrl)("@/static/space/doctor.png"),g:a.o(p),h:a.unref(s.imgUrl)("@/static/space/talent.png"),i:a.unref(s.imgUrl)("@/static/space/calendar-number.png"),j:a.unref(s.imgUrl)("@/static/space/calendar.png"),k:a.f(o.value,((e,t,s)=>a.e({a:a.t(e),b:r.value===t},(r.value,{}),{c:t,d:a.n({active:r.value===t}),e:a.o((e=>(e=>{r.value=e})(t)),t)}))),l:a.o(m),m:a.p({name:"camera"}),n:a.o(d),o:i.value.length>0},i.value.length>0?{p:a.f(i.value,((e,t,n)=>({a:"4111aa64-3-"+n+",4111aa64-0",b:a.p({round:!0,src:a.unref(s.imgUrl)(e.avatar)}),c:a.t(e.name),d:t})))}:{},{q:c.value},c.value?{r:a.f(c.value[0==r.value?"posts":"followedPosts"],((e,t,s)=>({a:"4111aa64-4-"+s+",4111aa64-0",b:a.p({post:e})})))}:{})}},i=a._export_sfc(r,[["__scopeId","data-v-4111aa64"]]);wx.createPage(i);