Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart-agriculture
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张泽丹
smart-agriculture
Commits
4e4bf5a1
Commit
4e4bf5a1
authored
Apr 15, 2019
by
zhangzedan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pages:cropplant
parent
9e6c5b91
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
162 additions
and
16 deletions
+162
-16
datashow.js
pages/component/datashow/datashow.js
+35
-9
datashow.wxml
pages/component/datashow/datashow.wxml
+14
-0
datashow.wxss
pages/component/datashow/datashow.wxss
+31
-1
subdata.js
pages/component/subdata/subdata.js
+2
-2
dataDicts.js
pages/data/dataDicts.js
+22
-1
dataFields.js
pages/data/dataFields.js
+58
-3
No files found.
pages/component/datashow/datashow.js
View file @
4e4bf5a1
...
...
@@ -40,12 +40,12 @@ Component({
fieldData
:
{},
error
:
""
,
formMul
:{},
subdata
:{}
subdata
:{},
subdatas
:[]
},
lifetimes
:
{
created
()
{
// 在组件实例进入页面节点树时执行
console
.
log
(
this
.
data
.
items
);
},
detached
()
{
// 在组件实例被从页面节点树移除时执行
...
...
@@ -89,24 +89,19 @@ Component({
// 单选事件
radioChange
:
function
(
e
)
{
let
_this
=
this
console
.
log
(
e
);
let
field
=
e
.
target
.
dataset
.
field
let
subType
=
e
.
target
.
dataset
.
sub
let
value
=
e
.
detail
.
value
let
res
=
_this
.
data
.
fieldData
console
.
log
(
subType
);
if
(
subType
){
for
(
let
i
=
0
;
i
<
_this
.
data
.
items
.
length
;
i
++
){
console
.
log
(
_this
.
data
.
items
[
i
].
level
);
if
(
_this
.
data
.
items
[
i
].
level
==-
1
&&
_this
.
data
.
items
[
i
].
related
.
indexOf
(
field
)
>=
0
){
if
(
_this
.
data
.
items
[
i
].
level
==-
1
){
let
subdata
=
_this
.
data
.
subdata
subdata
.
field
=
field
subdata
.
info
=
_this
.
data
.
items
[
i
]
_this
.
setData
({
subdata
:
subdata
})
console
.
log
(
_this
.
data
.
subdata
);
console
.
log
(
this
.
data
.
subdata
);
}
}
}
else
{
...
...
@@ -125,7 +120,6 @@ Component({
this
.
setData
({
fieldData
:
res
})
console
.
log
(
this
.
data
.
fieldData
);
},
// 多选事件
checkboxChange
:
function
(
e
)
{
...
...
@@ -180,6 +174,38 @@ Component({
formMul
:
formMul
,
fieldData
:
res
})
},
add
:
function
(
e
){
let
_this
=
this
for
(
let
i
=
0
;
i
<
_this
.
data
.
items
.
length
;
i
++
){
if
(
_this
.
data
.
items
[
i
].
level
==-
1
){
let
subdatas
=
_this
.
data
.
subdatas
let
subdels
=
this
.
data
.
subdels
// subdata.field=field
let
subdata
=
{}
subdata
.
info
=
_this
.
data
.
items
[
i
]
subdata
.
show
=
true
subdatas
.
push
(
subdata
)
// subdels[subdatas.length-1]=true
// console.log(subdatas)
// console.log(subdels)
_this
.
setData
({
subdatas
:[...
subdatas
],
// subdels:[...subdels]
})
// console.log(this.data.subdatas)
break
;
}
}
},
subSub
:
function
(
e
){
let
_this
=
this
let
idx
=
e
.
target
.
dataset
.
idx
let
subdatas
=
_this
.
data
.
subdatas
subdatas
[
idx
].
show
=
false
_this
.
setData
({
subdatas
:[...
subdatas
]
})
}
}
})
\ No newline at end of file
pages/component/datashow/datashow.wxml
View file @
4e4bf5a1
...
...
@@ -32,6 +32,7 @@
</block>
</view>
</view>
<!-- 单选以及多选样式 -->
<view class="form_item">
<view class="form_item_bd" wx:if="{{info.show==='radio'&&!tools.radioType(info.selects)}}">
<view class="radio_text {{registe?'field':''}}">
...
...
@@ -84,5 +85,18 @@
</view>
</view>
</view>
<view wx:if="{{item.sub}}">
<block wx:for-items="{{subdatas}}" wx:for-item="subdata" wx:for-index="idx" wx:key="{{idx}}">
<view class="{{registe?'':'report-section'}}" wx:if="{{subdata.show}}">
<button data-idx="{{idx}}" class="sub_btn" bindtap="subSub">X</button>
<sub-data id="{{'sub'+idx}}" subdata="{{subdata.info}}"></sub-data>
</view>
</block>
<view class="btn_view">
<button class="add_btn" bindtap="add">+</button>
</view>
</view>
</view>
</view>
\ No newline at end of file
pages/component/datashow/datashow.wxss
View file @
4e4bf5a1
...
...
@@ -43,3 +43,33 @@ check-group{
position: static;
border-bottom: 1px solid rgb(240,240,230);
} */
.btn_view{
display: flex;
height: 30px;
margin: 5px;
}
.add_btn{
width: 30px;
height: 30px;
line-height: 30px;
border: 1px solid #3cc51f;
box-shadow: 5px 5px 10px rgb(200,255,180);
padding: 0;
background-color:rgb(255,255,255);
color: #3cc51f;
}
.sub_btn{
position: absolute;
z-index: 10;
background-color: rgba(255,116,116,1);
width: 20px;
height: 20px;
line-height: 20px;
padding: 0;
margin-top: -8px;
right: 5px;
color: white;
border-radius: 10px;
font-size: 13px;
}
\ No newline at end of file
pages/component/subdata/subdata.js
View file @
4e4bf5a1
...
...
@@ -8,11 +8,11 @@ Component({
type
:
"Object"
,
value
:
""
,
observer
:
function
(
new_val
,
old_val
,
path
){
console
.
log
(
"subdata.js"
);
//
console.log("subdata.js");
this
.
setData
({
subdata
:
new_val
})
console
.
log
(
this
.
data
.
subdata
);
//
console.log(this.data.subdata);
}
},
registe
:{
...
...
pages/data/dataDicts.js
View file @
4e4bf5a1
...
...
@@ -55,6 +55,26 @@ const investsource=[
{
value
:
"众筹"
,
id
:
4
},
{
value
:
"其他请注明"
,
id
:
-
1
}
]
// 作物名称
const
cropName
=
[
{
value
:
"小麦"
,
id
:
0
},
{
value
:
"玉米"
,
id
:
1
},
{
value
:
"水稻"
,
id
:
2
},
{
value
:
"杂粮"
,
id
:
3
},
{
value
:
"叶类蔬菜"
,
id
:
4
},
{
value
:
"根茎类蔬菜"
,
id
:
5
},
{
value
:
"果实类蔬菜"
,
id
:
6
},
{
value
:
"苹果"
,
id
:
7
},
{
value
:
"梨"
,
id
:
8
},
{
value
:
"桃"
,
id
:
9
},
{
value
:
"其他水果"
,
id
:
10
},
{
value
:
"核桃"
,
id
:
11
},
{
value
:
"板栗"
,
id
:
12
},
{
value
:
"其他坚果"
,
id
:
13
},
{
value
:
"大豆"
,
id
:
14
},
{
value
:
"其他油料作物"
,
id
:
15
},
{
value
:
"其他作物"
,
id
:
16
}
]
// const
module
.
exports
=
{
sex
:
sex
,
...
...
@@ -64,5 +84,6 @@ module.exports = {
organstruct
:
organstruct
,
businessmodel
:
businessmodel
,
whether
:
whether
,
investsource
:
investsource
investsource
:
investsource
,
cropName
:
cropName
}
\ No newline at end of file
pages/data/dataFields.js
View file @
4e4bf5a1
...
...
@@ -312,8 +312,6 @@ const plantFarm={
{
level
:
-
1
,
title
:
"认证详情"
,
related
:[
"organicCertification"
,
"pollutionFreeCertification"
,
"greenCertification"
,
"geographicalCertification"
,
"gapCertification"
],
info
:[{
field
:
"StartTime"
,
label
:
"认证开始年份"
,
...
...
@@ -325,7 +323,64 @@ const plantFarm={
}]
}]
},
"model2"
:{},
"model2"
:{
"cropplant"
:[{
level
:
0
,
title
:
"作物种植情况(上一自然年信息)"
,
sub
:
true
,
field
:
"cropplant"
,
info
:[
{
field
:
"cropname"
,
label
:
"作物"
,
show
:
"picker"
,
selects
:
datafileds
.
cropName
},{
field
:
"cropSingleArea"
,
label
:
"面积/亩"
,
show
:
"input"
},{
field
:
"cropSingleCountArea"
,
label
:
"单产(千克/亩)"
,
show
:
"input"
},{
field
:
"cropSalePrice"
,
label
:
"价格(元/千克)"
,
show
:
"input"
},{
field
:
"cropSaleRatio"
,
label
:
"产品销售比例(%)"
,
show
:
"input"
}]
},
{
level
:
-
1
,
title
:
"作物种植情况详细信息"
,
info
:[
{
field
:
"cropname"
,
label
:
"作物"
,
show
:
"picker"
,
selects
:
datafileds
.
cropName
},{
field
:
"cropSingleArea"
,
label
:
"面积/亩"
,
show
:
"input"
},{
field
:
"cropSingleCountArea"
,
label
:
"单产(千克/亩)"
,
show
:
"input"
},{
field
:
"cropSalePrice"
,
label
:
"价格(元/千克)"
,
show
:
"input"
},{
field
:
"cropSaleRatio"
,
label
:
"产品销售比例(%)"
,
show
:
"input"
}]
}]
},
"model3"
:{},
"model4"
:{}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment