diff --git a/pages/index/index/index.vue b/pages/index/index/index.vue index 4117356..bd3d8c0 100644 --- a/pages/index/index/index.vue +++ b/pages/index/index/index.vue @@ -74,7 +74,7 @@ - + 直播间 @@ -152,7 +152,8 @@ show_ad: false, // 是否显示ad广告 ad_modal_list: [], // ad广告列表 nav_bg_color: 'rgba(255,255,255,0)' ,// 导航背景颜色 - car_num: 0 + car_num: 0, + live_roomid: 0 }; }, // 注册组件 @@ -189,14 +190,14 @@ } }, onShow(e) { - + this.getLiveRoom(); this.isLogin=!!this.$cookieStorage.get('user_token') let toekn = this.$cookieStorage.get('user_token'); if (toekn) { this.getUserInfo(); - this.getcarNum() + this.getcarNum(); } @@ -266,15 +267,28 @@ onPullDownRefresh(){ wx.showLoading(); this.queryMicroData(); + this.getLiveRoom(); }, // 方法,需要将小程序的方法都放到这个里面 methods: { goLive() { - this.$msg('敬请期待!'); - return - // wx.navigateTo({ - // url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=1` - // }) + // this.$msg('敬请期待!'); + // return + wx.navigateTo({ + url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=`+this.live_roomid + }) + }, + //获取直播房间号 + getLiveRoom(){ + this.$http.get({ + api: '/api/live' + }).then(res => { + console.log('=======',res.data.data) + if(res.data.data != null) { + this.live_roomid = res.data.data.number + } + uni.stopPullDownRefresh(); + }); }, getAlertAd(){ this.$http.get({