作者 lihongjuan

12213213321

正在显示 37 个修改的文件 包含 1799 行增加445 行删除
... ... @@ -61,6 +61,13 @@ App({
let day = date.getDate();
return date.getFullYear() + '-' + (month > 9 ? month : ('0' + month))
},
//结束时间
endate(){
let date = new Date();
let month = date.getMonth() + 1;
let day = date.getDate()+1;
return date.getFullYear() + '.' + (month > 9 ? month : ('0' + month)) + '.' + (day > 9 ? day : ('0' + day));
},
globalData: {
userInfo: null
}
... ...
{
"pages": [
"pages/companybox/zhishudetail/shebei/shebeilist/shebeilist",
"pages/companybox/qiyeyuebao/qiyeyuebao",
"pages/companybox/zhishudetail/shebei/shebeidetail/shebeidetail",
"pages/changqu/changqu",
"pages/companybox/zhishudetail/shebei/shebeilist/shebeilist",
"pages/companybox/qiyedetail/qiyedetail",
"pages/companybox/zhishudetail/member/member",
"pages/companybox/zhishudetail/car/car",
"pages/companybox/defendetail/defendetail",
"pages/companybox/zhishudetail/chengpin/chengpin",
"pages/companybox/zhishudetail/yuanliaomsg/yuanliao/yuanliao",
"pages/qiye/qiye",
"pages/changqu/changqu",
"pages/companybox/zhishudetail/yuanliaomsg/yuanliaoDetail/yuanliaoDetail",
"pages/companybox/zhishudetail/qiyeyongdian/detail/detail",
"pages/companybox/qiyedetail/qiyedetail",
"pages/companybox/defendetail/defendetail",
"pages/companybox/jichuxinxi/jichuxinxi",
"pages/qiye/qiye",
"pages/login/login",
"pages/mine/mine",
"pages/index/index",
"pages/logs/logs",
"pages/yujing/yujing",
"pages/companybox/zhishudetail/qiyeyongdian/qyyd/qyyd",
"pages/companybox/zhishudetail/member/member",
"pages/companybox/zhishudetail/chengpin/chengpin",
"pages/companybox/zhishudetail/yuanliaomsg/yuanliaoDetail/yuanliaoDetail"
"pages/ditu/ditu",
"pages/companybox/zhishudetail/chengpindetail/chengpindetail"
],
"window": {
"backgroundTextStyle": "light",
... ... @@ -61,5 +70,10 @@
}
]
},
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
... ...
... ... @@ -59,6 +59,8 @@
height: 90rpx;
justify-content: space-between;
border-top:1rpx solid #f5f5f5;
background: #fff;
z-index:999999
/* padding: 0 154rpx;
box-sizing: border-box */
}
... ...
... ... @@ -6,36 +6,49 @@ Page({
*/
data: {
markers: [{
iconPath: "",
iconPath: "/img/map.png",
id: 0,
latitude: 23.099994,
longitude: 113.324520,
width: 50,
height: 50
}],
polyline: [{
points: [{
longitude: 113.3245211,
latitude: 23.10229
}, {
longitude: 113.324520,
latitude: 23.21229
}],
color: "#FF0000DD",
width: 2,
dottedLine: true
}],
controls: [{
id: 1,
iconPath: '',
position: {
left: 0,
top: 300 - 50,
width: 50,
height: 50
latitude: 39.908710,
longitude: 116.397499,
width: 20,
height: 20,
id:1
},
{
iconPath: "/img/map2.png",
id: 0,
latitude: 39.957306,
longitude: 116.371027,
width: 20,
height: 20,
id:2
},
clickable: true
}]
{
iconPath: "/img/map3.png",
id: 0,
latitude: 39.907020,
longitude: 116.400680,
width: 20,
height: 20,
id: 2
},
{
iconPath: "/img/map2.png",
id: 0,
latitude: 39.905160,
longitude: 116.393924,
width: 20,
height: 20,
id: 2
}
],
longitude:'116.397499',
latitude:'39.908710'
},
/**
... ... @@ -45,16 +58,15 @@ Page({
},
regionchange(e) {
console.log(e.type)
},
// 跳转到对应的企业详情页面
markertap(e) {
console.log(e)
console.log(e.markerId)
wx.navigateTo({
url: '/pages/companybox/qiyedetail/qiyedetail',
})
},
controltap(e) {
console.log(e.controlId)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -7,5 +7,7 @@
<input placeholder='湖南' placeholder-class='searchword'/>
</view>
</view>
<map id="map" longitude="113.324520" latitude="23.099994" scale="14" controls="{{controls}}" bindcontroltap="controltap" markers="{{markers}}" bindmarkertap="markertap" polyline="{{polyline}}" bindregionchange="regionchange" show-location style="width: 100%;height:100% "></map>
<map id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" controls="{{controls}}" bindcontroltap="controltap" markers="{{markers}}" bindmarkertap="markertap" polyline="{{polyline}}" bindregionchange="regionchange" show-location style="width: 100%;height:100% "></map>
</view>
\ No newline at end of file
... ...
// pages/member/member.js
import * as echarts from '../../../ec-canvas/echarts';
const app = getApp()
const app = getApp();
function initChart(canvas, width, height) {
function initChart1(canvas, width, height) {
const chart = echarts.init(canvas, null, {
width: width,
height: height
});
canvas.setChart(chart);
var colors = ['#5793f3', '#d14a61', '#675bba'];
var option = {
color: colors,
var option = {
title: {
text: '',
subtext: ''
},
textStyle: {
fontSize: 12
},
tooltip: {
trigger: 'none',
axisPointer: {
type: 'cross'
}
trigger: 'axis'
},
legend: {
data: ['每月','平均' ]
data: ['每月', '平均']
},
grid: {
top: 70,
bottom: 50
toolbox: {
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
axisLine: {
onZero: false,
lineStyle: {
color: colors[1]
},
},
axisPointer: {
label: {
formatter: function (params) {
return '降水量 ' + params.value
+ (params.seriesData.length ? ':' + params.seriesData[0].data : '');
}
}
},
data: ["18.11", "18.12", "19.01", "19.02", "19.03", "19.04", "19.05", "19.06", "19.07"],
axisLabel: {
interval: 0,
},
smooth: true,
xAxis: {
type: 'category',
boundaryGap: false,
data: ['18.11', '18.12', '19.01', '19.02', '19.03', '19.04', '19.05', '19.06', '19.07'],
axisLabel: {
interval: 1,
},
{
type: 'category',
axisTick: {
alignWithLabel: true
},
axisLine: {
onZero: false,
lineStyle: {
color: colors[0]
}
},
axisPointer: {
label: {
formatter: function (params) {
return '降水量 ' + params.value
+ (params.seriesData.length ? ':' + params.seriesData[0].data : '');
}
}
},
},
yAxis: {
type: 'value',
min: 10,
max: 100,
splitNumber: 10,
}
],
yAxis: [
{
type: 'value',
min:10,
max:100,
splitNumber: 10,
axisLabel: {
formatter: '{value}'
}
],
series: [
{
name: '平均',
type: 'line',
xAxisIndex: 1,
smooth: true,
data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 86.6, 96.2, 48.7, 18.8, 6.0, 2.3]
},
series: [{
name: '每月',
type: 'line',
color: '#FF5345',
data: [11, 11, 15, 13, 12, 13, 10],
markPoint: {
data: [{
type: 'max',
name: '最大值'
},
{
type: 'min',
name: '最小值'
}
]
},
markLine: {
data: [{
type: 'average',
name: '平均值'
}]
}
},
{
name: '平均',
type: 'line',
color: '#6497F5',
data: [78, 18, 44, 33, 25, 45, 67],
markPoint: {
data: [{
name: '周最低',
value: 10,
xAxis: 1,
yAxis: 10
}]
},
{
name: '每月',
type: 'line',
smooth: true,
data: [3.9, 5.9, 11.1, 18.7, 48.3, 69.2, 31.6, 46.6, 55.4, 18.4, 10.3, 0.7]
markLine: {
data: [{
type: 'average',
name: '平均值'
},
[{
symbol: 'none',
x: '90%',
yAxis: 'max'
}, {
symbol: 'circle',
label: {
normal: {
position: 'start',
formatter: '最大值'
}
},
type: 'max',
name: '最高点'
}]
]
}
}
]
};
chart.setOption(option);
return chart;
}
Page({
onShareAppMessage: function (res) {
return {
title: 'ECharts 可以在微信小程序中使用啦!',
path: '/pages/index/index',
path: '',
success: function () { },
fail: function () { }
}
},
/**
* 页面的初始数据
*/
data: {
ec: {
onInit: initChart
state: 1,
timestate: 1,
ec1: {
onInit: initChart1,
},
statedate: '',
showdate: "",
watertime: '',
timesel: 1,
timearr: [
],
date: '',
datePickerValue: ['', '', ''],
datePickerIsShow: false,
datechu: false,
currentdate: true,
//开始日期
startdate: '',
//结束日期
enddate: '',
// 车辆状况日期
showModal: false,
monthList: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
time: '',
year: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
statedate: app.monthnowDate(),
watertime: app.newnowDate() + '-' + app.endate(),
startdate: app.newnowDate(),
enddate: app.endate()
})
//默认车辆状况日期
var date = new Date();
var month = date.getMonth() + 1;
var year = date.getFullYear();
this.setData({
showdate: year + '年' + month + '月'
})
if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
if (month < 10) {
this.setData({
time: "(" + year + "." + "0" + month + ".01" + "-2019." + '0' + month + ".31" + ")"
})
} else {
this.setData({
time: "(" + year + "." + month + ".01" + "-2019." + month + ".31" + ")"
})
}
} else {
if (month < 10) {
this.setData({
time: "(" + year + "." + "0" + month + ".01" + "-2019." + '0' + month + ".30" + ")"
})
} else {
this.setData({
time: "(" + year + "." + month + ".01" + "-2019." + month + ".30" + ")"
})
}
}
},
//车辆状况日期
choice(e) {
//默认显示当前月份
this.setData({
showt: false
})
var date = new Date();
var year = date.getFullYear()
let index = e.currentTarget.dataset.id;
index = index + 1
if (index == 1 || index == 3 || index == 5 || index == 7 || index == 8 || index == 10 || index == 12) {
if (month < 10) {
this.setData({
time: "(" + year + "." + "0" + index + ".01" + "-2019." + '0' + index + ".31" + ")"
})
} else {
this.setData({
time: "(" + year + "." + index + ".01" + "-2019." + index + ".31" + ")"
})
}
} else {
if (index < 10) {
this.setData({
time: "(" + year + "." + "0" + index + ".01" + "-2019." + '0' + index + ".30" + ")"
})
} else {
this.setData({
time: "(" + year + "." + index + ".01" + "-2019." + index + ".30" + ")"
})
}
}
this.setData({
changeColor: index - 1,
showdate: year + '年' + index + '月'
})
},
three() {
this.setData({
time: '近30天',
showt: !this.data.showt,
changeColor: -1
})
},
toShowModal(e) {
this.setData({
showModal: true
})
var date = new Date();
var mon = date.getMonth();
console.log(mon)
this.setData({
changeColor: mon
})
},
hideModal() {
this.setData({
showModal: false
});
},
showDatePicker: function (e) {
// this.data.datePicker.show(this);
this.setData({
datePickerIsShow: true,
});
},
datePickerOnSureClick: function (e) {
console.log('datePickerOnSureClick');
if (this.data.timesel == 1) {
console.log(e);
this.setData({
date: `${e.detail.value[0]}${e.detail.value[1]}${e.detail.value[2]}日`,
datePickerValue: e.detail.value,
datePickerIsShow: false,
currentdate: false,
startdate: e.detail.value[0] + '.' + e.detail.value[1] + "." + e.detail.value[2]
});
} else {
console.log(e);
this.setData({
date: `${e.detail.value[0]}${e.detail.value[1]}${e.detail.value[2]}日`,
datePickerValue: e.detail.value,
datePickerIsShow: false,
currentdate: false,
enddate: e.detail.value[0] + '.' + e.detail.value[1] + "." + e.detail.value[2]
});
}
},
datePickerOnCancelClick: function (event) {
console.log('datePickerOnCancelClick');
console.log(event);
this.setData({
datePickerIsShow: false,
currentdate: false,
});
},
changedate(e) {
console.log(e)
},
// 选择设备切换
selectshebei(e) {
this.setData({
state: e.currentTarget.dataset.id,
})
// if (e.currentdate.dataset.id == 1) {
// this.setData({
// ec1: {
// onInit: initChart1,
// },
// })
// }
},
// 显示日期
datexianshi() {
this.setData({
datechu: true,
currentdate: true
})
//获取年
var date = new Date();
var obj = {}
var year = date.getFullYear();
var month = date.getMonth() + 1;
if (month < 10) {
month = '0' + month
}
var day = date.getDate();
if (day < 10) {
day = "0" + day
}
console.log()
if (typeof (day) == 'number') {
day = day.toString()
}
console.log(typeof (day))
this.setData({
datePickerValue: [year, month, day],
})
},
// 选择时间和摄像头切换
seltime(e) {
this.setData({
timestate: e.currentTarget.dataset.id
})
},
//开始时间和结束时间切换
xuanshijan(e) {
this.setData({
timesel: e.currentTarget.dataset.time,
currentdate: true
})
this.datexianshi()
},
//确定选择开始日期和结束日期
qudingxuandate() {
this.setData({
datechu: false,
watertime: this.data.startdate + '-' + this.data.enddate
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
onReady() { }
});
\ No newline at end of file
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {
"ec-canvas": "../../../ec-canvas/ec-canvas"
"ec-canvas": "../../../ec-canvas/ec-canvas",
"date-picker": "../../../components/date-picker/date-picker"
}
}
\ No newline at end of file
... ...
<!--日期弹出层 -->
<view class="register" wx:if="{{datechu}}">
<view class="timewrap">
<view class="detailhead">
<view class="detailname {{timestate==1?'selactive':''}}" bindtap="seltime" data-id="1">选择时间</view>
<view class="detailname {{timestate==2?'selactive':''}}" bindtap="seltime" data-id="2">选摄像头</view>
</view>
<!-- 开始时间和结束时间 -->
<view class="timetwo">
<view class="timebetin" bindtap="xuanshijan" data-time="1">
<view class="timetop {{timesel==1?'seltimeactive':''}}">开始时间</view>
<view class="timebottom {{timesel==1?'selnameactive':''}}">{{startdate}}</view>
</view>
<view class="timebetin" bindtap="xuanshijan" data-time="2">
<view class="timetop {{timesel==2?'seltimeactive':''}}">结束时间</view>
<view class="timebottom {{timesel==2?'selnameactive':''}}">{{enddate}}</view>
</view>
</view>
<view class="timebox" wx:if="{{currentdate}}">
<view class="timeboxitem {{sel==index?'timeboxactive':''}}" wx:for="{{timearr}}" wx:key="">
<view class="itemcontent">{{item.year}}</view>
<view class="itemcontent">{{item.month}}</view>
<view class="itemcontent">{{item.day}}</view>
</view>
</view>
<view class="qudingdate" wx:else bindtap='qudingxuandate'>确定</view>
<view wx:if="{{currentdate}}">
<date-picker id="date-picker" value="{{datePickerValue}}" isShow="{{datePickerIsShow}}" bindsureclick="datePickerOnSureClick" bindcancelclick="datePickerOnCancelClick" />
</view>
</view>
</view>
<!-- 车辆状况 -->
<view class="peoplestate" wx:if="{{state==1}}">
<view class="date" bindtap="datexianshi">
<view class="dateleft">
<image src="/img/row.png"></image>
</view>
<view class="datetime">
<view class="datesel">
{{watertime}}
</view>
<view class="datepic">
<image src="/img/row.png"></image>
</view>
</view>
<view class="dateright">
<image src="/img/row.png"></image>
</view>
</view>
<view class="containerzhe">
<ec-canvas id="mychart-dom-line" canvas-id="mychart-line" ec="{{ ec1 }}"></ec-canvas>
</view>
</view>
<view class="container">
<ec-canvas id="mychart-dom-line" canvas-id="mychart-line" ec="{{ ec }}"></ec-canvas>
</view>
\ No newline at end of file
... ...
.container{
width:750rpx;
height:800rpx;
.detailhead {
display: flex;
align-items: center;
justify-content: space-around;
padding: 20rpx 69rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.detailname {
color: #999;
font-size: 28rpx;
}
.selactive {
position: relative;
}
.selactive::after {
display: block;
content: '';
width: 60rpx;
height: 1rpx;
border: 1rpx solid #ff9400;
position: absolute;
left: 50%;
right: 50%;
transform: translate(-50%);
bottom: -20rpx;
}
.date {
display: flex;
align-items: center;
justify-content: space-between;
height: 70rpx;
background: #f3f5f8;
padding: 0 31rpx;
box-sizing: border-box;
}
.dateleft {
width: 23rpx;
height: 23rpx;
font-size: 0;
transform: rotate(180deg);
}
.dateright {
width: 23rpx;
height: 23rpx;
font-size: 0;
}
.datetime {
display: flex;
align-items: center;
}
.datepic {
width: 16rpx;
height: 16rpx;
font-size: 0;
transform: rotate(90deg);
margin-left: 12rpx;
}
.datesel {
color: #666;
font-size: 28rpx;
}
.shebeinum {
color: #333;
font-size: 32rpx;
font-weight: bold;
padding: 40rpx 0 0 30rpx;
box-sizing: border-box;
border-top: 1rpx solid #f5f5f5;
position: relative;
}
.she {
margin-left: 18rpx;
}
.shebeinum::before {
content: '';
display: block;
width: 8rpx;
height: 33rpx;
background: #ff9400ff;
position: absolute;
top: 43rpx;
left: 30rpx;
}
.containerzhe {
width: 750rpx;
height: 500rpx;
margin-top:50rpx;
}
.datetime {
color: #333;
font-size: 28rpx;
display: flex;
justify-content: center;
}
.timewrap {
background: #fff;
/* height: 700rpx; */
padding-bottom: 40rpx;
box-sizing: border-box
}
ec-canvas {
width: 100%;
height: 100%;
}
\ No newline at end of file
.timetwo {
display: flex;
align-items: center;
padding: 60rpx 100rpx 50rpx;
box-sizing: border-box;
justify-content: space-between;
}
.timebetin {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.timetop {
color: #999;
font-size: 24rpx;
}
.timebottom {
color: #999;
font-size: 32rpx;
margin-top: 10rpx;
}
.seltimeactive {
color: #ff9400;
}
.selnameactive {
color: #333;
}
.timebox {
width: 580rpx;
height: 308rpx;
overflow-y: scroll;
margin: 0 auto;
}
.timeboxitem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 78rpx;
box-sizing: border-box;
background: #f9f8fe;
color: #999;
font-size: 28rpx;
border-bottom: 1rpx solid #f5f5f5;
}
.shihead {
display: flex;
align-items: center;
justify-content: space-between;
height: 100rpx;
padding: 0 28rpx;
border-bottom: 1rpx solid #f5f5f5;
}
.headitem {
color: #666;
font-size: 28rpx;
text-align: left;
}
.shuiitem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 34rpx 28rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.shuiitemleft {
color: #333;
font-size: 24rpx;
text-align: left;
}
.shijian {
width: 60rpx;
}
.shexiang {
width: 196rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.derition {
width: 56rpx;
}
.qudingdate {
width: 260rpx;
height: 80rpx;
background: rgba(255, 148, 0, 1);
opacity: 1;
border-radius: 10rpx;
color:#fff;
font-size: 30rpx;
text-align: center;
line-height: 80rpx;
margin:8rpx auto 0;
}
... ...
... ... @@ -10,15 +10,41 @@ function initChart(canvas, width, height) {
canvas.setChart(chart);
var option = {
tooltip: {
trigger: 'axis'
},
radar: [{
indicator: [{
title: {
text: '雷达图',
textStyle: {
color: 'rgba(221,221,221,1)', //标题颜色
fontSize: 14,
lineHeight: 20,
},
// 标题的位置,此时放在图的底边
left: 'center',
top: 'bottom',
},
legend: {
enabled: true
},
radar: [
{
indicator: [
{
text: '生产:90分',
max: 100
max: 100,
},
{
text: '预警:60分',
... ... @@ -27,47 +53,53 @@ function initChart(canvas, width, height) {
{
text: '稳定性:80分',
max: 100,
}
],
center: ['50%', '60%'],
radius: 80
radius: 80,
name: {
textStyle: {
fontSize: 14
}
},
},
],
series: [{
type: 'radar',
symbolSize: 6,
symbol: 'rect',
tooltip: {
trigger: 'item'
legend: {
},
itemStyle: {
normal: {
color: '#FBCB77',
areaStyle: {
type: 'default',
color: '#FBCB77'
color: '#FBCB77',
},
lineStyle:{
color:'#FBCB77',
lineStyle: {
color: '#FBCB77',
}
}
},
data: [{
value: [60, 73, 85],
itemStyle: {
normal: {
areaStyle: {
type: 'default',
color: '#FBCB77'
}
}
}
// name: '某软件'
}]
},
... ... @@ -77,6 +109,12 @@ function initChart(canvas, width, height) {
]
};
chart.setOption(option);
return chart;
... ... @@ -94,19 +132,22 @@ function initChart1(canvas, width, height) {
text: '开平机01每日开工时间',
left: 'center'
},
toolbox: {
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30','31'],
data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'],
axisLabel: {
interval:1,
interval: 1,
},
name:'日期'
name: '日期'
},
... ... @@ -115,29 +156,34 @@ function initChart1(canvas, width, height) {
axisLabel: {
formatter: '{value}'
},
min:1,
max:24,
min: 1,
max: 24,
splitNumber: 24,
name:'小时'
name: '小时'
},
series: [
{
series: [{
name: '',
type: 'line',
smooth: true,
color:'#FCB237',
color: '#FCB237',
data: [11, 11, 15, 13, 12, 13, 10],
markPoint: {
data: [
{ type: 'max', name: '最大值' },
{ type: 'min', name: '最小值' }
data: [{
type: 'max',
name: '最大值'
},
{
type: 'min',
name: '最小值'
}
]
},
markLine: {
data: [
{ type: 'average', name: '平均值' }
]
data: [{
type: 'average',
name: '平均值'
}]
},
// areaStyle: {
// // normal: {
... ... @@ -145,7 +191,7 @@ function initChart1(canvas, width, height) {
// // }
// },
},
]
};
... ... @@ -169,22 +215,29 @@ Page({
},
data: {
ec: {
onInit: initChart,
onInit: initChart,
// onInit: initChart1
},
ec1: {
onInit: initChart1
ec1: {
onInit: initChart1
}
},
onload(){
onload() {
},
dian(){
//跳转得分页面
godefen() {
wx.navigateTo({
url: '/pages/companybox/defendetail/defendetail',
})
},
dian() {
wx.navigateTo({
url: '/pages/qiyeyongdian/qyyd/qyyd',
})
... ...
<!--index.wxml-->
<view class="detailbox">
<view class="coint">
<view class="coint" bindtap="godefen">
<text class="cointleft">87</text>
<text class="cointword">分</text>
... ... @@ -36,55 +36,55 @@
<view class="zhilist">
<view class="zhishuitem">
<view class="zhilistimg">
<image src="/img/demo (18).png"></image>
<image src="/img/demo18.png"></image>
</view>
<view class="zhiname">开工</view>
</view>
<view class="zhishuitem" bindtap="dian">
<view class="zhilistimg dian">
<image src="/img/demo (19).png"></image>
<image src="/img/demo19.png"></image>
</view>
<view class="zhiname">电量</view>
</view>
<view class="zhishuitem">
<view class="zhilistimg people">
<image src="/img/demo (20).png"></image>
<image src="/img/demo20.png"></image>
</view>
<view class="zhiname">人员</view>
</view>
<view class="zhishuitem">
<view class="zhilistimg car">
<image src="/img/demo (21).png"></image>
<image src="/img/demo21.png"></image>
</view>
<view class="zhiname">车辆</view>
</view>
<view class="zhishuitem">
<view class="zhilistimg cheng">
<image src="/img/demo (22).png"></image>
<image src="/img/demo22.png"></image>
</view>
<view class="zhiname">成品</view>
</view>
<view class="zhishuitem">
<view class="zhilistimg cheng">
<image src="/img/demo (22).png"></image>
<image src="/img/demo22.png"></image>
</view>
<view class="zhiname">原材料</view>
</view>
<view class="zhishuitem">
<view class="zhilistimg shui">
<image src="/img/demo (1).png"></image>
<image src="/img/demo1.png"></image>
</view>
<view class="zhiname">水量</view>
</view>
<view class="zhishuitem">
<view class="zhilistimg qi">
<image src="/img/demo (24).png"></image>
<image src="/img/demo24.png"></image>
</view>
<view class="zhiname">气量</view>
</view>
<view class="zhishuitem">
<view class="zhilistimg wu">
<image src="/img/demo (23).png"></image>
<image src="/img/demo23.png"></image>
</view>
<view class="zhiname">排污</view>
</view>
... ...
... ... @@ -9,7 +9,7 @@ page {
overflow: hidden
}
.container {
width: 750rpx;
width: 100%;
height: 382rpx;
margin: 0 auto;
display: flex;
... ... @@ -33,17 +33,19 @@ ec-canvas {
}
.zonghe {
color: #ff9400ff;
color: #ff9400!important;
font-size: 30rpx;
text-align: center;
}
.cointleft {
font-size: 80rpx;
color: #ff9400!important;
}
.cointword {
font-size: 30rpx;
color: #ff9400!important;
}
.xian {
... ... @@ -92,7 +94,7 @@ ec-canvas {
}
.zhishuitem{
width:138rpx;
width:20%;
display:flex;
flex-direction: column;
justify-content: space-between;
... ...
... ... @@ -12,7 +12,7 @@ Page({
data: {
showModal: false,
modalTitle: ["选择时间", "选择地磅", "选择货物"],
modalNum: 2,
modalNum: 0,
monthList: ["货物名字", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", ],
time: '2019.01.01-2019.01.31',
changeColor: 0,
... ... @@ -41,6 +41,17 @@ Page({
btn: "详情"
},
],
watertime:'',
//出库日期
statedate: '',
timestate:1,
timesel:1,
startdate: '',
enddate: '',
ec: {
onInit: function(canvas, width, height) {
... ... @@ -68,6 +79,23 @@ Page({
this.setData({
tabNum: e.currentTarget.dataset.id
})
if(this.data.tabNum==0){
this.echartsComponnet = this.selectComponent('#mychart');
//如果是第一次绘制
if (!Chart) {
this.init_echarts(); //初始化图表
} else {
this.setOption(Chart); //更新数据
}
}
},
toShowModal(e) {
... ... @@ -75,38 +103,163 @@ Page({
showModal: true
})
},
//显示日期弹层
datexianshi() {
this.setData({
datechu: true,
currentdate: true
})
//获取年
var date = new Date();
var obj = {}
var year = date.getFullYear();
var month = date.getMonth() + 1;
if (month < 10) {
month = '0' + month
}
hideModal() {
var day = date.getDate();
if (day < 10) {
day = "0" + day
}
console.log()
if (typeof (day) == 'number') {
day = day.toString()
}
console.log(typeof (day))
this.setData({
showModal: false
});
datePickerValue: [year, month, day],
})
},
choice(e) {
// 时间地磅货物选择
selectbang(e){
this.setData({
changeColor: e.currentTarget.dataset.id
modalNum:e.currentTarget.dataset.index
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.echartsComponnet = this.selectComponent('#mychart');
//如果是第一次绘制
if (!Chart) {
this.init_echarts(); //初始化图表
//开始时间和结束时间
xuanshijan(e) {
this.setData({
timesel: e.currentTarget.dataset.time,
currentdate: true
})
this.datexianshi()
},
datePickerOnSureClick: function (e) {
console.log('datePickerOnSureClick');
if (this.data.timesel == 1) {
console.log(e);
this.setData({
date: `${e.detail.value[0]}${e.detail.value[1]}${e.detail.value[2]}日`,
datePickerValue: e.detail.value,
datePickerIsShow: false,
currentdate: false,
state: 2,
startdate: e.detail.value[0] + '.' + e.detail.value[1] + "." + e.detail.value[2]
});
} else {
console.log(e);
this.setData({
date: `${e.detail.value[0]}${e.detail.value[1]}${e.detail.value[2]}日`,
datePickerValue: e.detail.value,
datePickerIsShow: false,
currentdate: false,
state: 2,
enddate: e.detail.value[0] + '.' + e.detail.value[1] + "." + e.detail.value[2]
});
}
this.setOption(Chart); //更新数据
},
}
datePickerOnCancelClick: function (event) {
console.log('datePickerOnCancelClick');
console.log(event);
this.setData({
datePickerIsShow: false,
currentdate: false,
state: 2
});
},
//确定选择开始日期和结束日期
qudingxuandate() {
this.setData({
datechu: false,
watertime: this.data.startdate + '-' + this.data.enddate
})
},
// 选择地磅
quedibang(){
this.setData({
datechu: false
})
},
// 取消选择
quxiaobang(){
this.setData({
datechu: false,
watertime: app.newnowDate() + '-' + app.endate(),
})
},
choice(e) {
let index = e.currentTarget.dataset.id
this.setData({
changeColor: e.currentTarget.dataset.id,
watertime: this.data.monthList[index],
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.setData({
statedate: app.monthnowDate(),
startdate: app.newnowDate(),
enddate: app.endate()
})
let newdate = this.data.statedate.split("-");
this.setData({
showdate: newdate[0] + '年' + newdate[1] + '月',
watertime: app.newnowDate() + '-' + app.endate(),
})
},
// 跳转详情页
detail(){
wx.navigateTo({
url: '/pages/companybox/zhishudetail/chengpindetail/chengpindetail',
})
},
// 选择日期
bindstateDateChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
statedate: e.detail.value
})
let newdate = this.data.statedate.split("-");
this.setData({
showdate: newdate[0] + '年' + newdate[1] + '月'
})
},
//初始化图表
... ... @@ -259,6 +412,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.echartsComponnet = this.selectComponent('#mychart');
... ...
... ... @@ -2,6 +2,7 @@
"navigationBarTextStyle": "black",
"navigationBarTitleText": "成品",
"usingComponents": {
"ec-canvas": "../../../../ec-canvas/ec-canvas"
"ec-canvas": "../../../../ec-canvas/ec-canvas",
"date-picker": "../../../../components/date-picker/date-picker"
}
}
\ 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-mask" bindtap="hideModal" wx:if="{{datechu}}"></view>
<view wx:if="{{datechu}}">
<view class="modal-content">
<!-- 选项卡 -->
<!-- 时间 地磅 货物 选项卡 -->
<view class="modal_year">
<view class="modal_single {{modalNum == index ?'modal_choice':''}}" wx:for="{{modalTitle}}" wx:key="">{{item}}</view>
<view class="modal_single {{modalNum == index ?'modal_choice':''}}" wx:for="{{modalTitle}}" wx:key="" bindtap='selectbang' data-index="{{index}}">{{item}}</view>
</view>
<!-- 月份 -->
<scroll-view scroll-y style="height: 400px;">
<view class="modal_month">
<view class="month_single {{changeColor == index?'change':''}}" wx:for="{{monthList}}" wx:key="" data-id="{{index}}" catchtap="choice">{{item}}</view>
<!-- 选择时间 -->
<view class="timewrap" wx:if="{{modalNum==0}}">
<view class="timewrap">
<!-- 开始时间和结束时间 -->
<view class="timetwo">
<view class="timebetin" bindtap="xuanshijan" data-time="1">
<view class="timetop {{timesel==1?'seltimeactive':''}}">开始时间</view>
<view class="timebottom {{timesel==1?'selnameactive':''}}">{{startdate}}</view>
</view>
<view class="timebetin" bindtap="xuanshijan" data-time="2">
<view class="timetop {{timesel==2?'seltimeactive':''}}">结束时间</view>
<view class="timebottom {{timesel==2?'selnameactive':''}}">{{enddate}}</view>
</view>
</view>
<view class="timebox" wx:if="{{currentdate}}">
<view class="timeboxitem {{sel==index?'timeboxactive':''}}" wx:for="{{timearr}}" wx:key="">
<view class="itemcontent">{{item.year}}</view>
<view class="itemcontent">{{item.month}}</view>
<view class="itemcontent">{{item.day}}</view>
</view>
</view>
<view class="qudingdate" wx:else bindtap='qudingxuandate'>确定</view>
<view wx:if="{{currentdate}}">
<date-picker id="date-picker" value="{{datePickerValue}}" isShow="{{datePickerIsShow}}" bindsureclick="datePickerOnSureClick" bindcancelclick="datePickerOnCancelClick" />
</view>
</view>
</view>
</scroll-view>
<view class='btns'>
<view class="cacle" bindtap="hideModal">取消</view>
<view class="cacle sure" bindtap="hideModal">确定</view>
<!-- 选择地磅 选择货物 -->
<view class="dibang" wx:else>
<!-- 选择地磅 -->
<scroll-view scroll-y style="height: 400px;" wx:if="{{modalNum==1}}">
<view class="modal_month">
<view class="month_single {{changeColor == index?'change':''}}" wx:for="{{monthList}}" wx:key="" data-id="{{index}}" catchtap="choice">{{item}}</view>
</view>
</scroll-view>
<!--选择货物 -->
<scroll-view scroll-y style="height: 400px;" wx:if="{{modalNum==2}}">
<view class="modal_month">
<view class="month_single {{changeColor == index?'change':''}}" wx:for="{{monthList}}" wx:key="" data-id="{{index}}" catchtap="choice">{{item}}</view>
</view>
</scroll-view>
<view class='btns'>
<view class="cacle" bindtap="quxiaobang">取消</view>
<view class="cacle sure" bindtap="quedibang">确定</view>
</view>
</view>
</view>
</view>
<!-- 选项卡 -->
<!-- 出库 流水选项卡 -->
<view class="tab">
<view wx:for="{{tabList}}" wx:key="" class="tab_single {{tabNum == index?'tab_border':''}}" bindtap='changeTab' data-id="{{index}}">{{item}}</view>
</view>
... ... @@ -30,9 +95,15 @@
</view>
<view class="date_time">
<!-- 出库 -->
<view wx:if="{{tabNum == 0}}">2019.06</view>
<view wx:if="{{tabNum == 0}}">
<picker mode="date" value="{{date}}" start="" end="" bindchange="bindstateDateChange" fields="month">
<view class="picker">
{{statedate}}
</view>
</picker>
</view>
<!-- 流水 -->
<view wx:if="{{tabNum == 1}}" bindtap='toShowModal'>{{time}}</view>
<view wx:if="{{tabNum == 1}}" bindtap='datexianshi'>{{watertime}}</view>
<view class="rowimg">
<image src='/img/row.png' class="down"></image>
</view>
... ... @@ -56,7 +127,7 @@
<ec-canvas id="mychart" canvas-id="mychart-line" ec="{{ ec }}"></ec-canvas>
</view>
<view class="total_power">
<view>2019年6月</view>
<view>{{showdate}}</view>
</view>
</view>
</view>
... ... @@ -68,12 +139,12 @@
<view class="table_title">
<view wx:for="{{tableTitle}}" wx:key="">{{item}}</view>
</view>
<view class="table_tr" wx:for="{{trList}}" wx:key="">
<view class="table_tr" wx:for="{{trList}}" wx:key="" bindtap="detail">
<view class="tr_time">{{item.date}}</view>
<view class="tr_pos">{{item.position}}</view>
<view class="tr_name">{{item.name}}</view>
<view class="tr_time">{{item.num}}</view>
<view class="tr_btn" >{{item.btn}}</view>
<view class="tr_btn">{{item.btn}}</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/qiyeyongdian/detail/detail.wxss */
@import "../member/member.wxss";
.search_month {
width: 686rpx;
... ... @@ -86,7 +87,7 @@ ec-canvas {
z-index: 9500;
width: 100%;
/* height: 55%; */
overflow: hidden;
/* overflow: hidden; */
/* padding: 120rpx 50rpx 50rpx; */
background: #fff;
border-radius: 2rpx;
... ... @@ -101,19 +102,34 @@ ec-canvas {
align-items: center;
font-size: 28rpx;
color: #666;
padding-top: 20rpx;
padding: 20rpx 0;
border:1rpx solid #f5f5f5;
border-left:none;
border-right: none;
}
.modal_single{
border-bottom:4rpx solid #fff;
}
.modal_choice{
border-bottom-color: #FF9400;
color: #FF9400;
font-weight: 600;
padding-bottom:20rpx;
position: relative;
}
.modal_choice::after{
display:bolck;
content:'';
width:60rpx;
border:1rpx solid #FF9400;
position: absolute;
bottom:-20rpx;
left:50%;
right:50%;
transform: translate(-50%)
}
/* 选项卡 */
... ... @@ -123,7 +139,7 @@ ec-canvas {
justify-content: space-around;
align-items: center;
padding-top: 20rpx;
color: #ff9400;
color: #666;
border-top: 1rpx solid #f5f5f5;
}
... ... @@ -134,6 +150,7 @@ ec-canvas {
.tab_border {
border-bottom: 4rpx solid #ff9400;
color:#ff9400;
}
/* 月份 */
... ...
... ... @@ -15,7 +15,12 @@ function initChart1(canvas, width, height) {
text: '',
left: 'center'
},
legend: {
data: ['进人数']
},
textStyle: {
fontSize: 14
},
toolbox: {
... ... @@ -26,8 +31,13 @@ function initChart1(canvas, width, height) {
data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'],
axisLabel: {
interval: 1,
fontSize: 13,
},
name: '日期'
name: '日期',
nameTextStyle: {
fontSize: 12
}
},
... ... @@ -39,11 +49,14 @@ function initChart1(canvas, width, height) {
min: 10,
max: 100,
splitNumber: 10,
name: '人数'
name: '人数',
nameTextStyle:{
fontSize: 12
}
},
series: [{
name: '',
name: '进人数',
type: 'line',
smooth: true,
color: '#A8ACE8',
... ... @@ -115,7 +128,12 @@ Page({
date: '',
datePickerValue: ['', '', ''],
datePickerIsShow: false,
datechu:false
datechu:false,
currentdate:true,
//开始日期
startdate:'',
//结束日期
enddate:'',
},
/**
... ... @@ -124,7 +142,9 @@ Page({
onLoad: function(options) {
this.setData({
statedate: app.monthnowDate(),
watertime: app.newnowDate() + '-' + app.snewnowDate()
watertime: app.newnowDate() + '-' + app.endate(),
startdate: app.newnowDate(),
enddate: app.endate()
})
console.log(this.data.statedate)
... ... @@ -144,14 +164,29 @@ Page({
datePickerOnSureClick: function(e) {
console.log('datePickerOnSureClick');
console.log(e);
this.setData({
date: `${e.detail.value[0]}${e.detail.value[1]}${e.detail.value[2]}日`,
datePickerValue: e.detail.value,
datePickerIsShow: false,
datechu:false,
state:2
});
if (this.data.timesel==1){
console.log(e);
this.setData({
date: `${e.detail.value[0]}${e.detail.value[1]}${e.detail.value[2]}日`,
datePickerValue: e.detail.value,
datePickerIsShow: false,
currentdate: false,
state: 2,
startdate:e.detail.value[0]+'.'+e.detail.value[1]+"."+e.detail.value[2]
});
}else{
console.log(e);
this.setData({
date: `${e.detail.value[0]}${e.detail.value[1]}${e.detail.value[2]}日`,
datePickerValue: e.detail.value,
datePickerIsShow: false,
currentdate: false,
state: 2,
enddate: e.detail.value[0] + '.' + e.detail.value[1] + "." + e.detail.value[2]
});
}
},
datePickerOnCancelClick: function(event) {
... ... @@ -159,7 +194,8 @@ Page({
console.log(event);
this.setData({
datePickerIsShow: false,
datechu:false,
currentdate: false,
state:2
});
},
... ... @@ -176,7 +212,8 @@ Page({
// 显示日期
datexianshi(){
this.setData({
datechu:true
datechu:true,
currentdate:true
})
//获取年
... ... @@ -204,12 +241,6 @@ Page({
},
bindDateChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
date: e.detail.value
})
},
// 选择时间和摄像头切换
seltime(e) {
this.setData({
... ... @@ -220,8 +251,11 @@ Page({
//开始时间和结束时间切换
xuanshijan(e) {
this.setData({
timesel: e.currentTarget.dataset.time
timesel: e.currentTarget.dataset.time,
currentdate:true
})
this.datexianshi()
},
// 选择日期
bindstateDateChange(e) {
... ... @@ -234,7 +268,15 @@ Page({
showdate: newdate[0] + '年' + newdate[1] + '月'
})
},
/**
//确定选择开始日期和结束日期
qudingxuandate(){
this.setData({
datechu:false,
watertime: this.data.startdate+'-'+this.data.enddate
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
... ...
... ... @@ -2,11 +2,9 @@
<view class="register" wx:if="{{datechu}}">
<view class="timewrap">
<view class="detailhead">
<view class="detailname {{timestate==1?'selactive':''}}" bindtap="seltime" data-id="1">选择时间</view>
<view class="detailname {{timestate==2?'selactive':''}}" bindtap="seltime" data-id="2">选摄像头</view>
</view>
<!-- 开始时间和结束时间 -->
... ... @@ -15,16 +13,16 @@
<view class="timebetin" bindtap="xuanshijan" data-time="1">
<view class="timetop {{timesel==1?'seltimeactive':''}}">开始时间</view>
<view class="timebottom {{timesel==1?'selnameactive':''}}">2019.01.09</view>
<view class="timebottom {{timesel==1?'selnameactive':''}}">{{startdate}}</view>
</view>
<view class="timebetin" bindtap="xuanshijan" data-time="2">
<view class="timetop {{timesel==2?'seltimeactive':''}}">结束时间</view>
<view class="timebottom {{timesel==2?'selnameactive':''}}">2019.01.09</view>
<view class="timebottom {{timesel==2?'selnameactive':''}}">{{enddate}}</view>
</view>
</view>
<view class="timebox">
<view class="timebox" wx:if="{{currentdate}}">
<view class="timeboxitem {{sel==index?'timeboxactive':''}}" wx:for="{{timearr}}" wx:key="">
<view class="itemcontent">{{item.year}}</view>
<view class="itemcontent">{{item.month}}</view>
... ... @@ -33,11 +31,16 @@
</view>
<view class="qudingdate" wx:else bindtap='qudingxuandate'>确定</view>
<view wx:if="{{currentdate}}">
<date-picker id="date-picker" value="{{datePickerValue}}" isShow="{{datePickerIsShow}}" bindsureclick="datePickerOnSureClick" bindcancelclick="datePickerOnCancelClick" />
</view>
<!-- <text>当前日期:{{date}}</text>
<view bindtap="showDatePicker">选择日期</view> -->
<date-picker id="date-picker" value="{{datePickerValue}}" isShow="{{datePickerIsShow}}" bindsureclick="datePickerOnSureClick" bindcancelclick="datePickerOnCancelClick" bindchange="bindDateChange" />
</view>
... ... @@ -62,7 +65,7 @@
</view>
<view class="datetime">
<view class="datesel">
<picker mode="date" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindstateDateChange" fields="month">
<picker mode="date" value="{{date}}" start="" end="" bindchange="bindstateDateChange" fields="month">
<view class="picker">
{{statedate}}
</view>
... ... @@ -128,18 +131,18 @@
<view class="shuiitemleft shexiang">大厅左上角</view>
<view class="shuiitemleft derition">进</view>
</view>
<view class="shuiitem">
<view class="shuiitem">
<view class="shuiitemleft shijian">06.01</view>
<view class="shuiitemleft shexiang">大厅左上角</view>
<view class="shuiitemleft derition">进</view>
</view>
<view class="shuiitem">
<view class="shuiitem">
<view class="shuiitemleft shijian">06.01</view>
<view class="shuiitemleft shexiang">大厅左上角</view>
<view class="shuiitemleft derition">进</view>
</view>
<view class="shuiitem">
<view class="shuiitem">
<view class="shuiitemleft shijian">06.01</view>
<view class="shuiitemleft shexiang">车间后方大转盘</view>
<view class="shuiitemleft derition">进</view>
... ...
... ... @@ -5,10 +5,8 @@
padding: 20rpx 69rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.detailname {
color: #999;
font-size: 28rpx;
... ... @@ -22,26 +20,28 @@
display: block;
content: '';
width: 60rpx;
height: 1rpx;
border: 1rpx solid #ff9400;
position: absolute;
left:50%;
right:50%;
left: 50%;
right: 50%;
transform: translate(-50%);
bottom: -20rpx;
}
.date{
display:flex;
.date {
display: flex;
align-items: center;
justify-content: space-between;
height:70rpx;
background: #F3F5F8;
height: 70rpx;
background: #f3f5f8;
padding: 0 31rpx;
box-sizing: border-box
box-sizing: border-box;
}
.dateleft {
width: 23rpx;
height:23rpx;
height: 23rpx;
font-size: 0;
transform: rotate(180deg);
}
... ... @@ -51,19 +51,22 @@
height: 23rpx;
font-size: 0;
}
.datetime{
display:flex;
align-items: center
.datetime {
display: flex;
align-items: center;
}
.datepic{
width:16rpx;
height:16rpx;
.datepic {
width: 16rpx;
height: 16rpx;
font-size: 0;
transform: rotate(90deg);
margin-left:12rpx;
margin-left: 12rpx;
}
.datesel{
color:#666666;
.datesel {
color: #666;
font-size: 28rpx;
}
... ... @@ -76,119 +79,149 @@
border-top: 1rpx solid #f5f5f5;
position: relative;
}
.she{
margin-left:18rpx;
.she {
margin-left: 18rpx;
}
.shebeinum::before{
content:'';
display:block;
width:8rpx;
height:33rpx;
background: #FF9400FF;
position: absolute;
top:43rpx;
left:30rpx;
.she::before {
content: '';
display: block;
width: 8rpx;
height: 33rpx;
background: #ff9400;
position: absolute;
top: 47rpx;
left: 30rpx;
}
.containerzhe{
width:750rpx;
height:500rpx;
.containerzhe {
width: 750rpx;
height: 500rpx;
}
.datetime{
color:#333333;
.datetime {
color: #333;
font-size: 28rpx;
display:flex;
justify-content: center
display: flex;
justify-content: center;
}
.timewrap{
.timewrap {
background: #fff;
height:700rpx;
/* height: 700rpx; */
padding-bottom: 40rpx;
box-sizing: border-box
}
.timetwo{
display:flex;
.timetwo {
display: flex;
align-items: center;
padding: 60rpx 100rpx 50rpx;
box-sizing: border-box;
justify-content: space-between
justify-content: space-between;
}
.timebetin{
display:flex;
.timebetin {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center
align-items: center;
}
.timetop{
color:#999999;
.timetop {
color: #999;
font-size: 24rpx;
}
.timebottom{
color:#999999;
.timebottom {
color: #999;
font-size: 32rpx;
margin-top:10rpx;
margin-top: 10rpx;
}
.seltimeactive{
color:#FF9400;
.seltimeactive {
color: #ff9400;
}
.selnameactive{
color:#333
.selnameactive {
color: #333;
}
.timebox{
width:580rpx;
height:308rpx;
.timebox {
width: 580rpx;
height: 308rpx;
overflow-y: scroll;
margin:0 auto;
margin: 0 auto;
}
.timeboxitem{
display:flex;
.timeboxitem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 78rpx;
box-sizing: border-box;
background: #F9F8FE;
color:#999999;
background: #f9f8fe;
color: #999;
font-size: 28rpx;
border-bottom:1rpx solid #f5f5f5;
border-bottom: 1rpx solid #f5f5f5;
}
.shihead{
display:flex;
.shihead {
display: flex;
align-items: center;
justify-content: space-between;
height:100rpx;
height: 100rpx;
padding: 0 28rpx;
border-bottom:1rpx solid #f5f5f5;
border-bottom: 1rpx solid #f5f5f5;
}
.headitem{
color:#666666;
.headitem {
color: #666;
font-size: 28rpx;
text-align: left
text-align: left;
}
.shuiitem{
display:flex;
.shuiitem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 34rpx 28rpx;
box-sizing: border-box;
border-bottom:1rpx solid #f5f5f5;
border-bottom: 1rpx solid #f5f5f5;
}
.shuiitemleft{
color:#333333;
.shuiitemleft {
color: #333;
font-size: 24rpx;
text-align: left
text-align: left;
}
.shijian{
width:60rpx;
.shijian {
width: 60rpx;
}
.shexiang{
width:196rpx;
.shexiang {
width: 196rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
white-space: nowrap;
}
.derition {
width: 56rpx;
}
.qudingdate {
width: 260rpx;
height: 80rpx;
background: rgba(255, 148, 0, 1);
opacity: 1;
border-radius: 10rpx;
color:#fff;
font-size: 30rpx;
text-align: center;
line-height: 80rpx;
margin:8rpx auto 0;
}
.derition{
width:56rpx;
}
\ No newline at end of file
... ...
... ... @@ -12,7 +12,7 @@ Page({
data: {
showModal: false,
monthList: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
time:'2019.01.01-2019.01.31',
time: '2019.01.01-2019.01.31',
changeColor: -1,
ec: {
... ... @@ -33,49 +33,61 @@ Page({
},
lazyLoad: true, // 延迟加载
showt:false
showt: false
},
},
choice(e) {
this.setData({
showt:false
})
let index = e.currentTarget.dataset.id;
index=index+1
if(index==1||index==3||index==5||index==7||index==8||index==10||index==12){
if(index<10){
index = index + 1
if (index == 1 || index == 3 || index == 5 || index == 7 || index == 8 || index == 10 || index == 12) {
if (index < 10) {
this.setData({
time: "(" + "2019." + "0" + index + ".01" + "-2019." +'0'+ index + ".31" + ")"
time: "(" + "2019." + "0" + index + ".01" + "-2019." + '0' + index + ".31" + ")"
})
}else{
} else {
this.setData({
time: "(" + "2019." + index + ".01" + "-2019." + index + ".31" + ")"
})
}
}else{
if(index<10){
} else {
if (index < 10) {
this.setData({
time: "(" + "2019." + "0" + index + ".01" + "-2019." + '0' + index + ".30" + ")"
})
}else{
} else {
this.setData({
time: "(" + "2019." + index + ".01" + "-2019." + index + ".30" + ")"
time: "(" + "2019." + index + ".01" + "-2019." + index + ".30" + ")"
})
}
}
this.setData({
changeColor: index-1
changeColor: index - 1
})
},
three(){
three() {
this.setData({
time:'近30天',
showt: !this.data.showt
time: '近30天',
showt: !this.data.showt,
changeColor:-1
})
},
toShowModal(e) {
var date = new Date();
var mon = date.getMonth();
this.setData({
showModal: true
showModal: true,
changeColor: mon,
showt:false
})
},
... ... @@ -89,6 +101,37 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
// 获取默认的月份
var date = new Date();
var month = date.getMonth() + 1;
var year = date.getFullYear();
this.setData({
showdate: year + '年' + month + '月'
})
if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
if (month < 10) {
this.setData({
time: "(" + year + "." + "0" + month + ".01" + "-2019." + '0' + month + ".31" + ")"
})
} else {
this.setData({
time: "(" + year + "." + month + ".01" + "-2019." + month + ".31" + ")"
})
}
} else {
if (month < 10) {
this.setData({
time: "(" + year + "." + "0" + month + ".01" + "-2019." + '0' + month + ".30" + ")"
})
} else {
this.setData({
time: "(" + year + "." + month + ".01" + "-2019." + month + ".30" + ")"
})
}
}
this.echartsComponnet = this.selectComponent('#mychart');
... ... @@ -170,10 +213,10 @@ Page({
},
boundaryGap: false, //1.true 数据点在2个刻度直接 2.fals 数据点在分割线上,即刻度值上
data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30','31'],
data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'],
axisLabel: {
textStyle: {
fontSize: 13,
... ... @@ -215,7 +258,7 @@ Page({
type: 'line',
data: [100, 120, 123, 142, 231, 231, 123, 341, 234, 432, 100, 120, 123, 142, 231, 231, 123, 341, 234, 432, 100, 120, 123, 142, 231, 231, 123, 341, 234, 432,253],
data: [100, 120, 123, 142, 231, 231, 123, 341, 234, 432, 100, 120, 123, 142, 231, 231, 123, 341, 234, 432, 100, 120, 123, 142, 231, 231, 123, 341, 234, 432, 253],
symbol: 'true',
... ...
... ... @@ -80,7 +80,7 @@
</view>
<view class="datetime">
<view class="datesel">
<picker mode="date" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindDateChange" fields="month">
<picker mode="date" value="{{date}}" start="" end="" bindchange="bindDateChange" fields="month">
<view class="picker">
{{date}}
</view>
... ...
... ... @@ -208,4 +208,5 @@
.containerzhu{
width:750rpx;
height:1400rpx;
margin-top:20rpx;
}
\ No newline at end of file
... ...
... ... @@ -12,7 +12,7 @@ Page({
data: {
showModal: false,
modalTitle: ["选择时间", "选择地磅", "选择货物"],
modalNum: 2,
modalNum: 0,
monthList: ["货物名字", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘",],
time: '2019.01.01-2019.01.31',
changeColor: 0,
... ... @@ -41,6 +41,17 @@ Page({
btn: "详情"
},
],
watertime: '',
//出库日期
statedate: '',
timestate: 1,
timesel: 1,
startdate: '',
enddate: '',
ec: {
onInit: function (canvas, width, height) {
... ... @@ -64,16 +75,27 @@ Page({
},
},
// 流水详情页
toDetail(){
wx.navigateTo({
url: '/pages/yuanliaomsg/yuanliaoDetail/yuanliaoDetail'
})
},
changeTab(e) {
this.setData({
tabNum: e.currentTarget.dataset.id
})
if (this.data.tabNum == 0) {
this.echartsComponnet = this.selectComponent('#mychart');
//如果是第一次绘制
if (!Chart) {
this.init_echarts(); //初始化图表
} else {
this.setOption(Chart); //更新数据
}
}
},
toShowModal(e) {
... ... @@ -81,16 +103,124 @@ Page({
showModal: true
})
},
//显示日期弹层
datexianshi() {
this.setData({
datechu: true,
currentdate: true
})
//获取年
var date = new Date();
var obj = {}
var year = date.getFullYear();
var month = date.getMonth() + 1;
if (month < 10) {
month = '0' + month
}
var day = date.getDate();
if (day < 10) {
day = "0" + day
}
console.log()
if (typeof (day) == 'number') {
day = day.toString()
}
console.log(typeof (day))
this.setData({
datePickerValue: [year, month, day],
})
},
// 时间地磅货物选择
hideModal() {
selectbang(e) {
this.setData({
showModal: false
modalNum: e.currentTarget.dataset.index
})
},
//开始时间和结束时间
xuanshijan(e) {
this.setData({
timesel: e.currentTarget.dataset.time,
currentdate: true
})
this.datexianshi()
},
datePickerOnSureClick: function (e) {
console.log('datePickerOnSureClick');
if (this.data.timesel == 1) {
console.log(e);
this.setData({
date: `${e.detail.value[0]}${e.detail.value[1]}${e.detail.value[2]}日`,
datePickerValue: e.detail.value,
datePickerIsShow: false,
currentdate: false,
state: 2,
startdate: e.detail.value[0] + '.' + e.detail.value[1] + "." + e.detail.value[2]
});
} else {
console.log(e);
this.setData({
date: `${e.detail.value[0]}${e.detail.value[1]}${e.detail.value[2]}日`,
datePickerValue: e.detail.value,
datePickerIsShow: false,
currentdate: false,
state: 2,
enddate: e.detail.value[0] + '.' + e.detail.value[1] + "." + e.detail.value[2]
});
}
},
datePickerOnCancelClick: function (event) {
console.log('datePickerOnCancelClick');
console.log(event);
this.setData({
datePickerIsShow: false,
currentdate: false,
state: 2
});
},
//确定选择开始日期和结束日期
qudingxuandate() {
this.setData({
datechu: false,
watertime: this.data.startdate + '-' + this.data.enddate
})
},
// 选择地磅
quedibang() {
this.setData({
datechu: false
})
},
// 取消选择
quxiaobang() {
this.setData({
datechu: false,
watertime: app.newnowDate() + '-' + app.endate(),
})
},
choice(e) {
let index = e.currentTarget.dataset.id
this.setData({
changeColor: e.currentTarget.dataset.id
changeColor: e.currentTarget.dataset.id,
watertime: this.data.monthList[index],
})
},
/**
... ... @@ -98,21 +228,39 @@ Page({
*/
onLoad: function (options) {
this.echartsComponnet = this.selectComponent('#mychart');
//如果是第一次绘制
if (!Chart) {
this.init_echarts(); //初始化图表
this.setData({
statedate: app.monthnowDate(),
startdate: app.newnowDate(),
enddate: app.endate()
})
let newdate = this.data.statedate.split("-");
this.setData({
showdate: newdate[0] + '年' + newdate[1] + '月',
watertime: app.newnowDate() + '-' + app.endate(),
})
} else {
this.setOption(Chart); //更新数据
},
}
//跳转详情页
godetail(){
wx.navigateTo({
url: '/pages/companybox/zhishudetail/yuanliaomsg/yuanliaoDetail/yuanliaoDetail',
})
},
//选择日期
bindstateDateChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
statedate: e.detail.value
})
let newdate = this.data.statedate.split("-");
this.setData({
showdate: newdate[0] + '年' + newdate[1] + '月'
})
},
//初始化图表
... ... @@ -224,7 +372,7 @@ Page({
type: 'line',
data: [10, 12, 13, 14, 23, 31, 23, 31, 48, 43, 55, 61, 46, 42, 31, 31, 23, 47, 57, 63, 69, 77, 82, 82, 93, 31, 13, 34, 34, 43, 25],
data: [10, 12, 13, 14, 23, 31, 23, 31, 48, 43, 1, 100, 23, 42, 21, 31, 23, 34, 97, 43, 59, 67, 82, 42, 23, 31, 13, 34, 34, 43, 25],
symbol: 'true',
... ... @@ -234,7 +382,7 @@ Page({
lineStyle: {
color: '#ED3676'
color: '#46C5C8'
}
... ... @@ -265,6 +413,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.echartsComponnet = this.selectComponent('#mychart');
... ...
... ... @@ -2,6 +2,7 @@
"navigationBarTextStyle": "black",
"navigationBarTitleText": "原料",
"usingComponents": {
"ec-canvas": "../../../../../ec-canvas/ec-canvas"
"ec-canvas": "../../../../../ec-canvas/ec-canvas",
"date-picker": "../../../../../components/date-picker/date-picker"
}
}
\ 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-mask" bindtap="hideModal" wx:if="{{datechu}}"></view>
<view wx:if="{{datechu}}">
<view class="modal-content">
<!-- 选项卡 -->
<!-- 时间 地磅 货物 选项卡 -->
<view class="modal_year">
<view class="modal_single {{modalNum == index ?'modal_choice':''}}" wx:for="{{modalTitle}}" wx:key="">{{item}}</view>
<view class="modal_single {{modalNum == index ?'modal_choice':''}}" wx:for="{{modalTitle}}" wx:key="" bindtap='selectbang' data-index="{{index}}">{{item}}</view>
</view>
<!-- 月份 -->
<scroll-view scroll-y style="height: 400px;">
<view class="modal_month">
<view class="month_single {{changeColor == index?'change':''}}" wx:for="{{monthList}}" wx:key="" data-id="{{index}}" catchtap="choice">{{item}}</view>
<!-- 选择时间 -->
<view class="timewrap" wx:if="{{modalNum==0}}">
<view class="timewrap">
<!-- 开始时间和结束时间 -->
<view class="timetwo">
<view class="timebetin" bindtap="xuanshijan" data-time="1">
<view class="timetop {{timesel==1?'seltimeactive':''}}">开始时间</view>
<view class="timebottom {{timesel==1?'selnameactive':''}}">{{startdate}}</view>
</view>
<view class="timebetin" bindtap="xuanshijan" data-time="2">
<view class="timetop {{timesel==2?'seltimeactive':''}}">结束时间</view>
<view class="timebottom {{timesel==2?'selnameactive':''}}">{{enddate}}</view>
</view>
</view>
<view class="timebox" wx:if="{{currentdate}}">
<view class="timeboxitem {{sel==index?'timeboxactive':''}}" wx:for="{{timearr}}" wx:key="">
<view class="itemcontent">{{item.year}}</view>
<view class="itemcontent">{{item.month}}</view>
<view class="itemcontent">{{item.day}}</view>
</view>
</view>
<view class="qudingdate" wx:else bindtap='qudingxuandate'>确定</view>
<view wx:if="{{currentdate}}">
<date-picker id="date-picker" value="{{datePickerValue}}" isShow="{{datePickerIsShow}}" bindsureclick="datePickerOnSureClick" bindcancelclick="datePickerOnCancelClick" />
</view>
</view>
</view>
</scroll-view>
<view class='btns'>
<view class="cacle" bindtap="hideModal">取消</view>
<view class="cacle sure" bindtap="hideModal">确定</view>
<!-- 选择地磅 选择货物 -->
<view class="dibang" wx:else>
<!-- 选择地磅 -->
<scroll-view scroll-y style="height: 400px;" wx:if="{{modalNum==1}}">
<view class="modal_month">
<view class="month_single {{changeColor == index?'change':''}}" wx:for="{{monthList}}" wx:key="" data-id="{{index}}" catchtap="choice">{{item}}</view>
</view>
</scroll-view>
<!--选择货物 -->
<scroll-view scroll-y style="height: 400px;" wx:if="{{modalNum==2}}">
<view class="modal_month">
<view class="month_single {{changeColor == index?'change':''}}" wx:for="{{monthList}}" wx:key="" data-id="{{index}}" catchtap="choice">{{item}}</view>
</view>
</scroll-view>
<view class='btns'>
<view class="cacle" bindtap="quxiaobang">取消</view>
<view class="cacle sure" bindtap="quedibang">确定</view>
</view>
</view>
</view>
</view>
<!-- 选项卡 -->
<!-- 出库 流水选项卡 -->
<view class="tab">
<view wx:for="{{tabList}}" wx:key="" class="tab_single {{tabNum == index?'tab_border':''}}" bindtap='changeTab' data-id="{{index}}">{{item}}</view>
</view>
... ... @@ -30,9 +91,15 @@
</view>
<view class="date_time">
<!-- 出库 -->
<view wx:if="{{tabNum == 0}}">2019.06</view>
<view wx:if="{{tabNum == 0}}">
<picker mode="date" value="{{date}}" start="" end="" bindchange="bindstateDateChange" fields="month">
<view class="picker">
{{statedate}}
</view>
</picker>
</view>
<!-- 流水 -->
<view wx:if="{{tabNum == 1}}" bindtap='toShowModal'>{{time}}</view>
<view wx:if="{{tabNum == 1}}" bindtap='datexianshi'>{{watertime}}</view>
<view class="rowimg">
<image src='/img/row.png' class="down"></image>
</view>
... ... @@ -44,7 +111,7 @@
<!-- 出库 -->
<view wx:if="{{tabNum == 0}}">
<view class="cp_title">
成品入库信息
原料入库信息
</view>
<view class="total">
重量总计(吨)
... ... @@ -56,7 +123,7 @@
<ec-canvas id="mychart" canvas-id="mychart-line" ec="{{ ec }}"></ec-canvas>
</view>
<view class="total_power">
<view>2019年6月</view>
<view>{{showdate}}</view>
</view>
</view>
</view>
... ... @@ -68,12 +135,12 @@
<view class="table_title">
<view wx:for="{{tableTitle}}" wx:key="">{{item}}</view>
</view>
<view class="table_tr" wx:for="{{trList}}" wx:key="">
<view class="table_tr" wx:for="{{trList}}" wx:key="" bindtap="godetail">
<view class="tr_time">{{item.date}}</view>
<view class="tr_pos">{{item.position}}</view>
<view class="tr_name">{{item.name}}</view>
<view class="tr_time">{{item.num}}</view>
<view class="tr_btn" bindtap='toDetail'>{{item.btn}}</view>
<view class="tr_btn">{{item.btn}}</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/qiyeyongdian/detail/detail.wxss */
@import "../../member/member.wxss";
.search_month {
width: 686rpx;
... ... @@ -86,7 +87,7 @@ ec-canvas {
z-index: 9500;
width: 100%;
/* height: 55%; */
overflow: hidden;
/* overflow: hidden; */
/* padding: 120rpx 50rpx 50rpx; */
background: #fff;
border-radius: 2rpx;
... ... @@ -101,19 +102,34 @@ ec-canvas {
align-items: center;
font-size: 28rpx;
color: #666;
padding-top: 20rpx;
padding: 20rpx 0;
border:1rpx solid #f5f5f5;
border-left:none;
border-right: none;
}
.modal_single{
border-bottom:4rpx solid #fff;
}
.modal_choice{
border-bottom-color: #FF9400;
color: #FF9400;
font-weight: 600;
padding-bottom:20rpx;
position: relative;
}
.modal_choice::after{
display:bolck;
content:'';
width:60rpx;
border:1rpx solid #FF9400;
position: absolute;
bottom:-20rpx;
left:50%;
right:50%;
transform: translate(-50%)
}
/* 选项卡 */
... ... @@ -123,7 +139,7 @@ ec-canvas {
justify-content: space-around;
align-items: center;
padding-top: 20rpx;
color: #ff9400;
color: #666;
border-top: 1rpx solid #f5f5f5;
}
... ... @@ -134,6 +150,7 @@ ec-canvas {
.tab_border {
border-bottom: 4rpx solid #ff9400;
color:#ff9400;
}
/* 月份 */
... ...
... ... @@ -29,7 +29,9 @@ Page({
name: '中国银行',
sel: false
}
]
],
fenup:true,
timeup:true
},
/**
... ... @@ -80,6 +82,18 @@ Page({
})
},
//评分筛选
pingfen(){
this.setData({
fenup:!this.data.fenup
})
},
// 时间筛选
creattime(){
this.setData({
timeup:!this.data.timeup
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -22,17 +22,23 @@
<view class="qibrand">
<view class="branditem ming">企业名称</view>
<view class="branditem ">行业分类</view>
<view class="branditem ping">
<view class="branditem ping" bindtap="pingfen" >
<text>评分</text>
<view class="brandimg">
<view class="brandimg" wx:if="{{fenup}}">
<image src="/img/rowup.png"></image>
</view>
<view class="brandimg" wx:else>
<image src="/img/rowdown.png"></image>
</view>
</view>
<view class="branditem ping">
<view class="branditem ping" bindtap="creattime">
<text>创建时间</text>
<view class="brandimg">
<view class="brandimg" wx:if="{{timeup}}">
<image src="/img/rowup.png"></image>
</view>
<view class="brandimg" wx:else>
<image src="/img/rowdown.png"></image>
</view>
</view>
</view>
... ... @@ -166,12 +172,12 @@
<view class="fenduan">
<view class="fenleft">
<input placeholder='0.0' type="number" />
<input placeholder='0.0' type="number" placeholder-class='entershuzi'/>
</view>
<view class="fenheng">-</view>
<view class="fenleft">
<input placeholder='0.0' type="number" />
<input placeholder='0.0' type="number" placeholder-class='entershuzi' />
</view>
</view>
... ...
... ... @@ -198,6 +198,16 @@
color: #ccccccff;
font-size: 27rpx;
width: 350rpx;
height:64rpx;
line-height: 64rpx;
}
.fenleft input{
height:64rpx;
line-height: 64rpx;
}
.entershuzi{
color: #ccccccff;
font-size: 27rpx;
}
.fenright {
... ...