master
pipi 4 years ago
parent 7928916143
commit 5d44d02a1e

@ -33,19 +33,18 @@
</uni-popup>
<uni-popup ref="shareCode" :mask-click="true" type="bottom" class="shareBox">
<view class="codeOuter">
<view class="shareCon" @click="shareClose">
<image class="shareBg" mode="widthFix" :src="img"></image>
<view class="shareCon" @click="shareClose">
<canvas style="width: 220px; height: 220px" 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> -->
</view>
<view class="shareBott">
<button class="shareCol" @click="shareClose" open-type="share" style="border-radius:0">发给朋友</button>
<view class="shareCol" @click="save"></view>
<view class="shareBott" :style="{display: shareBtnDisplay}">
<button class="shareCol" @click="shareClose" open-type="share" style="border-radius:0;flex:1;">发给朋友</button>
<button class="shareCol" @click="save" style="border-radius:0;flex:1;">保存相册</button>
</view>
</view>
</uni-popup>
<canvas style="width: 220px; height: 220px;" canvas-id="firstCanvas" id="firstCanvas"></canvas>
</view>
</template>
@ -61,12 +60,12 @@
user_info: {
promotion: ''
},
shareBtnDisplay: 'none',
}
},
onLoad() {
weixin.getOpenidInfo(info => {
this.user_info = info
console.log(this.user_info)
this.user_info = info
})
},
onShareAppMessage() {
@ -81,6 +80,7 @@
uni.showLoading({
title: '加载中'
});
this.$refs.shareCode.open()
uni.request({
url: this.baseUrl + '/api/member/get-wxa-qrcode',
method: 'GET',
@ -104,8 +104,8 @@
canvasId: 'firstCanvas',
fileType: 'jpg',
success: (res) => {
this.shareBtnDisplay = 'flex'
uni.hideLoading()
this.$refs.shareCode.open()
this.img = res.tempFilePath
},
})
@ -113,6 +113,8 @@
}
})
} else {
uni.hideLoading()
this.$refs.shareCode.close()
this.alert(r.data.msg)
}
}
@ -307,15 +309,18 @@
width: 100%;
height: 100vh;
background: rgba(0, 0, 0, 0.5);
padding-top: 13vh;
// padding-top: 13vh;
box-sizing: border-box;
position: relative;
}
.shareCon {
width: 500rpx;
margin: 0 auto;
position: relative;
// margin: 0 auto;
position: absolute;
top: 45%;
left: 50%;
transform: translate(-50%, -50%);
.code {
width: 300rpx;

Loading…
Cancel
Save