|
@@ -122,6 +122,26 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="line1"></view>
|
|
|
+ <view class="swithBox" v-if="equipment.isSleep">
|
|
|
+ <view class="swichFont2">{{$t('equipmentStatusList.sleepDesc')}}:</view>
|
|
|
+ <input v-if="descShow" class="swichFont3" :value=equipment.sleepDesc @input="getValue"
|
|
|
+ style="background: #fff" />
|
|
|
+ <span v-else class="swichFont4">{{equipment.sleepDesc==null?"暂停营业":equipment.sleepDesc}}</span>
|
|
|
+ <view v-if="editBtn" class="switch3">
|
|
|
+ <button type="primary" @click="toggleReadOnly" class="button">
|
|
|
+ <p class="p">{{$t('equipmentStatusList.edit')}}</p>
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ <view v-else class="switch2">
|
|
|
+ <button type="primary" @click="confirmDesc(equipment.sleepDesc,equipment.id)" class="button">
|
|
|
+ <p class="p">{{$t('equipmentStatusList.confirm')}}</p>
|
|
|
+ </button>
|
|
|
+ <button style="color:#BEBEBE;" @click="cancelDesc" class="button">
|
|
|
+ <p class="p">{{$t('equipmentStatusList.cancel')}}</p>
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-if="equipment.isSleep" class="line1"></view>
|
|
|
<!-- 一键重启 -->
|
|
|
<view class="opendoor"><span>{{$t('equipmentStatusList.reboot')}}:</span>
|
|
|
<view class="">
|
|
@@ -136,7 +156,7 @@
|
|
|
<!-- 已关机 -->
|
|
|
<view class="swithBox" v-if="equipment.eqeStatus==0">
|
|
|
<view class="swichFont1">{{$t('equipmentStatusList.off')}}</view>
|
|
|
- <view class="switch1">
|
|
|
+ <view class="switch2">
|
|
|
<!-- <switch style="transform:scale(0.65)" checked @change="OnOff(equipment.id,1)" /> -->
|
|
|
<button style="color:#BEBEBE;" @click="OnOff(equipment.id,1)" class="button">
|
|
|
<p class="p">{{$t('equipmentStatusList.kaiqi')}}</p>
|
|
@@ -149,7 +169,7 @@
|
|
|
<!-- 已开机 -->
|
|
|
<view class="swithBox" v-else>
|
|
|
<view class="swichFont1">{{$t('equipmentStatusList.on')}}</view>
|
|
|
- <view class="switch1">
|
|
|
+ <view class="switch2">
|
|
|
<!-- <switch style="transform:scale(0.65)" :checked="onffChecked" @change="OnOff(equipment.id,0)" /> -->
|
|
|
<button type="primary" @click="OnOff(equipment.id,1)" class="button">
|
|
|
<p class="p">{{$t('equipmentStatusList.kaiqi')}}</p>
|
|
@@ -333,6 +353,10 @@
|
|
|
|
|
|
},
|
|
|
input: 0,
|
|
|
+ isReadOnly: true,
|
|
|
+ editBtn:true,
|
|
|
+ sleepDesc:null,
|
|
|
+ descShow:false,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -389,6 +413,79 @@
|
|
|
uni.stopPullDownRefresh();
|
|
|
}, _ => void uni.stopPullDownRefresh());
|
|
|
},
|
|
|
+
|
|
|
+ getValue: function(event) {
|
|
|
+ // 绕过v-model 获取input输入框的值
|
|
|
+ var value = event.target.value;
|
|
|
+ this.sleepDesc = value;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 点击更改
|
|
|
+ toggleReadOnly() {
|
|
|
+ this.descShow = true;
|
|
|
+ this.editBtn = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 取消更改
|
|
|
+ cancelDesc() {
|
|
|
+ this.descShow = false;
|
|
|
+ this.editBtn = true;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更改睡眠描述
|
|
|
+ confirmDesc(sleepDesc,id) {
|
|
|
+ var that = this;
|
|
|
+ uni.showModal({
|
|
|
+ title: that.$t('equipmentStatusList.tip'),
|
|
|
+ content: that.$t('equipmentStatusList.sleepDescTip'),
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ var serverurl = that.serverurl;
|
|
|
+ var sleepDescNew = that.sleepDesc;
|
|
|
+ if(sleepDescNew == null||sleepDescNew == '') {
|
|
|
+ if(sleepDesc!=null) {
|
|
|
+ sleepDescNew = sleepDesc;
|
|
|
+ } else {
|
|
|
+ sleepDescNew = that.$t('equipmentStatusList.suspendBusiness');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var token = uni.getStorageSync("token");
|
|
|
+ uni.request({
|
|
|
+ url: serverurl + '/TEquipmentDesc/updateSleepDesc',
|
|
|
+ data: {
|
|
|
+ "sleepDesc": sleepDescNew,
|
|
|
+ "equipmentId": id
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ header: {
|
|
|
+ 'token': token
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res.data.code);
|
|
|
+ if (res.data.code) {
|
|
|
+ uni.showModal({
|
|
|
+ title: that.$t('equipmentStatusList.tip'),
|
|
|
+ content: that.$t('equipmentStatusList.modifiedSuccessfully'),
|
|
|
+ })
|
|
|
+ that.descShow = false;
|
|
|
+ that.editBtn = true;
|
|
|
+ that.getEquipmentListData();
|
|
|
+ } else {
|
|
|
+ uni.showModal({
|
|
|
+ title: that.$t('equipmentStatusList.tip'),
|
|
|
+ content: that.$t('equipmentStatusList.modificationFailure'),
|
|
|
+ })
|
|
|
+ that.descShow = false;
|
|
|
+ that.editBtn = true;
|
|
|
+ that.getEquipmentListData();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
//查看经纬度
|
|
|
lookMap(id, longitude, latitude) {
|
|
|
var item = {};
|
|
@@ -773,6 +870,8 @@
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
+ that.descShow = false;
|
|
|
+ that.editBtn = true;
|
|
|
var serverurl = that.serverurl;
|
|
|
var code = code;
|
|
|
var equipmentId = id;
|
|
@@ -834,7 +933,7 @@
|
|
|
}
|
|
|
|
|
|
.opendoor {
|
|
|
- /* #ifdef H5 */
|
|
|
+ /* #ifdef H5
|
|
|
|
|
|
/* #endif */
|
|
|
padding-top: 10upx;
|
|
@@ -909,20 +1008,52 @@
|
|
|
|
|
|
.switch1 {
|
|
|
display: flex;
|
|
|
+ /* flex-direction: row; */
|
|
|
+ width: 35%;
|
|
|
+ height: 42upx;
|
|
|
+ /* padding-top: 13upx; */
|
|
|
+/* padding-left: 132px; */
|
|
|
+ margin-left: auto;
|
|
|
+ }
|
|
|
+
|
|
|
+ .switch2 {
|
|
|
+ display: flex;
|
|
|
flex-direction: row;
|
|
|
+ padding-top: 13upx;
|
|
|
width: 35%;
|
|
|
height: 42upx;
|
|
|
+ margin-left: auto;
|
|
|
+ }
|
|
|
+
|
|
|
+ .switch3 {
|
|
|
+ height: 42upx;
|
|
|
padding-top: 13upx;
|
|
|
- padding-left: 72upx;
|
|
|
+ margin-left: auto;
|
|
|
}
|
|
|
|
|
|
.swichFont {
|
|
|
width: 85%;
|
|
|
padding-top: 12upx;
|
|
|
}
|
|
|
+
|
|
|
+ .swichFont2{
|
|
|
+ width: auto;
|
|
|
+ padding-top: 12upx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .swichFont3{
|
|
|
+ width: 40%;
|
|
|
+ margin-top: 8px;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .swichFont4 {
|
|
|
+ width: auto;
|
|
|
+ padding-top: 12upx;
|
|
|
+ }
|
|
|
|
|
|
.swichFont1 {
|
|
|
- width: 55%;
|
|
|
+ width: 60%;
|
|
|
padding-top: 12upx;
|
|
|
}
|
|
|
|