zoukankan      html  css  js  c++  java
  • mui简单介绍

    mui

    hbuilder连接夜神模拟器

    mui相关

    # 每个页面必须有
    mui.plusReady(function() {
    		});
    
    
    • 监听事件
    document.getElementById('index').addEventListener('tap',function () {
    	// 开一个新页面
    	mui.openWindow({
    		url: 'index.html',
    		id: 'index',
    		style: {
    			top: '0',
    			bottom: '50px',
    		},
    		extras: {
    
    		},
    		createNew:false,
    	});
    });
    
    
    // 新页面接收extras参数
    mui.plusReady(function() {
    			var data = plus.webview.currentWebview();
    		})
    
    • mui.fire(webview, 'event', {data:data})
    document.getElementById('send_music').addEventListener('tap',function () {
    	var index = plus.webview.getWebviewById("HBuilder");
        mui.fire(index,"send_music",{"to_usr":"toy123","music":window.audio_srv + data.src})
        })
    
    document.addEventListener("send_music", function(data) {
    	ws.send(JSON.stringify(data.detail));
    	})
    
    • mui.back() = function(){};

    Storage

    相当于web端的cookie

    • window.localStorage.setItem("key", data)
    • window.localStorage.getItem('key')
    • window.localStorage.removeItem('key')

    加载子页面

    • subpages

    播放音频

    # 创建player对象
    player = plus.audio.createPlayer(window.audio_srv + data.src);                                                          
    
    # 重头开始播放
    player.play();
    
    # 暂停播放
    player.pause()
    
    # 继续播放
    player.resume()
    
    # 停止播放
    player.stop()
    
  • 相关阅读:
    Git远程库
    Git的使用
    如何利用IO流复制文件
    Lambda表达式
    Lambda表达式的标准格式
    线程池的使用步骤
    解决线程安全的三个方法
    多线程
    位运算
    如何用javadoc生成java帮助文档
  • 原文地址:https://www.cnblogs.com/tmdhhl/p/10888083.html
Copyright © 2011-2022 走看看