|
二维码是我的测试工程,测试代码如下:- var mnPopups = api.require('MNPopups');
- mnPopups.open({
- rect: {
- w: 200,
- h: 300
- },
- position: {
- x: 0,
- y: 0
- },
- styles: {
- mask: 'rgba(0,0,0,0.2)',
- bg: '#eee',
- cell: {
- bg: {
- normal:'#FFF',
- highlight:"#eee"
- },
- h: 60,
- title: {
- marginL: 60,
- color: '#f00',
- size: 12,
- },
- icon: {
- marginL: 10,
- w: 40,
- h: 40,
- corner: 20
- }
- },
- pointer: { //(可选项)JSON类型;尖角配置
- size: 20, //(可选项)数字类型;尖角大小,该尖角为等边三角形,本参数为该三角形边长;默认:7
- xPercent: 90, //(可选项)数字类型;尖角底边中点 x 坐标占模块宽度的百分比;默认:90
- yPercent: 0, //(可选项)数字类型;尖角底边中点 y 坐标占模块高度的百分比;默认:0
- orientation: 'upward' //(可选项)字符串类型;气泡菜单弹出方向,取值范围如下:
- }
- },
- datas: [{
- title: '添加朋友',
- icon: 'widget://image/test_img.jpg'
- },
- {
- title: '扫一扫',
- icon: 'widget://image/test_img.jpg'
- },
- {
- title: '面对面快传',
- icon: 'widget://image/test_img.jpg'
- }],
- fixedOn: api.frameName,
- fixed: true
- }, function(ret) {
-
- if (ret) {
-
- if(ret.eventType == "click"){
- alert("eventType == click");
- if(ret.index == 0){
- alert("click item 0");
- }
-
- if(ret.index == 1){
- alert("click item 1");
- }
-
- if(ret.index == 2){
- alert("click item 2");
- }
- }
-
-
-
-
- }
- });
复制代码 测试是没有问题的
|
-
|