直播修改

This commit is contained in:
luyuan 2020-07-30 08:46:35 +08:00
parent 74fbd629d6
commit 519ec0abe8
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
2 changed files with 43 additions and 30 deletions

View File

@ -28,7 +28,7 @@
<!-- 标签的引入 -->
<tap_tosign :fileListes="fileListes" @chuangjian="chuangjian" @qiehuan="qiehuan"></tap_tosign>
<view class="titles">直播封面图</view>
<u-upload :form-data="{'name':'article_cover'}" action='https://dmmall.sdbairui.com/storeapi/Upload/uploadFile' name="article_cover" :max-count="1" :show-progress="false" @on-change="tupian" del-color="#ececec" upload-text="上传" del-bg-color="#fff"></u-upload>
<u-upload :form-data="{'name':'article_cover'}" action='https://dmmall.sdbairui.com/storeapi/Upload/uploadFile' name="article_cover" :header="{'Authorization' : 'Bearer' + ' ' + token}" :max-count="1" :show-progress="false" @on-change="tupian" del-color="#ececec" upload-text="上传" del-bg-color="#fff"></u-upload>
</view>
<view class="button-uview">
<u-button @click="kaibo">{{relerest}}</u-button>
@ -60,7 +60,8 @@
relerest: '开始直播',
fileListes:[],
rSelect:[],
image:""
image:"",
token:""
};
},
methods: {
@ -90,7 +91,7 @@
this.init()
},
tupian(a){
console.log(JSON.parse(a.data).data)
console.log(JSON.parse(a.data))
this.image = JSON.parse(a.data).data.file_name
},
navto(url){
@ -137,6 +138,14 @@
onLoad(){
this.init()
uni.removeStorageSync('gouwudai')
//
this.token = uni.getStorageSync('token');
var config = {
appkey: 'mgb7ka1',
debug:true
};
}
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<div>
<live-pusher id='livePusher' ref="livePusher" class="livePusher" :url="url"
mode="SD" :muted="true" :enable-camera="true" :auto-focus="true" :beauty="1" whiteness="2"
mode="SD" :muted="false" :enable-camera="true" :auto-focus="true" :beauty="1" whiteness="2"
aspect="9:16" @statechange="statechange" @netstatus="netstatus" @error = "error"
:style="{'height':height + 'px'}"
></live-pusher>
@ -166,7 +166,7 @@
}
</style>
<script>
const RongIMLib = require('../../static/rongyun.js');
const RongIMLib = require('../../static/rongyun.js');
export default {
data: {
fil: true,
@ -195,28 +195,29 @@ const RongIMLib = require('../../static/rongyun.js');
this.url = a.url.replace("*","&")
let that = this
const token = uni.getStorageSync('token');
uni.request({
url:"https://dmmall.sdbairui.com//storeapi/Streaming/liveStreamList",
method:"POST",
headers:{
'Authorization' : 'Bearer' + " " + token
},
success(res){
console.log(res)
that.list= res.data.data
}
})
uni.request({
url:"https://dmmall.sdbairui.com/storeapi/member/memberInfo",
method:"POST",
headers:{
'Authorization' : 'Bearer' + " " + token
},
success(res){
console.log(res.data.data.memberInfo)
that.info = res.data.data.memberInfo
}
})
console.log('Bearer' + " " + token)
// uni.request({
// url:"https://dmmall.sdbairui.com/storeapi/Streaming/liveStreamList",
// method:"POST",
// headers:{
// 'Authorization' : 'Bearer' + " " + token
// },
// success(res){
// console.log(res)
// that.list= res.data.data
// }
// })
// uni.request({
// url:"https://dmmall.sdbairui.com/storeapi/member/memberInfo",
// method:"POST",
// headers:{
// 'Authorization' : 'Bearer' + " " + token
// },
// success(res){
// console.log(res.data.data.memberInfo)
// that.info = res.data.data.memberInfo
// }
// })
var config = {
appkey: 'mgb7ka1',
debug:true
@ -244,19 +245,22 @@ const RongIMLib = require('../../static/rongyun.js');
var user = {
token: uni.getStorageSync('rongyun')
};
console.log(user,123)
im.connect(user).then(function(user) {
console.log('链接成功, 链接用户 id 为: ', user.id);
}).catch(function(error) {
console.log('链接失败: ', error.code, error.msg);
console.log('链接失败: ', error.code, error);
});
var chatRoom = im.ChatRoom.get({
id: a.id
});
})
chatRoom.join({
count: 20 // 进入后, 自动拉取 20 条聊天室最新消息
}).then(function() {
console.log('加入聊天室成功');
});
}).catch((err)=>{
console.log(err,262)
})
},
methods: {
statechange(e) {