Commit acced4ca authored by chenqikuai's avatar chenqikuai

直播

parent 2a1c5419
......@@ -5,6 +5,8 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!-- <meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1; minimum-scale=1; user-scalable=no;"> -->
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>
<%= htmlWebpackPlugin.options.title %>
......
......@@ -32,6 +32,12 @@ export default defineComponent({
setup() {
onBeforeMount(() => {
setTimeout(() => {
new Bridge().getNotchHeight(null, (height: any) => {
console.log('getNotchHeight', height);
})
}, 3000);
new Bridge().getNotchHeight(null, (height: any) => {
height = Number(height)
notchHeight.value = height;
......
<template>
<div class="wrap18 flex mx-5 overflow-hidden">
<div class="wrap18 flex mx-5 overflow-hidden" @click="goto">
<div class="flex-shrink-0 block2 outer3" style="width: 44%">
<div class="flex-col">
<div class="flex-col">
......@@ -15,19 +15,56 @@
</div>
</div>
<div class="flex flex-col justify-between items-center mx-2.5 py-5">
<p class="word18">
知名财经专家现场精彩讲座
</p>
<p class="word19">
建设银行财经专家分析
</p>
<p class="word18">{{ title }}</p>
</div>
</div>
</template>
<script lang="ts">
import Vue, {defineComponent} from "vue";
import { defineComponent } from "vue";
import Icon from "../common/Icon.vue";
export default defineComponent({ components: { Icon } });
import Bridge from "@/utils/jsBridge2"
import { Toast } from "vant";
import { enableLive } from "@/service/StaffService";
export default defineComponent({
components: { Icon },
props: {
title: String,
},
mounted() {
},
methods: {
goto() {
const USER_MSG = window.localStorage.getItem('USER_MSG')
if (!USER_MSG) {
Toast('请先登录')
return
}
let allow = false
let time_section = ''
enableLive().then(res => {
if (res.code === 200) {
allow = res.data.allow
time_section = res.data.time_section
}
new Bridge().bridge_gotoLiveRoom({
phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)?.userInfo.phone,
avatar: window.location.host + require('@/assets/icons/avatar.png'),
allow,
time_section
})
}).catch(() => {
new Bridge().bridge_gotoLiveRoom({
phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)?.userInfo.phone,
avatar: window.location.host + require('@/assets/icons/avatar.png'),
allow,
time_section
})
})
},
}
});
</script>
<style scoped>
.wrap18 {
......
......@@ -95,6 +95,7 @@ export default defineComponent({
},
heightOfNotch() { // 刘海屏的刘海高度 单位px
return notchHeight.value;
// return 103;
}
}
});
......
......@@ -551,4 +551,25 @@ jsBridge.prototype.getNotchHeight = function (params, success) {
}
}
/* 获取直播信息 */
jsBridge.prototype.bridge_getliveInfo = function (params, success) {
if (this.curApp == ANDROID) {
dsBridge.call('bridge_getliveInfo', params, success)
}
else if (this.curApp == IOS) {
this.callHandler('bridge_getliveInfo', params, success)
}
}
/* 去直播间 */
jsBridge.prototype.bridge_gotoLiveRoom = function (params, success) {
if (this.curApp == ANDROID) {
dsBridge.call('bridge_gotoLiveRoom', params, success)
}
else if (this.curApp == IOS) {
this.callHandler('bridge_gotoLiveRoom', params, success)
}
}
export default jsBridge;
<template>
<Navbar :bangsBlock="true"/>
<Navbar :bangsBlock="true" />
<div class="page flex-col">
<div class="outer1 flex-col">
<Banner class="w-full overflow-hidden" :bannerUrls="bannerList" />
......@@ -28,8 +28,8 @@
"
/>
</Skeleton>
<group-title class="mt-7" title="精彩直播" />
<LiveCard class="mt-4" />
<group-title class="mt-7" title="精彩直播" v-if="LiveRoomTitle" @seeMore="handleSeeMoreLive" />
<LiveCard class="mt-4" :title="LiveRoomTitle" />
<group-title
class="mt-7"
v-if="src"
......@@ -73,6 +73,7 @@ import { queryBannerList } from "@/service/BannerService";
import { getImageSrcFromFileHash } from "@/service/FileService";
import { queryNotifyList } from "@/service/NotifyService";
import { queryActivityList } from "@/service/ActivityService";
import Bridge from "@/utils/jsBridge2"
import {
queryLoanProductList,
queryLoanProductInfo,
......@@ -96,6 +97,7 @@ export default defineComponent({
},
data() {
return {
LiveRoomTitle: '',
appList,
skeLoading: false,
bannerList: [] as string[],
......@@ -137,8 +139,19 @@ export default defineComponent({
this.fetchNotifyList();
this.fetchActivityList();
this.fetchLoanProductList();
this.initLiveRoomCard();
},
methods: {
handleSeeMoreLive() {
},
initLiveRoomCard() {
new Bridge().bridge_getliveInfo(null, (msg: string) => {
if (msg) {
this.LiveRoomTitle = msg;
}
})
},
getHotNews() {
getNewsList({
limit: 2,
......@@ -189,7 +202,7 @@ export default defineComponent({
this.skeLoading = false;
this.hotLoanUuid = ret.data.uuid[0];
const uuid = this.hotLoanUuid;
if(uuid){
if (uuid) {
queryLoanProductInfo({ uuid }).then((ret) => {
console.log("uuid", uuid);
if (ret.code === 200) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment