Browse Source

升级小程序直播组件版本1.1.9

首页直播间列表点击全部进入一个直播bug
活动商品拼sku显示价格与库存为共享库存的bug
更改直播间id ->roomId
直播中开放轮询直播状态接口
直播回放不生效的问题,因为直播组件版本太低
zyh
xuwenbo 4 years ago
parent
commit
3a847ac185
  1. 52
      components/ShoproLiveCard.vue
  2. 2
      manifest.json
  3. 18
      pages/activity/GroupDetails/index.vue
  4. 18
      pages/activity/SeckillDetails/index.vue
  5. 43
      pages/home/components/Live.vue
  6. 8
      pages/shop/Live/LiveList/index.vue

52
components/ShoproLiveCard.vue

@ -19,7 +19,7 @@
</view>
<slot name="liveGoods">
<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>
<view class="live-goods__price" v-if="index < 2">{{ goods.price }}</view>
<view class="live-goods__mark" v-else>
@ -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 @@
}
}
}
</style>
</style>

2
manifest.json

@ -143,7 +143,7 @@
"plugins": {
"live-player-plugin": {
//
"version": "1.0.15",
"version": "1.1.9",
// appidappid
"provider": "wx2b03c6e691cd7370"
}

18
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);

18
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);

43
pages/home/components/Live.vue

@ -8,7 +8,7 @@
</view>
</view>
<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>
<view class="item-status">
<image class="status-img" :src="liveStatus[live.liveStatus].img" mode=""></image>
@ -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}`
});

8
pages/shop/Live/LiveList/index.vue

@ -11,7 +11,7 @@
<view class="content_box">
<scroll-view scroll-y="true" @scrolltolower="loadMore" class="scroll-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>
</block>
</view>
@ -40,6 +40,12 @@
name: '全部',
code: ''
},
{
title: 'prevue',
name: '预告',
code: '102'
},
{
title: 'living',
name: '直播中',

Loading…
Cancel
Save