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 {
},
// 获取直播配置
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 @@
v-if="info.liveBroadcastState<2&&guestBookList"
:guestBookList="guestBookList"
:updateVal="updateVal"
:isSend="isSend"
:fixedHeight="getBottom"
></livedIsMsg>
<!-- 带货商品层 -->
<livedExplainingCommodities
......@@ -58,7 +60,7 @@
</div>
</template>
<template v-else>
<div class="sendOut" :style="{'bottom':getBottom}">
<div class="sendOut" :style="{'bottom':getBottom+'px'}">
<input
class="sendIpt"
:adjust-position="false"
......@@ -275,7 +277,7 @@ export default {
},
// 获取焦点
onFocus(e){
this.getBottom=(e.mp.detail.height-10)+'px';
this.getBottom=(e.mp.detail.height-10);
},
// 点击发送留言
toSend() {
......
......@@ -7,6 +7,7 @@
:class="{isEC:item.upperScreenState==1}"
v-for="(item,index) in list"
:key="index"
@click="toGoodsInfo(item)"
>
<img :src="item.productImgUrl" alt />
<p class="num">{{item.number}}</p>
......@@ -15,7 +16,7 @@
</div>
<!-- 左上角展示讲解中商品 -->
<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 />
<!-- <p class="num">{{item.number}}</p> -->
<div class="explain" v-if="item.upperScreenState==1">讲解中</div>
......@@ -29,6 +30,7 @@
<script type="text/ecmascript-6">
import { DFSImg } from "@/utils/index";
import live from "@/api/live";
export default {
props: ["updateGoods", "goodsList"],
name: "",
......@@ -86,6 +88,25 @@ export default {
},
mounted() {},
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类型
* @param {Object} obj
......
......@@ -10,6 +10,7 @@
<div class="list" v-if="list.length>0">
<div class="item" v-for="(item,index) in list" :key="index">
<div class="img" @click="toGoodsInfo(item)">
<div class="num">{{item.number}}</div>
<img v-if="item.productImgUrl" :src="item.productImgUrl" alt />
</div>
<div class="info">
......@@ -26,7 +27,7 @@
</p>-->
</div>
<div class="icon" @click="isLogin(item)">
<van-icon name="shopping-cart" />
<img src="../../../static/images/lived/shopCart.png" alt="">
</div>
</div>
</div>
......@@ -201,6 +202,9 @@ export default {
</script>
<style lang="scss" scoped>
img{
display: block;
}
.livedGoodsList {
.list {
.item {
......@@ -213,11 +217,22 @@ export default {
border-radius: 6px;
overflow: hidden;
background: #999;
position: relative;
img {
width: 100%;
height: 100%;
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 {
flex: 1;
......@@ -249,8 +264,10 @@ export default {
}
}
.icon {
font-size: 22px;
color: #ff8181;
img{
width: 30px;
height: 26px;
}
}
}
}
......
......@@ -30,6 +30,7 @@
<div class="list">
<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="num">{{item.number}}</div>
<img :src="item.productImgUrl" alt />
</div>
<div class="info">
......@@ -40,7 +41,7 @@
<span>{{item.minPrice}}</span>
</p>
<div class="icon" @click="isLogin(item)">
<van-icon name="shopping-cart" />
<img src="../../../static/images/lived/shopCart.png" alt="">
</div>
</div>
</div>
......@@ -271,7 +272,7 @@ export default {
padding: 0 4px 6px 0;
}
.list {
max-height: 50vh;
max-height: 48vh;
overflow-y: auto;
.item {
padding: 14px 4px;
......@@ -281,11 +282,22 @@ export default {
height: 100px;
border-radius: 6px;
overflow: hidden;
position: relative;
img {
width: 100%;
height: 100%;
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 {
flex: 1;
......@@ -308,14 +320,16 @@ export default {
color: #ff0000;
}
.icon {
font-size: 22px;
color: #ff8181;
img{
width: 30px;
height: 26px;
}
}
}
}
}
.itemBorder{
border-bottom: 0.5px solid #b8b8b8;
border-bottom: 0.5px solid #EEEEED;
}
}
}
......
<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">
<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">
......@@ -18,7 +18,7 @@
<script type="text/ecmascript-6">
export default {
props:["guestBookList","updateVal"],
props:["guestBookList","updateVal","isSend","fixedHeight"],
name: "",
data() {
return {
......@@ -61,13 +61,14 @@ export default {
padding: 8px;
margin-bottom: 10px;
position: relative;
width: 60vw;
.list {
width: 50vw;
width: 60vw;
max-height: 24vh;
overflow: hidden;
bottom: 0;
.item {
width: 50vw;
width: 60vw;
padding: 4px 0;
display: flex;
align-items: flex-start;
......@@ -85,4 +86,9 @@ export default {
}
}
}
.livedIsMsgFixed{
position: absolute;
margin: 0;
left: 12px;
}
</style>
......@@ -15,6 +15,7 @@
</template>
<script type="text/ecmascript-6">
import live from "@/api/live";
export default {
props: ["showPosterDia", "posterInfo"],
name: "",
......@@ -127,6 +128,11 @@ export default {
});
},
getImg() {
let query = {
liveBroadcastId: this.liveId,
shareType: "HB"
};
live.addShareRecord(query).then();
this.handleSave();
},
// 点击保存时,将画布生成海报
......
......@@ -132,8 +132,8 @@ export default {
computed: {},
onLoad(options) {
wx.setKeepScreenOn({
keepScreenOn: true
})
keepScreenOn: true
});
getNavbarInfo(res => {
console.log(res, "--------------------125");
this.navTop = res.navTop;
......@@ -170,9 +170,11 @@ export default {
});
}
this.init();
this.infoTiming = setInterval(() => {
this.timingGetInfo();
}, 5000);
setTimeout(() => {
this.infoTiming = setInterval(() => {
this.timingGetInfo();
}, 5000);
}, 2000);
this.userEntry("IN");
// 通过分享进入直播间重新查询订阅消息配置
......@@ -181,6 +183,11 @@ export default {
},
onShareAppMessage(options) {
let query = {
liveBroadcastId: this.liveId,
shareType: "WX"
};
live.addShareRecord(query).then();
let _this = this;
if (this.hasInvitationStatus == 1) {
Object.assign(this.params, this.params, this.spokesmanObj);
......@@ -189,7 +196,7 @@ export default {
let shareObj = {
title: this.liveNoticeInfo.title,
path: `/pages/lived/main?params=${JSON.stringify(this.params)}`,
imageUrl: this.liveNoticeInfo.coverUrl,
imageUrl: this.liveNoticeInfo.shareUrl,
success: function(res) {
console.log("-----------success");
// 转发成功之后的回调
......@@ -239,6 +246,9 @@ export default {
this.liveNoticeInfo.coverUrl = this.liveNoticeInfo.coverUrl
? DFSImg(this.liveNoticeInfo.coverUrl)
: "";
this.liveNoticeInfo.shareUrl = this.liveNoticeInfo.coverUrl
? DFSImg(this.liveNoticeInfo.coverUrl,500,400)
: "";
this.getGoodsList();
if (this.liveNoticeInfo.liveBroadcastState == 2) {
// 调直播结束
......@@ -340,19 +350,6 @@ export default {
this.liveNoticeInfo.liveBroadcastState == 1 &&
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 (
this.liveNoticeInfo.liveBroadcastState == 0 &&
resData.liveState == "IN_LIVE"
......@@ -382,15 +379,28 @@ export default {
this.liveNoticeInfo.liveBroadcastState == 1 &&
resData.liveState == "PAUSE_LIVE"
) {
this.liveNoticeInfo.liveBroadcastState = 3
this.liveNoticeInfo.liveBroadcastState = 3;
} else if (
this.liveNoticeInfo.liveBroadcastState == 3 &&
resData.liveState == "IN_LIVE"
) {
this.liveNoticeInfo.liveBroadcastState = 1
this.liveNoticeInfo.liveBroadcastState = 1;
}
this.guestBookList = resData.guestBookList; //评论列表
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(); //监听使用数据
} else {
if (this.infoTiming) {
......@@ -564,7 +574,11 @@ img {
}
}
.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;
color: #fff;
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