diff --git a/config/app.js b/config/app.js index 01e3316..ab2ac5f 100644 --- a/config/app.js +++ b/config/app.js @@ -10,7 +10,7 @@ switch (env) { BASE_URL = 'https://test-multi-store.lihaink.cn'; break; case 'liu': - BASE_URL = 'http://192.168.1.22:8545'; + BASE_URL = 'http://192.168.1.201:8545'; break; default: BASE_URL = 'https://multi-store.lihaink.cn'; diff --git a/multipleShop/index/index.vue b/multipleShop/index/index.vue index 42d295e..5637c50 100644 --- a/multipleShop/index/index.vue +++ b/multipleShop/index/index.vue @@ -89,6 +89,7 @@ // 门店选择 const onChooseShop = (item) => { + return currShop.value = item.id; uni.setStorageSync('STORE_INFO', JSON.stringify(item)); // 如果选择了新店铺,删除之前的分享信息 @@ -161,10 +162,8 @@ const getLocation = () => { let location = uni.getStorageSync('location'); if (location) { - let [lng, lat] = location.split(','); - queryParams.longitude = lng; - queryParams.latitude = lat; - + queryParams.longitude = location.lat + queryParams.latitude = location.long // 加载店铺列表 getShopList(); } else { @@ -178,7 +177,10 @@ getShopList(); // 避免下次再获取 - uni.setStorageSync('location', `${res.longitude},${res.latitude}`) + uni.setStorageSync('location', { + lat: queryParams.latitude, + long: queryParams.longitude + }) } }) } diff --git a/pages/index/index.vue b/pages/index/index.vue index e6d117a..f69e464 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -24,7 +24,7 @@ {{(shareInfo.real_name||userStore.userInfo.nickname) + '的供销个人门店' }} + style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{(shareInfo.real_name||( userStore.userInfo.real_name|| userStore.userInfo.nickname)) + '的供销个人门店' }} {{STORE_INFO.store_name}} @@ -222,8 +222,8 @@ import useUserStore from "@/store/user"; const userStore = useUserStore(); const STORE_INFO = reactive({ - id: 5, - store_name: "测试" + id: 4, + store_name: "农(特)产品直营店" }) const getStoreInfoFn = () => { @@ -246,10 +246,10 @@ let shareStr = '?id=' + STORE_INFO.id; if (userStore.userInfo.user_ship == 1) { shareStr = shareStr + '&spread_uid=' + userStore.userInfo.id + '&real_name=' + (userStore.userInfo - .nickname) + .real_name || userStore.userInfo.nickname) } let shareInfo = { - title: userStore.userInfo.nickname, + title: (userStore.userInfo.real_name || userStore.userInfo.nickname) + '的供销个人门店', path: '/pages/index/index' + shareStr, imageUrl: STORE_INFO.image || '', success() { diff --git a/pagesOrder/detail/detail.vue b/pagesOrder/detail/detail.vue index 782db89..03438dc 100644 --- a/pagesOrder/detail/detail.vue +++ b/pagesOrder/detail/detail.vue @@ -4,7 +4,9 @@ 还剩{{countDown}}订单自动取消 - + @@ -13,8 +15,6 @@ {{shopInfo.name}} - {{shopInfo.detailed_address}} @@ -24,16 +24,14 @@ {{shopInfo.name||shopInfo.mer_real_name}} {{shopInfo.phone}} - + + 所有提货点 + - @@ -237,11 +235,12 @@ const datas = ref({}) const getDetails = () => { orderDetailApi({ - order_id: datas.value.id + order_id: datas.value.id, + ...location }).then(res => { datas.value = res.data; options.code = datas.value.verify_code; // 生成条形码的值 - shopInfo.value = res.data.store_info; + shopInfo.value = res.data.near_store; if (addressList.value.length > 0 && res.data.paid) { addressInfo.value = addressList.value.find(item => item.address_id == res.data.address_id); } else { @@ -456,13 +455,37 @@ }) } + // 获取位置 + let location = { + lat: "", + long: "", + } + + const getLocation = () => { + if (uni.getStorageSync('location')) { + location = uni.getStorageSync('location') + } else { + uni.getLocation({ + type: "gcj02", + success(res) { + location.lat = res.latitude; + location.long = res.longitude; + uni.setStorageSync('location', location) + return getDetails() + } + }) + } + getDetails() + } + + onLoad((option) => { uni.setNavigationBarTitle({ title: option.type == 0 ? '等待付款' : '订单详情' }); if (option.id) { datas.value.id = option.id; - getDetails() + getLocation() } }) @@ -470,6 +493,12 @@ clearInterval(timer); console.log("清除"); }) + + const navgo = (url) => { + uni.navigateTo({ + url + }) + }