Merge branch 'test' of https://newgitea.sxczgkj.cn/czg_team/cashier_wx into prod
This commit is contained in:
@@ -233,6 +233,10 @@ export const useWebSocket = defineStore('socketTask', () => {
|
||||
|
||||
// 发送消息
|
||||
const sendMessage = (data) => {
|
||||
console.log('data',data)
|
||||
if(!data){
|
||||
return
|
||||
}
|
||||
if (isConnected.value && data) {
|
||||
// console.log('发送消息', data);
|
||||
socketTask.value.send({
|
||||
|
||||
@@ -49,6 +49,7 @@ export const Storelogin = defineStore("login", {
|
||||
rawData: infoRes.rawData,
|
||||
source: "wechat",
|
||||
});
|
||||
console.log('APIuserlogin',res);
|
||||
if (res) {
|
||||
this.token = res.token;
|
||||
this.miniAppOpenId = res.userInfo
|
||||
@@ -95,6 +96,9 @@ export const Storelogin = defineStore("login", {
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
resolve(true)
|
||||
// #endif
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -115,6 +119,18 @@ export const productStore = defineStore("product", {
|
||||
getLocation() {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log("获取经纬度");
|
||||
// #ifdef H5
|
||||
resolve({
|
||||
accuracy: 65,
|
||||
altitude: 0,
|
||||
errMsg: "getLocation:ok",
|
||||
horizontalAccuracy: 65,
|
||||
latitude: 23.129163,
|
||||
longitude: 113.264435,
|
||||
speed: -1,
|
||||
verticalAccuracy: 65,
|
||||
});
|
||||
// #endif
|
||||
uni.getLocation({
|
||||
type: "wgs84",
|
||||
altitude: true,
|
||||
@@ -167,6 +183,13 @@ export const productStore = defineStore("product", {
|
||||
*/
|
||||
async scanCodeactions(q) {
|
||||
console.log("扫码内容", q);
|
||||
// #ifdef H5
|
||||
uni.navigateTo({
|
||||
url:'/pages/product/index'
|
||||
})
|
||||
return
|
||||
// #endif
|
||||
|
||||
return new Promise(async (resolve, reject) => {
|
||||
if (q) {
|
||||
console.log(q);
|
||||
@@ -206,7 +229,7 @@ export const productStore = defineStore("product", {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
|
||||
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
|
||||
uni.scanCode({
|
||||
success: async (res) => {
|
||||
let tableCode = this.getQueryString(
|
||||
@@ -298,11 +321,11 @@ export const productStore = defineStore("product", {
|
||||
]) {
|
||||
resolve(
|
||||
true
|
||||
);
|
||||
);
|
||||
} else {
|
||||
reject(
|
||||
false
|
||||
);
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user