|
@@ -22,16 +22,11 @@
|
|
<view class="content_right">
|
|
<view class="content_right">
|
|
<view class="content_city" v-if="tab==1">
|
|
<view class="content_city" v-if="tab==1">
|
|
<scroll-view scroll-y="true" class="city_province">
|
|
<scroll-view scroll-y="true" class="city_province">
|
|
- <view class="province_item" v-for="(item1,index1) in region" :key='index1.id' @click="chooceProvince(item1)" :style="{'color':provinceId==item1.id?color1:'#999999','background':provinceId==item1.id?'#FFFFFF':'transparent'}">
|
|
|
|
- {{item1.name}}
|
|
|
|
|
|
+ <view class="province_item" v-for="(item1,index1) in region" :key='index1' @click="chooceProvince(item1)" :style="{'color':city==item1?color1:'#999999','background':city==item1?'#FFFFFF':'transparent'}">
|
|
|
|
+ {{item1}}
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
|
|
|
- <scroll-view scroll-y="true" class="city_town">
|
|
|
|
- <view class="city_item" v-for="(item2,index2) in cities" :key='item2.id' @click="chooseCity(item2)" :style="{'color':cityId==item2.id?color1:'#999999'}">
|
|
|
|
- {{item2.name}}
|
|
|
|
- </view>
|
|
|
|
- </scroll-view>
|
|
|
|
</view>
|
|
</view>
|
|
<view class="content_type" v-if="tab==2">
|
|
<view class="content_type" v-if="tab==2">
|
|
<view class="content_type_item" v-for="(item,index) in types" :key='item.id' @click="typeChooce(item)" :style='{color:currentType==item.id?color1:"#999999"}'>
|
|
<view class="content_type_item" v-for="(item,index) in types" :key='item.id' @click="typeChooce(item)" :style='{color:currentType==item.id?color1:"#999999"}'>
|
|
@@ -55,7 +50,6 @@
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
- let region = require('@/static/region.json');
|
|
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
title: String,
|
|
title: String,
|
|
@@ -107,10 +101,7 @@
|
|
currentType:"",
|
|
currentType:"",
|
|
region:[],
|
|
region:[],
|
|
cities:[],
|
|
cities:[],
|
|
- province:"",
|
|
|
|
- provinceId:"",
|
|
|
|
city:"",
|
|
city:"",
|
|
- cityId:"",
|
|
|
|
typeName:"",
|
|
typeName:"",
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -119,8 +110,7 @@
|
|
this.globalData = app.globalData;
|
|
this.globalData = app.globalData;
|
|
this.color2 = this.globalData.color2;
|
|
this.color2 = this.globalData.color2;
|
|
this.color1 = this.globalData.color1;
|
|
this.color1 = this.globalData.color1;
|
|
- this.region = region;
|
|
|
|
- this.cities = region[0].children;
|
|
|
|
|
|
+ this.queryCities();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
async queryCategoryBox(){
|
|
async queryCategoryBox(){
|
|
@@ -135,6 +125,18 @@
|
|
this.types = this.types.filter(item=>item.name.indexOf('注册')==-1)
|
|
this.types = this.types.filter(item=>item.name.indexOf('注册')==-1)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async queryCities(){
|
|
|
|
+ let res = await this.$myRequest({
|
|
|
|
+ url: "/project/cities",
|
|
|
|
+ data: {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ method:"GET"
|
|
|
|
+ })
|
|
|
|
+ if(res.data.success){
|
|
|
|
+ this.region = res.data.list||[]
|
|
|
|
+ }
|
|
|
|
+ },
|
|
setOptionType(option){
|
|
setOptionType(option){
|
|
this.tab = option;
|
|
this.tab = option;
|
|
},
|
|
},
|
|
@@ -144,7 +146,6 @@
|
|
this.maskBgColor = this.maskColor
|
|
this.maskBgColor = this.maskColor
|
|
this.containerVisible = true
|
|
this.containerVisible = true
|
|
}, 20)
|
|
}, 20)
|
|
- console.log("regin",region)
|
|
|
|
this.queryCategoryBox();
|
|
this.queryCategoryBox();
|
|
},
|
|
},
|
|
hide() {
|
|
hide() {
|
|
@@ -174,19 +175,10 @@
|
|
this.typeName = item.name;
|
|
this.typeName = item.name;
|
|
},
|
|
},
|
|
chooceProvince(item){
|
|
chooceProvince(item){
|
|
- this.cities = item.children;
|
|
|
|
- this.province = item.name;
|
|
|
|
- this.provinceId = item.id;
|
|
|
|
- },
|
|
|
|
- chooseCity(item){
|
|
|
|
- this.city = item.name;
|
|
|
|
- this.cityId = item.id;
|
|
|
|
|
|
+ this.city = item;
|
|
},
|
|
},
|
|
reset(){
|
|
reset(){
|
|
this.city = "";
|
|
this.city = "";
|
|
- this.cityId = "";
|
|
|
|
- this.province = "";
|
|
|
|
- this.provinceId = "";
|
|
|
|
this.currentType = "";
|
|
this.currentType = "";
|
|
this.typeName = "";
|
|
this.typeName = "";
|
|
},
|
|
},
|
|
@@ -303,13 +295,11 @@
|
|
height: 100%;
|
|
height: 100%;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
padding-top: 50rpx;
|
|
padding-top: 50rpx;
|
|
- background: #f8f8f8;
|
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
overflow-y: scroll;
|
|
overflow-y: scroll;
|
|
.province_item{
|
|
.province_item{
|
|
- width: 280rpx;
|
|
|
|
line-height: 60rpx;
|
|
line-height: 60rpx;
|
|
- text-align: center;
|
|
|
|
|
|
+ padding-left: 60rpx;
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
font-family: Verdana, Verdana-Regular;
|
|
font-family: Verdana, Verdana-Regular;
|
|
font-weight: 400;
|
|
font-weight: 400;
|