Commit 6f85e6ad authored by 高宇's avatar 高宇

选择停车场

parent 5b36a937
...@@ -2,22 +2,13 @@ ...@@ -2,22 +2,13 @@
<view class="choose"> <view class="choose">
<!-- <u-search placeholder="输入停车场名称" bg-color="#eee" :show-action="false" input-align="center"></u-search> --> <!-- <u-search placeholder="输入停车场名称" bg-color="#eee" :show-action="false" input-align="center"></u-search> -->
<view> <view>
<u-radio-group v-model="value" @change="radioGroupChange" iconPlacement="right"> <u-radio-group v-model="value" @change="radioGroupChange" iconPlacement="right" :wrap="true">
<u-radio @change="radioChange" v-for="(item, index) in list" :key="index" :name="item.name" <u-radio @change="radioChange(res)" v-for="(res, index) in list" :key="index" :name="res.name">
:disabled="item.disabled"> <view style="display: flex;flex-direction: column;" @click="checkPark(res)" >
<view style="display: flex;flex-direction: column;"> <view style="display: flex;flex-direction: column;">
<view class="onetitle" @click="showaddress">{{item.name}}</view> <spam class="onetitle">{{tenantNme}}</spam>
<view class="address" v-if="show"> <span class="twotitle">{{res.name}}</span>
<view class="addresscard"> <span class="threetitle">{{res.address}}</span>
<view v-for="item in addressList" class="addressmessage" @click="choosecity(item)">
{{item.name}}
</view>
</view>
</view>
<view v-else style="display: flex;flex-direction: column;">
<span class="twotitle">北京世纪城</span>
<span class="threetitle">北京市海淀区</span>
</view> </view>
</view> </view>
</u-radio> </u-radio>
...@@ -30,17 +21,51 @@ ...@@ -30,17 +21,51 @@
export default { export default {
data(){ data(){
return{ return{
list: [{ name: '',
name: '北京市', tenantId: '',
disabled: false tenantNme: '',
}], list: [],
show: false, show: false,
addressList: [], addressList: [],
// u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中 // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
value: '北京市', value: '北京市',
} }
}, },
onLoad(option) {
console.log('option',option)
if(option.name) {
this.value = option.name
}
// this.init()
},
onShow() {
this.getList()
},
methods:{ methods:{
checkPark(item) {
console.log('item',item)
uni.navigateTo({
url:'/homePage/parkingService/index?name=' + item.name
})
},
getList(){
const that = this
uni.getStorage({
key:'business',
success:function(res){
console.log('商圈数据',res.data)
that.tenantId = res.data.id
that.tenantNme = res.data.name
that.init()
}
})
},
init(){
this.$u.get('/parking/mobile/list?tenantId='+this.tenantId).then(res => {
console.log('res',res)
this.list = res
})
},
// 选中某个单选框时,由radio时触发 // 选中某个单选框时,由radio时触发
radioChange(e) { radioChange(e) {
// console.log(e); // console.log(e);
...@@ -89,6 +114,11 @@ ...@@ -89,6 +114,11 @@
.choose{ .choose{
padding: 34rpx 0; padding: 34rpx 0;
/deep/ .u-radio__icon-wrap{
position: absolute;
right: 20rpx;
}
/deep/.u-radio__icon-wrap--checked { /deep/.u-radio__icon-wrap--checked {
order: 2; order: 2;
position: absolute; position: absolute;
...@@ -96,16 +126,20 @@ ...@@ -96,16 +126,20 @@
} }
.onetitle { .onetitle {
margin-top: 32rpx;
margin-left: 30rpx;
font-size: 40rpx; font-size: 40rpx;
font-weight: bold; font-weight: bold;
} }
.twotitle { .twotitle {
margin-left: 30rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: 600; font-weight: 600;
} }
.threetitle { .threetitle {
margin-left: 30rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
} }
......
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