From f05af3c3f7474e9553d9f03407ae2644dc1b9b57 Mon Sep 17 00:00:00 2001 From: Gaoxs <704041637@qq.com> Date: Wed, 9 Sep 2020 19:59:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=9B=B4=E6=92=AD=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ShoproLiveCard.vue | 69 ++++---- pages.json | 6 + pages/home/components/FirstNewProduct.vue | 1 - pages/home/components/HotCommodity.vue | 5 +- pages/home/components/Live.vue | 76 ++++----- pages/home/components/ProductsRecommended.vue | 1 - pages/home/components/PromoteProduct.vue | 1 - pages/home/index.vue | 12 +- pages/shop/Live/LiveList/index.vue | 158 ++++++++++++++++++ 9 files changed, 246 insertions(+), 83 deletions(-) create mode 100644 pages/shop/Live/LiveList/index.vue diff --git a/components/ShoproLiveCard.vue b/components/ShoproLiveCard.vue index 25b5b1d..d481eb3 100644 --- a/components/ShoproLiveCard.vue +++ b/components/ShoproLiveCard.vue @@ -1,30 +1,29 @@ @@ -88,7 +89,6 @@ detail: Array }, created() { - this.getLiveList(); }, mounted() { let that = this; @@ -103,40 +103,40 @@ methods: { // 直播列表 getLiveList() { - let that = this; - yxWechatLive({ - page: 1, - size: 10, - }).then(res => { - console.log(res) - }) + // let that = this; + // yxWechatLive({ + // page: 1, + // size: 10, + // }).then(res => { + // console.log(res) + // }) }, // 轮询liveStatus getLiveStatus() { - if (HAS_LIVE) { - let that = this; - let date = ''; - if (that.detail.live_status == 102) { - date = that.$tools.dateFormat('mm-dd HH:MM', new Date(that.detail.starttime * 1000)).replace('-', - '/'); - that.liveStatus['102'].title = '预告 ' + date; - } - livePlayer - .getLiveStatus({ - room_id: that.detail.room_id - }) - .then(res => { - // 101: 直播中, 102: 未开始, 103: 已结束, 104: 禁播, 105: 暂停中, 106: 异常,107:已过期 - that.detail.live_status = res.liveStatus; - }) - .catch(err => { - console.log('get live status', err); - }); - } + // if (HAS_LIVE) { + // let that = this; + // let date = ''; + // if (that.detail.live_status == 102) { + // date = that.$tools.dateFormat('mm-dd HH:MM', new Date(that.detail.starttime * 1000)).replace('-', + // '/'); + // that.liveStatus['102'].title = '预告 ' + date; + // } + // livePlayer + // .getLiveStatus({ + // room_id: that.detail.room_id + // }) + // .then(res => { + // // 101: 直播中, 102: 未开始, 103: 已结束, 104: 禁播, 105: 暂停中, 106: 异常,107:已过期 + // that.detail.live_status = res.liveStatus; + // }) + // .catch(err => { + // console.log('get live status', err); + // }); + // } }, goRoom(live) { wx.navigateTo({ - url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${live.room_id}` + url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${live.roomId}` }); } } diff --git a/pages/home/components/ProductsRecommended.vue b/pages/home/components/ProductsRecommended.vue index 0bfe3cb..fde1ec6 100644 --- a/pages/home/components/ProductsRecommended.vue +++ b/pages/home/components/ProductsRecommended.vue @@ -60,7 +60,6 @@ created() {}, watch: { detail(next) { - console.log(next) this.goodsList = this.sortData(next, 4); } }, diff --git a/pages/home/components/PromoteProduct.vue b/pages/home/components/PromoteProduct.vue index f50eb54..1cb219a 100644 --- a/pages/home/components/PromoteProduct.vue +++ b/pages/home/components/PromoteProduct.vue @@ -61,7 +61,6 @@ created() {}, watch: { detail(next) { - console.log(next) this.goodsList = this.sortData(next, 4); } }, diff --git a/pages/home/index.vue b/pages/home/index.vue index 7713556..cf96de0 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -36,13 +36,13 @@ - + - + - + @@ -69,7 +69,7 @@ import HotCommodity from './components/HotCommodity'; import FirstNewProduct from './components/FirstNewProduct'; import ProductsRecommended from './components/ProductsRecommended'; - // import Live from './components/Live'; + import Live from './components/Live'; import { getHomeData, @@ -99,7 +99,7 @@ HotCommodity, FirstNewProduct, ProductsRecommended, - // Live + Live }, props: {}, data: function () { @@ -220,7 +220,7 @@ that.$set(that, 'firstList', res.data.firstList); that.$set(that, 'bastList', res.data.bastList); that.$set(that, 'likeInfo', res.data.likeInfo); - that.$set(that, 'live', res.data.live); + that.$set(that, 'live', res.data.liveList); that.$set(that, 'lovely', res.data.lovely); that.$set(that, 'benefit', res.data.benefit); that.$set(that, 'couponList', res.data.couponList); diff --git a/pages/shop/Live/LiveList/index.vue b/pages/shop/Live/LiveList/index.vue new file mode 100644 index 0000000..d01f97b --- /dev/null +++ b/pages/shop/Live/LiveList/index.vue @@ -0,0 +1,158 @@ + + + + +