...
|
...
|
@@ -79,14 +79,14 @@ |
|
|
<view class="sybanitem">详情</view>
|
|
|
</view>
|
|
|
<view class="shebeilitem" v-for="(item,index) in guan_list" :key="index" v-if="guan_list != ''">
|
|
|
<view class="sbitem sbdate">{{item.date}}<br/>{{item.time}}</view>
|
|
|
<view class="sbitem sbdate">{{item.date}}<br />{{item.time}}</view>
|
|
|
<view class="sbitem sbhao">{{item.image_id}}</view>
|
|
|
<view class="sbitem sbt">
|
|
|
<image :src="item.files"></image>
|
|
|
</view>
|
|
|
<view class="sbitem ck" @click="look_guan(item.id)">查看</view>
|
|
|
</view>
|
|
|
<view class="shebeilitem" v-if="guan_list == ''">
|
|
|
<view class="shebeilitem" v-if="guan_list.length==0">
|
|
|
<view class="nodatas">暂无数据</view>
|
|
|
</view>
|
|
|
</view>
|
...
|
...
|
@@ -118,7 +118,7 @@ |
|
|
cHeight: '',
|
|
|
pixelRatio: 1,
|
|
|
// 获取剩余可用次数
|
|
|
shenyu_times:"",
|
|
|
shenyu_times: "",
|
|
|
// 图表数据
|
|
|
//*数板*//
|
|
|
shuban: [],
|
...
|
...
|
@@ -129,7 +129,8 @@ |
|
|
shuguan: [],
|
|
|
shuguan_x: [],
|
|
|
/*数管列表数据*/
|
|
|
guan_list:""
|
|
|
guan_list: [],
|
|
|
page: 1
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
...
|
...
|
@@ -147,7 +148,7 @@ |
|
|
let ban = [];
|
|
|
let banX = []
|
|
|
app.post(url, param, 'post').then(r => {
|
|
|
console.log('88888888',r)
|
|
|
console.log('88888888', r)
|
|
|
for (var i = 0; i < r.user_equipment_log.length; i++) {
|
|
|
banX.unshift(r.user_equipment_log[i].date)
|
|
|
ban.unshift(r.user_equipment_log[i].count)
|
...
|
...
|
@@ -156,9 +157,9 @@ |
|
|
t.shuban_x = banX;
|
|
|
t.getServerData1();
|
|
|
t.ban_list = r.equipment;
|
|
|
|
|
|
let newban_list=t.ban_list;
|
|
|
for(var obj of newban_list){
|
|
|
|
|
|
let newban_list = t.ban_list;
|
|
|
for (var obj of newban_list) {
|
|
|
let number = obj.time;
|
|
|
// // 时间戳处理
|
|
|
var totalSecond = number;
|
...
|
...
|
@@ -171,19 +172,19 @@ |
|
|
// 小时位
|
|
|
var hr = Math.floor((second - day * 3600 * 24) / 3600);
|
|
|
var hrStr = hr.toString();
|
|
|
if (hrStr.length == 1) hrStr = hrStr;
|
|
|
if (hrStr.length == 1) hrStr = hrStr;
|
|
|
// 分钟位
|
|
|
var min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60);
|
|
|
var minStr = min.toString();
|
|
|
if (minStr.length == 1) minStr = minStr;
|
|
|
if (minStr.length == 1) minStr = minStr;
|
|
|
// 秒位
|
|
|
var sec = second - day * 3600 * 24 - hr * 3600 - min * 60;
|
|
|
var secStr = sec.toString();
|
|
|
if (secStr.length == 1) secStr = secStr;
|
|
|
obj.time = dayStr + '天' + hrStr + '小时' + minStr + "分钟"
|
|
|
if (secStr.length == 1) secStr = secStr;
|
|
|
obj.time = dayStr + '天' + hrStr + '小时' + minStr + "分钟"
|
|
|
}
|
|
|
this.ban_list=newban_list
|
|
|
|
|
|
this.ban_list = newban_list
|
|
|
|
|
|
}).catch(err => {
|
|
|
console.log(err)
|
|
|
})
|
...
|
...
|
@@ -192,7 +193,9 @@ |
|
|
get_shuguanchart() {
|
|
|
let t = this;
|
|
|
let url = "api/person/getUserShuguanLog";
|
|
|
let param = {};
|
|
|
let param = {
|
|
|
page: this.page
|
|
|
};
|
|
|
let guan = [];
|
|
|
let guanX = []
|
|
|
app.post(url, param, 'post').then(r => {
|
...
|
...
|
@@ -203,15 +206,17 @@ |
|
|
t.shuguan = guan;
|
|
|
t.shuguan_x = guanX;
|
|
|
t.getServerData();
|
|
|
t.guan_list = r.shuguan
|
|
|
//t.guan_list =r.shuguan
|
|
|
t.guan_list = t.guan_list.concat(r.shuguan);
|
|
|
console.log('9999', t.guan_list)
|
|
|
}).catch(err => {
|
|
|
console.log(err)
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
timechange(){
|
|
|
let number = this.shengyuqixian;
|
|
|
|
|
|
|
|
|
timechange() {
|
|
|
let number = this.shengyuqixian;
|
|
|
// // 时间戳处理
|
|
|
var totalSecond = number;
|
|
|
var second = totalSecond;
|
...
|
...
|
@@ -223,24 +228,24 @@ |
|
|
// 小时位
|
|
|
var hr = Math.floor((second - day * 3600 * 24) / 3600);
|
|
|
var hrStr = hr.toString();
|
|
|
if (hrStr.length == 1) hrStr = hrStr;
|
|
|
if (hrStr.length == 1) hrStr = hrStr;
|
|
|
// 分钟位
|
|
|
var min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60);
|
|
|
var minStr = min.toString();
|
|
|
if (minStr.length == 1) minStr = minStr;
|
|
|
if (minStr.length == 1) minStr = minStr;
|
|
|
// 秒位
|
|
|
var sec = second - day * 3600 * 24 - hr * 3600 - min * 60;
|
|
|
var secStr = sec.toString();
|
|
|
if (secStr.length == 1) secStr = secStr;
|
|
|
this.showshengyuqixian = dayStr + '天' + hrStr + '小时' + minStr + "分钟"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (secStr.length == 1) secStr = secStr;
|
|
|
this.showshengyuqixian = dayStr + '天' + hrStr + '小时' + minStr + "分钟"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getServerData() {
|
|
|
let t = this;
|
|
|
uni.request({
|
...
|
...
|
@@ -296,27 +301,27 @@ |
|
|
});
|
|
|
},
|
|
|
// 前往数板详情
|
|
|
go_shuban(e){
|
|
|
go_shuban(e) {
|
|
|
console.log(e)
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/shubanxinxi/shubanxinxi?num='+e.number,
|
|
|
url: '/pages/shubanxinxi/shubanxinxi?num=' + e.number,
|
|
|
success: res => {},
|
|
|
fail: () => {},
|
|
|
complete: () => {}
|
|
|
});
|
|
|
},
|
|
|
// 获取剩余可用次数
|
|
|
get_shenyu(){
|
|
|
get_shenyu() {
|
|
|
let t = this;
|
|
|
let url = "api/shuguan/getShuguanRule";
|
|
|
let param = {};
|
|
|
app.post(url,param,'post').then(r =>{
|
|
|
console.log(r,"获取剩余可用次数")
|
|
|
app.post(url, param, 'post').then(r => {
|
|
|
console.log(r, "获取剩余可用次数")
|
|
|
t.shenyu_times = r;
|
|
|
let newshenyu_times=t.shenyu_times;
|
|
|
|
|
|
|
|
|
let number = newshenyu_times.shengyu;
|
|
|
let newshenyu_times = t.shenyu_times;
|
|
|
|
|
|
|
|
|
let number = newshenyu_times.shengyu;
|
|
|
// // 时间戳处理
|
|
|
var totalSecond = number;
|
|
|
var second = totalSecond;
|
...
|
...
|
@@ -328,28 +333,28 @@ |
|
|
// 小时位
|
|
|
var hr = Math.floor((second - day * 3600 * 24) / 3600);
|
|
|
var hrStr = hr.toString();
|
|
|
if (hrStr.length == 1) hrStr = hrStr;
|
|
|
if (hrStr.length == 1) hrStr = hrStr;
|
|
|
// 分钟位
|
|
|
var min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60);
|
|
|
var minStr = min.toString();
|
|
|
if (minStr.length == 1) minStr = minStr;
|
|
|
if (minStr.length == 1) minStr = minStr;
|
|
|
// 秒位
|
|
|
var sec = second - day * 3600 * 24 - hr * 3600 - min * 60;
|
|
|
var secStr = sec.toString();
|
|
|
if (secStr.length == 1) secStr = secStr;
|
|
|
newshenyu_times.shengyu = dayStr + '天' + hrStr + '小时' + minStr + "分钟"
|
|
|
|
|
|
|
|
|
this.shenyu_times=newshenyu_times
|
|
|
}).catch(err =>{
|
|
|
if (secStr.length == 1) secStr = secStr;
|
|
|
newshenyu_times.shengyu = dayStr + '天' + hrStr + '小时' + minStr + "分钟"
|
|
|
|
|
|
|
|
|
this.shenyu_times = newshenyu_times
|
|
|
}).catch(err => {
|
|
|
console.log(err)
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
// 数管列表查看
|
|
|
look_guan(e){
|
|
|
look_guan(e) {
|
|
|
console.log(e)
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/shuguanshujudetail/shuguanshujudetail?id='+e,
|
|
|
url: '/pages/shuguanshujudetail/shuguanshujudetail?id=' + e,
|
|
|
success: res => {},
|
|
|
fail: () => {},
|
|
|
complete: () => {}
|
...
|
...
|
@@ -435,6 +440,9 @@ |
|
|
this.getServerData1();
|
|
|
} else {
|
|
|
this.getServerData();
|
|
|
// this.shuguan=[];
|
|
|
// this.page=1;
|
|
|
// this.get_shuguanchart()
|
|
|
}
|
|
|
},
|
|
|
},
|
...
|
...
|
@@ -444,20 +452,26 @@ |
|
|
// 获取数管图表数据
|
|
|
this.get_shuguanchart();
|
|
|
// 获取剩余可用次数
|
|
|
this.get_shenyu()
|
|
|
}
|
|
|
this.get_shenyu();
|
|
|
},
|
|
|
onReachBottom: function() {
|
|
|
let newpage=this.page;
|
|
|
newpage++;
|
|
|
this.page=newpage
|
|
|
this.get_shuguanchart();
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
.nodatas{
|
|
|
color:#7F8389;
|
|
|
font-size:36rpx;
|
|
|
.nodatas {
|
|
|
color: #7F8389;
|
|
|
font-size: 36rpx;
|
|
|
margin: 100rpx 0 50rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
/*样式的width和height一定要与定义的cWidth和cHeight相对应*/
|
|
|
.qiun-charts {
|
|
|
width: 750upx;
|
...
|
...
|
|