chuangte_bike_newxcx/page_shanghu/gongzuotai/sysSet.vue
2025-04-16 09:14:52 +08:00

689 lines
15 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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="tops">
<view class="card_left">
运营区名称
</view>
<view class="card_right">
<input type="text" v-model="form.name" placeholder="运营区名称" class="input"
placeholder-style="color:#C7CDD3">
</view>
</view>
</view>
</view>
<view class="card">
<view class="biaoti">
基础信息
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
状态
</view>
<view class="card_right">
<u-switch v-model="timeflag"></u-switch>
</view>
</view>
<view class="tips">
关闭后用户将不能使用运营区及车辆
</view>
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
实名认证
</view>
<view class="card_right">
<u-switch v-model="form.authentication"></u-switch>
</view>
</view>
<view class="tips">
开启后用户骑行前必须先进行实名认证才可使用
</view>
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
短信通知服务
</view>
<view class="card_right">
<u-switch v-model="form.msgSwitch"></u-switch>
</view>
</view>
<view class="tips">
开启短信通知短信费用0.1元/条,从余额中扣除
</view>
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
运营时间
</view>
<view class="card_right">
</view>
</view>
<view class="tips" style="display: flex;justify-content: space-between;margin-top: 20rpx;align-items: center;">
<u-input :disabled="true" style="margin-right: 10rpx;" v-model="startTime" placeholder="如: 09:00:00" border="none"
@click="showTimePicker('work')"></u-input> —
<u-input :disabled="true" style="margin-left: 10rpx;" v-model="endTime" placeholder="如: 18:00:00" border="none"
@click="showTimePicker('off')"></u-input>
</view>
</view>
<view class="biaoti">
骑行设置
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
靠近边界播报距离
</view>
<view class="card_right">
<input type="number" v-model="form.boundaryDistance" placeholder=" " class="input"
placeholder-style="color:#C7CDD3" style="width: 100rpx;">米
</view>
</view>
<view class="tips" style="text-align: left;">
靠近边界播报距离(米)
</view>
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
运营区外断电距离
</view>
<view class="card_right">
<input type="number" v-model="form.outageDistance" placeholder=" " class="input"
placeholder-style="color:#C7CDD3" style="width: 100rpx;">米
</view>
</view>
<view class="tips" style="text-align: left;">
运营区外断电距离(米)
</view>
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
禁行区内断电
</view>
<view class="card_right">
<u-switch v-model="form.noRidingOutage"></u-switch>
</view>
</view>
<view class="tips">
开启后当进入禁行区内将进行断电
</view>
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
运营区域外断电
</view>
<view class="card_right">
<u-switch v-model="form.areaOutOutage"></u-switch>
</view>
</view>
<view class="tips">
开启后当进入运营区域外内将进行断电
</view>
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
低于电量(%)不得骑行
</view>
<view class="card_right">
<input type="number" v-model="form.undercharge" placeholder=" " class="input"
placeholder-style="color:#C7CDD3" style="width: 100rpx;">%
</view>
</view>
<view class="tips" style="text-align: left;">
当车辆电量低于多少时无法解锁用车
</view>
</view>
<view class="biaoti">
还车设置
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
还车是否拍照审核
</view>
<view class="card_right">
<u-switch v-model="form.returnVerify"></u-switch>
</view>
</view>
<view class="tips">
开启后则需用户拍摄视频后审核订单方可退还押金
</view>
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
强制停车点还车
</view>
<view class="card_right">
<u-switch v-model="form.parkingReturn"></u-switch>
</view>
</view>
<view class="tips">
开启则必须在停车点才可还车,停车点存在误差
</view>
</view>
<view class="card_li" v-if="form.parkingReturn == false">
<view class="tops">
<view class="card_left">
运营区外还车
</view>
<view class="card_right">
<u-switch v-model="form.areaOutReturn"></u-switch>
</view>
</view>
<view class="tips">
开启后可以在运营区范围外还车
</view>
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
运营区外调度费
</view>
<view class="card_right">
<input type="number" v-model="form.dispatchFee" placeholder=" " class="input"
placeholder-style="color:#C7CDD3" style="width: 100rpx;">元
</view>
</view>
<view class="tips" style="text-align: left;">
设置车辆超出运营区外产生的调度费用
</view>
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
停车点外调度费
</view>
<view class="card_right">
<input type="number" v-model="form.vehicleManagementFee" placeholder=" " class="input"
placeholder-style="color:#C7CDD3" style="width: 100rpx;">元
</view>
</view>
<view class="tips" style="text-align: left;">
设置车辆超出停车点外产生的调度费用
</view>
</view>
<view class="card_li">
<view class="tops">
<view class="card_left">
还车误差
</view>
<view class="card_right">
<input type="number" v-model="form.error" placeholder=" " class="input"
placeholder-style="color:#C7CDD3" style="width: 100rpx;">米
</view>
</view>
<view class="tips" style="text-align: left;">
允许用户在规划的停车点外多少米还车
</view>
</view>
<!-- <view class="card_li" @click="toMap()">
<view class="tops">
<view class="card_left">
电子围栏设置
</view>
<view class="card_right">
<view class="iconfont icon-xiangyou1">
</view>
</view>
</view>
<view class="tips" style="text-align: left;">
设置车辆可以正常行驶的区域
</view>
</view> -->
</view>
<!-- 时间选择器 -->
<u-picker v-model="showTimeSelect" mode="time" @confirm="timeConfirm" :params="params"
:default-time='00'></u-picker>
<view class="btn_box">
<view class="btn1" @click="backpage()">
取消
</view>
<view class="btn2" @click="sub">
保存
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
bgc: {
backgroundColor: "#fff",
},
list: [],
form: {
},
deptInfo: {},
areaId: '',
customServices: [],
params: {
year: false,
month: false,
day: false,
hour: true,
minute: true,
second: true
},
showTimeSelect: false,
timeType: "work", // work or off
startTime:'',
endTime:'',
timeflag:false
}
},
onLoad(e) {
},
onShow() {
if (uni.getStorageSync('adminAreaid')) {
this.areaId = uni.getStorageSync('adminAreaid')
}
this.getAreaInfo()
// this.getdept()
},
methods: {
// 显示时间选择器
showTimePicker(type) {
this.timeType = type
this.showTimeSelect = true
},
// 时间选择确认
timeConfirm(e) {
const time = `${e.hour}:${e.minute}:${e.second}`
if (this.timeType === 'work') {
this.startTime = time
} else {
this.endTime = time
}
},
toMap(){
uni.navigateTo({
url:'/page_shanghu/guanli/msp_set?areaId='+this.areaId
})
},
addService() {
if (this.customServices.length < 3) {
this.customServices.push({
name: "",
phone: ""
});
}
},
removeService(index) {
if (index > 0 && this.customServices.length > 1) {
this.$delete(this.customServices, index);
this.$set(this.form, `serviceName${index + 1}`, "");
this.$set(this.form, `servicePhone${index + 1}`, "");
}
},
getAreaInfo() {
this.$u.get(`/bst/area/${this.areaId}`).then((res) => {
if (res.code == 200) {
this.form = res.data
this.form.ruleIds = res.ruleIds
this.startTime = res.data.areaTimeStart
this.endTime = res.data.areaTimeEnd
if(res.data.status == 1){
this.timeflag = false
}else if(res.data.status == 0){
this.timeflag = 1
}
// 初始化 customServices 数组
this.customServices = [];
for (let i = 1; i <= 3; i++) {
if (
res.data[`serviceName${i}`] ||
res.data[`servicePhone${i}`]
) {
this.customServices.push({
name: res.data[`serviceName${i}`] || "",
phone: res.data[`servicePhone${i}`] || "",
});
}
}
// 如果 customServices 为空,添加一个默认的服务
if (this.customServices.length === 0) {
this.customServices.push({
name: "",
phone: ""
});
}
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
},
backpage() {
uni.navigateBack()
},
// 选中任一radio时由radio-group触发
radioGroupChange(e) {
console.log(e);
if (e == '按分钟') {
this.data.rentalUnit = 'minutes'
} else {
this.data.rentalUnit = 'hours'
}
},
sub() {
let data = {
...this.form,
areaTimeStart:this.startTime,
areaTimeEnd:this.endTime,
status:this.timeflag == true ? '0' : '1'
}
this.$u.put(`/bst/area`, data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '保存成功',
icon: 'success',
duration: 1000
});
setTimeout(() => {
uni.navigateBack()
}, 1100)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 1000
})
}
})
}
}
}
</script>
<style lang="scss">
page {}
.page {
padding-bottom: 300rpx;
.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;
padding: 4rpx 8rpx;
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;
z-index: 100;
.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;
.biaoti{
font-size: 32rpx;
font-weight: 600;
padding-top: 30rpx;
box-sizing: border-box;
color: #4C97E7;
}
.card_li:last-child {
border-bottom: 1rpx solid #fff;
}
.tips {
width: 100%;
// text-align: right;
font-weight: 400;
font-size: 22rpx;
color: #999;
}
.card_li {
width: 100%;
padding-top: 24rpx;
display: flex;
flex-wrap: wrap;
// align-content: center;
// justify-content: space-between;
border-bottom: 1rpx solid #D8D8D8;
padding-bottom: 18rpx;
.rule {
display: flex;
flex-wrap: wrap;
align-items: center;
font-weight: 400;
font-size: 30rpx;
color: #3D3D3D;
.input {
margin-left: 6rpx;
margin-right: 6rpx;
padding: 6rpx;
border: 1rpx solid #ccc;
border-radius: 20rpx;
width: 250rpx;
}
.btns1 {
margin-left: auto;
padding: 10rpx 20rpx;
background: #DCEDFF;
border-radius: 6rpx 6rpx 6rpx 6rpx;
font-weight: 400;
font-size: 30rpx;
color: #4297F3;
}
.btns2 {
margin-left: auto;
padding: 10rpx 20rpx;
background: #FFDBDB;
border-radius: 6rpx 6rpx 6rpx 6rpx;
font-weight: 400;
font-size: 30rpx;
color: #FF1C1C;
}
}
.tops {
width: 100%;
display: flex;
flex-wrap: nowrap;
align-items: center;
.card_left {
font-weight: 400;
font-size: 30rpx;
color: #333;
font-weight: 600;
}
.card_right {
margin-left: auto;
display: flex;
flex-wrap: nowrap;
align-items: center;
color: #000;
span {
font-weight: 400;
font-size: 30rpx;
color: #000;
}
.input {
height: 60rpx;
line-height: 60rpx;
padding-left: 20rpx;
box-sizing: border-box;
margin-right: 10rpx;
border: 1rpx solid #ccc;
border-radius: 20rpx;
width: 400rpx;
text-align: left;
/* 输入框内容靠右显示 */
}
}
}
}
}
}
</style>