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: '直播中',