acdr-ui/dist/build/mp-weixin/modules/mall/sheep/components/s-live-block/s-live-block.js
2024-10-01 09:15:35 +08:00

2 lines
1.9 KiB
JavaScript

"use strict";var e=(e,t,o)=>new Promise(((a,i)=>{var r=e=>{try{d(o.next(e))}catch(t){i(t)}},n=e=>{try{d(o.throw(e))}catch(t){i(t)}},d=e=>e.done?a(e.value):Promise.resolve(e.value).then(r,n);d((o=o.apply(e,t)).next())}));const t=require("../../../../../common/vendor.js"),o=require("../../index.js");if(!Array){t.resolveComponent("s-live-card")()}Math;const a={__name:"s-live-block",props:{data:{type:Object,default(){}},styles:{type:Object,default(){}}},setup(a){var i;const r=t.reactive({liveList:[],mpLink:""}),n=a,{mode:d,goodsFields:l,mpliveIds:s}=null!=(i=n.data)?i:{};function u(e){t.index.navigateTo({url:`plugin-private://wx2b03c6e691cd7370/modules/mall/live-player-plugin?room_id=${e}`})}return n.styles,t.onMounted((()=>e(this,null,(function*(){r.liveList=yield function(t){return e(this,null,(function*(){const{data:e}=yield o.sheep.$api.app.mplive.getRoomList(t);return e}))}(s)})))),(e,o)=>t.e({a:2===t.unref(d)&&r.liveList.length},2===t.unref(d)&&r.liveList.length?{b:t.f(r.liveList,((e,o,i)=>{var r,n;return{a:t.o((t=>u(e.roomid)),e.id),b:"d2835a00-0-"+i,c:t.p({size:"md",goodsFields:t.unref(l),data:e,titleColor:null==(r=t.unref(l).name)?void 0:r.color,subTitleColor:null==(n=t.unref(l).anchor_name)?void 0:n.color,topRadius:a.data.borderRadiusTop,bottomRadius:a.data.borderRadiusBottom}),d:e.id}})),c:t.s({padding:a.data.space+"rpx"}),d:t.s({margin:"-"+a.data.space+"rpx"})}:{},{e:1===t.unref(d)&&r.liveList.length},1===t.unref(d)&&r.liveList.length?{f:t.f(r.liveList,((e,o,i)=>{var r;return{a:t.o((t=>u(e.roomid)),e.id),b:"d2835a00-1-"+i,c:t.p({size:"sl",goodsFields:t.unref(l),data:e,titleColor:null==(r=t.unref(l).name)?void 0:r.color,subTitleColor:t.unref(l).anchor_name.color,topRadius:a.data.borderRadiusTop,bottomRadius:a.data.borderRadiusBottom}),d:e.id}})),g:t.s({marginBottom:a.data.space+"px"})}:{})}},i=t._export_sfc(a,[["__scopeId","data-v-d2835a00"]]);wx.createComponent(i);