Browse Source

直播对接

master
Enzo 4 years ago
parent
commit
cff5958843
  1. 32
      pages/index/index/index.vue

32
pages/index/index/index.vue

@ -74,7 +74,7 @@
</view>
<!-- 悬浮购物车入口 -->
<view class="fixed-right">
<view class="fixed-cart fixed-live" hover-class="lf-opacity" @click="goLive()">
<view class="fixed-cart fixed-live" hover-class="lf-opacity" @click="goLive()" v-if="live_roomid">
<text class="lf-iconfont icon-zhibo icon-text"></text>
<text class="tips">直播间</text>
</view>
@ -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({

Loading…
Cancel
Save