{
    "name": "gov-voice-recognizer",
    "label": "语音识别",
    "description": "语音识别",
    "codeSnap": "<gov-voice-recognizer\n     show-panel=\"{{true}}\"\n/>",
    "groups": "layout",
    "demoCode": {
        "s": "<view class=\"preview-caption\">听音模式（touch，此模式手动听音，需要手动调用stop方法才会停止语音识别）：{{voiceManualCont}}</view>\n    <view class=\"preview-section\" bind:tap=\"openManualVoicePanel\">\n        点击说话\n        <gov-voice-recognizer\n            show-panel=\"{= showManualPanel =}\"\n            bindstop=\"getManualCont\"\n            bindcancelend=\"cancelManualEnd\"\n            mode=\"touch\"\n        />\n    </view>\n    <view class=\"preview-caption\">自定义语音文案：{{voiceTextCont}}</view>\n    <view class=\"preview-section\" bind:tap=\"openTextVoicePanel\">\n        点击说话\n        <gov-voice-recognizer\n            show-panel=\"{= showTextPanel =}\"\n            bindcancelend=\"cancelTextEnd\"\n            bindstop=\"getTextCont\"\n            defaultText=\"聆听中，请说话...\"\n        />\n    </view>\n    <view class=\"preview-caption\">自定义样式：{{voiceColorCont}}</view>\n    <view class=\"preview-section\" bind:tap=\"openColorVoicePanel\">\n        点击说话\n        <gov-voice-recognizer\n            show-panel=\"{= showColorPanel =}\"\n            bindcancelend=\"cancelColorEnd\"\n            bindstop=\"getColorCont\"\n            gov-mark=\"gov-mark\"\n            gov-btn-voice=\"gov-btn-voice\"\n            gov-voice-panel=\"gov-voice-panel\"\n            gov-word-box=\"gov-word-box\"\n        />\n    </view>",
        "js": "Page({\n    data: {\n        showManualPanel: false,\n        showManualCont: '',\n        showTextPanel: false,\n        showTextCont: '',\n        showColorPanel: false,\n        showColorCont: ''\n    },\n    openManualVoicePanel() {\n        this.setData({\n            showManualPanel: true\n        });\n    },\n    openTextVoicePanel() {\n        this.setData({\n            showTextPanel: true\n        });\n    },\n    openColorVoicePanel() {\n        this.setData({\n            showColorPanel: true\n        });\n    },\n    cancelManualEnd() {\n        this.setData({\n            showManualPanel: false\n        });\n    },\n    cancelTextEnd() {\n        this.setData({\n            showTextPanel: false\n        });\n    },\n    cancelColorEnd() {\n        this.setData({\n            showColorPanel: false\n        });\n    },\n    getManualCont(e) {\n        this.setData({\n            voiceManualCont: e.content\n        });\n    },\n    getTextCont(e) {\n        this.setData({\n            voiceTextCont: e.content\n        });\n    },\n    getColorCont(e) {\n        this.setData({\n            voiceColorCont: e.content\n        });\n    }\n});",
        "css": ".preview-section {\n    padding: 13px;\n    font-size: 15px;\n}\n.gov-mark {\n    background-color: rgba(201, 184, 184, 0.3) !important;\n}\n.gov-voice-panel {\n    background: #F5FFFA !important;\n}\n.gov-btn-voice {\n    background: #ffc0cb !important;\n    height: 60px !important;\n    width: 300px !important;\n    margin: 0 auto !important;\n}\n.gov-word-box {\n    color: #ffdab9 !important;\n    font-size: 15px !important;\n}"
    },
    "fragement": "",
    "properties": {
        "attributes": [
            {
                "name": "longSpeech",
                "type": "Boolean",
                "description": "是否开启长语音，默认不开启，长语音模式（此模式不限制收音时长，适用于长字段输入），短语音模式（此模式支持60秒以内识别，适用于短字段输入）",
                "required": "否",
                "default": "false"
            },
            {
                "name": "mode",
                "type": "String",
                "description": "听音模式，dnn（此模式自动听音,默认值），touch（此模式手动听音，需要手动调用stop方法才会停止语音识别）",
                "required": "否",
                "default": "dnn"
            },
            {
                "name": "context",
                "type": "String",
                "description": "语音识别所用的场景值，input（输入法场景），search（搜索场景值）",
                "required": "否",
                "default": "input"
            },
            {
                "name": "defaultText",
                "type": "String",
                "description": "语音文案",
                "required": "否",
                "default": "正在聆听中…"
            },
            {
                "name": "showPanel",
                "type": "Boolean",
                "description": "是否要展示语音面板，需要使用双向绑定show-panel='{= showPanel =}'",
                "required": "否",
                "default": "false"
            },
            {
                "name": "hasTabBar",
                "type": "Boolean",
                "description": "页面是否有tabBar",
                "required": "否",
                "default": "false"
            }
        ],
        "events": [
            {
                "name": "stop",
                "type": "Event",
                "description": "点击时停止识别",
                "required": "否",
                "default": "-"
            },
            {
                "name": "cancelend",
                "type": "Event",
                "description": "点击取消识别",
                "required": "否",
                "default": "-"
            }
        ],
        "externalClasses": [
            {
                "name": "gov-mark",
                "type": "",
                "description": "遮罩层的扩展样式类，可通过此class改变遮罩层的样式",
                "required": "否",
                "default": "-"
            },
            {
                "name": "gov-voice-panel",
                "type": "",
                "description": "语音面板的扩展样式类，可通过此class改变语音面板的样式",
                "required": "否",
                "default": "-"
            },
            {
                "name": "gov-btn-voice",
                "type": "",
                "description": "按钮的扩展样式类，可通过此class改变按钮的样式",
                "required": "否",
                "default": "-"
            },
            {
                "name": "gov-word-box",
                "type": "",
                "description": "语音文案的扩展样式类，可通过此class改变语音文案的样式",
                "required": "否",
                "default": "-"
            }
        ]
    }
}