作者 王军

合并分支 'Branch_wj' 到 'master'

企业用电



查看合并请求 !1
@@ -3,14 +3,14 @@ @@ -3,14 +3,14 @@
3 "pages/login/login", 3 "pages/login/login",
4 "pages/changqu/changqu", 4 "pages/changqu/changqu",
5 "pages/shebei/shebeilist/shebeilist", 5 "pages/shebei/shebeilist/shebeilist",
6 -  
7 "pages/mine/mine", 6 "pages/mine/mine",
8 "pages/index/index", 7 "pages/index/index",
9 "pages/logs/logs", 8 "pages/logs/logs",
10 -  
11 "pages/qiye/qiye", 9 "pages/qiye/qiye",
12 "pages/yujing/yujing", 10 "pages/yujing/yujing",
13 - "pages/shebei/shebeidetail/shebeidetail" 11 + "pages/shebei/shebeidetail/shebeidetail",
  12 + "pages/qiyeyongdian/qyyd/qyyd",
  13 + "pages/qiyeyongdian/detail/detail"
14 ], 14 ],
15 "window": { 15 "window": {
16 "backgroundTextStyle": "light", 16 "backgroundTextStyle": "light",
  1 +// pages/qiyeyongdian/detail/detail.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 + showModal: false,
  9 + monthList: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
  10 + changeColor:-1,
  11 + },
  12 + choice(e){
  13 + let index = e.currentTarget.dataset.id;
  14 + this.setData({
  15 + changeColor: index
  16 + })
  17 + },
  18 + toShowModal(e) {
  19 + this.setData({
  20 + showModal: true
  21 +
  22 + })
  23 + },
  24 +
  25 + hideModal() {
  26 + this.setData({
  27 + showModal: false
  28 + });
  29 + },
  30 + /**
  31 + * 生命周期函数--监听页面加载
  32 + */
  33 + onLoad: function(options) {
  34 +
  35 + },
  36 +
  37 + /**
  38 + * 生命周期函数--监听页面初次渲染完成
  39 + */
  40 + onReady: function() {
  41 +
  42 + },
  43 +
  44 + /**
  45 + * 生命周期函数--监听页面显示
  46 + */
  47 + onShow: function() {
  48 +
  49 + },
  50 +
  51 + /**
  52 + * 生命周期函数--监听页面隐藏
  53 + */
  54 + onHide: function() {
  55 +
  56 + },
  57 +
  58 + /**
  59 + * 生命周期函数--监听页面卸载
  60 + */
  61 + onUnload: function() {
  62 +
  63 + },
  64 +
  65 + /**
  66 + * 页面相关事件处理函数--监听用户下拉动作
  67 + */
  68 + onPullDownRefresh: function() {
  69 +
  70 + },
  71 +
  72 + /**
  73 + * 页面上拉触底事件的处理函数
  74 + */
  75 + onReachBottom: function() {
  76 +
  77 + },
  78 +
  79 + /**
  80 + * 用户点击右上角分享
  81 + */
  82 + onShareAppMessage: function() {
  83 +
  84 + }
  85 +})
  1 +{
  2 + "navigationBarTextStyle": "black",
  3 + "navigationBarTitleText": "企业用电",
  4 + "usingComponents": {}
  5 +}
  1 +<!--pages/qiyeyongdian/detail/detail.wxml-->
  2 +<!-- 日期选择 -->
  3 +<view class="modal-mask" bindtap="hideModal" wx:if="{{showModal}}"></view>
  4 +<view wx:if="{{showModal}}">
  5 + <view class="modal-content">
  6 + <!-- 年份 -->
  7 + <view class="modal_year">2019年</view>
  8 + <!-- 月份 -->
  9 + <view class="modal_month">
  10 + <view class="month_single {{changeColor == index?'change':''}}" wx:for="{{monthList}}" wx:key="" data-id="{{index}}" catchtap="choice">{{item}}</view>
  11 + </view>
  12 + <view class="date_descript">近30天</view>
  13 + <view class='btns'>
  14 + <view class="cacle" bindtap="hideModal">取消</view>
  15 + <view class="cacle sure" bindtap="hideModal">确定</view>
  16 + </view>
  17 + </view>
  18 +</view>
  19 +<!-- 月份 -->
  20 +<view class="search_month">
  21 + <view class="rowimg">
  22 + <image src='/img/row.png' class="left"></image>
  23 + </view>
  24 + <view class="date_time" bindtap='toShowModal'>近30天(2019.03.01-2019.03.30)
  25 + <view class="rowimg">
  26 + <image src='/img/row.png' class="down"></image>
  27 + </view>
  28 + </view>
  29 + <view class="rowimg">
  30 + <image src='/img/row.png'></image>
  31 + </view>
  32 +</view>
  33 +<!-- 折线图 -->
  34 +<view class="charts_line">
  35 + <view class="total_power">
  36 + <view>当月:1788kw.h</view>
  37 + <view>累计:5898kw.h</view>
  38 + </view>
  39 +
  40 +</view>
  1 +/* pages/qiyeyongdian/detail/detail.wxss */
  2 +
  3 +.search_month {
  4 + width: 686rpx;
  5 + padding: 0 30rpx;
  6 + height: 70rpx;
  7 + background-color: #f3f5f8;
  8 + display: flex;
  9 + flex-direction: row;
  10 + justify-content: space-between;
  11 + align-items: center;
  12 +}
  13 +
  14 +/* 左箭头 */
  15 +
  16 +.left {
  17 + transform: rotate(180deg);
  18 +}
  19 +/* 日期 */
  20 +.date_time {
  21 + color: #666;
  22 + font-size: 28rpx;
  23 + display: flex;
  24 + flex-direction: row;
  25 + align-items: center;
  26 +}
  27 +.down{
  28 + transform: rotate(90deg)
  29 +}
  30 +/* 折线图 */
  31 +
  32 +.charts_line {
  33 + padding: 40rpx 13rpx;
  34 +}
  35 +
  36 +.total_power {
  37 + display: flex;
  38 + flex-direction: row;
  39 + justify-content: space-around;
  40 +}
  41 +
  42 +/* 弹出框 */
  43 +
  44 +.modal-mask {
  45 + width: 100%;
  46 + height: 100%;
  47 + position: fixed;
  48 + top: 0;
  49 + left: 0;
  50 + background: #000;
  51 + opacity: 0.5;
  52 + overflow: hidden;
  53 + z-index: 9000;
  54 + color: #fff;
  55 +}
  56 +
  57 +.modal-dialog {
  58 + width: 100%;
  59 + overflow: hidden;
  60 + position: fixed;
  61 + top: 45%;
  62 + left: 0;
  63 + z-index: 9500;
  64 + margin: -180rpx 70rpx;
  65 +}
  66 +
  67 +.modal-content {
  68 + position: fixed;
  69 + top: 0;
  70 + left: 0;
  71 + z-index: 9500;
  72 + width: 100%;
  73 + /* height: 55%; */
  74 + overflow: hidden;
  75 + /* padding: 120rpx 50rpx 50rpx; */
  76 + background: #fff;
  77 + border-radius: 2rpx;
  78 +}
  79 +
  80 +/* 年份 */
  81 +
  82 +.modal_year {
  83 + padding: 38rpx;
  84 + border: 1rpx solid #f5f5f5;
  85 + font-size: 28rpx;
  86 + color: #666;
  87 + text-align: center;
  88 +}
  89 +
  90 +/* 月份 */
  91 +
  92 +.modal_month {
  93 + display: flex;
  94 + flex-wrap: wrap;
  95 + flex-direction: row;
  96 + margin: 40rpx 0 30rpx;
  97 +}
  98 +
  99 +.month_single {
  100 + width: 33.333%;
  101 + height: 120rpx;
  102 + text-align: center;
  103 + border-radius: 6rpx;
  104 + font-size: 32rpx;
  105 + color: #333;
  106 + line-height: 120rpx;
  107 +}
  108 +.change{
  109 + background-color: #FF9400;
  110 + color: #fff;
  111 +}
  112 +.date_descript {
  113 + width: 296rpx;
  114 + height: 70rpx;
  115 + line-height: 70rpx;
  116 + text-align: center;
  117 + color: #FF9400;
  118 + font-size: 28rpx;
  119 + margin:0 auto;
  120 + background: rgba(244, 244, 244, 1);
  121 + border-radius: 6rpx;
  122 +}
  123 +
  124 +.btns {
  125 + margin-top:50rpx;
  126 + display: flex;
  127 + flex-direction: row;
  128 + align-items: center;
  129 + border-top: 1rpx solid #f5f5f5;
  130 +}
  131 +.cacle{
  132 + width:50%;
  133 + color: #afafaf;
  134 + height: 87rpx;
  135 + line-height: 87rpx;
  136 + text-align: center;
  137 + font-size: 34rpx;
  138 +}
  139 +.sure{
  140 + color: #FF9400;
  141 + border-left: 1rpx solid #f5f5f5;
  142 +}
  1 +// pages/qiyeyongdian/qyyd/qyyd.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 + list: [{
  9 + index: 1,
  10 + name: "电表009",
  11 + num: "27.5",
  12 + unit: "昨日(千瓦时)",
  13 + unit1: "上月(千瓦时)"
  14 + },
  15 + {
  16 + index: 1,
  17 + name: "电表009",
  18 + num: "27.5",
  19 + unit: "昨日(千瓦时)",
  20 + unit1: "上月(千瓦时)"
  21 + },
  22 + {
  23 + index: 1,
  24 + name: "电表009",
  25 + num: "27.5",
  26 + unit: "昨日(千瓦时)",
  27 + unit1: "上月(千瓦时)"
  28 + },
  29 + {
  30 + index: 1,
  31 + name: "电表009",
  32 + num: "27.5",
  33 + unit: "昨日(千瓦时)",
  34 + unit1: "上月(千瓦时)"
  35 + },
  36 + ],
  37 + },
  38 + toDetail(e){
  39 + console.log(e)
  40 + wx.navigateTo({
  41 + url: '/pages/qiyeyongdian/detail/detail?id='+e.currentTarget.dataset.id,
  42 + })
  43 + },
  44 + /**
  45 + * 生命周期函数--监听页面加载
  46 + */
  47 + onLoad: function(options) {
  48 +
  49 + },
  50 +
  51 + /**
  52 + * 生命周期函数--监听页面初次渲染完成
  53 + */
  54 + onReady: function() {
  55 +
  56 + },
  57 +
  58 + /**
  59 + * 生命周期函数--监听页面显示
  60 + */
  61 + onShow: function() {
  62 +
  63 + },
  64 +
  65 + /**
  66 + * 生命周期函数--监听页面隐藏
  67 + */
  68 + onHide: function() {
  69 +
  70 + },
  71 +
  72 + /**
  73 + * 生命周期函数--监听页面卸载
  74 + */
  75 + onUnload: function() {
  76 +
  77 + },
  78 +
  79 + /**
  80 + * 页面相关事件处理函数--监听用户下拉动作
  81 + */
  82 + onPullDownRefresh: function() {
  83 +
  84 + },
  85 +
  86 + /**
  87 + * 页面上拉触底事件的处理函数
  88 + */
  89 + onReachBottom: function() {
  90 +
  91 + },
  92 +
  93 + /**
  94 + * 用户点击右上角分享
  95 + */
  96 + onShareAppMessage: function() {
  97 +
  98 + }
  99 +})
  1 +{
  2 + "navigationBarTextStyle": "black",
  3 + "navigationBarTitleText": "企业用电",
  4 + "usingComponents": {}
  5 +}
  1 +<!--pages/qiyeyongdian/qyyd/qyyd.wxml-->
  2 +<!-- 标题 -->
  3 +<view class="qy_title">
  4 + <view class="pesudo">电表数量:3</view>
  5 +</view>
  6 +<!-- 内容 -->
  7 +<view class="qy_content_box">
  8 + <view class="content_single" wx:for="{{list}}" wx:key="" bindtap='toDetail' data-id="{{item.index}}">
  9 + <view>{{item.name}}</view>
  10 + <view class="qy_used">
  11 + <view>{{item.num}}</view>
  12 + <view class="unit">{{item.unit}}</view>
  13 + </view>
  14 + <view class="qy_used">
  15 + <view>{{item.num}}</view>
  16 + <view class="unit">{{item.unit1}}</view>
  17 + </view>
  18 + <view class="rowimg">
  19 + <image src='/img/row.png'></image>
  20 + </view>
  21 + </view>
  22 +</view>
  1 +/* pages/qiyeyongdian/qyyd/qyyd.wxss */
  2 +
  3 +/* 标题 */
  4 +
  5 +.qy_title {
  6 + font-size: 32rpx;
  7 + color: #333;
  8 + font-weight: 500;
  9 + padding: 30rpx 54rpx;
  10 + border: 1rpx solid #f5f5f5;
  11 + border-left: none;
  12 + border-right: none;
  13 +}
  14 +
  15 +/* 伪类 */
  16 +
  17 +.pesudo {
  18 + position: relative;
  19 +}
  20 +
  21 +.pesudo::after {
  22 + position: absolute;
  23 + top: 6rpx;
  24 + left: -18rpx;
  25 + content: "";
  26 + display: block;
  27 + width: 8rpx;
  28 + height: 35rpx;
  29 + background-color: #ff9400;
  30 +}
  31 +
  32 +/* 内容 */
  33 +
  34 +.qy_content_box {
  35 + padding: 30rpx;
  36 +}
  37 +
  38 +/* 内容列表 */
  39 +
  40 +.content_single {
  41 + width: 630rpx;
  42 + height: 138rpx;
  43 + border: 1rpx solid #f5f5f5;
  44 + border-radius: 10rpx;
  45 + color: #333333;
  46 + display: flex;
  47 + flex-direction: row;
  48 + align-items: center;
  49 + justify-content: space-between;
  50 + padding:0 30rpx;
  51 + margin-bottom: 30rpx;
  52 +}
  53 +.qy_used{
  54 + text-align: center;
  55 +}
  56 +.unit{
  57 + font-size: 20rpx;
  58 + color: #666666;
  59 + margin-top:10rpx;
  60 +}
  61 +
  62 +
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 }, 13 },
14 "compileType": "miniprogram", 14 "compileType": "miniprogram",
15 "libVersion": "2.8.0", 15 "libVersion": "2.8.0",
16 - "appid": "wx1f51f42105b63343", 16 + "appid": "wxd4445f65df16adca",
17 "projectname": "APPUI", 17 "projectname": "APPUI",
18 "debugOptions": { 18 "debugOptions": {
19 "hidedInDevtools": [] 19 "hidedInDevtools": []
@@ -30,13 +30,32 @@ @@ -30,13 +30,32 @@
30 "current": -1, 30 "current": -1,
31 "list": [] 31 "list": []
32 }, 32 },
  33 + "plugin": {
  34 + "current": -1,
  35 + "list": []
  36 + },
33 "game": { 37 "game": {
34 "currentL": -1, 38 "currentL": -1,
35 "list": [] 39 "list": []
36 }, 40 },
37 "miniprogram": { 41 "miniprogram": {
38 - "current": -1,  
39 - "list": [] 42 + "current": 1,
  43 + "list": [
  44 + {
  45 + "id": -1,
  46 + "name": "qiyeyongdian",
  47 + "pathName": "pages/qiyeyongdian/qyyd/qyyd",
  48 + "query": "",
  49 + "scene": null
  50 + },
  51 + {
  52 + "id": 1,
  53 + "name": "detail",
  54 + "pathName": "pages/qiyeyongdian/detail/detail",
  55 + "query": "",
  56 + "scene": null
  57 + }
  58 + ]
40 } 59 }
41 } 60 }
42 } 61 }