Commit be8bdd6f by 赵雅纹

Merge branch 'fixbug-ZYW' into 'dev_7.1.0'

Fixbug zyw

See merge request !167
parents a87f27d0 60a3f423
......@@ -3,7 +3,6 @@
export default class InviteFriends {
palette(posterImg, qrcodeImg, userName, avatarUrl,options) {
//获取图片的长宽
console.log(options)
let posterImgWidth = 0, posterImgHeight = 280;
if(options){
posterImgWidth = options.posterImgWidth ? options.posterImgWidth : 0;
......@@ -13,6 +12,10 @@ export default class InviteFriends {
}
}
console.log(avatarUrl)
let windowWidth = options.windowWidth;
return ({
width: '750rpx',
height: '705rpx',
......@@ -22,7 +25,7 @@ export default class InviteFriends {
type: 'image',
url: posterImg,
css: {
width: '375px',
width: windowWidth + 'px',
height: posterImgHeight + 'px'
}
},
......
......@@ -66,21 +66,30 @@ wxService.page({
//生成海报
generatePoster(){
console.log(this.data.currentPosterImg)
let _this = this;
wx.getImageInfo({
src: this.data.currentPosterImg,
success: function (res) {
let posterImgWidth = res.width,
posterImgHeight = res.height;
_this.setData({
template: new Card().palette(_this.data.currentPosterImg,
_this.data.codeImg,
member.memberWeixin.nickname,
avatarUrl, { posterImgWidth: posterImgWidth, posterImgHeight: posterImgHeight}),
});
wx.getSystemInfo({
success: function (system) {
wx.getImageInfo({
src: this.data.currentPosterImg,
success: function (res) {
let posterImgWidth = res.width,
posterImgHeight = res.height;
_this.setData({
template: new Card().palette(_this.data.currentPosterImg,
_this.data.codeImg,
member.memberWeixin.nickname,
avatarUrl, {
posterImgWidth: posterImgWidth,
posterImgHeight: posterImgHeight ,
windowWidth: system.windowWidth,
windowHeight: system.windowHeight
}),
});
}
})
}
})
});
},
......@@ -104,7 +113,7 @@ wxService.page({
//获取二维码
getMiniCode() {
const urls = utils.getCurrentPageUrlWithArgs()
let _this = this;
let data = {
"autoColor": true,
"page": 'pages/userCenter/userCenter',
......@@ -113,15 +122,35 @@ wxService.page({
}
wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => {
const { result, data } = res.data
console.log(app.globalData.imageUrl + data)
if (result == 0) {
this.setData({
codeImg: app.globalData.imageUrl + data
// codeImg: "https://hwimagecdn.ihotwind.cn/usr/201908/miniQrCode-f00c5051fef7479395efb193431762c4.jpg"
},()=>{
this.setData({
template: new Card().palette(this.data.posterImgData[0], this.data.codeImg, member.memberWeixin.nickname, avatarUrl,wx),
});
wx.getSystemInfo({
success: function (system) {
wx.getImageInfo({
src: _this.data.posterImgData[0],
success: function (res) {
let posterImgWidth = res.width,
posterImgHeight = res.height;
_this.setData({
template: new Card().palette(_this.data.posterImgData[0],
_this.data.codeImg,
member.memberWeixin.nickname,
avatarUrl,
{
posterImgWidth: posterImgWidth,
posterImgHeight: posterImgHeight,
windowWidth: system.windowWidth,
windowHeight: system.windowHeight
}),
});
}
})
}
})
})
}
})
......@@ -129,7 +158,6 @@ wxService.page({
// 保存海报
savePoster(){
console.log('111')
let tentacleInfo = {
content: "我的邀请页面",
contentType: app.globalData.contants.SHARE_TYPE.INVITE_FRIENDS, //内容类型
......@@ -138,7 +166,6 @@ wxService.page({
}
wxService.getTentacleContent(tentacleInfo).then(res => {
console.log(res)
if (res && res.id) {
wx.saveImageToPhotosAlbum({
filePath: this.imagePath,
......
......@@ -58,6 +58,18 @@ function getAccountInfo() {
return accountInfo
}
// 获取系统屏幕信息
// function getSystemInfo(){
// wx.getSystemInfo({
// success: function (res) {
// return {
// windowWidth: res.windowWidth,
// windowHeight: res.windowHeight
// }
// }
// })
// }
/**
* 图片宽高比
*/
......
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