master
xy 2 years ago
parent 45eb3acaf1
commit 3fb8128278

@ -0,0 +1,483 @@
<template>
<!-- 城市选择-->
<view class="city-select">
<scroll-view scroll-y="true" class="city-select-main" id="city-select-main" :scroll-into-view="toView">
<!-- 预留搜索-->
<view class="city-serach" v-if="isSearch"><input @input="keyInput" :placeholder="placeholder" class="city-serach-input" /></view>
<!-- 当前定位城市 -->
<view class="hot-title" v-if="activeCity && !serachCity"></view>
<view class="hot-city" v-if="activeCity && !serachCity">
<view class="hot-item" @click="cityTrigger(activeCity)">{{ activeCity[formatName] }}</view>
</view>
<!-- 热门城市 -->
<view class="hot-title" v-if="hotCity.length > 0 && !serachCity"></view>
<view class="hot-city" v-if="hotCity.length > 0 && !serachCity">
<template v-for="(item, index) in hotCity">
<view :key="index" @click="cityTrigger(item, 'hot')" class="hot-item">{{ item[formatName] }}</view>
</template>
</view>
<!-- 城市列表(搜索前) -->
<view class="citys" v-if="!serachCity">
<view v-for="(city, index) in sortItems" :key="index" v-show="city.isCity" class="citys-row">
<view class="citys-item-letter" :id="'city-letter-' + (city.name === '#' ? '0' : city.name)">{{ city.name }}</view>
<view class="citys-item" v-for="(item, inx) in city.citys" :key="inx" @click="cityTrigger(item)">{{ item.cityName }}</view>
</view>
</view>
<!-- 城市列表(搜索后) -->
<view class="citys" v-if="serachCity">
<view v-for="(item, index) in searchDatas" :key="index" class="citys-row">
<view class="citys-item" :key="inx" @click="cityTrigger(item)">{{ item.name }}</view>
</view>
</view>
</scroll-view>
<!-- 城市选择索引-->
<view class="city-indexs-view" v-if="!serachCity">
<!-- #ifndef MP-WEIXIN -->
<view class="city-indexs" id="index-bar">
<view v-for="(cityIns, index) in handleCity" class="city-indexs-text" v-show="cityIns.isCity" :key="index" @click="cityindex(cityIns.forName)">
{{ cityIns.name }}
</view>
</view>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<view class="city-indexs" @touchstart="tStart" @touchend="tEnd" @touchmove.stop="tMove" id="index-bar">
<view v-for="(cityIns, index) in handleCity" class="city-indexs-text" v-show="cityIns.isCity" :key="index" @click="cityindex(cityIns.forName)">
{{ cityIns.name }}
</view>
</view>
<!-- #endif -->
</view>
<!--选择显示-->
<!-- #ifdef MP-WEIXIN -->
<view v-show="!hidden" class="index-toast">
{{listCurID}}
</view>
<!-- #endif -->
</view>
</template>
<script>
import citySelect from './citySelect.js';
export default {
props: {
//
placeholder: {
type: String,
default: '请输入城市名称'
},
//
formatName: {
type: String,
default: 'cityName'
},
//
activeCity: {
type: Object,
default: () => null
},
//
hotCity: {
type: Array,
default: () => []
},
//
obtainCitys: {
type: Array,
default: () => []
},
//
isSearch: {
type: Boolean,
default: true
}
},
data() {
return {
itemHeight: 0, //item
hidden: true, //
listCurID: '', //
toView: 'city-letter-Find', //
cityindexs: [], //
activeCityIndex: '', //
handleCity: [], //
serachCity: '', //
cityData: []
};
},
computed: {
/**
* @desc 城市列表排序
* @return Array
*/
sortItems() {
for (let index = 0; index < this.handleCity.length; index++) {
if (this.handleCity[index].isCity) {
let cityArr = this.handleCity[index].citys;
cityArr = cityArr.sort(function(a, b) {
var value1 = a.unicode;
var value2 = b.unicode;
return value1 - value2;
});
}
}
return this.handleCity;
},
/**
* @desc 搜索后的城市列表
* @return Array
*/
searchDatas() {
var searchData = [];
for (let i = 0; i < this.cityData.length; i++) {
if (this.cityData[i][this.formatName].indexOf(this.serachCity) !== -1) {
searchData.push({
oldData: this.cityData[i],
name: this.cityData[i][this.formatName]
});
}
}
return searchData;
}
},
created() {
//
this.cityData = this.obtainCitys;
this.initializationCity();
this.buildCityindexs();
},
watch: {
obtainCitys(newData) {
this.updateCitys(newData);
}
},
// #ifdef MP-WEIXIN
mounted() {
this.getIndexsHeight();
},
// #endif
methods: {
// #ifdef MP-WEIXIN
//
getIndexsHeight() {
//
let that = this;
const query = uni.createSelectorQuery().in(this);
query.select('#index-bar').boundingClientRect(data => {
// console.log("", JSON.stringify(data));
// console.log("", data.top);
that.barTop = data.top
const cityIndexName = this.handleCity.filter(item => item.isCity);
this.itemHeight = data.height / cityIndexName.length;
}).exec();
},
//Item
tMove(e) {
this.hidden = false
this.listCurID = '';
const cityIndexName = this.handleCity.filter(item => item.isCity);
let y = e.touches[0].clientY,
offsettop = this.barTop,
that = this;
//,
if (y > offsettop) {
let num = parseInt((y - offsettop) / this.itemHeight);
// console.log(num, cityIndexName.length)
if (num > cityIndexName.length) {
this.hidden = true
this.listCurID = '';
} else {
this.hidden = false
this.listCurID = cityIndexName[num].name
}
} else {
this.listCurID = '';
this.hidden = true
}
},
//
tStart() {
if (this.listCurID) {
this.hidden = false
this.listCurID = '';
}
},
//
tEnd() {
this.hidden = true;
this.toView = 'city-letter-' + (this.listCurID == "#" ? "0" : this.listCurID);
this.listCurID = '';
},
// #endif
/**
* @desc 初始化
*/
updateCitys(data) {
if (data && data.length) {
this.cityData = data;
this.initializationCity();
this.buildCityindexs();
// #ifdef MP-WEIXIN
setTimeout(() => {
this.getIndexsHeight();
}, 500);
// #endif
}
},
/**
* @desc 监听输入框的值
*/
keyInput(event) {
this.serachCity = event.detail.value;
},
/**
* @desc 初始化城市数据
* @return undefind
*/
initializationCity() {
this.handleCity = [];
const cityLetterArr = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '#'
];
for (let index = 0; index < cityLetterArr.length; index++) {
this.handleCity.push({
name: cityLetterArr[index],
isCity: false, //
citys: [], //
forName: 'city-letter-' + (cityLetterArr[index] == '#' ? '0' : cityLetterArr[index]) //label
});
}
},
/**
* @desc 得到城市的首字母
* @param str String
*/
getLetter(str) {
return citySelect.getFirstLetter(str[0]);
},
/**
* @desc 构建城市索引
* @return undefind
*/
buildCityindexs() {
this.cityindexs = [];
for (let i = 0; i < this.cityData.length; i++) {
//
const cityLetter = this.getLetter(this.cityData[i][this.formatName]).firstletter;
// unicode
const unicode = this.getLetter(this.cityData[i][this.formatName]).unicode;
const index = this.cityIndexPosition(cityLetter);
if (this.cityindexs.indexOf(cityLetter) === -1) {
this.handleCity[index].isCity = true;
this.cityindexs.push(cityLetter);
}
this.handleCity[index].citys.push({
cityName: this.cityData[i][this.formatName],
unicode: unicode,
oldData: this.cityData[i]
});
}
},
/**
* @desc 滑动到城市索引所在的地方
* @param id String 城市索引
*/
cityindex(id) {
this.toView = id;
},
/**
* @desc 获取城市首字母的unicode
* @param letter String 城市索引
*/
cityIndexPosition(letter) {
if (!letter) {
return '';
}
const ACode = 65;
return letter === '#' ? 26 : letter.charCodeAt(0) - ACode;
},
/** @desc
* @param Object
*/
cityTrigger(item) {
//
this.$emit('cityClick', item.oldData ? item.oldData : item);
}
}
};
</script>
<style lang="scss">
//vw
@function vww($number) {
@return ($number / 375) * 750+rpx;
}
/* #ifndef MP-ALIPAY */
.index-toast {
position: fixed;
top: 0;
right: vww(40);
bottom: 0;
background: rgba(0, 0, 0, 0.5);
width: vww(50);
height: vww(50);
border-radius: 10px;
margin: auto;
color: #fff;
line-height: vww(50);
text-align: center;
font-size: vww(16);
}
/* #endif */
view {
box-sizing: border-box;
}
.city-serach {
width: 100%;
color: #4a4a4a;
padding: 0 vww(10);
&-input {
margin: vww(10) 0;
height: vww(40);
line-height: vww(40);
font-size: vww(14);
padding: 0 vww(5);
border: 1px solid #4d8cfd;
border-radius: 3px;
}
}
.city-select-main {
position: relative;
// overflow: scroll;
// -webkit-overflow-scrolling: touch;
width: 100%;
height: 100%;
background: #f6f5fa;
// overflow-y: auto;
}
.city-select {
position: relative;
width: 100vw;
height: 100vh;
background: #f6f5fa;
//
.hot-title {
padding-left: vww(23);
width: 100vw;
font-size: 14px;
line-height: vww(40);
color: #9b9b9b;
}
.hot-city {
padding-left: vww(23);
padding-right: vww(20);
overflow: hidden;
width: 100vw;
.hot-item {
float: left;
padding: 0 vww(5);
margin-right: vww(16);
margin-bottom: vww(6);
overflow: hidden;
width: vww(100);
height: vww(31);
font-size: 14px;
text-align: center;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
line-height: vww(31);
color: #4a4a4a;
background: #fff;
border: 1px solid #ebebf0;
&:nth-child(3n) {
margin-right: 0;
}
}
.hot-hidden {
display: none;
margin-right: 0;
}
}
.citys {
.citys-row {
padding-left: vww(18);
width: 100%;
font-size: 14px;
background: #fff;
.citys-item-letter {
margin-left: vww(-18);
padding-left: vww(18);
margin-top: -1px;
width: 100vw;
line-height: vww(30);
color: #9b9b9b;
background: #f6f5fa;
border-top: none;
}
.citys-item {
width: 100%;
line-height: vww(50);
color: #4a4a4a;
border-bottom: 1px solid #ebebf0;
&:last-child {
border: none;
}
}
}
}
.city-indexs-view {
position: absolute;
right: 0;
top: 0;
z-index: 999;
display: flex;
width: vww(20);
height: 100%;
text-align: center;
.city-indexs {
width: vww(20);
text-align: center;
vertical-align: middle;
align-self: center;
.city-indexs-text {
// margin-bottom: vww(10);
width: vww(20);
padding: vww(5) 0;
font-size: 12px;
color: #4d8cfd;
// &:last-child {
// margin-bottom: 0;
// }
}
}
}
}
</style>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -27,4 +27,10 @@ Vue.use(httpApi, app)
import moment from '@/libs/moment.min.js'
Vue.prototype.$moment = moment
import QQMapWX from '@/libs/qqmap-wx-jssdk.js'
Vue.prototype.$qqmapsdk = new QQMapWX({
key: 'D5EBZ-C3BWP-HZIDG-VO6BE-P2MN5-ESFZO'
});
app.$mount()

@ -54,7 +54,17 @@
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
"usingComponents" : true,
"permission": {
"scope.userLocation": {
"desc": "需要获取您的定位"
}
},
"requiredPrivateInfos" : [ "getLocation" ],
"optimization" : {
"subPackages" : true
},
"__usePrivacyCheck__" : true
},
"mp-alipay" : {
"usingComponents" : true

@ -1,5 +1,5 @@
<template>
<view class="page">
<view class="page safe-area-inset-bottom">
<image class="bkg" src="~@/package_sub/static/ServiceDetail/bkg.png" mode="aspectFill"></image>
<view class="container">
@ -23,19 +23,54 @@
</view>
</view>
<view class="card for-people">
<view class="for-people__title">
服务流程
<view v-show="currentTab === 0">
<view class="card for-people">
<view class="card__title">
适用人群
</view>
<view class="for-people__content block">
<view class="block-item" v-for="i in 10" :key="i">
<image class="block-item__img" src="~@/static/index/honor-title.png" mode="aspectFit"></image>
<view class="block-item__text">老年人对医院环境设设备不熟悉</view>
</view>
</view>
</view>
<view class="for-people__content block">
<view class="block-item" v-for="i in 10" :key="i">
<image class="block-item__img" src="~@/static/index/honor-title.png" mode="aspectFit"></image>
<view class="service-flow card">
<view class="card__title">
服务流程
</view>
<view class="service-flow__content" v-for="i in 5" :key="i">
<view class="dot-line" />
<view class="content-panel">
<image class="db-arrow-down" src="~@/package_sub/static/ServiceDetail/db-arrow-down.png" mode="aspectFit"></image>
<view class="content-panel__section">
请至少提前2小时预约以便平台安排合适的陪诊师;
</view>
<view class="content-panel__section">
提交预约申请后请添加客服专员以便及时与您沟通服务进展;
</view>
</view>
</view>
</view>
<view class="block-item__text">老年人对医院环境设设备不熟悉</view>
<view class="cost-description card">
<view class="card__title">
费用说明
</view>
<ul class="cost-description__content">
<li v-for="i in 7" :key="i">
本服务含医院内半天(不超过4小时)陪诊服务仅限单个医院不含治疗检查饮食交通等费用;
</li>
</ul>
</view>
</view>
<u-button class="btn" shape="circle" ripple :custom-style="orderBtnStyle">立即预约</u-button>
</view>
</view>
</template>
@ -46,7 +81,14 @@ export default {
data() {
return {
currentTab: 0,
orderBtnStyle: {
'background-image': 'linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)',
'font-weight': '500',
'font-size': '28rpx',
'color': '#fff',
'width': '436rpx',
'margin-top': '32rpx'
}
};
},
onLoad(option) {
@ -60,6 +102,11 @@ export default {
}
</script>
<style>
page {
background: #f4efee;
}
</style>
<style lang="scss" scoped>
.page {
@ -81,12 +128,46 @@ export default {
border-radius: 10rpx;
filter: drop-shadow(2.192px 4.494px 5px rgba(33,32,32,0.15));
background-color: #ffffff;
&__title {
display: inline-block;
font-size: 28rpx;
color: #ca2328;
font-weight: bold;
position: relative;
left: 50%;
transform: translateX(-50%);
&::before {
content: '';
position: absolute;
width: 139rpx;
height: 5rpx;
border-radius: 3px;
left: -28rpx;
top: 50%;
transform: translate(-100%, -50%);
background: linear-gradient(to left,#ca2328,#ffffff00);
}
&::after {
content: '';
position: absolute;
width: 139rpx;
height: 5rpx;
border-radius: 3px;
right: -28rpx;
top: 50%;
transform: translate(100%, -50%);
background: linear-gradient(to right,#ca2328,#ffffff00);
}
}
}
.detail {
margin: 0 24rpx;
padding: 26rpx 22rpx;
&__text {
text-indent: 48rpx;
font-size: 24rpx;
line-height: 1.5;
color: #929196;
@ -145,38 +226,6 @@ export default {
margin: 54rpx 24rpx 0;
padding: 46rpx 30rpx;
&__title {
display: inline-block;
font-size: 28rpx;
color: #ca2328;
font-weight: bold;
position: relative;
left: 50%;
transform: translateX(-50%);
&::before {
content: '';
position: absolute;
width: 139rpx;
height: 5rpx;
border-radius: 3px;
left: -28rpx;
top: 50%;
transform: translate(-100%, -50%);
background: linear-gradient(to left,#ca2328,#ffffff00);
}
&::after {
content: '';
position: absolute;
width: 139rpx;
height: 5rpx;
border-radius: 3px;
right: -28rpx;
top: 50%;
transform: translate(100%, -50%);
background: linear-gradient(to right,#ca2328,#ffffff00);
}
}
&__content {
margin-top: 46rpx;
@ -188,15 +237,176 @@ export default {
&-item {
display: flex;
align-items: center;
flex-basis: 50%;
margin-bottom: 60rpx;
flex-basis: calc((100% - 64rpx) / 2);
&__img {
width: 62rpx;
height: 70rpx;
}
&__text {
font-size: 24rpx;
color: #666666;
font-weight: 500;
margin-left: 16rpx;
text-align: left;
}
}
.block-item:nth-child(2n) {
margin-left: 64rpx;
}
.block-item:nth-last-child(1) {
margin-bottom: 0;
}
.block-item:nth-last-child(2) {
margin-bottom: 0;
}
}
}
.service-flow {
margin: 34rpx 24rpx 0;
padding: 45rpx 20rpx 34rpx 28rpx;
&__content {
margin-top: 18rpx;
$dot-bkgs:
linear-gradient(0deg, #ebb6b6 0%, #f7d8ba 99%, #f7d8ba 100%),
linear-gradient(0deg, #edbd97 0%, #e4de9f 100%, #e4de9f 100%),
linear-gradient(0deg, #8fa9e3 0%, #a3d9fb 100%),
linear-gradient(0deg, #e3c2f7 0%, #e3c2f7 1%, #c7ccfb 100%),
linear-gradient(0deg, #f99ea2 0%, #f4d4fa 100%);
$dot-border: #f7d8ba,#e4de9f,#a3d9fb,#c7ccfb,#f4d4fa;
$panel-bkgs:
linear-gradient(0deg, #fde5e5b3 0%, #fdf7f1b3 100%),
linear-gradient(0deg, #fdede1b3 0%, #fbfbefb3 100%),
linear-gradient(0deg, #e5e7f7b3 0%, #f3fbfdb3 100%),
linear-gradient(0deg, #f5e7fdb3 0%, #f0f1fcb3 100%),
linear-gradient(0deg, #fde5e5b3 0%, #f9f4fcb3 100%);
.dot-line {
float: left;
width: 16rpx;
height: 16rpx;
border-radius: 100%;
z-index: 2;
position: relative;
top: 8rpx;
left: 8rpx;
&::after {
content: '';
width: 22rpx;
height: 22rpx;
box-sizing: border-box;
border-radius: 100%;
border: 2rpx solid;
z-index: 2;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
@for $index from 1 through length($dot-bkgs) {
&:nth-child(#{$index+1}n) .dot-line {
background: nth($dot-bkgs, $index);
&::after {
border-color: nth($dot-border, $index);
}
}
&:nth-child(#{$index+1}n) .content-panel {
background: nth($panel-bkgs, $index);
}
}
&:nth-child(2) .content-panel:before {
top: 10rpx !important;
}
.content-panel {
border-radius: 5px;
margin-left: 40rpx;
padding: 24rpx 8rpx 24rpx 32rpx;
color: #666666;
font-weight: 500;
position: relative;
&::before {
content: '';
width: 2rpx;
opacity: .2;
background-color: #666666;
z-index: 1;
position: absolute;
top: -18rpx;
left: calc(-40rpx + 15rpx);
bottom: 0;
}
.db-arrow-down {
width: 98rpx;
height: 103rpx;
position: absolute;
right: 20rpx;
bottom: 24rpx;
}
&__section {
font-size: 24rpx;
line-height: 40rpx;
position: relative;
&::before {
content: '';
position: absolute;
width: 8rpx;
height: 8rpx;
border-radius: 100%;
background-color: #7a7a7a;
top: 16rpx;
left: -16rpx;
}
}
}
}
}
.cost-description {
margin: 22rpx 24rpx 0;
padding: 45rpx 20rpx 34rpx 28rpx;
&__content {
margin-top: 50rpx;
font-size: 24rpx;
line-height: 40rpx;
color: #666666;
font-weight: 500;
position: relative;
& > li {
margin-left: 36rpx;
position: relative;
&::before {
content: '';
width: 8rpx;
height: 8rpx;
border-radius: 100%;
background-color: #7a7a7a;
position: absolute;
left: -26rpx;
top: calc(20rpx - 4rpx);
}
}
& > li + li {
margin-top: 10rpx;
}
}
}
.btn {
margin: 32rpx auto 0;
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

@ -24,10 +24,9 @@
}
},
{
"path": "component/Tabbar/Tabbar",
"path": "pages/CitySelect/CitySelect",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
"navigationBarTitleText": "城市选择"
}
}
],

@ -0,0 +1,113 @@
<template>
<view>
<city-select
@cityClick="cityClick"
:formatName="formatName"
:activeCity="activeCity"
:hotCity="hotCity"
:obtainCitys="obtainCitys"
:isSearch="true"
ref="citys"
></city-select>
</view>
</template>
<script>
import citys from '@/component/CitySelect/citys.js'
import CitySelect from "@/component/CitySelect/city-select.vue"
export default {
components: {
CitySelect
},
data() {
return {
//
formatName: 'title',
//
activeCity: {
id: 1,
title: '南京市'
},
//
hotCity: [
{
id: 0,
title: '南京市'
},
{
id: 1,
title: '南京市'
}
],
//
obtainCitys: [
{
id: 0,
title: '南京'
},
{
id: 1,
title: '北京'
},
{
id: 2,
title: '天津'
},
{
id: 3,
title: '东京'
}
]
};
},
onLoad () {
//
setTimeout(() => {
//
this.formatName = 'cityName'
//
this.activeCity = {
cityName: '南京',
cityCode: 110100
}
//
this.hotCity = [
{
cityName: '南京',
cityCode: 110100
},
{
cityName: '北京',
cityCode: 110102
}
]
//
this.obtainCitys = citys
uni.showToast({
icon: 'none',
title: '更新数据成功',
// #ifdef MP-WEIXIN
duration: 3000,
// #endif
mask: true
})
}, 500)
},
methods: {
cityClick(item) {
uni.showToast({
icon: 'none',
title: 'item: ' + JSON.stringify(item),
// #ifdef MP-WEIXIN
duration: 3000,
// #endif
mask: true
})
}
}
}
</script>
<style lang="scss">
</style>

@ -10,7 +10,7 @@
<view class="top" :style="{ 'padding-right': menuButtonRight + 'px' }">
<view class="position" @click="isShowCity = true">
<u-icon name="map-fill"></u-icon>
<text>苏州</text>
<text>{{ location.city.replace(/(市|区|县)/,'') }}</text>
<u-icon name="arrow-down" size="22"></u-icon>
</view>
<view class="icon">
@ -145,6 +145,7 @@
</view>
<u-picker v-model="isShowCity" mode="region"></u-picker>
<u-top-tips :navbar-height="navbarHeight" ref="uTips"></u-top-tips>
<tabbar />
</view>
@ -158,6 +159,7 @@ export default {
},
data() {
return {
navbarHeight: 44,
isShowSticky: false,
scrollTop: 308,
statusBarHeight: 40,
@ -209,12 +211,19 @@ export default {
],
isShowCity: false,
location: {
latitude: '',
longitude: '',
city: '',
cityCode: ''
}
};
},
mounted() {
this.getElScrollTop()
},
created() {
this.navbarHeight = uni.getSystemInfoSync().safeArea.top
this.menuButtonRight =
uni.getSystemInfoSync().screenWidth -
uni.getMenuButtonBoundingClientRect().left +
@ -224,7 +233,9 @@ export default {
onPageScroll(e) {
this.isShowSticky = e.scrollTop > this.scrollTop
},
onLoad() {},
onLoad() {
this.getLocation()
},
methods: {
getElScrollTop () {
const query = uni.createSelectorQuery().in(this)
@ -252,6 +263,42 @@ export default {
uni.navigateBack()
break
}
},
async getLocation () {
try {
const [err, res] = await uni.getLocation({
type: 'gcj02'
})
if (err) {
await Promise.reject(err)
}
this.location.latitude = res.latitude;
this.location.longitude = res.longitude;
const address = await new Promise((resolve, reject) => {
this.$qqmapsdk.reverseGeocoder({
location: {
latitude: res.latitude,
longitude: res.longitude
},
success: address => resolve(address),
fail: error => reject(error)
})
})
console.log('address', address)
if (!!address.status) {
await Promise.reject(address.message)
}
this.location.city = address?.result?.ad_info.city
this.location.cityCode = address?.result?.ad_info?.city_code
} catch (err) {
console.error(err)
this.$refs.uTips.show({
title: '获取定位失败',
type: 'warning',
duration: '2000'
})
}
}
},
};
@ -352,7 +399,7 @@ export default {
letter-spacing: 3rpx;
font-weight: 500;
white-space: nowrap;
padding: 0 10rpx;
padding: 0 16rpx;
& > text {
padding: 0 10rpx;

Loading…
Cancel
Save