|
本帖最后由 uoaccw 于 2019-1-5 13:31 编辑
美洽是一款实现手机用户与企业保持随时随刻沟通的客服工具。
https://docs.apicloud.com/Client-API/Open-SDK/meiQia
使用前需要先去美洽官网申请appkey, 填到代码中。
参考美洽接入指南文档:https://docs.apicloud.com/Others ... ration-Guide/meiQia
这个客服模块功能还是挺丰富的,能发送图片,表情,语音,拍照,评价,设置预发送消息等。
附件有代码包。
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
- <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
- <title>Hello APP</title>
- <link rel="stylesheet" type="text/css" href="../css/api.css" />
- <style>
- body {
- padding: 50px
- }
- button {
- width: 260px;
- height: 80px;
- background-color: #fff
- }
- </style>
- </head>
- <body>
- <button onclick="initMeiQia()">
- initMeiQia
- </button>
- <button onclick="meiQia_show()">
- meiQia_show
- </button>
- <button onclick="setTitleColor()">
- setTitleColor
- </button>
- <button onclick="setNavRightButton()">
- setNavRightButton
- </button>
- <button onclick="getUnreadMessageCount()">
- getUnreadMessageCount
- </button>
- <button onclick="setPreSendTextMessage()">
- setPreSendTextMessage
- </button>
- </body>
- <script type="text/javascript" src="../script/api.js"></script>
- <script type="text/javascript">
- var mq;
- function initMeiQia() {
- //创建美洽
- mq = api.require('meiQia');
- //配置初始化美洽需要的appkey
- var param = {
- appkey: "" <font color="Red"> // 这里需要填写自己在美洽申请的appkey</font>
- };
- //初始化美洽
- mq.initMeiQia(param, function(ret, err) {
- if (ret) {
- //初始化成功
- alert(JSON.stringify(ret));
- } else {
- //初始化失败
- alert(JSON.stringify(err));
- }
- })
- };
- function meiQia_show() {
- mq.show();
- }
- function setTitleColor() {
- var mq = api.require('meiQia');
- //设置title以及按钮颜色
- var titleColor = {
- color: "#0000ff"
- };
- mq.setTitleColor(titleColor);
- }
- function setNavRightButton() {
- console.log(123);
- var buttonInfo = {
- title: "test",
- image: "http://www.apicloud.com/image/jpeg/54/1f/541f675422b1d4469711b78680d81c6a.30x30.jpg"
- };
- mq = api.require('meiQia');
- mq.setNavRightButton(buttonInfo, buttonTapCallback);
- function buttonTapCallback() {
- alert("button tapped")
- }
- }
- function getUnreadMessageCount() {
- mq = api.require('meiQia');
- mq.getUnreadMessageCount(unreadMessageCountCallback);
- function unreadMessageCountCallback(result) {
- alert("总共有" + result["count"] + "条未读消息");
- }
- }
- function setPreSendTextMessage() {
- var message = {
- message: "This is the presend message, you can put your product here to indicate to agent that the client is browsing it",
- };
- mq = api.require('meiQia');
- mq.setPreSendTextMessage(message);
- }
- </script>
- </html>
复制代码
|
本帖子中包含更多资源,您需要 登录 才可以下载或查看,没有帐号?立即注册
X
|