|
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width"/>
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<title>聊天</title>
<script src="../script/api.js"></script>
<style media="screen">
html,body {
background-color: #ededed;
}
#zhanwei{
height: 60px;
}
</style>
</head>
<body>
<div id="msg-box">
</div>
<div id="zhanwei"></div>
<script type="text/javascript">
var to_user_id=0;
var me,to;
apiready = function () {
api.addEventListener({
name:'navitembtn'
},function(ret, err){
if(ret.type=='left'){
api.closeWin();
}
});
var UIChatBox = api.require('UIChatBox');
UIChatBox.open({
placeholder: '',
maxRows: 4,
emotionPath: 'widget://res/chat/emotion',
texts: {
recordBtn: {
normalTitle: '按住 说话',
activeTitle: '松开 结束'
},
sendBtn: {
title: '发送'
}
},
styles: {
inputBar: {
borderColor: '#efefef',
bgColor: '#fff',
textColor: '#000', //(可选项)字符串类型;输入文字的颜色;默认:#000,支持 rgb,rgba,#;默认:'#f2f2f2'
placeholderColor: '', //(可选项)字符串类型;提示文字的颜色;默认:系统默认,支持 rgb,rgba,#;默认:'#f2f2f2'
textSize: 16, //(可选项)数字类型;默认:16
textMarginLeft: 5
},
inputBox: {
borderColor: '#B3B3B3',
bgColor: '#FFFFFF'
},
emotionBtn: {
normalImg: 'widget://res/chat/face1.png'
},
keyboardBtn: {
normalImg: 'widget://res/chat/key1.png'
},
extrasBtn: {
normalImg: 'widget://res/chat/add1.png'
},
recordBtn: {
normalBg: '#efefef',
activeBg: '#cccccc',
color: '#000',
size: 14
},
indicator: {
target: 'both',
color: '#c4c4c4',
activeColor: '#9e9e9e'
},
sendBtn: {
titleColor: '#FFFFFF',
bg: '#22bd22',
titleSize: 14
}
},
extras: {
titleSize: 10,
titleColor: '#a3a3a3',
btns: [{
title: '图片',
normalImg: 'widget://res/chat/album1.png',
activeImg: 'widget://res/chat/album2.png'
}, {
title: '拍照',
normalImg: 'widget://res/chat/p1.png',
activeImg: 'widget://res/chat/p2.png'
}]
}
}, function (ret, err) {
if (ret.eventType == 'send') {
}
if(ret.eventType=='clickExtras'){
if(ret.index==0){}
if(ret.index==1){}
}
});
}
</script>
</body>
</html>
这个是全部程序
|
|