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