From 2af5f043b60c1f7ac38ecccc8f5bf44743134325 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 12 十二月 2025 18:08:00 +0800
Subject: [PATCH] test
---
pages/index/detail.vue | 50 +++++++++++++++++++++++++++++---------------------
1 files changed, 29 insertions(+), 21 deletions(-)
diff --git a/pages/index/detail.vue b/pages/index/detail.vue
index c615aa2..a9b3e14 100644
--- a/pages/index/detail.vue
+++ b/pages/index/detail.vue
@@ -1,22 +1,22 @@
<template>
<view class="pages-vehicle-detail">
- <uni-nav-bar :fixed="true" status-bar right-text="" left-text="" leftWidth="72rpx" rightWidth="72rpx"
- :title="navigationBarTitle">
+ <uni-nav-bar :fixed="true" status-bar :title="navigationBarTitle" @clickLeft="clickCancel"
+ @clickRight="clickSave">
<view class="uni-navbar-container-inner">
<text class="uni-nav-bar-text">{{navigationBarTitle }}</text>
</view>
<template v-slot:right>
- <view class="uni-navbar-btn-text" @click="clickSave">
- <a class="uni-nav-bar-right-text">
- 淇濆瓨
+ <view class="uni-navbar-btn-text">
+ <a class="uni-nav-bar-right-text">
+ {{translate('save')}}
</a>
</view>
</template>
<template v-slot:left>
- <view class="uni-navbar-btn-text" @click="clickCancel">
- <a class="uni-nav-bar-left-text">
- 鍙栨秷
+ <view class="uni-navbar-btn-text">
+ <a class="uni-nav-bar-left-text">
+ {{translate('cancel')}}
</a>
</view>
@@ -25,25 +25,25 @@
<view class="content">
<view class="group">
<view class="item line">
- <view>鍚嶇О锛�/view>
- <input class="input" v-model="vehicleName"/>
+ <view>{{translate('name')}}锛�/view>
+ <input class="input" v-model="vehicleName" />
</view>
<view class="item line">
- <view>ip鍦板潃锛�/view>
+ <view>{{translate('ip_address')}}锛�/view>
<view class="text">{{vehicleInfo.ip }} </view>
</view>
<view class="item line">
- <view>鍨嬪彿锛�/view>
+ <view>{{translate('model')}}锛�/view>
<view class="text">{{vehicleInfo.model_number|| ""}}</view>
</view>
<view class="item line">
- <view>杞﹁浇鐗堟湰锛�/view>
+ <view>{{translate('car_version')}}锛�/view>
<view class="text">{{car_version|| ""}}</view>
</view>
- <view class="item line">
- <view>鎺堟潈鏈夋晥鏈燂細</view>
+ <!-- <view class="item line">
+ <view>{{translate('authorization_validity_period')}}锛�/view>
<view class="text">{{vehicleInfo.authorization_period|| ""}}</view>
- </view>
+ </view> -->
<!-- <view class="item" @click="clickUpgrade">
<view>鍥轰欢鐗堟湰锛�/view>
<view class="text2">{{firmware_version|| ""}}</view>
@@ -54,7 +54,7 @@
</view>
<view class="group">
<view class="item line">
- <view>鏃犵嚎灞�煙缃戝湴鍧�細</view>
+ <view>{{translate('wifi_address')}}锛�/view>
<!-- <input class="input" v-model="vehicleInfo.wifi.mac"> </input> -->
<view class="text">{{vehicleInfo.wifi?.mac|| ""}}</view>
</view>
@@ -63,7 +63,7 @@
<view class="text">{{vehicleInfo.bluetooth|| ""}}</view>
</view> -->
</view>
- <a-button type="ghost" class="button" @click="clickDelete">鍒犻櫎杞﹁締</a-button>
+ <a-button type="ghost" class="button" @click="clickDelete">{{translate('remove_vehicle')}}</a-button>
</view>
</view>
@@ -131,14 +131,18 @@
const info = await shellVersion(this.vehicleIp)
this.car_version = info.software_version
} catch (ex) {
- showError(ex)
+ showError(ex, this.translate('error'))
}
},
clickDelete() {
- showModal(`纭畾瑕佸垹闄よ澶団�${ this.vehicleInfo.name}鈥濆悧`, "璀﹀憡",true,"纭畾","鍙栨秷").then((res) => {
+ showModal({
+ content: `${this.translate('ask_delete_device')}`,
+ confirmText: this.translate('remove'),
+ cancelText: this.translate("cancel"),
+ }).then((res) => {
if (res) {
const eventChannel = this.getOpenerEventChannel();
- eventChannel.emit('delete_vehicle', this.vehicleInfo);
+ eventChannel.emit('remove_vehicle', this.vehicleInfo);
uni.navigateBack({
delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
})
@@ -166,6 +170,10 @@
delta: 1
})
},
+ translate(t) {
+ if (typeof this.$t == "function") return this.$t(`page.${t}`)
+ else return t;
+ },
}
--
Gitblit v1.9.1