删除无用文件夹

This commit is contained in:
qianlile
2021-08-30 09:56:13 +08:00
parent 33aecb6bda
commit e50ba21896
919 changed files with 35 additions and 24460 deletions

View File

@@ -0,0 +1,113 @@
// miniprogram/pages/deviceDetail/index.js
const { request } = require('../../API/request')
Page({
/**
* 页面的初始数据
*/
data: {
newRemark:{},
newName:'',
info:{},
show:false,
deleteShow:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getLastPageData();
},
getLastPageData(){
const that = this;
const eventChannel = this.getOpenerEventChannel();
eventChannel.on('getDeviceInfo', async(res)=>{
const data = await request(`system/device/getByUserAndNum/${res.deviceNum}`,'GET');
that.setData({
info:data.data
})
})
},
changeName(e){
let info = this.data.info;
info.deviceName = e.detail;
this.setData({ info });
},
changeRemark(e){
let info = this.data.info;
info.remark = e.detail;
this.setData({ info });
},
showDialog(){
this.setData({ show:true })
},
async onConfirm(){
let info = this.data.info;
const { deviceName, remark } = info;
if (deviceName.trim() === '') {
wx.showToast({
title: '名称不能为空!',
icon:'error',
mask:true
});
return;
}
const res = await request('system/device/updateDeviceInfo','post',{
deviceId:info.deviceId,
deviceName,
remark,
});
wx.showToast({
title: res.msg,
})
this.onClose();
},
onCancel(){
this.onClose();
},
onClose(){
this.setData({ show:false });
},
showDeleteDialog(){
this.setData({
deleteShow:true
})
},
onCancelDelete(){
this.setData({
deleteShow:false
})
},
onCloseDelete(){
this.onCancelDelete();
},
async onConfirmDelete(){
let deviceId = this.data.info.deviceId;
const res = await request('system/device/unBindDevice','post',{
deviceId
});
if (res.code === 200) {
wx.showToast({
title: '解除成功',
icon:'success',
mask:true,
duration:1000
});
wx.reLaunch({
url: '/pages/index/index',
});
}
}
})

View File

@@ -0,0 +1,8 @@
{
"usingComponents": {
"van-field": "@vant/weapp/field/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-button": "@vant/weapp/button/index",
"van-dialog": "@vant/weapp/dialog/index"
}
}

View File

@@ -0,0 +1,62 @@
<!--miniprogram/pages/deviceDetail/index.wxml-->
<van-cell-group title='设备信息'>
<van-field
label="设备编号"
value="{{ info.deviceNum }}"
readonly
/>
<van-field
label="设备分类"
value="{{ info.categoryName }}"
readonly
/>
<van-field
label="固件版本"
value="{{ info.firmwareVersion }}"
readonly
/>
</van-cell-group>
<van-cell-group title='自定义信息'>
<van-field
label="设备名称"
value="{{ info.deviceName }}"
bind:change="changeName"
/>
<van-field
label="备注"
value="{{ info.remark }}"
type='textarea'
bind:change="changeRemark"
/>
</van-cell-group>
<view class="btn">
<van-button block round color="linear-gradient(to right, #4bb0ff, #6149f6)" bindtap="showDialog">
提交修改
</van-button>
</view>
<view class="btn">
<van-button block round type='danger' bindtap="showDeleteDialog">
解除绑定
</van-button>
</view>
<van-dialog
message='您确定要提交您所做的修改吗?'
show="{{ show }}"
show-cancel-button
bind:close="onClose"
bind:confirm="onConfirm"
bind:cancel='onCancel'
>
</van-dialog>
<van-dialog
message='您确定要解除这个设备吗?'
show="{{ deleteShow }}"
show-cancel-button
bind:close="onCloseDelete"
bind:confirm="onConfirmDelete"
bind:cancel='onCancelDelete'
>
</van-dialog>

View File

@@ -0,0 +1,6 @@
/* miniprogram/pages/deviceDetail/index.wxss */
.btn{
width:80vw;
margin:30rpx auto;
}