收藏
回答

小程序二维码显示不正常,之前没问题,用着用着就显示不全了?

这个二维码在服务器上直接查看 是正常的,但小小程序显示就是这样的

回答关注问题邀请回答
收藏

2 个回答

  • 少侠
    少侠
    2020-10-27

    小程序码是后端生成的?如果是的,copy下小程序码的url,在浏览器中打开是否显示正常?如果正常检查是不是自己在小程序码上覆盖了图层

    2020-10-27
    有用 1
    回复 3
    • 马爽
      马爽
      2020-10-27
      是后端生成,在浏览器中打开正常,我这页没覆盖任何图层,只是显示了个图片,而且之前都好用,昨天突然这样了
      2020-10-27
      回复
    • 少侠
      少侠
      发表于小程序端
      2020-10-27回复马爽
      可以贴下代码
      2020-10-27
      1
      回复
    • 马爽
      马爽
      2020-10-27
      我用uniapp做的
      2020-10-27
      回复
  • 马爽
    马爽
    2020-10-27

    我是用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
    有用
    回复
登录 后发表内容
问题标签