This commit is contained in:
weipengfei 2024-06-11 10:44:10 +08:00
parent 72ea67e75e
commit 306e546dd9
4 changed files with 21 additions and 17 deletions

View File

@ -11,8 +11,10 @@
import * as pos from "@/utils/EscPostUtils.js"
const vw = ref(null); // web-view
const src = ref("https://erp-cashier.lihaink.cn/#/login");
// const src = ref("http://192.168.1.55:5178/#/");
// const src = ref("https://erp-cashier.lihaink.cn/#/login");
// const src = ref("http://192.168.1.55:5181/#/");
const src = ref("http://cashier-multi-store.lihaink.cn/#/");
onLoad(() => {
// #ifdef APP-PLUS

View File

@ -302,7 +302,7 @@ if (uni.restoreGlobal) {
__name: "index",
setup(__props) {
const vw = vue.ref(null);
const src = vue.ref("http://192.168.1.55:5178/#/");
const src = vue.ref("http://cashier-multi-store.lihaink.cn/#/");
onLoad(() => {
plus.navigator.setFullscreen(true);
getLocationManager(() => {
@ -335,14 +335,14 @@ if (uni.restoreGlobal) {
title: "不可打印空内容",
icon: "exception"
});
formatAppLog("log", "at pages/index/index.vue:66", "打印内容", stringData);
formatAppLog("log", "at pages/index/index.vue:68", "打印内容", stringData);
let deviceId = uni.getStorageSync("deviceId");
if (!deviceId)
return uni.showToast({
title: "蓝牙未连接到T58打印机, 请检查是否已配对T58打印机",
icon: "exception"
});
formatAppLog("log", "at pages/index/index.vue:82", "打印机地址=>", deviceId);
formatAppLog("log", "at pages/index/index.vue:84", "打印机地址=>", deviceId);
print(deviceId, stringData, () => {
uni.showToast({
title: "打印成功",
@ -353,7 +353,7 @@ if (uni.restoreGlobal) {
};
const onmessage = (e) => {
var _a, _b, _c, _d, _e, _f, _g, _h;
formatAppLog("log", "at pages/index/index.vue:100", "收到消息", e);
formatAppLog("log", "at pages/index/index.vue:102", "收到消息", e);
if (((_b = (_a = e.detail) == null ? void 0 : _a.data[0]) == null ? void 0 : _b.type) == "print") {
if ((_d = (_c = e.detail) == null ? void 0 : _c.data[0]) == null ? void 0 : _d.content) {
onPrintClick((_f = (_e = e.detail) == null ? void 0 : _e.data[0]) == null ? void 0 : _f.content);
@ -376,7 +376,7 @@ if (uni.restoreGlobal) {
address: e2.address
}
};
formatAppLog("log", "at pages/index/index.vue:124", "连接成功", e2);
formatAppLog("log", "at pages/index/index.vue:126", "连接成功", e2);
uni.setStorageSync("deviceId", e2.address);
vw.value.evalJS(`receiveData('${JSON.stringify(obj)}')`);
});
@ -643,11 +643,12 @@ if (uni.restoreGlobal) {
}
const inUpdate = () => {
uni.request({
url: "http://192.168.1.22:8546/api/app_update",
// url: 'http://192.168.1.22:8546/api/app_update',
url: "https://multi-store.lihaink.cn/api/app_update",
method: "GET",
success: (res) => {
formatAppLog("log", "at utils/update.js:26", "更新");
formatAppLog("log", "at utils/update.js:27", "======", res);
formatAppLog("log", "at utils/update.js:27", "更新");
formatAppLog("log", "at utils/update.js:28", "======", res);
let os = uni.getSystemInfoSync();
if (Object.keys(res.data.data).length > 0) {
if (compareVersions(res.data.data.version || "1.0.0", os.appWgtVersion) == 1) {
@ -674,10 +675,10 @@ if (uni.restoreGlobal) {
}
},
fail: (err) => {
formatAppLog("log", "at utils/update.js:57", "err", err);
formatAppLog("log", "at utils/update.js:58", "err", err);
},
complete: (res) => {
formatAppLog("log", "at utils/update.js:60", "结束", res);
formatAppLog("log", "at utils/update.js:61", "结束", res);
}
});
};

View File

@ -4,11 +4,11 @@
"iPhone",
"iPad"
],
"id": "__UNI__3A527D1",
"name": "采购收银测试",
"id": "__UNI__D15002B",
"name": "采购收银系统",
"version": {
"name": "1.0.1",
"code": 101
"name": "1.0.2",
"code": 102
},
"description": "",
"developer": {

View File

@ -20,7 +20,8 @@ function compareVersions(version1, version2) {
export const inUpdate = () => {
uni.request({
url: 'http://192.168.1.22:8546/api/app_update',
// url: 'http://192.168.1.22:8546/api/app_update',
url: 'https://multi-store.lihaink.cn/api/app_update',
method: 'GET',
success: (res) => {
console.log('更新');