123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <template>
- <view>
- <u-navbar
- title="车辆入场"
- title-color="#fff"
- :custom-back="customBack"
- :border-bottom="false"
- back-icon-color="#CCE8FF"
- :background="{background: 'linear-gradient(145deg, #41AFF9 0%, #2D8CFB 100%)' }"></u-navbar>
- <u-empty class="u-m-t-80" text="暂无车位" mode="data" v-if="roadspaceList.length == 0"></u-empty>
- <view class="roadspace-list wrap">
- <view class="roadspace-list-item" @click="roadspaceClick(item)" v-for="(item,index) in roadspaceList" :key="index + item.id">
- <view class="block">
-
- </view>
- <view class="text">{{item.spaceName}}</view>
- </view>
- <view class="bottom-btn-wrap">
- <view class="bottom-btn" @click="openPage('pages/index/index')">返回主页</view>
- </view>
- </view>
-
- <u-action-sheet :list="actionList" @click="actionClick" v-model="actionShow"></u-action-sheet>
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- roadNo:null,//路段编码 ,示例值(RN000000004)
- actionList:[
- {text: '停车',},
- // {text: '查看'}
- ],
- actionShow:false,
- roadspaceList:[],
- spaceId:null,
- spaceName:'',
-
- }
- },
- onLoad() {
- this.roadNo = this.$store.state.vuex_user.roadList[0].roadNo || '';
- this.handleGetRoadspace(this.roadNo);
-
- },
- methods:{
- customBack(){
- this.$u.route({
- // type:'switchTab',
- url: 'pages/index/index'
- });
- },
- openPage(path) {
- console.log('path',path);
- this.$u.route({
- url: path
- })
- },
- handleGetRoadspace(roadNo){
- this.$u.api.getRoadspace({roadNo:this.roadNo,placeStatus:0})
- .then(res=>{
- // this.$refs.uToast.show({
- // title: res.msg,
- // type: 'success',
- // });
- this.roadspaceList = res.data.rows;
- console.log('handleGetRoadspace',res)
- }).catch(err=>{
- if(err.errMsg){
- this.$refs.uToast.show({
- title: '请检查网络',
- type: 'error',
- });
- return false;
- };
- this.$refs.uToast.show({
- title: err.msg,
- type: 'error',
- });
- console.log('handleGetRoadspace ',err)
- });
- },
- roadspaceClick(roadspace){
- this.actionShow = true;
- this.spaceId = roadspace.id;
- this.spaceName = roadspace.spaceName;
- console.log('roadspace',roadspace);
- },
- actionClick(e){
- console.log('actionClick',e);
- switch (e){
- case 0:
- this.$u.route({
- url: 'pages/getin/getin',
- params: {
- spaceId: this.spaceId,
- spaceName:this.spaceName,
- roadNo:this.roadNo
- }
- });
- break;
- case 1:
- break;
- default:
- break;
- }
- }
-
- }
-
- }
- </script>
- <style lang="scss">
- @import "./parking.scss";
- </style>
|