Commit 3d7c5939ba23060da69e2312b8a0ba5e9e2d5677

Authored by 刘淇
1 parent 7fc91f7a

新增时候 数量限制

subPackages/treePage/treeFiles.vue
... ... @@ -57,7 +57,7 @@
57 57 <!-- <tui-no-data imgUrl="/static/images/nodata.png">暂无数据</tui-no-data>-->
58 58 </view>
59 59 <view v-else>
60   - <view v-for="i in roads" class="card-wrap cad-box-shadow" @click="toNewPage(i.roadId)">
  60 + <view v-for="i in roads" class="card-wrap cad-box-shadow" @click="toNewPage(i.roadId, i.treeCount)">
61 61  
62 62 <p class="fs-flex__between">
63 63 <span class="fs-ellipsis">{{ i.roadName }}</span>
... ... @@ -129,8 +129,9 @@ export default {
129 129 this.deptListQuery()
130 130 },
131 131 // 前往历史页面
132   - toNewPage(params) {
133   - uni.$tui.href(`/subPackages/treePage/treeRecord?roadId=${params}`)
  132 + toNewPage(roadId, treeCount) {
  133 + console.log(treeCount)
  134 + uni.$tui.href(`/subPackages/treePage/treeRecord?roadId=${roadId}&count=${treeCount}`)
134 135 },
135 136 // 搜索
136 137 searchChange() {
... ...
subPackages/treePage/treeRecord.vue
... ... @@ -11,10 +11,12 @@
11 11 <view style="text-align: right">{{ i.updatetime.substring(0, 10) }}</view>
12 12 </view>
13 13 <view class="fs-mt8 fs-align__center">
14   - <img src="../../static/images/tree/tree-high.png" style="width: 14px;height: 14px;margin-right: 6px;" alt=""> 高度:{{ i.treeheight }} 米
  14 + <img src="../../static/images/tree/tree-high.png" style="width: 14px;height: 14px;margin-right: 6px;"
  15 + alt=""> 高度:{{ i.treeheight }} 米
15 16 </view>
16 17 <view class="fs-mt8 fs-align__center">
17   - <img src="../../static/images/tree/treearound.png" style="width: 14px;height: 14px;margin-right: 6px;" alt="">胸径:{{ i.dbh }} 厘米
  18 + <img src="../../static/images/tree/treearound.png" style="width: 14px;height: 14px;margin-right: 6px;"
  19 + alt="">胸径:{{ i.dbh }} 厘米
18 20 </view>
19 21 </view>
20 22 </view>
... ... @@ -24,8 +26,7 @@
24 26 </view>
25 27 </view>
26 28  
27   -
28   - <tui-button class="addTree" @click="toAddTreePage">新增树木录入</tui-button>
  29 + <tui-button class="addTree" @click="toAddTreePage" v-show="count>0&&count>rows.length">新增树木录入</tui-button>
29 30 </view>
30 31  
31 32 </template>
... ... @@ -37,13 +38,16 @@ export default {
37 38 data() {
38 39 return {
39 40 rows: [],
40   - roadId: ''
  41 + roadId: '',
  42 + count: 0
41 43 }
42 44 },
43 45 onLoad(options) {
  46 + console.log(options)
44 47 this.roadId = options.roadId
  48 + this.count = options.count
45 49 },
46   - onShow(){
  50 + onShow() {
47 51 this.treeRoadQuery()
48 52 },
49 53 methods: {
... ... @@ -65,17 +69,19 @@ export default {
65 69 </script>
66 70  
67 71 <style scoped>
68   -.record-wrap{
  72 +.record-wrap {
69 73 padding-bottom: 60px;
70 74 }
  75 +
71 76 .record-list-wrap {
72   - margin: 15px 10px 0 ;
73   - padding:10px;
  77 + margin: 15px 10px 0;
  78 + padding: 10px;
74 79 border-radius: 6px;
75 80 font-size: 14px;
76 81 }
77   -.treetypeName{
78   - flex:1;
  82 +
  83 +.treetypeName {
  84 + flex: 1;
79 85 font-size: 16px;
80 86 font-weight: bold;
81 87 }
... ... @@ -98,7 +104,7 @@ export default {
98 104 justify-content: space-between;
99 105 }
100 106  
101   -.treenumber-no{
  107 +.treenumber-no {
102 108 padding: 3px 10px;
103 109 background: #bdefd0;
104 110 font-size: 12px;
... ...