cuiqian2004
4 天以前 2af5f043b60c1f7ac38ecccc8f5bf44743134325
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, //返回层数,2则上上页
                  })
@@ -166,6 +170,10 @@
               delta: 1
            })
         },
         translate(t) {
            if (typeof this.$t == "function") return this.$t(`page.${t}`)
            else return t;
         },
      }