|
- var UIChatBox = api.require('UIChatBox');
- UIChatBox.open({
- placeholder: '',
- maxRows: 4,
- emotionPath: 'widget://res/img/emotion',
- texts: {
- recordBtn: {
- normalTitle: '按住说话',
- activeTitle: '松开结束'
- },
- sendBtn: {
- title: 'send'
- }
- },
- styles: {
- inputBar: {
- borderColor: '#d9d9d9',
- bgColor: '#f2f2f2'
- },
- inputBox: {
- borderColor: '#B3B3B3',
- bgColor: '#FFFFFF'
- },
- emotionBtn: {
- normalImg: 'widget://res/img/chatBox_face1.png'
- },
- extrasBtn: {
- normalImg: 'widget://res/img/chatBox_add1.png'
- },
- keyboardBtn: {
- normalImg: 'widget://res/img/chatBox_key1.png'
- },
- speechBtn: {
- normalImg: 'widget://res/img/chatBox_key1.png'
- },
- recordBtn: {
- normalBg: '#c4c4c4',
- activeBg: '#999999',
- color: '#000',
- size: 14
- },
- indicator: {
- target: 'both',
- color: '#c4c4c4',
- activeColor: '#9e9e9e'
- },
- sendBtn: {
- titleColor: '#4cc518',
- bg: '#999999',
- activeBg: '#46a91e',
- titleSize: 14
- }
- },
- extras: {
- titleSize: 10,
- titleColor: '#a3a3a3',
- btns: [{
- title: '图片',
- normalImg: 'widget://res/img/chatBox_album1.png',
- activeImg: 'widget://res/img/chatBox_album2.png'
- }, {
- title: '拍照',
- normalImg: 'widget://res/img/chatBox_cam1.png',
- activeImg: 'widget://res/img/chatBox_cam2.png'
- }]
- }
- }, function(ret, err) {
- if (ret.eventType == "send") {
- // 点击后事件
- } else {
- alert(JSON.stringify(err));
- }
- });
复制代码
|
|