liuwei 1 天之前
父節點
當前提交
f4118567ca

+ 8 - 2
common/params.js

@@ -8,8 +8,14 @@ module.exports = {
 
 	api_web_url: 'https://dev.bms16.com/new_energy/server/api/web/',
 	up_img_url: 'https://dev.bms16.com/new_energy/server/api/web/',
-	gps_url: 'https://dev.bms16.com/new_energy/server/api/web/',
-	map_url: 'https://mapdev.bms16.com/'
+	gps_url: 'https://dev.bms16.com/new_energy/server/gps/web/',
+	map_url: 'https://mapdev.bms16.com/',
+	
+	//海外
+	// api_web_url: 'https://api.app.zxbms16.com/new_energy/server/api/web/',
+	// up_img_url: 'https://api.app.zxbms16.com/new_energy/server/api/web/',
+	// gps_url: 'https://api.app.zxbms16.com/new_energy/server/gps/web/',
+	// map_url: 'https://mapdev.bms16.com/'
 
 	// 预发布
 	// api_web_url: 'https://pre.bms16.com/new_energy/server/api/web/',

+ 4 - 1
locale/en.json

@@ -859,5 +859,8 @@
 	"购买时间":"Buy Time",
 	"¥": "$",
 	"当前电池存在未知型号,请联系门店处理!":"The current battery is of an unknown model. Please contact the store for assistance!",
-	"正在加载数据":"Loading"
+	"正在加载数据":"Loading",
+	"敬请期待下次更新!":"Coming soon",
+	"您不是车主,不能进行此操作":"You are not the car owner and cannot perform this operation",
+	"暂无套餐":"No plan available"
 }

+ 5 - 1
locale/zh.json

@@ -859,5 +859,9 @@
 	"购买时间":"购买时间",
 	"¥": "¥",
 	"当前电池存在未知型号,请联系门店处理!":"当前电池存在未知型号,请联系门店处理!",
-	"正在加载数据":"正在加载数据"
+	"正在加载数据":"正在加载数据",
+	"敬请期待下次更新!":"敬请期待下次更新!",
+	"您不是车主,不能进行此操作":"您不是车主,不能进行此操作",
+	"暂无套餐":"暂无套餐"
+	
 }

+ 3 - 0
pages/index/components/control/control.css

@@ -14,6 +14,9 @@
 	/* background-color: #fff; */
 	/* border-radius: 50%; */
 	/* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
+	
+}
+.contril-item-z{
 	margin: 20rpx;
 }
 .contril-item-e,

+ 5 - 5
pages/index/components/control/control.vue

@@ -1,11 +1,11 @@
 <template>
     <view class="container-view-contril">
 		<scroll-view class="scroll-view flex-row" scroll-x="true">
-			<view @tap="tapOpen" v-for="(item,index) of contrilList" :key="index" :data-item="item" class="contril-item flex-row">
+			<view @tap="tapOpen" v-for="(item,index) of contrilList" :key="index" :data-item="item" :class="['contril-item' ,'flex-row',Language=='en'?'contril-item-e':'contril-item-z']">
 				<img class="contril-item-img"  :src="isOverdueShow?item.disableUrl:(item.isTurnOn==0?item.offUrl:item.iconUrl)" alt="">
 				<text >{{item.name}}</text>
 			</view>
-			<view class="contril-item flex-row" @tap="toMoreFunctionSet">
+			<view v-if="!isOverdueShow" :class="['contril-item' ,'flex-row',Language=='en'?'contril-item-e':'contril-item-z']" @tap="toMoreFunctionSet">
 				<img class="contril-item-img" src="https://qiniu.bms16.com/Ft3pNyStT22LP8Ds1Mru2LoTHadx" alt="">
 				<text>{{$t("更多功能")}}</text>
 			</view>
@@ -21,9 +21,9 @@
 				
 			<!-- <custom-switch :defaultPosition="'right'" :width="'400rpx'" 
 			    :height="'96rpx'"  v-model="switchValue" :fetchData="loadData"></custom-switch> -->
-			<view v-if="authority_list.indexOf(5) == -1" @tap="navToInputPages" class="car-change-battery flex-row">
-				<view class="car-change-btn"><image style="width: 80rpx;height: 80rpx;" src="https://qiniu.bms16.com/FgvnT-msLbL5RHjl6fvNlM0kab5N" mode=""></image></view>
-				<view class="car-change-text">{{ $t('车辆换电') }}</view>
+			<view  @tap="navToInputPages" class="car-change-battery flex-row">
+				<view class="car-change-btn"><image :style="{width:' 80rpx',height: '80rpx',opacity:car_detail.is_share==1&&car_detail.authority_list.indexOf(5) != -1?0.5:1}" src="https://qiniu.bms16.com/FgvnT-msLbL5RHjl6fvNlM0kab5N" mode=""></image></view>
+				<view :style="{opacity:car_detail.is_share==1&&car_detail.authority_list.indexOf(5) != -1?0.5:1}" class="car-change-text">{{ $t('车辆换电') }}</view>
 			</view>
 		</view>
 		<view v-if="popupControlShow" class="show-modal">

+ 3 - 1
pages/index/index.css

@@ -76,9 +76,11 @@
 .card-right{
 	flex-grow: 1;
 	height: 100%;
-	margin-left:20rpx;
 	display: flex;
+}
+.card-right-i{
 	flex-direction: column;
+	margin-left:20rpx;
 }
 .card-top-title{
 	margin-bottom: 20rpx;

+ 41 - 19
pages/index/index.vue

@@ -89,11 +89,10 @@
 					</view>
 					<Control :contrilList="contrilList" :isConnectBlueth="isConnectBlueth" @toBluetooth="inductiveUnlockHandle" @loadCarDetail="loadCarDetail" :isOverdueShow="isOverdueShow"/>
 					
+					<view :class="['flex-row', 'flex-between', 'map-card-view',(car_info.is_share=='1'&&car_info.authority_list.indexOf('4') != -1)?'height_362':'height_260']">
+						<MapCard v-if="(car_info.is_share=='1'&&car_info.authority_list.indexOf('4') != -1)" :isShowReturnCar='isShowReturnCar' :car_info="car_info" :height="(car_info.is_share=='1'&&car_info.authority_list.indexOf('4') != -1)"/>
 			
-					<view :class="['flex-row', 'flex-between', 'map-card-view',car_info.exchange_package_info && car_info.exchange_package_info.activity_time?'height_362':'height_260']">
-						<MapCard :isShowReturnCar='isShowReturnCar' :car_info="car_info" :height="!!(car_info.exchange_package_info && car_info.exchange_package_info.activity_time)"/>
-			
-						<view class="card-right">
+						<view :class="['card-right',(car_info.is_share=='1'&&car_info.authority_list.indexOf('4') != -1)?'card-right-i':'']">
 							<view class="card-bg" @tap="navTravelingTrack">
 								<view class="flex-row flex-between card-top-title">
 									<view class="flex-row align-center">
@@ -108,22 +107,28 @@
 								<view class="card-top-text">{{isTrackOrAll?car_info.current_mail:car_info.total_mil}}<text class="font_24">km</text>
 								</view>
 							</view>
-			
-							<view v-if="car_info.exchange_package_info && car_info.exchange_package_info.activity_time" class="card-bg">
+							<view :style="{'margin-left':(car_info.is_share=='1'&&car_info.authority_list.indexOf('4') != -1)?'0':'20rpx'}" class="card-bg">
 								<view class="flex-row card-top-title">
 									<img style="width: 36rpx;height: 36rpx;"
 										src="https://qiniu.bms16.com/FtalApKa3STyruaBxxRB4O9hHXyE" alt="">
 									<text class="margin_l_8">{{$t("换电套餐")}}</text>
 								</view>
-								<view v-if="car_info.package_type == 1" class="card-top-text">
-									{{calculateRemainingDays(car_info.exchange_package_info.expire_time)}} <text
-										class="font_24">{{$t("天")}}</text>
+								<view v-if="car_info.exchange_package_info">
+									<view v-if="car_info.exchange_package_info.package_type == 1" class="card-top-text">
+										{{calculateRemainingDays(car_info.exchange_package_info.expire_time)}} <text
+											class="font_24">{{$t("天")}}</text>
+									</view>
+									<view v-if="car_info.exchange_package_info.package_type == 2" class=" card-top-text">{{item.last_num}} <text
+											class="font_24">{{$t("次")}}</text></view>
+									<view v-if="car_info.exchange_package_info.package_type == 3" class=" card-top-text">
+										{{item.total_day}}{{$t("天")}}/{{item.last_num}} <text
+											class="font_24">{{$t("次")}}</text>
+									</view>
 								</view>
-								<view v-if="car_info.package_type == 2" class=" card-top-text">{{item.last_num}} <text
-										class="font_24">{{$t("次")}}</text></view>
-								<view v-if="car_info.package_type == 3" class=" card-top-text">
-									{{item.total_day}}{{$t("天")}}/{{item.last_num}} <text
-										class="font_24">{{$t("次")}}</text>
+								<view v-else>
+									<view style="font-size: 25rpx;">
+										{{$t('暂无套餐')}}
+									</view>
 								</view>
 							</view>
 						</view>
@@ -131,10 +136,10 @@
 					<!-- <custom-switch :defaultPosition="'right'" :width="'400rpx'"
 					    :height="'96rpx'"  v-model="switchValue" :fetchData="loadData"></custom-switch> -->
 					<view class="config-view">
-						<view @tap="navToPage" class="flex-row config-car-view">
+						<view @tap="inductiveUnlockHandle" class="flex-row config-car-view">
 							<view class="margin_r_20"><img class="icon_style_64"
 									src="https://qiniu.bms16.com/Ftzyvs5whxDdMFksYChHaWKVb0Uk" alt=""></view>
-							<view class="flex-row config-text-view" @tap="inductiveUnlockHandle">
+							<view class="flex-row config-text-view" >
 								<view class="flex-row font_w_600">{{$t("感应解锁")}}</view>
 								<view class="flex-row tip-text-config">{{isBluethConnect?$t("蓝牙配对成功"):$t("请先连接蓝牙")}}
 								</view>
@@ -142,7 +147,7 @@
 							<img class="icon_style_28" src="https://qiniu.bms16.com/FqnbZ2iKHmzCGJA8XD30sf5g_CAm"
 								alt="">
 						</view>
-						<view @tap="navToPage" data-url="/pages/userManagement/userManagement"
+						<view @tap="navToUserPage" data-url="/pages/userManagement/userManagement"
 							class="flex-row config-car-view">
 							<view class="margin_r_20"><img class="icon_style_64"
 									src="https://qiniu.bms16.com/FhKkijkN__9UzhYNgamBFSggIlYo" alt=""></view>
@@ -246,7 +251,19 @@
 				isConnectBlueth:false
 			};
 		},
-		computed: {},
+		computed: {
+			isShowMap(){
+				const {exchange_package_info,authority_list,is_share}=this.car_info
+				console.log(is_share=='1',authority_list,authority_list.indexOf(4) != -1,'123');
+				//false 表示有地图
+				return is_share=='1'&&authority_list.indexOf(4) != -1
+			},
+			isShowBatteryChange(){
+				const {exchange_package_info,authority_list,is_share}=this.car_info
+				return exchange_package_info && (exchange_package_info.activity_time!=0) &&is_share=='1'&&authority_list.indexOf(5) != -1
+			},
+			
+		},
 		components: {
 			Control,
 			MapCard,
@@ -406,6 +423,7 @@
 			},
 			inductiveUnlockHandle() {
 				
+				common.simpleToast(this.$t('敬请期待下次更新!'));
 				// uni.navigateTo({ url: '/pages/bluetoothUnlock/bluetoothPair' })
 				
 				// console.log(!this.isOpenAllPermission,this.isBluethConnect,'this.isBluethConnect');
@@ -455,12 +473,16 @@
 					url: url
 				});
 			},
-			navToPage(e) {
+			navToUserPage(e) {
 				const me = this
 				const url = e.currentTarget.dataset.url;
 				if (!url) {
 					return;
 				}
+				if(this.car_info.is_share==1){
+					common.simpleToast(this.$t('您不是车主,不能进行此操作'));
+					return 
+				}
 				uni.navigateTo({
 					url: url
 				});

+ 2 - 0
pages/powerSetting/powerSetting.vue

@@ -140,6 +140,7 @@
 				let {
 					data
 				} = await http.postApi(config.API_FLK_CAR_ADD_SHARE_USER, this.form)
+				uni.hideLoading()
 				if (data.code == 200) {
 					msg(this.$t('添加成功!'))
 					setTimeout(() => {
@@ -148,6 +149,7 @@
 						})
 					}, 800)
 				} else {
+
 					msg(data.msg)
 				}
 			},

+ 1 - 1
utils/util.js

@@ -3,7 +3,7 @@ import duration from 'dayjs/plugin/duration'
 dayjs.extend(duration);
 const systemInfo = uni.getSystemInfoSync();
 // const Language = (systemInfo.language == 'zh-CN' || systemInfo.language == 'zh_CN') ? 'zh' : 'en' // 'zh' | 'en'
-const Language = 'en' // 'zh' | 'en'
+const Language = 'zh' // 'zh' | 'en'
 const formatTime = (date) => {
 	const year = date.getFullYear();
 	const month = date.getMonth() + 1;