作者 王军

合并分支 'Branch_wj' 到 'master'

企业用电



查看合并请求 !1
... ... @@ -3,14 +3,14 @@
"pages/login/login",
"pages/changqu/changqu",
"pages/shebei/shebeilist/shebeilist",
"pages/mine/mine",
"pages/index/index",
"pages/logs/logs",
"pages/qiye/qiye",
"pages/yujing/yujing",
"pages/shebei/shebeidetail/shebeidetail"
"pages/shebei/shebeidetail/shebeidetail",
"pages/qiyeyongdian/qyyd/qyyd",
"pages/qiyeyongdian/detail/detail"
],
"window": {
"backgroundTextStyle": "light",
... ...
// pages/qiyeyongdian/detail/detail.js
Page({
/**
* 页面的初始数据
*/
data: {
showModal: false,
monthList: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
changeColor:-1,
},
choice(e){
let index = e.currentTarget.dataset.id;
this.setData({
changeColor: index
})
},
toShowModal(e) {
this.setData({
showModal: true
})
},
hideModal() {
this.setData({
showModal: false
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{
"navigationBarTextStyle": "black",
"navigationBarTitleText": "企业用电",
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/qiyeyongdian/detail/detail.wxml-->
<!-- 日期选择 -->
<view class="modal-mask" bindtap="hideModal" wx:if="{{showModal}}"></view>
<view wx:if="{{showModal}}">
<view class="modal-content">
<!-- 年份 -->
<view class="modal_year">2019年</view>
<!-- 月份 -->
<view class="modal_month">
<view class="month_single {{changeColor == index?'change':''}}" wx:for="{{monthList}}" wx:key="" data-id="{{index}}" catchtap="choice">{{item}}</view>
</view>
<view class="date_descript">近30天</view>
<view class='btns'>
<view class="cacle" bindtap="hideModal">取消</view>
<view class="cacle sure" bindtap="hideModal">确定</view>
</view>
</view>
</view>
<!-- 月份 -->
<view class="search_month">
<view class="rowimg">
<image src='/img/row.png' class="left"></image>
</view>
<view class="date_time" bindtap='toShowModal'>近30天(2019.03.01-2019.03.30)
<view class="rowimg">
<image src='/img/row.png' class="down"></image>
</view>
</view>
<view class="rowimg">
<image src='/img/row.png'></image>
</view>
</view>
<!-- 折线图 -->
<view class="charts_line">
<view class="total_power">
<view>当月:1788kw.h</view>
<view>累计:5898kw.h</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/qiyeyongdian/detail/detail.wxss */
.search_month {
width: 686rpx;
padding: 0 30rpx;
height: 70rpx;
background-color: #f3f5f8;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
/* 左箭头 */
.left {
transform: rotate(180deg);
}
/* 日期 */
.date_time {
color: #666;
font-size: 28rpx;
display: flex;
flex-direction: row;
align-items: center;
}
.down{
transform: rotate(90deg)
}
/* 折线图 */
.charts_line {
padding: 40rpx 13rpx;
}
.total_power {
display: flex;
flex-direction: row;
justify-content: space-around;
}
/* 弹出框 */
.modal-mask {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
opacity: 0.5;
overflow: hidden;
z-index: 9000;
color: #fff;
}
.modal-dialog {
width: 100%;
overflow: hidden;
position: fixed;
top: 45%;
left: 0;
z-index: 9500;
margin: -180rpx 70rpx;
}
.modal-content {
position: fixed;
top: 0;
left: 0;
z-index: 9500;
width: 100%;
/* height: 55%; */
overflow: hidden;
/* padding: 120rpx 50rpx 50rpx; */
background: #fff;
border-radius: 2rpx;
}
/* 年份 */
.modal_year {
padding: 38rpx;
border: 1rpx solid #f5f5f5;
font-size: 28rpx;
color: #666;
text-align: center;
}
/* 月份 */
.modal_month {
display: flex;
flex-wrap: wrap;
flex-direction: row;
margin: 40rpx 0 30rpx;
}
.month_single {
width: 33.333%;
height: 120rpx;
text-align: center;
border-radius: 6rpx;
font-size: 32rpx;
color: #333;
line-height: 120rpx;
}
.change{
background-color: #FF9400;
color: #fff;
}
.date_descript {
width: 296rpx;
height: 70rpx;
line-height: 70rpx;
text-align: center;
color: #FF9400;
font-size: 28rpx;
margin:0 auto;
background: rgba(244, 244, 244, 1);
border-radius: 6rpx;
}
.btns {
margin-top:50rpx;
display: flex;
flex-direction: row;
align-items: center;
border-top: 1rpx solid #f5f5f5;
}
.cacle{
width:50%;
color: #afafaf;
height: 87rpx;
line-height: 87rpx;
text-align: center;
font-size: 34rpx;
}
.sure{
color: #FF9400;
border-left: 1rpx solid #f5f5f5;
}
... ...
// pages/qiyeyongdian/qyyd/qyyd.js
Page({
/**
* 页面的初始数据
*/
data: {
list: [{
index: 1,
name: "电表009",
num: "27.5",
unit: "昨日(千瓦时)",
unit1: "上月(千瓦时)"
},
{
index: 1,
name: "电表009",
num: "27.5",
unit: "昨日(千瓦时)",
unit1: "上月(千瓦时)"
},
{
index: 1,
name: "电表009",
num: "27.5",
unit: "昨日(千瓦时)",
unit1: "上月(千瓦时)"
},
{
index: 1,
name: "电表009",
num: "27.5",
unit: "昨日(千瓦时)",
unit1: "上月(千瓦时)"
},
],
},
toDetail(e){
console.log(e)
wx.navigateTo({
url: '/pages/qiyeyongdian/detail/detail?id='+e.currentTarget.dataset.id,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{
"navigationBarTextStyle": "black",
"navigationBarTitleText": "企业用电",
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/qiyeyongdian/qyyd/qyyd.wxml-->
<!-- 标题 -->
<view class="qy_title">
<view class="pesudo">电表数量:3</view>
</view>
<!-- 内容 -->
<view class="qy_content_box">
<view class="content_single" wx:for="{{list}}" wx:key="" bindtap='toDetail' data-id="{{item.index}}">
<view>{{item.name}}</view>
<view class="qy_used">
<view>{{item.num}}</view>
<view class="unit">{{item.unit}}</view>
</view>
<view class="qy_used">
<view>{{item.num}}</view>
<view class="unit">{{item.unit1}}</view>
</view>
<view class="rowimg">
<image src='/img/row.png'></image>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/qiyeyongdian/qyyd/qyyd.wxss */
/* 标题 */
.qy_title {
font-size: 32rpx;
color: #333;
font-weight: 500;
padding: 30rpx 54rpx;
border: 1rpx solid #f5f5f5;
border-left: none;
border-right: none;
}
/* 伪类 */
.pesudo {
position: relative;
}
.pesudo::after {
position: absolute;
top: 6rpx;
left: -18rpx;
content: "";
display: block;
width: 8rpx;
height: 35rpx;
background-color: #ff9400;
}
/* 内容 */
.qy_content_box {
padding: 30rpx;
}
/* 内容列表 */
.content_single {
width: 630rpx;
height: 138rpx;
border: 1rpx solid #f5f5f5;
border-radius: 10rpx;
color: #333333;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding:0 30rpx;
margin-bottom: 30rpx;
}
.qy_used{
text-align: center;
}
.unit{
font-size: 20rpx;
color: #666666;
margin-top:10rpx;
}
... ...
... ... @@ -13,7 +13,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.8.0",
"appid": "wx1f51f42105b63343",
"appid": "wxd4445f65df16adca",
"projectname": "APPUI",
"debugOptions": {
"hidedInDevtools": []
... ... @@ -30,13 +30,32 @@
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
"current": 1,
"list": [
{
"id": -1,
"name": "qiyeyongdian",
"pathName": "pages/qiyeyongdian/qyyd/qyyd",
"query": "",
"scene": null
},
{
"id": 1,
"name": "detail",
"pathName": "pages/qiyeyongdian/detail/detail",
"query": "",
"scene": null
}
]
}
}
}
\ No newline at end of file
... ...