Commit d1714614 authored by 陈宗胤(贵阳日报)'s avatar 陈宗胤(贵阳日报)
parents 7ef68247 2130e576
......@@ -54,6 +54,7 @@
"sass": "^1.77.6",
"typescript": "^4.9.4",
"unplugin-auto-import": "^0.17.6",
"vconsole": "^3.15.1",
"vite": "4.3.5",
"vite-plugin-eslint": "^1.8.1",
"vue-tsc": "^1.0.24"
......@@ -6964,6 +6965,18 @@
"dev": true,
"license": "MIT"
},
"node_modules/copy-text-to-clipboard": {
"version": "3.2.0",
"resolved": "https://registry.npmmirror.com/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz",
"integrity": "sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/core-js": {
"version": "3.37.1",
"resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.37.1.tgz",
......@@ -12594,6 +12607,12 @@
"dev": true,
"license": "MIT"
},
"node_modules/mutation-observer": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/mutation-observer/-/mutation-observer-1.0.3.tgz",
"integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA==",
"dev": true
},
"node_modules/mute-stream": {
"version": "0.0.8",
"resolved": "https://registry.npmmirror.com/mute-stream/-/mute-stream-0.0.8.tgz",
......@@ -15805,6 +15824,18 @@
"node": ">= 0.8"
}
},
"node_modules/vconsole": {
"version": "3.15.1",
"resolved": "https://registry.npmmirror.com/vconsole/-/vconsole-3.15.1.tgz",
"integrity": "sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g==",
"dev": true,
"dependencies": {
"@babel/runtime": "^7.17.2",
"copy-text-to-clipboard": "^3.0.1",
"core-js": "^3.11.0",
"mutation-observer": "^1.0.3"
}
},
"node_modules/vite": {
"version": "4.3.5",
"resolved": "https://registry.npmmirror.com/vite/-/vite-4.3.5.tgz",
......
......@@ -54,6 +54,7 @@
"sass": "^1.77.6",
"typescript": "^4.9.4",
"unplugin-auto-import": "^0.17.6",
"vconsole": "^3.15.1",
"vite": "4.3.5",
"vite-plugin-eslint": "^1.8.1",
"vue-tsc": "^1.0.24"
......
......@@ -2,10 +2,12 @@ import { createSSRApp } from 'vue';
import App from './App.vue';
import store from './store';
import '@/assets/iconfont/iconfont.css'; // 引入自定义图标样式文件
import Vconsole from 'vconsole';
export function createApp() {
const app = createSSRApp(App);
app.use(store);
const vConsole = new Vconsole();
app.use(store, vConsole);
return {
app,
};
......
......@@ -13,16 +13,16 @@
}
},
{
"path": "pages/index/foodClassification",
"path": "pages/shop/shop",
"style": {
"navigationBarTitleText": ""
"navigationBarTitleText": "店铺首页",
"onReachBottomDistance": 50
}
},
{
"path": "pages/shop/shop",
"path": "pages/index/foodClassification",
"style": {
"navigationBarTitleText": "店铺首页",
"onReachBottomDistance":50
"navigationBarTitleText": ""
}
},
{
......@@ -54,8 +54,7 @@
"style": {
"navigationBarTitleText": "查看券码"
}
}
,
},
{
"path": "pages/ticket/ticket",
"style": {
......@@ -67,28 +66,32 @@
"style": {
"navigationBarTitleText": "优惠券详情"
}
}
,
},
{
"path": "pages/shop/confirmOrder",
"style": {
"navigationBarTitleText": "确认订单"
}
}
,
},
{
"path": "pages/shop/paymentSuccessful",
"style": {
"navigationBarTitleText": "支付成功"
}
}
,
},
{
"path": "pages/order/remark",
"style": {
"navigationBarTitleText": "美食评论"
}
}
,
{
"path": "pages/order/refund",
"style": {
"navigationBarTitleText": "申请退款"
}
}
],
"globalStyle": {
"navigationStyle": "custom"
......
<template>
<view class="container">
<Header title="申请退款"></Header>
</view>
</template>
<script setup>
import Header from '@/pages/order/components/Header/index.vue';
</script>
<style lang="scss" scoped>
page {
background: #f3f3f3;
}
.container {
width: 375 * 2rpx;
margin: 0 auto;
}
</style>
......@@ -66,7 +66,12 @@
<text class="shop-address-detail">{{ shopInfo.shopAddress }}</text>
</view>
<view class="shop-map-phone">
<image mode="aspectFill" class="img1" src="@/static/shop/map.png"></image>
<image
mode="aspectFill"
@click="openMapApp(shopInfo)"
class="img1"
src="@/static/shop/map.png"
></image>
<image
@tap="callShopPhone(shopInfo.phone)"
mode="aspectFill"
......@@ -274,7 +279,13 @@ import {
peripheryRecom,
sgyrddShopPage,
} from '@/api/shop';
import { debounce, addImgUrlPrefixToImages, getDistance, addImgUrlPrefix } from '@/utils/common';
import {
debounce,
addImgUrlPrefixToImages,
getDistance,
addImgUrlPrefix,
navigationSelect,
} from '@/utils/common';
const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const current = ref(0);
const old = reactive({ scrollTop: 0 });
......@@ -352,8 +363,8 @@ function sgyrddShopPageFn(categoryIds) {
const params = {
current: 1,
size: 15,
lat: currentLatitudeAndLongitude.value.latitude,
lon: currentLatitudeAndLongitude.value.longitude,
lat: '106.68650025025502',
lon: '26.567192352601154',
categoryIds,
distance: 200,
};
......@@ -376,7 +387,11 @@ function sgyrddShopPageFn(categoryIds) {
function getLocationFn() {
xma.getLocation({
type: 'wgs84',
isHighAccuracy: true,
success: function (res) {
// 经纬度
console.log('res.latitude, res.longitude', res.latitude, res.longitude);
const myLatitude = currentLatitudeAndLongitude.value.latitude;
const myLongitude = currentLatitudeAndLongitude.value.longitude;
const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1);
......@@ -387,6 +402,41 @@ function getLocationFn() {
},
});
}
/**
* 跳转地图
*/
function openMapApp() {
uni.showActionSheet({
itemList: ['高德地图', '百度地图'],
success: (res) => {
const item = {
shopAddress: shopInfo.value.shopAddress,
latitude: shopInfo.value.location.lat,
longitude: shopInfo.value.location.lon,
name: shopInfo.value.shopAddress,
};
switch (res.tapIndex) {
case 0:
// 打开高德地图
item.name = '高德地图';
navigationSelect(item);
break;
case 1:
item.name = '百度地图';
// 打开百度地图
navigationSelect(item);
break;
default:
break;
}
},
fail: (err) => {
console.log('取消选择', err);
},
});
}
// 获取店铺信息
const getStoreInformationFn = (id) => {
......@@ -437,7 +487,7 @@ const getEvaluationPageFn = () => {
});
xma.showLoading({
title: '加载中...',
mask: true,
mask: false,
});
return getEvaluationPage({
current: params.value.current,
......
<template>
<!-- 优惠券列表 -->
<view class="ticket-list">
<view class="ticket-list" v-if="couponData.length">
<view class="ticket-item">
<view class="ticket-box">
<view class="normal ticket-left">
......@@ -95,9 +95,16 @@
</view>
</view>
</view>
<wd-status-tip image="content" tip="暂无优惠券" v-else />
</template>
<script setup>
const props = defineProps({
couponData: {
type: Array,
},
});
const showDetail = ref(false);
const changeShowDetail = () => {
......
<template>
<view class="container">
<Header title="合力超市"></Header>
<Header :title="shopDetail.shopName"></Header>
<view class="content">
<view class="shop">
<image src="@/static/ticket/logo.png" class="logo"></image>
<image :src="fileDomain + shopDetail.shopLogo" class="logo" mode="aspectFill"></image>
<view class="info">
<view class="top">
<view class="left">
<text class="title">合力超市花果园R1区店</text>
<text class="title">{{ shopDetail.shopName }}</text>
<view class="ratebox">
<wd-rate v-model="value" size="13px" space="1px" active-color="#f12929" />
<text class="rate">4.9</text>
<wd-rate
v-model="shopDetail.grade"
size="13px"
space="1px"
active-color="#f12929"
/>
<text class="rate">{{ shopDetail.grade }}</text>
</view>
<view class="ratebox">
<text>营业时间:</text>
<text class="time">6:00-22:00</text>
<text class="time">
{{ shopDetail.transactionStart }}-{{ shopDetail.transactionEnd }}
</text>
</view>
</view>
<view class="btn">
<view class="btn" @tap="toShop">
<image src="@/static/ticket/shopmail.png"></image>
<text>进店</text>
</view>
......@@ -27,14 +34,14 @@
<view class="bottom">
<image class="address" src="@/static/ticket/address.png"></image>
<view class="infobox">
<text class="addr">贵阳市南明区花果园R1区1209</text>
<text>距您400米</text>
<text class="addr">{{ shopDetail.shopAddress }}</text>
<text>距您{{ shopDetail.distance }}</text>
</view>
<view class="iconbox">
<image class="img" src="@/static/ticket/map.png"></image>
<text>导航到店</text>
</view>
<view class="iconbox">
<view class="iconbox" @tap="callShopPhone(shopDetail.phone)">
<image class="img" src="@/static/ticket/phone.png"></image>
<text>电话</text>
</view>
......@@ -43,7 +50,7 @@
</view>
<!-- 优惠券列表 -->
<TicketList></TicketList>
<TicketList :couponData="couponData"></TicketList>
</view>
</view>
</template>
......@@ -51,22 +58,35 @@
<script setup>
import { shopCouponList } from '@/api/ticket';
import { getShopDetail } from '@/api/order';
import { getDistance } from '@/utils/common';
import Header from '@/pages/order/components/Header/index.vue';
import TicketList from '@/pages/ticket/components/TicketList/index.vue';
const value = ref(4);
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
onShow(() => {
// 获取位置
getLocationFn();
});
onLoad(() => {});
const shopId = ref('1626126617850544129');
const couponData = ref();
const getList = async () => {
const res = await shopCouponList(shopId.value);
console.log(res);
if (res.code === 0) {
couponData.value = res.data;
}
};
getList();
/**
* 获取商铺信息
*/
const shopDetail = ref();
const shopDetail = ref({
shopName: '店铺详情',
});
const getShopMailDetail = async () => {
const res = await getShopDetail({ shopId: shopId.value });
if (res.code === 0) {
......@@ -74,6 +94,37 @@ const getShopMailDetail = async () => {
}
};
getShopMailDetail();
/**
* 拨打商家电话
* @param {*} phoneNumber
*/
function callShopPhone(phoneNumber) {
xma.makePhoneCall({
phoneNumber, // 仅为示例
});
}
function getLocationFn() {
xma.getLocation({
type: 'wgs84',
success: function (res) {
const myLatitude = shopDetail.value.shopLat;
const myLongitude = shopDetail.value.shopLng;
const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1);
shopDetail.value.distance = distance;
},
fail: function (err) {
return err;
},
});
}
const toShop = () => {
xma.navigateTo({
url: `/pages/shop/shop?shopId=${shopId.value}`,
});
};
</script>
<style scoped lang="scss">
......
......@@ -67,7 +67,7 @@ const changeStatus = (index) => {
/**
* 获取用户统计列表
*/
const discountAmount = ref(0.00);
const discountAmount = ref(0.0);
const getStatistics = async () => {
const params = {
statuMain: currentTab.value,
......
......@@ -73,3 +73,54 @@ export function debounce(func, wait) {
}, wait);
};
}
/**
* 跳转地图
* @param {*} param0
*/
export function navigationSelect(item) {
console.log(item);
const { osName } = uni.getSystemInfoSync();
const { name, latitude, longitude, shopAddress } = item;
const to = {
name: shopAddress,
longitude,
latitude,
};
const getMapScheme = (to) => {
const u = navigator.userAgent;
const isAndroid = osName === 'android';
const andriodBaidu = (to) => {
return `bdapp://map/direction?destination=name:${to.name}|latlng:${to.latitude},${to.longitude}&coord_type=gcj02&mode=driving&src=andr.jianghu.jianhao`;
};
const iOSBaidu = (to) => {
return `baidumap://map/direction?destination=name:${to.name}|latlng:${to.latitude},${to.longitude}&coord_type=gcj02&mode=driving&src=ios.jianghu.jianhao`;
};
const andriodGaode = (to) => {
return `amapuri://route/plan/?sourceApplication=mhc&dlat=${to.latitude}&dlon=${to.longitude}&dname=${to.name}&dev=0&t=0`;
};
const iOSGaode = (to) => {
return `iosamap://path?sourceApplication=mhc&dlat=${to.latitude}&dlon=${to.longitude}&dname=${to.name}&dev=0&t=0`;
};
if (item.name === '百度地图') {
if (isAndroid) {
return andriodBaidu(to);
} else {
return iOSBaidu(to);
}
} else if (item.name === '高德地图') {
if (isAndroid) {
return andriodGaode(to);
} else {
return iOSGaode(to);
}
}
};
const a = document.createElement('a');
document.body.appendChild(a);
a.href = getMapScheme(to);
a.click();
}
......@@ -41,7 +41,7 @@ export default defineConfig({
// 代理配置
proxy: {
'/api': {
target: 'http://test.rhhzkj.com:8080',
target: 'http://192.168.0.147:9999',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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