acdr-ui/dist/build/mp-weixin/sheep/components/s-live-block/s-live-block.js

2 lines
1.9 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";var e=(e,t,o)=>new Promise(((i,a)=>{var r=e=>{try{l(o.next(e))}catch(t){a(t)}},n=e=>{try{l(o.throw(e))}catch(t){a(t)}},l=e=>e.done?i(e.value):Promise.resolve(e.value).then(r,n);l((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 i={__name:"s-live-block",props:{data:{type:Object,default(){}},styles:{type:Object,default(){}}},setup(i){var a;const r=t.reactive({liveList:[],mpLink:""}),n=i,{mode:l,goodsFields:d,mpliveIds:s}=null!=(a=n.data)?a:{};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(l)&&r.liveList.length},2===t.unref(l)&&r.liveList.length?{b:t.f(r.liveList,((e,o,a)=>{var r,n;return{a:t.o((t=>u(e.roomid)),e.id),b:"39297be1-0-"+a,c:t.p({size:"md",goodsFields:t.unref(d),data:e,titleColor:null==(r=t.unref(d).name)?void 0:r.color,subTitleColor:null==(n=t.unref(d).anchor_name)?void 0:n.color,topRadius:i.data.borderRadiusTop,bottomRadius:i.data.borderRadiusBottom}),d:e.id}})),c:t.s({padding:i.data.space+"rpx"}),d:t.s({margin:"-"+i.data.space+"rpx"})}:{},{e:1===t.unref(l)&&r.liveList.length},1===t.unref(l)&&r.liveList.length?{f:t.f(r.liveList,((e,o,a)=>{var r;return{a:t.o((t=>u(e.roomid)),e.id),b:"39297be1-1-"+a,c:t.p({size:"sl",goodsFields:t.unref(d),data:e,titleColor:null==(r=t.unref(d).name)?void 0:r.color,subTitleColor:t.unref(d).anchor_name.color,topRadius:i.data.borderRadiusTop,bottomRadius:i.data.borderRadiusBottom}),d:e.id}})),g:t.s({marginBottom:i.data.space+"px"})}:{})}},a=t._export_sfc(i,[["__scopeId","data-v-39297be1"]]);wx.createComponent(a);