|
@@ -2,7 +2,7 @@
|
|
|
<view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
|
|
<view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
|
|
|
<cus-header title='专业支持'></cus-header>
|
|
<cus-header title='专业支持'></cus-header>
|
|
|
<image style="width: 100%;" :src="imgBase+'support.png'" mode="widthFix" @click="handleTurn"></image>
|
|
<image style="width: 100%;" :src="imgBase+'support.png'" mode="widthFix" @click="handleTurn"></image>
|
|
|
- <div class="code" :style="{'top':(mt*2+1278)+'rpx'}">
|
|
|
|
|
|
|
+ <div class="code" :style="{'top':codetop+'px'}">
|
|
|
<canvas canvas-id="qrcode" style="width:216rpx;height:216rpx;border-radius: 16rpx; position: fixed;left: -9999px;top: -9999px;"></canvas>
|
|
<canvas canvas-id="qrcode" style="width:216rpx;height:216rpx;border-radius: 16rpx; position: fixed;left: -9999px;top: -9999px;"></canvas>
|
|
|
<image v-if="qrCodeDataURL" :src="qrCodeDataURL" mode="scaleToFill" show-menu-by-longpress></image>
|
|
<image v-if="qrCodeDataURL" :src="qrCodeDataURL" mode="scaleToFill" show-menu-by-longpress></image>
|
|
|
</div>
|
|
</div>
|
|
@@ -17,9 +17,11 @@
|
|
|
imgBase:this.$imgBase,
|
|
imgBase:this.$imgBase,
|
|
|
qrCodeDataURL:'',
|
|
qrCodeDataURL:'',
|
|
|
qrVal:'https://wxapp.transcend-intl.cn',
|
|
qrVal:'https://wxapp.transcend-intl.cn',
|
|
|
|
|
+ codetop:0,
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
|
|
+ this.codetop = uni.upx2px(this.mt*2+1278);
|
|
|
this.generateQRCode();
|
|
this.generateQRCode();
|
|
|
if(uni.getStorageSync('userInfo')){
|
|
if(uni.getStorageSync('userInfo')){
|
|
|
this.qrVal = `https://wxapp.transcend-intl.cn?shareUserId=${JSON.parse(uni.getStorageSync('userInfo'))?.id||''}`;
|
|
this.qrVal = `https://wxapp.transcend-intl.cn?shareUserId=${JSON.parse(uni.getStorageSync('userInfo'))?.id||''}`;
|
|
@@ -34,13 +36,14 @@
|
|
|
async generateQRCode(){
|
|
async generateQRCode(){
|
|
|
try {
|
|
try {
|
|
|
let that = this;
|
|
let that = this;
|
|
|
|
|
+ const canvasSizePx = uni.upx2px(216);
|
|
|
// 确保DOM已经更新,canvas元素已准备好
|
|
// 确保DOM已经更新,canvas元素已准备好
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
UQrcode.make({
|
|
UQrcode.make({
|
|
|
canvasId: 'qrcode',
|
|
canvasId: 'qrcode',
|
|
|
componentInstance: this,
|
|
componentInstance: this,
|
|
|
text: that.qrVal,
|
|
text: that.qrVal,
|
|
|
- size: 103, // 对应 216rpx 的物理像素大小
|
|
|
|
|
|
|
+ size: canvasSizePx, // 对应 216rpx 的物理像素大小
|
|
|
margin: 5,
|
|
margin: 5,
|
|
|
backgroundColor: '#ffffff',
|
|
backgroundColor: '#ffffff',
|
|
|
foregroundColor: '#000000',
|
|
foregroundColor: '#000000',
|