Browse Source

bug修复

郭宇琦 1 week ago
parent
commit
2a54f2b90d

+ 0 - 1
pages/activation/activation.css

@@ -36,7 +36,6 @@
 	border-radius: 40rpx;
 	border-radius: 40rpx;
 	padding-top: 12rpx;
 	padding-top: 12rpx;
 	padding-bottom: 12rpx;
 	padding-bottom: 12rpx;
-	width: 208rpx;
 	text-align: center;
 	text-align: center;
 }
 }
 
 

+ 137 - 21
pages/activation/activation.vue

@@ -1,10 +1,9 @@
 <template>
 <template>
 	<view class="">
 	<view class="">
-		<navBar name="我的订单" left="0"></navBar>
+		<navBar name="车辆激活" left="0"></navBar>
 		<view class="container-view">
 		<view class="container-view">
 			<view class="return-info">
 			<view class="return-info">
 				<view class="h5">车辆信息</view>
 				<view class="h5">车辆信息</view>
-		
 				<view v-if="overdueMoney" class="return-top  flex-row flex-between">
 				<view v-if="overdueMoney" class="return-top  flex-row flex-between">
 					<view style="align-items: baseline;" class="flex-row">逾期费用:
 					<view style="align-items: baseline;" class="flex-row">逾期费用:
 						<allPrice :amount="(overdueMoney/100)" />
 						<allPrice :amount="(overdueMoney/100)" />
@@ -13,6 +12,9 @@
 				<view class="return-top  flex-row flex-between">
 				<view class="return-top  flex-row flex-between">
 					<view>车辆编号:{{car_sn}}</view>
 					<view>车辆编号:{{car_sn}}</view>
 				</view>
 				</view>
+				<view v-if="carInfoData.license_plate_number" class="return-top  flex-row flex-between">
+					<view>车牌号:{{carInfoData.license_plate_number}}</view>
+				</view>
 				<view class="return-top  flex-row flex-between">
 				<view class="return-top  flex-row flex-between">
 					<view>车辆名称:{{carInfoData.car_name}}</view>
 					<view>车辆名称:{{carInfoData.car_name}}</view>
 				</view>
 				</view>
@@ -20,14 +22,17 @@
 					<view>车型:{{carInfoData.model_name}}</view>
 					<view>车型:{{carInfoData.model_name}}</view>
 				</view>
 				</view>
 				<view class="return-top  flex-row flex-between">
 				<view class="return-top  flex-row flex-between">
-					<view>续航:{{carInfoData.endurance}}m</view>
+					<view>续航:{{(carInfoData.endurance / 2).toFixed(2)}}km</view>
 				</view>
 				</view>
 				<view class="return-top  flex-row flex-between">
 				<view class="return-top  flex-row flex-between">
-					<view>重量:{{carInfoData.weight}}kg</view>
+					<view>重量:{{(carInfoData.weight / 100).toFixed(2)}}kg</view>
 				</view>
 				</view>
 				<view class="return-top  flex-row ">
 				<view class="return-top  flex-row ">
 					<view>照片:</view>
 					<view>照片:</view>
-					<image class="img" :src="carInfoData.model_images" mode="aspectFill"></image>
+					<view style="display: flex;align-items: center;" class="">
+						<image style="margin-right: 10rpx;" v-for="(item,index) of carInfoData.model_images"
+							:key="index" class="img" :src="item" mode="aspectFill"></image>
+					</view>
 				</view>
 				</view>
 			</view>
 			</view>
 			<view v-if="shopInfo.shop_name" class="return-info">
 			<view v-if="shopInfo.shop_name" class="return-info">
@@ -40,21 +45,28 @@
 				</view>
 				</view>
 			</view>
 			</view>
 			<view class="pictures-info">
 			<view class="pictures-info">
-				<view>车辆照片</view>
+				<view>上传照片</view>
 				<!-- <view>这里是关于激活车辆照片的文案描述,这里是关于激活车辆照片的文案描述</view> -->
 				<!-- <view>这里是关于激活车辆照片的文案描述,这里是关于激活车辆照片的文案描述</view> -->
-				<uploaders :max="Number(shopList.flk_hire_car_img_num)" :car_info="car_imgs"
-					@update-car-images="handleCarImagesUpdate"></uploaders>
+				<!-- <uploaders :max="Number(shopList.flk_hire_car_img_num)" :car_info="car_imgs"
+					@update-car-images="handleCarImagesUpdate"></uploaders> -->
+
+
+				<view class="list-group">
+					<view class="list-item" @click="bindUpImg(index)" @longpress="bindDelImage(index)" :data-idx="index" v-for="(item, index) in shopList.flk_hire_return_car_img"
+						:key="item.unique">
+						<image v-if="!item.imgUrl"  class="img-item-demo" :src="item.url"></image>
+						<image v-else class="img-item" :src="item.imgUrl" mode="aspectFill"></image>
+						<view class="img_text">{{ item.title? item.title : '车辆照片'}}</view>
+						<view v-if="!item.imgUrl" class="empity-item">+</view>
+					</view>
+				</view>
 				<view v-if="isReturnCar" @tap="submitReturn" class="pictures-btn">归还车辆</view>
 				<view v-if="isReturnCar" @tap="submitReturn" class="pictures-btn">归还车辆</view>
 				<view v-else @tap="submitEnabled" class="pictures-btn">激活车辆</view>
 				<view v-else @tap="submitEnabled" class="pictures-btn">激活车辆</view>
 			</view>
 			</view>
-		
 			<PayTypeModel @closeShow="()=>isShowToBuy=false" @payToOrder="payToOrder" :free_price="totalPrice"
 			<PayTypeModel @closeShow="()=>isShowToBuy=false" @payToOrder="payToOrder" :free_price="totalPrice"
 				:isShowToBuy="isShowToBuy" />
 				:isShowToBuy="isShowToBuy" />
 		</view>
 		</view>
-		
 	</view>
 	</view>
-	
-
 </template>
 </template>
 
 
 <script>
 <script>
@@ -66,6 +78,7 @@
 	const common = require('@/common/common.js');
 	const common = require('@/common/common.js');
 	import PayTypeModel from '@/component/payTypeModel/payTypeModel';
 	import PayTypeModel from '@/component/payTypeModel/payTypeModel';
 	import allPrice from '@/component/allPrice/allPrice';
 	import allPrice from '@/component/allPrice/allPrice';
+	import upload from '@//component/uploaders/upload.js.js';
 	export default {
 	export default {
 		components: {
 		components: {
 			uploaders,
 			uploaders,
@@ -74,6 +87,7 @@
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
+				imgList:[],
 				totalPrice: 0,
 				totalPrice: 0,
 				isShowToBuy: false,
 				isShowToBuy: false,
 				myLocation: {},
 				myLocation: {},
@@ -101,7 +115,6 @@
 		 */
 		 */
 		onLoad: function(options) {
 		onLoad: function(options) {
 			this.locationFn()
 			this.locationFn()
-			console.log(options, 'options');
 			this.isReturnCar = options.isReturnCar
 			this.isReturnCar = options.isReturnCar
 			if (options.isReturnCar) {
 			if (options.isReturnCar) {
 				uni.setNavigationBarTitle({
 				uni.setNavigationBarTitle({
@@ -136,6 +149,33 @@
 		onShow: function() {},
 		onShow: function() {},
 		onUnload: function() {},
 		onUnload: function() {},
 		methods: {
 		methods: {
+			async bindDelImage(index){
+				let res = await uni.showModal({
+					title: '提示',
+					content: '你确定要删除吗?',
+					showCancel: true,
+				})
+				if (res[1].confirm) {
+					this.shopList.flk_hire_return_car_img[index].imgUrl = ''
+					this.$forceUpdate()
+				}
+			},
+			async bindUpImg(index) {
+				let res = await uni.chooseImage({
+					count: 1,
+				})
+				if(res[1]){
+					const imgList = res[1].tempFilePaths
+					let data = await upload.uploadFile(imgList)
+					this.shopList.flk_hire_return_car_img[index].imgUrl = data[0].url
+					this.$forceUpdate()
+					// this.imgList = this.imgList.concat(data)
+					// this.updateImages(this.imgList)
+				}
+			},	
+			
+			
+			
 			async payToOrder(pay_type) {
 			async payToOrder(pay_type) {
 				let milliseconds = new Date().getTime();
 				let milliseconds = new Date().getTime();
 				const current_time = this.overdueTime ? this.overdueTime : parseInt(milliseconds / 1000);
 				const current_time = this.overdueTime ? this.overdueTime : parseInt(milliseconds / 1000);
@@ -177,17 +217,20 @@
 			},
 			},
 			//还车
 			//还车
 			async submitReturn() {
 			async submitReturn() {
-				this._image_list = this.car_imgs.map(item => {
-					return item.url
+				let _image_list = this.shopList.flk_hire_return_car_img.map(item => {
+					return item.imgUrl
 				})
 				})
-				if (this._image_list.length < 1) return common.simpleToast('请上传车辆照片')
+				 _image_list = _image_list.filter(item=> {
+					if(item){
+						return item
+					}
+				})
+				if (_image_list.length < this.shopList.flk_hire_return_car_img.length) return common.simpleToast('请上传车辆照片')
 				if (this.totalPrice > 0) {
 				if (this.totalPrice > 0) {
 					this.isShowToBuy = true
 					this.isShowToBuy = true
 				} else {
 				} else {
 					this.payToOrder(1)
 					this.payToOrder(1)
 				}
 				}
-
-
 			},
 			},
 			async shopInfoFn() {
 			async shopInfoFn() {
 				let res = await uni.getLocation()
 				let res = await uni.getLocation()
@@ -227,6 +270,7 @@
 					car_sn: this.car_sn
 					car_sn: this.car_sn
 				})
 				})
 				if (data.code == 200) {
 				if (data.code == 200) {
+					data.data.model_images = data.data.model_images.split(',') || []
 					this.carInfoData = data.data
 					this.carInfoData = data.data
 				} else {
 				} else {
 					common.simpleToast(data.msg)
 					common.simpleToast(data.msg)
@@ -239,8 +283,13 @@
 
 
 			submitEnabled() {
 			submitEnabled() {
 				const me = this
 				const me = this
-				const _image_list = this.car_imgs.map(item => item.url)
-				if (_image_list.length < 1) return common.simpleToast('请上传车辆照片')
+				let _image_list =this.shopList.flk_hire_return_car_img.map(item => item.imgUrl)
+				_image_list = _image_list.filter(item=> {
+					if(item){
+						return item
+					}
+				})
+				if (_image_list.length < this.shopList.flk_hire_return_car_img.length) return common.simpleToast('请上传车辆照片')
 				const pData = {
 				const pData = {
 					car_sn: this.car_sn,
 					car_sn: this.car_sn,
 					sub_sn: this.sub_sn,
 					sub_sn: this.sub_sn,
@@ -263,6 +312,73 @@
 	};
 	};
 </script>
 </script>
 
 
-<style>
+<style scoped>
 	@import './activation.css';
 	@import './activation.css';
+	.list-group {
+	    display: flex;
+	    flex-direction: row;
+	    justify-content: flex-start;
+	    flex-wrap: wrap;
+	}
+	
+	.list-item {
+		width: 200rpx;
+		height: 200rpx;
+		background-color: #F4F5F6;
+		border-radius: 16rpx;
+		display: flex;
+		flex-direction: column;
+	    margin-right: 9rpx;
+	    margin-bottom: 10rpx;
+		position: relative;
+		align-items: center;
+	}
+	
+	.img-item {
+	    width: 200rpx;
+	    height: 200rpx;
+	    background-color: #fff;
+		border-radius: 16rpx;
+	}
+	.img-item-demo {
+	    width: 200rpx;
+	    height: 200rpx;
+	    background-color: #fff;
+		border-radius: 16rpx;
+		/* 翻转图片的颜色 */
+		filter: invert(30%); 
+		opacity: 0.8;
+	}
+	
+	
+	
+	.empity-item {
+		position: absolute;
+		/* #ifdef MP-ALIPAY */
+		top: 0.7rem;
+		left: 0.5rem;
+		/* #endif */
+		/* #ifdef MP-WEIXIN */
+		top: 10rpx;
+		left: 48rpx;
+		/* #endif */
+	
+	    color: #e6e6e6;
+	    font-size: 120rpx;
+	    text-align: center;
+	}
+	
+	.img_text {
+	    font-family: PingFangSC, PingFang SC;
+	    font-weight: 500;
+	    font-size: 24rpx;
+	    color: #fff;
+	    line-height: 24rpx;
+	    /* text-align: center; */
+	    font-style: normal;
+	    /* text-align: center; */
+	    position: absolute;
+	    bottom: 17rpx;
+	    /* left: 73rpx; */
+	}
 </style>
 </style>

+ 2 - 3
pages/batteryDetail/batteryDetail.vue

@@ -13,18 +13,17 @@
 					<view class="battery-info-text">剩余电量</view>
 					<view class="battery-info-text">剩余电量</view>
 				</view>
 				</view>
 				<view class="battery-device-info">
 				<view class="battery-device-info">
-					<view class="quantity-info">{{item.voltage || 0}}<text class="quantity-text-1">%</text></view>
+					<view class="quantity-info">{{(item.voltage).toFixed(2) || 0}}<text class="quantity-text-1"></text></view>
 					<view class="battery-info-text">电压</view>
 					<view class="battery-info-text">电压</view>
 				</view>
 				</view>
 				<view class="battery-device-info">
 				<view class="battery-device-info">
-					<view class="quantity-info">{{item.battery_temp || 0}} <text class="quantity-text-1">%</text></view>
+					<view class="quantity-info">{{item.battery_temp[0] || 0}} <text class="quantity-text-1">℃</text></view>
 					<view class="battery-info-text">温度</view>
 					<view class="battery-info-text">温度</view>
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
-
 <script>
 <script>
 	const http = require('../../common/request.js');
 	const http = require('../../common/request.js');
 	const config = require('../../common/config_gyq.js');
 	const config = require('../../common/config_gyq.js');

+ 1 - 1
pages/batteryRecord/batteryRecord.vue

@@ -91,7 +91,7 @@
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
 	.car-model-text{
 	.car-model-text{
-		width: 260rpx;
+		max-width: 260rpx;
 		text-overflow: ellipsis;
 		text-overflow: ellipsis;
 		overflow: hidden;
 		overflow: hidden;
 		white-space: nowrap;
 		white-space: nowrap;

+ 1 - 1
pages/index/index.css

@@ -32,7 +32,7 @@
 	align-items: baseline;
 	align-items: baseline;
 }
 }
 .car-name-view .text{
 .car-name-view .text{
-	width: 200rpx;
+	max-width: 200rpx;
 	white-space: nowrap;
 	white-space: nowrap;
 	text-overflow: ellipsis;
 	text-overflow: ellipsis;
 	overflow: hidden;
 	overflow: hidden;

+ 1 - 1
pages/order/order.css

@@ -16,7 +16,7 @@
 	color: #060809;
 	color: #060809;
 }
 }
 .car-model-text{
 .car-model-text{
-	width: 260rpx;
+	max-width: 260rpx;
 	text-overflow: ellipsis;
 	text-overflow: ellipsis;
 	overflow: hidden;
 	overflow: hidden;
 	white-space: nowrap;
 	white-space: nowrap;

+ 14 - 3
pages/order/order.vue

@@ -1,8 +1,8 @@
 <template>
 <template>
 	<view class="container-view">
 	<view class="container-view">
-		<navBar name="我的订单" left="0" ></navBar>
-		<view class="order-type-view flex-row flex-between">
-			<view v-if="car_info.car_sn" @click="srcFn(`/pages/carList/carList`)" class="car-model-list flex-row">
+		<navBar name="我的订单" ></navBar>
+		<view v-if="selectOrderType == 0" class="order-type-view flex-row flex-between">
+			<view v-if="car_info.car_sn && selectOrderType == 0" @click="srcFn(`/pages/carList/carList`)" class="car-model-list flex-row">
 				<view class="car-model-text">{{car_info.car_name}}</view><img class="right-corner-icon"
 				<view class="car-model-text">{{car_info.car_name}}</view><img class="right-corner-icon"
 					src="https://qiniu.bms16.com/Fqs6TrEmcdT7QNEdKWs9Hir2cacO" alt="">
 					src="https://qiniu.bms16.com/Fqs6TrEmcdT7QNEdKWs9Hir2cacO" alt="">
 			</view>
 			</view>
@@ -17,6 +17,17 @@
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
+		<view v-if="selectOrderType == 1" class="order-type-view flex-row flex-between">
+			<view style="justify-content: space-around;width: 100%;" class="order-package-type-view flex-row">
+				<view style="width: 128rpx;" v-for="(type, index) in orderTypes" :key="index" @tap="checkOrderType" :data-type="type.value"
+					:class="['package-type-list', 'flex-row', {'package-type-list-i': selectOrderType === type.value}]"
+					>
+					<view class="package-type-text">{{ type.text }}</view>
+					<img v-if="selectOrderType === type.value" class="right-button-icon"
+						src="https://qiniu.bms16.com/FmcoAVgWvyK44iPjK0phkDRU21i0" alt="">
+				</view>
+			</view>
+		</view>
 		<view v-for="(item, index) of hireOrderList" :key="index" @tap="loadToNav" :data-sub_sn="item.sub_sn"
 		<view v-for="(item, index) of hireOrderList" :key="index" @tap="loadToNav" :data-sub_sn="item.sub_sn"
 			class="order-card">
 			class="order-card">
 			<view class="card-top flex-row">
 			<view class="card-top flex-row">

+ 1 - 1
pages/orderStatus/orderStatus.vue

@@ -141,7 +141,7 @@
 				<view>
 				<view>
 					<view class="top-flex">
 					<view class="top-flex">
 						<view>{{orderInfo.model_name}}</view>
 						<view>{{orderInfo.model_name}}</view>
-						<view>续航{{(orderInfo.endurance /100).toFixed(0)}}km|重量{{(orderInfo.weight / 1000).toFixed(0)}}kg</view>
+						<view>续航{{(orderInfo.endurance /1000).toFixed(0)}}km|重量{{(orderInfo.weight / 1000).toFixed(0)}}kg</view>
 					</view>
 					</view>
 					<!-- //配套服务 -->
 					<!-- //配套服务 -->
 					<view class="serviceList">
 					<view class="serviceList">