Commit ac5c7a50 by 施宇

111

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