Commit 032911d8 by cwq0219

分享

1 parent 3a1ca9d4
......@@ -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 => {
params.method = `${defaultPath}insert.live.room`
return http({
......@@ -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 @@
<el-button v-if="scope.scope.liveStatus != '101'" type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
</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="flex">
<div class="flex box poster">
<div>
<p>直播间分享海报</p>
<p>小程序码不带参数</p>
<el-button :size="size">保存图片</el-button>
<p class="share-txt">海报</p>
<!-- <p>小程序码不带参数</p> -->
<el-button :size="size" type="primary">保存图片</el-button>
</div>
<img src="https://img0.baidu.com/it/u=2322199322,1491298297&fm=26&fmt=auto" />
<img :src="shareForm.posterUrl" />
</div>
<div class="flex box poster">
<div>
<p>直播间小程序码</p>
<p>小程序码不带参数</p>
<el-button :size="size">保存图片</el-button>
<p class="share-txt">小程序码</p>
<!-- <p>小程序码不带参数</p> -->
<el-button :size="size" type="primary">保存图片</el-button>
</div>
<img src="https://img0.baidu.com/it/u=2322199322,1491298297&fm=26&fmt=auto" />
<img :src="shareForm.cdnUrl" />
</div>
</div>
<div class="box page-route">
<div>
<p>直播间页面路径</p>
<p>www</p>
<el-button :size="size">复制链接</el-button>
<p>链接是直播间原始页面路径,如需加入参数,详见使用方法</p>
<p class="route-txt">短链</p>
<div class="flex">
<p style="width: 426px;">{{shareForm.pagePath}}</p>
<el-button :size="size" type="primary" @click="handleSaveTxt(shareForm.pagePath)">复制链接</el-button>
<!-- <p>链接是直播间原始页面路径,如需加入参数,详见使用方法</p> -->
</div>
</div>
</div>
</div>
......@@ -66,7 +68,7 @@
<script>
import glsxDialog from '@/components/glsx-dialog'
// 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'
export default {
name: 'liveRoom',
......@@ -77,6 +79,7 @@ export default {
name: ''
},
// 分享 - 弹窗
shareForm: {},
isShareVisible: false,
noCancel: true,
// 表格组件
......@@ -147,10 +150,27 @@ export default {
})
},
handleShare(row) {
this.isShareVisible = !this.isShareVisible
getLiveShareApi({ id: row.id }).then(res => {
console.log(res)
this.isShareVisible = !this.isShareVisible
this.shareForm = res
})
},
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) {
this.$router.push({
......@@ -217,11 +237,19 @@ export default {
padding: 30px;
}
.live-room .share-dialog .poster img {
width: 100px;
height: 150px;
margin-left: 10px;
width: 150px;
height: 240px;
margin-left: 45px;
}
.live-room .share-dialog .page-route {
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>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!