Merge pull request '添加了开始直播' (#80) from xbx into master

Reviewed-on: http://git.luyuan.tk/luyuan/beelink/pulls/80
This commit is contained in:
luyuan 2020-10-26 11:11:14 +08:00
commit 662521ea33
2 changed files with 26 additions and 3 deletions

View File

@ -943,4 +943,13 @@ export async function feedback(text: string) {
}else{
message.error(res.msg)
}
}
}
export async function livestart(id: string) {
const res = await put("live/" + id, {status : 1})
if(res.code == 0){
message.success(res.msg)
}else{
message.error(res.msg)
}
}

View File

@ -20,9 +20,15 @@
<span class="score">5.0</span>
</div>
</div>
<div class="right" @click="bianji">
<div style="display: flex">
<div class="right" @click="bianji">
编辑信息
</div>
<div class="right" @click="kaishi">
开始直播
</div>
</div>
</div>
</div>
</template>
@ -77,6 +83,7 @@
}
</style>
<script lang="ts">
import { livestart } from '@/api';
import router from '@/router';
import { defineComponent, ref } from "vue";
@ -91,9 +98,16 @@ export default defineComponent({
router.push("/mine/webcast?id=" + props.info.liveid)
}
}
// todo
function kaishi(){
if(props.info != undefined){
livestart(props.info.liveid)
}
}
// const liveinfo = ref(props.liveinfo)
return {
bianji
bianji,
kaishi
}
},
});