// function handleQuit() { // if (userCardType === 1) { // $.actions({ // actions: [{ // text: "退出", // onClick: function () { // ws.close(); // wsss.close(); // quit(); // } // }, { // text: "退出并下机", // onClick: function () { // downline(); // } // }] // }); // } else { // ws.close(); // wsss.close(); // quit(); // } // } function handleQuit(action = "quit") { switch (action) { case 'quit': return exit(); case 'dormant': return downline(); } } // 退出 function exit() { ws.close(); wsss.close(); quit(); } // 退出并下机 function downline() { $.ajax({ url: baseUrl + '/api/resources/yearMember/downline?userCardId=' + userCardId, headers: { Authorization: token }, type: 'get', dataType: 'json', success: function (res) { if (res.status === 0) { ws.close(); wsss.close(); deleteDB(db, storeName, userCardId); quit(); } else { $.toast(res.msg, 'text'); } }, }); } function residueTimeStamp(value) { let theTime = value;//秒 let middle = 0;//分 let hour = 0;//小时 if (theTime > 59) { middle = parseInt(theTime / 60); theTime = parseInt(theTime % 60); } if (middle > 59) { hour = parseInt(middle / 60); middle = parseInt(middle % 60); } theTime < 10 ? theTime = '0' + theTime : theTime = theTime middle < 10 ? middle = '0' + middle : middle = middle hour < 10 ? hour = '0' + hour : hour = hour return hour + ':' + middle + ':' + theTime } function handleclose() { $.ajax({ url: baseUrl + '/api/resources/yearMember/closeRemind?userCardId=' + userCardId, headers: { Authorization: token, }, type: 'get', dataType: 'json', async: false, success: function (res) { if (res.status === 0) { clearInterval(residueTimer); $("#countView").hide() } else { $.toast(res.msg, 'text'); } }, }); } $.toast.prototype.defaults.duration = 4000