This commit is contained in:
zmj 2024-06-18 19:03:33 +08:00
parent ca9c5bfbf1
commit 8c33ae1516
5 changed files with 58 additions and 27 deletions

View File

@ -10,7 +10,7 @@ switch (env) {
BASE_URL = 'https://test-multi-store.lihaink.cn'; BASE_URL = 'https://test-multi-store.lihaink.cn';
break; break;
case 'liu': case 'liu':
BASE_URL = 'http://192.168.1.22:8545'; BASE_URL = 'http://192.168.1.201:8545';
break; break;
default: default:
BASE_URL = 'https://multi-store.lihaink.cn'; BASE_URL = 'https://multi-store.lihaink.cn';

View File

@ -89,6 +89,7 @@
// //
const onChooseShop = (item) => { const onChooseShop = (item) => {
return
currShop.value = item.id; currShop.value = item.id;
uni.setStorageSync('STORE_INFO', JSON.stringify(item)); uni.setStorageSync('STORE_INFO', JSON.stringify(item));
// , // ,
@ -161,10 +162,8 @@
const getLocation = () => { const getLocation = () => {
let location = uni.getStorageSync('location'); let location = uni.getStorageSync('location');
if (location) { if (location) {
let [lng, lat] = location.split(','); queryParams.longitude = location.lat
queryParams.longitude = lng; queryParams.latitude = location.long
queryParams.latitude = lat;
// //
getShopList(); getShopList();
} else { } else {
@ -178,7 +177,10 @@
getShopList(); getShopList();
// //
uni.setStorageSync('location', `${res.longitude},${res.latitude}`) uni.setStorageSync('location', {
lat: queryParams.latitude,
long: queryParams.longitude
})
} }
}) })
} }

View File

@ -24,7 +24,7 @@
<view class="store-info"> <view class="store-info">
<view style="display: flex;font-size: 30rpx;font-weight: bold;"> <view style="display: flex;font-size: 30rpx;font-weight: bold;">
<text v-if="userStore.userInfo.user_ship==1 || shareInfo.store_id" <text v-if="userStore.userInfo.user_ship==1 || shareInfo.store_id"
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{(shareInfo.real_name||userStore.userInfo.nickname) + '的供销个人门店' }}</text> style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{(shareInfo.real_name||( userStore.userInfo.real_name|| userStore.userInfo.nickname)) + '的供销个人门店' }}</text>
<text v-else <text v-else
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{STORE_INFO.store_name}}</text> style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{STORE_INFO.store_name}}</text>
<up-icon name="arrow-right"></up-icon> <up-icon name="arrow-right"></up-icon>
@ -222,8 +222,8 @@
import useUserStore from "@/store/user"; import useUserStore from "@/store/user";
const userStore = useUserStore(); const userStore = useUserStore();
const STORE_INFO = reactive({ const STORE_INFO = reactive({
id: 5, id: 4,
store_name: "测试" store_name: "农(特)产品直营店"
}) })
const getStoreInfoFn = () => { const getStoreInfoFn = () => {
@ -246,10 +246,10 @@
let shareStr = '?id=' + STORE_INFO.id; let shareStr = '?id=' + STORE_INFO.id;
if (userStore.userInfo.user_ship == 1) { if (userStore.userInfo.user_ship == 1) {
shareStr = shareStr + '&spread_uid=' + userStore.userInfo.id + '&real_name=' + (userStore.userInfo shareStr = shareStr + '&spread_uid=' + userStore.userInfo.id + '&real_name=' + (userStore.userInfo
.nickname) .real_name || userStore.userInfo.nickname)
} }
let shareInfo = { let shareInfo = {
title: userStore.userInfo.nickname, title: (userStore.userInfo.real_name || userStore.userInfo.nickname) + '的供销个人门店',
path: '/pages/index/index' + shareStr, path: '/pages/index/index' + shareStr,
imageUrl: STORE_INFO.image || '', imageUrl: STORE_INFO.image || '',
success() { success() {

View File

@ -4,7 +4,9 @@
还剩<text>{{countDown}}</text>订单自动取消 还剩<text>{{countDown}}</text>订单自动取消
</view> </view>
<view class="m-card m-address" style="margin-top: 20rpx;"> <view class="m-card m-address" style="margin-top: 20rpx;">
<view class="address-info" @click="callPhone(shopInfo.phone)"> <view class="address-info"
style='display: flex;justify-content: space-between;width: 690rpx;align-items: center;'
@click="callPhone(shopInfo.phone)">
<view class="top" style="align-items: flex-start;"> <view class="top" style="align-items: flex-start;">
<view style="color: #333;display: flex;align-items: center;"> <view style="color: #333;display: flex;align-items: center;">
<up-icon name="map"></up-icon> <up-icon name="map"></up-icon>
@ -13,8 +15,6 @@
<view v-if="shopInfo.id"> <view v-if="shopInfo.id">
<view style="color: #333;"> <view style="color: #333;">
{{shopInfo.name}} {{shopInfo.name}}
<!-- <text v-if="shopInfo.recommend"
style="font-size: 20rpx;color: #fff;background-color: #20b128;padding: 2rpx 5rpx;padding: 1rpx 4rpx;">推荐</text> -->
</view> </view>
<view style="font-size: 24rpx;color: #333;"> <view style="font-size: 24rpx;color: #333;">
{{shopInfo.detailed_address}} {{shopInfo.detailed_address}}
@ -24,16 +24,14 @@
<text style="margin-right: 10rpx;">{{shopInfo.name||shopInfo.mer_real_name}}</text> <text style="margin-right: 10rpx;">{{shopInfo.name||shopInfo.mer_real_name}}</text>
<text>{{shopInfo.phone}}</text> <text>{{shopInfo.phone}}</text>
</view> </view>
<!-- <text v-if="shopInfo.distance"
style="color: #20b128;font-size: 22rpx;border: 1px solid #20b128;border-radius: 4rpx;">{{shopInfo.distance}}</text> -->
</view> </view>
</view> </view>
</view> </view>
<view @click.stop="navgo('/multipleShop/index/index')"
style="padding: 20rpx;background-color:#20B128;color: white;border-radius: 40rpx;">
所有提货点
</view>
</view> </view>
<!-- <view class="address-btn" v-if="datas.paid==0">
<view style="width: 80px;"><up-button @click="shopListShow=true" size="small" shape="circle"
color="#f6f6f6" :customStyle="{color:'#666666'}">修改</up-button></view>
</view> -->
</view> </view>
<view class="m-card m-address" style="margin-top: 20rpx;" v-if="addressInfo && addressInfo.address_id"> <view class="m-card m-address" style="margin-top: 20rpx;" v-if="addressInfo && addressInfo.address_id">
<view class="address-info"> <view class="address-info">
@ -237,11 +235,12 @@
const datas = ref({}) const datas = ref({})
const getDetails = () => { const getDetails = () => {
orderDetailApi({ orderDetailApi({
order_id: datas.value.id order_id: datas.value.id,
...location
}).then(res => { }).then(res => {
datas.value = res.data; datas.value = res.data;
options.code = datas.value.verify_code; // 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) { if (addressList.value.length > 0 && res.data.paid) {
addressInfo.value = addressList.value.find(item => item.address_id == res.data.address_id); addressInfo.value = addressList.value.find(item => item.address_id == res.data.address_id);
} else { } 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) => { onLoad((option) => {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.type == 0 ? '等待付款' : '订单详情' title: option.type == 0 ? '等待付款' : '订单详情'
}); });
if (option.id) { if (option.id) {
datas.value.id = option.id; datas.value.id = option.id;
getDetails() getLocation()
} }
}) })
@ -470,6 +493,12 @@
clearInterval(timer); clearInterval(timer);
console.log("清除"); console.log("清除");
}) })
const navgo = (url) => {
uni.navigateTo({
url
})
}
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -1,6 +1,6 @@
<template> <template>
<view class=""> <view class="">
<view class="m-card m-address"> <!-- <view class="m-card m-address">
<view class="address-info" @click="showAddress = true" v-if='orderInfo.shipping_type == 1'> <view class="address-info" @click="showAddress = true" v-if='orderInfo.shipping_type == 1'>
<view class="top"> <view class="top">
<up-icon name="account"></up-icon> <up-icon name="account"></up-icon>
@ -31,7 +31,7 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view> -->
<view class="m-card m-good" v-for="(item, index) in cartList" :key="index"> <view class="m-card m-good" v-for="(item, index) in cartList" :key="index">
<view class="image"> <view class="image">
<up-image width="160rpx" height="160rpx" :src="item.imgs"></up-image> <up-image width="160rpx" height="160rpx" :src="item.imgs"></up-image>
@ -72,8 +72,8 @@
</view> </view>
<view class="row" v-if="userInfo.user_ship==1 "> <view class="row" v-if="userInfo.user_ship==1 ">
<view>消费返利</view> <view>消费返利</view>
<view style="color: red;"> <view>
<text>-¥</text>{{ c_price(orderInfo.activities, 0) }}<text>.{{ c_price(orderInfo.activities, 1) }}</text> <text>¥</text>{{ c_price(orderInfo.activity_price, 0) }}<text>.{{ c_price(orderInfo.activity_price, 1) }}</text>
</view> </view>
</view> </view>
</view> </view>