master
pipi 4 years ago
parent 7928916143
commit 5d44d02a1e

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

Loading…
Cancel
Save