Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug很无奈哈 #33

Closed
tmzdy888 opened this issue May 7, 2019 · 12 comments
Closed

bug很无奈哈 #33

tmzdy888 opened this issue May 7, 2019 · 12 comments

Comments

@tmzdy888
Copy link

tmzdy888 commented May 7, 2019

~

@1977474741
Copy link
Owner

什么bug?

@tmzdy888
Copy link
Author

tmzdy888 commented May 7, 2019

什么bug?

我刚删除了我的问题,发现之前描述的不严谨,现在我重新说下:
` data: {
src: '',
width: 0,//宽度
height: 0,//高度
},
onLoad: function (options) {
let t = this;
let url = options.url;
wx.getSystemInfo({
success: function(res) {

    let r = res.windowWidth / res.windowHeight
    t.setData({
      width: res.windowWidth/2,
      height: res.windowHeight / 2
    });
    wx.showLoading({
      title: '加载中'
    })
    setTimeout(()=>{
      t.setData({
        src: url
      });
    },500)

  },
})

},`
上面出现的问题是:
我动态设置的宽度 和 高度。模拟器没有问题。
在真机上,我的ios,苹果6plus,一定要在真机上测试。
会出现裁切变形,位置(实际只有图上一半的位置)不对,尺寸是对的。
另图片尺寸如果1024左右是没问题的。

@tmzdy888
Copy link
Author

tmzdy888 commented May 7, 2019

什么bug?

第二个bug:实际上你的插件下过来是无法运行的,需要作出修改才能运行。
修改的方法,是把你原因的函数构造方法如:funName(){} 改成 funName:fun(){}.这样的形式才能运行,因为这个问题导致了郁闷了将近1小时,怎么也找不到问题。因为我自己写的组件也可以运行哈,就你的跑不起来,后来对比发现你的写法问题。不是不可以那样的写法,而是你的方法不对,传递方法不对。你现在这样的写法。需要改变下,

@tmzdy888
Copy link
Author

tmzdy888 commented May 7, 2019

另外你这样的问题好比在vue里的medthos是写:()=>{}这样一样,无法获取真实的this的意思是一样。

@1977474741
Copy link
Owner

你的基础库是哪个版本?

@tmzdy888
Copy link
Author

tmzdy888 commented May 7, 2019

什么bug?

所有问题真实测试,绝对有问题,另我是个设计师,js方面比较不专业,提问如果不专业请原谅下。。
调试库:2.6.6;
微信是最新版本。

@tmzdy888
Copy link
Author

tmzdy888 commented May 7, 2019

你的基础库是哪个版本?

宽高那如果设置成死的,就是不动态设置,真机上也不会有问题。这点你要知悉下。

@1977474741
Copy link
Owner

(){}和箭头函数不一样,实际和:function(){}是一样的,都有this。很奇怪了,你加我qq

@tmzdy888
Copy link
Author

tmzdy888 commented May 7, 2019

(){}和箭头函数不一样,实际和:function(){}是一样的,都有this。很奇怪了,你加我qq

加了。你没通过

@1977474741
Copy link
Owner

啥时候加的?我没收到

@1977474741
Copy link
Owner

跟插件没关系。
“bug1”:尺寸取错了。
“bug2“:作用域搞错了。

@tmzdy888
Copy link
Author

tmzdy888 commented May 7, 2019

谢谢,大神的耐心指导,是我的问题导致的。非常感谢!!!我本人非常尊重你及你的代码!!再次感谢!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants