|
|
@ -46,8 +46,8 @@ |
|
|
// mainurl: 'https://taketest.sdwanyue.com/api/?s=', |
|
|
// mainurl: 'https://taketest.sdwanyue.com/api/?s=', |
|
|
// mainurl: 'https://take.sdwanyue.com/api/?s=', |
|
|
// mainurl: 'https://take.sdwanyue.com/api/?s=', |
|
|
// mainurl: 'https://dev.xenjoyou.com/hiver', |
|
|
// mainurl: 'https://dev.xenjoyou.com/hiver', |
|
|
mainurl: 'https://hbkuaishi.com/hiver', |
|
|
// mainurl: 'https://hbkuaishi.com/hiver', |
|
|
// mainurl: 'http://192.168.1.192:8888/hiver', |
|
|
mainurl: 'http://192.168.100.32:8888/hiver', |
|
|
// #endif |
|
|
// #endif |
|
|
// weburl: 'https://taketest.sdwanyue.com/', |
|
|
// weburl: 'https://taketest.sdwanyue.com/', |
|
|
weburl: 'https://takeout.sdwanyue.com/', |
|
|
weburl: 'https://takeout.sdwanyue.com/', |
|
|
@ -80,7 +80,6 @@ |
|
|
return context.$t(str) |
|
|
return context.$t(str) |
|
|
} |
|
|
} |
|
|
this.getAreaSize() |
|
|
this.getAreaSize() |
|
|
console.log('jpushModule', jpushModule) |
|
|
|
|
|
// this.getRegistrationID() |
|
|
// this.getRegistrationID() |
|
|
// #ifdef APP-PLUS |
|
|
// #ifdef APP-PLUS |
|
|
jpushModule.initJPushService(); |
|
|
jpushModule.initJPushService(); |
|
|
@ -95,7 +94,6 @@ |
|
|
//监听 极光推送连接状态 |
|
|
//监听 极光推送连接状态 |
|
|
this.getNotificationEnabled(); |
|
|
this.getNotificationEnabled(); |
|
|
jpushModule.addConnectEventListener(result => { |
|
|
jpushModule.addConnectEventListener(result => { |
|
|
console.log('----------------------------', result) |
|
|
|
|
|
let connectEnable = result.connectEnable |
|
|
let connectEnable = result.connectEnable |
|
|
if (connectEnable == true) { |
|
|
if (connectEnable == true) { |
|
|
|
|
|
|
|
|
@ -103,7 +101,6 @@ |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
console.log('监听到了连接状态变化 --- ') |
|
|
|
|
|
}); |
|
|
}); |
|
|
jpushModule.addNotificationListener(result => { //极光推送的消息通知回调 |
|
|
jpushModule.addNotificationListener(result => { //极光推送的消息通知回调 |
|
|
jpushModule.setBadge(0); |
|
|
jpushModule.setBadge(0); |
|
|
@ -123,7 +120,6 @@ |
|
|
} |
|
|
} |
|
|
// 将消息数据推入打印队列 |
|
|
// 将消息数据推入打印队列 |
|
|
this.globalData.printData.push(JSON.parse(result.android.inAppExtras)) |
|
|
this.globalData.printData.push(JSON.parse(result.android.inAppExtras)) |
|
|
console.log("通知入队,当前队列长度:", this.globalData.printData.length) |
|
|
|
|
|
// 若当前未在打印,则启动队列处理 |
|
|
// 若当前未在打印,则启动队列处理 |
|
|
if (!this.globalData.isPrinting) { |
|
|
if (!this.globalData.isPrinting) { |
|
|
this.processPrintQueue() |
|
|
this.processPrintQueue() |
|
|
@ -136,7 +132,6 @@ |
|
|
const { |
|
|
const { |
|
|
code |
|
|
code |
|
|
} = res |
|
|
} = res |
|
|
console.log(res, '安卓连接状态'); |
|
|
|
|
|
}) |
|
|
}) |
|
|
//#endif |
|
|
//#endif |
|
|
|
|
|
|
|
|
@ -196,17 +191,14 @@ |
|
|
// 队列为空时,重置打印标志并退出 |
|
|
// 队列为空时,重置打印标志并退出 |
|
|
if (this.globalData.printData.length === 0) { |
|
|
if (this.globalData.printData.length === 0) { |
|
|
this.globalData.isPrinting = false |
|
|
this.globalData.isPrinting = false |
|
|
console.log("打印队列已全部处理完毕") |
|
|
|
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
// 标记正在打印,防止并发触发 |
|
|
// 标记正在打印,防止并发触发 |
|
|
this.globalData.isPrinting = true |
|
|
this.globalData.isPrinting = true |
|
|
console.log("开始打印队头数据,剩余队列长度:", this.globalData.printData.length) |
|
|
|
|
|
// 调用打印,传入 onDone 回调 |
|
|
// 调用打印,传入 onDone 回调 |
|
|
printer.getData(() => { |
|
|
printer.getData(() => { |
|
|
// 打印完成(或异常跳过),从队列中删除已处理的队头 |
|
|
// 打印完成(或异常跳过),从队列中删除已处理的队头 |
|
|
this.globalData.printData.shift() |
|
|
this.globalData.printData.shift() |
|
|
console.log("本条打印完成,队列剩余:", this.globalData.printData.length) |
|
|
|
|
|
// 继续处理下一条 |
|
|
// 继续处理下一条 |
|
|
this.processPrintQueue() |
|
|
this.processPrintQueue() |
|
|
}) |
|
|
}) |
|
|
@ -235,7 +227,6 @@ |
|
|
}, |
|
|
}, |
|
|
getAreaSize() { |
|
|
getAreaSize() { |
|
|
var res = uni.getSystemInfoSync() |
|
|
var res = uni.getSystemInfoSync() |
|
|
// console.log(res) |
|
|
|
|
|
this.globalData.safeAreaInsets = res.safeAreaInsets |
|
|
this.globalData.safeAreaInsets = res.safeAreaInsets |
|
|
this.globalData.windowHeight = res.windowHeight |
|
|
this.globalData.windowHeight = res.windowHeight |
|
|
this.globalData.screenHeight = res.screenHeight |
|
|
this.globalData.screenHeight = res.screenHeight |
|
|
@ -247,7 +238,6 @@ |
|
|
this.globalData.pageHeight = this.globalData.windowHeight + 44 + this.globalData.top |
|
|
this.globalData.pageHeight = this.globalData.windowHeight + 44 + this.globalData.top |
|
|
// #ifdef MP-WEIXIN |
|
|
// #ifdef MP-WEIXIN |
|
|
var weixin = uni.getMenuButtonBoundingClientRect(); |
|
|
var weixin = uni.getMenuButtonBoundingClientRect(); |
|
|
// console.log(weixin) |
|
|
|
|
|
this.globalData.top = weixin.top |
|
|
this.globalData.top = weixin.top |
|
|
this.globalData.menuButtonWidth = weixin.width |
|
|
this.globalData.menuButtonWidth = weixin.width |
|
|
this.globalData.menuButtonLeft = weixin.left |
|
|
this.globalData.menuButtonLeft = weixin.left |
|
|
@ -280,7 +270,6 @@ |
|
|
jpushModule.getRegistrationID(result => { |
|
|
jpushModule.getRegistrationID(result => { |
|
|
let registerID = result.registerID |
|
|
let registerID = result.registerID |
|
|
this.globalData.registrationID = registerID |
|
|
this.globalData.registrationID = registerID |
|
|
console.log("看这里", result) |
|
|
|
|
|
uni.setStorageSync("registerID", registerID) |
|
|
uni.setStorageSync("registerID", registerID) |
|
|
// uni.setStorageSync("signPerson", result.signPerson) |
|
|
// uni.setStorageSync("signPerson", result.signPerson) |
|
|
}) |
|
|
}) |
|
|
@ -354,12 +343,6 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
onShow: function() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
onHide: function() { |
|
|
|
|
|
// console.log('App Hide') |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
|