帖子
帖子
用户
博客
课程
1234下一页
返回列表 发新帖
显示全部楼层
33
帖子
0
勋章
185
Y币

[BUG] MNPopups 在安卓下ret.eventType =="click"无效

[复制链接]
发表于 2016-5-16 11:48:53
    if (ret.eventType =="click") {
    alert('点击了菜单'+ret.index);
                 if(ret.index == 0){
                                 type = 2;
                                 $('#type').html('店铺');  
                                // mnPopups.hide();
                 }
                 if(ret.index == 1){       
                                type = 1;       
                                $('#type').html('商品');       
                }
    }
});       
点击了菜单项不执行里面代码。苹果正常。
QQ图片20160516114715.jpg

27
帖子
0
勋章
292
Y币
lzy160824 发表于 2016-6-5 10:26
代码规范点,整个页面的代码,会少很多问题

您在这里回答问题的时候试试海马,的确不行。复制的官方的代码出现的问题
68
帖子
0
勋章
1万+
Y币
你打印出ret中的数据都包含什么
0
帖子
1
勋章
1640
Y币
是没有回调么?你把alert()去掉
33
帖子
0
勋章
185
Y币
Robot_Lee 发表于 2016-5-16 11:57
是没有回调么?你把alert()去掉

去掉也一样的。
33
帖子
0
勋章
185
Y币
Robot_Lee 发表于 2016-5-16 11:57
是没有回调么?你把alert()去掉

就是没有回调if (ret.eventType =="click") {
0
帖子
1
勋章
1640
Y币
二维码是我的测试工程,测试代码如下:
  1. var mnPopups = api.require('MNPopups');
  2. mnPopups.open({
  3.     rect: {      
  4.                 w: 200,                          
  5.                 h: 300
  6.     },
  7.     position: {
  8.             x: 0,
  9.             y: 0
  10.     },
  11.     styles: {
  12.                 mask: 'rgba(0,0,0,0.2)',
  13.                 bg: '#eee',                        
  14.                 cell: {                           
  15.                     bg: {
  16.                             normal:'#FFF',
  17.                             highlight:"#eee"
  18.                     },                  
  19.                     h: 60,                        
  20.                     title: {                     
  21.                             marginL: 60,               
  22.                             color: '#f00',         
  23.                             size: 12,                 
  24.                     },
  25.                     icon: {                        
  26.                             marginL: 10,               
  27.                             w: 40,                     
  28.                             h: 40,                     
  29.                             corner: 20                  
  30.                     }
  31.             },
  32.              pointer: {                    //(可选项)JSON类型;尖角配置
  33.                 size: 20,                  //(可选项)数字类型;尖角大小,该尖角为等边三角形,本参数为该三角形边长;默认:7
  34.                 xPercent: 90,              //(可选项)数字类型;尖角底边中点 x 坐标占模块宽度的百分比;默认:90
  35.                 yPercent: 0,               //(可选项)数字类型;尖角底边中点 y 坐标占模块高度的百分比;默认:0
  36.                 orientation: 'upward'      //(可选项)字符串类型;气泡菜单弹出方向,取值范围如下:
  37.              }
  38.     },
  39.     datas: [{                           
  40.                 title: '添加朋友',  
  41.                 icon: 'widget://image/test_img.jpg'
  42.         },
  43.         {                           
  44.                 title: '扫一扫',  
  45.                 icon: 'widget://image/test_img.jpg'
  46.         },
  47.         {                           
  48.                 title: '面对面快传',  
  49.                 icon: 'widget://image/test_img.jpg'
  50.         }],
  51.     fixedOn: api.frameName,
  52.     fixed: true
  53. }, function(ret) {

  54.        
  55.     if (ret) {
  56.    
  57.             if(ret.eventType == "click"){
  58.                     alert("eventType == click");

  59.                     if(ret.index == 0){
  60.                             alert("click item 0");
  61.                     }
  62.            
  63.                     if(ret.index == 1){
  64.                             alert("click item 1");
  65.                     }
  66.            
  67.                     if(ret.index == 2){
  68.                             alert("click item 2");
  69.                     }
  70.             }
  71.    
  72.            
  73.            
  74.         
  75.     }
  76. });
复制代码
测试是没有问题的
QQ图片20160516124145.png
33
帖子
0
勋章
185
Y币
Robot_Lee 发表于 2016-5-16 12:46
二维码是我的测试工程,测试代码如下:测试是没有问题的

我用VIVO手机安装上也是点了没反应啊。
0
帖子
0
勋章
216
Y币
Start 发表于 2016-5-16 21:42
我用VIVO手机安装上也是点了没反应啊。

你点哪没反应?我用vivo也有回调啊
33
帖子
0
勋章
185
Y币
冯成 发表于 2016-5-17 19:51
你点哪没反应?我用vivo也有回调啊

就是点弹出来的菜单没有回调啊。
27
帖子
0
勋章
292
Y币
Start 发表于 2016-5-19 10:23
就是点弹出来的菜单没有回调啊。

顶一下,同样问题,安卓下按钮点了没有反应
1234下一页
您需要登录后才可以回帖 登录

本版积分规则