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

线上mip2页面引入mip1 mip-vd-tab 组件在手百下失效 #267

Closed
VenyXiong opened this issue Sep 11, 2018 · 1 comment
Closed

线上mip2页面引入mip1 mip-vd-tab 组件在手百下失效 #267

VenyXiong opened this issue Sep 11, 2018 · 1 comment
Assignees

Comments

@VenyXiong
Copy link
Member

BUG 描述
线上mip2页面引入mip1 mip-vd-tab 组件再手百下失效

复现步骤
https://m.baidu.com/wishwing/c/s/mip.wangxiao.cn/course/detail%3Fid%3D5a1ac09b-ad22-4d3e-9b8d-03f68cf3a31e
手百下打开这个链接,发现引入的mip-vd-tab组件失效。

期望结果
组件可以正常运行

截图
手百下
image
其他浏览器
image

环境及版本信息:

  • OS: IOS
  • Browser: 手机百度
@huanghuiquan huanghuiquan self-assigned this Sep 11, 2018
@huanghuiquan
Copy link
Contributor

huanghuiquan commented Sep 11, 2018

问题定位

造成问题的原因是 mip-search-video.js 在手百情况下获取网络状态的方式导致的,具体代码如下

// 获取手百的网络状态
getNetworkBaidubox: function () {
  //  getNetworkType: 'baiduboxapp://v19/utils/getNetworkType?callback=videoPageGetNetworkType',
  location.assign(videoLog.getNetworkType);
},

location.assign(url) 相当于 location.href = url,可以理解为跳页面,导致停止继续执行后面的代码。所以凡是放在 mip-search-video.js 后的代码都无法执行,上述例子中,mip-vd-tab 组件 js 刚好在 mip-search-video.js 后面,所以没被执行。

解决方案
mip-search-video 上线修复

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

3 participants