Commit ac5c7a50 by 施宇

111

parent 670d518b
Showing with 9 additions and 18 deletions
...@@ -220,7 +220,7 @@ WebIM.conn = new WebIM.connection({ ...@@ -220,7 +220,7 @@ WebIM.conn = new WebIM.connection({
https: typeof WebIM.config.https === "boolean" ? WebIM.config.https : location.protocol === "https:", https: typeof WebIM.config.https === "boolean" ? WebIM.config.https : location.protocol === "https:",
url: WebIM.config.xmppURL, url: WebIM.config.xmppURL,
apiUrl: WebIM.config.apiURL, apiUrl: WebIM.config.apiURL,
isAutoLogin: false, isAutoLogin: true,
heartBeatWait: WebIM.config.heartBeatWait, heartBeatWait: WebIM.config.heartBeatWait,
autoReconnectNumMax: WebIM.config.autoReconnectNumMax, autoReconnectNumMax: WebIM.config.autoReconnectNumMax,
autoReconnectInterval: WebIM.config.autoReconnectInterval autoReconnectInterval: WebIM.config.autoReconnectInterval
......
...@@ -129,7 +129,7 @@ const webimListen = () => { ...@@ -129,7 +129,7 @@ const webimListen = () => {
duration: 2000 duration: 2000
}); });
} }
WebIM.conn.setPresence(); // WebIM.conn.setPresence();
}, },
onReconnect() { onReconnect() {
// wx.showToast({ // wx.showToast({
......
...@@ -326,22 +326,13 @@ const interval = (usedTime) => { ...@@ -326,22 +326,13 @@ const interval = (usedTime) => {
} }
const fourPoint = (num) => { //检测价格是否是数字或者是不大于四位小数点的小数 const fourPoint = (num) => { //检测价格是否是数字或者是不大于四位小数点的小数
let price = num.trim(); let price = num.trim();
if (!price.length) { console.log(price)
tips('请填写价格'); let reg = /^(([1-9][0-9]*)|(([0]\.\d{1,4}|[1-9][0-9]*\.\d{1,4})))$/;
return false if(!reg.test(price)){
} else { tips('价格为整数或不超过4位小数');
if (isNaN(price)) { return false;
tips('价格必须为数字'); }else{
return false return true;
} else {
let strArr = price.split('.');
if ((strArr.length == 1) || (strArr.length == 2 && strArr[1].length < 5)) {
return true
} else {
tips('价格最多4位小数点');
return false
}
}
} }
} }
const matchReg = (str) => { const matchReg = (str) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment