我是用uniapp做的 <template> <gracePage :customHeader="false"> <!-- 页面主体 --> <view slot="gBody" class="body"> <view class="imgview" @tap="refresh"><image :src="qrcodeimg" mode="widthFix"></image></view> <view class="grace-center padding30"> 扫码领优惠券,点击二维码可刷新 </view> </view> </gracePage> </template> <script> import gracePage from "@/graceUI/components/gracePage.vue"; let that; export default { data() { return { userinfo:null, qrcodeimg:'', } }, onLoad:function(options){ that = this let userinfo = uni.getStorageSync('userinfo'); that.userinfo = userinfo; // #ifdef MP-WEIXIN uni.hideShareMenu() // #endif that.init(); }, onShow:function(){ }, methods:{ init:function(){ that.getcode(0); }, getcode:function(refresh){ if(refresh){ uni.showLoading({ title: '刷新中', mask:true }); } // #ifdef MP-WEIXIN console.log(that.userinfo.id); that.tools.post(that.common.apiUrl+'api/register/getxcxqrcode1',{uid:9254},'json',{},function(res){ console.log(res); uni.hideLoading() if(res){ that.qrcodeimg = that.common.apiUrl+res.imgurl; console.log(that.qrcodeimg); if(refresh){ uni.showToast({ title:'刷新成功', duration:1000, mask:true }) } } }); //#endif // #ifdef H5 that.tools.post(that.common.apiUrl+'api/register/getqrcode',{uid:that.userinfo.id},'json',{},function(res){ uni.hideLoading() if(res){ that.qrcodeimg = that.common.apiUrl+res.replace(/(^\s*)|(\s*$)/g, ""); if(refresh){ uni.showToast({ title:'刷新成功', duration:1000, mask:true }) } } }); //#endif }, refresh:function(){ that.getcode(1); } }, components:{ gracePage } } </script> <style> page{width:100%; height: 100%;} .body{width:100%; height: 100%; display: flex; align-items: center;justify-content: center; flex-direction: column;} image{width:500rpx;height: 500rpx;} .imgview{width:500rpx;} </style>
小程序二维码显示不正常,之前没问题,用着用着就显示不全了?[图片]这个二维码在服务器上直接查看 是正常的,但小小程序显示就是这样的
2020-10-27