分享/朋友圈/折线图单位
parent
aef995f446
commit
d4cc5a025e
3
main.js
3
main.js
|
@ -24,6 +24,9 @@ export function createApp() {
|
|||
}
|
||||
// #endif
|
||||
|
||||
import share from './mixins/share.js'
|
||||
Vue.mixin(share)
|
||||
|
||||
//接口 this.api
|
||||
import api from '@/api/driverapi.js'
|
||||
Vue.prototype.api = api;
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
export default {
|
||||
onShareTimeline() {
|
||||
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
||||
let curRoute = routes[routes.length - 1].route // 获取当前页面路由,也就是最后一个打开的页面路由
|
||||
|
||||
return {
|
||||
path: '/pages/timeEnvironment/timeEnvironment',
|
||||
// path:"/pages/index/index", //不设置默认当前页面
|
||||
title: "温室智慧云",
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
// console.log(res)
|
||||
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
||||
let curRoute = routes[routes.length - 1].route // 获取当前页面路由,也就是最后一个打开的页面路由
|
||||
// console.log(curRoute+'?u_id='+uni.getStorageSync('u_id'))
|
||||
return {
|
||||
path: '/pages/timeEnvironment/timeEnvironment',
|
||||
|
||||
title: "温室智慧云",
|
||||
|
||||
// imageUrl: '',
|
||||
// query:'u_id='+uni.getStorageSync('u_id'),
|
||||
success(res) {
|
||||
uni.showToast({
|
||||
title: '分享成功'
|
||||
})
|
||||
},
|
||||
fail(res) {
|
||||
uni.showToast({
|
||||
title: '分享失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<view class="content">
|
||||
<view class="number">
|
||||
{{ valuePH }}
|
||||
{{ valuePH + unit }}
|
||||
</view>
|
||||
<view class="data_analysis">
|
||||
<image src="../../static/data_analysis.png" mode=""></image>
|
||||
|
@ -62,9 +62,12 @@
|
|||
yAxis: {
|
||||
gridType: "dash",
|
||||
dashLength: 2,
|
||||
showTitle: true,
|
||||
data: [{
|
||||
title: '',
|
||||
min: 0,
|
||||
max: 14
|
||||
// max: 14
|
||||
titleOffsetY: -5,
|
||||
}]
|
||||
},
|
||||
extra: {
|
||||
|
@ -83,6 +86,7 @@
|
|||
valuePH:'',
|
||||
valuePHList:[],
|
||||
newValuePHList:[],
|
||||
unit:'',
|
||||
|
||||
titleName:'',
|
||||
echartName:''
|
||||
|
@ -94,6 +98,7 @@
|
|||
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log(option);
|
||||
if(option.id){
|
||||
this.equipmentId = option.id
|
||||
}
|
||||
|
@ -103,6 +108,10 @@
|
|||
if(option.name){
|
||||
this.echartName = option.name
|
||||
}
|
||||
if(option.unit){
|
||||
this.unit = option.unit
|
||||
this.opts.yAxis.data[0].title = option.unit
|
||||
}
|
||||
|
||||
this.titleName = this.getStatus(option.equipmentNumber,option.targetValue)
|
||||
},
|
||||
|
@ -132,7 +141,7 @@
|
|||
url:this.api.chart_fsdata + '?equipmentId=' + this.equipmentId,
|
||||
method:'POST'
|
||||
}).then(res=>{
|
||||
// console.log(res,'获取折线图数据');
|
||||
console.log(res,'获取折线图数据');
|
||||
res.data.forEach((i,index)=>{
|
||||
this.categoriesList.push(i.time);
|
||||
this.valuePHList.push(i.value)
|
||||
|
@ -141,9 +150,9 @@
|
|||
// console.log(this.categoriesList,'this.categoriesList');
|
||||
// console.log(this.valuePHList,'this.valuePHList');
|
||||
this.newValuePHList = this.valuePHList.map((e,index)=>{
|
||||
return e[this.titleName+this.echartName]
|
||||
return e[this.titleName+this.echartName] == undefined ? '' : e[this.titleName+this.echartName]
|
||||
})
|
||||
// console.log(this.newValuePHList,'121212212121211111111');
|
||||
console.log(this.newValuePHList,'121212212121211111111');
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<text>{{ item1.deviceTypeName }}</text>
|
||||
</view>
|
||||
<view class="detail">
|
||||
<view class="item" v-for="(item2,index2) in item1.childList" :key="index2" @click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue)">
|
||||
<view class="item" v-for="(item2,index2) in item1.childList" :key="index2" @click="toTarget_water_fertilizer_PH(item2.equipmentId,item2.environmentData,item2.environmentDataId,item2.equipmentNumber,item2.targetValue,getTypeList(item2.formula))">
|
||||
<image :src='`../../static/icon/icon${ (index2 + 1) < 9 ? (index2 + 1) : 1 }.png`' mode=""></image>
|
||||
<view class="info">
|
||||
<view class="">{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}</view>
|
||||
|
@ -354,9 +354,9 @@
|
|||
},
|
||||
|
||||
// 跳转到折线图
|
||||
toTarget_water_fertilizer_PH(id,data,name,equipmentNumber,targetValue){
|
||||
toTarget_water_fertilizer_PH(id,data,name,equipmentNumber,targetValue,unit){
|
||||
uni.navigateTo({
|
||||
url:'/pages/target_water_fertilizer_PH/target_water_fertilizer_PH?id=' + id + '&data=' + data + '&name=' + name + '&equipmentNumber=' + equipmentNumber + '&targetValue=' + targetValue
|
||||
url:'/pages/target_water_fertilizer_PH/target_water_fertilizer_PH?id=' + id + '&data=' + data + '&name=' + name + '&equipmentNumber=' + equipmentNumber + '&targetValue=' + targetValue + '&unit=' + unit
|
||||
})
|
||||
},
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -17,6 +17,7 @@ var _App = _interopRequireDefault(__webpack_require__(/*! ./App */ 27));
|
|||
var _uviewUi = _interopRequireDefault(__webpack_require__(/*! uview-ui */ 33));
|
||||
var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
|
||||
__webpack_require__(/*! ./uni.promisify.adaptor */ 62);
|
||||
var _share = _interopRequireDefault(__webpack_require__(/*! ./mixins/share.js */ 359));
|
||||
var _driverapi = _interopRequireDefault(__webpack_require__(/*! @/api/driverapi.js */ 63));
|
||||
var _nvuerequest = __webpack_require__(/*! ./api/nvuerequest */ 65);
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
||||
|
@ -28,6 +29,7 @@ _vue.default.config.productionTip = false;
|
|||
_App.default.mpType = 'app';
|
||||
var app = new _vue.default(_objectSpread({}, _App.default));
|
||||
createApp(app).$mount();
|
||||
_vue.default.mixin(_share.default);
|
||||
|
||||
//接口 this.api
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -228,9 +228,12 @@ var _default = {
|
|||
yAxis: {
|
||||
gridType: "dash",
|
||||
dashLength: 2,
|
||||
showTitle: true,
|
||||
data: [{
|
||||
title: '',
|
||||
min: 0,
|
||||
max: 14
|
||||
// max: 14
|
||||
titleOffsetY: -5
|
||||
}]
|
||||
},
|
||||
extra: {
|
||||
|
@ -248,6 +251,7 @@ var _default = {
|
|||
valuePH: '',
|
||||
valuePHList: [],
|
||||
newValuePHList: [],
|
||||
unit: '',
|
||||
titleName: '',
|
||||
echartName: ''
|
||||
};
|
||||
|
@ -257,6 +261,7 @@ var _default = {
|
|||
// this.getServerData();
|
||||
},
|
||||
onLoad: function onLoad(option) {
|
||||
console.log(option);
|
||||
if (option.id) {
|
||||
this.equipmentId = option.id;
|
||||
}
|
||||
|
@ -266,6 +271,10 @@ var _default = {
|
|||
if (option.name) {
|
||||
this.echartName = option.name;
|
||||
}
|
||||
if (option.unit) {
|
||||
this.unit = option.unit;
|
||||
this.opts.yAxis.data[0].title = option.unit;
|
||||
}
|
||||
this.titleName = this.getStatus(option.equipmentNumber, option.targetValue);
|
||||
},
|
||||
mounted: function mounted() {
|
||||
|
@ -294,7 +303,7 @@ var _default = {
|
|||
url: this.api.chart_fsdata + '?equipmentId=' + this.equipmentId,
|
||||
method: 'POST'
|
||||
}).then(function (res) {
|
||||
// console.log(res,'获取折线图数据');
|
||||
console.log(res, '获取折线图数据');
|
||||
res.data.forEach(function (i, index) {
|
||||
_this2.categoriesList.push(i.time);
|
||||
_this2.valuePHList.push(i.value);
|
||||
|
@ -303,9 +312,9 @@ var _default = {
|
|||
// console.log(this.categoriesList,'this.categoriesList');
|
||||
// console.log(this.valuePHList,'this.valuePHList');
|
||||
_this2.newValuePHList = _this2.valuePHList.map(function (e, index) {
|
||||
return e[_this2.titleName + _this2.echartName];
|
||||
return e[_this2.titleName + _this2.echartName] == undefined ? '' : e[_this2.titleName + _this2.echartName];
|
||||
});
|
||||
// console.log(this.newValuePHList,'121212212121211111111');
|
||||
console.log(_this2.newValuePHList, '121212212121211111111');
|
||||
});
|
||||
},
|
||||
// 判断是否是平均或者目标,或者是1#
|
||||
|
|
|
@ -1 +1 @@
|
|||
<view class="target_water_fertilizer_PH data-v-3d983434"><u-navbar vue-id="454957e0-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="{{titleName+echartName}}" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" class="data-v-3d983434" bind:__l="__l"></u-navbar><view class="navbar data-v-3d983434"><image src="../../static/PH_bg.png" mode class="data-v-3d983434"></image></view><view class="content data-v-3d983434"><view class="number data-v-3d983434">{{''+valuePH+''}}</view><view class="data_analysis data-v-3d983434"><image src="../../static/data_analysis.png" mode class="data-v-3d983434"></image><text class="data-v-3d983434">数据分析</text></view><view class="echart data-v-3d983434"><view class="title data-v-3d983434"><image src="../../static/icon_ph.png" mode class="data-v-3d983434"></image><text class="data-v-3d983434">{{titleName+echartName}}</text></view><view id="echart_p" class="data-v-3d983434"><qiun-data-charts vue-id="454957e0-2" type="line" opts="{{opts}}" chartData="{{chartData}}" ontouch="{{true}}" background="none" class="data-v-3d983434" bind:__l="__l"></qiun-data-charts></view></view></view></view>
|
||||
<view class="target_water_fertilizer_PH data-v-3d983434"><u-navbar vue-id="454957e0-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="{{titleName+echartName}}" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" class="data-v-3d983434" bind:__l="__l"></u-navbar><view class="navbar data-v-3d983434"><image src="../../static/PH_bg.png" mode class="data-v-3d983434"></image></view><view class="content data-v-3d983434"><view class="number data-v-3d983434">{{''+(valuePH+unit)+''}}</view><view class="data_analysis data-v-3d983434"><image src="../../static/data_analysis.png" mode class="data-v-3d983434"></image><text class="data-v-3d983434">数据分析</text></view><view class="echart data-v-3d983434"><view class="title data-v-3d983434"><image src="../../static/icon_ph.png" mode class="data-v-3d983434"></image><text class="data-v-3d983434">{{titleName+echartName}}</text></view><view id="echart_p" class="data-v-3d983434"><qiun-data-charts vue-id="454957e0-2" type="line" opts="{{opts}}" chartData="{{chartData}}" ontouch="{{true}}" background="none" class="data-v-3d983434" bind:__l="__l"></qiun-data-charts></view></view></view></view>
|
|
@ -131,12 +131,14 @@ var render = function () {
|
|||
var $orig = _vm.__get_orig(item1)
|
||||
var l0 = _vm.__map(item1.childList, function (item2, index2) {
|
||||
var $orig = _vm.__get_orig(item2)
|
||||
var m0 = _vm.getStatus(item2.equipmentNumber, item2.targetValue)
|
||||
var m1 = _vm.getTypeList(item2.formula)
|
||||
var m0 = _vm.getTypeList(item2.formula)
|
||||
var m1 = _vm.getStatus(item2.equipmentNumber, item2.targetValue)
|
||||
var m2 = _vm.getTypeList(item2.formula)
|
||||
return {
|
||||
$orig: $orig,
|
||||
m0: m0,
|
||||
m1: m1,
|
||||
m2: m2,
|
||||
}
|
||||
})
|
||||
return {
|
||||
|
@ -754,9 +756,9 @@ var _default = {
|
|||
});
|
||||
},
|
||||
// 跳转到折线图
|
||||
toTarget_water_fertilizer_PH: function toTarget_water_fertilizer_PH(id, data, name, equipmentNumber, targetValue) {
|
||||
toTarget_water_fertilizer_PH: function toTarget_water_fertilizer_PH(id, data, name, equipmentNumber, targetValue, unit) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/target_water_fertilizer_PH/target_water_fertilizer_PH?id=' + id + '&data=' + data + '&name=' + name + '&equipmentNumber=' + equipmentNumber + '&targetValue=' + targetValue
|
||||
url: '/pages/target_water_fertilizer_PH/target_water_fertilizer_PH?id=' + id + '&data=' + data + '&name=' + name + '&equipmentNumber=' + equipmentNumber + '&targetValue=' + targetValue + '&unit=' + unit
|
||||
});
|
||||
},
|
||||
// 数据单位
|
||||
|
|
|
@ -1 +1 @@
|
|||
<view class="timeEnvironment data-v-34c343d8"><u-navbar vue-id="63a4351c-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="实时环境" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" class="data-v-34c343d8" bind:__l="__l"></u-navbar><view class="navbar data-v-34c343d8"><image src="../../static/timeEnvironment_bg.png" mode class="data-v-34c343d8"></image></view><view class="content data-v-34c343d8"><view class="title data-v-34c343d8"><image src="../../static/logo_1.png" mode class="data-v-34c343d8"></image><view class="right data-v-34c343d8"><view class="data-v-34c343d8">温室智慧云</view><view class="data-v-34c343d8">Greenhouse wisdom Cloud</view></view></view><view class="subtitle data-v-34c343d8">欢迎使用温室智慧云数据统计</view><block wx:for="{{$root.l1}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><view class="waterAndFertilizerParams data-v-34c343d8"><view class="nav data-v-34c343d8"><image src="../../static/PH.png" mode class="data-v-34c343d8"></image><text class="data-v-34c343d8">{{item1.$orig.deviceTypeName}}</text></view><view class="detail data-v-34c343d8"><block wx:for="{{item1.l0}}" wx:for-item="item2" wx:for-index="index2" wx:key="index2"><view data-event-opts="{{[['tap',[['toTarget_water_fertilizer_PH',['$0','$1','$2','$3','$4'],[[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentData']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentDataId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentNumber']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'targetValue']]]]]]]}}" class="item data-v-34c343d8" bindtap="__e"><image src="{{'../../static/icon/icon'+(index2+1<9?index2+1:1)+'.png'}}" mode class="data-v-34c343d8"></image><view class="info data-v-34c343d8"><view class="data-v-34c343d8">{{item2.m0+item2.$orig.environmentDataId}}</view><view class="data-v-34c343d8">{{item2.$orig.environmentData+item2.m1}}</view></view></view></block></view><view class="updateTime data-v-34c343d8"><label class="_span data-v-34c343d8"></label><label class="_span data-v-34c343d8">{{"*更新数据时间 : "+updateTime}}</label></view></view></block></view></view>
|
||||
<view class="timeEnvironment data-v-34c343d8"><u-navbar vue-id="63a4351c-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="实时环境" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" class="data-v-34c343d8" bind:__l="__l"></u-navbar><view class="navbar data-v-34c343d8"><image src="../../static/timeEnvironment_bg.png" mode class="data-v-34c343d8"></image></view><view class="content data-v-34c343d8"><view class="title data-v-34c343d8"><image src="../../static/logo_1.png" mode class="data-v-34c343d8"></image><view class="right data-v-34c343d8"><view class="data-v-34c343d8">温室智慧云</view><view class="data-v-34c343d8">Greenhouse wisdom Cloud</view></view></view><view class="subtitle data-v-34c343d8">欢迎使用温室智慧云数据统计</view><block wx:for="{{$root.l1}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><view class="waterAndFertilizerParams data-v-34c343d8"><view class="nav data-v-34c343d8"><image src="../../static/PH.png" mode class="data-v-34c343d8"></image><text class="data-v-34c343d8">{{item1.$orig.deviceTypeName}}</text></view><view class="detail data-v-34c343d8"><block wx:for="{{item1.l0}}" wx:for-item="item2" wx:for-index="index2" wx:key="index2"><view data-event-opts="{{[['tap',[['toTarget_water_fertilizer_PH',['$0','$1','$2','$3','$4',item2.m0],[[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentData']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentDataId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentNumber']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'targetValue']]]]]]]}}" class="item data-v-34c343d8" bindtap="__e"><image src="{{'../../static/icon/icon'+(index2+1<9?index2+1:1)+'.png'}}" mode class="data-v-34c343d8"></image><view class="info data-v-34c343d8"><view class="data-v-34c343d8">{{item2.m1+item2.$orig.environmentDataId}}</view><view class="data-v-34c343d8">{{item2.$orig.environmentData+item2.m2}}</view></view></view></block></view><view class="updateTime data-v-34c343d8"><label class="_span data-v-34c343d8"></label><label class="_span data-v-34c343d8">{{"*更新数据时间 : "+updateTime}}</label></view></view></block></view></view>
|
Loading…
Reference in New Issue