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

1 line
4.6 KiB
Plaintext
Raw Normal View History

2024-09-19 07:20:14 +08:00
{"version":3,"file":"s-live-block.js","sources":["../../../../../../src/sheep/components/s-live-block/s-live-block.vue","../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy9zaGVlcC9jb21wb25lbnRzL3MtbGl2ZS1ibG9jay9zLWxpdmUtYmxvY2sudnVl"],"sourcesContent":["<template>\r\n <view>\r\n <view\r\n v-if=\"mode === 2 && state.liveList.length\"\r\n class=\"goods-md-wrap ss-flex ss-flex-wrap ss-col-top\"\r\n :style=\"[{ margin: '-' + data.space + 'rpx' }]\"\r\n >\r\n <view\r\n :style=\"[\r\n {\r\n padding: data.space + 'rpx',\r\n },\r\n ]\"\r\n class=\"goods-list-box\"\r\n v-for=\"item in state.liveList\"\r\n :key=\"item.id\"\r\n >\r\n <s-live-card\r\n class=\"goods-md-box\"\r\n size=\"md\"\r\n :goodsFields=\"goodsFields\"\r\n :data=\"item\"\r\n :titleColor=\"goodsFields.name?.color\"\r\n :subTitleColor=\"goodsFields.anchor_name?.color\"\r\n :topRadius=\"data.borderRadiusTop\"\r\n :bottomRadius=\"data.borderRadiusBottom\"\r\n @click=\"goRoom(item.roomid)\"\r\n ></s-live-card>\r\n </view>\r\n </view>\r\n <view v-if=\"mode === 1 && state.liveList.length\" class=\"goods-lg-box\">\r\n <view\r\n class=\"goods-box\"\r\n :style=\"[{ marginBottom: data.space + 'px' }]\"\r\n v-for=\"item in state.liveList\"\r\n :key=\"item.id\"\r\n >\r\n <s-live-card\r\n class=\"goods-card\"\r\n size=\"sl\"\r\n :goodsFields=\"goodsFields\"\r\n :data=\"item\"\r\n :titleColor=\"goodsFields.name?.color\"\r\n :subTitleColor=\"goodsFields.anchor_name.color\"\r\n :topRadius=\"data.borderRadiusTop\"\r\n :bottomRadius=\"data.borderRadiusBottom\"\r\n @tap=\"goRoom(item.roomid)\"\r\n ></s-live-card>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n<script setup>\r\nimport { reactive, onMounted } from 'vue'\r\nimport sheep from '@/sheep'\r\n\r\nconst state = reactive({\r\n liveList: [],\r\n mpLink: '',\r\n})\r\nconst props = defineProps({\r\n data: {\r\n type: Object,\r\n default() {},\r\n },\r\n styles: {\r\n type: Object,\r\n default() {},\r\n },\r\n})\r\nconst { mode, goodsFields, mpliveIds } = props.data ?? {}\r\nconst { marginLeft, marginRight } = props.styles ?? {}\r\n\r\nasync function getLiveListByIds(ids) {\r\n const { data } = await sheep.$api.app.mplive.getRoomList(ids)\r\n return data\r\n}\r\nfunction goRoom(id) {\r\n // #ifdef MP-WEIXIN\r\n uni.navigateTo({\r\n url: `plugin-private://wx2b03c6e691cd7370/modules/mall/live-player-plugin?room_id=${id}`,\r\n })\r\n // #endif\r\n\r\n // #ifndef MP-WEIXIN\r\n uni.showModal({\r\n title: '提示',\r\n confirmText: '允许',\r\n content: '将打开小程序访问',\r\n success: async function (res) {\r\n if (res.confirm) {\r\n getMpLink()\r\n }\r\n },\r\n })\r\n // #endif\r\n}\r\n\r\nfunction goMpLink() {\r\n // #ifdef H5\r\n window.location = state.mpLink\r\n // #endif\r\n // #ifdef APP-PLUS\r\n plus.runtime.openURL(state.mpLink)\r\n // #endif\r\n}\r\n\r\nasync function getMpLink() {\r\n // #ifndef MP-WEIXIN\r\n if (state.mpLink === '') {\r\n const { error, data } = await sheep.$api.app.mplive.getMpLink()\r\n if (error === 0) {\r\n state.mpLink = data\r\n }\r\n }\r\n goMpLink()\r\n // #endif\r\n}\r\n\r\nonMounted(async () => {\r\n state.liveList = await getLiveListByIds(mpliveIds)\r\n})\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n \r\n.goods-list-box {\r\n box-sizing: border-box;\r\n flex-shrink: 0;\r\n width: 50%;\r\n overflow: hidden;\r\n}\r\n\r\n.goods-box {\r\n &:nth-last-of-type(1) {\r\n margin-bottom: 0 !important;\r\n }\r\n}\r\n\r\n.goods-md-box,\r\n.goods-sl-box {\r\n position: relative;\r\n}\r\n</style>\r\n","import Component from 'D:/App/Work/addr/acdr-ui/src/sheep/components/s-live-block/s-live-block.vue'\nwx.createComponent(Component)"],"n