Commit be538a91 by 程默

Merge branch 'product_dev' of http://code.mayi888.com/chengmo/mayi-mp-shop into product_dev

parents c3fddab7 70a9fe33
...@@ -63,6 +63,10 @@ export default { ...@@ -63,6 +63,10 @@ export default {
}, },
// 获取直播配置 // 获取直播配置
getConfigValueByConfigCode(options) { getConfigValueByConfigCode(options) {
return requestPOST(`${process.env.OLSHOP_URL}/liveBroadcastInfo/getConfigValueByConfigCode?configCode`,options); return requestPOST(`${process.env.OLSHOP_URL}/liveBroadcastInfo/getConfigValueByConfigCode`,options);
},
// 分享时记录
addShareRecord(options) {
return requestPOST(`${process.env.OLSHOP_URL}/liveBroadcastInfo/addShareRecord`,options);
}, },
}; };
\ No newline at end of file
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
v-if="info.liveBroadcastState<2&&guestBookList" v-if="info.liveBroadcastState<2&&guestBookList"
:guestBookList="guestBookList" :guestBookList="guestBookList"
:updateVal="updateVal" :updateVal="updateVal"
:isSend="isSend"
:fixedHeight="getBottom"
></livedIsMsg> ></livedIsMsg>
<!-- 带货商品层 --> <!-- 带货商品层 -->
<livedExplainingCommodities <livedExplainingCommodities
...@@ -58,7 +60,7 @@ ...@@ -58,7 +60,7 @@
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div class="sendOut" :style="{'bottom':getBottom}"> <div class="sendOut" :style="{'bottom':getBottom+'px'}">
<input <input
class="sendIpt" class="sendIpt"
:adjust-position="false" :adjust-position="false"
...@@ -275,7 +277,7 @@ export default { ...@@ -275,7 +277,7 @@ export default {
}, },
// 获取焦点 // 获取焦点
onFocus(e){ onFocus(e){
this.getBottom=(e.mp.detail.height-10)+'px'; this.getBottom=(e.mp.detail.height-10);
}, },
// 点击发送留言 // 点击发送留言
toSend() { toSend() {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
:class="{isEC:item.upperScreenState==1}" :class="{isEC:item.upperScreenState==1}"
v-for="(item,index) in list" v-for="(item,index) in list"
:key="index" :key="index"
@click="toGoodsInfo(item)"
> >
<img :src="item.productImgUrl" alt /> <img :src="item.productImgUrl" alt />
<p class="num">{{item.number}}</p> <p class="num">{{item.number}}</p>
...@@ -15,7 +16,7 @@ ...@@ -15,7 +16,7 @@
</div> </div>
<!-- 左上角展示讲解中商品 --> <!-- 左上角展示讲解中商品 -->
<div class="fixedGoods" v-else-if="showFixedGoods&&fixedGoodsList&&fixedGoodsList.length>0"> <div class="fixedGoods" v-else-if="showFixedGoods&&fixedGoodsList&&fixedGoodsList.length>0">
<div class="goodsList" v-for="(item,index) in fixedGoodsList" :key="index"> <div class="goodsList" v-for="(item,index) in fixedGoodsList" :key="index" @click="toGoodsInfo(item)">
<img :src="item.productImgUrl" alt /> <img :src="item.productImgUrl" alt />
<!-- <p class="num">{{item.number}}</p> --> <!-- <p class="num">{{item.number}}</p> -->
<div class="explain" v-if="item.upperScreenState==1">讲解中</div> <div class="explain" v-if="item.upperScreenState==1">讲解中</div>
...@@ -29,6 +30,7 @@ ...@@ -29,6 +30,7 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import { DFSImg } from "@/utils/index"; import { DFSImg } from "@/utils/index";
import live from "@/api/live";
export default { export default {
props: ["updateGoods", "goodsList"], props: ["updateGoods", "goodsList"],
name: "", name: "",
...@@ -86,6 +88,25 @@ export default { ...@@ -86,6 +88,25 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
// 到商品详情
toGoodsInfo(val) {
// 点击商品埋点
let info={
liveBroadcastId:Number(this.liveId),
liveBroadcastGoodsId:Number(val.productId),
}
live.addLiveUserGoodsByUser(info).then(res=>{});
let query = {
fromLived: 1,
liveId: this.liveId
};
let backPath = `/goods/${val.productId}`;
wx.reLaunch({
url: `../index/main?from=livedToGoodsInfo&backpath=${
backPath
}&params=${JSON.stringify(query)}`
});
},
/** /**
* 判断此对象是否是Object类型 * 判断此对象是否是Object类型
* @param {Object} obj * @param {Object} obj
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<div class="list" v-if="list.length>0"> <div class="list" v-if="list.length>0">
<div class="item" v-for="(item,index) in list" :key="index"> <div class="item" v-for="(item,index) in list" :key="index">
<div class="img" @click="toGoodsInfo(item)"> <div class="img" @click="toGoodsInfo(item)">
<div class="num">{{item.number}}</div>
<img v-if="item.productImgUrl" :src="item.productImgUrl" alt /> <img v-if="item.productImgUrl" :src="item.productImgUrl" alt />
</div> </div>
<div class="info"> <div class="info">
...@@ -26,7 +27,7 @@ ...@@ -26,7 +27,7 @@
</p>--> </p>-->
</div> </div>
<div class="icon" @click="isLogin(item)"> <div class="icon" @click="isLogin(item)">
<van-icon name="shopping-cart" /> <img src="../../../static/images/lived/shopCart.png" alt="">
</div> </div>
</div> </div>
</div> </div>
...@@ -201,6 +202,9 @@ export default { ...@@ -201,6 +202,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
img{
display: block;
}
.livedGoodsList { .livedGoodsList {
.list { .list {
.item { .item {
...@@ -213,11 +217,22 @@ export default { ...@@ -213,11 +217,22 @@ export default {
border-radius: 6px; border-radius: 6px;
overflow: hidden; overflow: hidden;
background: #999; background: #999;
position: relative;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
} }
.num {
position: absolute;
top: 0;
left: 0;
color: #fff;
font-size: 12px;
background: #666;
padding: 2px 6px;
border-bottom-right-radius: 6px;
}
} }
.info { .info {
flex: 1; flex: 1;
...@@ -249,8 +264,10 @@ export default { ...@@ -249,8 +264,10 @@ export default {
} }
} }
.icon { .icon {
font-size: 22px; img{
color: #ff8181; width: 30px;
height: 26px;
}
} }
} }
} }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
<div class="list"> <div class="list">
<div class="item" v-for="(item,index) in list" :key="index" :class="{'itemBorder':index!=list.length-1}"> <div class="item" v-for="(item,index) in list" :key="index" :class="{'itemBorder':index!=list.length-1}">
<div class="img" @click="toGoodsInfo(item)"> <div class="img" @click="toGoodsInfo(item)">
<div class="num">{{item.number}}</div>
<img :src="item.productImgUrl" alt /> <img :src="item.productImgUrl" alt />
</div> </div>
<div class="info"> <div class="info">
...@@ -40,7 +41,7 @@ ...@@ -40,7 +41,7 @@
<span>{{item.minPrice}}</span> <span>{{item.minPrice}}</span>
</p> </p>
<div class="icon" @click="isLogin(item)"> <div class="icon" @click="isLogin(item)">
<van-icon name="shopping-cart" /> <img src="../../../static/images/lived/shopCart.png" alt="">
</div> </div>
</div> </div>
</div> </div>
...@@ -271,7 +272,7 @@ export default { ...@@ -271,7 +272,7 @@ export default {
padding: 0 4px 6px 0; padding: 0 4px 6px 0;
} }
.list { .list {
max-height: 50vh; max-height: 48vh;
overflow-y: auto; overflow-y: auto;
.item { .item {
padding: 14px 4px; padding: 14px 4px;
...@@ -281,11 +282,22 @@ export default { ...@@ -281,11 +282,22 @@ export default {
height: 100px; height: 100px;
border-radius: 6px; border-radius: 6px;
overflow: hidden; overflow: hidden;
position: relative;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
} }
.num {
position: absolute;
top: 0;
left: 0;
color: #fff;
font-size: 12px;
background: #666;
padding: 2px 6px;
border-bottom-right-radius: 6px;
}
} }
.info { .info {
flex: 1; flex: 1;
...@@ -308,14 +320,16 @@ export default { ...@@ -308,14 +320,16 @@ export default {
color: #ff0000; color: #ff0000;
} }
.icon { .icon {
font-size: 22px; img{
color: #ff8181; width: 30px;
height: 26px;
}
} }
} }
} }
} }
.itemBorder{ .itemBorder{
border-bottom: 0.5px solid #b8b8b8; border-bottom: 0.5px solid #EEEEED;
} }
} }
} }
......
<template> <template>
<!-- 评论模块 --> <!-- 评论模块 -->
<div class="livedIsMsg" v-if="list.length>0"> <div class="livedIsMsg" v-if="list.length>0" :class="{'livedIsMsgFixed':isSend}" :style="{'bottom':isSend?(fixedHeight+50)+'px':''}">
<div class="list"> <div class="list">
<scroll-view :style="{'height': '24vh','width':'52vw'}" :scroll-y="true" :scroll-top="scrollTop" :scroll-with-animation="true" @scrolltolower="scrolltolower"> <scroll-view :style="{'height': '24vh','width':'52vw'}" :scroll-y="true" :scroll-top="scrollTop" :scroll-with-animation="true" @scrolltolower="scrolltolower">
<div class="item flex" v-for="(item,index) in list" :key="index"> <div class="item flex" v-for="(item,index) in list" :key="index">
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
export default { export default {
props:["guestBookList","updateVal"], props:["guestBookList","updateVal","isSend","fixedHeight"],
name: "", name: "",
data() { data() {
return { return {
...@@ -61,13 +61,14 @@ export default { ...@@ -61,13 +61,14 @@ export default {
padding: 8px; padding: 8px;
margin-bottom: 10px; margin-bottom: 10px;
position: relative; position: relative;
width: 60vw;
.list { .list {
width: 50vw; width: 60vw;
max-height: 24vh; max-height: 24vh;
overflow: hidden; overflow: hidden;
bottom: 0; bottom: 0;
.item { .item {
width: 50vw; width: 60vw;
padding: 4px 0; padding: 4px 0;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
...@@ -85,4 +86,9 @@ export default { ...@@ -85,4 +86,9 @@ export default {
} }
} }
} }
.livedIsMsgFixed{
position: absolute;
margin: 0;
left: 12px;
}
</style> </style>
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import live from "@/api/live";
export default { export default {
props: ["showPosterDia", "posterInfo"], props: ["showPosterDia", "posterInfo"],
name: "", name: "",
...@@ -127,6 +128,11 @@ export default { ...@@ -127,6 +128,11 @@ export default {
}); });
}, },
getImg() { getImg() {
let query = {
liveBroadcastId: this.liveId,
shareType: "HB"
};
live.addShareRecord(query).then();
this.handleSave(); this.handleSave();
}, },
// 点击保存时,将画布生成海报 // 点击保存时,将画布生成海报
......
...@@ -132,8 +132,8 @@ export default { ...@@ -132,8 +132,8 @@ export default {
computed: {}, computed: {},
onLoad(options) { onLoad(options) {
wx.setKeepScreenOn({ wx.setKeepScreenOn({
keepScreenOn: true keepScreenOn: true
}) });
getNavbarInfo(res => { getNavbarInfo(res => {
console.log(res, "--------------------125"); console.log(res, "--------------------125");
this.navTop = res.navTop; this.navTop = res.navTop;
...@@ -170,9 +170,11 @@ export default { ...@@ -170,9 +170,11 @@ export default {
}); });
} }
this.init(); this.init();
this.infoTiming = setInterval(() => { setTimeout(() => {
this.timingGetInfo(); this.infoTiming = setInterval(() => {
}, 5000); this.timingGetInfo();
}, 5000);
}, 2000);
this.userEntry("IN"); this.userEntry("IN");
// 通过分享进入直播间重新查询订阅消息配置 // 通过分享进入直播间重新查询订阅消息配置
...@@ -181,6 +183,11 @@ export default { ...@@ -181,6 +183,11 @@ export default {
}, },
onShareAppMessage(options) { onShareAppMessage(options) {
let query = {
liveBroadcastId: this.liveId,
shareType: "WX"
};
live.addShareRecord(query).then();
let _this = this; let _this = this;
if (this.hasInvitationStatus == 1) { if (this.hasInvitationStatus == 1) {
Object.assign(this.params, this.params, this.spokesmanObj); Object.assign(this.params, this.params, this.spokesmanObj);
...@@ -189,7 +196,7 @@ export default { ...@@ -189,7 +196,7 @@ export default {
let shareObj = { let shareObj = {
title: this.liveNoticeInfo.title, title: this.liveNoticeInfo.title,
path: `/pages/lived/main?params=${JSON.stringify(this.params)}`, path: `/pages/lived/main?params=${JSON.stringify(this.params)}`,
imageUrl: this.liveNoticeInfo.coverUrl, imageUrl: this.liveNoticeInfo.shareUrl,
success: function(res) { success: function(res) {
console.log("-----------success"); console.log("-----------success");
// 转发成功之后的回调 // 转发成功之后的回调
...@@ -239,6 +246,9 @@ export default { ...@@ -239,6 +246,9 @@ export default {
this.liveNoticeInfo.coverUrl = this.liveNoticeInfo.coverUrl this.liveNoticeInfo.coverUrl = this.liveNoticeInfo.coverUrl
? DFSImg(this.liveNoticeInfo.coverUrl) ? DFSImg(this.liveNoticeInfo.coverUrl)
: ""; : "";
this.liveNoticeInfo.shareUrl = this.liveNoticeInfo.coverUrl
? DFSImg(this.liveNoticeInfo.coverUrl,500,400)
: "";
this.getGoodsList(); this.getGoodsList();
if (this.liveNoticeInfo.liveBroadcastState == 2) { if (this.liveNoticeInfo.liveBroadcastState == 2) {
// 调直播结束 // 调直播结束
...@@ -340,19 +350,6 @@ export default { ...@@ -340,19 +350,6 @@ export default {
this.liveNoticeInfo.liveBroadcastState == 1 && this.liveNoticeInfo.liveBroadcastState == 1 &&
resData.liveState == "IN_LIVE" resData.liveState == "IN_LIVE"
) { ) {
// 直播中且接口直播中---主要操作
// 数据初始化
this.entryNoticeText = "";
this.liveNoticeInfo.watchNum = resData.watchNum; //观看人数
if (resData.entryNoticeList.length > 0) {
if (resData.entryNoticeList.length == 1) {
this.entryNoticeText = `${resData.entryNoticeList[0].userName}`; //用户进入
} else {
this.entryNoticeText = `${
resData.entryNoticeList[0].userName
}${resData.entryNoticeList.length}人`; //用户进入
}
}
} else if ( } else if (
this.liveNoticeInfo.liveBroadcastState == 0 && this.liveNoticeInfo.liveBroadcastState == 0 &&
resData.liveState == "IN_LIVE" resData.liveState == "IN_LIVE"
...@@ -382,15 +379,28 @@ export default { ...@@ -382,15 +379,28 @@ export default {
this.liveNoticeInfo.liveBroadcastState == 1 && this.liveNoticeInfo.liveBroadcastState == 1 &&
resData.liveState == "PAUSE_LIVE" resData.liveState == "PAUSE_LIVE"
) { ) {
this.liveNoticeInfo.liveBroadcastState = 3 this.liveNoticeInfo.liveBroadcastState = 3;
} else if ( } else if (
this.liveNoticeInfo.liveBroadcastState == 3 && this.liveNoticeInfo.liveBroadcastState == 3 &&
resData.liveState == "IN_LIVE" resData.liveState == "IN_LIVE"
) { ) {
this.liveNoticeInfo.liveBroadcastState = 1 this.liveNoticeInfo.liveBroadcastState = 1;
} }
this.guestBookList = resData.guestBookList; //评论列表 this.guestBookList = resData.guestBookList; //评论列表
this.likeInfo = resData.likeInfo; //点赞信息 this.likeInfo = resData.likeInfo; //点赞信息
// 直播中且接口直播中---主要操作
// 数据初始化
this.entryNoticeText = "";
this.liveNoticeInfo.watchNum = resData.watchNum; //观看人数
if (resData.entryNoticeList.length > 0) {
if (resData.entryNoticeList.length == 1) {
this.entryNoticeText = `${resData.entryNoticeList[0].userName}`; //用户进入
} else {
this.entryNoticeText = `${resData.entryNoticeList[0].userName}${
resData.entryNoticeList.length
}人`; //用户进入
}
}
this.updateVal = Math.random(); //监听使用数据 this.updateVal = Math.random(); //监听使用数据
} else { } else {
if (this.infoTiming) { if (this.infoTiming) {
...@@ -564,7 +574,11 @@ img { ...@@ -564,7 +574,11 @@ img {
} }
} }
.toShop { .toShop {
background:linear-gradient(90deg,rgba(255,135,125,1),rgba(251,86,109,1)); background: linear-gradient(
90deg,
rgba(255, 135, 125, 1),
rgba(251, 86, 109, 1)
);
padding: 0 8px; padding: 0 8px;
color: #fff; color: #fff;
font-size: 14px; font-size: 14px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment