设置修改

This commit is contained in:
tx 2025-01-10 10:05:18 +08:00
parent 02e85a6d72
commit 48f1c588c6
3 changed files with 449 additions and 462 deletions

View File

@ -41,15 +41,6 @@
</view> </view>
</view> </view>
<view class="decice_cont"> <view class="decice_cont">
<!-- <view class="cont" @click="changeidx(0)">
<view class="text" :class="statusidx==0?'act1':''">
未上架
</view>
<view class="text" :class="statusidx==0?'act1':''">
1
</view>
</view> -->
<view class="cont" @click="changeidx('-0')"> <view class="cont" @click="changeidx('-0')">
<view class="text" :class="statusidx=='-0'?'act1':''"> <view class="text" :class="statusidx=='-0'?'act1':''">
投放中 投放中
@ -143,9 +134,7 @@
<view class="fixdivce" v-if="nearbyMarkers.length>1&&showdevList"> <view class="fixdivce" v-if="nearbyMarkers.length>1&&showdevList">
<view class="scrollable-content"> <view class="scrollable-content">
<view class="divce_li" v-for="(item,index) in nearbyMarkers" :key="index" @click="tapsn(item.sn)"> <view class="divce_li" v-for="(item,index) in nearbyMarkers" :key="index" @click="tapsn(item.sn)">
<!-- <view class="left_img">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uEW2Zm3sO8E5eqOf2wwl" mode=""></image>
</view> -->
<view class="right_cont"> <view class="right_cont">
<view class="right_top"> <view class="right_top">
<view class="right_top_right"> <view class="right_top_right">
@ -234,13 +223,9 @@
}); });
// this.getareaid() // this.getareai
this.getmarks() this.getmarks()
this.allVehicleNum() this.allVehicleNum()
// this.getmarks();
}, },
onLoad() { onLoad() {
if (uni.getStorageSync('adminAreaid')) { if (uni.getStorageSync('adminAreaid')) {
@ -254,15 +239,8 @@
type: 'wgs84', type: 'wgs84',
success: function(lb) { success: function(lb) {
// that.latitude = Number(lb.latitude.toFixed(5)) - 0.005
// that.longitude = Number(lb.longitude.toFixed(5)) + 0.005
console.log(that.areaInfo, 'that.areaInfo'); console.log(that.areaInfo, 'that.areaInfo');
// that.setMapScale()
// that.getmarks()
//
}, },
fail: function(error) { fail: function(error) {
uni.showToast({ uni.showToast({
@ -316,11 +294,7 @@
uni.createMapContext("map", this).getCenterLocation({ uni.createMapContext("map", this).getCenterLocation({
type: 'gcj02', type: 'gcj02',
success: (res) => { success: (res) => {
// console.log("", res)
// that.deviceGps.latitude = res.latitude;
// that.deviceGps.longitude = res.longitude;
//
}, },
fail: (err) => {} fail: (err) => {}
}) })

View File

@ -10,8 +10,7 @@
<view class="top_box" style="margin-top: 20rpx;"> <view class="top_box" style="margin-top: 20rpx;">
<view class="sear_ipt"> <view class="sear_ipt">
<input type="text" v-model="searchKeyword" placeholder="请输入SN码" class="input" <input type="text" v-model="searchKeyword" placeholder="请输入SN码" class="input" placeholder-style="color:#C7CDD3" @input="search()">
placeholder-style="color:#C7CDD3" @input="search()">
</view> </view>
</view> </view>
@ -169,6 +168,10 @@ export default {
{ {
value: '3', value: '3',
label: '车牌号排序' label: '车牌号排序'
},
{
value: '4',
label: '电量排序'
}], }],
lists: [{ lists: [{
value: 'desc', value: 'desc',
@ -344,17 +347,17 @@ export default {
}, },
getStatusColor(item) { getStatusColor(item) {
if (item.status == 0 || item.status == 8) { if (item.status == 0 || item.status == 8) {
return '#808080'; // 线 return '#979797'; // 线
} else if (item.status == 1) { } else if (item.status == 1) {
return '#28a745'; // 绿 return '#4c97e7'; // 绿
} else if (item.status == 2) { } else if (item.status == 2) {
return '#ff8c00'; // return '#28c445'; //
} else if (item.status == 3) { } else if (item.status == 3) {
return '#007bff'; // return '#ffc757'; //
} else if (item.status == 4) { } else if (item.status == 4) {
return '#ffc107'; // return '#ff7429'; //
} else if (item.status == 6) { } else if (item.status == 6) {
return '#6f42c1'; // return '#986cf0'; //
} else if (item.status == 7) { } else if (item.status == 7) {
return '#343a40'; // return '#343a40'; //
} }

View File

@ -23,10 +23,10 @@
</view> </view>
<view class="up_rignt"> <view class="up_rignt">
<image src="https://lxnapi.ccttiot.com/bike/img/static/u08cpfIllwweGcS9awYP" mode="" <image src="https://lxnapi.ccttiot.com/bike/img/static/u08cpfIllwweGcS9awYP" mode=""
v-if="data.picture==''" @click="btn()"></image> v-if="data.picture == ''" @click="btn()"></image>
<image :src="data.picture" mode="" v-else></image> <image :src="data.picture" mode="" v-else></image>
<image src="https://lxnapi.ccttiot.com/bike/img/static/uFp9riSLtpmuq6gyKfdr" mode="" class="close" <image src="https://lxnapi.ccttiot.com/bike/img/static/uFp9riSLtpmuq6gyKfdr" mode="" class="close"
v-if="data.picture!=''" @click="data.picture=''"></image> v-if="data.picture != ''" @click="data.picture = ''"></image>
</view> </view>
</view> </view>
</view> </view>
@ -108,7 +108,7 @@
<view class="card"> <view class="card">
<view class="card_li1"> <view class="card_li1">
<view class="card_top" @click="showpart=true"> <view class="card_top" @click="showpart = true">
<view class="card_left"> <view class="card_left">
收费模版 收费模版
</view> </view>
@ -139,20 +139,20 @@
<view class="choose_part" v-if="showpart"> <view class="choose_part" v-if="showpart">
<view class="tit"> <view class="tit">
选择收费方式 选择收费方式
</view> </view>
<view class="part_box"> <scroll-view class="part_box" scroll-y>
<view class="" v-for="(item, index) in Accessorylist" :key="index" @click="chooseAcc(item.ruleId)" <view class="part_list">
style="width: 100%; display: flex;margin-top: 10rpx;"> <view class="part_item" v-for="(item, index) in Accessorylist" :key="index"
<view class="part" :class="data.ruleIds.includes(item.ruleId) ? 'act' : ''"> @click="chooseAcc(item.ruleId)">
{{item.name}} <view class="part" :class="data.ruleIds.includes(item.ruleId) ? 'act' : ''">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uJNlGEGmN0F4AuPJmOZn" mode="" {{ item.name }}
v-if="data.ruleIds.includes(item.ruleId)"> <image src="https://lxnapi.ccttiot.com/bike/img/static/uJNlGEGmN0F4AuPJmOZn" mode=""
</image> v-if="data.ruleIds.includes(item.ruleId)">
</image>
</view>
</view> </view>
</view> </view>
</scroll-view>
</view>
<view class="btn" @click="subacc()"> <view class="btn" @click="subacc()">
确定 确定
</view> </view>
@ -169,456 +169,397 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
bgc: { bgc: {
backgroundColor: "#fff", backgroundColor: "#fff",
},
showpart: false,
list: [],
Accessorylist: [],
chooseIdxArr: [], //
data: {
model: "",
fullVoltage: "",
lowVoltage: "",
fullEndurance: "",
ruleIds: [],
lowBatteryReminder: '20',
lowBatteryReminderSwitch: false
// deposit: "",
// picture: "",
// description: "",
},
token: '',
upurl: '',
modelId: '',
areaId: ''
}
},
onLoad(e) {
if (e.modelId) {
console.log(e);
this.modelId = e.modelId
this.getmodelInfo()
}
if (uni.getStorageSync('adminAreaid')) {
this.areaId = uni.getStorageSync('adminAreaid')
}
// this.getQiniuToken()
},
onShow() {
this.getAccessorylist()
// this.getModelList()
},
methods: {
closepart() {
this.showpart = false
}, },
getmodelInfo() { showpart: false,
list: [],
Accessorylist: [],
this.$u.get("system/model/" + this.modelId).then((res) => { chooseIdxArr: [], //
if (res.code == 200) { data: {
this.data = res.data model: "",
this.data.ruleIds = res.ruleIds fullVoltage: "",
console.log(this.data, 'this.datathis.data'); lowVoltage: "",
fullEndurance: "",
} ruleIds: [],
}); lowBatteryReminder: '20',
}, lowBatteryReminderSwitch: false
backpage() { // deposit: "",
uni.redirectTo({ // picture: "",
url: '/pages_adminSet/CarModel' // description: "",
})
},
sub() {
if (this.data.model === undefined || this.data.model === null || this.data.model === '') {
uni.showToast({
title: '请填写车型名称',
icon: 'none',
duration: 2000
});
return; //
}
if (this.data.fullVoltage === undefined || this.data.fullVoltage === null || this.data.fullVoltage ===
'') {
uni.showToast({
title: '请填写满电电压',
icon: 'none',
duration: 2000
});
return;
}
if (this.data.lowVoltage === undefined || this.data.lowVoltage === null || this.data.lowVoltage === '') {
uni.showToast({
title: '请填写亏电电压',
icon: 'none',
duration: 2000
});
return;
}
if (this.data.fullEndurance === undefined || this.data.fullEndurance === null || this.data
.fullEndurance === '') {
uni.showToast({
title: '请填写续航公里数',
icon: 'none',
duration: 2000
});
return;
}
if (this.data.ruleIds.length < 1) {
uni.showToast({
title: '请选择收费模版',
icon: 'none',
duration: 2000
});
return;
}
if (this.modelId) {
this.data.areaId = this.areaId
this.$u.put("/system/model", this.data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '操作成功',
icon: 'none',
duration: 1000
});
setTimeout(() => {
uni.navigateBack()
}, 1200)
}
});
} else {
this.data.areaId = this.areaId
this.$u.post("/system/model", this.data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '操作成功',
icon: 'none',
duration: 1000
});
setTimeout(() => {
uni.navigateBack()
}, 1200)
}
});
}
}, },
token: '',
subacc() { upurl: '',
this.showpart = false modelId: '',
console.log(this.chooseIdxArr); areaId: ''
},
chooseAcc(ruleId) {
const index = this.data.ruleIds.indexOf(ruleId);
if (index > -1) {
// ruleId ruleIds
this.data.ruleIds.splice(index, 1);
} else {
// ruleId ruleIds
this.data.ruleIds.push(ruleId);
}
console.log(this.data.ruleIds, ' this.data.ruleIds');
},
getAccessoryNames(accessoryIds) {
// accessoryIds Accessorylist name
// accessoryIds id Accessorylist name
// const accessoryNames = this.data.ruleIds.map(id => {
// console.log(id);
// const item = this.Accessorylist.find(accessory => accessory.ruleId === id);
// return item ? item.name : '';
// });
// // name
// return accessoryNames.filter(name => name).join(', ');
// accessoryIds Accessorylist name
const accessoryNames = this.data.ruleIds.map(id => {
const item = this.Accessorylist.find(accessory => accessory.ruleId === id);
return item ? item.name : '';
});
//
return accessoryNames.filter(name => name);
},
getAccessorylist() {
let data = {
areaId: this.areaId
}
this.$u.get(`/app/fee/list?`, data).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 => {
//
});
},
} }
},
onLoad(e) {
if (e.modelId) {
console.log(e);
this.modelId = e.modelId
this.getmodelInfo()
}
if (uni.getStorageSync('adminAreaid')) {
this.areaId = uni.getStorageSync('adminAreaid')
}
// this.getQiniuToken()
},
onShow() {
this.getAccessorylist()
// this.getModelList()
},
methods: {
closepart() {
this.showpart = false
},
getmodelInfo() {
this.$u.get("system/model/" + this.modelId).then((res) => {
if (res.code == 200) {
this.data = res.data
this.data.ruleIds = res.ruleIds
console.log(this.data, 'this.datathis.data');
}
});
},
backpage() {
uni.redirectTo({
url: '/pages_adminSet/CarModel'
})
},
sub() {
if (this.data.model === undefined || this.data.model === null || this.data.model === '') {
uni.showToast({
title: '请填写车型名称',
icon: 'none',
duration: 2000
});
return; //
}
if (this.data.fullVoltage === undefined || this.data.fullVoltage === null || this.data.fullVoltage ===
'') {
uni.showToast({
title: '请填写满电电压',
icon: 'none',
duration: 2000
});
return;
}
if (this.data.lowVoltage === undefined || this.data.lowVoltage === null || this.data.lowVoltage === '') {
uni.showToast({
title: '请填写亏电电压',
icon: 'none',
duration: 2000
});
return;
}
if (this.data.fullEndurance === undefined || this.data.fullEndurance === null || this.data
.fullEndurance === '') {
uni.showToast({
title: '请填写续航公里数',
icon: 'none',
duration: 2000
});
return;
}
if (this.data.ruleIds.length < 1) {
uni.showToast({
title: '请选择收费模版',
icon: 'none',
duration: 2000
});
return;
}
if (this.modelId) {
this.data.areaId = this.areaId
this.$u.put("/system/model", this.data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '操作成功',
icon: 'none',
duration: 1000
});
setTimeout(() => {
uni.navigateBack()
}, 1200)
}
});
} else {
this.data.areaId = this.areaId
this.$u.post("/system/model", this.data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '操作成功',
icon: 'none',
duration: 1000
});
setTimeout(() => {
uni.navigateBack()
}, 1200)
}
});
}
},
subacc() {
this.showpart = false
console.log(this.chooseIdxArr);
},
chooseAcc(ruleId) {
const index = this.data.ruleIds.indexOf(ruleId);
if (index > -1) {
// ruleId ruleIds
this.data.ruleIds.splice(index, 1);
} else {
// ruleId ruleIds
this.data.ruleIds.push(ruleId);
}
console.log(this.data.ruleIds, ' this.data.ruleIds');
},
getAccessoryNames(accessoryIds) {
// accessoryIds Accessorylist name
// accessoryIds id Accessorylist name
// const accessoryNames = this.data.ruleIds.map(id => {
// console.log(id);
// const item = this.Accessorylist.find(accessory => accessory.ruleId === id);
// return item ? item.name : '';
// });
// // name
// return accessoryNames.filter(name => name).join(', ');
// accessoryIds Accessorylist name
const accessoryNames = this.data.ruleIds.map(id => {
const item = this.Accessorylist.find(accessory => accessory.ruleId === id);
return item ? item.name : '';
});
//
return accessoryNames.filter(name => name);
},
getAccessorylist() {
let data = {
areaId: this.areaId
}
this.$u.get(`/app/fee/list?`, data).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> </script>
<style lang="scss"> <style lang="scss">
page {} page {}
.page { .page {
.choose_part { .choose_part {
position: fixed; position: fixed;
top: 530rpx; top: 50%;
left: 54rpx; left: 50%;
z-index: 110; transform: translate(-50%, -50%);
width: 644rpx; z-index: 110;
padding: 40rpx 48rpx; width: 644rpx;
background: #FFFFFF; padding: 40rpx 48rpx;
border-radius: 26rpx 26rpx 26rpx 26rpx; background: #FFFFFF;
border-radius: 26rpx;
.part_box { .part_box {
margin-top: 40rpx; margin-top: 40rpx;
max-height: 600rpx;
.part_list {
display: flex; display: flex;
flex-wrap: wrap; flex-direction: column;
gap: 20rpx;
.part:nth-child(3n) { .part_item {
margin-right: 0; width: 100%;
} }
.part { .part {
margin-top: 10rpx;
position: relative; position: relative;
margin-right: 36rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
// width: 160rpx; padding: 20rpx;
// height: 60rpx;
padding: 10rpx 20rpx;
background: #F0F0F0; background: #F0F0F0;
border-radius: 6rpx 6rpx 6rpx 6rpx; border-radius: 12rpx;
border: 1rpx solid #F0F0F0; border: 1rpx solid #F0F0F0;
font-weight: 500;
font-size: 32rpx; font-size: 32rpx;
color: #3D3D3D; color: #3D3D3D;
transition: all 0.3s ease;
image { image {
position: absolute; position: absolute;
right: 0; right: 10rpx;
bottom: 0; bottom: 10rpx;
width: 34rpx; width: 34rpx;
height: 34rpx; height: 34rpx;
} }
}
.act { &.act {
background: #DCEDFF;
border: 1rpx solid #4297F3;
color: #4297F3;
}
&:active {
opacity: 0.8;
}
}
}
}
.tit {
width: 100%;
text-align: center;
font-weight: 600;
font-size: 36rpx;
color: #3D3D3D;
margin-bottom: 20rpx;
}
.btn {
margin-top: 40rpx;
width: 100%;
height: 88rpx;
background: #4C97E7;
border-radius: 10rpx;
font-weight: 600;
font-size: 36rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
&:active {
opacity: 0.9;
}
}
}
.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_li1 {
padding-top: 24rpx;
display: flex;
flex-wrap: wrap;
.taocan {
margin-top: 10rpx;
padding-bottom: 20rpx;
display: flex;
flex-wrap: wrap;
.tc_li {
padding: 8rpx 14rpx;
margin-right: 20rpx;
background: #DCEDFF; background: #DCEDFF;
border: 1rpx solid #4297F3; border-radius: 6rpx 6rpx 6rpx 6rpx;
font-weight: 400;
font-size: 26rpx;
color: #4297F3; color: #4297F3;
} }
} }
.tit { .card_top {
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_li1 {
padding-top: 24rpx;
display: flex;
flex-wrap: wrap;
.taocan {
margin-top: 10rpx;
padding-bottom: 20rpx;
display: flex;
flex-wrap: wrap;
.tc_li {
padding: 8rpx 14rpx;
margin-right: 20rpx;
background: #DCEDFF;
border-radius: 6rpx 6rpx 6rpx 6rpx;
font-weight: 400;
font-size: 26rpx;
color: #4297F3;
}
}
.card_top {
display: flex;
flex-wrap: nowrap;
align-content: center;
justify-content: space-between;
width: 100%;
border-bottom: 1rpx solid #D8D8D8;
padding-bottom: 18rpx;
.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;
/* 输入框内容靠右显示 */
}
}
}
}
.card_li {
padding-top: 24rpx;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
align-content: center; align-content: center;
justify-content: space-between; justify-content: space-between;
width: 100%;
border-bottom: 1rpx solid #D8D8D8; border-bottom: 1rpx solid #D8D8D8;
padding-bottom: 18rpx; 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 { .card_left {
font-weight: 400; font-weight: 400;
font-size: 30rpx; font-size: 30rpx;
@ -642,8 +583,77 @@
} }
} }
} }
} }
.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> </style>