Commit 9b614778 authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents 2021e623 c961b4ef
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="content"> <view class="content">
<view class="shop"> <view class="shop">
<image src="@/static/ticket/logo.png" class="logo" mode="aspectFill"></image> <image :src="fileDomain + shopDetail.shopLogo" class="logo" mode="aspectFill"></image>
<view class="info"> <view class="info">
<view class="top"> <view class="top">
<view class="left"> <view class="left">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</view> </view>
</view> </view>
<view class="btn"> <view class="btn" @tap="toShop">
<image src="@/static/ticket/shopmail.png"></image> <image src="@/static/ticket/shopmail.png"></image>
<text>进店</text> <text>进店</text>
</view> </view>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<image class="address" src="@/static/ticket/address.png"></image> <image class="address" src="@/static/ticket/address.png"></image>
<view class="infobox"> <view class="infobox">
<text class="addr">{{ shopDetail.shopAddress }}</text> <text class="addr">{{ shopDetail.shopAddress }}</text>
<text>距您400米</text> <text>距您{{ shopDetail.distance }}</text>
</view> </view>
<view class="iconbox"> <view class="iconbox">
<image class="img" src="@/static/ticket/map.png"></image> <image class="img" src="@/static/ticket/map.png"></image>
...@@ -62,13 +62,14 @@ import { getDistance } from '@/utils/common'; ...@@ -62,13 +62,14 @@ import { getDistance } from '@/utils/common';
import Header from '@/pages/order/components/Header/index.vue'; import Header from '@/pages/order/components/Header/index.vue';
import TicketList from '@/pages/ticket/components/TicketList/index.vue'; import TicketList from '@/pages/ticket/components/TicketList/index.vue';
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
onShow(() => { onShow(() => {
// 获取位置 // 获取位置
getLocationFn(); getLocationFn();
}); });
// 当前位置的经纬度 onLoad(() => {});
const currentLatitudeAndLongitude = ref({ latitude: 0, longitude: 0 });
const shopId = ref('1626126617850544129'); const shopId = ref('1626126617850544129');
const getList = async () => { const getList = async () => {
...@@ -80,7 +81,9 @@ getList(); ...@@ -80,7 +81,9 @@ getList();
/** /**
* 获取商铺信息 * 获取商铺信息
*/ */
const shopDetail = ref(); const shopDetail = ref({
shopName: '店铺详情',
});
const getShopMailDetail = async () => { const getShopMailDetail = async () => {
const res = await getShopDetail({ shopId: shopId.value }); const res = await getShopDetail({ shopId: shopId.value });
if (res.code === 0) { if (res.code === 0) {
...@@ -93,7 +96,7 @@ getShopMailDetail(); ...@@ -93,7 +96,7 @@ getShopMailDetail();
* 拨打商家电话 * 拨打商家电话
* @param {*} phoneNumber * @param {*} phoneNumber
*/ */
function callShopPhone(phoneNumber) { function callShopPhone(phoneNumber) {
xma.makePhoneCall({ xma.makePhoneCall({
phoneNumber, // 仅为示例 phoneNumber, // 仅为示例
}); });
...@@ -103,16 +106,22 @@ function getLocationFn() { ...@@ -103,16 +106,22 @@ function getLocationFn() {
xma.getLocation({ xma.getLocation({
type: 'wgs84', type: 'wgs84',
success: function (res) { success: function (res) {
const myLatitude = currentLatitudeAndLongitude.value.latitude; const myLatitude = shopDetail.value.shopLat;
const myLongitude = currentLatitudeAndLongitude.value.longitude; const myLongitude = shopDetail.value.shopLng;
const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1); const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1);
shopInfo.value.distance = distance; shopDetail.value.distance = distance;
}, },
fail: function (err) { fail: function (err) {
return err; return err;
}, },
}); });
} }
const toShop = () => {
xma.navigateTo({
url: `/pages/shop/shop?shopId=${shopId.value}`,
});
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment