Commit 032911d8 by cwq0219

分享

1 parent 3a1ca9d4
...@@ -12,6 +12,16 @@ const getLiveRoomListApi = params => { ...@@ -12,6 +12,16 @@ const getLiveRoomListApi = params => {
}) })
} }
const getLiveShareApi = params => {
params.method = `${defaultPath}get.shared.code`
return http({
url: 'rop-scrm-live/router',
method: 'GET',
data: params,
sign: true
})
}
const insertLiveRoomApi = params => { const insertLiveRoomApi = params => {
params.method = `${defaultPath}insert.live.room` params.method = `${defaultPath}insert.live.room`
return http({ return http({
...@@ -129,4 +139,4 @@ const controlDeleteApi = params => { ...@@ -129,4 +139,4 @@ const controlDeleteApi = params => {
}) })
} }
export { getLiveRoomListApi, insertLiveRoomApi, deleteLiveRoomApi, getLiveRoomInfoApi, getControlInfoApi, getControlImportListApi, getWaitImportListApi, importGoodsApi, updateCommentApi, updateReplayApi, controlUpOrDownApi, controlDeleteApi } export { getLiveRoomListApi, getLiveShareApi, insertLiveRoomApi, deleteLiveRoomApi, getLiveRoomInfoApi, getControlInfoApi, getControlImportListApi, getWaitImportListApi, importGoodsApi, updateCommentApi, updateReplayApi, controlUpOrDownApi, controlDeleteApi }
...@@ -29,32 +29,34 @@ ...@@ -29,32 +29,34 @@
<el-button v-if="scope.scope.liveStatus != '101'" type="text" @click="handleDelete(scope.scope)">删除</el-button> <el-button v-if="scope.scope.liveStatus != '101'" type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span> </span>
</GLTable> </GLTable>
<glsx-dialog title="分享" width="620px" :isVisible="isShareVisible" :noCancel="noCancel" @closeDialog="handleShareClose" @confirmDialog="handleShareClose"> <glsx-dialog title="分享" width="730px" :isVisible="isShareVisible" :noCancel="noCancel" @closeDialog="handleShareClose" @confirmDialog="handleShareClose">
<div class="share-dialog"> <div class="share-dialog">
<div class="flex"> <div class="flex">
<div class="flex box poster"> <div class="flex box poster">
<div> <div>
<p>直播间分享海报</p> <p class="share-txt">海报</p>
<p>小程序码不带参数</p> <!-- <p>小程序码不带参数</p> -->
<el-button :size="size">保存图片</el-button> <el-button :size="size" type="primary">保存图片</el-button>
</div> </div>
<img src="https://img0.baidu.com/it/u=2322199322,1491298297&fm=26&fmt=auto" /> <img :src="shareForm.posterUrl" />
</div> </div>
<div class="flex box poster"> <div class="flex box poster">
<div> <div>
<p>直播间小程序码</p> <p class="share-txt">小程序码</p>
<p>小程序码不带参数</p> <!-- <p>小程序码不带参数</p> -->
<el-button :size="size">保存图片</el-button> <el-button :size="size" type="primary">保存图片</el-button>
</div> </div>
<img src="https://img0.baidu.com/it/u=2322199322,1491298297&fm=26&fmt=auto" /> <img :src="shareForm.cdnUrl" />
</div> </div>
</div> </div>
<div class="box page-route"> <div class="box page-route">
<div> <div>
<p>直播间页面路径</p> <p class="route-txt">短链</p>
<p>www</p> <div class="flex">
<el-button :size="size">复制链接</el-button> <p style="width: 426px;">{{shareForm.pagePath}}</p>
<p>链接是直播间原始页面路径,如需加入参数,详见使用方法</p> <el-button :size="size" type="primary" @click="handleSaveTxt(shareForm.pagePath)">复制链接</el-button>
<!-- <p>链接是直播间原始页面路径,如需加入参数,详见使用方法</p> -->
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -66,7 +68,7 @@ ...@@ -66,7 +68,7 @@
<script> <script>
import glsxDialog from '@/components/glsx-dialog' import glsxDialog from '@/components/glsx-dialog'
// import glsxTable from '@/components/glsx-table' // import glsxTable from '@/components/glsx-table'
import { getLiveRoomListApi, deleteLiveRoomApi } from '@/api/modules/liveRoom' import { getLiveRoomListApi, getLiveShareApi, deleteLiveRoomApi } from '@/api/modules/liveRoom'
import { liveStatusList } from '@/common/constant' import { liveStatusList } from '@/common/constant'
export default { export default {
name: 'liveRoom', name: 'liveRoom',
...@@ -77,6 +79,7 @@ export default { ...@@ -77,6 +79,7 @@ export default {
name: '' name: ''
}, },
// 分享 - 弹窗 // 分享 - 弹窗
shareForm: {},
isShareVisible: false, isShareVisible: false,
noCancel: true, noCancel: true,
// 表格组件 // 表格组件
...@@ -147,10 +150,27 @@ export default { ...@@ -147,10 +150,27 @@ export default {
}) })
}, },
handleShare(row) { handleShare(row) {
getLiveShareApi({ id: row.id }).then(res => {
console.log(res)
this.isShareVisible = !this.isShareVisible this.isShareVisible = !this.isShareVisible
this.shareForm = res
})
}, },
handleShareClose() { handleShareClose() {
this.handleShare() // this.handleShare()
this.isShareVisible = !this.isShareVisible
},
handleSaveTxt(txt) {
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('value', txt)
input.select()
document.execCommand('Copy')
document.body.removeChild(input)
this.$message({
message: '复制成功',
type: 'success'
})
}, },
handleDetail(row) { handleDetail(row) {
this.$router.push({ this.$router.push({
...@@ -217,11 +237,19 @@ export default { ...@@ -217,11 +237,19 @@ export default {
padding: 30px; padding: 30px;
} }
.live-room .share-dialog .poster img { .live-room .share-dialog .poster img {
width: 100px; width: 150px;
height: 150px; height: 240px;
margin-left: 10px; margin-left: 45px;
} }
.live-room .share-dialog .page-route { .live-room .share-dialog .page-route {
margin-top: 16px; margin-top: 16px;
} }
.live-room .share-dialog .page-route .route-txt {
font-weight: bold;
padding-bottom: 10px;
}
.live-room .share-dialog .share-txt {
font-weight: bold;
margin-bottom: 50px;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!