一部分内容

This commit is contained in:
luyuan 2020-11-06 22:30:17 +08:00
parent 8e146606da
commit a75e5a3c02
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
9 changed files with 148 additions and 14 deletions

View File

@ -1024,3 +1024,7 @@ export async function interests() {
return res.data;
}
export async function getset() {
const res = await get('getset');
return res.data;
}

View File

@ -13,7 +13,7 @@
</div>
<div class="icons">
<img src="@/static/images/camera.png" alt="" class="icon">
<img src="@/static/images/camera.png" @click="sendmasg" alt="" class="icon">
<img src="@/static/images/vol.png" alt="" class="icon">
</div>
</div>
@ -147,5 +147,14 @@
<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({});
export default defineComponent({
setup(prop,context){
function sendmasg(){
context.emit("sentext")
}
return {
sendmasg
}
}
});
</script>

View File

@ -189,7 +189,6 @@ export default {
xuanzezhanghu: "Select account",
tixianjine: "Withdrawal amount",
quanbujine: "Total amount",
tixianzhu: "Note: 0.1% service fee will be charged for each withdrawal, with a minimum of ¥ 0.1",
yueshu: "Your balance is only",
zuiditixian: "Minimum withdrawal amount ¥ 100",
mingxichaxun: "Details inquiry",
@ -297,5 +296,8 @@ export default {
kaihuhangweikong:"Swiftcode cannot be empty",
shensu:"Appeal",
querenquxiao: "Are you sure to cancel the live broadcast?",
tianjiatixian: "Add a withdrawal account"
tianjiatixian: "Add a withdrawal account",
shichangtishi:"",
renshutishi: '',
tixianzhu: "",
}

View File

@ -1,9 +1,19 @@
import zh from "./zh"
import en from "./en"
import { getset } from '@/api';
getset().then((res: any)=>{
zh.shichangtishi = `最短${res.timeLowerLimit}min, 最长${res.timeCeiling}min`
en.shichangtishi = `The shortest is ${res.timeLowerLimit}min and the longest is ${res.timeCeiling}min`
zh.renshutishi = `最少${res.lowerLimit}人, 最多${res.numberCeiling}`
en.shichangtishi = `Minimum ${res.lowerLimit} person, maximum ${res.numberCeiling} people`
zh.tixianzhu = `注:每笔提现收取${res.sxf}服务费,最低${ res.symbol + res.minmoney }`
en.tixianzhu = `Note: ${res.sxf} service fee will be charged for each withdrawal, with a minimum of ${ res.symbol + res.minmoney }`
})
export default {
locale: "zh", //默认语言
messages: {
zh,
en
zh: zh,
en: en
}
}

View File

@ -192,7 +192,6 @@ export default {
xuanzezhanghu:"选择账户",
tixianjine:"提现金额",
quanbujine:"全部金额",
tixianzhu:"注每笔提现收取0.1%服务费最低¥0.1",
yueshu:"您的余额只有",
zuiditixian:"最低提现金额¥100",
mingxichaxun:"明细查询",
@ -297,5 +296,8 @@ export default {
kaihuhangweikong:"开户行不能为空",
shensu:"申诉",
querenquxiao: "您确认取消直播吗?",
tianjiatixian: "添加提现账户"
tianjiatixian: "添加提现账户",
shichangtishi:"",
renshutishi: '',
tixianzhu:"",
}

5
src/import-png.d.ts vendored
View File

@ -13,4 +13,9 @@ declare module "ant-design-vue/es/locale/zh_CN" {
export default value;
}
declare module 'tim-js-sdk'{
const value: any;
export default value;
}
declare var FB: any;

View File

@ -126,7 +126,7 @@
</template>
<script lang="ts">
import { defineComponent, onMounted, ref, toRaw } from "vue";
import { computed, defineComponent, onMounted, ref, toRaw } from "vue";
import NavBottom from "@/components/NavBottom.vue";
import { cashout, getwallect } from "@/api";
import store from "@/store";
@ -154,7 +154,7 @@ export default defineComponent({
console.log(e);
};
const yue=ref<number>(store.state.userinfo.moneyValue)
const danwei = ref(store.state.userinfo.symbol)
const danwei = computed(() => store.state.userinfo.symbol)
// const yue = ref<number>(10000);
// yue.value=store.state.userinfo.money
const accountlist = ref<Array<any>>([]);

View File

@ -143,7 +143,7 @@
type="number"
/>
<span class="unit">{{ lan.$t("fenzhong") }}</span>
<div style="color: red;font-size: 0.12rem;line-height: 1.3;">*最短30min, 最长120min</div>
<div style="color: red;font-size: 0.12rem;line-height: 1.3;">*{{ lan.$t('shichangtishi') }}</div>
</a-form-item>
<a-form-item
:label="lan.$t('zhiborenshu')"

View File

@ -9,7 +9,7 @@
</div>
</div>
<div class="info">
<LiveingWatcher></LiveingWatcher>
<LiveingWatcher @sentext="sendtext"></LiveingWatcher>
<div class="LivePlaying">
<LivePlaying></LivePlaying>
<div class="comment">
@ -190,7 +190,7 @@
}
</style>
<script lang="ts">
import { defineComponent, onMounted, ref } from "vue";
import { defineComponent, onMounted, ref, resolveComponent } from "vue";
import LivePlaying from "@/components/LivePlaying.vue";
import LiveingWatcher from "@/components/LiveingWatcher.vue";
import TRTC from "trtc-js-sdk"
@ -199,6 +199,7 @@ import { useRoute } from 'vue-router';
import store from '@/store';
import { message } from 'ant-design-vue';
import { useI18n } from '@/utils/i18n';
import TIM from 'tim-js-sdk';
export default defineComponent({
components: {
@ -217,6 +218,7 @@ export default defineComponent({
const roominfo = ref<any>([]);
console.log(useRoute())
const id = useRoute().query.id;
let tim: any;
TRTC.checkSystemRequirements().then((result: any) => {
if(!result) {
message.error(lan.$t('buzhichitonghua'))
@ -351,6 +353,87 @@ export default defineComponent({
// }
fun()
});
// im
tim = TIM.create({
SDKAppID: 1400400340
}); // SDK tim
tim.setLogLevel(0);
tim.on(TIM.EVENT.MESSAGE_RECEIVED, function(event: any) {
// event.data
// event.name - TIM.EVENT.MESSAGE_RECEIVED
// event.data - Message - [Message]
for(const i in event.data){
console.log(event.data[i])
}
});
tim.on(TIM.EVENT.GROUP_LIST_UPDATED, function(event: any) {
// event.data
// event.name - TIM.EVENT.GROUP_LIST_UPDATED
// event.data - Group - [Group]
console.log(event.data)
});
tim.login({userID: store.state.userinfo.memberid.toString(), userSig: userSig}).then((res: any)=>{
console.log(res.data); //
if (res.data.repeatLogin === true) {
// v2.5.1
console.log(res.data.errorInfo);
}
}).catch(function(imError: any) {
console.warn('login error:', imError); //
});
tim.on(TIM.EVENT.SDK_READY, function (){
const promise = tim.createGroup({
type: TIM.TYPES.GRP_AVCHATROOM,
name: 'live',
groupID: roominfo.value.roomid
});
promise.then(function(imResponse: any) { //
console.log(imResponse.data.group); //
tim.joinGroup({
groupID: roominfo.value.roomid,
type: TIM.TYPES.GRP_AVCHATROOM
}).then((res: any)=>{
switch (res.data.status) {
case TIM.TYPES.JOIN_STATUS_WAIT_APPROVAL: //
break;
case TIM.TYPES.JOIN_STATUS_SUCCESS: //
console.log(res.data.group); //
break;
case TIM.TYPES.JOIN_STATUS_ALREADY_IN_GROUP: //
break;
default:
break;
}
}).catch((err: any)=>{
console.log(err)
})
}).catch(function(imError: any) {
console.warn('createGroup error:', imError); //
tim.joinGroup({
groupID: roominfo.value.roomid,
type: TIM.TYPES.GRP_AVCHATROOM
}).then((res: any)=>{
switch (res.data.status) {
case TIM.TYPES.JOIN_STATUS_WAIT_APPROVAL: //
break;
case TIM.TYPES.JOIN_STATUS_SUCCESS: //
console.log(res.data.group); //
break;
case TIM.TYPES.JOIN_STATUS_ALREADY_IN_GROUP: //
break;
default:
break;
}
}).catch((err: any)=>{
console.log(err)
})
});
});
}
async function fenxiang(){
console.log(localStream)
@ -387,6 +470,24 @@ export default defineComponent({
});
}
function sendtext(){
const message = tim.createTextMessage({
to: roominfo.value.roomid,
conversationType: TIM.TYPES.CONV_GROUP,
payload: {
text: 'Hello world!'
}
});
const promise = tim.sendMessage(message);
promise.then(function(imResponse: any) {
//
console.log(imResponse);
}).catch(function(imError: any) {
//
console.warn('sendMessage error:', imError);
});
}
onMounted(async ()=>{
const si = setInterval(async ()=>{
if(store.state.userinfo.memberid != 0 && store.state.userinfo.memberid){
@ -405,7 +506,8 @@ export default defineComponent({
roominfo,
guanbi,
visible,
lan
lan,
sendtext
}
},
});