Browse Source

添加功能 新增害虫类型表单

master
邓宏 2 years ago
parent
commit
6c2d8b22f6
  1. 1
      pages/home/index.vue
  2. 9
      pages/home/my.vue
  3. 1
      pages/massif/pestRecord.vue
  4. 99
      pages/massif/pestType.vue
  5. 9
      router/massif.js
  6. 2
      uni.scss
  7. 9
      uni_modules/d-form/components/d-form/d-form.vue

1
pages/home/index.vue

@ -399,6 +399,7 @@ import request,{host} from '@/common/request.js'
// index:0,
// pagePath:"/pages/home/rePassword"
// })
uni.setTabBarBadge({ index:2, text:'2' })//
this.getHeadImg()
if(this.isAdmin){
this.getPlantBase()

9
pages/home/my.vue

@ -70,6 +70,9 @@
<view class="item" @click="$u.route({url:'/pages/stock/already'})">
<text class="plant-kufangguanli-lingyongguihuan"/> <text>领用记录</text> <text class="plant-youbian"/>
</view>
<view class="item">
<text class="plant-xitongxiaoxi"/> <text>系统消息</text> <text class="plant-youbian"/>
</view>
<view class="item" @click="$store.commit('outLogin')">
<text class="plant-tuichu"/> <text>退出</text> <text class="plant-youbian"/>
</view>
@ -85,12 +88,18 @@ import {host} from '@/common/request'
}
},
onLoad(options){
console.log('--my-----onLoad-----------')
this.$nextTick(()=>{
if(options.toPage){
uni.navigateTo({url:`/pages/purchase/${options.toPage}`})
}
})
},
onShow(){
console.log('------my-----onShow---------------')
// uni.setTabBarBadge({ index:2, text:'' })//
uni.hideTabBarRedDot({index:2})
},
methods:{
}

1
pages/massif/pestRecord.vue

@ -32,6 +32,7 @@ export default {
pestSite:{label:"病虫害部位",type:"checkBox",value:[],columns:[{label:"根",value:"根"},{label:"茎",value:"茎"},{label:"叶",value:"叶"}]},
growthProcess:{label:"作物生长过程",type:"select-tab",dictCode:"growth_process"},
symptom:{label:"显著症状",type:"select-tab",dictCode:"symptom"},
type:{label:"害虫类型",type:"navigate",btnFun:()=>uni.navigateTo({url:"/pages/massif/pestType"})},
medicationArea:{label:"农资作用面积",type:"digit",suffix:"亩"},
pic:{label:"凭证",type:"upImg",value:""},
description:{label:"病虫害描述",type:"textarea"},

99
pages/massif/pestType.vue

@ -0,0 +1,99 @@
<style lang="less" scoped>
.container{
height:100%;
&>.d-search{
&/deep/ .search{
margin-bottom:0;
}
}
&>.u-tabs{
&/deep/ .u-tabs__wrapper__nav__line{
box-shadow:0 4rpx 6rpx 2rpx rgba(16,193,118,0.1);
}
}
&>.tabs{
margin:10rpx 30rpx 0;
background:#EEFBF5;
border-radius: 8rpx;
padding:0 15rpx;
display:flex;
flex-wrap: wrap;
text{
color:#999;
padding:15rpx;
&.active{
color:#10C176;
}
}
}
&>.title{
color:#333;
margin:30rpx;
&:before{
content:"*";
color:#EE263A;
}
}
&>.items{
display:flex;
flex-wrap: wrap;
margin:30rpx;
text{
background:#eee;
color:#999;
height:54rpx;
line-height: 54rpx;
border-radius: 54rpx;
font-size:24rpx;
margin:0 30rpx 20rpx 0;
width:calc(100%/4 - 30rpx);
text-align: center;
&.active{
background:#10C176;
color:#fff;
}
}
}
}
</style>
<template>
<view class="container">
<d-navbar style="--bg:#10C176;--c:#fff;" isBack text="添加农事">
<button slot="right" class="cu-btn round" @click="submit">提交</button>
</d-navbar>
<d-search background="#f6f6f6"/>
<u-tabs :list="cropList" activeStyle="color:#10C176" lineWidth="60rpx" lineHeight="8rpx" inactiveStyle="color:#333" lineColor="#10C176"></u-tabs>
<view class="tabs">
<text>玉米</text>
<text class="active">水稻</text>
</view>
<view class="title">害虫类型</view>
<view class="items">
<text class="active">黄地老虎</text>
<text v-for="k in 20" :key="k">黄地老虎</text>
<text>自定义+</text>
</view>
</view>
</template>
<script>
export default {
data(){
return{
cropList:[
{name:'粮食作物',},
{name:'油料作物',},
{name:'经济作物',},
{name:'药用作物',},
{name:'牧草',},
{name:'树林'},
]
}
},
methods:{
submit(){
},
}
}
</script>

9
router/massif.js

@ -134,4 +134,13 @@ module.exports=[
}
}
},
{
path:"pages/massif/pestType",
style:{
navigationBarTitleText:"害虫类型",
"app-plus":{
titleNView:false,
}
}
},
]

2
uni.scss

@ -77,7 +77,7 @@ $uni-font-size-paragraph:15px;
@import '@/common/main.css';
@import 'uview-ui/theme.scss';
@import url('https://at.alicdn.com/t/c/font_3852037_x0ytzgg6if.css');
@import url('https://at.alicdn.com/t/c/font_3852037_8frcz777lb4.css');
[class*=plant-]{
font-family: "plantMana" !important;
font-size: 16px;

9
uni_modules/d-form/components/d-form/d-form.vue

@ -25,7 +25,7 @@
border-radius: 24rpx;
width:100%;
}
.map{
.map,.navigate{
height:80rpx;
display:flex;
align-items: center;
@ -61,6 +61,12 @@
transform: rotate(90deg);
color:rgb(48,49,51);
}
&.navigate{
&:before{
margin:0 0 0 14rpx;
transform: rotate(0deg);
}
}
}
.select-tab{
display:flex;
@ -283,6 +289,7 @@
</view>
<view v-else-if="type=='map'" class="map plant-dingweixiao" :class="{noData:value.length<=0}" @click="openMap">{{value.length>0?Object.values(value[0]).join():"选择经纬度"}}</view>
<view v-else-if="type=='select'" class="plant-youbian" :class="{noData: !value[0]}" @click="show=true">{{pickerContent}}</view>
<view v-else-if="type=='navigate'" class="navigate plant-youbian noData" @click="btnFun">{{value||placeholder||`请选择${label}`}}</view>
<view v-else-if="type=='select-tab'" class="select-tab">
<text :class="{active:value==v.value}" v-for="(v,k) in dictCodeList" :key="k" @click="$emit('select',[v])">{{v.label}}</text>
<text @click="show=true">自定义+</text>

Loading…
Cancel
Save