You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
high-mini/pages/user/positioning/positioning.vue

94 lines
2.0 KiB

<template>
<view>
<view class="width100 backcorfff">
<!-- <uSearchBar @confirm="search" @input="input"></uSearchBar>
<view class="line1 mart10"></view> -->
<view class="width90 mart20 font15 fcor333">当前定位</view>
3 years ago
<view class="posacname actives mart20">{{posName}}</view>
<view class="width90 mart20 font14 fcor333">其他地区</view>
3 years ago
<view class="posheadname mart20 flleft font14" :class="{'actives':posId===item.regionId}"
v-for="(item,index) in posList" :key="index" @click="change(item)">
{{item.regionName}}
</view>
</view>
</view>
</template>
<script>
import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue';
import {
getDredgeProvince
} from '../../../Utils/Api.js';
let app = getApp();
export default {
components: {
uSearchBar
},
data() {
return {
posList: [],
posId: '',
posName: ''
}
},
onLoad() {
this.getDredgeProvince();
this.posName = app.globalData.cityName;
},
methods: {
getDredgeProvince() {
uni.showLoading({
title: '加载中'
})
getDredgeProvince().then(res => {
uni.hideLoading()
if (res.return_code == '000000') {
this.posList = res.return_data;
}
});
},
change(item) {
this.posId = item.regionId;
this.posName = item.regionName;
app.globalData.cityId = item.regionId;
3 years ago
app.globalData.cityName = item.regionName;
uni.navigateBack({
})
}
}
}
</script>
<style lang="less">
3 years ago
.posheadname {
background-color: #f5f5f5;
color: #666666;
padding-left: 10px;
padding-right: 10px;
height: 30px;
margin-left: 4%;
line-height: 30px;
text-align: center;
border-radius: 5px;
}
.posacname {
background-color: #f5f5f5;
color: #666666;
3 years ago
display: inline-block;
padding-left: 10px;
padding-right: 10px;
height: 30px;
margin-left: 4%;
line-height: 30px;
text-align: center;
border-radius: 5px;
}
.actives {
color: #089bf5;
background-color: #f4faff;
border: 1px solid #089bf5;
}
</style>