|
|
|
|
@ -368,8 +368,9 @@
|
|
|
|
|
<uni-popup ref="shareCode" :mask-click="true" type="bottom" class="shareBox">
|
|
|
|
|
<view class="codeOuter">
|
|
|
|
|
<view class="shareCon" @click="shareClose">
|
|
|
|
|
<canvas style="width:90%;margin-left:5%;position: absolute;"
|
|
|
|
|
:style="{ height:(shareHeight*scare) + 'px', marginTop:(cropperH-(shareHeight*scare))/2+'rpx'}"
|
|
|
|
|
<canvas
|
|
|
|
|
style="width:90%;margin-left:5%;position: absolute;"
|
|
|
|
|
:style="{ height:isType3?(shareHeight*scare)*.89 +10 + 'px':(shareHeight*scare)+ 'px', marginTop:(cropperH-(shareHeight*scare))/2+'rpx'}"
|
|
|
|
|
canvas-id="firstCanvas" id="firstCanvas"></canvas>
|
|
|
|
|
<!-- <image class="shareBg" mode="widthFix" src="../../static/bg_haibao@2x.png"></image> -->
|
|
|
|
|
<!-- <image class="code" src="../../static/300_qr.png"></image> -->
|
|
|
|
|
@ -480,7 +481,7 @@
|
|
|
|
|
illustration:'',
|
|
|
|
|
showUser: false,
|
|
|
|
|
showPhone: false,
|
|
|
|
|
|
|
|
|
|
isType3:false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onShareAppMessage() {
|
|
|
|
|
@ -788,55 +789,123 @@
|
|
|
|
|
if (r.data.status === 1) {
|
|
|
|
|
uni.getImageInfo({
|
|
|
|
|
src: this.baseUrl + r.data.data, // 二维码
|
|
|
|
|
success: res => {
|
|
|
|
|
var ctx = uni.createCanvasContext('firstCanvas')
|
|
|
|
|
var w = SCREEN_WIDTH * 0.9;
|
|
|
|
|
var h = this. shareHeight* this.scare;
|
|
|
|
|
ctx.drawImage('../../static/bg_haibao1.png', 0, 40,
|
|
|
|
|
w, h*.9);
|
|
|
|
|
console.log("this.poster",this.poster)
|
|
|
|
|
ctx.drawImage(this.poster, 11, 51,
|
|
|
|
|
w-22, (h+5) * 0.3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ctx.font = "16rpx bold";
|
|
|
|
|
// 设置颜色
|
|
|
|
|
ctx.fillStyle = "#000";
|
|
|
|
|
// 绘制文字(参数:要写的字,x坐标,y坐标)
|
|
|
|
|
let active_title = this.info.template == '新' ? '课程' : '活动'
|
|
|
|
|
// ctx.fillText(active_title, w*0.1, (h + 50) * 0.6 + 20);
|
|
|
|
|
|
|
|
|
|
ctx.font = "14rpx bold";
|
|
|
|
|
// 设置颜色
|
|
|
|
|
ctx.fillStyle = "#333";
|
|
|
|
|
success: res => {
|
|
|
|
|
if(this.info.active_type_id==3){
|
|
|
|
|
this.isType3 = false
|
|
|
|
|
var ctx = uni.createCanvasContext('firstCanvas')
|
|
|
|
|
var w = SCREEN_WIDTH * 0.9;
|
|
|
|
|
var h = this.shareHeight * this.scare;
|
|
|
|
|
console.log(1)
|
|
|
|
|
ctx.drawImage('../../static/bg_haibao@2x.jpg', 0, 0,
|
|
|
|
|
w, h
|
|
|
|
|
);
|
|
|
|
|
ctx.drawImage('../../static/bg_haibao2.png', 20, 30 + 40,
|
|
|
|
|
w -
|
|
|
|
|
40, h - 100);
|
|
|
|
|
|
|
|
|
|
ctx.drawImage(this.poster, 20, 30 + 40,
|
|
|
|
|
w -
|
|
|
|
|
40, (h - 60 - 60) * 0.5);
|
|
|
|
|
ctx.font = "22rpx bold";
|
|
|
|
|
// 设置颜色
|
|
|
|
|
ctx.fillStyle = "#fff";
|
|
|
|
|
// 绘制文字(参数:要写的字,x坐标,y坐标)
|
|
|
|
|
ctx.fillText(this.info.active_name, 20, 50);
|
|
|
|
|
|
|
|
|
|
ctx.font = "16rpx bold";
|
|
|
|
|
// 设置颜色
|
|
|
|
|
ctx.fillStyle = "#000";
|
|
|
|
|
// 绘制文字(参数:要写的字,x坐标,y坐标)
|
|
|
|
|
ctx.fillText("活动", 40, (h + 50) * 0.5 + 20);
|
|
|
|
|
|
|
|
|
|
ctx.font = "14rpx bold";
|
|
|
|
|
// 设置颜色
|
|
|
|
|
ctx.fillStyle = "#3377b7";
|
|
|
|
|
// 绘制文字(参数:要写的字,x坐标,y坐标)
|
|
|
|
|
|
|
|
|
|
let packagesFirst = this.info
|
|
|
|
|
let address1 = this.info.address.length>16?this.info.address.substring(0,16):this.info.address
|
|
|
|
|
let address2 = this.info.address.length>16?this.info.address.substring(16,this.info.address.length-1):''
|
|
|
|
|
let active_name1 = this.info.active_name.length>17?this.info.active_name.substring(0,17):this.info.active_name
|
|
|
|
|
let active_name2 = this.info.active_name.length>17?this.info.active_name.substring(17,this.info.active_name.length-1):''
|
|
|
|
|
ctx.fillText("" + active_name1, 40, (h + 50) * 0.5 + 50);
|
|
|
|
|
ctx.fillText("" + active_name2, 40, (h + 50) * 0.5 + 70);
|
|
|
|
|
ctx.fillText("活动时间:" + this.info.apply_start, 40, (h + 50) * 0.5 + 120);
|
|
|
|
|
ctx.fillText("活动地点:" + address1, 40, (h + 50) * 0.5 + 140);
|
|
|
|
|
ctx.fillText("" + address2, 40, (h + 50) * 0.5 + 160);
|
|
|
|
|
let user_info = uni.getStorageSync("user_info_yunyuhui");
|
|
|
|
|
|
|
|
|
|
let userProfile = uni.getStorageSync('user_profile');
|
|
|
|
|
|
|
|
|
|
var img = this.imgAvatar;
|
|
|
|
|
uni.getImageInfo({
|
|
|
|
|
src: userProfile.avatarUrl, // 头像
|
|
|
|
|
success: rlogo => {
|
|
|
|
|
img = rlogo.path;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// that.circleImg(ctx,
|
|
|
|
|
// img,
|
|
|
|
|
// 40, h - 50 - w * 0.15,
|
|
|
|
|
// w * 0.15 / 2);
|
|
|
|
|
|
|
|
|
|
ctx.font = "12rpx normal";
|
|
|
|
|
// 设置颜色
|
|
|
|
|
ctx.fillStyle = "#000";
|
|
|
|
|
// 绘制文字(参数:要写的字,x坐标,y坐标)
|
|
|
|
|
// if (!weixin.isNull(user_info.name))
|
|
|
|
|
// ctx.fillText(user_info.name,
|
|
|
|
|
// 40, h - 40);
|
|
|
|
|
// else
|
|
|
|
|
// ctx.fillText("",
|
|
|
|
|
// 40, h - 40);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.circleImg(ctx, res.path, w - 40 - w * 0.2, h - 40 -
|
|
|
|
|
w *
|
|
|
|
|
0.2, w * 0.2 / 2);
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
this.isType3 = true
|
|
|
|
|
var ctx = uni.createCanvasContext('firstCanvas')
|
|
|
|
|
var w = SCREEN_WIDTH * 0.9;
|
|
|
|
|
var h = this. shareHeight* this.scare;
|
|
|
|
|
ctx.drawImage('../../static/bg_haibao1.png', 0, 0,
|
|
|
|
|
w, h*.89+10);
|
|
|
|
|
console.log("this.poster",this.poster)
|
|
|
|
|
ctx.drawImage(this.poster, 11, 11,
|
|
|
|
|
w-22, (h+5) * 0.3);
|
|
|
|
|
ctx.font = "16rpx bold";
|
|
|
|
|
// 设置颜色
|
|
|
|
|
ctx.fillStyle = "#000";
|
|
|
|
|
// 绘制文字(参数:要写的字,x坐标,y坐标)
|
|
|
|
|
let active_title = this.info.template == '新' ? '课程' : '活动'
|
|
|
|
|
ctx.font = "14rpx bold";
|
|
|
|
|
// 设置颜色
|
|
|
|
|
ctx.fillStyle = "#333";
|
|
|
|
|
|
|
|
|
|
// 绘制文字(参数:要写的字,x坐标,y坐标)
|
|
|
|
|
|
|
|
|
|
let packagesFirst = this.info
|
|
|
|
|
|
|
|
|
|
let lecturer = this.info.lecturer?this.info.lecturer:''
|
|
|
|
|
// let lecturer = '王一档'
|
|
|
|
|
ctx.fillText(this.info.start_date + ' ' +
|
|
|
|
|
this.info.start_time, w*0.1+15, (h - 50) * 0.5+10);
|
|
|
|
|
|
|
|
|
|
let address = this.info.address.length > 17? this.info
|
|
|
|
|
.address.substring(0, 17) : this.info.address
|
|
|
|
|
let address1 = this.info.address.length > 17 ? this.info
|
|
|
|
|
.address.substring(17,this.info.address.length) : ''
|
|
|
|
|
|
|
|
|
|
ctx.fillText(address, w*0.1+15, (h - 50) * 0.6 + 20);
|
|
|
|
|
ctx.fillText(address1, w*0.1+15, (h - 50) * 0.6 + 40);
|
|
|
|
|
ctx.fillText(lecturer, w*0.1+15, (h - 50) * 0.6 + 100);
|
|
|
|
|
this.circleImg(ctx, res.path, w - 20 - w * 0.2, h - 10 -w *0.4, w * 0.2 / 2);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 绘制文字(参数:要写的字,x坐标,y坐标)
|
|
|
|
|
|
|
|
|
|
let packagesFirst = this.info
|
|
|
|
|
let active_time = this.info.template == '新' ? '时间:' :
|
|
|
|
|
'时间:'
|
|
|
|
|
let active_add = this.info.template == '新' ? '地点:' :
|
|
|
|
|
'地点:'
|
|
|
|
|
let active_name = this.info.active_name.length > 17 ? this
|
|
|
|
|
.info.active_name.substring(0, 17) : this.info
|
|
|
|
|
.active_name
|
|
|
|
|
let active_name1 = this.info.active_name.length > 17 ? this
|
|
|
|
|
.info.active_name.substring(17, this.info.active_name
|
|
|
|
|
.length) : ''
|
|
|
|
|
let lecturer = this.info.lecturer?this.info.lecturer:''
|
|
|
|
|
|
|
|
|
|
ctx.fillText(this.info.start_date + ' ' +
|
|
|
|
|
this.info.start_time, w*0.1+15, (h - 50) * 0.6);
|
|
|
|
|
let address = this.info.address.length > 17? this.info
|
|
|
|
|
.address.substring(0, 17) : this.info.address
|
|
|
|
|
let address1 = this.info.address.length > 17 ? this.info
|
|
|
|
|
.address.substring(17,this.info.address.length) : ''
|
|
|
|
|
|
|
|
|
|
ctx.fillText(address, w*0.1+15, (h - 50) * 0.6 + 60);
|
|
|
|
|
ctx.fillText(address1, w*0.1+15, (h - 50) * 0.6 + 80);
|
|
|
|
|
ctx.fillText(lecturer, w*0.1+15, (h - 50) * 0.6 + 140);
|
|
|
|
|
this.circleImg(ctx, res.path, w - 20 - w * 0.2, h - 10 -w *0.3, w * 0.2 / 2);
|
|
|
|
|
|
|
|
|
|
ctx.draw(),
|
|
|
|
|
// r: 半径
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
@ -1139,6 +1208,13 @@
|
|
|
|
|
min-height: 150px !important;
|
|
|
|
|
margin: 20px auto;
|
|
|
|
|
height:auto!important
|
|
|
|
|
}
|
|
|
|
|
.yuezi{
|
|
|
|
|
width:90%;margin-left:5%;position: absolute;
|
|
|
|
|
}
|
|
|
|
|
.other{
|
|
|
|
|
width:90%;margin-left:5%;position: absolute;
|
|
|
|
|
height:540px!important
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@ -1484,7 +1560,8 @@
|
|
|
|
|
display: inline-block;
|
|
|
|
|
font-size: 36rpx;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: #333333;
|
|
|
|
|
color: #333333;
|
|
|
|
|
padding-right:60rpx
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dataGroup {
|
|
|
|
|
|