This commit is contained in:
GaoHao
2024-08-08 17:06:26 +08:00
parent d82bd93033
commit b67f1381ca
4 changed files with 51 additions and 60 deletions

View File

@@ -166,7 +166,7 @@ export default {
return uni.api.get("/product/queryShopIdByTableCode", data); return uni.api.get("/product/queryShopIdByTableCode", data);
}, },
geocodelocation(data) { //根据经纬度获取信息 geocodelocation(data) { //根据经纬度获取信息
return uni.api.get("/location/geocode", data); return uni.api.get("/location/geocode", data, false);
}, },
// 修改头像和昵称 // 修改头像和昵称
upUserInfo(data) { upUserInfo(data) {

View File

@@ -16,11 +16,11 @@ const baseUrlwws = 'ws://cashier.sxczgkj.cn/cashierService'
// #endif // #endif
// #ifdef APP || MP-WEIXIN // #ifdef APP || MP-WEIXIN
const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.cn/cashierService' // 线上 // const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.cn/cashierService' // 线上
const baseUrlwws = debug ? proxyApiwws : 'wss://cashier.sxczgkj.cn/netty' // 线上 // const baseUrlwws = debug ? proxyApiwws : 'wss://cashier.sxczgkj.cn/netty' // 线上
// const baseUrl = 'https://cashier.sxczgkj.cn/cashierService' // 线上 const baseUrl = 'https://cashier.sxczgkj.cn/cashierService' // 线上
// const baseUrlwws = 'wss://cashier.sxczgkj.cn/netty' // 线上/ const baseUrlwws = 'wss://cashier.sxczgkj.cn/netty' // 线上/
// #endif // #endif
// import VConsole from "./vConsole.js" // import VConsole from "./vConsole.js"

View File

@@ -216,9 +216,22 @@
title: "支付成功" title: "支付成功"
}) })
uni.hideLoading() uni.hideLoading()
let pages = getCurrentPages()
if ( pages.length > 1) {
setTimeout(res => { setTimeout(res => {
uni.navigateBack() uni.navigateBack()
}, 500) }, 500)
} else {
uni.exitMiniProgram({
success: function () {
console.log('退出成功');
},
fail: function () {
console.log('退出失败');
}
});
}
}, },
fail: (res) => { fail: (res) => {
uni.hideLoading() uni.hideLoading()

View File

@@ -424,7 +424,6 @@
scrollTop: 0, scrollTop: 0,
duration: 0 duration: 0
}); });
if (!uni.cache.get('token')) {
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: async (data) => { success: async (data) => {
@@ -452,10 +451,6 @@
} catch (e) {} } catch (e) {}
} }
}); });
} else {
uni.$on('message', this.getMessage)
_this.getLocation()
}
}, },
methods: { methods: {
navigateBacknav() { navigateBacknav() {
@@ -508,25 +503,8 @@
}, },
fail: async (err) => { fail: async (err) => {
console.log(err, '获取错误') //测试用于app console.log(err, '获取错误') //测试用于app
let successres = await this.api.geocodelocation({
lng: '',
lat: '',
})
if (successres.code == 0) {
console.log(successres.data.addressComponent.streetNumber.location.split(','))
let res = successres.data.addressComponent.streetNumber.location.split(',')
let datastorage = {
country: successres.data.addressComponent.country, // "中国"
province: successres.data.addressComponent.province, //province: "陕西省"
address: successres.data.addressComponent.city, //district: "西安市"
district: successres.data.addressComponent.district, //district: "未央区"
lng: res[0],
lat: res[1],
}
uni.cache.set('getLocationstorage', datastorage);
this.productqueryShop(); this.productqueryShop();
} }
}
}); });
}, },
@@ -536,8 +514,8 @@
async productqueryShop() { async productqueryShop() {
let res = await this.api.productqueryShop({ let res = await this.api.productqueryShop({
code: uni.cache.get('tableCode'), code: uni.cache.get('tableCode'),
lng: uni.cache.get('getLocationstorage').lng, lng: uni.cache.get('getLocationstorage').lng?uni.cache.get('getLocationstorage').lng:'',
lat: uni.cache.get('getLocationstorage').lat, lat: uni.cache.get('getLocationstorage').lat? uni.cache.get('getLocationstorage').lat:'',
}) })
if (res.code == 0) { if (res.code == 0) {
uni.cache.set('shopUser', res.data.storeInfo.id) uni.cache.set('shopUser', res.data.storeInfo.id)