This commit is contained in:
zmj 2023-10-17 09:49:06 +08:00
parent 28192757cb
commit 3113639e31
85 changed files with 4901 additions and 0 deletions

20
.hbuilderx/launch.json Normal file
View File

@ -0,0 +1,20 @@
{
// launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote
"version" : "0.0",
"configurations" : [
{
"app-plus" : {
"launchtype" : "local"
},
"default" : {
"launchtype" : "local"
},
"type" : "uniCloud"
},
{
"playground" : "standard",
"type" : "uni-app:app-android"
}
]
}

6
api/test.js Normal file
View File

@ -0,0 +1,6 @@
import oahttp from "@/utils/oahttp.js";
/**
* 我的公司
*/
export const companyMine = (data) => oahttp.post('/SuYuan/monitorDetail', data)

59
config/app.js Normal file
View File

@ -0,0 +1,59 @@
let httpApiThree;
let httpApi; // 总域名
let httpApiTwo; // 物流系统域名
let httpApiTest
const env = 'dev'; // 开发
// const env = 'prod'; // 生产
// const env = 'prew'; // 预上线
switch (env) {
case 'dev':
httpApi = 'http://192.168.1.15/adminapi'
}
// #ifdef H5
// httpApiThree = 'baseUrlTest' //生产
// #endif
// if (process.env.NODE_ENV === "development") {
// httpApi = "http://192.168.0.222:8324"
// // #ifdef MP-WEIXIN
// httpApiTwo = "http://cms.com"
// httpApiThree = 'http://ceshi-oa.lihaink.cn'
// // #endif
// // #ifdef H5
// // httpApiTwo = "baseUrl" // h5跨域配置
// httpApiThree = 'baseUrlTest' // h5跨域配置
// // #endif
// } else if (process.env.NODE_ENV === 'production') {
// httpApi = 'https://shop.lihaink.cn' // 生产
// httpApiTwo = 'https://nk.lihaink.cn' // 生产
// httpApiThree = 'http://ceshi-oa.lihaink.cn' //生产
// }
module.exports = {
// 请求域名 格式: https://您的域名
HTTP_REQUEST_URL: httpApi,
// #ifdef H5
//H5接口是浏览器地址
// HTTP_REQUEST_URL: httpApi || window.location.protocol + "//" + window.location.host,
// HTTP_REQUEST_URL_THREE: httpApiThree || window.location.protocol + "//" + window.location.host,
// #endif
HEADER: {
'content-type': 'application/json',
//#ifdef MP
'Form-type': 'routine',
//#endif
//#ifdef APP-PLUS
'Form-type': 'app',
//#endif
},
// 回话密钥名称 请勿修改此配置
// TOKENNAME: 'X-Token',
TOKENNAME: 'token',
// 缓存时间 0 永久
EXPIRE: 0,
};

41
config/cache.js Normal file
View File

@ -0,0 +1,41 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
module.exports = {
//token
LOGIN_STATUS: 'LOGIN_STATUS_TOKEN',
// uid
UID:'UID',
//<2F>û<EFBFBD>
USER_INFO: 'USER_INFO',
//token<65><6E><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
EXPIRES_TIME: 'EXPIRES_TIME',
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>Ȩ
WX_AUTH: 'WX_AUTH',
//<2F><><EFBFBD>ں<EFBFBD><DABA><EFBFBD>Ȩcode
STATE_KEY: 'wx_authorize_state',
//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
LOGINTYPE: 'loginType',
//<2F><><EFBFBD>ں<EFBFBD><DABA><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>
BACK_URL: 'login_back_url',
// С<><D0A1><EFBFBD><EFBFBD>code
STATE_R_KEY: 'roution_authorize_state',
//<2F><>ȨlogoС<6F><D0A1><EFBFBD><EFBFBD>
LOGO_URL: 'LOGO_URL',
//模板缓存
SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE',
TIPS_KEY: 'TIPS_KEY',
SPREAD: 'spread',
//缓存经度
CACHE_LONGITUDE: 'LONGITUDE',
//缓存纬度
CACHE_LATITUDE: 'LATITUDE',
}

104
libs/login.js Normal file
View File

@ -0,0 +1,104 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import store from "../store";
import Cache from '../utils/cache';
// #ifdef H5
// import { isWeixin } from "../utils";
// import auth from './wechat';
// #endif
import {
LOGIN_STATUS,
USER_INFO,
EXPIRES_TIME,
STATE_R_KEY
} from './../config/cache';
function prePage() {
let pages = getCurrentPages();
console.log(pages)
let prePage = pages[pages.length - 2];
// #ifdef H5
return prePage;
// #endif
//return prePage.$vm;
}
export function toLogin(push, pathLogin) {
store.commit("LOGOUT");
let path = prePage();
if (path) {
path = path.router;
if (path == undefined) {
path = location.pathname + location.search;
}
}
// #ifdef MP
uni.navigateTo({
url: '/page/users/login/login'
})
// #endif
// #ifdef H5
else {
path = location.pathname + location.search;
}
// #endif
if (!pathLogin)
pathLogin = '/page/users/login/login'
Cache.set('login_back_url', path);
uni.navigateTo({
url: '/pages/users/login/login'
})
// #ifdef H5
if (isWeixin()) {
// auth.oAuth(); // 微信授权
uni.navigateTo({
url: '/pages/users/login/login'
})
} else {
if (path !== pathLogin) {
push ? uni.navigateTo({
url: '/pages/users/login/login'
}) : uni.reLaunch({
url: '/pages/users/login/login'
});
}
}
// #endif
// #ifdef APP-PLUS
uni.navigateTo({
url: '/pages/users/login/login',
})
// #endif
}
export function checkLogin() {
let token = Cache.get(LOGIN_STATUS);
let expiresTime = Cache.get(EXPIRES_TIME) || 0;
let newTime = Math.round(new Date() / 1000);
if (expiresTime < newTime || !token) {
Cache.clear(LOGIN_STATUS);
Cache.clear(EXPIRES_TIME);
Cache.clear(USER_INFO);
Cache.clear(STATE_R_KEY);
return false;
} else {
store.commit('UPDATE_LOGIN', token);
let userInfo = Cache.get(USER_INFO, true);
if (userInfo) {
store.commit('UPDATE_USERINFO', userInfo);
}
return true;
}
}

186
libs/routine.js Normal file
View File

@ -0,0 +1,186 @@
import store from '@/store';
import { checkLogin } from './login';
import { login } from '@/api/pubic.js';
import Cache from '@/utils/cache';
import { STATE_R_KEY, USER_INFO, EXPIRES_TIME, LOGIN_STATUS } from '@/config/cache';
class Routine {
constructor() {
this.scopeUserInfo = 'scope.userInfo';
}
async getUserCode() {
let isAuth = await this.isAuth(),
code = '';
if (isAuth)
code = await this.getCode();
return code;
}
/**
* 获取用户信息
*/
getUserInfo() {
let that = this,
code = this.getUserCode();
return new Promise((resolve, reject) => {
uni.getUserInfo({
lang: 'zh_CN',
success(user) {
if (code) user.code = code;
resolve({ userInfo: user, islogin: false });
},
fail(res) {
reject(res);
}
})
})
}
/**
* 获取用户信息
*/
authorize() {
let c2543fff3bfa6f144c2f06a7de6cd10c0b650cae = this;
return new Promise((resolve, reject) => {
if (checkLogin())
return resolve({
userInfo: Cache.get(USER_INFO, true),
islogin: true,
});
uni.authorize({
scope: c2543fff3bfa6f144c2f06a7de6cd10c0b650cae.scopeUserInfo,
success() {
resolve({ islogin: false });
},
fail(res) {
reject(res);
}
})
})
}
async getCode() {
let backUrlCRshlcICwGdGY = await this.getProvider();
return new Promise((resolve, reject) => {
if (Cache.has(STATE_R_KEY)) {
return resolve(Cache.get(STATE_R_KEY));
}
uni.login({
provider: backUrlCRshlcICwGdGY,
success(res) {
if (res.code) Cache.set(STATE_R_KEY, res.code, 10800);
return resolve(res.code);
},
fail() {
return reject(null);
}
})
})
}
/**
* 获取服务供应商
*/
getProvider() {
return new Promise((resolve, reject) => {
uni.getProvider({
service: 'oauth',
success(res) {
resolve(res.provider);
},
fail() {
resolve(false);
}
});
});
}
/**
* 是否授权
*/
isAuth() {
let that = this;
return new Promise((resolve, reject) => {
uni.getSetting({
success(res) {
if (!res.authSetting[that.scopeUserInfo]) {
resolve(true)
} else {
resolve(true);
}
},
fail() {
resolve(false);
}
});
});
}
getUserProfile(code) {
return new Promise((resolve, reject) => {
uni.getUserProfile({
lang: 'zh_CN',
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success(user) {
if (code) user.code = code;
resolve({
userInfo: user,
islogin: false
});
},
fail(res) {
reject(res);
}
})
})
}
/**
* 小程序比较版本信息
* @param v1 当前版本
* @param v2 进行比较的版本
* @return boolen
*
*/
compareVersion(v1, v2) {
v1 = v1.split('.')
v2 = v2.split('.')
const len = Math.max(v1.length, v2.length)
while (v1.length < len) {
v1.push('0')
}
while (v2.length < len) {
v2.push('0')
}
for (let i = 0; i < len; i++) {
const num1 = parseInt(v1[i])
const num2 = parseInt(v2[i])
if (num1 > num2) {
return 1
} else if (num1 < num2) {
return -1
}
}
return 0
}
authUserInfo(data) {
return new Promise((resolve, reject) => {
login(data).then(res => {
let time = res.data.expires_time - Cache.time();
store.commit('UPDATE_USERINFO', res.data.user);
store.commit('LOGIN', { token: res.data.token, time: time });
store.commit('SETUID', res.data.user.uid);
Cache.set(EXPIRES_TIME, res.data.expires_time, time);
Cache.set(USER_INFO, res.data.userInfo, time);
return resolve(res);
}).catch(res => {
return reject(res);
})
})
}
}
export default new Routine();

474
libs/uniApi.js Normal file
View File

@ -0,0 +1,474 @@
// import uniCopy from '@/js_sdk/xb-copy/uni-copy.js'; // 拷贝功能插件
// import compressImage from './compressImage.js'; // 解决图片旋转90°问题
// const device = uni.getSystemInfoSync();
// console.log("device:======================== " + JSON.stringify(device));
/*
参数说明
@url
要跳转的目标地址
@opt
要传给目标地址的参数
可在目标页面的onLoad生命周期函数的第一个参数中获取
*/
// 压栈跳转页面
export function navigateTo(type, url, opt) {
// H5端页面跳转目前不支持动画 (浏览器性能限制)
let toUrl = url;
let api = 'navigateTo';
toUrl = opt ? toUrl + '?' + convertObj(opt) : toUrl;
switch (type) {
case 1:
api = 'navigateTo';
break;
case 2:
api = 'redirectTo'; // 关闭当前页,跳转应用内某个页面
break;
case 3:
api = 'reLaunch'; // 关闭所有页面,打开到应用内某个页面
break;
case 4:
api = 'switchTab'; //跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面。
break;
default:
api = 'navigateTo'
break;
}
uni[api]({
url: toUrl,
animationType: 'slide-in-right',
animationDuration: 200
});
}
// 关闭当前页面并返回上一页面 delta 标识返回几层
export function navigateBack(delta) {
uni.navigateBack({
delta: delta
});
}
// setStorage 将数据存入缓存
export function setStorage(key, val) {
if (typeof val == 'string') {
uni.setStorageSync(key, val);
return val
}
uni.setStorageSync(key, JSON.stringify(val));
}
// getStorage 从缓存中读取数据
export function getStorage(key) {
let uu = uni.getStorageSync(key);
try {
if (typeof JSON.parse(uu) != 'number') {
uu = JSON.parse(uu);
}
} catch (e) {}
return uu;
}
// 删除缓存中的数据
export function removeStorage(key) {
if (key) {
uni.removeStorageSync(key);
}
}
// 将缓存中的数据清空
export function clearStorage() {
try {
uni.clearStorageSync();
} catch (e) {
throw new Error('处理失败');
}
}
// 显示Toast
/*
@title 最多汉字数量7个
@icon success loading none
*/
export function Toast(title, icon = 'none', obj = {}, duration = 700) {
let toastData = {
title: title,
duration: duration,
// position: 'center',
mask: true,
icon: icon ? icon : 'none',
...obj
};
uni.showToast(toastData);
}
/*
显示loading提示框,需要手动隐藏
*/
export function Loading(title = '正在加载...', obj = {}) {
uni.showLoading({
title: title,
mask: true,
...obj
});
}
// 隐藏loading
export function hideLoading() {
try {
uni.hideLoading();
} catch (e) {
//TODO handle the exception
throw new Error('处理失败');
}
}
// 模态框
/*
确定取消按钮的文字颜色可修改
obj 对象中传入 cancelColor : rgb 即可修改取消按钮颜色
obj 对象中传入 confirmColor : rgb 即可修改确认按钮颜色
*/
export function Modal(title = '提示', content = '这是一个模态弹窗!', obj = {
showCancel: true,
cancelText: '取消',
confirmText: '确定'
}) {
// #ifdef APP-PLUS
obj.cancelText = '确定';
obj.confirmText = '取消';
// #endif
return new Promise((reslove, reject) => {
uni.showModal({
title: title,
content: content,
...obj,
success: (res) => {
if (res.confirm) {
reslove()
}
if (res.cancel) {
reject()
}
}
});
})
}
/*
显示操作菜单
@itemList 操作菜单数组
@itemColor 文字颜色
*/
export function ActionSheet(itemList, itemColor = "#000000") {
return new Promise((reslove, reject) => {
uni.showActionSheet({
itemList: itemList,
itemColor: itemColor,
success: (res) => {
reslove(res.tapIndex);
},
fail: function(res) {
reject(res.errMsg);
}
});
})
}
//将页面滚动到目标位置。
export function ScrollTo(ScrollTop) {
uni.pageScrollTo({
scrollTop: ScrollTop,
duration: 300
})
}
// 获取用户信息
export function GetUserInfo() {
return new Promise((reslove, reject) => {
uni.getUserInfo({
success(res) {
console.log(res);
reslove(res);
},
fail(rej) {
reject(rej);
}
})
})
}
// 获取用户授权信息
export function Authorize(scoped = 'scope.userInfo') {
return new Promise((reslove, reject) => {
uni.authorize({
scope: scoped,
success(res) {
reslove(res);
},
fail(rej) {
reject(rej);
}
})
})
}
// 将对象转换成使用 & 连接的字符串
export function convertObj(opt) {
let str = '';
let arr = [];
Object.keys(opt).forEach(item => {
arr.push(`${item}=${opt[item]}`);
})
str = arr.join('&');
return str;
}
// 节流函数
// 节流函数
export function throttle(fn, delay) {
var lastArgs;
var timer;
var delay = delay || 200;
return function(...args) {
lastArgs = args;
if (!timer) {
timer = setTimeout(() => {
timer = null;
fn.apply(this, lastArgs);
}, delay);
}
}
}
// 调起相机
export function chooseImage(count) {
return new Promise((reslove, reject) => {
uni.chooseImage({
count: count, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择
success: (res) => {
reslove(res);
// const tempFilePaths = res.tempFilePaths;
// let tempPathList = [];
// for (let i = 0; i < tempFilePaths.length; i++) {
// const path = tempFilePaths[i];
// const src = await compressImageHandler(path)
// tempPathList.push(src);
// }
// reslove(tempPathList);
},
fail: (rej) => {
reject(rej);
}
});
})
}
// function compressImageHandler(src) {
// // console.log('platform===' + device.platform)
// const tempPath = compressImage(src, device.platform);
// // console.log('tempPath-----' + tempPath);
// return tempPath
// }
//序列化对象和数组
export function serialize(data) {
if (data != null && data != '') {
try {
return JSON.parse(JSON.stringify(data));
} catch (e) {
if (data instanceof Array) {
return [];
}
return {};
}
}
return data;
}
Date.prototype.format = function(fmt) {
let o = {
'M+': this.getMonth() + 1, //月份
'd+': this.getDate(), //日
'h+': this.getHours(), //小时
'm+': this.getMinutes(), //分
's+': this.getSeconds(), //秒
'q+': Math.floor((this.getMonth() + 3) / 3), //季度
S: this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, String(this.getFullYear()).substr(4 - RegExp.$1.length));
}
for (let k in o) {
if (new RegExp('(' + k + ')').test(fmt)) {
fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(String(o[k]).length));
}
}
return fmt;
};
//格式化日期
export function formatDate(nS, format) {
//日期格式化
if (!nS) {
return '';
}
format = format || 'yyyy-MM-dd hh:mm:ss';
return new Date(nS).format(format);
}
// 图片转base64
export function pathToBase64(path) {
return new Promise(function(resolve, reject) {
if (typeof window === 'object' && 'document' in window) {
if (typeof FileReader === 'function') {
var xhr = new XMLHttpRequest()
xhr.open('GET', path, true)
xhr.responseType = 'blob'
xhr.onload = function() {
if (this.status === 200) {
let fileReader = new FileReader()
fileReader.onload = function(e) {
resolve(e.target.result)
}
fileReader.onerror = reject
fileReader.readAsDataURL(this.response)
}
}
xhr.onerror = reject
xhr.send()
return
}
var canvas = document.createElement('canvas')
var c2x = canvas.getContext('2d')
var img = new Image
img.onload = function() {
canvas.width = img.width
canvas.height = img.height
c2x.drawImage(img, 0, 0)
resolve(canvas.toDataURL())
canvas.height = canvas.width = 0
}
img.onerror = reject
img.src = path
return
}
if (typeof plus === 'object') {
plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) {
entry.file(function(file) {
var fileReader = new plus.io.FileReader()
fileReader.onload = function(data) {
resolve(data.target.result)
}
fileReader.onerror = function(error) {
reject(error)
}
fileReader.readAsDataURL(file)
}, function(error) {
reject(error)
})
}, function(error) {
reject(error)
})
return
}
if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
wx.getFileSystemManager().readFile({
filePath: path,
encoding: 'base64',
success: function(res) {
resolve('data:image/png;base64,' + res.data)
},
fail: function(error) {
reject(error)
}
})
return
}
reject(new Error('not support'))
})
}
/*
@value 要拷贝的内容
*/
// export function copyText(value) {
// // 条件编译以下代码仅在H5出现
// //#ifdef H5
// return new Promise((reslove, reject) => {
// uniCopy({
// content: value,
// success: (res) => {
// reslove(res);
// },
// error: (e) => {
// reject(res)
// }
// })
// })
// //#endif
// // 以下代码在除H5以外的平台出现
// //#ifndef H5
// //#endif
// }
// 获取本周的第一天
export function showWeekFirstDay() {
var date = new Date();
var weekday = date.getDay() || 7; //获取星期几,getDay()返回值是 0周日 到 6周六 之间的一个整数。0||7为7即weekday的值为1-7
date.setDate(date.getDate() - weekday + 1); //往前算weekday-1年份、月份会自动变化
return formatDate(date, 'yyyy-MM-dd');
}
// 获取本月第一天
export function showMonthFirstDay() {
var MonthFirstDay = new Date().setDate(1);
return formatDate(new Date(MonthFirstDay).getTime(), 'yyyy-MM-dd');
}
var now = new Date(); //当前日期
// var nowDayOfWeek = now.getDay(); //今天本周的第几天
// var nowDay = now.getDate(); //当前日
var nowMonth = now.getMonth(); //当前月
var nowYear = now.getYear(); //当前年
nowYear += (nowYear < 2000) ? 1900 : 0; //
//获得本季度的开始月份
function getQuarterStartMonth() {
var quarterStartMonth = 0;
if (nowMonth < 3) {
quarterStartMonth = 0;
}
if (2 < nowMonth && nowMonth < 6) {
quarterStartMonth = 3;
}
if (5 < nowMonth && nowMonth < 9) {
quarterStartMonth = 6;
}
if (nowMonth > 8) {
quarterStartMonth = 9;
}
return quarterStartMonth;
}
//或的本季度的结束日期
//获得本季度的开始日期
export function getQuarterStartDate() {
var quarterStartDate = new Date(nowYear, getQuarterStartMonth(), 1);
return formatDate(quarterStartDate, 'yyyy-MM-dd');
}
// 删除数组中重复数据
export function unique(data) {
data = data || [];
var n = {}; //存放新的数据
for (var i = 0; i < data.length; i++) {
var v = JSON.stringify(data[i]);
if (typeof(v) == "undefined") {
n[v] = 1;
}
}
data.length = 0;
for (var i in n) {
data[data.length] = i;
}
return data;
}

241
pages/index/index.vue Normal file
View File

@ -0,0 +1,241 @@
<template>
<view class="" style="background-color: #EAF2EF;min-height: 100vh;">
<view class="bg"></view>
<view class="" style="height: 200rpx;">
</view>
<view class="content">
<view class="serch">
<view class="s">
<u-search searchIconColor='white' color="white" placeholder="搜索基地名称" bgColor='#34D190'
borderColor="white" placeholderColor="white" :showAction="false" v-model="keyword"></u-search>
</view>
<view class="add" @click="ceshi">
+
</view>
</view>
<view class="plowland" v-for="(item,index) in list" :key="index" @click="navgo('/pages/index1/'+item.path)">
<view class="top">
<view class="left">
<view class="tit">
{{item.tit}}
</view>
<view class="">
面积 <text>{{item.mj}}</text>
</view>
<view class="" style="margin:20rpx 0">
{{item.type?item.type:"农作物"}} <text>{{item.nzw}}</text>
</view>
</view>
<view class="right" @click.stop="navgo('/pages/index3/'+item.path)">
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="'https://uqrcode.cn/doc'+item.path"
sizeUnit='rpx' :size='163'></uqrcode>
</view>
</view>
<view class="bottom">
<view class="" style="display: flex;justify-content: space-between;">
<view class="">
生长周期<text>{{item.szzq}}</text>
</view>
<view class="">
培育方式 <text>{{item.pyfs}}</text>
</view>
</view>
<view class="hr">
</view>
<view class="" style="display: flex; justify-content: space-around;">
<view class="" style="display: flex;flex-direction: column;align-items: center;"
v-for="items in item.li">
<view class="">
<u--image :src="items.img" width="101.64rpx" height="101.64rpx" alt=""></u--image>
</view>
<view class="">
<text>{{items.tit}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
keyword: "",
list: [{
path: "index",
tit: "柑橘园种植基地",
mj: "1200亩",
nzw: "蜜桔",
szzq: "125天",
pyfs: "种植",
li: [{
img: "/static/img/QXJC.png",
tit: "气象检测"
}, {
img: "/static/img/QTTC.png",
tit: "气体探测"
}, {
img: "/static/img/ZWXBSQ.png",
tit: "紫外线变送器"
}, ]
},
{
path: "shucai",
tit: "蔬菜种植基地",
mj: "300亩",
nzw: "有机花菜",
szzq: "95天",
pyfs: "种植",
li: [{
img: "/static/img/QXJC.png",
tit: "气象检测"
}, {
img: "/static/img/QTTC.png",
tit: "气体探测"
}, {
img: "/static/img/ZWXBSQ.png",
tit: "紫外线变送器"
}, ]
},
{
path: "ji",
tit: "鸡畜养殖基地",
mj: "30亩",
nzw: "黄羽鸡",
szzq: "136天",
pyfs: "养殖",
type: "种植物",
li: [{
img: "/static/img/QXJC.png",
tit: "气象检测"
}, {
img: "/static/img/QTTC.png",
tit: "气体探测"
}, {
img: "/static/img/DZJC.png",
tit: "地质检测"
}, ]
},
{
path: "xia",
tit: "水产养殖基地",
mj: "200亩",
nzw: "鲥鱼",
type: "养殖物",
szzq: "72天",
pyfs: "养殖",
li: [{
img: "/static/img/RYY.png",
tit: "溶氧仪"
}, {
img: "/static/img/SZJC.png",
tit: "水质检测"
}, ]
}
],
}
},
onShow() {},
methods: {
ceshi() {
this.$refs.uqrcode[0].toTempFilePath({
success: res => {
console.log(res);
}
});
},
navgo(url) {
uni.navigateTo({
url
})
}
}
}
</script>
<style lang="scss" scoped>
.bg {
width: 750rpx;
height: 419.92rpx;
background-color: #34D190;
position: absolute;
border-radius: 0 0 60rpx 60rpx;
}
.serch {
margin-bottom: 30rpx;
display: flex;
align-items: center;
.s {
width: 611.57rpx;
}
.add {
margin-left: 20rpx;
font-size: 80rpx;
color: white;
transform: translateY(-5rpx);
}
}
.content {
width: 693.93rpx;
margin: 0 auto;
position: relative;
padding-bottom: 50rpx;
.plowland {
font-size: 33.29rpx;
background-color: white;
box-sizing: border-box;
padding: 30rpx;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
color: #737373;
margin-bottom: 30rpx;
text {
color: black;
}
.top {
display: flex;
justify-content: space-between;
.left {
.tit {
font-size: 42.06rpx;
color: #00A15E;
margin-bottom: 30rpx;
}
}
.right {
width: 162.97rpx;
height: 162.97rpx;
// background-color: pink;
}
}
.hr {
border-top: 1px solid #B3B3B3;
margin: 30rpx 0;
}
}
}
</style>

323
pages/index1/index.vue Normal file
View File

@ -0,0 +1,323 @@
<template>
<view class="content">
<view style="height: var(--status-bar-height)"></view>
<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
<text>生态概况</text>
</view>
<view class="head-img">
<view class="">
<u--image src="/static/img/GJ.jpg" width="693.93rpx" height=" 394.28rpx" alt=""></u--image>
</view>
<!-- <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="click"></u--image> -->
<view class="poisition">
<view style="display: flex;">
<u--image src="/static/img/dw.png" style="margin: 0 5rpx;" width="35.05rpx"
height="35.05rpx"></u--image>
分水岭大南山北326米
</view>
</view>
</view>
<view class="bad-info">
<!-- <view class="tit" @tap="test">
异常信息 1
</view>
<view class="bad-info-cont">
<u--image :src="urlFn('badinfo')" style="margin: 0 21rpx;" width="80rpx" height="80rpx"></u--image>
<view class="">
<view class="">
土壤温度过低
</view>
<view class="" style="color: #0095FF;font-size: 22.78rpx;margin-top: 5rpx;">
低于预警值得5%
</view>
</view>
</view> -->
</view>
<view class="data">
<view class="tit">
<view class="data-alanys" @tap="navto">
<!-- <img :src="urlFn('sjfx')" :style="img(191,63,0)" alt=""> -->
<u--image :src="urlFn('sjfx')" style="margin: 0 5rpx;" width="191rpx" height="63rpx"></u--image>
</view>
<view class="">
环境数据
</view>
<view class="tit-b">
<!-- <img :src="urlFn('sj')" :style="img(28.04,28.04,5)" alt=""> -->
<u--image :src="urlFn('sj')" style="margin: 0 5rpx;" width="28.04rpx" height="28.04rpx"></u--image>
<text>刷新时间:{{dateFn()}}</text>
</view>
</view>
<view class="data-cont">
<view class="data-cont-li center" v-for="(item,index) in data " :key="index">
<view style="margin:0 20rpx">
<view class="center">
<!-- <img :src="urlFn('B')" :style="img(38.55,38.55,5)" alt=""> -->
<u--image :src="urlFn(item.icon)" style="margin: 0 5rpx;" width="38.55rpx"
height="38.54rpx"></u--image>
{{item.tit}}
</view>
<view class="b-cls">
<view class="" :style="{color:item.flag?'#0095FF':''}">
<text style=" font-size: 70.09rpx;">
{{baseData[item.cont]}}
</text>{{item.dw}}
</view>
<view class="" style="display: flex;align-items: center;" v-if="item.flag">
<u--image :src="urlFn('D')" style="margin: 0 5rpx;" width="31.54rpx" height="31.54rpx">
</u--image>
<text style="color: #0095FF;">5</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="data">
<view class="tit">
<view class="">
设备状态
</view>
</view>
<view class="data-cont">
<view class="data-cont-li center" v-for="item in data2">
<view style="margin:0 20rpx">
<view class="center">
{{item.cont}}
</view>
<view class="">
<text style="font-size: 70.09rpx;color: #4CC593;"></text>
<text style="margin-left: 20rpx;font-size: 26.29rpx;">({{item.cont2}})</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
companyMine
} from "@/api/test.js"
export default {
data() {
return {
// title: 'Hello'
data: [{
tit: "土壤温度",
icon: 'TRWD',
dw: "℃",
cont: 'soil_temperature',
flag: false,
}, {
tit: "土壤湿度",
icon: 'TRSD',
dw: "%RH",
cont: 'soil_moisture',
}, {
tit: "风向",
icon: 'FX',
cont: 'wind_direction',
}, {
tit: "风速",
icon: 'FS',
dw: "m/s",
cont: 'wind_speed',
}, {
tit: "降雨量",
icon: 'JYL',
dw: "mm",
cont: 'rainfall',
}, {
tit: "光照",
icon: 'GZ',
dw: "Wlux",
cont: 'illumination',
}, {
tit: "二氧化碳",
icon: 'EYHT',
dw: "ppm",
cont: 'carbon_dioxide_content',
},
],
data2: [{
cont: "气象多要素百叶箱",
cont2: "1天/1次",
}, {
cont: "多功能控制器",
cont2: "3个小时/次",
}, ],
baseData: {
}
}
},
onShow() {
companyMine({
id: 1,
flag: 1
}).then(res => {
this.baseData = res.data
// console.log(res)
})
},
onPullDownRefresh() {
setTimeout(() => {
uni.stopPullDownRefresh()
}, 500)
},
methods: {
dateFn() {
var today = new Date();
//
var year = today.getFullYear();
var month = today.getMonth() + 1; // 01
var day = today.getDate();
//
var dateStr = year + '-' + month + '-' + day;
return dateStr
//
},
backFn() {
uni.navigateBack()
},
test() {
companyMine()
},
urlFn(name) {
return `/static/img/${name}.png`
},
img(w, h, m) {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
},
navto() {
uni.navigateTo({
url: '/pages/index2/index'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 30rpx;
// background-color: grey;
background-image: url("/static/img/bgc.png");
background-size: cover;
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 0 auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 380.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 43rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
.dw-cls {
margin: 0 5rpx;
}
}
}
.bad-info {
margin: 20rpx 0;
width: 693.93rpx;
.tit {
margin: 20rpx 0;
}
.bad-info-cont {
background-color: white;
display: flex;
// padding: 20rpx;
height: 140.19rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
align-items: center;
}
}
.data {
.tit {
.tit-b {
color: #B3B3B3;
font-size: 26.29rpx;
display: flex;
align-items: center;
}
}
.data-alanys {
// background-color: blue;
float: right;
color: white;
}
.data-cont {
// margin: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 30rpx;
box-sizing: border-box;
// padding: 70rpx;
.data-cont-li {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
width: 310.94rpx;
height: 212.03rpx;
background-color: white;
margin-bottom: 20rpx;
}
}
}
.center {
display: flex;
align-items: center;
}
.b-cls {
display: flex;
align-items: flex-end;
width: 250rpx;
justify-content: space-between;
color: #4CC593;
}
</style>

310
pages/index1/ji.vue Normal file
View File

@ -0,0 +1,310 @@
<template>
<view class="content">
<view style="height: var(--status-bar-height)"></view>
<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
<text>生态概况</text>
</view>
<view class="head-img">
<view class="">
<u--image src="/static/img/JC.jpg" width="693.93rpx" height=" 394.28rpx" alt=""></u--image>
</view>
<!-- <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="click"></u--image> -->
<view class="poisition">
<view style="display: flex;">
<u--image src="/static/img/dw.png" style="margin: 0 5rpx;" width="35.05rpx"
height="35.05rpx"></u--image>
江阳区威武村南485米
</view>
</view>
</view>
<view class="bad-info">
<!-- <view class="tit" @tap="test">
异常信息 1
</view>
<view class="bad-info-cont">
<u--image :src="urlFn('GG')" style="margin: 0 21rpx;" width="80rpx" height="80rpx"></u--image>
<view class="">
<view class="">
棚内温度过高
</view>
<view class="" style="color: #FF473E;font-size: 22.78rpx;margin-top: 5rpx;">
高于预警值得2%
</view>
</view>
</view> -->
</view>
<view class="data">
<view class="tit">
<view class="data-alanys" @tap="navto">
<!-- <img :src="urlFn('sjfx')" :style="img(191,63,0)" alt=""> -->
<u--image :src="urlFn('sjfx')" style="margin: 0 5rpx;" width="191rpx" height="63rpx"></u--image>
</view>
<view class="">
环境数据
</view>
<view class="tit-b">
<!-- <img :src="urlFn('sj')" :style="img(28.04,28.04,5)" alt=""> -->
<u--image :src="urlFn('sj')" style="margin: 0 5rpx;" width="28.04rpx" height="28.04rpx"></u--image>
<text>刷新时间:2023-10-15</text>
</view>
</view>
<view class="data-cont">
<view class="data-cont-li center" v-for="(item,index) in data " :key="index">
<view style="margin:0 20rpx">
<view class="center">
<!-- <img :src="urlFn('B')" :style="img(38.55,38.55,5)" alt=""> -->
<u--image :src="urlFn(item.icon)" style="margin: 0 5rpx;" width="38.55rpx"
height="38.54rpx"></u--image>
{{item.tit}}
</view>
<view class="b-cls">
<view class="" :style="{color:item.flag?'#FF473E':''}">
<text style=" font-size: 70.09rpx;">
{{baseData[item.cont]}}
</text>{{item.dw}}
</view>
<view class="" style="display: flex; align-items: center;" v-if="item.flag">
<u--image :src="urlFn('SG')" style="margin: 0 5rpx;" width="31.54rpx" height="31.54rpx">
</u--image>
<text style="color: #FF473E;">2</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="data">
<view class="tit">
<view class="">
设备状态
</view>
</view>
<view class="data-cont">
<view class="data-cont-li center" v-for="item in data2">
<view style="margin:0 20rpx">
<view class="center">
{{item.cont}}
</view>
<view class="">
<text style="font-size: 70.09rpx;color: #4CC593;"></text>
<text style="margin-left: 20rpx;font-size: 26.29rpx;">({{item.cont2}})</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
companyMine
} from "@/api/test.js"
export default {
data() {
return {
data: [{
tit: "室内温度",
icon: 'SLWD',
cont: "room_temperature",
dw: "℃",
flag: false
}, {
tit: "空气湿度",
icon: 'KQSD',
dw: "%RH",
cont: "air_humidity"
}, {
tit: "氨气含量",
icon: 'AQHL',
dw: "%",
cont: "ammonia_nitrogen_content"
}, {
tit: "甲烷含量",
icon: 'JWHL',
dw: "%",
cont: "methane_content"
}, {
tit: "空气质量指数",
icon: 'KQZLZS',
cont: "air_quality_index",
dw: "(pm)",
}, {
tit: "降雨量",
icon: 'JYL',
cont: "rainfall",
dw: "mm"
}, {
tit: "风向",
icon: 'FX',
cont: "wind_direction"
}, {
tit: "风速",
icon: 'FS',
cont: "wind_speed",
dw: "m/s"
}, {
tit: "光照",
icon: 'GZ',
cont: "illumination",
dw: "lux"
},
],
baseData: {},
data2: [{
cont: "倾斜位移监测仪",
cont2: "3小时/1次",
}, {
cont: "气象多要素百叶箱",
cont2: "1天/次",
}, ]
}
},
onLoad() {
companyMine({
id: 3,
flag: 1
}).then(res => {
this.baseData = res.data
// console.log(res)
})
},
methods: {
backFn() {
uni.navigateBack()
},
test() {
companyMine()
},
urlFn(name) {
return `/static/img/${name}.png`
},
img(w, h, m) {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
},
navto() {
uni.navigateTo({
url: '/pages/index2/ji'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 30rpx;
// background-color: grey;
background-image: url("/static/img/bgc.png");
background-size: cover;
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 0 auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 380.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 43rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
.dw-cls {
margin: 0 5rpx;
}
}
}
.bad-info {
margin: 20rpx 0;
width: 693.93rpx;
.tit {
margin: 20rpx 0;
}
.bad-info-cont {
background-color: white;
display: flex;
// padding: 20rpx;
height: 140.19rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
align-items: center;
}
}
.data {
.tit {
.tit-b {
color: #B3B3B3;
font-size: 26.29rpx;
display: flex;
align-items: center;
}
}
.data-alanys {
// background-color: blue;
float: right;
color: white;
}
.data-cont {
// margin: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 30rpx;
box-sizing: border-box;
// padding: 70rpx;
.data-cont-li {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
width: 310.94rpx;
height: 212.03rpx;
background-color: white;
margin-bottom: 20rpx;
}
}
}
.center {
display: flex;
align-items: center;
}
.b-cls {
display: flex;
align-items: flex-end;
width: 250rpx;
justify-content: space-between;
color: #4CC593;
}
</style>

298
pages/index1/shucai.vue Normal file
View File

@ -0,0 +1,298 @@
<template>
<view class="content">
<view style="height: var(--status-bar-height)"></view>
<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
<text>生态概况</text>
</view>
<view class="head-img">
<view class="">
<u--image src="/static/img/SC.jpg" width="693.93rpx" height=" 394.28rpx" alt=""></u--image>
</view>
<!-- <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="click"></u--image> -->
<view class="poisition">
<view style="display: flex;">
<u--image src="/static/img/dw.png" style="margin: 0 5rpx;" width="35.05rpx"
height="35.05rpx"></u--image>
江阳区水中坝北352米
</view>
</view>
</view>
<view class="bad-info">
<!-- <view class="tit" @tap="test">
异常信息 1
</view>
<view class="bad-info-cont">
<u--image :src="urlFn('badinfo')" style="margin: 0 21rpx;" width="80rpx" height="80rpx"></u--image>
<view class="">
<view class="">
土壤湿度过低
</view>
<view class="" style="color: #0095FF;font-size: 22.78rpx;margin-top: 5rpx;">
低于预警值得5%
</view>
</view>
</view> -->
</view>
<view class="data">
<view class="tit">
<view class="data-alanys" @tap="navto">
<u--image :src="urlFn('sjfx')" style="margin: 0 5rpx;" width="191rpx" height="63rpx"></u--image>
</view>
<view class="">
环境数据
</view>
<view class="tit-b">
<u--image :src="urlFn('sj')" style="margin: 0 5rpx;" width="28.04rpx" height="28.04rpx"></u--image>
<text>刷新时间:2023-10-15</text>
</view>
</view>
<view class="data-cont">
<view class="data-cont-li center" v-for="(item,index) in data " :key="index">
<view style="margin:0 20rpx">
<view class="center">
<!-- <img :src="urlFn('B')" :style="img(38.55,38.55,5)" alt=""> -->
<u--image :src="urlFn(item.icon)" style="margin: 0 5rpx;" width="38.55rpx"
height="38.54rpx"></u--image>
{{item.tit}}
</view>
<view class="b-cls">
<view class="" :style="{color:item.flag?'#0095FF':''}">
<text style=" font-size: 70.09rpx;"> {{baseData[item.cont]}}</text>{{item.dw}}
</view>
<view class="" style="display: flex; align-items: center;" v-if="item.flag">
<u--image :src="urlFn('D')" style="margin: 0 5rpx;" width="31.54rpx" height="31.54rpx">
</u--image>
<text style="color: #0095FF;">5</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="data">
<view class="tit">
<view class="">
设备状态
</view>
</view>
<view class="data-cont">
<view class="data-cont-li center" v-for="item in data2">
<view style="margin:0 20rpx">
<view class="center">
{{item.cont}}
</view>
<view class="">
<text style="font-size: 70.09rpx;color: #4CC593;"></text>
<text style="margin-left: 20rpx;font-size: 26.29rpx;">({{item.cont2}})</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
companyMine
} from "@/api/test.js"
export default {
data() {
return {
data: [{
tit: "土壤温度",
icon: 'TRWD',
dw: "℃",
cont: 'soil_temperature',
}, {
tit: "土壤湿度",
icon: 'TRSD',
dw: "%RH",
cont: 'soil_moisture',
flag: false
}, {
tit: "风向",
icon: 'FX',
cont: 'wind_direction',
}, {
tit: "风速",
icon: 'FS',
dw: "m/s",
cont: 'wind_speed',
}, {
tit: "降雨量",
icon: 'JYL',
dw: "mm",
cont: 'rainfall',
}, {
tit: "光照",
icon: 'GZ',
dw: "Wlux",
cont: 'illumination',
}, {
tit: "二氧化碳",
icon: 'EYHT',
dw: "ppm",
cont: 'carbon_dioxide_content',
},
],
baseData: {},
data2: [{
cont: "气象多要素百叶箱",
cont2: "1天/1次",
}, {
cont: "多功能控制器",
cont2: "3个小时/次",
}, ]
}
},
onLoad() {
companyMine({
id: 2,
flag: 1
}).then(res => {
this.baseData = res.data
// console.log(res)
})
},
methods: {
backFn() {
uni.navigateBack()
},
test() {
companyMine()
},
urlFn(name) {
return `/static/img/${name}.png`
},
img(w, h, m) {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
},
navto() {
uni.navigateTo({
url: '/pages/index2/shucai'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 30rpx;
// background-color: grey;
background-image: url("/static/img/bgc.png");
background-size: cover;
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 0 auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 380.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 43rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
.dw-cls {
margin: 0 5rpx;
}
}
}
.bad-info {
margin: 20rpx 0;
width: 693.93rpx;
.tit {
margin: 20rpx 0;
}
.bad-info-cont {
background-color: white;
display: flex;
// padding: 20rpx;
height: 140.19rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
align-items: center;
}
}
.data {
.tit {
.tit-b {
color: #B3B3B3;
font-size: 26.29rpx;
display: flex;
align-items: center;
}
}
.data-alanys {
// background-color: blue;
float: right;
color: white;
}
.data-cont {
// margin: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 30rpx;
box-sizing: border-box;
// padding: 70rpx;
.data-cont-li {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
width: 310.94rpx;
height: 212.03rpx;
background-color: white;
margin-bottom: 20rpx;
}
}
}
.center {
display: flex;
align-items: center;
}
.b-cls {
display: flex;
align-items: flex-end;
width: 250rpx;
justify-content: space-between;
color: #4CC593;
}
</style>

288
pages/index1/xia.vue Normal file
View File

@ -0,0 +1,288 @@
<template>
<view class="content">
<view style="height: var(--status-bar-height)"></view>
<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
<text>生态概况</text>
</view>
<view class="head-img">
<view class="">
<u--image src="/static/img/YX.jpg" width="693.93rpx" height=" 394.28rpx" alt=""></u--image>
</view>
<!-- <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="click"></u--image> -->
<view class="poisition">
<view style="display: flex;">
<u--image src="/static/img/dw.png" style="margin: 0 5rpx;" width="35.05rpx"
height="35.05rpx"></u--image>
牟咀村西南294米
</view>
</view>
</view>
<view class="bad-info">
<view class="tit" @tap="test">
异常信息 1
</view>
<view class="bad-info-cont">
<!-- <img :src="urlFn('badinfo')" :style="img(80,80,21)" alt=""> -->
<u--image :src="urlFn('GG')" style="margin: 0 21rpx;" width="80rpx" height="80rpx"></u--image>
<view class="">
<view class="">
池内溶氧量过高
</view>
<view class="" style="color: #FF473E;font-size: 22.78rpx;margin-top: 5rpx;">
高于预警值1mg/l
</view>
</view>
</view>
</view>
<view class="data">
<view class="tit">
<view class="data-alanys" @tap="navto">
<!-- <img :src="urlFn('sjfx')" :style="img(191,63,0)" alt=""> -->
<u--image :src="urlFn('sjfx')" style="margin: 0 5rpx;" width="191rpx" height="63rpx"></u--image>
</view>
<view class="">
环境数据
</view>
<view class="tit-b">
<!-- <img :src="urlFn('sj')" :style="img(28.04,28.04,5)" alt=""> -->
<u--image :src="urlFn('sj')" style="margin: 0 5rpx;" width="28.04rpx" height="28.04rpx"></u--image>
<text>刷新时间:2023-10-15</text>
</view>
</view>
<view class="data-cont">
<view class="data-cont-li center" v-for="(item,index) in data " :key="index">
<view style="margin:0 20rpx">
<view class="center">
<!-- <img :src="urlFn('B')" :style="img(38.55,38.55,5)" alt=""> -->
<u--image :src="urlFn(item.icon)" style="margin: 0 5rpx;" width="38.55rpx"
height="38.54rpx"></u--image>
{{item.tit}}
</view>
<view class="b-cls">
<view class="" :style="{color:item.flag?'#FF473E':''}">
<text style=" font-size: 70.09rpx;">{{baseData[item.cont]}}</text>{{item.dw}}
</view>
<view class="" style="display: flex;align-items: center;" v-if="item.flag">
<u--image :src="urlFn('SG')" style="margin: 0 5rpx;" width="31.54rpx" height="31.54rpx">
</u--image>
<text style="color: #FF473E;">1</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="data">
<view class="tit">
<view class="">
设备状态
</view>
</view>
<view class="data-cont">
<view class="data-cont-li center" v-for="item in data2">
<view style="margin:0 20rpx">
<view class="center">
{{item.cont}}
</view>
<view class="">
<text style="font-size: 70.09rpx;color: #4CC593;"></text>
<text style="margin-left: 20rpx;font-size: 26.29rpx;">({{item.cont2}})</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
companyMine
} from "@/api/test.js"
export default {
data() {
return {
data: [{
tit: "池塘温度",
icon: 'CTWD',
dw: "℃",
cont: "pond_temperature",
// flag: true
}, {
tit: "池塘PH",
icon: 'CTPH',
dw: "",
cont: "pond_ph_value",
}, {
tit: "溶氧量",
icon: 'RYL',
dw: "mg/L",
cont: "dissolved_oxygen",
flag: true
}, {
tit: "氨氮量",
icon: 'ADL',
dw: "mg/L",
cont: "ammonia_nitrogen_content",
}, {
tit: "亚硝酸盐",
icon: 'YXSY',
dw: "mg/L",
cont: "nitrite_content",
}
],
baseData: {},
data2: [{
cont: "溶氧仪设备",
cont2: "3个小时/次",
}, {
cont: "水质检测仪",
cont2: "1天/次",
}, ]
}
},
onLoad() {
companyMine({
id: 4,
flag: 1
}).then(res => {
this.baseData = res.data
// console.log(res)
})
},
methods: {
backFn() {
uni.navigateBack()
},
test() {
companyMine()
},
urlFn(name) {
return `/static/img/${name}.png`
},
img(w, h, m) {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
},
navto() {
uni.navigateTo({
url: '/pages/index2/yx'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 30rpx;
// background-color: grey;
background-image: url("/static/img/bgc.png");
background-size: cover;
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 0 auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 380.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 43rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
.dw-cls {
margin: 0 5rpx;
}
}
}
.bad-info {
margin: 20rpx 0;
width: 693.93rpx;
.tit {
margin: 20rpx 0;
}
.bad-info-cont {
background-color: white;
display: flex;
// padding: 20rpx;
height: 140.19rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
align-items: center;
}
}
.data {
.tit {
.tit-b {
color: #B3B3B3;
font-size: 26.29rpx;
display: flex;
align-items: center;
}
}
.data-alanys {
// background-color: blue;
float: right;
color: white;
}
.data-cont {
// margin: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 30rpx;
box-sizing: border-box;
// padding: 70rpx;
.data-cont-li {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
width: 310.94rpx;
height: 212.03rpx;
background-color: white;
margin-bottom: 20rpx;
}
}
}
.center {
display: flex;
align-items: center;
}
.b-cls {
display: flex;
align-items: flex-end;
width: 250rpx;
justify-content: space-between;
color: #4CC593;
}
</style>

373
pages/index2/index.vue Normal file
View File

@ -0,0 +1,373 @@
<template>
<view class="" style="padding: 30rpx;">
<view style="height: var(--status-bar-height)"></view>
<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
<text>生态概况</text>
</view>
<view class="" style="padding: 20rpx;box-sizing: border-box;">
<view class="head">
<view class="subsection">
<view class="subsection-li" @click="changeDate(10)">
小时
</view>
<view class="subsection-li" @click="changeDate(160.7)">
</view>
<view class="subsection-li sct" @click="changeDate(311.4)">
</view>
<view class="act" :style="{left:leftNum+'rpx'}">
</view>
</view>
<view class="set" @tap="navgo">
<view class="" style="margin: 0 10rpx;">
<u-icon name="setting" color="white" size="15"></u-icon>
</view> 设置
</view>
</view>
<view class="">
<view class="tit">
果林检测数据
</view>
<view class="charts-box">
<qiun-data-charts type="mix" :opts="opts" :chartData="chartData" />
</view>
<view class="charts-box">
<qiun-data-charts type="mix" :opts="opts2" :chartData="chartData2" />
</view>
</view>
<view class="detect">
<view class="detecttit">
<text class="line"></text> 种植监测
</view>
<view class="content" style=" text-indent: 2em;">
<view class="">
监测果树的水分含量确保植物不会因缺水而枯萎或者过度浇水而导致根部窒息监测植物所需的养分含量确保植物能够获得足够的养分来支持其生长和发育监测植物所接受的光照强度和光谱确保植物能够获得足够的光照来支持其光合作用监测植物周围的温度确保植物不会因温度过高或过低而受到影响监测植物周围的空气质量确保植物不会受到有害气体的影响
</view>
<view class="">
监测果树生长与病虫害可以为果树的栽培和管理提供科学依据使果树栽培更加精细化规范化提高果树的适应性和抗逆性
通过这些监测种植者可以更好的掌握果树的生长状况.
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
companyMine
} from "@/api/test.js"
export default {
data() {
return {
leftNum: 10,
chartData: {},
chartData2: {},
// config-ucharts.js ['mix'] opts opts
opts: {
color: ["#1890FF", "#91CB74"],
padding: [15, 15, 0, 15],
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true,
},
yAxis: {
disabled: false,
disableGrid: false,
splitNumber: 5,
gridType: "dash",
dashLength: 4,
gridColor: "#CCCCCC",
padding: 10,
showTitle: true,
data: [{
position: "left",
title: ""
},
{
position: "right",
min: 0,
max: 200,
title: "",
textAlign: "left"
},
]
},
extra: {
mix: {
column: {
width: 20
}
}
}
},
opts2: {
color: ["#1890FF", "#91CB74"],
padding: [15, 15, 0, 15],
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true,
},
yAxis: {
disabled: false,
disableGrid: false,
splitNumber: 5,
gridType: "dash",
dashLength: 4,
gridColor: "#CCCCCC",
padding: 10,
showTitle: true,
data: [{
position: "left",
title: ""
},
{
position: "right",
min: 0,
max: 200,
title: "",
textAlign: "left"
},
]
},
extra: {
mix: {
column: {
width: 20
}
}
}
}
};
},
onReady() {
let datas = [
[20, 23, 25, 19, 23, 24],
[30, 25, 27, 28, 24, 25],
[40, 41, 32, 30, 32, 30],
[20, 23, 25, 19, 23, 24],
[100, 79, 89, 93, 98, 82],
[18, 20, 25, 26, 30, 31],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
]
this.getServerData(datas)
},
onShow() {
companyMine({
id: 1,
flag: 1
}).then(res => {
console.log(res.data)
})
},
methods: {
changeDate(num) {
let datas = []
this.leftNum = num
if (num == 10) {
datas = [
[20, 23, 25, 19, 23, 24],
[30, 25, 27, 28, 24, 25],
[40, 41, 32, 30, 32, 30],
[20, 23, 25, 19, 23, 24],
[100, 79, 89, 93, 98, 82],
[18, 20, 25, 26, 30, 31],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
]
} else if (num == 160.7) {
datas = [
[25, 22, 24, 19, 21, 22],
[38, 27, 21, 30, 32, 24],
[45, 43, 35, 33, 38, 40],
[27, 23, 25, 27, 30, 34],
[102, 107, 96, 95, 82, 83],
[19, 21, 26, 25, 22, 19],
["10-12", "10-13", "10-14", "10-15", "10-16", "10-17"],
["10-12", "10-13", "10-14", "10-15", "10-16", "10-17"],
]
} else if (num == 311.4) {
datas = [
[29, 32, 38, 31, 23, 24],
[36, 34, 30, 29, 27, 27],
[41, 40, 36, 32, 29, 24],
[29, 23, 25, 30, 34, 36],
[94, 109, 120, 116, 110, 113],
[18, 20, 25, 26, 30, 31],
["5月", "6月", "7月", "8月", "9月", "10月"],
["5月", "6月", "7月", "8月", "9月", "10月"],
]
}
this.getServerData(datas)
},
navgo() {
uni.navigateTo({
url: '/pages/index3/index'
})
},
backFn() {
uni.navigateBack()
},
getServerData(datas) {
//
setTimeout(() => {
//
let res = {
categories: datas[6],
series: [{
name: "土壤温度(℃)",
index: 1,
type: "column",
data: datas[0]
},
{
name: "降雨量(mm)",
type: "line",
color: "#2fc25b",
data: datas[1]
},
{
name: "湿度(WC)",
type: "line",
color: "pink",
data: datas[2]
},
]
};
let res2 = {
categories: datas[7],
series: [
{
name: "光照(lux)",
type: "line",
color: "#2fc25b",
data: datas[4]
},
{
name: "风速(m/h)",
type: "line",
color: "blue",
data: datas[5]
},
]
};
this.chartData = JSON.parse(JSON.stringify(res));
this.chartData2 = JSON.parse(JSON.stringify(res2));
}, 500);
},
}
};
</script>
<style lang="less" scoped>
.head {
// height: 10vh;
display: flex;
justify-content: space-between;
align-items: center;
// background-color: red;
.subsection {
display: flex;
width: 466.12rpx;
height: 98.13rpx;
background-color: #F4F4F4;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
line-height: 5vh;
position: relative;
.subsection-li {
width: 150.7rpx;
height: 84.11rpx;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
text-align: center;
line-height: 94rpx;
z-index: 8;
// margin-top: 10rpx;
}
.act {
position: absolute;
width: 130.7rpx;
height: 84.11rpx;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
background-color: #fff;
top: 50%;
transform: translateY(-50%);
transition: .5s;
}
}
.set {
width: 131.43rpx;
height: 63rpx;
background-color: #0BC677;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
color: white;
text-align: center;
line-height: 63rpx;
display: flex;
align-items: center;
}
}
.tit {
text-align: center;
margin: 30rpx 0;
font-size: 36.8rpx;
}
.charts-box {
width: 100%;
height: 300px;
border: 1px solid black;
margin-bottom: 40rpx;
}
.detect {
.line {
width: 7.01rpx;
height: 31.54rpx;
background-color: #4CC593;
display: inline-block;
margin-right: 10rpx;
}
.detecttit {
font-size: 31.54rpx;
display: flex;
align-items: center;
}
.content {
padding-top: 20rpx;
}
}
</style>

465
pages/index2/ji.vue Normal file
View File

@ -0,0 +1,465 @@
<template>
<view class="" style="padding: 30rpx;">
<view style="height: var(--status-bar-height)"></view>
<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
<text>生态概况</text>
</view>
<view class="" style="padding: 20rpx;box-sizing: border-box;">
<view class="head">
<view class="subsection">
<view class="subsection-li" @click="changeDate(10)">
小时
</view>
<view class="subsection-li" @click="changeDate(160.7)">
</view>
<view class="subsection-li sct" @click="changeDate(311.4)">
</view>
<view class="act" :style="{left:leftNum+'rpx'}">
</view>
</view>
<view class="set" @tap="navgo">
<view class="" style="margin: 0 10rpx;">
<u-icon name="setting" color="white" size="15"></u-icon>
</view> 设置
</view>
</view>
<view class="">
<view class="tit">
养殖检测数据
</view>
<view class="charts-box">
<qiun-data-charts type="mix" :opts="opts" :chartData="chartData" />
</view>
<view class="charts-box">
<qiun-data-charts type="mix" :opts="opts2" :chartData="chartData2" />
</view>
<view class="charts-box">
<qiun-data-charts type="mix" :opts="opts3" :chartData="chartData3" />
</view>
</view>
<view class="detect">
<view class="detecttit">
<text class="line"></text> 种植监测
</view>
<view class="content" style=" text-indent: 2em;">
<view class="">
对动物的营养疾病等监测可以可以确保动物摄入足够的营养物质提高生长速度和抗病能力评估饲料的营养水平和动物的营养需求为饲料配方和饲养管理提供依据通过观察动物的行为食欲生长状况等以及定期进行实验室检测可以及早发现动物的异常状况从而采取相应的治疗和隔离措施降低疫情传播风险
</view>
<view class="">
动物排便甲烷浓度含量监测是保障养殖场环境安全和可持续发展的重要措施之一能够及时发现和处理养殖场内的环境问题降低环境污染和温室气体排放提高养殖场的经济效益和社会效益
</view>
<view class="">
对山体监测可以帮助养殖业者更好地了解山体的环境状况,对水质土壤等样品进行检测可以检测出其中是否存在有害微生物和寄生虫及时采取防控措施减少疾病的发生和传播通过对山体温度生态环境的监测可以了解山体生态系统的变化情况如气候变化水土流失植被破坏等可以及时采取措施维护生态平衡优化养殖生产管理提高养殖效率和质量保障养殖业的可持续发展
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
companyMine
} from "@/api/test.js"
export default {
data() {
return {
leftNum: 10,
chartData: {},
chartData2: {},
chartData3: {},
// config-ucharts.js ['mix'] opts opts
opts: {
color: ["#1890FF", "#91CB74"],
padding: [15, 15, 0, 15],
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true,
},
yAxis: {
disabled: false,
disableGrid: false,
splitNumber: 5,
gridType: "dash",
dashLength: 4,
gridColor: "#CCCCCC",
padding: 10,
showTitle: true,
data: [{
position: "left",
title: ""
},
{
position: "right",
min: 0,
max: 200,
title: "",
textAlign: "left"
},
]
},
extra: {
mix: {
column: {
width: 20
}
}
}
},
opts2: {
color: ["#1890FF", "#91CB74"],
padding: [15, 15, 0, 15],
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true,
},
yAxis: {
disabled: false,
disableGrid: false,
splitNumber: 5,
gridType: "dash",
dashLength: 4,
gridColor: "#CCCCCC",
padding: 10,
showTitle: true,
data: [{
position: "left",
title: ""
},
{
position: "right",
min: 0,
max: 200,
title: "",
textAlign: "left"
},
]
},
extra: {
mix: {
column: {
width: 20
}
}
}
}
,
opts3: {
color: ["#1890FF", "#91CB74"],
padding: [15, 15, 0, 15],
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true,
},
yAxis: {
disabled: false,
disableGrid: false,
splitNumber: 5,
gridType: "dash",
dashLength: 4,
gridColor: "#CCCCCC",
padding: 10,
showTitle: true,
data: [{
position: "left",
title: ""
},
{
position: "right",
min: 0,
max: 200,
title: "",
textAlign: "left"
},
]
},
extra: {
mix: {
column: {
width: 20
}
}
}
}
};
},
onReady() {
let datas = [
[25, 20, 17, 29, 28, 26],
[32, 30, 25, 21, 27, 29],
[34, 37, 29, 33, 38, 26],
[25, 15, 172, 95, 71, 59],
[70, 78, 73, 77, 75, 80],
[1.8, 2.8, 1.9, 1.7, 1.3, 1.7],
[111, 113, 129, 34, 199, 153],
[100, 97, 93, 88, 86, 73],
[18, 22, 25, 24, 33, 37],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
]
this.getServerData(datas)
},
onShow() {
companyMine({
id: 1,
flag: 1
}).then(res => {
console.log(res.data)
})
},
methods: {
changeDate(num) {
let datas = []
this.leftNum = num
if (num == 10) {
datas = [
[25, 20, 17, 29, 28, 26],
[32, 30, 25, 21, 27, 29],
[34, 37, 29, 33, 38, 26],
[25, 15, 172, 95, 71, 59],
[70, 78, 73, 77, 75, 80],
[1.8, 2.8, 1.9, 1.7, 1.3, 1.7],
[111, 113, 129, 34, 199, 153],
[100, 97, 93, 88, 86, 73],
[18, 22, 25, 24, 33, 37],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
]
} else if (num == 160.7) {
datas = [
[23, 21, 27, 23, 28, 20],
[30, 34, 32, 36, 27, 24],
[29, 30, 27, 26, 37, 33],
[22, 26, 22, 27, 150, 107],
[70, 76, 83, 87, 84, 80],
[1.6, 1.3, 2.2, 2.0, 1.9, 2.5],
[151, 55, 25, 146, 157, 154],
[101, 116, 114, 109, 105, 105],
[19, 23, 24, 27, 26, 22],
["10-12", "10-13", "10-14", "10-15", "10-16", "10-17"],
["10-12", "10-13", "10-14", "10-15", "10-16", "10-17"],
["10-12", "10-13", "10-14", "10-15", "10-16", "10-17"],
]
} else if (num == 311.4) {
datas = [
[29, 23, 22, 23, 19, 17],
[32, 33, 28, 27, 26, 23],
[26, 25, 35, 32, 30, 33],
[190, 172, 76, 96, 39, 23],
[85, 84, 83, 93, 89, 85],
[1.7, 1.8, 1.8, 1.6, 1.7, 2.0],
[3, 140, 125, 186, 127, 14],
[90, 95, 94, 90, 84, 80],
[19, 23, 25, 20, 22, 26],
["5月", "6月", "7月", "8月", "9月", "10月"],
["5月", "6月", "7月", "8月", "9月", "10月"],
["5月", "6月", "7月", "8月", "9月", "10月"],
]
}
this.getServerData(datas)
},
navgo() {
uni.navigateTo({
url: '/pages/index3/index'
})
},
backFn() {
uni.navigateBack()
},
getServerData(datas) {
//
setTimeout(() => {
//
let res = {
categories: datas[9],
series: [{
name: "土壤温度(℃)",
index: 1,
type: "column",
data: datas[0],
},
{
name: "降雨量(mm)",
type: "line",
color: "#2fc25b",
data: datas[1],
},
{
name: "湿度(wc)",
type: "line",
color: "pink",
data: datas[2],
},
]
};
let res2 = {
categories: datas[10],
series: [
{
name: "氮气含量(%)",
type: "line",
color: "#2fc25b",
data: datas[4],
},
{
name: "甲烷含量(ppm)",
type: "line",
color: "red",
data: datas[5],
},
]
};
let res3 = {
categories: datas[11],
series: [
{
name: "光照(lux)",
type: "line",
color: "#2fc25b",
data: datas[7],
},
{
name: "风速(m/h)",
type: "line",
color: "grey",
data: datas[8],
},
]
};
this.chartData = JSON.parse(JSON.stringify(res));
this.chartData2 = JSON.parse(JSON.stringify(res2));
this.chartData3 = JSON.parse(JSON.stringify(res3));
}, 500);
},
}
};
</script>
<style lang="less" scoped>
.head {
// height: 10vh;
display: flex;
justify-content: space-between;
align-items: center;
// background-color: red;
.subsection {
display: flex;
width: 466.12rpx;
height: 98.13rpx;
background-color: #F4F4F4;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
line-height: 5vh;
position: relative;
.subsection-li {
width: 150.7rpx;
height: 84.11rpx;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
text-align: center;
line-height: 94rpx;
z-index: 8;
// margin-top: 10rpx;
}
.act {
position: absolute;
width: 150.7rpx;
height: 84.11rpx;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
background-color: #fff;
top: 50%;
transform: translateY(-50%);
transition: .5s;
}
}
.set {
width: 131.43rpx;
height: 63rpx;
background-color: #0BC677;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
color: white;
text-align: center;
line-height: 63rpx;
display: flex;
align-items: center;
}
}
.tit {
text-align: center;
margin: 30rpx 0;
font-size: 36.8rpx;
}
.charts-box {
width: 100%;
height: 300px;
border: 1px solid black;
margin-bottom: 40rpx;
}
.detect {
.line {
width: 7.01rpx;
height: 31.54rpx;
background-color: #4CC593;
display: inline-block;
margin-right: 10rpx;
}
.detecttit {
font-size: 31.54rpx;
display: flex;
align-items: center;
}
.content {
padding-top: 20rpx;
}
}
</style>

373
pages/index2/shucai.vue Normal file
View File

@ -0,0 +1,373 @@
<template>
<view class="" style="padding: 30rpx;">
<view style="height: var(--status-bar-height)"></view>
<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
<text>生态概况</text>
</view>
<view class="" style="padding: 20rpx;box-sizing: border-box;">
<view class="head">
<view class="subsection">
<view class="subsection-li" @click="changeDate(10)">
小时
</view>
<view class="subsection-li" @click="changeDate(160.7)">
</view>
<view class="subsection-li sct" @click="changeDate(311.4)">
</view>
<view class="act" :style="{left:leftNum+'rpx'}">
</view>
</view>
<view class="set" @tap="navgo">
<view class="" style="margin: 0 10rpx;">
<u-icon name="setting" color="white" size="15"></u-icon>
</view> 设置
</view>
</view>
<view class="">
<view class="tit">
种植检测数据
</view>
<view class="charts-box">
<qiun-data-charts type="mix" :opts="opts" :chartData="chartData" />
</view>
<view class="charts-box">
<qiun-data-charts type="mix" :opts="opts2" :chartData="chartData2" />
</view>
</view>
<view class="detect">
<view class="detecttit">
<text class="line"></text> 种植监测
</view>
<view class="content" style=" text-indent: 2em;">
<view class="">
监测植物的水分含量确保植物不会因缺水而枯萎或者过度浇水而导致根部窒息监测植物所需的养分含量确保植物能够获得足够的养分来支持其生长和发育监测植物所接受的光照强度和光谱确保植物能够获得足够的光照来支持其光合作用监测植物周围的温度确保植物不会因温度过高或过低而受到影响监测植物周围的空气质量确保植物不会受到有害气体的影响
</view>
<view class="">
通过这些监测种植者可以更好地了解植物的生长状况并根据需要进行调整确保植物能够健康生长同时这些监测也可以用于预测植物的收获时间和收获量从而帮助更好的规划种植计划
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
companyMine
} from "@/api/test.js"
export default {
data() {
return {
leftNum: 10,
chartData: {},
chartData2: {},
// config-ucharts.js ['mix'] opts opts
opts: {
color: ["#1890FF", "#91CB74"],
padding: [15, 15, 0, 15],
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true,
},
yAxis: {
disabled: false,
disableGrid: false,
splitNumber: 5,
gridType: "dash",
dashLength: 4,
gridColor: "#CCCCCC",
padding: 10,
showTitle: true,
data: [{
position: "left",
title: ""
},
{
position: "right",
min: 0,
max: 200,
title: "",
textAlign: "left"
},
]
},
extra: {
mix: {
column: {
width: 20
}
}
}
},
opts2: {
color: ["#1890FF", "#91CB74"],
padding: [15, 15, 0, 15],
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true,
},
yAxis: {
disabled: false,
disableGrid: false,
splitNumber: 5,
gridType: "dash",
dashLength: 4,
gridColor: "#CCCCCC",
padding: 10,
showTitle: true,
data: [{
position: "left",
title: ""
},
{
position: "right",
min: 0,
max: 200,
title: "",
textAlign: "left"
},
]
},
extra: {
mix: {
column: {
width: 20
}
}
}
}
};
},
onReady() {
let datas = [
[30, 32, 32, 38, 36, 30],
[29, 26, 27, 25, 26, 21],
[42, 41, 36, 30, 35, 36],
[189, 98, 88, 55, 131, 195],
[98, 99, 92, 93, 99, 90],
[16, 19, 23, 16, 24, 27],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
]
this.getServerData(datas)
},
onShow() {
companyMine({
id: 1,
flag: 1
}).then(res => {
console.log(res.data)
})
},
methods: {
changeDate(num) {
let datas = []
this.leftNum = num
if (num == 10) {
datas = [
[30, 32, 32, 38, 36, 30],
[29, 26, 27, 25, 26, 21],
[42, 41, 36, 30, 35, 36],
[189, 98, 88, 55, 131, 195],
[98, 99, 92, 93, 99, 90],
[16, 19, 23, 16, 24, 27],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
]
} else if (num == 160.7) {
datas = [
[36, 33, 24, 28, 26, 32],
[26, 29, 26, 30, 31, 28],
[46, 40, 45, 43, 40, 46],
[93, 47, 63, 167, 181, 114],
[88, 97, 89, 92, 95, 96],
[17, 18, 19, 18, 16, 17],
["10-12", "10-13", "10-14", "10-15", "10-16", "10-17"],
["10-12", "10-13", "10-14", "10-15", "10-16", "10-17"],
]
} else if (num == 311.4) {
datas = [
[35, 32, 36, 38, 33, 37],
[22, 27, 28, 23, 25, 24],
[40, 43, 41, 46, 42, 46],
[106, 13, 155, 18, 114, 194],
[94, 89, 87, 86, 85, 87],
[16, 17, 18, 20, 21, 19],
["5月", "6月", "7月", "8月", "9月", "10月"],
["5月", "6月", "7月", "8月", "9月", "10月"],
]
}
this.getServerData(datas)
},
navgo() {
uni.navigateTo({
url: '/pages/index3/index'
})
},
backFn() {
uni.navigateBack()
},
getServerData(datas) {
//
setTimeout(() => {
//
let res = {
categories: datas[6],
series: [{
name: "土壤温度(℃)",
index: 1,
type: "column",
data: datas[0]
},
{
name: "降雨量(mm)",
type: "line",
color: "#2fc25b",
data: datas[1]
},
{
name: "湿度(wc)",
type: "line",
color: "pink",
data: datas[2]
},
]
};
let res2 = {
categories: datas[7],
series: [
{
name: "光照(lux)",
type: "line",
color: "#2fc25b",
data: datas[4]
},
{
name: "风速(m/h)",
type: "line",
color: "blue",
data: datas[5]
},
]
};
this.chartData = JSON.parse(JSON.stringify(res));
this.chartData2 = JSON.parse(JSON.stringify(res2));
}, 500);
},
}
};
</script>
<style lang="less" scoped>
.head {
// height: 10vh;
display: flex;
justify-content: space-between;
align-items: center;
// background-color: red;
.subsection {
display: flex;
width: 466.12rpx;
height: 98.13rpx;
background-color: #F4F4F4;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
line-height: 5vh;
position: relative;
.subsection-li {
width: 150.7rpx;
height: 84.11rpx;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
text-align: center;
line-height: 94rpx;
z-index: 8;
// margin-top: 10rpx;
}
.act {
position: absolute;
width: 130.7rpx;
height: 84.11rpx;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
background-color: #fff;
top: 50%;
transform: translateY(-50%);
transition: .5s;
}
}
.set {
width: 131.43rpx;
height: 63rpx;
background-color: #0BC677;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
color: white;
text-align: center;
line-height: 63rpx;
display: flex;
align-items: center;
}
}
.tit {
text-align: center;
margin: 30rpx 0;
font-size: 36.8rpx;
}
.charts-box {
width: 100%;
height: 300px;
border: 1px solid black;
margin-bottom: 40rpx;
}
.detect {
.line {
width: 7.01rpx;
height: 31.54rpx;
background-color: #4CC593;
display: inline-block;
margin-right: 10rpx;
}
.detecttit {
font-size: 31.54rpx;
display: flex;
align-items: center;
}
.content {
padding-top: 20rpx;
}
}
</style>

370
pages/index2/yx.vue Normal file
View File

@ -0,0 +1,370 @@
<template>
<view class="" style="padding: 30rpx;">
<view style="height: var(--status-bar-height)"></view>
<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
<text>生态概况</text>
</view>
<view class="" style="padding: 20rpx;box-sizing: border-box;">
<view class="head">
<view class="subsection">
<view class="subsection-li" @click="changeDate(10)">
小时
</view>
<view class="subsection-li" @click="changeDate(160.7)">
</view>
<view class="subsection-li sct" @click="changeDate(311.4)">
</view>
<view class="act" :style="{left:leftNum+'rpx'}">
</view>
</view>
<view class="set" @tap="navgo">
<view class="" style="margin: 0 10rpx;">
<u-icon name="setting" color="white" size="15"></u-icon>
</view> 设置
</view>
</view>
<view class="">
<view class="tit">
水池检测数据
</view>
<view class="charts-box">
<qiun-data-charts type="mix" :opts="opts" :chartData="chartData" />
</view>
<view class="charts-box">
<qiun-data-charts type="mix" :opts="opts2" :chartData="chartData2" />
</view>
</view>
<view class="detect">
<view class="detecttit">
<text class="line"></text> 种植监测
</view>
<view class="content" style=" text-indent: 2em;">
<view class="">
通过对水池数据进行实时监测可以及时发现水池中存在的问题如水池的水位水质恶化等可以了解水池的运行规律为水池的管理提供科学依据提高水池的管理水平
</view>
<view class="">
保障水质安全:通过对水质参数的监测,可以及时发现水质问题采取相应措施进行处理确保水池中的水质达标
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
companyMine
} from "@/api/test.js"
export default {
data() {
return {
leftNum: 10,
chartData: {},
chartData2: {},
// config-ucharts.js ['mix'] opts opts
opts: {
color: ["#1890FF", "#91CB74"],
padding: [15, 15, 0, 15],
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true,
},
yAxis: {
disabled: false,
disableGrid: false,
splitNumber: 5,
gridType: "dash",
dashLength: 4,
gridColor: "#CCCCCC",
padding: 10,
showTitle: true,
data: [{
position: "left",
title: ""
},
{
position: "right",
min: 0,
max: 200,
title: "",
textAlign: "left"
},
]
},
extra: {
mix: {
column: {
width: 20
}
}
}
},
opts2: {
color: ["#1890FF", "#91CB74"],
padding: [15, 15, 0, 15],
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true,
},
yAxis: {
disabled: false,
disableGrid: false,
splitNumber: 5,
gridType: "dash",
dashLength: 4,
gridColor: "#CCCCCC",
padding: 10,
showTitle: true,
data: [{
position: "left",
title: ""
},
{
position: "right",
min: 0,
max: 200,
title: "",
textAlign: "left"
},
]
},
extra: {
mix: {
column: {
width: 20
}
}
}
}
};
},
onReady() {
let datas = [
[6.5, 7, 7.5, 6.8, 7.0, 7.2],
[33, 33, 34, 32, 32, 33],
[5, 6, 6, 7, 5, 6],
[0.2, 0.4, 0.5, 0.3, 0.4, 0.3],
[0.3, 0.5, 0.3, 0.4, 0.5, 0.3],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
]
this.getServerData(datas)
},
onLaunch() {
},
onShow() {
companyMine({
id: 1,
flag: 1
}).then(res => {
console.log(res.data)
})
},
methods: {
changeDate(num) {
let datas = []
this.leftNum = num
if (num == 10) {
datas = [
[6.5, 7, 7.5, 6.8, 7.0, 7.2],
[33, 33, 34, 32, 32, 33],
[5, 6, 6, 7, 5, 6],
[0.2, 0.4, 0.5, 0.3, 0.4, 0.3],
[0.3, 0.5, 0.3, 0.4, 0.5, 0.3],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
["12:00", "13:00", "14:00", "15:00", "16:00", "17:00"],
]
} else if (num == 160.7) {
datas = [
[6.9, 7.1, 7.5, 7.5, 7.4, 7.3],
[35, 36, 37, 38, 36, 34],
[5, 7, 6, 6, 7, 5],
[0.3, 0.5, 0.2, 0.3, 0.52, 0.57],
[0.4, 0.45, 0.35, 0.3, 0.28, 0.32],
["10-12", "10-13", "10-14", "10-15", "10-16", "10-17"],
["10-12", "10-13", "10-14", "10-15", "10-16", "10-17"],
]
} else if (num == 311.4) {
datas = [
[7.0, 6.9, 7.3, 6.7, 6.5, 6.6],
[36, 34, 37, 38, 36, 33],
[5, 5, 6, 6, 5, 6],
[0.5, 0.4, 0.34, 0.5, 0.4, 0.3],
[0.6, 0.4, 0.4, 0.5, 0.4, 0.6],
["5月", "6月", "7月", "8月", "9月", "10月"],
["5月", "6月", "7月", "8月", "9月", "10月"],
]
}
this.getServerData(datas)
},
navgo() {
uni.navigateTo({
url: '/pages/index3/index'
})
},
backFn() {
uni.navigateBack()
},
getServerData(datas) {
//
setTimeout(() => {
//
let res = {
categories: datas[5],
series: [{
name: "PH值",
index: 1,
type: "column",
data: datas[0]
},
{
name: "水池温度(℃)",
type: "line",
color: "#2fc25b",
data: datas[1]
},
]
};
let res2 = {
categories: datas[6],
series: [{
name: "溶氧量(mg/L)",
index: 1,
type: "column",
data: datas[2]
},
{
name: "氨气量(mg/L)",
type: "line",
color: "#2fc25b",
data: datas[3]
},
{
name: "亚硝酸盐",
type: "line",
color: "#2fc25b",
data: datas[4]
},
]
};
this.chartData = JSON.parse(JSON.stringify(res));
this.chartData2 = JSON.parse(JSON.stringify(res2));
}, 500);
},
}
};
</script>
<style lang="less" scoped>
.head {
// height: 10vh;
display: flex;
justify-content: space-between;
align-items: center;
// background-color: red;
.subsection {
display: flex;
width: 466.12rpx;
height: 98.13rpx;
background-color: #F4F4F4;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
line-height: 5vh;
position: relative;
.subsection-li {
width: 150.7rpx;
height: 84.11rpx;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
text-align: center;
line-height: 94rpx;
z-index: 8;
// margin-top: 10rpx;
}
.act {
position: absolute;
width: 130.7rpx;
height: 84.11rpx;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
background-color: #fff;
top: 50%;
transform: translateY(-50%);
transition: .5s;
}
}
.set {
width: 131.43rpx;
height: 63rpx;
background-color: #0BC677;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
color: white;
text-align: center;
line-height: 63rpx;
display: flex;
align-items: center;
}
}
.tit {
text-align: center;
margin: 30rpx 0;
font-size: 36.8rpx;
}
.charts-box {
width: 100%;
height: 300px;
border: 1px solid black;
margin-bottom: 40rpx;
}
.detect {
.line {
width: 7.01rpx;
height: 31.54rpx;
background-color: #4CC593;
display: inline-block;
margin-right: 10rpx;
}
.detecttit {
font-size: 31.54rpx;
display: flex;
align-items: center;
}
.content {
padding-top: 20rpx;
}
}
</style>

206
pages/index3/index.vue Normal file
View File

@ -0,0 +1,206 @@
<template>
<view class="content">
<view style="height: var(--status-bar-height)"></view>
<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
<text>商品溯源</text>
</view>
<view class="head-img">
<view class="">
<u--image src="/static/img/GJBG.jpg" width="693.93rpx" height=" 394.28rpx" alt=""></u--image>
</view>
<!-- <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="click"></u--image> -->
<!-- <view class="poisition">
<view style="display: flex;">
<u--image src="/static/img/dw.png" style="margin: 0 5rpx;" width="35.05rpx"
height="35.05rpx"></u--image>
江阳区通滩镇1队123号
</view>
</view> -->
</view>
<view class="bad-info" v-for="(item,index) in data" :key="index">
<view class="tit">
{{item.tit}}
</view>
<view class="bad-info-cont">
<view class="" v-if="item.step">
<u-steps current="3" direction="column" activeColor="#3DD395">
<u-steps-item :title="item.des1" :desc="item.time1">
</u-steps-item>
<u-steps-item :title="item.des2" :desc="item.time2">
</u-steps-item>
<u-steps-item :title="item.des3" :desc="item.time3">
</u-steps-item>
</u-steps>
</view>
<view class="" style=" display: flex;" v-else>
<view class="">
<view class="bad-info-cont-li">
{{item.spmc}}
</view>
<view class="bad-info-cont-li">
{{item.scdz}}
</view>
<view class="bad-info-cont-li" v-show="item.scq">
{{item.scq}}
</view>
</view>
<view class="">
<view class="bad-info-cont-li">
{{item.spmc1}}
</view>
<view class="bad-info-cont-li" v-if="!(item.scdz1.includes('/static'))">
{{item.scdz1}}
</view>
<view class="bad-info-cont-li" v-show="!item.scq1.includes('static')">
{{item.scq1}}
</view>
</view>
</view>
<view class="" v-if='item.img'>
<u--image :src="item.scq1" width="646.61rpx" height="529.21rpx" alt=""></u--image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello',
data: [{
tit: "品类信息",
spmc: "商品名称",
scdz: "生产地址",
scq: "生长期",
spmc1: "蜜桔",
scdz1: "分水岭大南山北326米",
scq1: "125天",
img: false
}, {
tit: "施肥",
des1: "桔丰1号2kg 施肥人:韦军",
des2: "华东化肥1.5kg 施肥人:张鹏飞",
des3: "承平洋化肥2.7kg 施肥人:陈明",
time1: "2023-5-15",
time2: "2023-6-1",
time3: "2023-6-29",
step: true,
}, {
tit: "打药",
des1: "宝卓 30%乙唑螨腈2kg 打药人:韦军",
des2: "抑霉唑1.5kg 打药人:张鹏飞",
des3: "噻菌灵2.7kg 打药人:陈明",
time1: "2023-5-20",
time2: "2023-6-18",
time3: "2023-7-5",
step: true,
}, {
tit: "采摘",
spmc: "采摘时间",
scdz: "采摘人",
scq: "果园图片",
img: true,
spmc1: "2023-9-20",
scdz1: "李莲芳",
scq1: "/static/img/GJ.jpg",
},
]
}
},
onLoad() {
},
methods: {
urlFn(name) {
return `/static/img/${name}.png`
},
img(w, h, m) {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
},
backFn() {
uni.navigateBack()
},
navto() {
uni.navigateTo({
url: '/pages/index2/index'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 30rpx;
// background-color: grey;
background-image: url("/static/img/bgc.png");
background-size: cover;
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 0 auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 380.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 43rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
.dw-cls {
margin: 0 5rpx;
}
}
}
.bad-info {
margin: 20rpx 0;
width: 693.93rpx;
.tit {
margin: 20rpx 0;
}
.bad-info-cont {
padding: 20rpx;
// padding-bottom: 0;
background-color: white;
// width: 693.93rpx;
// height: 140.19rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
// align-items: center;
}
.bad-info-cont-li {
margin-bottom: 30rpx;
}
}
</style>

220
pages/index3/ji.vue Normal file
View File

@ -0,0 +1,220 @@
<template>
<view class="content">
<view style="height: var(--status-bar-height)"></view>
<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
<text>商品溯源</text>
</view>
<view class="head-img">
<view class="">
<u--image src="/static/img/JCBJ.jpg" width="693.93rpx" height=" 394.28rpx" alt=""></u--image>
</view>
<!-- <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="click"></u--image> -->
<!-- <view class="poisition">
<view style="display: flex;">
<u--image src="/static/img/dw.png" style="margin: 0 5rpx;" width="35.05rpx"
height="35.05rpx"></u--image>
江阳区通滩镇1队123号
</view>
</view> -->
</view>
<view class="bad-info" v-for="(item,index) in data" :key="index">
<view class="tit">
{{item.tit}}
</view>
<view class="bad-info-cont">
<view class="" v-if="item.step">
<u-steps current="5" direction="column" activeColor="#3DD395">
<u-steps-item class="steps" :title="item.des1" :desc="item.time1">
</u-steps-item>
<u-steps-item :title="item.des2" :desc="item.time2">
</u-steps-item>
<u-steps-item :title="item.des3" :desc="item.time3">
</u-steps-item>
<u-steps-item :title="item.des4" :desc="item.time4">
</u-steps-item>
<u-steps-item :title="item.des5" :desc="item.time5">
</u-steps-item>
</u-steps>
</view>
<view class="" style=" display: flex;" v-else>
<view class="">
<view class="bad-info-cont-li">
{{item.spmc}}
</view>
<view class="bad-info-cont-li">
{{item.scdz}}
</view>
<view class="bad-info-cont-li" v-show="item.scq">
{{item.scq}}
</view>
</view>
<view class="">
<view class="bad-info-cont-li">
{{item.spmc1}}
</view>
<view class="bad-info-cont-li" v-show="!item.scdz1.includes('static')">
{{item.scdz1}}
</view>
<view class="bad-info-cont-li" v-show="!item.scdz1.includes('static')">
<!-- {{item.scdz1}} -->
{{item.scq1}}
</view>
</view>
</view>
<view class="" v-if='item.img'>
<u--image :src="item.scdz1" width="646.61rpx" height="529.21rpx" alt=""></u--image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello',
data: [{
tit: "品类信息",
spmc: "商品名称",
scdz: "生产地址",
scq: "生长期",
img: false,
spmc1: "白羽鸡",
scdz1: "江阳区威武村南485米",
scq1: "5个月",
}, {
tit: "饲养",
spmc: "饲料名称",
scdz: "饲料用量",
scq: "饲养人",
img: false,
spmc1: "正大饲料",
scdz1: "3KG",
scq1: "赵国强",
},
{
tit: "卫生",
des1: "鸡舍卫生清洁 负责人:周树",
des2: "滴露消毒液1L 负责人:刘明山",
des3: "鸡舍卫生清洁 负责人:周树",
des4: "滴露消毒液1L 负责人:刘明山",
des5: "鸡舍卫生清洁 负责人:周树",
time1: "2023-10-9",
time2: "2023-9-29",
time3: "2023-8-15",
time4: "2023-5-15",
time5: "2023-7-1",
step: true,
},
{
tit: "出栏",
spmc: "出栏时间",
scdz: "鸡畜图片",
img: true,
spmc1: "2023-11-10",
scdz1: "/static/img/JC.jpg",
scq1: "8个月",
}
]
}
},
onLoad() {
},
methods: {
urlFn(name) {
return `/static/img/${name}.png`
},
img(w, h, m) {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
},
backFn() {
uni.navigateBack()
},
navto() {
uni.navigateTo({
url: '/pages/index2/index'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 30rpx;
// background-color: grey;
background-image: url("/static/img/bgc.png");
background-size: cover;
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 0 auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 380.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 43rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
.dw-cls {
margin: 0 5rpx;
}
}
}
.bad-info {
margin: 20rpx 0;
width: 693.93rpx;
.tit {
margin: 20rpx 0;
}
.bad-info-cont {
padding: 20rpx;
// padding-bottom: 0;
background-color: white;
// width: 693.93rpx;
// height: 140.19rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
// align-items: center;
}
.bad-info-cont-li {
margin-bottom: 30rpx;
}
}
.steps {
// color: red !important;
}
</style>

216
pages/index3/shucai.vue Normal file
View File

@ -0,0 +1,216 @@
<template>
<view class="content">
<view style="height: var(--status-bar-height)"></view>
<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
<text>商品溯源</text>
</view>
<view class="head-img">
<view class="">
<u--image src="/static/img/SCBJ.jpg" width="693.93rpx" height=" 394.28rpx" alt=""></u--image>
</view>
<!-- <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="click"></u--image> -->
<!-- <view class="poisition">
<view style="display: flex;">
<u--image src="/static/img/dw.png" style="margin: 0 5rpx;" width="35.05rpx"
height="35.05rpx"></u--image>
江阳区通滩镇1队123号
</view>
</view> -->
</view>
<view class="bad-info" v-for="(item,index) in data" :key="index">
<view class="tit">
{{item.tit}}
</view>
<view class="bad-info-cont">
<view class="" v-if="item.step">
<u-steps current="3" direction="column" activeColor="#3DD395">
<u-steps-item :title="item.des1" :desc="item.time1">
</u-steps-item>
<u-steps-item :title="item.des2" :desc="item.time2">
</u-steps-item>
<u-steps-item :title="item.des3" :desc="item.time3">
</u-steps-item>
</u-steps>
</view>
<view class="" style=" display: flex;" v-else>
<view class="">
<view class="bad-info-cont-li">
{{item.spmc}}
</view>
<view class="bad-info-cont-li">
{{item.scdz}}
</view>
<view class="bad-info-cont-li" v-show="item.scq">
{{item.scq}}
</view>
</view>
<view class="">
<view class="bad-info-cont-li">
{{item.spmc1}}
</view>
<view class="bad-info-cont-li">
{{item.scdz1}}
</view>
<view class="bad-info-cont-li" v-show="!item.scq1.includes('static')">
{{item.scq1}}
</view>
</view>
</view>
<view class="" v-if='item.img'>
<u--image :src="item.scq1" width="646.61rpx" height="529.21rpx" alt=""></u--image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello',
data: [{
tit: "品类信息",
spmc: "商品名称",
scdz: "生产地址",
scq: "生长期",
img: false,
spmc1: "白菜",
scdz1: "于江阳区水中坝北352米",
scq1: "82天",
}, {
tit: "施肥",
des1: "史丹利复合肥2kg 施肥人:刘扬",
des2: "绿盼有机肥1.5kg 施肥人:周立明",
des3: "美乐棵营养土2.7kg 施肥人:马挑",
time1: "2023-8-15",
time2: "2023-9-1",
time3: "2023-9-15",
step: true,
}, {
tit: "打药",
des1: "先正达杀虫剂2L 打药人:张龙",
des2: "红太阳抑霉唑1.5kg 打药人:李俊杰",
des3: "扬农氯碱2.7kg 打药人:徐坤",
time1: "2023-8-30",
time2: "2023-9-15",
time3: "2023-9-29",
step: true,
spmc: "农药名称",
scdz: "农药用量",
scq: "打药人",
img: false,
spmc1: "宝卓 30%乙唑螨腈",
scdz1: "2kg",
scq1: "李*",
step: true
}, {
tit: "采摘",
spmc: "采摘时间",
scdz: "采摘人",
scq: "蔬菜图片",
img: true,
spmc1: "2023-10-10",
scdz1: "陈能",
scq1: "/static/img/SC.jpg",
}
]
}
},
onLoad() {
},
methods: {
urlFn(name) {
return `/static/img/${name}.png`
},
img(w, h, m) {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
},
backFn() {
uni.navigateBack()
},
navto() {
uni.navigateTo({
url: '/pages/index2/index'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 30rpx;
// background-color: grey;
background-image: url("/static/img/bgc.png");
background-size: cover;
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 0 auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 380.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 43rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
.dw-cls {
margin: 0 5rpx;
}
}
}
.bad-info {
margin: 20rpx 0;
width: 693.93rpx;
.tit {
margin: 20rpx 0;
}
.bad-info-cont {
padding: 20rpx;
// padding-bottom: 0;
background-color: white;
// width: 693.93rpx;
// height: 140.19rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
// align-items: center;
}
.bad-info-cont-li {
margin-bottom: 30rpx;
}
}
</style>

211
pages/index3/xia.vue Normal file
View File

@ -0,0 +1,211 @@
<template>
<view class="content">
<view style="height: var(--status-bar-height)"></view>
<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
<text>商品溯源</text>
</view>
<view class="head-img">
<view class="">
<u--image src="/static/img/YXBJ.jpg" width="693.93rpx" height=" 394.28rpx" alt=""></u--image>
</view>
<!-- <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="click"></u--image> -->
<!-- <view class="poisition">
<view style="display: flex;">
<u--image src="/static/img/dw.png" style="margin: 0 5rpx;" width="35.05rpx"
height="35.05rpx"></u--image>
江阳区通滩镇1队123号
</view>
</view> -->
</view>
<view class="bad-info" v-for="(item,index) in data" :key="index">
<view class="tit">
{{item.tit}}
</view>
<view class="bad-info-cont">
<view class="" v-if="item.step">
<u-steps current="3" direction="column" activeColor="#3DD395">
<u-steps-item :title="item.des1" :desc="item.time1">
</u-steps-item>
<u-steps-item :title="item.des2" :desc="item.time2">
</u-steps-item>
<u-steps-item :title="item.des3" :desc="item.time3">
</u-steps-item>
</u-steps>
</view>
<view class="" style=" display: flex;" v-else>
<view class="">
<view class="bad-info-cont-li">
{{item.spmc}}
</view>
<view class="bad-info-cont-li">
{{item.scdz}}
</view>
<view class="bad-info-cont-li" v-show="item.scq">
{{item.scq}}
</view>
</view>
<view class="">
<view class="bad-info-cont-li">
{{item.spmc1}}
</view>
<view class="bad-info-cont-li">
{{item.scdz1}}
</view>
<view class="bad-info-cont-li" v-show="!item.scq1.includes('static')">
{{item.scq1}}
</view>
</view>
</view>
<view class="" v-if='item.img'>
<u--image :src="item.scq1" width="646.61rpx" height="529.21rpx" alt=""></u--image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello',
data: [{
tit: "品类信息",
spmc: "商品名称",
scdz: "生产地址",
scq: "生长期",
img: false,
spmc1: "鲥鱼",
scdz1: "牟咀村西南294米",
scq1: "72天",
},
{
tit: "饲养",
spmc: "饲料名称",
scdz: "饲料用量",
scq: "饲养人",
img: false,
spmc1: "海豚鱼粮",
scdz1: "3Kg",
scq1: "赵志",
},
{
tit: "环境检测",
des1: "水质检测 负责人:刘明明",
des2: "水质检测 负责人:刘明明",
des3: "水质检测 负责人:刘明明",
time1: "2023-6-8",
time2: "2023-7-1",
time3: "2023-7-18",
step: true,
}, {
tit: "捕捞",
spmc: "捕捞时间",
scdz: "捕捞人",
scq: "图片",
img: true,
spmc1: "2023.8",
scdz1: "徐坤",
scq1: "/static/img/YX.jpg",
}
]
}
},
onLoad() {
},
methods: {
urlFn(name) {
return `/static/img/${name}.png`
},
img(w, h, m) {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
},
backFn() {
uni.navigateBack()
},
navto() {
uni.navigateTo({
url: '/pages/index2/index'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 30rpx;
// background-color: grey;
background-image: url("/static/img/bgc.png");
background-size: cover;
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 0 auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 380.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 43rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
.dw-cls {
margin: 0 5rpx;
}
}
}
.bad-info {
margin: 20rpx 0;
width: 693.93rpx;
.tit {
margin: 20rpx 0;
}
.bad-info-cont {
padding: 20rpx;
// padding-bottom: 0;
background-color: white;
// width: 693.93rpx;
// height: 140.19rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
// align-items: center;
}
.bad-info-cont-li {
margin-bottom: 30rpx;
}
}
</style>

11
pages/test/index.vue Normal file
View File

@ -0,0 +1,11 @@
<template>
<view class="">
<view style="height: var(--status-bar-height)"></view>
</view>
</template>
<script>
</script>
<style>
</style>

BIN
static/img/ADL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
static/img/AHL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
static/img/AQHL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
static/img/B.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/img/CO2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/img/CTPH.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/img/CTWD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/img/D.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/img/DK.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
static/img/DZJC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
static/img/EYHT.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/img/F.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/img/FH.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/img/FS (1).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/img/FS (2).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/img/FS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/img/FX (1).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/img/FX.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/img/G (1).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/img/G.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/img/GG.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
static/img/GJ.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 MiB

BIN
static/img/GJBG.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 MiB

BIN
static/img/GZ (1).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/img/GZ (2).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/img/GZ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/img/JC.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

BIN
static/img/JCBJ.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 MiB

BIN
static/img/JI.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 KiB

BIN
static/img/JWHL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/img/JYL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/img/KQSD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/img/KQZL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
static/img/KQZLZS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
static/img/QTTC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
static/img/QXJC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
static/img/RYL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
static/img/RYY.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
static/img/SC.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 KiB

BIN
static/img/SCBJ.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

BIN
static/img/SG.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/img/SHUCAI.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 KiB

BIN
static/img/SJ (1).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/img/SLWD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/img/SZJC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
static/img/TDSD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/img/TDWD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/img/TRSD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/img/TRWD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/img/WD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
static/img/WDGG.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
static/img/XIA.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

BIN
static/img/YX.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

BIN
static/img/YXBJ.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

BIN
static/img/YXSY.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
static/img/ZWXBSQ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
static/img/badinfo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
static/img/bg1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 KiB

BIN
static/img/bgc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

BIN
static/img/dw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/img/sj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/img/sjfx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
static/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

106
utils/oahttp.js Normal file
View File

@ -0,0 +1,106 @@
import {
HTTP_REQUEST_URL_THREE,
HEADER,
TOKENNAME,
} from '@/config/app';
import {
Toast
} from '../libs/uniApi';
// import { checkLogin } from '../libs/login';
// import store from '../store';
function baseRequestTwo(url, method, data, {
noAuth = false,
noVerify = false,
onReLogin = false
}) {
let Url = 'http://ceshi-suyuan.lihaink.cn/',
header = HEADER;
// if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token;
// if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
// header[TOKENNAME] = 'Bearer sdjflidshjgfkbdasgjmasbgvhauuiavhkesvndkaesbvkjsdbv';
return new Promise((reslove, reject) => {
// uni.showLoading({
// title: '加载中'
// })
uni.request({
// url: Url + '/api/v1' + url,
url: Url + 'adminapi' + url,
method: method || 'GET',
header: {
...header
},
data: method != 'GET' ? data || {} : {},
params: method == 'GET' ? data : {},
success: (res) => {
if (noVerify)
reslove(res.data);
else if (res.data.code == -1) {
if (onReLogin) {
// store.commit('LOGOUT');
return reject();
}
// 如果登录超时,自动重新登录并且继续发送请求
// store.dispatch("RE_LOGIN", {
// url: url,
// method: method,
// data: data,
// opt: {
// noAuth,
// noVerify
// }
// }).then((e) => {
// reslove(e);
// }).catch((err) => {
// reject(res.data);
// })
// store.commit("SET_REQUEST", false);
} else if (res.data.code == 0) {
if (res.data.msg != '无登录信息') {
uni.showToast({
title: res.data.msg || '请检查网络',
icon: 'none',
})
}
reject(res.data);
} else if (res.data.code == 1) {
// store.commit("SET_REQUEST");
reslove(res.data);
} else if (res.data.code == 200) {
// store.commit("SET_REQUEST");
reslove(res.data.data);
} else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) {
toLogin();
reject(res.data);
} else if (res.data.code == 501) {
reject(res.data);
} else {
uni.showToast({
title: res.data.msg || '请检查网络',
icon: 'none'
})
reject(res.data.msg || '请检查网络');
}
},
fail: (message) => {
// uni.hideLoading()
uni.showToast({
title: '网络错误',
icon: 'none'
})
reject('请求失败');
}
})
});
}
const oahttp = {};
['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => {
oahttp[method] = (api, data, opt) => baseRequestTwo(api, method, data, opt || {})
});
export default oahttp;