diff --git a/App.vue b/App.vue index e67f279..0d24abb 100644 --- a/App.vue +++ b/App.vue @@ -48,6 +48,10 @@ display: flex; align-items: center; } + .u-action-sheet__item-wrap { + overflow: auto; + max-height: 30vh !important; + } /*每个页面公共css */ \ No newline at end of file diff --git a/api/file.js b/api/file.js index e1e235a..e527b01 100644 --- a/api/file.js +++ b/api/file.js @@ -1,25 +1,60 @@ import syhttp from "@/utils/syhttp.js"; +import http from "@/utils/http.js"; + + -/** - * 我的公司 - */ -export const uplodeImgAPI = (data) => syhttp.post('/user/imageUpload', data) //登录 export const login = (data) => syhttp.post('/login/account', data) - - //验证码 - export const xinregister = (data) => syhttp.post('/index/code', data) - - //用户注册 export const logregister = (data) => syhttp.post('/login/register', data) - //修改密码 export const changePassword = (data) => syhttp.post('/user/changePassword', data) - //退出登录 +export const logout = (data) => syhttp.get('/login/logout', data) +//土地列表 +export const landlist = (data) => syhttp.get('/land/list', data) +//土地详情 +export const landdetail = (data) => syhttp.get('/land/detail', data) +//新增土地 +export const addland = (data) => syhttp.post('/land/add', data) +//种植列表 +export const plantlist = (data) => syhttp.get('/plant/list', data) +//新增种植 +export const addplant = (data) => syhttp.post('/plant/add', data) +//操作列表 +export const actionlist = (data) => syhttp.get('/action/list', data) +//添加操作 +export const addaction = (data) => syhttp.post('/action/add', data) +//添加操作 +export const binddevice = (data) => syhttp.post('/device/bind', data) + +//首页 +export const lindexist = (data) => syhttp.get('/index/index', data) + + + + + + + + + + + +//省 +export const province = (data) => http.get('/common/geo/province', data) +//市 +export const city = (data) => http.get('/common/geo/city', data) +//区县 +export const county = (data) => http.get('/common/geo/county', data) +//镇街 +export const towns = (data) => http.get('/common/geo/towns', data) +//乡村 +export const villages = (data) => http.get('/common/geo/villages', data) +//小组 +export const groups = (data) => http.get('/common/geo/groups', data) + -export const logout = (data) => syhttp.get('/login/logout', data) \ No newline at end of file diff --git a/api/upload.js b/api/upload.js new file mode 100644 index 0000000..41e9505 --- /dev/null +++ b/api/upload.js @@ -0,0 +1,68 @@ +// import base from "@/config/baseUrl"; +// let baseUrl = 'https://ceshi.excellentkk.cn/api'; +// import store from '../store'; +import { config } from '@/config/app'; +let header = {}; +console.log(config) + +if (uni.getStorageSync('SY_TOKEN')){ + header.token = uni.getStorageSync('SY_TOKEN'); +} + +function uploads(src, type) { + return new Promise((resolve, reject) => { + // //console.log('上传', type === 'img' ? '图片' : '视频', ':', src) + let a = uni.uploadFile({ + // url: base.baseUrl + '/upload?token=', + url: HTTP_REQUEST_URL_TWO + '/api' + '/upload?token=', + filePath: src, + name: 'file', + success: (res) => { + let data = JSON.parse(res.data) + if (data.code != 1) { + uni.$u.toast(data.msg) + return false + } else { + resolve(data.data.url) // 返回线上地址 + } + }, + fail: (err) => { + reject(err) + //console.log('upload-上传失败', err) + } + }); + }) +} + +function Uploads(src, type) { + return new Promise((resolve, reject) => { + // //console.log('上传', type === 'img' ? '图片' : '视频', ':', src) + + let a = uni.uploadFile({ + url:config.HTTP_REQUEST_URL + '/api/upload/image', + filePath: src, + name: 'file', + header: header, + success: (res) => { + + let data = JSON.parse(res.data) + if (data.code == 1) { + resolve(data) // 返回线上地址 + } else { + uni.$u.toast(data.msg) + return false + } + }, + fail: (err) => { + reject(err) + //console.log('upload-上传失败', err) + } + }); + }) +} + + +export { + uploads, + Uploads +} diff --git a/components/plant/landInfo.vue b/components/plant/landInfo.vue index b1abaf6..937c46d 100644 --- a/components/plant/landInfo.vue +++ b/components/plant/landInfo.vue @@ -2,31 +2,32 @@ - {{land.crop_id}}号土地 + {{info.title}} + 号土地 - 溯源码: {{land.source_code}} + 溯源码: {{}} - 当前种植: {{land.crop_name}} - - - 种植品牌: {{land.crop_brand}} + 当前种植: {{info.residual_area}}亩 + - 土地面积: {{land.land_area}}亩 - - - 种子品牌: {{land.crop_variety}} + 土地面积: {{info.total_area}}亩 + - + - 预计产量: {{land.crop_yield}}亩 + - - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + v-model="data.formData.master_phone"> 土地图片 + + + + + + + + - - - - - + + 点击上传图片 + + + - + + + + + + + + + + + + 提交 - - - - - 完成添加 - - - - - - - - \ No newline at end of file diff --git a/pages/addLand/addLand1.vue b/pages/addLand/addLand1.vue new file mode 100644 index 0000000..4d20b4f --- /dev/null +++ b/pages/addLand/addLand1.vue @@ -0,0 +1,504 @@ + + + + + \ No newline at end of file diff --git a/pages/addLand/addLand2.vue b/pages/addLand/addLand2.vue new file mode 100644 index 0000000..bf54764 --- /dev/null +++ b/pages/addLand/addLand2.vue @@ -0,0 +1,403 @@ + + + \ No newline at end of file diff --git a/pages/husbandryForm/Pest.vue b/pages/husbandryForm/Pest.vue index 126b7df..069b501 100644 --- a/pages/husbandryForm/Pest.vue +++ b/pages/husbandryForm/Pest.vue @@ -3,69 +3,85 @@ - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + - 防治图片 + 杀虫图片 - - - - + + + + - - + + + + + + + 点击上传图片 + - - + + - + - 完成添加 @@ -80,69 +96,211 @@ diff --git a/pages/husbandryForm/fertilize.vue b/pages/husbandryForm/fertilize.vue index c36fb3d..227a1b5 100644 --- a/pages/husbandryForm/fertilize.vue +++ b/pages/husbandryForm/fertilize.vue @@ -3,72 +3,90 @@ - + + v-model="formData.kind"> - + - + + v-model="formData.dosage"> - - - - - - - - - - + + + + + + + + + + + + + + + + + + + v-model="formData.area"> - - + + 施肥图片 - - - - + + + + + - - - + + + + + + + + 点击上传图片 + - - + + - + 完成添加 - + dateConfirmfn1 @@ -79,69 +97,215 @@ diff --git a/pages/husbandryForm/harvest.vue b/pages/husbandryForm/harvest.vue index 58ae97c..8114552 100644 --- a/pages/husbandryForm/harvest.vue +++ b/pages/husbandryForm/harvest.vue @@ -4,41 +4,49 @@ - + + + 收获图片 - - - - + + + + - - + + + + + + + 点击上传图片 + - - + + + @@ -57,31 +65,49 @@ diff --git a/pages/husbandryForm/sow.vue b/pages/husbandryForm/sow.vue index 3150b16..a4f86c1 100644 --- a/pages/husbandryForm/sow.vue +++ b/pages/husbandryForm/sow.vue @@ -2,55 +2,60 @@ - - + + + v-model="data.formData.kind"> - + + v-model="data.formData.breed"> - - + + - - - - + + + v-model="data.formData.area"> - - + + - 种植图片 + 土地图片 + + + + + + + + - - - - - + + 点击上传图片 + - - + + - + @@ -72,68 +77,190 @@ diff --git a/pages/husbandryForm/weeding.vue b/pages/husbandryForm/weeding.vue index 8b5466e..2e33244 100644 --- a/pages/husbandryForm/weeding.vue +++ b/pages/husbandryForm/weeding.vue @@ -3,69 +3,85 @@ - + + v-model="formData.kind"> - + - - + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + v-model="formData.area"> - - + + - 除草图片 + 土地图片 - - - - + + + + - - + + + + + + + 点击上传图片 + - - + + - + - 完成添加 @@ -74,75 +90,217 @@ + diff --git a/pages/index/index.vue b/pages/index/index.vue index 35b90f6..cf74793 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,35 +3,43 @@ - + + 搜索 + - + - 土地名称 + {{item.title}} - + 已种植 - + 未种植 - + - 面积: 20亩 + 种植面积:{{item.total_area-item.residual_area}}亩 + + + + + 未种植面积:{{item.total_area}}亩 - 农作物: 洋芋 + 地址: {{item.town_name}}{{item.village_name}}{{item.group_name}} - - + @@ -39,18 +47,40 @@ + \ No newline at end of file diff --git a/pages/index/massif.vue b/pages/index/massif.vue index f663626..1ed4d59 100644 --- a/pages/index/massif.vue +++ b/pages/index/massif.vue @@ -1,5 +1,3 @@ - -