Commit 9dffd164 by zhangxw

优化

1 parent 1e56a612
......@@ -12,21 +12,28 @@ Component({
data: {
type: Object,
observer(val) {
let _this = this
let thisPage = wx.$router.getPageInstance()
this.setData({
_this.setData({
navHeight: thisPage.data.navHeight
})
if (val.showSharePopup) {
val.boxImageHeight = 66
// 计算弹窗图片区域最大高度
wx.$util.getViewInfo('.layout', res => {
this.setData({
_this.setData({
postersBoxHeight: res.height * 0.7,
postersImageHeight: (res.height / res.width ) * 247
})
val.postersBoxHeight = res.height * 0.7,
val.postersImageHeight = (res.height / res.width ) * 247
this.init(val)
wx.getImageInfo({
src: val.posterImg,
success(e) {
_this.setData({
postersImageHeight: (e.height / e.width ) * 247
})
val.postersImageHeight = (e.height / e.width ) * 247
_this.init(val)
}
})
})
}
......@@ -49,8 +56,8 @@ Component({
async init(n) {
wx.$api.showLoading()
const drawfun = new Draw({
width: 280,
height: n.postersImageHeight + 80,
width: 279,
height: n.postersImageHeight + 76,
borderRadius: 8
}, this),
{
......
......@@ -8,7 +8,7 @@
</view>
</view>
<view class="share-popup-content" style="max-height: {{postersBoxHeight}}px;">
<image style="height: {{postersImageHeight + 80}}px;" mode="widthFix" src="{{poster}}"></image>
<image style="height: {{postersImageHeight + 76}}px;" src="{{poster}}"></image>
</view>
<view class="btn-box">
<view class="btn" bind:tap="saveImage">保存至相册</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!