Commit acced4ca authored by chenqikuai's avatar chenqikuai

直播

parent 2a1c5419
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <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.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"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title> <title>
<%= htmlWebpackPlugin.options.title %> <%= htmlWebpackPlugin.options.title %>
......
...@@ -32,6 +32,12 @@ export default defineComponent({ ...@@ -32,6 +32,12 @@ export default defineComponent({
setup() { setup() {
onBeforeMount(() => { onBeforeMount(() => {
setTimeout(() => {
new Bridge().getNotchHeight(null, (height: any) => {
console.log('getNotchHeight', height);
})
}, 3000);
new Bridge().getNotchHeight(null, (height: any) => { new Bridge().getNotchHeight(null, (height: any) => {
height = Number(height) height = Number(height)
notchHeight.value = height; notchHeight.value = height;
......
<template> <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-shrink-0 block2 outer3" style="width: 44%">
<div class="flex-col"> <div class="flex-col">
<div class="flex-col"> <div class="flex-col">
...@@ -15,19 +15,56 @@ ...@@ -15,19 +15,56 @@
</div> </div>
</div> </div>
<div class="flex flex-col justify-between items-center mx-2.5 py-5"> <div class="flex flex-col justify-between items-center mx-2.5 py-5">
<p class="word18"> <p class="word18">{{ title }}</p>
知名财经专家现场精彩讲座
</p>
<p class="word19">
建设银行财经专家分析
</p>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue, {defineComponent} from "vue"; import { defineComponent } from "vue";
import Icon from "../common/Icon.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> </script>
<style scoped> <style scoped>
.wrap18 { .wrap18 {
......
...@@ -95,6 +95,7 @@ export default defineComponent({ ...@@ -95,6 +95,7 @@ export default defineComponent({
}, },
heightOfNotch() { // 刘海屏的刘海高度 单位px heightOfNotch() { // 刘海屏的刘海高度 单位px
return notchHeight.value; return notchHeight.value;
// return 103;
} }
} }
}); });
......
...@@ -551,4 +551,25 @@ jsBridge.prototype.getNotchHeight = function (params, success) { ...@@ -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; export default jsBridge;
<template> <template>
<Navbar :bangsBlock="true"/> <Navbar :bangsBlock="true" />
<div class="page flex-col"> <div class="page flex-col">
<div class="outer1 flex-col"> <div class="outer1 flex-col">
<Banner class="w-full overflow-hidden" :bannerUrls="bannerList" /> <Banner class="w-full overflow-hidden" :bannerUrls="bannerList" />
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
" "
/> />
</Skeleton> </Skeleton>
<group-title class="mt-7" title="精彩直播" /> <group-title class="mt-7" title="精彩直播" v-if="LiveRoomTitle" @seeMore="handleSeeMoreLive" />
<LiveCard class="mt-4" /> <LiveCard class="mt-4" :title="LiveRoomTitle" />
<group-title <group-title
class="mt-7" class="mt-7"
v-if="src" v-if="src"
...@@ -73,6 +73,7 @@ import { queryBannerList } from "@/service/BannerService"; ...@@ -73,6 +73,7 @@ import { queryBannerList } from "@/service/BannerService";
import { getImageSrcFromFileHash } from "@/service/FileService"; import { getImageSrcFromFileHash } from "@/service/FileService";
import { queryNotifyList } from "@/service/NotifyService"; import { queryNotifyList } from "@/service/NotifyService";
import { queryActivityList } from "@/service/ActivityService"; import { queryActivityList } from "@/service/ActivityService";
import Bridge from "@/utils/jsBridge2"
import { import {
queryLoanProductList, queryLoanProductList,
queryLoanProductInfo, queryLoanProductInfo,
...@@ -96,6 +97,7 @@ export default defineComponent({ ...@@ -96,6 +97,7 @@ export default defineComponent({
}, },
data() { data() {
return { return {
LiveRoomTitle: '',
appList, appList,
skeLoading: false, skeLoading: false,
bannerList: [] as string[], bannerList: [] as string[],
...@@ -137,8 +139,19 @@ export default defineComponent({ ...@@ -137,8 +139,19 @@ export default defineComponent({
this.fetchNotifyList(); this.fetchNotifyList();
this.fetchActivityList(); this.fetchActivityList();
this.fetchLoanProductList(); this.fetchLoanProductList();
this.initLiveRoomCard();
}, },
methods: { methods: {
handleSeeMoreLive() {
},
initLiveRoomCard() {
new Bridge().bridge_getliveInfo(null, (msg: string) => {
if (msg) {
this.LiveRoomTitle = msg;
}
})
},
getHotNews() { getHotNews() {
getNewsList({ getNewsList({
limit: 2, limit: 2,
...@@ -189,7 +202,7 @@ export default defineComponent({ ...@@ -189,7 +202,7 @@ export default defineComponent({
this.skeLoading = false; this.skeLoading = false;
this.hotLoanUuid = ret.data.uuid[0]; this.hotLoanUuid = ret.data.uuid[0];
const uuid = this.hotLoanUuid; const uuid = this.hotLoanUuid;
if(uuid){ if (uuid) {
queryLoanProductInfo({ uuid }).then((ret) => { queryLoanProductInfo({ uuid }).then((ret) => {
console.log("uuid", uuid); console.log("uuid", uuid);
if (ret.code === 200) { 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