// function handleQuit() { // if (userCardType === 1) { // $.actions({ // actions: [{ // text: "退出", // onClick: function () { // decodeWoker.postMessage('close'); // decodeWoker.terminate(); // quit(); // } // }, { // text: "退出并下机", // onClick: function () { // downline(); // } // }] // }); // } else { // decodeWoker.postMessage('close'); // decodeWoker.terminate(); // quit(); // } // } function handleQuit(action = "quit") { $('.control-right-img').attr({ 'data-id': '1', }); $('.leftmains').css({ right: '-4rem', }); switch (action) { case 'quit': return exit(); case 'dormant': $.confirm({ title: '提示', text: '确定退出云手机并下机', onOK: function () { //点击确认 downline(); }, }); // return } } // 退出 function exit() { decodeWoker.postMessage('close'); decodeWoker.terminate(); 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) { decodeWoker.postMessage('close'); decodeWoker.terminate(); deleteDB(db, storeName, userCardId) parent.postMessage( { type: 'exit', }, '*', ); uni.postMessage({ data: { type: 'exit' } }); 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