From 3a847ac185dd5c719b6ad2b7f142b3faaf6148c3 Mon Sep 17 00:00:00 2001 From: xuwenbo <717567226@qq.com> Date: Thu, 10 Sep 2020 22:51:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=9B=B4=E6=92=AD=E7=BB=84=E4=BB=B6=E7=89=88=E6=9C=AC1.1.9=20?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=9B=B4=E6=92=AD=E9=97=B4=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=85=A8=E9=83=A8=E8=BF=9B=E5=85=A5=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E7=9B=B4=E6=92=ADbug=20=E6=B4=BB=E5=8A=A8=E5=95=86?= =?UTF-8?q?=E5=93=81=E6=8B=BCsku=E6=98=BE=E7=A4=BA=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E4=B8=8E=E5=BA=93=E5=AD=98=E4=B8=BA=E5=85=B1=E4=BA=AB=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E7=9A=84bug=20=E6=9B=B4=E6=94=B9=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E9=97=B4id=20->roomId=20=E7=9B=B4=E6=92=AD=E4=B8=AD=E5=BC=80?= =?UTF-8?q?=E6=94=BE=E8=BD=AE=E8=AF=A2=E7=9B=B4=E6=92=AD=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E7=9B=B4=E6=92=AD=E5=9B=9E=E6=94=BE?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E7=9B=B4=E6=92=AD=E7=BB=84=E4=BB=B6=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=A4=AA=E4=BD=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ShoproLiveCard.vue | 52 ++++++++++++------------- manifest.json | 2 +- pages/activity/GroupDetails/index.vue | 18 ++++----- pages/activity/SeckillDetails/index.vue | 18 ++++----- pages/home/components/Live.vue | 43 ++++++++++---------- pages/shop/Live/LiveList/index.vue | 8 +++- 6 files changed, 74 insertions(+), 67 deletions(-) diff --git a/components/ShoproLiveCard.vue b/components/ShoproLiveCard.vue index d481eb3..d7463de 100644 --- a/components/ShoproLiveCard.vue +++ b/components/ShoproLiveCard.vue @@ -19,7 +19,7 @@ - + ¥{{ goods.price }} @@ -95,10 +95,10 @@ this.getLiveStatus(); }, mounted() { - // let that = this; - // timer = setInterval(() => { - // that.getLiveStatus(); - // }, 60000); + let that = this; + timer = setInterval(() => { + that.getLiveStatus(); + }, 60000); }, beforeDestroy() { timer = null; @@ -112,26 +112,26 @@ }, // 轮询liveStatus getLiveStatus() { - // if (HAS_LIVE) { - // let that = this; - // let date = ''; - // if (that.detail.liveStatus == 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.liveStatus = res.liveStatus; - // }) - // .catch(err => { - // console.log('get live status', err); - // }); - // } + if (HAS_LIVE) { + let that = this; + let date = ''; + if (that.detail.liveStatus == 102) { + // date = that.$tools.dateFormat('mm-dd HH:MM', new Date(that.detail.starttime * 1000)).replace('-', + // '/'); + that.liveStatus['102'].title = '预告 ' ; + } + livePlayer + .getLiveStatus({ + room_id: that.detail.roomId + }) + .then(res => { + // 101: 直播中, 102: 未开始, 103: 已结束, 104: 禁播, 105: 暂停中, 106: 异常,107:已过期 + that.detail.liveStatus = res.liveStatus; + }) + .catch(err => { + console.log('get live status', err); + }); + } } } }; @@ -302,4 +302,4 @@ } } } - + diff --git a/manifest.json b/manifest.json index f286e6e..eda2d30 100644 --- a/manifest.json +++ b/manifest.json @@ -143,7 +143,7 @@ "plugins": { "live-player-plugin": { // 注意填写该直播组件最新版本号,微信开发者工具调试时可获取最新版本号(复制时请去掉注释) - "version": "1.0.15", + "version": "1.1.9", // 必须填该直播组件appid,该示例值即为直播组件appid(复制时请去掉注释) "provider": "wx2b03c6e691cd7370" } diff --git a/pages/activity/GroupDetails/index.vue b/pages/activity/GroupDetails/index.vue index 676e510..442122d 100644 --- a/pages/activity/GroupDetails/index.vue +++ b/pages/activity/GroupDetails/index.vue @@ -295,7 +295,7 @@ } else { that.posterData.title = that.storeInfo.title; } - that.posterData.price = that.storeInfo.price; + that.posterData.price = that.storeInfo.pinkPrice; that.posterData.code = that.storeInfo.code_base; that.domStatus = true; console.log(this.storeInfo) @@ -319,8 +319,8 @@ this.storeInfo.title ); this.$set(this.attr.productSelect, "image", productSelect.image); - this.$set(this.attr.productSelect, "price", productSelect.price); - this.$set(this.attr.productSelect, "stock", productSelect.stock); + this.$set(this.attr.productSelect, "price", productSelect.pinkPrice); + this.$set(this.attr.productSelect, "stock", productSelect.pinkStock); this.$set(this.attr.productSelect, "unique", productSelect.unique); this.$set(this.attr.productSelect, "cart_num", 1); this.$set(this, "attrValue", value.sort().join(",")); @@ -332,7 +332,7 @@ this.storeInfo.title ); this.$set(this.attr.productSelect, "image", this.storeInfo.image); - this.$set(this.attr.productSelect, "price", this.storeInfo.price); + this.$set(this.attr.productSelect, "price", this.storeInfo.pinkPrice); this.$set(this.attr.productSelect, "stock", 0); this.$set(this.attr.productSelect, "unique", ""); this.$set(this.attr.productSelect, "cart_num", 0); @@ -345,8 +345,8 @@ this.storeInfo.title ); this.$set(this.attr.productSelect, "image", this.storeInfo.image); - this.$set(this.attr.productSelect, "price", this.storeInfo.price); - this.$set(this.attr.productSelect, "stock", this.storeInfo.stock); + this.$set(this.attr.productSelect, "price", this.storeInfo.pinkPrice); + this.$set(this.attr.productSelect, "stock", this.storeInfo.pinkStock); this.$set( this.attr.productSelect, "unique", @@ -418,15 +418,15 @@ if (productSelect) { this.attr.productAttr[res.indexw].index = res.indexn; this.$set(this.attr.productSelect, "image", productSelect.image); - this.$set(this.attr.productSelect, "price", productSelect.price); - this.$set(this.attr.productSelect, "stock", productSelect.stock); + this.$set(this.attr.productSelect, "price", productSelect.pinkPrice); + this.$set(this.attr.productSelect, "stock", productSelect.pinkStock); this.$set(this.attr.productSelect, "unique", productSelect.unique); this.$set(this.attr.productSelect, "cart_num", 1); this.$set(this, "attrValue", res.value); this.$set(this, "attrTxt", "已选择"); } else { this.$set(this.attr.productSelect, "image", this.storeInfo.image); - this.$set(this.attr.productSelect, "price", this.storeInfo.price); + this.$set(this.attr.productSelect, "price", this.storeInfo.pinkPrice); this.$set(this.attr.productSelect, "stock", 0); this.$set(this.attr.productSelect, "unique", ""); this.$set(this.attr.productSelect, "cart_num", 0); diff --git a/pages/activity/SeckillDetails/index.vue b/pages/activity/SeckillDetails/index.vue index ffc001f..f57088d 100644 --- a/pages/activity/SeckillDetails/index.vue +++ b/pages/activity/SeckillDetails/index.vue @@ -237,8 +237,8 @@ this.storeInfo.title ); this.$set(this.attr.productSelect, "image", productSelect.image); - this.$set(this.attr.productSelect, "price", productSelect.price); - this.$set(this.attr.productSelect, "stock", productSelect.stock); + this.$set(this.attr.productSelect, "price", productSelect.seckillPrice); + this.$set(this.attr.productSelect, "stock", productSelect.seckillStock); this.$set(this.attr.productSelect, "unique", productSelect.unique); this.$set(this.attr.productSelect, "cart_num", 1); this.$set(this, "attrValue", value.sort().join(",")); @@ -250,7 +250,7 @@ this.storeInfo.title ); this.$set(this.attr.productSelect, "image", this.storeInfo.image); - this.$set(this.attr.productSelect, "price", this.storeInfo.price); + this.$set(this.attr.productSelect, "price", this.storeInfo.seckillPrice); this.$set(this.attr.productSelect, "stock", 0); this.$set(this.attr.productSelect, "unique", ""); this.$set(this.attr.productSelect, "cart_num", 0); @@ -263,8 +263,8 @@ this.storeInfo.title ); this.$set(this.attr.productSelect, "image", this.storeInfo.image); - this.$set(this.attr.productSelect, "price", this.storeInfo.price); - this.$set(this.attr.productSelect, "stock", this.storeInfo.stock); + this.$set(this.attr.productSelect, "price", this.storeInfo.seckillPrice); + this.$set(this.attr.productSelect, "stock", this.storeInfo.seckillStock); this.$set( this.attr.productSelect, "unique", @@ -289,7 +289,7 @@ ChangeCartNum: function (res) { var that = this; if (res) { - if (that.attr.productSelect.cart_num < that.storeInfo.stock) { + if (that.attr.productSelect.cart_num < that.storeInfo.seckillStock) { that.attr.productSelect.cart_num++; this.cartNum++; } @@ -307,15 +307,15 @@ if (productSelect) { this.attr.productAttr[res.indexw].index = res.indexn; this.$set(this.attr.productSelect, "image", productSelect.image); - this.$set(this.attr.productSelect, "price", productSelect.price); - this.$set(this.attr.productSelect, "stock", productSelect.stock); + this.$set(this.attr.productSelect, "price", productSelect.seckillPrice); + this.$set(this.attr.productSelect, "stock", productSelect.seckillStock); this.$set(this.attr.productSelect, "unique", productSelect.unique); this.$set(this.attr.productSelect, "cart_num", 1); this.$set(this, "attrValue", res.value); this.$set(this, "attrTxt", "已选择"); } else { this.$set(this.attr.productSelect, "image", this.storeInfo.image); - this.$set(this.attr.productSelect, "price", this.storeInfo.price); + this.$set(this.attr.productSelect, "price", this.storeInfo.seckillPrice); this.$set(this.attr.productSelect, "stock", 0); this.$set(this.attr.productSelect, "unique", ""); this.$set(this.attr.productSelect, "cart_num", 0); diff --git a/pages/home/components/Live.vue b/pages/home/components/Live.vue index cf2a752..1f71da4 100644 --- a/pages/home/components/Live.vue +++ b/pages/home/components/Live.vue @@ -8,7 +8,7 @@ - + @@ -113,28 +113,29 @@ }, // 轮询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.liveStatus == 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.roomId + // }) + // .then(res => { + // // 101: 直播中, 102: 未开始, 103: 已结束, 104: 禁播, 105: 暂停中, 106: 异常,107:已过期 + // that.detail.liveStatus = res.liveStatus; + // }) + // .catch(err => { + // console.log('get live status', err); + // }); + // } }, goRoom(live) { + console.log(live.roomId,9999) wx.navigateTo({ url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${live.roomId}` }); diff --git a/pages/shop/Live/LiveList/index.vue b/pages/shop/Live/LiveList/index.vue index d01f97b..9cb7eb8 100644 --- a/pages/shop/Live/LiveList/index.vue +++ b/pages/shop/Live/LiveList/index.vue @@ -11,7 +11,7 @@ - + @@ -40,6 +40,12 @@ name: '全部', code: '' }, + { + title: 'prevue', + name: '预告', + code: '102' + + }, { title: 'living', name: '直播中',