123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <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>
-
- <view class="road-list">
- <view class="road-list-item" v-for="item in Roads" :key="item.id" @click="handleModifyRoad(item.id)">
- <view class="name">{{item.roadName}}</view>
- <view class="position">{{item.roadName}}</view>
- <view class="distance">{{item.roadName}}</view>
- </view>
- </view>
-
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- export default{
- data(){
- return{
- Roads:[],
- }
- },
- onLoad(){
- this.Roads = this.$store.state.vuex_user?.roadList;
- console.log('Roads',JSON.parse(JSON.stringify(this.Roads)));
- },
- onShow(){
-
- },
- methods:{
- customBack(){
- this.$u.route({
- // type:'switchTab',
- url: 'pages/index/index'
- });
- },
- handleModifyRoad(id){
- console.log('id',id);
- this.$u.api.modifyRoad({roadId:id})
- .then(res=>{
- this.$refs.uToast.show({
- title: res.msg,
- type: 'success',
- url: 'pages/index/index'
- });
- console.log('modifyRoad',res)
- }).catch(err=>{
- this.$refs.uToast.show({
- title: err.msg,
- type: 'error',
- });
- console.log('modifyRoad ',err)
- });
- }
-
- }
- }
- </script>
- <style lang="scss">
- @import './roadlist.scss'
- </style>
|