444 lines
9.3 KiB
Vue
444 lines
9.3 KiB
Vue
<template>
|
|
<view class="page">
|
|
<u-navbar title="车辆管理" :border-bottom="false" :background="bgc" title-color='#000' title-size='36'
|
|
height='45'></u-navbar>
|
|
<view class="card">
|
|
<view class="card_li">
|
|
<view class="card_left">
|
|
车型名称
|
|
</view>
|
|
<view class="card_right">
|
|
<input type="text" v-model="data.model" placeholder="请输入SN码" class="input"
|
|
placeholder-style="color:#C7CDD3">
|
|
</view>
|
|
</view>
|
|
<view class="card_li" style="margin-top: 30rpx;">
|
|
<view class="up_left">
|
|
<view class="txt1">
|
|
上传门头照
|
|
</view>
|
|
<view class="txt2">
|
|
门头照片必须清晰、方正、易于辨识
|
|
</view>
|
|
</view>
|
|
<view class="up_rignt">
|
|
<image src="https://lxnapi.ccttiot.com/bike/img/static/u08cpfIllwweGcS9awYP" mode="" v-if="data.picture==''" @click="btn()"></image>
|
|
<image :src="data.picture" mode="" v-else></image>
|
|
<image src="https://lxnapi.ccttiot.com/bike/img/static/uFp9riSLtpmuq6gyKfdr" mode="" class="close" v-if="data.picture!=''" @click="data.picture=''"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="card">
|
|
<view class="card_li">
|
|
<view class="card_left">
|
|
最高电压
|
|
</view>
|
|
<view class="card_right">
|
|
<input type="text" v-model="searchKeyword" placeholder="请输入电压" class="input"
|
|
placeholder-style="color:#C7CDD3"><span> v</span>
|
|
</view>
|
|
</view>
|
|
<view class="card_li">
|
|
<view class="card_left">
|
|
最低电压
|
|
</view>
|
|
<view class="card_right">
|
|
<input type="text" v-model="searchKeyword" placeholder="请输入电压" class="input"
|
|
placeholder-style="color:#C7CDD3"><span> v</span>
|
|
</view>
|
|
</view>
|
|
<view class="card_li">
|
|
<view class="card_left">
|
|
满电续航
|
|
</view>
|
|
<view class="card_right">
|
|
<input type="text" v-model="searchKeyword" placeholder="请输入续航公里" class="input"
|
|
placeholder-style="color:#C7CDD3">
|
|
<span> KM</span>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- <view class="card">
|
|
<view class="card_li">
|
|
<view class="card_left">
|
|
收费模板
|
|
</view>
|
|
<view class="card_right">
|
|
无日租 <view class="iconfont icon-xiangyou1 " style="color: #CBCBCB;">
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
</view> -->
|
|
<view class="card">
|
|
<view class="card_li">
|
|
<view class="card_left">
|
|
车辆配件
|
|
</view>
|
|
<view class="card_right">
|
|
<view class="iconfont icon-xiangyou1 " style="color: #CBCBCB;">
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
<u-mask :show="showpart" @click="closevehicle()" :z-index='100' />
|
|
<view class="choose_part" v-if="showpart">
|
|
<view class="tit">
|
|
选择配件
|
|
|
|
</view>
|
|
<view class="part_box">
|
|
<view class="part " v-for="(item,index) in Accessorylist" :key="index" @click="chooseAcc(item, index)"
|
|
:class="chooseIdxArr.includes(index) ? 'act' : ''">
|
|
{{item.name}}
|
|
<image src="https://lxnapi.ccttiot.com/bike/img/static/uJNlGEGmN0F4AuPJmOZn" mode=""
|
|
v-if="chooseIdxArr.includes(index)"></image>
|
|
</view>
|
|
|
|
</view>
|
|
<view class="btn" @click="subacc()">
|
|
确定
|
|
</view>
|
|
</view>
|
|
<view class="btn_box">
|
|
<view class="btn1">
|
|
取消
|
|
</view>
|
|
<view class="btn2">
|
|
保存
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
bgc: {
|
|
backgroundColor: "#fff",
|
|
},
|
|
showpart: false,
|
|
list: [],
|
|
Accessorylist: [],
|
|
chooseIdxArr: [], // 存储选中的索引
|
|
data:{
|
|
model:"",
|
|
fullVoltage:"",
|
|
lowVoltage:"",
|
|
fullEndurance:"",
|
|
remark:"",
|
|
intro:"",
|
|
deposit:"",
|
|
picture:"",
|
|
description:"",
|
|
|
|
},
|
|
token: '',
|
|
upurl:''
|
|
}
|
|
},
|
|
onLoad(e) {
|
|
if (e.modelId) {
|
|
|
|
}
|
|
this.getQiniuToken()
|
|
},
|
|
onShow() {
|
|
this.getAccessorylist()
|
|
// this.getModelList()
|
|
},
|
|
|
|
methods: {
|
|
btn(){
|
|
let _this=this
|
|
let math='static/'+_this.$u.guid(20)
|
|
uni.chooseMessageFile({
|
|
count: 1,
|
|
type: 'all',
|
|
success (res) {
|
|
// tempFilePath可以作为img标签的src属性显示图片
|
|
const tempFilePaths = res.tempFiles
|
|
// let tempFilePaths = chooseImageRes.tempFilePaths;
|
|
// console.log(tempFilePaths)
|
|
// tempFilePaths.forEach(item=>{
|
|
// // 上传图片到七牛云
|
|
|
|
// })
|
|
wx.uploadFile({
|
|
url: 'https://up-z2.qiniup.com',
|
|
name: 'file',
|
|
filePath: tempFilePaths[0].path,
|
|
formData: {
|
|
token: _this.token, //后端返回的token
|
|
key:'bike/img/'+math
|
|
},
|
|
success: function(res) {
|
|
|
|
let str = JSON.parse(res.data)
|
|
|
|
_this.data.picture = _this.upurl +'/'+ str.key
|
|
console.log(_this.data.picture)
|
|
}
|
|
});
|
|
}
|
|
})
|
|
|
|
// });
|
|
},
|
|
getQiniuToken() {
|
|
|
|
this.$u.get("/common/qiniu/uploadInfo").then((res) => {
|
|
if (res.code == 200) {
|
|
this.token=res.token
|
|
console.log(res,'resres');
|
|
this.upurl=res.domain
|
|
}
|
|
});
|
|
|
|
|
|
},
|
|
subacc(){
|
|
|
|
},
|
|
chooseAcc(itm, idx) {
|
|
const index = this.chooseIdxArr.indexOf(idx);
|
|
if (index > -1) {
|
|
// 如果索引已存在于数组中,表示已经选中,再点击则取消选中
|
|
this.chooseIdxArr.splice(index, 1);
|
|
} else {
|
|
// 如果索引不存在于数组中,表示未选中,添加到数组中
|
|
this.chooseIdxArr.push(idx);
|
|
}
|
|
},
|
|
getAccessorylist() {
|
|
this.$u.get(`appAgent/getAccessorylist`).then((res) => {
|
|
if (res.code == 200) {
|
|
this.Accessorylist = res.data
|
|
} else {
|
|
// 处理接口返回错误的情况
|
|
}
|
|
}).catch(error => {
|
|
// 处理接口请求失败的情况
|
|
});
|
|
},
|
|
getModelList() {
|
|
|
|
this.$u.get(`appAdmin/getModelListByMerchantId`).then((res) => {
|
|
if (res.code == 200) {
|
|
this.list = res.data
|
|
} else {
|
|
// 处理接口返回错误的情况
|
|
}
|
|
}).catch(error => {
|
|
// 处理接口请求失败的情况
|
|
});
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
page {}
|
|
|
|
.page {
|
|
.choose_part {
|
|
position: fixed;
|
|
top: 530rpx;
|
|
left: 54rpx;
|
|
z-index: 110;
|
|
width: 644rpx;
|
|
padding: 40rpx 48rpx;
|
|
background: #FFFFFF;
|
|
border-radius: 26rpx 26rpx 26rpx 26rpx;
|
|
|
|
.part_box {
|
|
margin-top: 40rpx;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
|
|
.part:nth-child(3n) {
|
|
margin-right: 0;
|
|
}
|
|
|
|
.part {
|
|
margin-top: 10rpx;
|
|
position: relative;
|
|
margin-right: 36rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 160rpx;
|
|
height: 60rpx;
|
|
background: #F0F0F0;
|
|
border-radius: 6rpx 6rpx 6rpx 6rpx;
|
|
border: 1rpx solid #F0F0F0;
|
|
font-weight: 500;
|
|
font-size: 32rpx;
|
|
|
|
color: #3D3D3D;
|
|
|
|
image {
|
|
position: absolute;
|
|
right: 0;
|
|
bottom: 0;
|
|
width: 34rpx;
|
|
height: 34rpx;
|
|
}
|
|
}
|
|
|
|
.act {
|
|
background: #DCEDFF;
|
|
border: 1rpx solid #4297F3;
|
|
color: #4297F3;
|
|
}
|
|
}
|
|
|
|
.tit {
|
|
width: 100%;
|
|
text-align: center;
|
|
font-weight: 600;
|
|
font-size: 36rpx;
|
|
color: #3D3D3D;
|
|
}
|
|
|
|
.btn {
|
|
margin-top: 60rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 552rpx;
|
|
height: 88rpx;
|
|
background: #4C97E7;
|
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
|
font-weight: 600;
|
|
font-size: 36rpx;
|
|
color: #FFFFFF;
|
|
}
|
|
}
|
|
|
|
|
|
.btn_box {
|
|
position: fixed;
|
|
width: 750rpx;
|
|
bottom: 50rpx;
|
|
display: flex;
|
|
flex-wrap: nowrap;
|
|
align-content: center;
|
|
justify-content: center;
|
|
|
|
.btn1 {
|
|
margin-right: 52rpx;
|
|
display: flex;
|
|
flex-wrap: nowrap;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 310rpx;
|
|
height: 100rpx;
|
|
background: #E2F2FF;
|
|
font-weight: 500;
|
|
font-size: 40rpx;
|
|
color: #4C97E7;
|
|
}
|
|
|
|
.btn2 {
|
|
display: flex;
|
|
flex-wrap: nowrap;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 310rpx;
|
|
height: 100rpx;
|
|
background: #4C97E7;
|
|
font-weight: 500;
|
|
font-size: 40rpx;
|
|
color: #FFFFFF;
|
|
}
|
|
}
|
|
|
|
.card {
|
|
padding: 0 24rpx;
|
|
margin: 0 auto;
|
|
margin-top: 24rpx;
|
|
width: 672rpx;
|
|
background: #FFFFFF;
|
|
box-shadow: 0rpx 4rpx 22rpx 0rpx rgba(0, 0, 0, 0.07);
|
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
|
|
|
.card_li:last-child {
|
|
border-bottom: 1rpx solid #fff;
|
|
}
|
|
|
|
.card_li {
|
|
padding-top: 24rpx;
|
|
display: flex;
|
|
flex-wrap: nowrap;
|
|
align-content: center;
|
|
justify-content: space-between;
|
|
border-bottom: 1rpx solid #D8D8D8;
|
|
padding-bottom: 18rpx;
|
|
|
|
.up_left {
|
|
.txt1 {
|
|
font-weight: 400;
|
|
font-size: 30rpx;
|
|
color: #3D3D3D;
|
|
}
|
|
|
|
.txt2 {
|
|
margin-top: 16rpx;
|
|
font-weight: 400;
|
|
font-size: 24rpx;
|
|
color: #3D3D3D;
|
|
}
|
|
}
|
|
|
|
.up_rignt {
|
|
width: 110rpx;
|
|
height: 110rpx;
|
|
|
|
image {
|
|
width: 110rpx;
|
|
height: 110rpx;
|
|
}
|
|
.close{
|
|
background: #FFFFFF;
|
|
// border-radius: 50%;
|
|
position: absolute;
|
|
right: 0;
|
|
top: 0;
|
|
width: 25rpx;
|
|
height: 25rpx;
|
|
}
|
|
}
|
|
|
|
.card_left {
|
|
font-weight: 400;
|
|
font-size: 30rpx;
|
|
color: #3D3D3D;
|
|
}
|
|
|
|
.card_right {
|
|
display: flex;
|
|
flex-wrap: nowrap;
|
|
align-items: center;
|
|
|
|
span {
|
|
font-weight: 400;
|
|
font-size: 30rpx;
|
|
color: #3D3D3D;
|
|
}
|
|
|
|
.input {
|
|
text-align: right;
|
|
/* 输入框内容靠右显示 */
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
</style> |