|
本帖最后由 在路上V5 于 2021-3-31 16:35 编辑
我们就是用的你们美洽dome上的代码来测试的,用ios出现的闪退,代码如下:
<!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>initMeiQia</button>
<button>meiQia_show</button>
<button>setTitleColor</button>
<button>setNavRightButton</button>
<button>getUnreadMessageCount</button>
<button>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: "85273", // 这里需要填写自己在美洽申请的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>
先点击initMeiQia,然后在点击的meiQia_show,就出现了闪退
|
|