Commit 24134a16 by 李嘉林

修改

parent d11341ad
......@@ -49,4 +49,8 @@ export default {
getLiveStatisticsById(options) {
return requestPOST(`${process.env.OLSHOP_URL}/liveBroadcastInfo/getLiveStatisticsById`,options);
},
// 商品点击埋点记录
addLiveUserGoodsByUser(options) {
return requestPOST(`${process.env.OLSHOP_URL}/liveBroadcastInfo/addLiveUserGoodsByUser`,options);
},
};
\ No newline at end of file
......@@ -179,6 +179,12 @@ export default {
},
// 到商品详情
toGoodsInfo(val) {
// 点击商品埋点
let info={
liveBroadcastId:Number(this.liveId),
liveBroadcastGoodsId:Number(val.productId),
}
live.addLiveUserGoodsByUser(info).then(res=>{});
let query = {
fromLived: 1,
liveId: this.liveId
......
......@@ -97,6 +97,12 @@ export default {
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
......
......@@ -45,7 +45,7 @@ export default {
const tmplIds = [];
for (var key in subscribeMessageObj) {
// 改成开播key
if (key == "gift_be_expire") {
if (key == "start_live") {
tmplIds.push(subscribeMessageObj[key]);
}
}
......
......@@ -253,21 +253,7 @@ export default {
// 查询分销员信息
_this.getSpokesman();
},
fail(res) {
console.log("未登录------150");
// 跳转登录页
let backUrl = "/lived/main";
let query = {
liveId: _this.liveId,
fromType: "mini"
};
let url = `/pages/login/main?back=${backUrl}&params=${JSON.stringify(
query
)}`;
wx.navigateTo({
url: url
});
}
fail(res) {}
});
},
getMsgConfig() {
......
<template>
<div class="test">
测试
<!--index.wxml-->
<view class="posterWrap">
<canvas canvas-id="posterCanvas" class="myCanvas"></canvas>
......@@ -25,32 +24,40 @@ export default {
name: "",
data() {
return {
InfoSync: {}
InfoSync: {},
// 海报中信息
info: {
coverUrl: "",
livedStatus: 1, //直播状态 0未开播 1一开播
livedTime: "3月21日 20:20",
nickName: "",
avatarUrl: ""
}
};
},
components: {},
computed: {},
onLoad() {
wx.getUserInfo({
//获取微信用户信息
success: function(res) {
console.log(res, "----------------108");
}
});
this.initPoster(this.info);
},
created() {},
mounted() {},
methods: {
initPoster(info) {
const InfoSync = wx.getSystemInfoSync();
this.InfoSync = InfoSync;
let bili = InfoSync.windowWidth / 375 * 1;
const ctx = wx.createCanvasContext("posterCanvas");
this.saveThe(
"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575527967726&di=172dcdd5a6f6b3a92a17d670793a6a50&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201303%2F10%2F20130310192450_S8HG8.thumb.700_0.jpeg",
path => {
ctx.drawImage(path, 0, 0, 310 * bili, 435 * bili); //ctx.drawImage(图片路径,距离画布左边,距离画布右边,图片宽,图片高)
ctx.save(); // 保存当前绘画
ctx.setTextAlign("center"); // 文字居中 ctx.fillText(显示文字,距离画布左边/基准点/文字以这个点居中或左对齐,距离画布顶部)
ctx.setFillStyle("#111"); // 文字颜色:fff
ctx.setFontSize(16); // 文字字号
ctx.fillText("刘亦菲", 155 * bili, 164 * bili); //名字 ctx.fillText(显示文字,距离画布左边/基准点/文字以这个点居中或左对齐,距离画布顶部)
ctx.setFontSize(21); // 文字字号
ctx.fillText("位置差一点出阴影重叠加粗", 155 * bili, 222.5 * bili);
ctx.setFillStyle("#895908"); // 文字颜色:895908
ctx.setTextAlign("center"); // 文字居中
ctx.fillText("位置差一点出阴影重叠加粗", 155 * bili, 221.5 * bili);
ctx.fillText("位置差一点出阴影重叠加粗", 155 * bili, 221.5 * bili);
ctx.fillText(info.livedTime, 155 * bili, 164 * bili); //名字 ctx.fillText(显示文字,距离画布左边/基准点/文字以这个点居中或左对齐,距离画布顶部
ctx.setFontSize(14); // 文字字号
ctx.setTextAlign("left"); // 文字居中
......@@ -77,13 +84,13 @@ export default {
ctx.fill();
//二维码
this.saveThe(
"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575528227860&di=f644289e83c18cf73d44e76dec4c1246&imgtype=0&src=http%3A%2F%2Fn.sinaimg.cn%2Fsinacn%2Fw640h395%2F20180109%2F0ae9-fyqnici9075376.jpg",
"http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/png/08af1c1f-b7a8-4bac-b85d-36e3cfc5cd05.png",
path => {
ctx.drawImage(path, 30.5 * bili, 320 * bili, 93 * bili, 93 * bili);
ctx.save();
//头像
this.saveThe(
"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575528093128&di=a92d8586763a982f233df10d358b8136&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201602%2F16%2F20160216165321_eTASf.jpeg",
"http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/png/08af1c1f-b7a8-4bac-b85d-36e3cfc5cd05.png",
path => {
ctx.clip();
ctx.drawImage(
......@@ -100,12 +107,7 @@ export default {
);
}
);
}
);
},
created() {},
mounted() {},
methods: {
// 小程序需要将图片下载下来,然后才能绘制到画布上
saveThe(url, callback) {
wx.getImageInfo({
......@@ -246,7 +248,7 @@ export default {
<style scoped>
.posterWrap {
min-height: 100%;
min-height: calc(100vh - 40px);
padding-top: 40px;
background-color: #f1f1f1;
}
......
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