| | |
| | | <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"> |
| | | <a @click="clickSave" class="uni-nav-bar-right-text"> |
| | | 保存 |
| | | <a class="uni-nav-bar-right-text"> |
| | | {{translate('save')}} |
| | | </a> |
| | | </view> |
| | | |
| | | </template> |
| | | <template v-slot:left> |
| | | <view class="uni-navbar-btn-text"> |
| | | <a @click="clickCancel" class="uni-nav-bar-left-text"> |
| | | 取消 |
| | | <a class="uni-nav-bar-left-text"> |
| | | {{translate('cancel')}} |
| | | </a> |
| | | </view> |
| | | |
| | |
| | | <view class="content"> |
| | | <view class="group"> |
| | | <view class="item line"> |
| | | <view>名称:</view> |
| | | <input class="input" v-model="vehicleName"> </input> |
| | | <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> |
| | |
| | | </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> |
| | |
| | | <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> |
| | |
| | | <script> |
| | | import { |
| | | showToast, |
| | | showModal |
| | | showModal, |
| | | showError, |
| | | showInfo |
| | | } from "@/comm/utils.js" |
| | | import { |
| | | Button |
| | |
| | | const info = await shellVersion(this.vehicleIp) |
| | | this.car_version = info.software_version |
| | | } catch (ex) { |
| | | this.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, //返回层数,2则上上页 |
| | | }) |
| | |
| | | delta: 1 |
| | | }) |
| | | }, |
| | | showError(ex) { |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | let tip = typeof ex.msg == "string" ? ex.msg : exStr |
| | | showModal(tip, "错误", false,"确定") |
| | | translate(t) { |
| | | if (typeof this.$t == "function") return this.$t(`page.${t}`) |
| | | else return t; |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |