升级小程序直播组件版本1.1.9
首页直播间列表点击全部进入一个直播bug 活动商品拼sku显示价格与库存为共享库存的bug 更改直播间id ->roomId 直播中开放轮询直播状态接口 直播回放不生效的问题,因为直播组件版本太低
This commit is contained in:
@ -19,7 +19,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<slot name="liveGoods">
|
<slot name="liveGoods">
|
||||||
<view class="live-goods" v-if="detail.product.length">
|
<view class="live-goods" v-if="detail.product.length">
|
||||||
<view class="live-goods__item" v-for="(goods, index) in detail.product" :key="goods.id" v-if="index < 3">
|
<view class="live-goods__item" v-for="(goods, index) in detail.product" :key="goods.goodsId" v-if="index < 3">
|
||||||
<image class="live-goods__img" :src="goods.coverImgeUrl" mode=""></image>
|
<image class="live-goods__img" :src="goods.coverImgeUrl" mode=""></image>
|
||||||
<view class="live-goods__price" v-if="index < 2">¥{{ goods.price }}</view>
|
<view class="live-goods__price" v-if="index < 2">¥{{ goods.price }}</view>
|
||||||
<view class="live-goods__mark" v-else>
|
<view class="live-goods__mark" v-else>
|
||||||
@ -95,10 +95,10 @@
|
|||||||
this.getLiveStatus();
|
this.getLiveStatus();
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// let that = this;
|
let that = this;
|
||||||
// timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
// that.getLiveStatus();
|
that.getLiveStatus();
|
||||||
// }, 60000);
|
}, 60000);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
timer = null;
|
timer = null;
|
||||||
@ -112,26 +112,26 @@
|
|||||||
},
|
},
|
||||||
// 轮询liveStatus
|
// 轮询liveStatus
|
||||||
getLiveStatus() {
|
getLiveStatus() {
|
||||||
// if (HAS_LIVE) {
|
if (HAS_LIVE) {
|
||||||
// let that = this;
|
let that = this;
|
||||||
// let date = '';
|
let date = '';
|
||||||
// if (that.detail.liveStatus == 102) {
|
if (that.detail.liveStatus == 102) {
|
||||||
// date = that.$tools.dateFormat('mm-dd HH:MM', new Date(that.detail.starttime * 1000)).replace('-',
|
// date = that.$tools.dateFormat('mm-dd HH:MM', new Date(that.detail.starttime * 1000)).replace('-',
|
||||||
// '/');
|
// '/');
|
||||||
// that.liveStatus['102'].title = '预告 ' + date;
|
that.liveStatus['102'].title = '预告 ' ;
|
||||||
// }
|
}
|
||||||
// livePlayer
|
livePlayer
|
||||||
// .getLiveStatus({
|
.getLiveStatus({
|
||||||
// room_id: that.detail.room_id
|
room_id: that.detail.roomId
|
||||||
// })
|
})
|
||||||
// .then(res => {
|
.then(res => {
|
||||||
// // 101: 直播中, 102: 未开始, 103: 已结束, 104: 禁播, 105: 暂停中, 106: 异常,107:已过期
|
// 101: 直播中, 102: 未开始, 103: 已结束, 104: 禁播, 105: 暂停中, 106: 异常,107:已过期
|
||||||
// that.detail.liveStatus = res.liveStatus;
|
that.detail.liveStatus = res.liveStatus;
|
||||||
// })
|
})
|
||||||
// .catch(err => {
|
.catch(err => {
|
||||||
// console.log('get live status', err);
|
console.log('get live status', err);
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -143,7 +143,7 @@
|
|||||||
"plugins": {
|
"plugins": {
|
||||||
"live-player-plugin": {
|
"live-player-plugin": {
|
||||||
// 注意填写该直播组件最新版本号,微信开发者工具调试时可获取最新版本号(复制时请去掉注释)
|
// 注意填写该直播组件最新版本号,微信开发者工具调试时可获取最新版本号(复制时请去掉注释)
|
||||||
"version": "1.0.15",
|
"version": "1.1.9",
|
||||||
// 必须填该直播组件appid,该示例值即为直播组件appid(复制时请去掉注释)
|
// 必须填该直播组件appid,该示例值即为直播组件appid(复制时请去掉注释)
|
||||||
"provider": "wx2b03c6e691cd7370"
|
"provider": "wx2b03c6e691cd7370"
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,7 @@
|
|||||||
} else {
|
} else {
|
||||||
that.posterData.title = that.storeInfo.title;
|
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.posterData.code = that.storeInfo.code_base;
|
||||||
that.domStatus = true;
|
that.domStatus = true;
|
||||||
console.log(this.storeInfo)
|
console.log(this.storeInfo)
|
||||||
@ -319,8 +319,8 @@
|
|||||||
this.storeInfo.title
|
this.storeInfo.title
|
||||||
);
|
);
|
||||||
this.$set(this.attr.productSelect, "image", productSelect.image);
|
this.$set(this.attr.productSelect, "image", productSelect.image);
|
||||||
this.$set(this.attr.productSelect, "price", productSelect.price);
|
this.$set(this.attr.productSelect, "price", productSelect.pinkPrice);
|
||||||
this.$set(this.attr.productSelect, "stock", productSelect.stock);
|
this.$set(this.attr.productSelect, "stock", productSelect.pinkStock);
|
||||||
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
||||||
this.$set(this.attr.productSelect, "cart_num", 1);
|
this.$set(this.attr.productSelect, "cart_num", 1);
|
||||||
this.$set(this, "attrValue", value.sort().join(","));
|
this.$set(this, "attrValue", value.sort().join(","));
|
||||||
@ -332,7 +332,7 @@
|
|||||||
this.storeInfo.title
|
this.storeInfo.title
|
||||||
);
|
);
|
||||||
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
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, "stock", 0);
|
||||||
this.$set(this.attr.productSelect, "unique", "");
|
this.$set(this.attr.productSelect, "unique", "");
|
||||||
this.$set(this.attr.productSelect, "cart_num", 0);
|
this.$set(this.attr.productSelect, "cart_num", 0);
|
||||||
@ -345,8 +345,8 @@
|
|||||||
this.storeInfo.title
|
this.storeInfo.title
|
||||||
);
|
);
|
||||||
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
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", this.storeInfo.stock);
|
this.$set(this.attr.productSelect, "stock", this.storeInfo.pinkStock);
|
||||||
this.$set(
|
this.$set(
|
||||||
this.attr.productSelect,
|
this.attr.productSelect,
|
||||||
"unique",
|
"unique",
|
||||||
@ -418,15 +418,15 @@
|
|||||||
if (productSelect) {
|
if (productSelect) {
|
||||||
this.attr.productAttr[res.indexw].index = res.indexn;
|
this.attr.productAttr[res.indexw].index = res.indexn;
|
||||||
this.$set(this.attr.productSelect, "image", productSelect.image);
|
this.$set(this.attr.productSelect, "image", productSelect.image);
|
||||||
this.$set(this.attr.productSelect, "price", productSelect.price);
|
this.$set(this.attr.productSelect, "price", productSelect.pinkPrice);
|
||||||
this.$set(this.attr.productSelect, "stock", productSelect.stock);
|
this.$set(this.attr.productSelect, "stock", productSelect.pinkStock);
|
||||||
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
||||||
this.$set(this.attr.productSelect, "cart_num", 1);
|
this.$set(this.attr.productSelect, "cart_num", 1);
|
||||||
this.$set(this, "attrValue", res.value);
|
this.$set(this, "attrValue", res.value);
|
||||||
this.$set(this, "attrTxt", "已选择");
|
this.$set(this, "attrTxt", "已选择");
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
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, "stock", 0);
|
||||||
this.$set(this.attr.productSelect, "unique", "");
|
this.$set(this.attr.productSelect, "unique", "");
|
||||||
this.$set(this.attr.productSelect, "cart_num", 0);
|
this.$set(this.attr.productSelect, "cart_num", 0);
|
||||||
|
@ -237,8 +237,8 @@
|
|||||||
this.storeInfo.title
|
this.storeInfo.title
|
||||||
);
|
);
|
||||||
this.$set(this.attr.productSelect, "image", productSelect.image);
|
this.$set(this.attr.productSelect, "image", productSelect.image);
|
||||||
this.$set(this.attr.productSelect, "price", productSelect.price);
|
this.$set(this.attr.productSelect, "price", productSelect.seckillPrice);
|
||||||
this.$set(this.attr.productSelect, "stock", productSelect.stock);
|
this.$set(this.attr.productSelect, "stock", productSelect.seckillStock);
|
||||||
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
||||||
this.$set(this.attr.productSelect, "cart_num", 1);
|
this.$set(this.attr.productSelect, "cart_num", 1);
|
||||||
this.$set(this, "attrValue", value.sort().join(","));
|
this.$set(this, "attrValue", value.sort().join(","));
|
||||||
@ -250,7 +250,7 @@
|
|||||||
this.storeInfo.title
|
this.storeInfo.title
|
||||||
);
|
);
|
||||||
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
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, "stock", 0);
|
||||||
this.$set(this.attr.productSelect, "unique", "");
|
this.$set(this.attr.productSelect, "unique", "");
|
||||||
this.$set(this.attr.productSelect, "cart_num", 0);
|
this.$set(this.attr.productSelect, "cart_num", 0);
|
||||||
@ -263,8 +263,8 @@
|
|||||||
this.storeInfo.title
|
this.storeInfo.title
|
||||||
);
|
);
|
||||||
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
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", this.storeInfo.stock);
|
this.$set(this.attr.productSelect, "stock", this.storeInfo.seckillStock);
|
||||||
this.$set(
|
this.$set(
|
||||||
this.attr.productSelect,
|
this.attr.productSelect,
|
||||||
"unique",
|
"unique",
|
||||||
@ -289,7 +289,7 @@
|
|||||||
ChangeCartNum: function (res) {
|
ChangeCartNum: function (res) {
|
||||||
var that = this;
|
var that = this;
|
||||||
if (res) {
|
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++;
|
that.attr.productSelect.cart_num++;
|
||||||
this.cartNum++;
|
this.cartNum++;
|
||||||
}
|
}
|
||||||
@ -307,15 +307,15 @@
|
|||||||
if (productSelect) {
|
if (productSelect) {
|
||||||
this.attr.productAttr[res.indexw].index = res.indexn;
|
this.attr.productAttr[res.indexw].index = res.indexn;
|
||||||
this.$set(this.attr.productSelect, "image", productSelect.image);
|
this.$set(this.attr.productSelect, "image", productSelect.image);
|
||||||
this.$set(this.attr.productSelect, "price", productSelect.price);
|
this.$set(this.attr.productSelect, "price", productSelect.seckillPrice);
|
||||||
this.$set(this.attr.productSelect, "stock", productSelect.stock);
|
this.$set(this.attr.productSelect, "stock", productSelect.seckillStock);
|
||||||
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
||||||
this.$set(this.attr.productSelect, "cart_num", 1);
|
this.$set(this.attr.productSelect, "cart_num", 1);
|
||||||
this.$set(this, "attrValue", res.value);
|
this.$set(this, "attrValue", res.value);
|
||||||
this.$set(this, "attrTxt", "已选择");
|
this.$set(this, "attrTxt", "已选择");
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
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, "stock", 0);
|
||||||
this.$set(this.attr.productSelect, "unique", "");
|
this.$set(this.attr.productSelect, "unique", "");
|
||||||
this.$set(this.attr.productSelect, "cart_num", 0);
|
this.$set(this.attr.productSelect, "cart_num", 0);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content-one">
|
<view class="content-one">
|
||||||
<view class="content-one__item" v-for="live in detail" :key="live.id" @tap="goRoom(live)">
|
<view class="content-one__item" v-for="live in detail" :key="live.roomId" @tap="goRoom(live)">
|
||||||
<image class="item-cover" :src="live.shareImge" mode="widthFix"></image>
|
<image class="item-cover" :src="live.shareImge" mode="widthFix"></image>
|
||||||
<view class="item-status">
|
<view class="item-status">
|
||||||
<image class="status-img" :src="liveStatus[live.liveStatus].img" mode=""></image>
|
<image class="status-img" :src="liveStatus[live.liveStatus].img" mode=""></image>
|
||||||
@ -116,18 +116,18 @@
|
|||||||
// if (HAS_LIVE) {
|
// if (HAS_LIVE) {
|
||||||
// let that = this;
|
// let that = this;
|
||||||
// let date = '';
|
// let date = '';
|
||||||
// if (that.detail.live_status == 102) {
|
// if (that.detail.liveStatus == 102) {
|
||||||
// date = that.$tools.dateFormat('mm-dd HH:MM', new Date(that.detail.starttime * 1000)).replace('-',
|
// date = that.$tools.dateFormat('mm-dd HH:MM', new Date(that.detail.starttime * 1000)).replace('-',
|
||||||
// '/');
|
// '/');
|
||||||
// that.liveStatus['102'].title = '预告 ' + date;
|
// that.liveStatus['102'].title = '预告 ' + date;
|
||||||
// }
|
// }
|
||||||
// livePlayer
|
// livePlayer
|
||||||
// .getLiveStatus({
|
// .getLiveStatus({
|
||||||
// room_id: that.detail.room_id
|
// room_id: that.detail.roomId
|
||||||
// })
|
// })
|
||||||
// .then(res => {
|
// .then(res => {
|
||||||
// // 101: 直播中, 102: 未开始, 103: 已结束, 104: 禁播, 105: 暂停中, 106: 异常,107:已过期
|
// // 101: 直播中, 102: 未开始, 103: 已结束, 104: 禁播, 105: 暂停中, 106: 异常,107:已过期
|
||||||
// that.detail.live_status = res.liveStatus;
|
// that.detail.liveStatus = res.liveStatus;
|
||||||
// })
|
// })
|
||||||
// .catch(err => {
|
// .catch(err => {
|
||||||
// console.log('get live status', err);
|
// console.log('get live status', err);
|
||||||
@ -135,6 +135,7 @@
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
goRoom(live) {
|
goRoom(live) {
|
||||||
|
console.log(live.roomId,9999)
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${live.roomId}`
|
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${live.roomId}`
|
||||||
});
|
});
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<view class="content_box">
|
<view class="content_box">
|
||||||
<scroll-view scroll-y="true" @scrolltolower="loadMore" class="scroll-box">
|
<scroll-view scroll-y="true" @scrolltolower="loadMore" class="scroll-box">
|
||||||
<view class="list-box">
|
<view class="list-box">
|
||||||
<block v-for="live in liveList" :key="live.id">
|
<block v-for="live in liveList" :key="live.roomId">
|
||||||
<shopro-live-card :detail="live"></shopro-live-card>
|
<shopro-live-card :detail="live"></shopro-live-card>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
@ -39,6 +39,12 @@
|
|||||||
title: 'all',
|
title: 'all',
|
||||||
name: '全部',
|
name: '全部',
|
||||||
code: ''
|
code: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'prevue',
|
||||||
|
name: '预告',
|
||||||
|
code: '102'
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'living',
|
title: 'living',
|
||||||
|
Reference in New Issue
Block a user