123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- // 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") {
- switch (action) {
- case 'quit':
- return exit();
- case 'dormant':
- return downline();
- }
- }
- // 退出
- 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)
- 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
|