dangerouslyUHTMLString: true,
message: `<p class="f-nt" ><i class="el-icon-warning"></i>您有⼀笔新订单,请及时接单</p>
<p >超过15分钟未接单订单将⾃动推送给⽹点业务员</p><p><span @click="checkDetail" style="float:right;color:#4 onClick: function () { _that.checkDetail(order, notify); },
onClo: function () { _that.cloNotify(order, notify); },
});
let time = 15 * 60;//秒数
let interval = window.tInterval(function () {
--time;
let e = ElementById(id);
if (e) {
e.innerHTML = parInt(time / 60) + ':' + time % 60;
if (time < 1) {
window.clearInterval(interval);
notify.clo();
}
} el {
window.clearInterval(interval);
}
}, 1000);
},
鸟的笔画
openCancel(order) {
let _that = this;
// _derCancelMp3()
let d = new Date();
let id = d.getTime();
let notify = _that.$notify({
title: `已取消订单:${order}`,
// title: `已取消订单`,
customClass: 'f-n',
dangerouslyUHTMLString: true,
message: `<p class="f-nt" ><i class="el-icon-warning"></i>您
有⼀笔订单已取消,请注意!</p><p><span @click="checkDetailCa onClick: function () { _that.checkDetailCancel(order, notify); },
onClo: function () { _that.cloNotifyCancel(order, notify); },
});
let time = 15 * 60;//秒数
let interval = window.tInterval(function () {
--time;
let e = ElementById(id);
if (e) {
e.innerHTML = parInt(time / 60) + ':' + time % 60;
if (time < 1) {
window.clearInterval(interval);
notify.clo();
}
} el {
window.clearInterval(interval);
}
}, 1000);
},
//待收件即将超时
openDs(order) {
let _that = this;
// _derDsMp3()
let d = new Date();
let id = d.getTime();
let notify = _that.$notify({
// title: `已取消订单:${order}`,
title: `待收件即将超时:${order}`,
customClass: 'f-n',
dangerouslyUHTMLString: true,
message: `<p class="f-nt" ><i class="el-icon-warning"></i>您有⼀笔订单即将超时,请及时收件!</p><p><span @click="check onClick: function () { _that.checkDetailDs(order, notify); },
onClo: function () { _that.cloNotifyCancel(order, notify); },
});
let time = 15 * 60;//秒数
let interval = window.tInterval(function () {
--time;
let e = ElementById(id);
if (e) {
if (e) {
e.innerHTML = parInt(time / 60) + ':' + time % 60;
if (time < 1) {
window.clearInterval(interval);
notify.clo();
}
} el {
window.clearInterval(interval);
}
}, 1000);
},
checkDetail(order, notify) {
if (this.$route.path == '/mailmanage') {
this.bus.$emit("sockets", 0);
} el {
this.$router.push({ path: "/mailmanage", query: { order, type: 0 } }); }
notify.clo();
},
checkDetailCancel(order, notify) {
if (this.$route.path == '/mailmanage') {
this.bus.$emit("sockets", 3);
} el {
this.$router.push({ path: "/mailmanage", query: { order, type: 3 } }); }
notify.clo();
},
//待收件
checkDetailDs(order, notify) {
if (this.$route.path == '/mailmanage') {
this.bus.$emit("sockets", 1);
} el {
this.$router.push({ path: "/mailmanage", query: { order, type: 1 } }); }
notify.clo();
},
cloNotify(order) {
// alert("关闭:"+order);
},
cloNotifyCancel(order) {
// alert("关闭:"+order);
},
initWebSocket() {//建⽴连接
//初始化weosocket
let ur = JSON.Item('UrInfo'));
const wsuri = 'ws://后端提供socket服务ip'.replace("http", "ws")
//建⽴连接
this.websock = new WebSocket(wsuri);
//连接成功
pen = this.websocketonopen;
五邑大学排名//连接错误
r = this.websocketonerror;
//接收信息
ssage = this.websocketonmessage;
//连接关闭
lo = this.websocketclo;
},
reconnect() {//重新连接
// console.log(this.pushid)
if (this.pushid != -1) {
var that = this;
if (that.lockReconnect) {
return;
};
that.lockReconnect = true;
//没连接上会⼀直重连,设置延迟避免请求过多
审稿意见怎么写
that.timeoutnum && clearTimeout(that.timeoutnum);
that.timeoutnum = tTimeout(function () {
//新连接锻炼是什么意思
that.initWebSocket();
that.lockReconnect = fal;
}, 5000);
}
},
ret() {//重置⼼跳
var that = this;
//清除时间
clearTimeout(that.timeoutObj);
clearTimeout(that.rverTimeoutObj);
//重启⼼跳
that.start(this.pushid);
},
start(id) {//开启⼼跳
let urs = JSON.Item('UrInfo'));
var lf = this;
if (id == -1) {
lf.websocketclo()
return fal
} el {
lf.timeoutObj && clearTimeout(lf.timeoutObj);
lf.rverTimeoutObj && clearTimeout(lf.rverTimeoutObj);
lf.timeoutObj = tTimeout(function () {
//这⾥发送⼀个⼼跳,后端收到后,返回⼀个⼼跳消息,
if (adyState == 1) {//如果连接正常
lf.websock.nd(`{"agentId":${urs.agentId},"phone":${urs.phone}}`); } el {//否则重连
}
lf.rverTimeoutObj = tTimeout(function () {
//超时关闭
lf.websock.clo();
}, lf.timeout);
}, lf.timeout)
}
},
websocketonopen() {//连接成功事件
let urinfo = JSON.Item('UrInfo'));
this.websock.nd(`{"agentId":${urinfo.agentId},"phone":${urinfo.phone}}`); //开启⼼跳
市场部的八个职位tTimeout(() => {
this.start(this.pushid);
}, 200)
花市},
websocketonerror(e) {//连接失败事件
//错误
console.log("WebSocket连接发⽣错误");
//重连
},
websocketclo(e) {//连接关闭事件
//关闭
/
/ console.log("connection clod");
// console.log('websocket 断开: ' + e.code + ' ' + e.reason + ' ' + e.wasClean)
// console.log(e)
//提⽰关闭
//重连防⽌资源消耗
裁判员宣誓词简短if (this.pushid != -1) {
} el {
this.$message({
这也是一个人
message: '请刷新浏览器,重新连接开启消息提醒',
type: 'warning'
});
}
},
websocketonmessage(event) {//接收服务器推送的信息