|
@@ -15,25 +15,32 @@
|
|
|
</view>
|
|
|
<view class="car-list" v-for="(item,index) in carList" :key="index">
|
|
|
<view class="left-img">
|
|
|
- <image style="width: 100%;height:100%; background-color: #eeeeee;border-radius:10rpx;" mode="widthFix" :src="item.addressUrl"></image>
|
|
|
+ <image style="width: 100%;height:100%; background-color: #eeeeee;border-radius:10rpx;" mode="widthFix"
|
|
|
+ :src="item.addressUrl"></image>
|
|
|
</view>
|
|
|
<view class="car-list-item">
|
|
|
<view class="row1">
|
|
|
{{item.carNumber}}
|
|
|
</view>
|
|
|
<view class="row2">
|
|
|
- <u-icon name="edit-pen" size="26" style="margin-right: 20rpx;" @click="edit(item)" v-if="item.status!='审核中'"></u-icon>
|
|
|
+ <u-icon name="edit-pen" size="26" style="margin-right: 20rpx;" @click="edit(item)"
|
|
|
+ v-if="item.status!='审核中'"></u-icon>
|
|
|
<u-icon name="trash" size="26" @click="del(item,index)"></u-icon>
|
|
|
</view>
|
|
|
<view class="row3">
|
|
|
<view class="text">车辆状态:</view>
|
|
|
- <u-tag v-if="item.status=='已认证'" :text="item.status" type="success" plain plainFill size="mini"></u-tag>
|
|
|
- <u-tag v-if="item.status=='未通过'" :text="item.status" type="error" plain plainFill size="mini"></u-tag>
|
|
|
- <u-tag v-if="item.status=='审核中'" :text="item.status" type="warning" plain plainFill size="mini"></u-tag>
|
|
|
+ <u-tag v-if="item.status=='已认证'" :text="item.status" type="success" plain plainFill size="mini">
|
|
|
+ </u-tag>
|
|
|
+ <u-tag v-if="item.status=='未通过'" :text="item.status" type="error" plain plainFill size="mini">
|
|
|
+ </u-tag>
|
|
|
+ <u-tag v-if="item.status=='审核中'" :text="item.status" type="warning" plain plainFill size="mini">
|
|
|
+ </u-tag>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-<u-toast ref="uToast"></u-toast>
|
|
|
+ <u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :showCancelButton='true'
|
|
|
+ confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal>
|
|
|
+ <u-toast ref="uToast"></u-toast>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -45,11 +52,15 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- carList:[],
|
|
|
+ carList: [],
|
|
|
+ obj: {},
|
|
|
+ index: null,
|
|
|
+ isShowAlert: false,
|
|
|
+ alertTitle: '确认删除该车辆?'
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(['hasLogin', 'userInfo','firstAuthentication']),
|
|
|
+ ...mapState(['hasLogin', 'userInfo', 'firstAuthentication']),
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
console.log(this.firstAuthentication.id)
|
|
@@ -61,6 +72,28 @@
|
|
|
console.log(options)
|
|
|
},
|
|
|
methods: {
|
|
|
+ confirmClick() {
|
|
|
+ this.isShowAlert = false
|
|
|
+ this.$request.baseRequest('post', '/driverCarInfo/api/deleteDriverCar', {
|
|
|
+ id: this.obj.id
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'success',
|
|
|
+ message: "删除成功!",
|
|
|
+ })
|
|
|
+ this.carList.splice(this.index, 1)
|
|
|
+ uni.hideLoading()
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ uni.$u.toast(res.message);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ cancelClick() {
|
|
|
+ this.isShowAlert = false
|
|
|
+ },
|
|
|
init() {
|
|
|
this.$request.baseRequest('get', '/driverCarInfo/selectDriverCar', {
|
|
|
driverId: this.userInfo.driverId,
|
|
@@ -68,7 +101,7 @@
|
|
|
}).then(res => {
|
|
|
if (res.code == '200') {
|
|
|
this.carList = res.data
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
uni.$u.toast(res.message);
|
|
|
}
|
|
|
|
|
@@ -81,29 +114,13 @@
|
|
|
uni.$u.route('/pages/mine/manageVehicles/addVehicle');
|
|
|
},
|
|
|
edit(val) {
|
|
|
- uni.$u.route('/pages/mine/manageVehicles/editVehicle',val);
|
|
|
+ uni.$u.route('/pages/mine/manageVehicles/editVehicle', val);
|
|
|
},
|
|
|
- del(val,index) {
|
|
|
- uni.showLoading({
|
|
|
- mask:true,
|
|
|
- title:'加载中'
|
|
|
- })
|
|
|
- this.$request.baseRequest('post', '/driverCarInfo/api/deleteDriverCar', {
|
|
|
- id:val.id
|
|
|
- }).then(res => {
|
|
|
- if (res.code == '200') {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'success',
|
|
|
- message: "删除成功!",
|
|
|
- })
|
|
|
- this.carList.splice(index,1)
|
|
|
- uni.hideLoading()
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
- uni.$u.toast(res.message);
|
|
|
- });
|
|
|
+ del(val, index) {
|
|
|
+ this.obj = val
|
|
|
+ this.index = index
|
|
|
+ this.isShowAlert = true
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
}
|
|
@@ -165,6 +182,7 @@
|
|
|
background-size: 100% 100%;
|
|
|
padding: 60rpx 43rpx;
|
|
|
width: 70%;
|
|
|
+
|
|
|
.row1 {
|
|
|
font-size: 36rpx;
|
|
|
font-weight: 700;
|
|
@@ -180,7 +198,8 @@
|
|
|
display: flex;
|
|
|
}
|
|
|
}
|
|
|
- .left-img{
|
|
|
+
|
|
|
+ .left-img {
|
|
|
width: 30%;
|
|
|
display: flex;
|
|
|
align-items: center;
|