|
function UIChatBox(){
var obj = api.require('UIChatBox');
obj.open({
placeholder: '',
maxRows: 4,
emotionPath: 'widget://image/emotion',
texts: {
recordBtn: {
normalTitle: '按住 说话',
activeTitle: '松开 结束'
}
},
styles: {
inputBar: {
borderColor: '#d9d9d9',
bgColor: '#f2f2f2'
},
inputBox: {
borderColor: '#B3B3B3',
bgColor: '#FFFFFF'
},
emotionBtn: {
normalImg: 'widget://image/chatBox_face1.png'
},
extrasBtn: {
normalImg: 'widget://image/chatBox_add1.png'
},
keyboardBtn: {
normalImg: 'widget://image/chatBox_key1.png'
},
speechBtn: {
normalImg: 'widget://image/chatBox_key1.png'
},
recordBtn: {
normalBg: '#c4c4c4',
activeBg: '#999999',
color: '#000',
size: 14
},
indicator: {
target: 'both',
color: '#c4c4c4',
activeColor: '#9e9e9e'
}
},
extras: {
titleSize: 10,
titleColor: '#a3a3a3',
btns: [{
title: '图片',
normalImg: 'widget://image/chatBox_album1.png',
activeImg: 'widget://image/chatBox_album2.png'
},{
title: '拍照',
normalImg: 'widget://image/chatBox_cam1.png',
activeImg: 'widget://image/chatBox_cam2.png'
}]
},
// fixedOn:api.frameName
}, function(ret){
//点击附加功能面板
if(ret.eventType == 'clickExtras'){
alert("用户点击了第"+ ret.index +"个按钮");
}
//点击发送按钮
if(ret.eventType == 'send'){
alert('输入的内容是:'+ ret.msg);
}
});
} |
|