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

选择停车场

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