From 24e5c4c50ccfa0db3b617cdef4984ffed21cf6f5 Mon Sep 17 00:00:00 2001
From: luyuan <1162963624@qq.com>
Date: Thu, 29 Oct 2020 15:46:21 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E7=9B=B4?=
=?UTF-8?q?=E6=92=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/LivePlaying.vue | 1 -
src/types/trtc-js-sdk.d.ts | 2 +
src/views/regime/Liveing.vue | 76 +++++++++++++++++++++++-----------
3 files changed, 54 insertions(+), 25 deletions(-)
diff --git a/src/components/LivePlaying.vue b/src/components/LivePlaying.vue
index 28a6bcd..1ad4d06 100644
--- a/src/components/LivePlaying.vue
+++ b/src/components/LivePlaying.vue
@@ -8,7 +8,6 @@
width: 797px;
height: 449px;
border-radius: 17px;
- background-color: #0f0;
overflow: hidden;
>video{
width: 100%;
diff --git a/src/types/trtc-js-sdk.d.ts b/src/types/trtc-js-sdk.d.ts
index 46c2043..70b0464 100644
--- a/src/types/trtc-js-sdk.d.ts
+++ b/src/types/trtc-js-sdk.d.ts
@@ -1,4 +1,6 @@
declare module 'trtc-js-sdk' {
export function createClient(info: any): any
export function createStream(info: any): any
+ export function checkSystemRequirements(): any
+ export function isScreenShareSupported(): any
}
diff --git a/src/views/regime/Liveing.vue b/src/views/regime/Liveing.vue
index 73b36e2..03c0252 100644
--- a/src/views/regime/Liveing.vue
+++ b/src/views/regime/Liveing.vue
@@ -4,7 +4,7 @@
@@ -30,8 +30,8 @@
-
-
+
+
{{item.name}}
@@ -51,11 +51,7 @@
asdsada
-->
-
+
@@ -219,11 +215,15 @@ export default defineComponent({
const roominfo = ref
([]);
console.log(useRoute())
const id = useRoute().query.id;
-
+ TRTC.checkSystemRequirements().then((result: any) => {
+ if(!result) {
+ message.error("您的浏览器不支持视频通话,请下载新版chrome浏览器")
+ }
+ })
async function qiehuan(){
// 1 屏幕分享 2 摄像头
client.unpublish(localStream)
- localStream = type ? TRTC.createStream({ userid: store.state.userinfo.memberid, audio: true, screen: true }) : TRTC.createStream({ userId: 10, audio: true, video: true });
+ localStream = type ? TRTC.createStream({ userid: store.state.userinfo.memberid, audio: true, screen: true }) : TRTC.createStream({ userId: 10, audio: false, video: true });
type = !type;
localStream.initialize().then(()=>{
client
@@ -232,10 +232,7 @@ export default defineComponent({
console.error('本地流发布失败 ' + error);
})
.then(() => {
- const el = document.querySelector("#local_stream");
- if(el){
- el.innerHTML = ""
- }
+
localStream.play('local_stream');
console.log('本地流发布成功');
});
@@ -243,21 +240,38 @@ export default defineComponent({
}
async function pingmu(){
+ const result = await TRTC.checkSystemRequirements()
+ console.log(result,11111)
+ if(!result) {
+ message.error("您的浏览器不支持屏幕分享,请下载新版chrome");
+ return ;
+ }
+
localStream = TRTC.createStream({ userid: store.state.userinfo.memberid, audio: true, screen: true });
const id = localStream.getId();
await localStream
.initialize()
.catch((error: string) => {
console.error('初始化本地流失败 ' + error);
+ message.error("请选择分享的内容")
+
+ setTimeout(()=>{
+ pingmu()
+ }, 1000)
})
.then(() => {
console.log('初始化本地流成功');
client
.publish(localStream)
.catch((error: string) => {
- console.error('本地流发布失败 ' + error);
+ console.log('本地流发布失败 ' + error);
+
})
.then(() => {
+ const el = document.querySelector("#local_stream");
+ if(el){
+ el.innerHTML = ""
+ }
localStream.play('local_stream');
console.log('本地流发布成功');
console.log(id , 123)
@@ -280,6 +294,10 @@ export default defineComponent({
console.error('本地流发布失败 ' + error);
})
.then(() => {
+ const el = document.querySelector("#local_stream");
+ if(el){
+ el.innerHTML = ""
+ }
localStream.play('local_stream');
console.log('本地流发布成功');
console.log(id, 123)
@@ -317,7 +335,7 @@ export default defineComponent({
remoteStream.play('s-' + remoteStream.userId_);
});
client
- .join({ roomId: roominfo.value.roomid })
+ .join({ roomId: 12 })
.catch((error: string) => {
console.error('进房失败 ' + error);
})
@@ -333,12 +351,16 @@ export default defineComponent({
await client.unpublish(localStream).then(() => {
// 关闭屏幕分享流
console.log("关闭")
- client.leave().then(() => {
- // leaving room success
- console.log("关闭成功")
- }).catch((error: string) => {
- console.error('leaving room failed: ' + error);
- });
+ // client.leave().then(() => {
+ // // leaving room success
+ // console.log("关闭成功")
+ // }).catch((error: string) => {
+ // console.error('leaving room failed: ' + error);
+ // });
+ const el = document.querySelector("#local_stream");
+ if(el){
+ el.innerHTML = ""
+ }
});
statie ? await shexiang() : await pingmu();
statie = !statie;
@@ -356,9 +378,15 @@ export default defineComponent({
}
onMounted(async ()=>{
- userSing = await usersig(store.state.userinfo.memberid);
+ const si = setInterval(async ()=>{
+ if(store.state.userinfo.memberid != 0 && store.state.userinfo.memberid){
+ clearInterval(si);
+ userSing = await usersig(store.state.userinfo.memberid);
+ init(pingmu, userSing);
+
+ }
+ })
- init(pingmu, userSing);
})
return{
From f6c95e9525e70f6dab9a18400ac50fdb3e07f9e4 Mon Sep 17 00:00:00 2001
From: luyuan <1162963624@qq.com>
Date: Thu, 29 Oct 2020 15:51:38 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=B9=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/regime/Liveing.vue | 81 +++++++++++++++++++-----------------
1 file changed, 42 insertions(+), 39 deletions(-)
diff --git a/src/views/regime/Liveing.vue b/src/views/regime/Liveing.vue
index 03c0252..7dd269d 100644
--- a/src/views/regime/Liveing.vue
+++ b/src/views/regime/Liveing.vue
@@ -239,45 +239,6 @@ export default defineComponent({
});
}
- async function pingmu(){
- const result = await TRTC.checkSystemRequirements()
- console.log(result,11111)
- if(!result) {
- message.error("您的浏览器不支持屏幕分享,请下载新版chrome");
- return ;
- }
-
- localStream = TRTC.createStream({ userid: store.state.userinfo.memberid, audio: true, screen: true });
- const id = localStream.getId();
- await localStream
- .initialize()
- .catch((error: string) => {
- console.error('初始化本地流失败 ' + error);
- message.error("请选择分享的内容")
-
- setTimeout(()=>{
- pingmu()
- }, 1000)
- })
- .then(() => {
- console.log('初始化本地流成功');
- client
- .publish(localStream)
- .catch((error: string) => {
- console.log('本地流发布失败 ' + error);
-
- })
- .then(() => {
- const el = document.querySelector("#local_stream");
- if(el){
- el.innerHTML = ""
- }
- localStream.play('local_stream');
- console.log('本地流发布成功');
- console.log(id , 123)
- });
- });
- }
async function shexiang(){
localStream = TRTC.createStream({ userId: store.state.userinfo.memberid, audio: true, video: true });
const id = localStream.getId();
@@ -304,6 +265,48 @@ export default defineComponent({
});
});
}
+
+ async function pingmu(){
+ const result = await TRTC.checkSystemRequirements()
+ console.log(result,11111)
+ if(!result) {
+ message.error("您的浏览器不支持屏幕分享,请下载新版chrome");
+ shexiang()
+ return ;
+ }
+
+ localStream = TRTC.createStream({ userid: store.state.userinfo.memberid, audio: true, screen: true });
+ const id = localStream.getId();
+ await localStream
+ .initialize()
+ .catch((error: string) => {
+ console.error('初始化本地流失败 ' + error);
+ message.error("请选择分享的内容")
+
+ setTimeout(()=>{
+ shexiang()
+ }, 1000)
+ })
+ .then(() => {
+ console.log('初始化本地流成功');
+ client
+ .publish(localStream)
+ .catch((error: string) => {
+ console.log('本地流发布失败 ' + error);
+
+ })
+ .then(() => {
+ const el = document.querySelector("#local_stream");
+ if(el){
+ el.innerHTML = ""
+ }
+ localStream.play('local_stream');
+ console.log('本地流发布成功');
+ console.log(id , 123)
+ });
+ });
+ }
+
async function init(fun: any, userSig: string): Promise{
console.log(userSig)
const el = document.querySelector("#local_stream");
From 98c0e6d603bfd17a6d7872efe6e01bf0679cb109 Mon Sep 17 00:00:00 2001
From: luyuan <1162963624@qq.com>
Date: Thu, 29 Oct 2020 16:42:46 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E5=88=87=E6=8D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/regime/Liveing.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/regime/Liveing.vue b/src/views/regime/Liveing.vue
index 7dd269d..123129d 100644
--- a/src/views/regime/Liveing.vue
+++ b/src/views/regime/Liveing.vue
@@ -265,7 +265,7 @@ export default defineComponent({
});
});
}
-
+
async function pingmu(){
const result = await TRTC.checkSystemRequirements()
console.log(result,11111)
@@ -284,7 +284,7 @@ export default defineComponent({
message.error("请选择分享的内容")
setTimeout(()=>{
- shexiang()
+ pingmu()
}, 1000)
})
.then(() => {
From 8d38b222d7fa0310fb3edfe8cdd1b9399451cef6 Mon Sep 17 00:00:00 2001
From: luyuan <1162963624@qq.com>
Date: Thu, 29 Oct 2020 16:58:56 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E8=B7=B3?=
=?UTF-8?q?=E8=BD=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/mine/Cashout.vue | 18 +++++++++++++-----
src/views/mine/Wallet.vue | 2 +-
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/views/mine/Cashout.vue b/src/views/mine/Cashout.vue
index 5487add..42c62bf 100644
--- a/src/views/mine/Cashout.vue
+++ b/src/views/mine/Cashout.vue
@@ -4,8 +4,8 @@
提现到指定账户
余额:{{ yue }}
-
提现到指定账户
-
提现记录
+
提现到指定账户
+
提现记录
@@ -131,6 +131,7 @@ import NavBottom from "@/components/NavBottom.vue";
import { cashout, getwallect } from "@/api";
import store from "@/store";
import { message } from "ant-design-vue";
+import router from '@/router';
export default defineComponent({
name: "Cashout",
components: {
@@ -150,8 +151,8 @@ export default defineComponent({
const moneychange: (e: number) => void = (e: number) => {
console.log(e);
};
- // const yue=ref
(store.state.userinfo.money)
- const yue = ref(10000);
+ const yue=ref(store.state.userinfo.moneyValue)
+ // const yue = ref(10000);
// yue.value=store.state.userinfo.money
const accountlist = ref>([]);
@@ -193,6 +194,11 @@ export default defineComponent({
// toRaw(accountlist.value)[payinfo.value.type]
// );
}
+
+ function navto(url: string){
+ router.push(url)
+ }
+
return {
money,
moneychange,
@@ -283,6 +289,7 @@ export default defineComponent({
color: #808080;
font-size: 11px;
margin-right: 28px;
+ flex-shrink: 0;
}
.chooseitem {
display: flex;
@@ -301,7 +308,8 @@ export default defineComponent({
background: white;
border-radius: 17px;
margin-left: 17px;
- margin-right: 46px;
+ width: 256px;
+ margin-right: 30px;
margin-bottom: 17px;
.hostinfo {
display: flex;
diff --git a/src/views/mine/Wallet.vue b/src/views/mine/Wallet.vue
index 2c068f0..a3ddc02 100644
--- a/src/views/mine/Wallet.vue
+++ b/src/views/mine/Wallet.vue
@@ -474,7 +474,7 @@ export default defineComponent({
width:1170px;
flex-wrap: wrap;
.accountitem {
- width: 372px;
+ width: 368px;
height: 226px;
background: white;
border-radius: 17px;