This commit is contained in:
3321822538@qq.com 2024-12-21 17:10:49 +08:00
parent e95d3fcc09
commit ea71dcdbfa
3 changed files with 88 additions and 71 deletions

View File

@ -304,6 +304,44 @@
}) })
}, },
methods: { methods: {
//
btnactive(item) {
console.log(item);
this.prices = item.price
this.sytime = item.value
this.zfobj = item
this.indexactive = item.suitId
this.suitTimeUnit = item.timeUnit
this.suitPrice = item.price
this.suitGearAmount = item.gearAmount
this.suitGearTime = item.gearTime
this.suitFeeMode = item.feeMode
this.suitFeeType = item.feeType
if(item.feeMode == 2 && ['1','2'].includes(item.feeType)){
let sum = item.deposit / item.price
if(item.timeUnit == 1){
this.jine = item.value * 24 * 60 * 60 * sum
}else if(item.timeUnit == 2){
this.jine = item.value * 60 * 60 * sum
}else if(item.timeUnit == 3){
this.jine = item.value * 60 * sum
}else if(item.timeUnit == 4){
this.jine = item.value * sum
}
}else{
if(item.timeUnit == 1){
this.jine = item.value * 24 * 60 * 60
}else if(item.timeUnit == 2){
this.jine = item.value * 60 * 60
}else if(item.timeUnit == 3){
this.jine = item.value * 60
}else if(item.timeUnit == 4){
this.jine = item.value
}
}
console.log(this.jine);
},
// //
btnswindleflag(){ btnswindleflag(){
this.swindleflag = false this.swindleflag = false
@ -1382,30 +1420,6 @@
} }
}, 15); }, 15);
}, },
//
btnactive(item) {
// this.zhifuflag = true
this.prices = item.price
this.sytime = item.value
this.zfobj = item
this.indexactive = item.suitId
this.suitTimeUnit = item.timeUnit
this.suitPrice = item.price
this.suitGearAmount = item.gearAmount
this.suitGearTime = item.gearTime
this.suitFeeMode = item.feeMode
this.suitFeeType = item.feeType
if(item.timeUnit == 1){
this.jine = item.value * 24 * 60 * 60
}else if(item.timeUnit == 2){
this.jine = item.value * 60 * 60
}else if(item.timeUnit == 3){
this.jine = item.value * 60
}else if(item.timeUnit == 4){
this.jine = item.value
}
console.log(this.jine);
},
checkboxChange(e) { checkboxChange(e) {
this.checked = e.value this.checked = e.value
}, },

View File

@ -41,10 +41,14 @@
<view class="machao"> <view class="machao">
版本号{{obj.version == undefined ? '--' : obj.version}} 版本号{{obj.version == undefined ? '--' : obj.version}}
</view> </view>
<view class="machao">
最后更新时间{{obj.lastPullTime == undefined ? '--' : obj.lastPullTime}}
</view>
<view class="machao"> <view class="machao">
最后在线时间{{obj.lastOnlineTime == undefined ? '--' : obj.lastOnlineTime}} 最后在线时间{{obj.lastOnlineTime == undefined ? '--' : obj.lastOnlineTime}}
</view> </view>
<view class="jiaozhun"> <view class="jiaozhun">
<view class="input"> <view class="input">
<button @click="btnjian">-</button> <button @click="btnjian">-</button>
@ -57,6 +61,14 @@
</view> </view>
<view class="list"> <view class="list">
<view class="anniulist">
<view class="anniu" @click="btncq">
重启
</view>
<view class="anniu" @click="btnsxs">
刷新
</view>
</view>
<view class="anniulist"> <view class="anniulist">
<view class="anniu" @click="btnkq"> <view class="anniu" @click="btnkq">
开启 开启
@ -65,7 +77,7 @@
关闭 关闭
</view> </view>
<view class="anniu" @click="btnsx"> <view class="anniu" @click="btnsx">
刷新 同步
</view> </view>
</view> </view>
<view class="fanhui" @click="btnfh"> <view class="fanhui" @click="btnfh">
@ -84,7 +96,6 @@
backgroundColor: "#F7FAFE", backgroundColor: "#F7FAFE",
}, },
storeId: '', storeId: '',
storeIds: '',
obj: {}, obj: {},
id: '', id: '',
onlineStatus: '--', onlineStatus: '--',
@ -117,6 +128,9 @@
} }
}, },
methods: { methods: {
btnsxs(){
},
btnjian(){ btnjian(){
this.valuedian = Number(this.valuedian) - 1 this.valuedian = Number(this.valuedian) - 1
}, },
@ -124,8 +138,24 @@
this.valuedian = Number(this.valuedian) + 1 this.valuedian = Number(this.valuedian) + 1
}, },
btnjiaozhun(){ btnjiaozhun(){
this.x = this.obj.voltage / this.valuedian * this.xshu this.x = this.valuedian / this.obj.voltage * this.xshu
this.x = this.x.toFixed(3)
console.log(this.x) console.log(this.x)
this.$u.put(`/app/device/admin/${this.obj.deviceId}/vxs?vxs=${this.x}`).then(res => {
if(res.code == 200){
uni.showToast({
title: '校准成功',
icon: 'success',
duration:2000
})
this.getsn()
}else{
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
}, },
btnmy() { btnmy() {
@ -160,11 +190,15 @@
}, },
getsn() { getsn() {
if (this.storeId == '' || this.storeId == null) { this.$u.get(`/app/device/admin/get?sn=${this.storeId}`).then(res => {
this.$u.get(`/app/device/${this.storeIds}/bySn`).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.obj = res.data this.obj = res.data
this.id = res.data.deviceId this.id = res.data.deviceId
if(res.data.vxs == null){
this.xshu = 1
}else{
this.xshu = res.data.vxs
}
if (res.data.onlineStatus == 0) { if (res.data.onlineStatus == 0) {
this.onlineStatus = '离线' this.onlineStatus = '离线'
} else if (res.data.onlineStatus == 1) { } else if (res.data.onlineStatus == 1) {
@ -189,36 +223,6 @@
}) })
} }
}) })
}else{
this.$u.get(`/app/device/${this.storeId}/bySn`).then(res => {
if (res.code == 200) {
this.obj = res.data
this.id = res.data.deviceId
if (res.data.onlineStatus == 0) {
this.onlineStatus = '离线'
} else if (res.data.onlineStatus == 1) {
this.onlineStatus = '在线'
}
if (res.data.powerStatus == 0) {
this.powerStatus = '关闭'
} else if (res.data.powerStatus == 1) {
this.powerStatus = '开启'
}
uni.showToast({
title: res.msg,
icon: 'success',
duration: 2000,
})
uni.hideLoading()
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000,
})
}
})
}
}, },
// //
@ -349,13 +353,12 @@
.anniulist { .anniulist {
width: 658rpx; width: 658rpx;
margin: auto; margin: auto;
margin-top: 200rpx; margin-top: 20rpx;
text-align: left; text-align: left;
font-size: 32rpx; font-size: 32rpx;
display: flex; display: flex;
justify-content: space-between;
.anniu { .anniu {
margin-right: 20rpx;
width: 30%; width: 30%;
height: 90rpx; height: 90rpx;
border-radius: 20rpx; border-radius: 20rpx;

View File

@ -216,12 +216,12 @@
} else if (res.data == 0) { } else if (res.data == 0) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '该设备未录入,你需进行录入吗?', content: '该设备未录入,请先进行录入',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
uni.navigateTo({ // uni.navigateTo({
url: '/page_fenbao/zhuce?sn=' + id // url: '/page_fenbao/zhuce?sn=' + id
}) // })
} }
} }
}) })
@ -525,12 +525,12 @@
} else if (res.data == 0) { } else if (res.data == 0) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '该设备未录入,你需进行录入吗?', content: '该设备未录入,请先进行录入',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
uni.navigateTo({ // uni.navigateTo({
url: '/page_fenbao/zhuce?sn=' + id // url: '/page_fenbao/zhuce?sn=' + id
}) // })
} else if (res.cancel) { } else if (res.cancel) {
} }