第一次提交
This commit is contained in:
54
ChargingStation/pages/vehicle/binding/index.scss
Normal file
54
ChargingStation/pages/vehicle/binding/index.scss
Normal file
@@ -0,0 +1,54 @@
|
||||
.binding_body {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: rgba(241, 248, 253, 0.9);
|
||||
padding: 54rpx 35rpx;
|
||||
box-sizing: border-box;
|
||||
.binding_container_footer{
|
||||
width: 680rpx;
|
||||
height: 106rpx;
|
||||
background: #121836;
|
||||
border-radius: 15rpx 15rpx 15rpx 15rpx;
|
||||
opacity: 1;
|
||||
margin: 0 auto;
|
||||
color: #ffffff;
|
||||
font-size: 34rpx;
|
||||
position: absolute;
|
||||
bottom: 80rpx;
|
||||
}
|
||||
.binding_container {
|
||||
width: 100%;
|
||||
height: 319rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
padding: 40rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
.binding_footer {
|
||||
font-size: 22rpx;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.binding_num {
|
||||
margin-top: 30rpx;
|
||||
font-size: 36rpx;
|
||||
color: #000000;
|
||||
font-weight: 600;
|
||||
.binding_num_item {
|
||||
width: 59rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 14rpx 14rpx 14rpx 14rpx;
|
||||
opacity: 1;
|
||||
border: 1rpx solid #cacaca;
|
||||
}
|
||||
.binding_num_item:last-child{
|
||||
border: 1rpx solid #52ca37;
|
||||
}
|
||||
}
|
||||
.binding_title {
|
||||
color: #121836;
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
67
ChargingStation/pages/vehicle/binding/index.vue
Normal file
67
ChargingStation/pages/vehicle/binding/index.vue
Normal file
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<view class="binding_body">
|
||||
<view class="binding_container">
|
||||
<view class="binding_title">车牌号码 </view>
|
||||
<view @click="$refs.plateNumber.open()" class="binding_num flex around">
|
||||
<view v-for=" (item,index) in 8 " class="binding_num_item flex ac jc">
|
||||
{{plateNum[index]?plateNum[index]:''}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="binding_footer">充电时请选择正确的车牌号码</view>
|
||||
</view>
|
||||
<view @click="binding" :style="{background:this.plateNum.length&&!duplicate?'':'#bbbbbb'}" class="binding_container_footer flex ac jc">
|
||||
确定绑定
|
||||
</view>
|
||||
<view style="position: absolute;right: 0;left: 0;">
|
||||
<keyboardPlates ref="plateNumber" :plateNum.sync='plateNum' @change="getPlateNum" isShow></keyboardPlates>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import station from '@/api/station.js'
|
||||
import keyboardPlates from '../../../components/plate/index.vue'
|
||||
export default {
|
||||
components: {
|
||||
keyboardPlates
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
plateNum: '',
|
||||
duplicate:false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
binding() {
|
||||
|
||||
if(!this.plateNum&&this.duplicate){
|
||||
return
|
||||
}
|
||||
this.duplicate = true
|
||||
station.vehicleSave({
|
||||
plateNumber:this.plateNum,
|
||||
createSource: 'MALL_COMS_MINI'
|
||||
}).then(res=>{
|
||||
setTimeout(()=>{
|
||||
uni.showToast({
|
||||
title:'添加成功',
|
||||
icon:'none',
|
||||
success() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
},1000)
|
||||
}).finally(()=>{
|
||||
this.duplicate = false
|
||||
})
|
||||
},
|
||||
getPlateNum() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import 'index.scss';
|
||||
</style>
|
||||
48
ChargingStation/pages/vehicle/index.scss
Normal file
48
ChargingStation/pages/vehicle/index.scss
Normal file
@@ -0,0 +1,48 @@
|
||||
.vehicle_body {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: rgba(241, 248, 253, 0.9);
|
||||
padding: 53rpx 30rpx;
|
||||
box-sizing: border-box !important;
|
||||
overflow-y: auto;
|
||||
.vehicle_add {
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
background: rgba(202, 202, 202, 0.2);
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
padding: 0 48rpx;
|
||||
box-sizing: border-box;
|
||||
font-weight: 600;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-size: 34rpx;
|
||||
text {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
.vehicle_item {
|
||||
width: 100%;
|
||||
height: 199rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
margin-bottom: 47rpx;
|
||||
padding: 40rpx;
|
||||
box-sizing: border-box;
|
||||
.vehicle_item_bottom {
|
||||
font-size: 24rpx;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
margin-top: 17rpx;
|
||||
}
|
||||
.vehicle_item_plateNumber {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 600;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
text {
|
||||
font-size: 22rpx;
|
||||
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
}
|
||||
}
|
||||
80
ChargingStation/pages/vehicle/index.vue
Normal file
80
ChargingStation/pages/vehicle/index.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<view class="vehicle_body">
|
||||
<view v-for="(item,index) in cars" :key="index" class="vehicle_item">
|
||||
<view class="vehicle_item_top flex jw ac">
|
||||
<view class="vehicle_item_plateNumber">{{item.plateNumber}}</view>
|
||||
<view @click="delect(item)">
|
||||
<uni-icons type="trash" size="15"></uni-icons>
|
||||
<text>删除</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="vehicle_item_bottom">
|
||||
已绑定车辆
|
||||
</view>
|
||||
</view>
|
||||
<view @click="goAdd" class="vehicle_add flex ac ">
|
||||
<uni-icons type="plus-filled" size="30"></uni-icons>
|
||||
<text>添加车辆</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import station from '@/api/station.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
cars:[]
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.init()
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
delect(item){
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确定删除车牌号?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
station.deleteVehicleById(item.id).then(res=>{
|
||||
setTimeout(()=>{
|
||||
uni.showToast({
|
||||
title:'删除成功',
|
||||
icon:'none',
|
||||
success() {
|
||||
that.getcars()
|
||||
}
|
||||
})
|
||||
},1000)
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
init(){
|
||||
this.getcars()
|
||||
},
|
||||
goAdd(){
|
||||
uni.navigateTo({
|
||||
url:'/ChargingStation/pages/vehicle/binding/index'
|
||||
})
|
||||
},
|
||||
getcars(){
|
||||
station.getVehicleAll().then(res=>{
|
||||
this.cars = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import 'index.scss';
|
||||
</style>
|
||||
Reference in New Issue
Block a user