Blame view

src/views/carManage/myCars.vue 5.17 KB
13b6a53a   刘淇   title
1
  <template>
002e5c7b   刘淇   添加车牌
2
3
    <div>
      <ul class="carsList">
76b0bb3d   刘淇   车辆认证
4
        <li v-for="(i, index) in carList" :key="i.id">
002e5c7b   刘淇   添加车牌
5
6
          <div style="display: flex;justify-content: space-between;margin-bottom: 6px;">
            <p >
76b0bb3d   刘淇   车辆认证
7
              {{ i.carNumber}}  <span class="carColor" :class="carBgFilter(i.carNumberColor)"></span>
002e5c7b   刘淇   添加车牌
8
            </p>
76b0bb3d   刘淇   车辆认证
9
10
11
12
13
  
            <p class=" certification-status" v-if="i.examineState == 0" @click="toCer(i)">
              立即认证
            </p>
            <p class=" check-status" v-if="i.examineState == 1">
002e5c7b   刘淇   添加车牌
14
15
              审核中
            </p>
76b0bb3d   刘淇   车辆认证
16
17
18
19
20
21
22
  
            <p class="  pass-status" v-if="i.examineState == 2">
              通过
            </p>
            <p class="" v-if="i.examineState == 3">
              驳回
            </p>
002e5c7b   刘淇   添加车牌
23
24
25
26
27
28
            <!--<p class=" pass-status">-->
            <!--已认证-->
            <!--</p>-->
          </div>
          <div style="display: flex;justify-content: space-between">
            <p>
76b0bb3d   刘淇   车辆认证
29
              {{ i.carNumberColor==2?'新能源车':'汽油车'}}
002e5c7b   刘淇   添加车牌
30
            </p>
76b0bb3d   刘淇   车辆认证
31
            <p style="color: blue" @click="deleteShowHandle(i)">
002e5c7b   刘淇   添加车牌
32
33
34
35
36
37
38
              解绑车辆
            </p>
            <!--<p class=" pass-status">-->
            <!--已认证-->
            <!--</p>-->
          </div>
          <p class="top-border">
76b0bb3d   刘淇   车辆认证
39
40
            {{i.examineStateMsg}}
            <!--您可以申请 <span style="color: blue">立刻认证</span>,享受更多服务-->
002e5c7b   刘淇   添加车牌
41
42
43
44
45
46
47
48
          </p>
          <!--<p class="top-border">-->
          <!--您已经提交审核申请,请耐心等待-->
          <!--</p>-->
          <!--<p class="top-border">-->
          <!--您可以查看历史停车记录了-->
          <!--</p>-->
        </li>
002e5c7b   刘淇   添加车牌
49
      </ul>
76b0bb3d   刘淇   车辆认证
50
51
      <div style="padding: 20px 15px" v-if="carList.length<3">
        <x-button type="primary"  @click.native="addCarNumb">立即添加</x-button>
002e5c7b   刘淇   添加车牌
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
      </div>
  
      <div class="tipWrap">
        <span>温馨提示:</span>
        <p>
          1、车辆绑定后请提交行驶证进行真实性验证,48小时内反馈审核结果,如自行解绑车牌后,再次重新绑定,需重新审核认证。
        </p>
        <p>
          2、未认证车牌只支持当前停车费和历史欠费记录。
        </p>
        <p>
          3、认证车牌支持查看历史停车记录。
        </p>
      </div>
  
76b0bb3d   刘淇   车辆认证
67
  
002e5c7b   刘淇   添加车牌
68
69
  
    </div>
13b6a53a   刘淇   title
70
71
72
  </template>
  
  <script>
76b0bb3d   刘淇   车辆认证
73
74
  
  import { queryUserCars, userCarsInfoEdit } from "@/api/myCars/myCars"
13b6a53a   刘淇   title
75
  export default {
76b0bb3d   刘淇   车辆认证
76
  
002e5c7b   刘淇   添加车牌
77
78
79
    name: "myCars",
    data(){
      return {
76b0bb3d   刘淇   车辆认证
80
81
82
        deleteShow: false, // 删除弹窗
        carList:[],
  
002e5c7b   刘淇   添加车牌
83
84
      }
    },
76b0bb3d   刘淇   车辆认证
85
86
87
    mounted(){
      this.queryUserCars()
    },
002e5c7b   刘淇   添加车牌
88
    methods:{
76b0bb3d   刘淇   车辆认证
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
      // 我的车辆查询
      queryUserCars(){
        let jsondata =  this.$utils.commonParams();
        console.log(jsondata)
        jsondata.sign = this.$utils.signObject(jsondata);
        queryUserCars(jsondata).then(data => {
          console.log(data)
          this.carList = data.data
        })
      },
      toCer(i){
        this.$router.push({
          path:'certification',
          query:{
            carNum:i.carNumber,
            carNumberColor:i.carNumberColor,
            id: i.id
          }
        })
      },
      addCarNumb(){
        this.$router.push({
          path:'addCar'
        })
      },
      deleteShowHandle(i){
        let me = this
        this.$vux.confirm.show({
          title: '提示',
          content: '是否删除该车辆',
          // onShow () {
          //   console.log('plugin show')
          // },
          // onHide () {
          //   console.log('plugin hide')
          // },
          onCancel () {
            console.log('plugin cancel')
          },
          onConfirm () {
            console.log('plugin confirm')
            me.deleteCarNumb(i)
          }
        })
      },
      deleteCarNumb(item){
        console.log(item)
        let arr = []
        arr.push(item)
        let jsondata =  this.$utils.commonParams();
        // 状态;1-已使用,0-未使用, 2-已使用+未使用
        jsondata.optType = '01'
        jsondata.carNumbers = JSON.stringify(arr)
        jsondata.sign = this.$utils.signObject(jsondata);
        userCarsInfoEdit(jsondata).then(data => {
          console.log(data)
          this.$vux.toast.text(data.message, 'top')
          this.queryUserCars()
        })
      },
      carBgFilter:function(val) {
        console.log(val)
        // 车牌颜色:0:蓝牌;1:黄牌;2:白牌;3:黑牌;4:绿色
        if(val == 0){
          return 'blueBg'
        }
        if(val == 1){
          return 'yellowBg'
        }
        if(val == 2){
          return 'whiteBg'
        }
        if(val == 3){
          return 'blackBg'
        }
        if(val == 4){
          return 'greenBg'
        }
002e5c7b   刘淇   添加车牌
167
      }
76b0bb3d   刘淇   车辆认证
168
169
170
    },
    filters:{
  
002e5c7b   刘淇   添加车牌
171
    }
13b6a53a   刘淇   title
172
173
174
  };
  </script>
  
002e5c7b   刘淇   添加车牌
175
176
177
178
179
180
181
182
183
184
185
186
  <style scoped lang="scss">
    .carsList {
      padding: 0 15px;
      font-size: 12px;
      > li {
        /*height:100px;*/
        margin-top: 15px;
        padding: 10px;
        border-radius: 10px;
        box-shadow: 0 1px 3px #ddd;
      }
    }
76b0bb3d   刘淇   车辆认证
187
  
002e5c7b   刘淇   添加车牌
188
189
190
191
192
193
194
195
196
197
198
199
200
201
  
    .check-status {
      padding: 1px 8px;
      border: 1px solid #ffbe00;
      border-radius: 15px;
      color: #ffbe00;
    }
  
    .pass-status {
      padding: 2px 8px;
      border: 1px solid blue;
      border-radius: 15px;
      color: blue;
    }
76b0bb3d   刘淇   车辆认证
202
203
204
205
206
207
    .certification-status{
      padding: 2px 8px;
      border: 1px solid red;
      border-radius: 15px;
      color: red;
    }
002e5c7b   刘淇   添加车牌
208
209
210
211
212
213
214
  
    .top-border {
      margin-top: 6px;
      padding-top: 6px;
      border-top: 1px solid #ddd;
    }
    .tipWrap{
76b0bb3d   刘淇   车辆认证
215
      padding: 15px 15px 0;
002e5c7b   刘淇   添加车牌
216
217
218
219
      p{
        text-indent: 15px;
      }
    }
13b6a53a   刘淇   title
220
221
  
  </style>