Merge pull request 'xbx' (#139) from xbx into master

Reviewed-on: http://git.luyuan.tk/luyuan/beelink/pulls/139
This commit is contained in:
luyuan 2020-11-20 11:19:15 +08:00
commit ac086aa468
15 changed files with 277 additions and 28 deletions

View File

@ -53,7 +53,7 @@ video{
.member{
cursor: default;
border-bottom-style: solid;
border-width: 1px;
border-width: 0;
border-bottom-color: #f0f0f0;
}
#video-grid{
@ -73,6 +73,7 @@ video{
height: 100%;
padding: 10px;
grid-area: 1/1/3/4;
border-radius: 17px;
}
.video-box{
width: 100%;

BIN
public/img/fasong.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

88
public/js/iminit.js Normal file
View File

@ -0,0 +1,88 @@
let options = {
SDKAppID: 1400435767 // 接入时需要将0替换为您的即时通信 IM 应用的 SDKAppID
};
let tim = TIM.create(options);
tim.setLogLevel(0);
// 监听事件,例如:
tim.on(TIM.EVENT.SDK_READY, function(event) {
// 收到离线消息和会话列表同步完毕通知,接入侧可以调用 sendMessage 等需要鉴权的接口
// event.name - TIM.EVENT.SDK_READY
});
tim.on(TIM.EVENT.MESSAGE_RECEIVED, function(event) {
// 收到推送的单聊、群聊、群提示、群系统通知的新消息,可通过遍历 event.data 获取消息列表数据并渲染到页面
// event.name - TIM.EVENT.MESSAGE_RECEIVED
// event.data - 存储 Message 对象的数组 - [Message]
});
tim.on(TIM.EVENT.MESSAGE_REVOKED, function(event) {
// 收到消息被撤回的通知
// event.name - TIM.EVENT.MESSAGE_REVOKED
// event.data - 存储 Message 对象的数组 - [Message] - 每个 Message 对象的 isRevoked 属性值为 true
});
tim.on(TIM.EVENT.MESSAGE_READ_BY_PEER, function(event) {
// SDK 收到对端已读消息的通知,即已读回执。使用前需要将 SDK 版本升级至 v2.7.0 或以上。仅支持单聊会话。
// event.name - TIM.EVENT.MESSAGE_READ_BY_PEER
// event.data - event.data - 存储 Message 对象的数组 - [Message] - 每个 Message 对象的 isPeerRead 属性值为 true
});
tim.on(TIM.EVENT.CONVERSATION_LIST_UPDATED, function(event) {
// 收到会话列表更新通知,可通过遍历 event.data 获取会话列表数据并渲染到页面
// event.name - TIM.EVENT.CONVERSATION_LIST_UPDATED
// event.data - 存储 Conversation 对象的数组 - [Conversation]
});
tim.on(TIM.EVENT.GROUP_LIST_UPDATED, function(event) {
// 收到群组列表更新通知,可通过遍历 event.data 获取群组列表数据并渲染到页面
// event.name - TIM.EVENT.GROUP_LIST_UPDATED
// event.data - 存储 Group 对象的数组 - [Group]
});
tim.on(TIM.EVENT.PROFILE_UPDATED, function(event) {
// 收到自己或好友的资料变更通知
// event.name - TIM.EVENT.PROFILE_UPDATED
// event.data - 存储 Profile 对象的数组 - [Profile]
});
tim.on(TIM.EVENT.BLACKLIST_UPDATED, function(event) {
// 收到黑名单列表更新通知
// event.name - TIM.EVENT.BLACKLIST_UPDATED
// event.data - 存储 userID 的数组 - [userID]
});
tim.on(TIM.EVENT.ERROR, function(event) {
// 收到 SDK 发生错误通知,可以获取错误码和错误信息
// event.name - TIM.EVENT.ERROR
// event.data.code - 错误码
// event.data.message - 错误信息
});
tim.on(TIM.EVENT.SDK_NOT_READY, function(event) {
// 收到 SDK 进入 not ready 状态通知,此时 SDK 无法正常工作
// event.name - TIM.EVENT.SDK_NOT_READY
});
tim.on(TIM.EVENT.KICKED_OUT, function(event) {
// 收到被踢下线通知
// event.name - TIM.EVENT.KICKED_OUT
// event.data.type - 被踢下线的原因,例如:
// - TIM.TYPES.KICKED_OUT_MULT_ACCOUNT 多实例登录被踢
// - TIM.TYPES.KICKED_OUT_MULT_DEVICE 多终端登录被踢
// - TIM.TYPES.KICKED_OUT_USERSIG_EXPIRED 签名过期被踢 v2.4.0起支持)。
});
tim.on(TIM.EVENT.NET_STATE_CHANGE, function(event) {
// 网络状态发生改变v2.5.0 起支持)。
// event.name - TIM.EVENT.NET_STATE_CHANGE
// event.data.state 当前网络状态,枚举值及说明如下:
// \- TIM.TYPES.NET_STATE_CONNECTED - 已接入网络
// \- TIM.TYPES.NET_STATE_CONNECTING - 连接中。很可能遇到网络抖动SDK 在重试。接入侧可根据此状态提示“当前网络不稳定”或“连接中”
// \- TIM.TYPES.NET_STATE_DISCONNECTED - 未接入网络。接入侧可根据此状态提示“当前网络不可用”。SDK 仍会继续重试若用户网络恢复SDK 会自动同步消息
});
genTestUserSig(window.mid).then((res)=>{
tim.login({userID: window.mid, userSig: res.data});
})
// 开始登录

1
public/js/tim-js.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,72 @@
<link rel="stylesheet" href="./css/bootstrap-material-design.min.css">
<link rel="stylesheet" href="./css/index.css">
<link rel="stylesheet" href="./css/room.css">
<style>
#member-list > div{
padding: 32px;
border-bottom: 1px solid #EEEEEE;
}
.liaotian{
grid-area: 3/1/4/4;
margin-top: 28px;
height: 240px;
margin-left: 10px;
width: 98%;
background-color: #fff;
border-radius: 17px;
padding: 24px 28px 14px 28px !important;
display: flex;
flex-direction: column;
}
.wenzi{
width: 100%;
display: flex;
flex-direction: column;
height: 100%;
overflow-y: auto;
}
.wenzi > div{
width: 100%;
font-size: 11px;
}
.wenzi > div >p:first-child {
margin-right: 33px;
}
.wenzi > div >p span{
color: #08AE98;
}
.fasongkuang{
width: 100%;
height: 47px;
display: flex;
align-items: flex-end;
justify-content: space-between;
flex-shrink: 0;
border-top: 1px solid #DCDFE0;
}
.fasongkuang input{
font-size: 11px;
color: #333;
width: 600px;
border: none;
}
.fasonganniu{
display: flex;
font-size: 11px;
color: #08AE98;
align-items: center;
}
.fasonganniu img{
width: 15px;
height: 12px;
}
.fasongkuang input::placeholder{
font-size: 11px;
}
.fasongkuang input:focus{ border: none; background: #fff; outline: none;}
</style>
</head>
<body>
@ -267,24 +333,24 @@
<!-- content -->
<div class="row-div" style="height: 100%; width: 100%; padding: 10px">
<div class="col-div" style="width: 340px; height: 100%; padding: 10px">
<div class="col-div card" style="width: 100%; height: 100%; padding: 23px">
<div class="col-div card" style="width: 100%; height: 100%; padding: 23px;border-radius: 17px;">
<!-- 成员列表 -->
<div style="width: 100%;">上课人员</div>
<div style="width: 100%;padding-bottom: 11px;border-bottom: 1px solid #EEEEEE;">上课人员</div>
<div id="member-list" class="col-div" style="width: 100%; justify-content: flex-start; flex: 1">
<!-- member -->
<!-- <div id="member-me" style="width: 100%; padding-left: 20px">
<div id="member-me" style="width: 100%; padding-left: 20px;">
<div class="row-div member"
style="width: 100%; height: 50px; justify-content: space-between">
<div class="member-id">(我)</div>
<div class="row-div" style="width:100px; height: 27px; justify-content: center">
<img class="member-video-btn" style="height: 100%" src="./img/camera-on.png"
<img id="video-btn" class="member-video-btn" style="height: 100%" src="./img/camera-on.png"
alt="">
<div style="width: 18px"></div>
<img class="member-audio-btn" style="height: 100%" src="./img/mic-on.png"
<img id="mic-btn" class="member-audio-btn" style="height: 100%" src="./img/mic-on.png"
alt="">
</div>
</div>
</div> -->
</div>
</div>
</div>
@ -294,13 +360,13 @@
<!-- 主视频 -->
<div id="main-video" class="video-box col-div" style="justify-content: flex-end">
<!-- 主视频控制按钮 -->
<div id="main-video-btns" class="row-div"
<!-- <div id="main-video-btns" class="row-div"
style="width: 156px; position: absolute; z-index: 10; justify-content: center; align-self: flex-end">
<img id="video-btn" style="width: 68px; height: 68px" onClick="event.cancelBubble = true"
src="./img/big-camera-on.png" alt="" title="关闭摄像头">
<img id="mic-btn" style="width: 68px; height: 68px" onClick="event.cancelBubble = true"
src="./img/big-mic-on.png" alt="" title="关闭麦克风">
</div>
</div> -->
<div id="mask_main" class="mask col-div">
<!-- “摄像头未开启”遮罩 -->
<div style="height: 100%; width: 100%; position: absolute; background-color: #D8D8D8"></div>
@ -309,6 +375,53 @@
<div style="z-index: 10">摄像头未打开</div>
</div>
</div>
<div class="liaotian">
<div class="wenzi">
<div>
<p>00:00:00</p>
<p><span>andy:</span>asdhjfhujaksdhfjkasdjhhjasjhfhjkas</p>
</div>
<div>
<p>00:00:00</p>
<p><span>andy:</span>asdhjfhujaksdhfjkasdjhhjasjhfhjkas</p>
</div>
<div>
<p>00:00:00</p>
<p><span>andy:</span>asdhjfhujaksdhfjkasdjhhjasjhfhjkas</p>
</div>
<div>
<p>00:00:00</p>
<p><span>andy:</span>asdhjfhujaksdhfjkasdjhhjasjhfhjkas</p>
</div>
<div>
<p>00:00:00</p>
<p><span>andy:</span>asdhjfhujaksdhfjkasdjhhjasjhfhjkas</p>
</div>
<div>
<p>00:00:00</p>
<p><span>andy:</span>asdhjfhujaksdhfjkasdjhhjasjhfhjkas</p>
</div>
<div>
<p>00:00:00</p>
<p><span>andy:</span>asdhjfhujaksdhfjkasdjhhjasjhfhjkas</p>
</div>
<div>
<p>00:00:00</p>
<p><span>andy:</span>asdhjfhujaksdhfjkasdjhhjasjhfhjkas</p>
</div>
<div>
<p>00:00:00</p>
<p><span>andy:</span>asdhjfhujaksdhfjkasdjhhjasjhfhjkas</p>
</div>
</div>
<div class="fasongkuang">
<input type="text" placeholder="直播说点什么吧" >
<div class="fasonganniu">
发送
<img src="./img/fasong.png" alt="">
</div>
</div>
</div>
<!-- 小视频 -->
</div>
</div>
@ -333,6 +446,8 @@
window.roomid = urldata.roomid
window.mid = urldata.memberid
</script>
<script src="./js/jquery-3.2.1.min.js"></script>
<script src="./js/popper.js"></script>
<script src="./js/bootstrap-material-design.js"></script>
@ -351,6 +466,8 @@
<script src="./js/presetting.js"></script>
<script src="./js/device-testing.js"></script>
<script src="./js/index.js"></script>
<script src="./js/tim-js.js"></script>
<script src="./js/iminit.js"></script>
</body>

View File

@ -450,11 +450,13 @@ export async function editpassword(data?: any): Promise<any> {
const res = await put<Liveaddrule>('/member/' + data.memberid,newdata)
if(res.code==0){
message.success("修改成功")
return false
}else{
message.error(res.msg)
return true
}
return res
}
/**
@ -606,6 +608,12 @@ export async function checkuser(data?: any){
newdata.number=data.phone
const res = await get<CheckuserRule>('checkUser',newdata);
// console.log(res)
if(res.code == 1){
return {
code: res.code,
msg: res.msg,
}
}
return {
code: res.code,
msg: res.msg,

View File

@ -315,4 +315,5 @@ export default {
shichangtishi:"",
renshutishi: '',
tixianzhu: "",
zhibotishi: ""
}

View File

@ -14,6 +14,8 @@ getset().then((res: any)=>{
en.tixianzhu = `Note: ${res.sxf} service fee will be charged for each withdrawal, with a minimum of ${ res.symbol + res.minmoney }`
zh.zuiditixian = "最低提现金额" + res.symbol + res.minwithdraw
en.zuiditixian = "Minimum withdrawal amount " + res.symbol + res.minwithdraw
zh.zhibotishi = `恭喜您在beelink有直播课资格。直播资格按照每周浏览量排名${res.views}名基本直播资格。`
en.zhibotishi = `Congratulations on your qualification for beelink live streaming course. The top ${res.views} basic live streaming qualifications are ranked according to the number of views per week`
const i18n = geti18n();
const loc = i18n.locale.value;
i18n.locale.value = '';

View File

@ -315,4 +315,5 @@ export default {
shichangtishi:"",
renshutishi: '',
tixianzhu:"",
zhibotishi:""
}

View File

@ -65,6 +65,7 @@ export default createStore({
symbol: "",
timeCeiling: "",
timeLowerLimit: "",
views:0
},
qh: {
code: "86",

View File

@ -142,7 +142,7 @@ export default defineComponent({
const time = ref(60);//
const phone = ref(""); //
const code =ref("")
const myquhao=ref("86")
const userinfo = reactive({
phone: '13152639856',
password: '123456'
@ -155,6 +155,7 @@ export default defineComponent({
name: "中国"
}
])
const myquhao=ref(mrqh.value.code)
const videolist=ref<any>([{}])
onMounted(async ()=>{

View File

@ -170,7 +170,7 @@ export default defineComponent({
const next: (e: number) => void = async (e: number) => {
if(e==2){
console.log(uinfo)
const res=await checkuser(toRaw(uinfo.value))
const res: any = await checkuser(toRaw(uinfo.value))
console.log(res.data.memberid)
if(res.code==0){
// stepnow.value = e;

View File

@ -247,11 +247,7 @@ export default defineComponent({
wrapperCol: 14,
};
const time = ref(60); //
const phone = ref({
quhao: "86",
phone: "",
code: "",
});
const userinfo = ref({
pass: "",
passtow: "",
@ -262,6 +258,11 @@ export default defineComponent({
});
const willsay = ref<any>();
const mrqh = computed(() => store.state.qh)
const phone = ref({
quhao: mrqh.value.code,
phone: "",
code: "",
});
const quhaolist = ref<any>([
{
code: "86",

View File

@ -180,7 +180,8 @@
:customRequest="uploads"
:beforeUpload="video"
>
<div class="upload-image">
<div class="upload-image" v-if="uploadprogress != 100 & userinfo.video != ''">
<PlaySquareOutlined
style="fontsize: 22px"
v-if="uploadprogress == 0"
@ -192,6 +193,14 @@
v-else
/>
</div>
<div class="upload-image" v-else>
<video
:src="userinfo.video"
style="width:100%;height:100%"
class="upload"
></video>
</div>
</a-upload>
<div class="demand">
<p class="one-line-hide">
@ -539,7 +548,7 @@ import {
} from "@/api/index";
import { message } from "ant-design-vue";
import { useI18n } from "@/utils/i18n";
import { provenimg, provenvideo } from '@/utils/common';
import { provenimg, provenvideo, saveValue } from '@/utils/common';
export default defineComponent({
name: "Archives",
@ -584,7 +593,7 @@ export default defineComponent({
const quhaolist = ref<any>([]);
const mrqh = computed(() => store.state.qh)
const myquhao = ref<string>("");
const myquhao = ref<string>(mrqh.value.code);
const mynewtel = ref<string>("");
@ -798,16 +807,16 @@ export default defineComponent({
* 修改密码
* @return { void }
*/
function updateUserPassword(): void {
async function updateUserPassword(): Promise<void> {
passwordForm.memberid = userinfo.value.memberid
console.log(toRaw(passwordForm));
if (
toRaw(passwordForm).password === toRaw(passwordForm).topassword
toRaw(passwordForm).password === toRaw(passwordForm).topassword
) {
if (toRaw(passwordForm).original != "") {
// console.log(toRaw(passwordForm).password);
editpassword(toRaw(passwordForm));
togglePasswordModal(false);
const res = await editpassword(toRaw(passwordForm));
togglePasswordModal(res);
} else {
message.error(lan.$t('yuanmimaweikong'));
}
@ -916,6 +925,7 @@ export default defineComponent({
if (reg.test(userinfo.value.email)) {
await putmember(uesrinfo);
if(lan.$s() != uesrinfo.languageValue){
saveValue("Lanvuage", uesrinfo.languageValue)
location.reload();
}
} else {
@ -939,7 +949,7 @@ export default defineComponent({
}
const uploadprogress: Ref<number> = ref(0);
async function uploads(file: AntUpload) {
console.log(1111)
uploadprogress.value = 1;
issum = false;
const res = await uploadflie(file.file, (info: any) => {
@ -948,6 +958,7 @@ export default defineComponent({
uploadprogress.value = jindu > 0 ? jindu : 1;
});
userinfo.value.video = res.video.url;
formData.value.video = res.video.url;
userinfo.value.videoid = res.fileId;
issum = true;
}

View File

@ -222,6 +222,10 @@
<p>{{ lan.$t("querenquxiao") }}</p>
</a-modal>
<nav-bottom></nav-bottom>
<div class="tishi" v-if="!jinzhi">
{{ lan.$t("zhibotishi") }}
</div>
</div>
</template>
<script lang="ts">
@ -518,9 +522,10 @@ export default defineComponent({
}
const ifallowpic = ref<boolean>(false);
async function uploadspic(file: AntUpload) {
uploadpicprogress.value = 1;
const res = await uploadflie(file.file, (info: any) => {
console.log(info);
uploadpicprogress.value = info.percent.toFixed(2) * 100;
uploadpicprogress.value = info.percent.toFixed(2) * 100 || 1;
});
console.log(res);
@ -576,7 +581,7 @@ export default defineComponent({
}
return provenimg(file)
}
const view = computed(()=>store.state.seting.views)
return {
labelCol: { span: 4 },
wrapperCol: { span: 14 },
@ -613,7 +618,8 @@ export default defineComponent({
isquxiao,
video,
imgs,
jinzhi
jinzhi,
view
};
},
});
@ -626,6 +632,16 @@ export default defineComponent({
padding: 46px;
border-radius: 17px;
position: relative;
.tishi{
position: absolute;
top: 40%;
right: 15%;
width: 25%;
line-height: 0.17rem;
font-size: 0.1rem;
font-weight: 500;
color: #808080;
}
::v-deep(.ant-form) {
.title {
font-size: 12px;