Commit d3808923e6f9067fa69a225a24aae8773fa1ef22
1 parent
176eff96
停车记录
Showing
5 changed files
with
100 additions
and
34 deletions
src/api/parkRecord/parkRecord.js
src/views/mySelf/myCars/addCarNum.vue
src/views/mySelf/myCars/myCars.vue
... | ... | @@ -19,7 +19,7 @@ |
19 | 19 | <p style="color: #2282C5">审核中</p> |
20 | 20 | </van-col> |
21 | 21 | <van-col span="2"> |
22 | - <p> | |
22 | + <p @click="toDeletecarNumber(item,_index)"> | |
23 | 23 | <van-icon name="cross" color="#D1D1D6"/> |
24 | 24 | </p> |
25 | 25 | </van-col> |
... | ... | @@ -68,7 +68,7 @@ |
68 | 68 | |
69 | 69 | <script> |
70 | 70 | |
71 | -import { queryUserCars } from "@/api/myCars/myCars"; | |
71 | +import { queryUserCars, userCarsInfoEdit } from "@/api/myCars/myCars"; | |
72 | 72 | export default { |
73 | 73 | name: "myCars", |
74 | 74 | data() { |
... | ... | @@ -103,6 +103,23 @@ export default { |
103 | 103 | } |
104 | 104 | } |
105 | 105 | ); |
106 | + }, | |
107 | + toDeletecarNumber(item,index){ | |
108 | + let arr = [] | |
109 | + arr.push(item); | |
110 | + let jsondata = { | |
111 | + optType: '01' , | |
112 | + carNumbers: JSON.stringify(arr) | |
113 | + }; | |
114 | + jsondata.sign = this.$utils.signObject(jsondata); | |
115 | + userCarsInfoEdit(jsondata).then(response => { | |
116 | + console.log(response); | |
117 | + if(response.code==0){ | |
118 | + this.queryUserCars(); | |
119 | + this.$toast('删除成功') | |
120 | + } | |
121 | + }); | |
122 | + | |
106 | 123 | } |
107 | 124 | } |
108 | 125 | }; | ... | ... |
src/views/mySelf/myCars/rzCarNumber.vue
... | ... | @@ -53,9 +53,9 @@ export default { |
53 | 53 | methods: { |
54 | 54 | afterRead(file) { |
55 | 55 | // 此时可以自行将文件上传至服务器 |
56 | - console.log(file.content); | |
57 | - this.path = file.content | |
58 | - this.uploadPic() | |
56 | + console.log(file); | |
57 | + // this.path = file.content | |
58 | + this.uploadPic(file) | |
59 | 59 | }, |
60 | 60 | toMyCarsPage() { |
61 | 61 | console.log(this.fileList); |
... | ... | @@ -71,18 +71,45 @@ export default { |
71 | 71 | |
72 | 72 | } |
73 | 73 | }, |
74 | - uploadPic() { | |
75 | - let jsondata = { | |
76 | - fileType: '11', | |
77 | - picFile: this.path | |
78 | - }; | |
79 | - jsondata.sign = this.$utils.signObject(jsondata); | |
80 | - uploadPic(jsondata).then(response => { | |
81 | - console.log(jsondata) | |
82 | - if(response.code=='0'){ | |
83 | - | |
84 | - } | |
74 | + uploadPic(file) { | |
75 | + | |
76 | + | |
77 | + | |
78 | + | |
79 | + let params=new FormData(); | |
80 | + params.append('file',file.file); | |
81 | + params.append('fileType','11'); | |
82 | + params.sign = this.$utils.signObject(params); | |
83 | + //uploafile为自定义上传路径,记得引入 | |
84 | + | |
85 | + uploadPic({ | |
86 | + filePath: file.content, | |
87 | + name: "picFile", | |
88 | + formData: params, | |
89 | + }).then((res) => { | |
90 | + | |
91 | + //上传成功返回结果 | |
92 | + console.log(res); | |
85 | 93 | }); |
94 | + | |
95 | + | |
96 | + | |
97 | + | |
98 | + // let jsondata = { | |
99 | + // fileType: '11', | |
100 | + // picFile:file.file | |
101 | + // }; | |
102 | + // // jsondata.sign = this.$utils.signObject(jsondata); | |
103 | + // //通过formData上传文件 | |
104 | + // let formData = new FormData(); | |
105 | + // formData.append("file", file) | |
106 | + // formData.append("fileType", '11') | |
107 | + // uploadPic(jsondata).then(response => { | |
108 | + // console.log(jsondata) | |
109 | + // if(response.code=='0'){ | |
110 | + // | |
111 | + // } | |
112 | + // }); | |
86 | 113 | } |
87 | 114 | } |
88 | 115 | }; | ... | ... |
src/views/mySelf/parkNotes/parkNotes.vue
1 | 1 | <template> |
2 | 2 | <div> |
3 | - <ul class="notesList"> | |
4 | - <li>车牌号: <span>蒙DMW169</span></li> | |
5 | - <li>车牌颜色: <span>蓝色</span></li> | |
6 | - <li>进场时间: <span>2020-12-19 12:59:18</span></li> | |
7 | - <li>出场时间: <span>2020-12-19 12:59:18</span></li> | |
8 | - <li>停车时长: <span>18分33秒</span></li> | |
9 | - </ul> | |
10 | - <ul class="notesList"> | |
11 | - <li>车牌号: <span>蒙DMW169</span></li> | |
12 | - <li>车牌颜色: <span>蓝色</span></li> | |
13 | - <li>进场时间: <span>2020-12-19 12:59:18</span></li> | |
14 | - <li>出场时间: <span>2020-12-19 12:59:18</span></li> | |
15 | - <li>停车时长: <span>18分33秒</span></li> | |
16 | - </ul> | |
3 | + <div v-if="recordList.length>0"> | |
4 | + <ul class="notesList" v-for="(i,index) in recordList" :key="i.orderId"> | |
5 | + <li>车牌号: <span>{{i.carNumber}}</span></li> | |
6 | + <li>停车场: <span>{{i.parkName}}</span></li> | |
7 | + <li>进场时间: <span>{{i.parkInTime}}</span></li> | |
8 | + <li>出场时间: <span>{{i.parkOutTime}}</span></li> | |
9 | + <li>停车时长: <span>{{i.parkDuration}}</span></li> | |
10 | + <li>费用: <span>{{(i.totalFee/100).toFixed(2)}}</span></li> | |
11 | + </ul> | |
12 | + </div> | |
17 | 13 | |
18 | - <div class="noRecord" >暂无记录</div> | |
14 | + | |
15 | + <div class="noRecord" v-else>暂无记录</div> | |
19 | 16 | |
20 | 17 | </div> |
21 | 18 | </template> |
22 | 19 | |
23 | 20 | <script> |
21 | +import { parkRecordList } from "@/api/parkRecord/parkRecord.js"; | |
24 | 22 | export default { |
25 | - name: 'parkRecord' | |
26 | -} | |
23 | + name: "parkRecord", | |
24 | + data() { | |
25 | + return { | |
26 | + recordList: [] | |
27 | + }; | |
28 | + }, | |
29 | + created() { | |
30 | + this.parkRecordList(); | |
31 | + }, | |
32 | + methods: { | |
33 | + parkRecordList() { | |
34 | + let jsondata = { | |
35 | + pageNum: 1, | |
36 | + pageSize: 10, | |
37 | + parkState: 20, | |
38 | + terminalSource: 3 | |
39 | + }; | |
40 | + jsondata.sign = this.$utils.signObject(jsondata); | |
41 | + parkRecordList(jsondata).then(response => { | |
42 | + console.log(response); | |
43 | + this.recordList = data.data.dataList; | |
44 | + }); | |
45 | + } | |
46 | + } | |
47 | +}; | |
27 | 48 | </script> |
28 | 49 | |
29 | 50 | <style scoped lang="scss"> | ... | ... |