小程序
小游戏
企业微信
微信支付
扫描小程序码分享
这个二维码在服务器上直接查看 是正常的,但小小程序显示就是这样的
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
小程序码是后端生成的?如果是的,copy下小程序码的url,在浏览器中打开是否显示正常?如果正常检查是不是自己在小程序码上覆盖了图层
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
<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>
</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){
我是用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>
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
小程序码是后端生成的?如果是的,copy下小程序码的url,在浏览器中打开是否显示正常?如果正常检查是不是自己在小程序码上覆盖了图层
<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){
我是用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>