Commit 39db792e by 程智春

直播

parent 841a3502
module.exports = { module.exports = {
SHOP_MIXID:"'zjgyl'", // SHOP_MIXID:"'zjgyl'",
SHOP_MIXID:"'ant'",
NODE_ENV: '"production"', NODE_ENV: '"production"',
BASE_URL:"'https://shop.mayi888.com'", BASE_URL:"'https://shop.mayi888.com'",
OLSHOP_URL:'"https://shop.mayi888.com/innerApi/shopApiService"', OLSHOP_URL:'"https://shop.mayi888.com/innerApi/shopApiService"',
IMG_DOMAIN: '"http://cdn.mayi888.com"' IMG_DOMAIN: '"https://mayi-newshop.oss-cn-shanghai.aliyuncs.com"'
// IMG_DOMAIN: '"http://cdn.mayi888.com"'
} }
...@@ -58,8 +58,8 @@ export default { ...@@ -58,8 +58,8 @@ export default {
return requestPOST(`${process.env.OLSHOP_URL}/broadcastReminderRecord/addLiveNoticeByCustomer`,options); return requestPOST(`${process.env.OLSHOP_URL}/broadcastReminderRecord/addLiveNoticeByCustomer`,options);
}, },
// 获取小程序码 // 获取小程序码
getLiveQRCode(options) { getLiveQRCode(options,data) {
return requestGET(`${process.env.OLSHOP_URL}/liveBroadcastInfo/getLiveQRCode?id=${options}`); return requestGET(`${process.env.OLSHOP_URL}/liveBroadcastInfo/getLiveQRCode?id=${options}&kl=${data}`);
}, },
// 获取直播配置 // 获取直播配置
getConfigValueByConfigCode(options) { getConfigValueByConfigCode(options) {
......
...@@ -154,8 +154,17 @@ export default { ...@@ -154,8 +154,17 @@ export default {
}, },
created() {}, created() {},
onLoad(options) { onLoad(options) {
let params = JSON.parse(options.params); if(options.params){
this.liveId = params.liveId; let params = JSON.parse(options.params);
this.liveId = params.liveId;
}else if(options.scene){
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
console.log(scene)
let sceneInfo = scene.split(',')
console.log('sceneInfo',sceneInfo)
this.liveId = sceneInfo[0].split('=')[1]
}
let _this=this; let _this=this;
wx.getStorage({ wx.getStorage({
key: "sessionid", key: "sessionid",
......
<template> <template>
<!-- 讲解商品 --> <!-- 讲解商品 -->
<div class="livedExplainingCommodities"> <div class="livedExplainingCommodities">
<div class="goods clearfix" v-if="!showFixedGoods"> <div class="goods clearfix" v-if="!showFixedGoods" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend">
<div <div
class="goodsList" class="goodsList"
:class="{isEC:item.upperScreenState==1}" :class="{isEC:item.upperScreenState==1}"
...@@ -42,6 +42,10 @@ export default { ...@@ -42,6 +42,10 @@ export default {
fixedGoodsList: [], fixedGoodsList: [],
firstCom: true, //首次进入 firstCom: true, //首次进入
liveId: 0, liveId: 0,
fixedGoodsTimer : null, //讲解商品隐藏的定时器
reserveList : []
}; };
}, },
watch: { watch: {
...@@ -61,8 +65,9 @@ export default { ...@@ -61,8 +65,9 @@ export default {
} }
}); });
this.list = [...arr1, ...arr2]; this.list = [...arr1, ...arr2];
this.reserveList = arr1;
console.log(this.list,'--------------------------------this.list1212') console.log(this.list,'--------------------------------this.list1212')
setTimeout(() => { this.fixedGoodsTimer = setTimeout(() => {
this.fixedGoodsList = arr1 ? arr1 : []; this.fixedGoodsList = arr1 ? arr1 : [];
this.showFixedGoods = true; this.showFixedGoods = true;
}, 5000); }, 5000);
...@@ -85,8 +90,16 @@ export default { ...@@ -85,8 +90,16 @@ export default {
computed: {}, computed: {},
created() {}, created() {},
onLoad(options) { onLoad(options) {
let params = JSON.parse(options.params); if(options.params){
this.liveId = params.liveId; let params = JSON.parse(options.params);
this.liveId = params.liveId;
}else if(options.scene){
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
console.log(scene)
let sceneInfo = scene.split(',')
console.log('sceneInfo',sceneInfo)
this.liveId = sceneInfo[0].split('=')[1]
}
}, },
onUnload() { onUnload() {
this.fixedGoodsList = []; this.fixedGoodsList = [];
...@@ -94,6 +107,7 @@ export default { ...@@ -94,6 +107,7 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
// 到商品详情 // 到商品详情
toGoodsInfo(val) { toGoodsInfo(val) {
// 点击商品埋点 // 点击商品埋点
...@@ -170,7 +184,19 @@ export default { ...@@ -170,7 +184,19 @@ export default {
// 走到这里,说明数组或者对象中所有元素都相同,返回true // 走到这里,说明数组或者对象中所有元素都相同,返回true
return true; return true;
} },
touchstart(){
clearTimeout(this.fixedGoodsTimer)
},
touchmove(){
clearTimeout(this.fixedGoodsTimer)
},
touchend(){
this.fixedGoodsTimer = setTimeout(() => {
this.fixedGoodsList = this.reserveList
this.showFixedGoods = true;
},5000)
},
} }
}; };
</script> </script>
......
...@@ -90,8 +90,16 @@ export default { ...@@ -90,8 +90,16 @@ export default {
computed: {}, computed: {},
created() {}, created() {},
onLoad(options) { onLoad(options) {
let params = JSON.parse(options.params); if(options.params){
this.liveId = params.liveId; let params = JSON.parse(options.params);
this.liveId = params.liveId;
}else if(options.scene){
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
console.log(scene)
let sceneInfo = scene.split(',')
console.log('sceneInfo',sceneInfo)
this.liveId = sceneInfo[0].split('=')[1]
}
}, },
mounted() {}, mounted() {},
methods: { methods: {
......
...@@ -91,8 +91,16 @@ export default { ...@@ -91,8 +91,16 @@ export default {
}, },
computed: {}, computed: {},
onLoad(options) { onLoad(options) {
let params = JSON.parse(options.params); if(options.params){
this.liveId = params.liveId; let params = JSON.parse(options.params);
this.liveId = params.liveId;
}else if(options.scene){
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
console.log(scene)
let sceneInfo = scene.split(',')
console.log('sceneInfo',sceneInfo)
this.liveId = sceneInfo[0].split('=')[1]
}
}, },
created() {}, created() {},
mounted() {}, mounted() {},
......
...@@ -166,8 +166,16 @@ export default { ...@@ -166,8 +166,16 @@ export default {
computed: {}, computed: {},
created() {}, created() {},
onLoad(options) { onLoad(options) {
let params = JSON.parse(options.params); if(options.params){
this.liveId=params.liveId; let params = JSON.parse(options.params);
this.liveId = params.liveId;
}else if(options.scene){
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
console.log(scene)
let sceneInfo = scene.split(',')
console.log('sceneInfo',sceneInfo)
this.liveId = sceneInfo[0].split('=')[1]
}
this.product_goods_info.goodsImgUrl=this.goodsImg; this.product_goods_info.goodsImgUrl=this.goodsImg;
this.init(); this.init();
}, },
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
import livedposterDia from "@/components/livedModel/livedposterDia"; import livedposterDia from "@/components/livedModel/livedposterDia";
import live from "@/api/live"; import live from "@/api/live";
import { DFSImg } from "@/utils/index"; import { DFSImg } from "@/utils/index";
import spokesman from "@/api/spokesman";
export default { export default {
props: ["showShareDia", "info"], props: ["showShareDia", "info"],
name: "", name: "",
...@@ -53,6 +54,7 @@ export default { ...@@ -53,6 +54,7 @@ export default {
posterInfo: {}, posterInfo: {},
againLoadingPoster: false, // 是否开始加载海报 againLoadingPoster: false, // 是否开始加载海报
userInfo : {}, userInfo : {},
spokesmanObj: {}, //分销员信息
}; };
}, },
components: { components: {
...@@ -61,12 +63,22 @@ export default { ...@@ -61,12 +63,22 @@ export default {
computed: {}, computed: {},
created() {}, created() {},
onLoad(options) { onLoad(options) {
let params = JSON.parse(options.params); if(options.params){
this.liveId = params.liveId; let params = JSON.parse(options.params);
this.shopName = params.shopName; this.liveId = params.liveId;
this.backPath = params.fromPagePath || "/"; this.shopName = params.shopName;
this.shopLogo = DFSImg(params.shopLogo, 40, 40); this.backPath = params.fromPagePath || "/";
this.init(); this.shopLogo = DFSImg(params.shopLogo, 40, 40);
}else if(options.scene){
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
console.log(scene)
let sceneInfo = scene.split(',')
console.log('sceneInfo',sceneInfo)
this.liveId = sceneInfo[0].split('=')[1]
}
this.getSpokesman()
// this.init();
console.log(this.info, "--------------------------67"); console.log(this.info, "--------------------------67");
}, },
onUnload() {}, onUnload() {},
...@@ -74,17 +86,38 @@ export default { ...@@ -74,17 +86,38 @@ export default {
onShow(){ onShow(){
console.log('onSHow..........................') console.log('onSHow..........................')
this.againLoadingPoster = false; this.againLoadingPoster = false;
this.init(); // this.init();
this.getSpokesman()
}, },
methods: { methods: {
closePosterDia() { closePosterDia() {
this.showPosterDia = false; this.showPosterDia = false;
}, },
getSpokesman() {
spokesman.getSpokesmanidByShare().then(res => {
if (res.data.code == 200) {
if (res.data.data.hasInvitationStatus == 1) {
this.hasInvitationStatus = 1;
this.spokesmanObj = {
spokesmanGroupId: res.data.data.groupId,
spokesmanShopId: res.data.data.shopId,
spokesmanRelId: res.data.data.spokesmanId
};
}
this.init()
}
});
},
// 初始化信息 // 初始化信息
init() { init() {
// 获取小程序码 // 获取小程序码
console.log(this.spokesmanObj,'this.spokesmanObj')
let id = Number(this.liveId); let id = Number(this.liveId);
live.getLiveQRCode(id).then(res => { let fxyInfo = '';
if(this.spokesmanObj.spokesmanGroupId){
fxyInfo = `hb_${this.spokesmanObj.spokesmanGroupId}_${this.spokesmanObj.spokesmanShopId}_${this.spokesmanObj.spokesmanRelId}`
}
live.getLiveQRCode(id,fxyInfo).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
let cImg = DFSImg(this.info.posterCoverUrl); let cImg = DFSImg(this.info.posterCoverUrl);
......
...@@ -46,8 +46,16 @@ export default { ...@@ -46,8 +46,16 @@ export default {
computed: {}, computed: {},
onLoad(options) { onLoad(options) {
this.posterStatus = false; this.posterStatus = false;
this.params = JSON.parse(options.params); if(options.params){
this.liveId = this.params.liveId; let params = JSON.parse(options.params);
this.liveId = params.liveId;
}else if(options.scene){
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
console.log(scene)
let sceneInfo = scene.split(',')
console.log('sceneInfo',sceneInfo)
this.liveId = sceneInfo[0].split('=')[1]
}
console.log(this.userInfo) console.log(this.userInfo)
Object.assign(this.info, this.info, this.posterInfo); Object.assign(this.info, this.info, this.posterInfo);
console.log(this.info, "--------------------35"); console.log(this.info, "--------------------35");
...@@ -149,27 +157,22 @@ export default { ...@@ -149,27 +157,22 @@ export default {
ctx.drawImage(path, 200 * bili, 390 * bili, 100 * bili, 100 * bili); ctx.drawImage(path, 200 * bili, 390 * bili, 100 * bili, 100 * bili);
ctx.save(); ctx.save();
//头像 //头像
// this.saveThe(info.avatarUrl, path => { ctx.clip();
ctx.drawImage(info.avatarUrl, 10 * bili, 370 * bili, 54 * bili, 54 * bili);
ctx.clip(); ctx.save();
ctx.drawImage(info.avatarUrl, 10 * bili, 370 * bili, 54 * bili, 54 * bili); ctx.stroke();
ctx.save(); ctx.draw();
ctx.stroke();
ctx.draw(); this.posterStatus = true;
console.log("--------海报生成成功");
this.posterStatus = true;
console.log("--------海报生成成功");
// });
}); });
}); });
}, },
// 小程序需要将图片下载下来,然后才能绘制到画布上 // 小程序需要将图片下载下来,然后才能绘制到画布上
saveThe(url, callback) { saveThe(url, callback) {
console.log('url==========',url)
wx.getImageInfo({ wx.getImageInfo({
src: url, //服务器返回的图片地址 src: url, //服务器返回的图片地址
success: res => { success: res => {
console.log(res.path, "--------------------131");
callback(res.path); callback(res.path);
}, },
fail: function(res) { fail: function(res) {
......
...@@ -27,9 +27,17 @@ export default { ...@@ -27,9 +27,17 @@ export default {
computed: {}, computed: {},
created() {}, created() {},
onLoad(options) { onLoad(options) {
let params = JSON.parse(options.params);
this.liveId = params.liveId; if(options.params){
console.log(params, "--------------------126"); let params = JSON.parse(options.params);
this.liveId = params.liveId;
}else if(options.scene){
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
console.log(scene)
let sceneInfo = scene.split(',')
console.log('sceneInfo',sceneInfo)
this.liveId = sceneInfo[0].split('=')[1]
}
this.startTime = this.info.startTime; this.startTime = this.info.startTime;
console.log(this.info) console.log(this.info)
}, },
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<div class="navbar-title">直播计划</div> <div class="navbar-title">直播计划</div>
</div> </div>
<div class="uprefresh" v-if="isUprefresh">正在刷新...</div> <div class="uprefresh" v-if="isUprefresh">正在刷新...</div>
<div class="history-list"> <div class="no-history" v-if="!list.length">无历史直播</div>
<div class="history-list">
<div class="list-item" v-for="(item,index) in list" :key="index" @click="liveDetail(item)"> <div class="list-item" v-for="(item,index) in list" :key="index" @click="liveDetail(item)">
<div class="item-top"> <div class="item-top">
<div class="top-img"> <div class="top-img">
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
</div> </div>
</div> </div>
</div> </div>
<van-divider <van-divider
class="no-more" class="no-more"
v-if="isNoMore" v-if="isNoMore"
...@@ -217,6 +218,12 @@ export default { ...@@ -217,6 +218,12 @@ export default {
color: #999; color: #999;
text-align: center; text-align: center;
} }
.no-history{
text-align: center;
padding-top: 20vh;
font-size: 30px;
color: #999999;
}
.history-list{ .history-list{
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
......
...@@ -167,21 +167,51 @@ export default { ...@@ -167,21 +167,51 @@ export default {
} }
} }
}); });
this.params = JSON.parse(options.params); if(options.params){
console.log(this.params, "-----------------133"); this.params = JSON.parse(options.params);
this.$store.commit("setOfflineShopCode", this.params.offlineShopCode); console.log(this.params, "-----------------133");
this.liveId = this.params.liveId; this.$store.commit("setOfflineShopCode", this.params.offlineShopCode);
this.shopName = this.params.shopName; this.liveId = this.params.liveId;
this.backPath = this.params.fromPagePath || "/"; this.shopName = this.params.shopName;
this.shopLogo = DFSImg(this.params.shopLogo, 40, 40); this.backPath = this.params.fromPagePath || "/";
// 是否有分销员信息 this.shopLogo = DFSImg(this.params.shopLogo, 40, 40);
if (this.params.spokesmanGroupId) { // 是否有分销员信息
this.$store.commit("setSpokesman", { if (this.params.spokesmanGroupId) {
spokesmanGroupId: this.params.spokesmanGroupId, this.$store.commit("setSpokesman", {
spokesmanShopId: this.params.spokesmanShopId, spokesmanGroupId: this.params.spokesmanGroupId,
spokesmanRelId: this.params.spokesmanRelId, spokesmanShopId: this.params.spokesmanShopId,
userId : this.params.userId spokesmanRelId: this.params.spokesmanRelId,
}); userId : this.params.userId
});
}
}else if(options.scene){
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
console.log(scene)
let sceneInfo = scene.split(',')
console.log('sceneInfo',sceneInfo)
this.liveId = sceneInfo[0].split('=')[1]
this.backPath = '/';
console.log('liveId',this.liveId)
if(sceneInfo[1]){
let fxyInfo = sceneInfo[1].split('=')[1]
console.log('fxyInfo',fxyInfo)
if(fxyInfo){
let querys = fxyInfo.split('_');
if(querys[1]){
this.$store.commit("setSpokesman", {
spokesmanGroupId: querys[1],
spokesmanShopId: querys[2],
spokesmanRelId: querys[3]
});
this.$set(this.params,'spokesmanGroupId',querys[1])
this.$set(this.params,'spokesmanShopId',querys[2])
this.$set(this.params,'spokesmanRelId',querys[3])
console.log('this.params',this.params)
}
}
}
} }
this.init(); this.init();
...@@ -271,6 +301,8 @@ export default { ...@@ -271,6 +301,8 @@ export default {
live.getLiveInfo(liveBroadcastId).then(res => { live.getLiveInfo(liveBroadcastId).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
console.log(res.data.data, "------73"); console.log(res.data.data, "------73");
this.shopName = res.data.data.orgName;
this.shopLogo = DFSImg(res.data.data.logoUrl, 40, 40);
this.liveNoticeInfo = res.data.data; this.liveNoticeInfo = res.data.data;
this.liveNoticeInfo.coverUrl = this.liveNoticeInfo.coverUrl this.liveNoticeInfo.coverUrl = this.liveNoticeInfo.coverUrl
? DFSImg(this.liveNoticeInfo.coverUrl) ? DFSImg(this.liveNoticeInfo.coverUrl)
...@@ -308,7 +340,6 @@ export default { ...@@ -308,7 +340,6 @@ export default {
key: "sessionid", key: "sessionid",
success : res => { success : res => {
// 查询分销员信息 // 查询分销员信息
console.log(res,'绑定关系',this.params,this.params.spokesmanRelId,this.params.userId) console.log(res,'绑定关系',this.params,this.params.spokesmanRelId,this.params.userId)
if(this.params.spokesmanRelId){ if(this.params.spokesmanRelId){
live.becomepokesmanCustomer(this.params.spokesmanRelId).then(res=>{ live.becomepokesmanCustomer(this.params.spokesmanRelId).then(res=>{
...@@ -367,6 +398,7 @@ export default { ...@@ -367,6 +398,7 @@ export default {
}); });
} }
}, },
//获取分销员信息
getSpokesman() { getSpokesman() {
spokesman.getSpokesmanidByShare().then(res => { spokesman.getSpokesmanidByShare().then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
......
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