Explorar o código

防抖,BUG修复

seimin %!s(int64=3) %!d(string=hai) anos
pai
achega
9bdc39c167
Modificáronse 8 ficheiros con 15059 adicións e 383 borrados
  1. 14636 25
      package-lock.json
  2. 1 0
      package.json
  3. 19 10
      src/views/checkNumber.vue
  4. 24 24
      src/views/incidentList.vue
  5. 1 1
      src/views/indes.vue
  6. 376 321
      src/views/knowList.vue
  7. 1 1
      src/views/my.vue
  8. 1 1
      src/views/supplementary.vue

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 14636 - 25
package-lock.json


+ 1 - 0
package.json

@@ -14,6 +14,7 @@
14 14
     "cube-ui": "^1.12.10",
15 15
     "js-base64": "^3.6.1",
16 16
     "lib-flexible": "^0.3.2",
17
+    "lodash": "^4.17.21",
17 18
     "vue": "^2.5.2",
18 19
     "vue-axios": "^2.1.4",
19 20
     "vue-router": "^3.0.1"

+ 19 - 10
src/views/checkNumber.vue

@@ -15,7 +15,7 @@
15 15
                 type="text"
16 16
                 placeholder="搜索"
17 17
                 v-model="search"
18
-                @input="searchFn()"
18
+                @input="searchFnDebounce()"
19 19
               />
20 20
             </div>
21 21
             <ul class="foods-wrapper">
@@ -100,6 +100,7 @@
100 100
 </template>
101 101
 <script>
102 102
 import Vue from "vue";
103
+import debounce from "lodash/debounce";
103 104
 import CubePage from "../components/cube-page.vue";
104 105
 import SwitchOption from "../components/switch-option";
105 106
 import InputOption from "../components/input-option";
@@ -108,7 +109,6 @@ import LoadIng from "./../views/loading.vue";
108 109
 export default {
109 110
   data() {
110 111
     return {
111
-      //   items: _foods,
112 112
       items: [],
113 113
       pullDownRefresh: true,
114 114
       pullDownRefreshThreshold: 60,
@@ -123,7 +123,9 @@ export default {
123 123
       search: "",
124 124
       sum: 10,
125 125
       idx: 0,
126
-      loadShow: true
126
+      loadShow: true,
127
+      lastSearchKey: "",
128
+      searchFnDebounce: null
127 129
     };
128 130
   },
129 131
   components: {
@@ -171,6 +173,7 @@ export default {
171 173
       var that = this;
172 174
       that.loadShow = true;
173 175
       this.idx = 0;
176
+      this.lastSearchKey = that.search;
174 177
       this.$http
175 178
         .post("service/user/data/fetchDataList/department", {
176 179
           idx: 0,
@@ -181,14 +184,16 @@ export default {
181 184
           }
182 185
         })
183 186
         .then(function(res) {
184
-          if (res.data.list.length > 0) {
185
-            that.items = res.data.list;
186
-            that.wushuju = false;
187
-          } else {
188
-            that.wushuju = true;
189
-            that.items = [];
187
+          if (that.lastSearchKey == that.search) {
188
+            if (res.data.list.length > 0) {
189
+              that.items = res.data.list;
190
+              that.wushuju = false;
191
+            } else {
192
+              that.wushuju = true;
193
+              that.items = [];
194
+            }
195
+            that.loadShow = false;
190 196
           }
191
-          that.loadShow = false;
192 197
         });
193 198
     },
194 199
     toKnowDetails(data) {
@@ -300,8 +305,12 @@ export default {
300 305
     }
301 306
   },
302 307
   created() {
308
+    this.searchFnDebounce = debounce(this.searchFn, 500);
303 309
     this.getParams();
304 310
     this.getData(this.idx, this.sum);
311
+  },
312
+  beforeDestroy() {
313
+    this.searchFnDebounce.cancel();
305 314
   }
306 315
 };
307 316
 </script>

+ 24 - 24
src/views/incidentList.vue

@@ -170,7 +170,7 @@ export default {
170 170
       this.loadShow=true;
171 171
       that.items=[];
172 172
       this.$http.post('service/apply/bpm/fetchServiceTasks',{
173
-          'assignee':that.loginUser.id,
173
+          'assignee':that.loginUser.account,
174 174
           'state':that.stateValue,
175 175
           'idx':0,
176 176
           'sum':10
@@ -183,7 +183,7 @@ export default {
183 183
               that.wushuju=false
184 184
             }else{
185 185
               that.wushuju=true
186
-            }           
186
+            }
187 187
             that.loadShow=false
188 188
         })
189 189
     },
@@ -202,7 +202,7 @@ export default {
202 202
         var that=this;
203 203
         // that.items=[];
204 204
         this.$http.post('service/apply/bpm/fetchServiceTasks',{
205
-          'assignee':that.loginUser.id,
205
+          'assignee':that.loginUser.account,
206 206
           'state':that.stateValue,
207 207
           'idx':0,
208 208
           'sum':10
@@ -223,7 +223,7 @@ export default {
223 223
     getData(idx,sum){
224 224
         var that=this;
225 225
         this.$http.post('service/apply/bpm/fetchServiceTasks',{
226
-            'assignee':that.loginUser.id,
226
+            'assignee':that.loginUser.account,
227 227
             'state':that.stateValue,
228 228
             'idx':idx,
229 229
             'sum':sum
@@ -244,14 +244,14 @@ export default {
244 244
       var that=this;
245 245
       that.idx=that.idx+1;
246 246
         this.$http.post('service/apply/bpm/fetchServiceTasks',{
247
-          'assignee':that.loginUser.id,
247
+          'assignee':that.loginUser.account,
248 248
           'state':that.stateValue,
249 249
           'idx':that.idx,
250
-          'sum':that.sum,         
250
+          'sum':that.sum,
251 251
           }).then(function(res){
252 252
             for(var i=0;i<res.data.data.length;i++){
253 253
               res.data.data[i].createTime=formatDate(new Date(res.data.data[i].createTime), 'yyyy-MM-dd hh:mm');
254
-            }       
254
+            }
255 255
             setTimeout(() => {
256 256
                 if(res.data.data.length>0){
257 257
                     that.items=that.items.concat(res.data.data);
@@ -299,7 +299,7 @@ export default {
299 299
 }
300 300
 </script>
301 301
 <style lang="stylus" rel="stylesheet/stylus" scoped>
302
-.scroll-list-wrap 
302
+.scroll-list-wrap
303 303
   /* height: 350px */
304 304
   height:95vh
305 305
   /* border: 1px solid rgba(0, 0, 0, 0.1) */
@@ -307,50 +307,50 @@ export default {
307 307
   transform: rotate(0deg) // fix 子元素超出边框圆角部分不隐藏的问题
308 308
   overflow: hidden
309 309
 
310
-.foods-wrapper 
311
-  .food-item 
310
+.foods-wrapper
311
+  .food-item
312 312
     display: flex
313 313
     /* padding: 18px */
314 314
     /* border-bottom: 1px solid rgba(7, 17, 27, 0.1) */
315 315
     /* border-top: 1px solid rgba(7, 17, 27, 0.1)!important */
316 316
 
317
-    &:last-child 
317
+    &:last-child
318 318
       border-none()
319 319
       margin-bottom: 0
320
-    .icon 
320
+    .icon
321 321
       flex: 0 0 57px
322 322
       margin-right: 10px
323 323
 
324
-    .food-content 
324
+    .food-content
325 325
       flex: 1
326
-      .name 
326
+      .name
327 327
         margin: 2px 0 8px 0
328 328
         height: 14px
329 329
         line-height: 14px
330 330
         font-size: 14px
331 331
         color: rgb(7, 17, 27)
332
-      .description, .extra 
332
+      .description, .extra
333 333
         line-height: 10px
334 334
         font-size: 10px
335 335
         color: rgb(147, 153, 159)
336
-      .description 
336
+      .description
337 337
         line-height: 12px
338 338
         margin-bottom: 8px
339
-      .extra 
340
-        .count 
339
+      .extra
340
+        .count
341 341
           margin-right: 12px
342
-      .price 
342
+      .price
343 343
         font-weight: 700
344 344
         line-height: 24px
345
-        .now 
345
+        .now
346 346
           margin-right: 8px
347 347
           font-size: 14px
348 348
           color: rgb(240, 20, 20)
349
-        .old 
349
+        .old
350 350
           text-decoration: line-through
351 351
           font-size: 10px
352 352
           color: rgb(147, 153, 159)
353
-      .cartcontrol-wrapper 
353
+      .cartcontrol-wrapper
354 354
         position: absolute
355 355
         right: 0
356 356
         bottom: 12px
@@ -367,7 +367,7 @@ export default {
367 367
         &.rotate{
368 368
             transform: rotate(180deg)
369 369
           }
370
-      } 
370
+      }
371 371
     }
372 372
     .after-trigger{
373 373
       .refresh-text{
@@ -484,4 +484,4 @@ export default {
484 484
     width: 5.12rem;
485 485
     height: 2.84rem;
486 486
 }
487
-</style>
487
+</style>

+ 1 - 1
src/views/indes.vue

@@ -229,7 +229,7 @@ export default {
229 229
       var that = this;
230 230
       this.$http
231 231
         .post("service/apply/bpm/fetchServiceTasks", {
232
-          assignee: that.loginUser.id,
232
+          assignee: that.loginUser.account,
233 233
           idx: 0,
234 234
           sum: 1
235 235
         })

+ 376 - 321
src/views/knowList.vue

@@ -1,394 +1,449 @@
1 1
 <template>
2
-    <div class="bgColor">
3
-        <div slot="content" class="scroll-wrapper">
4
-            <div class="demo">
5
-                <div class="scroll-list-wrap">
6
-                    <cube-scroll ref="scroll" :data="items" :options="options" @pulling-down="onPullingDown" @pulling-up="onPullingUp">
7
-                        <div class="search">
8
-                            <input type="text" placeholder="搜索" v-model="search" @input="searchFn()">
9
-                        </div>
10
-                        <ul class="foods-wrapper">
11
-                            <li v-for="data in items" class="food-item border-1px" @click="toKnowDetails(data)">
12
-                                <div class="food-content">
13
-                                    <div class="title">
14
-                                        <div>
15
-                                            <i class="iconfont icon-changjianwenti1"></i>
16
-                                        </div>
17
-                                        <div>主题:{{data.title}}</div>
18
-                                    </div>
19
-                                    <div class="content" v-html="data.content">
20
-                                    </div>
21
-                                    <div class="timeBox">
22
-                                        <div class="time">{{data.createtime.substring(0,data.createtime.length-3)}}</div>
23
-                                        <div class="good">
24
-                                            <i class="iconfont icon-dianzan"></i>&nbsp;&nbsp;<span>{{data.star}}</span>
25
-                                        </div>
26
-                                    </div>
27
-                                </div>
28
-                            </li>
29
-                            <div class="wushuju" v-show="wushuju">
30
-                                <img src="./../../static/images/wushuju.svg" alt="">
31
-                                <div class="noDataFont">暂无数据</div>
32
-                            </div>
33
-                        </ul>
34
-                        <template v-if="customPullDown" slot="pulldown" slot-scope="props">
35
-                            <div v-if="props.pullDownRefresh" class="cube-pulldown-wrapper" :style="props.pullDownStyle">
36
-                                <div v-show="props.beforePullDown" class="before-trigger" :style="{paddingTop: props.bubbleY + 'px'}">
37
-                                    <span :class="{rotate: props.bubbleY > pullDownRefreshThreshold - 40}">↓</span>
38
-                                </div>
39
-                                <div class="after-trigger" v-show="!props.beforePullDown">
40
-                                    <div v-show="props.isPullingDown" class="loading">
41
-                                        <cube-loading></cube-loading>
42
-                                    </div>
43
-                                    <div v-show="!props.isPullingDown" class="text">
44
-                                        <span class="refresh-text">更新成功</span>
45
-                                    </div>
46
-                                </div>
47
-                            </div>
48
-                        </template>
49
-                    </cube-scroll>
50
-                </div>
2
+  <div class="bgColor">
3
+    <div slot="content" class="scroll-wrapper">
4
+      <div class="demo">
5
+        <div class="scroll-list-wrap">
6
+          <cube-scroll
7
+            ref="scroll"
8
+            :data="items"
9
+            :options="options"
10
+            @pulling-down="onPullingDown"
11
+            @pulling-up="onPullingUp"
12
+          >
13
+            <div class="search">
14
+              <input
15
+                type="text"
16
+                placeholder="搜索"
17
+                v-model="search"
18
+                @input="searchFnDebounce()"
19
+              />
51 20
             </div>
21
+            <ul class="foods-wrapper">
22
+              <li
23
+                v-for="data in items"
24
+                class="food-item border-1px"
25
+                @click="toKnowDetails(data)"
26
+              >
27
+                <div class="food-content">
28
+                  <div class="title">
29
+                    <div>
30
+                      <i class="iconfont icon-changjianwenti1"></i>
31
+                    </div>
32
+                    <div>主题:{{ data.title }}</div>
33
+                  </div>
34
+                  <div class="content" v-html="data.content"></div>
35
+                  <div class="timeBox">
36
+                    <div class="time">
37
+                      {{
38
+                        data.createtime.substring(0, data.createtime.length - 3)
39
+                      }}
40
+                    </div>
41
+                    <div class="good">
42
+                      <i class="iconfont icon-dianzan"></i>&nbsp;&nbsp;<span>{{
43
+                        data.star
44
+                      }}</span>
45
+                    </div>
46
+                  </div>
47
+                </div>
48
+              </li>
49
+              <div class="wushuju" v-show="wushuju">
50
+                <img src="./../../static/images/wushuju.svg" alt="" />
51
+                <div class="noDataFont">暂无数据</div>
52
+              </div>
53
+            </ul>
54
+            <template v-if="customPullDown" slot="pulldown" slot-scope="props">
55
+              <div
56
+                v-if="props.pullDownRefresh"
57
+                class="cube-pulldown-wrapper"
58
+                :style="props.pullDownStyle"
59
+              >
60
+                <div
61
+                  v-show="props.beforePullDown"
62
+                  class="before-trigger"
63
+                  :style="{ paddingTop: props.bubbleY + 'px' }"
64
+                >
65
+                  <span
66
+                    :class="{
67
+                      rotate: props.bubbleY > pullDownRefreshThreshold - 40
68
+                    }"
69
+                    >↓</span
70
+                  >
71
+                </div>
72
+                <div class="after-trigger" v-show="!props.beforePullDown">
73
+                  <div v-show="props.isPullingDown" class="loading">
74
+                    <cube-loading></cube-loading>
75
+                  </div>
76
+                  <div v-show="!props.isPullingDown" class="text">
77
+                    <span class="refresh-text">更新成功</span>
78
+                  </div>
79
+                </div>
80
+              </div>
81
+            </template>
82
+          </cube-scroll>
52 83
         </div>
53
-        <load-ing v-show="loadShow"></load-ing>
84
+      </div>
54 85
     </div>
86
+    <load-ing v-show="loadShow"></load-ing>
87
+  </div>
55 88
 </template>
56 89
 <script>
57
-import Vue from 'vue'
58
-import CubePage from '../components/cube-page.vue'
59
-import SwitchOption from '../components/switch-option'
60
-import InputOption from '../components/input-option'
61
-import SelectOption from '../components/select-option'
62
-import LoadIng from './../views/loading.vue'
90
+import Vue from "vue";
91
+import debounce from "lodash/debounce";
92
+import CubePage from "../components/cube-page.vue";
93
+import SwitchOption from "../components/switch-option";
94
+import InputOption from "../components/input-option";
95
+import SelectOption from "../components/select-option";
96
+import LoadIng from "./../views/loading.vue";
63 97
 export default {
64
-    data() {
98
+  data() {
65 99
     return {
66
-    //   items: _foods,
67
-        items:[],
68
-        pullDownRefresh: true,
69
-        pullDownRefreshThreshold: 60,
70
-        pullDownRefreshStop: 40,
71
-        pullDownRefreshTxt: 'Refresh success',
72
-        pullUpLoad: true,
73
-        pullUpLoadThreshold: 0,
74
-        pullUpLoadMoreTxt: 'Load more',
75
-        pullUpLoadNoMoreTxt: '没有更多数据',
76
-        wushuju:false,
77
-        customPullDown: true,
78
-        search:"",
79
-        sum:10,
80
-        idx:0,
81
-        loadShow:true
82
-    }
83
-    },
84
-    components: {
85
-        CubePage,
86
-        SwitchOption,
87
-        InputOption,
88
-        SelectOption,
89
-        LoadIng
90
-    },
91
-    computed: {
100
+      //   items: _foods,
101
+      items: [],
102
+      pullDownRefresh: true,
103
+      pullDownRefreshThreshold: 60,
104
+      pullDownRefreshStop: 40,
105
+      pullDownRefreshTxt: "Refresh success",
106
+      pullUpLoad: true,
107
+      pullUpLoadThreshold: 0,
108
+      pullUpLoadMoreTxt: "Load more",
109
+      pullUpLoadNoMoreTxt: "没有更多数据",
110
+      wushuju: false,
111
+      customPullDown: true,
112
+      search: "",
113
+      sum: 10,
114
+      idx: 0,
115
+      loadShow: true,
116
+      lastSearchKey: "",
117
+      searchFnDebounce: null
118
+    };
119
+  },
120
+  components: {
121
+    CubePage,
122
+    SwitchOption,
123
+    InputOption,
124
+    SelectOption,
125
+    LoadIng
126
+  },
127
+  computed: {
92 128
     options() {
93
-        return {
129
+      return {
94 130
         pullDownRefresh: this.pullDownRefreshObj,
95 131
         pullUpLoad: this.pullUpLoadObj,
96 132
         scrollbar: true
97
-        }
133
+      };
98 134
     },
99 135
     pullDownRefreshObj: function() {
100
-        return this.pullDownRefresh ? {
101
-        threshold: parseInt(this.pullDownRefreshThreshold),
102
-        txt: this.pullDownRefreshTxt
103
-        } : false
136
+      return this.pullDownRefresh
137
+        ? {
138
+            threshold: parseInt(this.pullDownRefreshThreshold),
139
+            txt: this.pullDownRefreshTxt
140
+          }
141
+        : false;
104 142
     },
105 143
     pullUpLoadObj: function() {
106
-        return this.pullUpLoad ? {
107
-        threshold: parseInt(this.pullUpLoadThreshold),
108
-        txt: {
109
-            more: this.pullUpLoadMoreTxt,
110
-            noMore: this.pullUpLoadNoMoreTxt
111
-        }
112
-        } : false
144
+      return this.pullUpLoad
145
+        ? {
146
+            threshold: parseInt(this.pullUpLoadThreshold),
147
+            txt: {
148
+              more: this.pullUpLoadMoreTxt,
149
+              noMore: this.pullUpLoadNoMoreTxt
150
+            }
151
+          }
152
+        : false;
113 153
     }
154
+  },
155
+  methods: {
156
+    getParams() {
157
+      if (this.$route.params.keword) {
158
+        this.search = this.$route.params.keword;
159
+      }
114 160
     },
115
-    methods: {
116
-    getParams(){
117
-        if(this.$route.params.keword){
118
-            this.search=this.$route.params.keword
119
-        }
161
+    searchFn() {
162
+      var that = this;
163
+      that.loadShow = true;
164
+      this.idx = 0;
165
+      this.lastSearchKey = that.search;
166
+      this.$http
167
+        .post("service/solution/fetchDataList/solution", {
168
+          idx: 0,
169
+          sum: 10,
170
+          solution: {
171
+            title: that.search,
172
+            status: { id: 72 },
173
+            solutionRange: 1
174
+          }
175
+        })
176
+        .then(function(res) {
177
+          if (that.lastSearchKey == that.search) {
178
+            if (res.data.list.length > 0) {
179
+              that.items = res.data.list;
180
+              that.wushuju = false;
181
+            } else {
182
+              that.wushuju = true;
183
+              that.items = [];
184
+            }
185
+            that.loadShow = false;
186
+          }
187
+        });
120 188
     },
121
-    searchFn(){
122
-      var that=this;
123
-      that.loadShow=true;
124
-      this.idx=0;
125
-      this.$http.post('service/solution/fetchDataList/solution',{
126
-        'idx':0,
127
-        'sum':10,
128
-        'solution':{
129
-            'title':that.search,
130
-            'status':{'id':72},
131
-            'solutionRange':1
132
-        }
133
-    }).then(function(res){
134
-        if(res.data.list.length>0){
135
-            that.items=res.data.list;
136
-            that.wushuju=false
137
-        }else{
138
-            that.wushuju=true;
139
-            that.items=[]
189
+    toKnowDetails(data) {
190
+      // this.$router.push({path:'/knowDetails'})
191
+      this.$router.push({
192
+        name: "KnowDetails",
193
+        params: {
194
+          data: JSON.stringify(data)
140 195
         }
141
-        that.loadShow=false
142
-    })
143
-    },
144
-    toKnowDetails(data){
145
-        // this.$router.push({path:'/knowDetails'})
146
-        this.$router.push({
147
-            name:'KnowDetails',
148
-            params:{
149
-                data:JSON.stringify(data)
150
-            }
151
-        })
196
+      });
152 197
     },
153 198
     onPullingDown() {
154
-        // 模拟更新数据
155
-        this.idx=0;
156
-        setTimeout(() => {
157
-        var that=this;
158
-        this.$http.post('service/solution/fetchDataList/solution',{
159
-            'idx':0,
160
-            'sum':10,
161
-            'solution':{
162
-                'title':that.search,
163
-                'status':{'id':72},
164
-                'solutionRange':1
199
+      // 模拟更新数据
200
+      this.idx = 0;
201
+      setTimeout(() => {
202
+        var that = this;
203
+        this.$http
204
+          .post("service/solution/fetchDataList/solution", {
205
+            idx: 0,
206
+            sum: 10,
207
+            solution: {
208
+              title: that.search,
209
+              status: { id: 72 },
210
+              solutionRange: 1
165 211
             }
166
-        }).then(function(res){
167
-            if(res.data.list.length>0){
168
-                that.items=res.data.list;
169
-                that.wushuju=false
170
-            }else{
171
-                that.$refs.scroll.forceUpdate();
172
-                that.wushuju=true
212
+          })
213
+          .then(function(res) {
214
+            if (res.data.list.length > 0) {
215
+              that.items = res.data.list;
216
+              that.wushuju = false;
217
+            } else {
218
+              that.$refs.scroll.forceUpdate();
219
+              that.wushuju = true;
173 220
             }
174
-        })
175
-        }, 1000)
221
+          });
222
+      }, 1000);
176 223
     },
177
-    getData(idx,sum){
178
-        var that=this;
179
-        this.$http.post('service/solution/fetchDataList/solution',{
180
-            'idx':idx,
181
-            'sum':sum,
182
-            'solution':{
183
-                'title':that.search,
184
-                'status':{'id':72},
185
-                'solutionRange':1
186
-            }
187
-        }).then(function(res){
188
-            if(res.data.list.length>0){
189
-                that.items=res.data.list;
190
-                that.wushuju=false
191
-            }else{
192
-                that.wushuju=true
193
-            }
194
-            that.loadShow=false
224
+    getData(idx, sum) {
225
+      var that = this;
226
+      this.$http
227
+        .post("service/solution/fetchDataList/solution", {
228
+          idx: idx,
229
+          sum: sum,
230
+          solution: {
231
+            title: that.search,
232
+            status: { id: 72 },
233
+            solutionRange: 1
234
+          }
195 235
         })
236
+        .then(function(res) {
237
+          if (res.data.list.length > 0) {
238
+            that.items = res.data.list;
239
+            that.wushuju = false;
240
+          } else {
241
+            that.wushuju = true;
242
+          }
243
+          that.loadShow = false;
244
+        });
196 245
     },
197 246
     onPullingUp() {
198
-        var that=this;
199
-        that.idx=that.idx+1;
200
-        this.$http.post('service/solution/fetchDataList/solution',{
201
-            'idx':that.idx,
202
-            'sum':that.sum,
203
-            'solution':{
204
-                'title':that.search,
205
-                'status':{'id':72},
206
-                'solutionRange':1
207
-            }
208
-        }).then(function(res){
209
-            setTimeout(() => {
210
-                if(res.data.list.length>0){
211
-                    that.items=that.items.concat(res.data.list);
212
-                }else{
213
-                    that.$refs.scroll.forceUpdate()
214
-                }
215
-            }, 1000)
247
+      var that = this;
248
+      that.idx = that.idx + 1;
249
+      this.$http
250
+        .post("service/solution/fetchDataList/solution", {
251
+          idx: that.idx,
252
+          sum: that.sum,
253
+          solution: {
254
+            title: that.search,
255
+            status: { id: 72 },
256
+            solutionRange: 1
257
+          }
216 258
         })
259
+        .then(function(res) {
260
+          setTimeout(() => {
261
+            if (res.data.list.length > 0) {
262
+              that.items = that.items.concat(res.data.list);
263
+            } else {
264
+              that.$refs.scroll.forceUpdate();
265
+            }
266
+          }, 1000);
267
+        });
217 268
     },
218 269
     updatePullDownRefresh(val) {
219
-        this.pullDownRefresh = val
270
+      this.pullDownRefresh = val;
220 271
     },
221 272
     updatePullDownRefreshThreshold(val) {
222
-        this.pullDownRefreshThreshold = val
273
+      this.pullDownRefreshThreshold = val;
223 274
     },
224 275
     updatePullDownRefreshTxt(val) {
225
-        this.pullDownRefreshTxt = val
276
+      this.pullDownRefreshTxt = val;
226 277
     },
227 278
     updatePullUpLoad(val) {
228
-        this.pullUpLoad = val
279
+      this.pullUpLoad = val;
229 280
     },
230 281
     updatePullUpLoadThreshold(val) {
231
-        this.pullUpLoadThreshold = val
282
+      this.pullUpLoadThreshold = val;
232 283
     },
233 284
     updatePullUpLoadMoreTxt(val) {
234
-        this.pullUpLoadMoreTxt = val
285
+      this.pullUpLoadMoreTxt = val;
235 286
     },
236 287
     updatePullUpLoadNoMoreTxt(val) {
237
-        this.pullUpLoadNoMoreTxt = val
288
+      this.pullUpLoadNoMoreTxt = val;
238 289
     },
239 290
     updateCustomPullDown(val) {
240
-        this.customPullDown = val
291
+      this.customPullDown = val;
241 292
     },
242 293
     rebuildScroll() {
243
-        Vue.nextTick(() => {
244
-        this.$refs.scroll.destroy()
245
-        this.$refs.scroll.initScroll()
246
-        })
294
+      Vue.nextTick(() => {
295
+        this.$refs.scroll.destroy();
296
+        this.$refs.scroll.initScroll();
297
+      });
247 298
     }
248
-    },
249
-    created(){
250
-        this.getParams();
251
-        this.getData(this.idx,this.sum)
252
-    }
253
-}
299
+  },
300
+  created() {
301
+    this.searchFnDebounce = debounce(this.searchFn, 500);
302
+    this.getParams();
303
+    this.getData(this.idx, this.sum);
304
+  },
305
+  beforeDestroy() {
306
+    this.searchFnDebounce.cancel();
307
+  }
308
+};
254 309
 </script>
255
-    <style lang="stylus" rel="stylesheet/stylus" scoped>
256
-    .scroll-list-wrap
257
-      /* height: 350px */
258
-      height:100vh
259
-      /* border: 1px solid rgba(0, 0, 0, 0.1) */
260
-      border-radius: 5px
261
-      transform: rotate(0deg) // fix 子元素超出边框圆角部分不隐藏的问题
262
-      overflow: hidden
310
+<style lang="stylus" rel="stylesheet/stylus" scoped>
311
+.scroll-list-wrap
312
+  /* height: 350px */
313
+  height:100vh
314
+  /* border: 1px solid rgba(0, 0, 0, 0.1) */
315
+  border-radius: 5px
316
+  transform: rotate(0deg) // fix 子元素超出边框圆角部分不隐藏的问题
317
+  overflow: hidden
263 318
 
264
-    .foods-wrapper
265
-      .food-item
266
-        display: flex
267
-        /* min-width: 0 */
268
-        /* padding: 18px
269
-        border-bottom: 1px solid rgba(7, 17, 27, 0.1) */
319
+.foods-wrapper
320
+  .food-item
321
+    display: flex
322
+    /* min-width: 0 */
323
+    /* padding: 18px
324
+    border-bottom: 1px solid rgba(7, 17, 27, 0.1) */
270 325
 
271
-        &:last-child
272
-          border-none()
273
-          margin-bottom: 0
326
+    &:last-child
327
+      border-none()
328
+      margin-bottom: 0
274 329
 
275
-        .food-content
276
-          flex: 1
277
-          min-width: 0;
278
-          .cartcontrol-wrapper
279
-            position: absolute
280
-            right: 0
281
-            bottom: 12px
282
-            .scroll-wrapper{
283
-      .cube-pulldown-wrapper{
284
-        .before-trigger{
285
-          font-size: 30px;
286
-          line-height: 30px;
287
-          align-self: flex-end;
288
-          span{
289
-            display: inline-block;
290
-            transition: all 0.3s;
291
-            color: #666;
292
-            &.rotate{
293
-                transform: rotate(180deg)
294
-              }
295
-          }
296
-        }
297
-        .after-trigger{
298
-          .refresh-text{
299
-            color: grey
330
+    .food-content
331
+      flex: 1
332
+      min-width: 0;
333
+      .cartcontrol-wrapper
334
+        position: absolute
335
+        right: 0
336
+        bottom: 12px
337
+        .scroll-wrapper{
338
+  .cube-pulldown-wrapper{
339
+    .before-trigger{
340
+      font-size: 30px;
341
+      line-height: 30px;
342
+      align-self: flex-end;
343
+      span{
344
+        display: inline-block;
345
+        transition: all 0.3s;
346
+        color: #666;
347
+        &.rotate{
348
+            transform: rotate(180deg)
300 349
           }
301
-        }
302
-     }
350
+      }
351
+    }
352
+    .after-trigger{
353
+      .refresh-text{
354
+        color: grey
355
+      }
303 356
     }
304
-    </style>
357
+ }
358
+}
359
+</style>
305 360
 <style scoped>
306
-.bgColor{
307
-    background-color: white
361
+.bgColor {
362
+  background-color: white;
308 363
 }
309
-.search{
310
-    padding: .16rem .24rem;
311
-    height: .6rem;
312
-    background-color: #eeeeee;
313
-    border-bottom: .01rem #999999 solid
364
+.search {
365
+  padding: 0.16rem 0.24rem;
366
+  height: 0.6rem;
367
+  background-color: #eeeeee;
368
+  border-bottom: 0.01rem #999999 solid;
314 369
 }
315
-.search input{
316
-    width: 100%;
317
-    height: .56rem;
318
-    border-radius: 4px;
319
-    text-align: center;
320
-    font-size: .28rem
370
+.search input {
371
+  width: 100%;
372
+  height: 0.56rem;
373
+  border-radius: 4px;
374
+  text-align: center;
375
+  font-size: 0.28rem;
321 376
 }
322
-.search:focus{
323
-    outline:none
377
+.search:focus {
378
+  outline: none;
324 379
 }
325
-.food-item{
326
-  border-top: .16rem rgb(238,238,238) solid;
380
+.food-item {
381
+  border-top: 0.16rem rgb(238, 238, 238) solid;
327 382
 }
328
-.food-content{
329
-  border-top: .01rem rgb(223, 222, 222) solid;
330
-  border-bottom: .01rem rgb(223, 222, 222) solid;
383
+.food-content {
384
+  border-top: 0.01rem rgb(223, 222, 222) solid;
385
+  border-bottom: 0.01rem rgb(223, 222, 222) solid;
331 386
 }
332
-.title{
333
-    display: flex;
334
-    min-width: 0;
335
-    padding: .2rem .24rem;
336
-    line-height: .45rem;
337
-    border-bottom: .01rem rgb(223, 222, 222) solid;
387
+.title {
388
+  display: flex;
389
+  min-width: 0;
390
+  padding: 0.2rem 0.24rem;
391
+  line-height: 0.45rem;
392
+  border-bottom: 0.01rem rgb(223, 222, 222) solid;
338 393
 }
339
-.title div:nth-child(1){
340
-    width: 6%;
394
+.title div:nth-child(1) {
395
+  width: 6%;
341 396
 }
342
-.title div:nth-child(1) i{
343
-    font-size: .32rem;
344
-    color: #005395;
345
-    line-height: .49rem
397
+.title div:nth-child(1) i {
398
+  font-size: 0.32rem;
399
+  color: #005395;
400
+  line-height: 0.49rem;
346 401
 }
347
-.title div:nth-child(2){
348
-    width: 94%;
349
-    font-size: .32rem;
350
-    overflow: hidden;
351
-    white-space: nowrap;
352
-    text-overflow: ellipsis;
402
+.title div:nth-child(2) {
403
+  width: 94%;
404
+  font-size: 0.32rem;
405
+  overflow: hidden;
406
+  white-space: nowrap;
407
+  text-overflow: ellipsis;
353 408
 }
354
-.content{
355
-    font-size: .28rem;
356
-    /* margin-top: .3rem; */
357
-    line-height: .39rem;
358
-    overflow: hidden;
359
-    display: -webkit-box;
360
-    -webkit-line-clamp: 2;
361
-    -webkit-box-orient: vertical;
362
-    word-break: break-all;
363
-    padding: 0 .64rem;
364
-    margin: .24rem 0;
365
-    max-height:0.78rem;
409
+.content {
410
+  font-size: 0.28rem;
411
+  /* margin-top: .3rem; */
412
+  line-height: 0.39rem;
413
+  overflow: hidden;
414
+  display: -webkit-box;
415
+  -webkit-line-clamp: 2;
416
+  -webkit-box-orient: vertical;
417
+  word-break: break-all;
418
+  padding: 0 0.64rem;
419
+  margin: 0.24rem 0;
420
+  max-height: 0.78rem;
366 421
 }
367
-.timeBox{
368
-    display: flex;
369
-    justify-content:space-between;
370
-    /* margin-top: .3rem; */
371
-    border-top: .01rem rgb(223, 222, 222) solid;
372
-    padding: .2rem .64rem
422
+.timeBox {
423
+  display: flex;
424
+  justify-content: space-between;
425
+  /* margin-top: .3rem; */
426
+  border-top: 0.01rem rgb(223, 222, 222) solid;
427
+  padding: 0.2rem 0.64rem;
373 428
 }
374
-.timeBox .time{
375
-    color:#999999;
376
-    font-size: .24rem
429
+.timeBox .time {
430
+  color: #999999;
431
+  font-size: 0.24rem;
377 432
 }
378
-.timeBox .good i{
379
-    font-size: .3rem;
380
-    color: #A37200
433
+.timeBox .good i {
434
+  font-size: 0.3rem;
435
+  color: #a37200;
381 436
 }
382
-.timeBox .good span{
383
-    color: #A37200;
384
-    font-size: .24rem
437
+.timeBox .good span {
438
+  color: #a37200;
439
+  font-size: 0.24rem;
385 440
 }
386
-.wushuju{
387
-    margin-top: 2.4rem;
388
-    text-align: center;
441
+.wushuju {
442
+  margin-top: 2.4rem;
443
+  text-align: center;
389 444
 }
390
-.wushuju img{
391
-    width: 5.12rem;
392
-    height: 2.84rem;
445
+.wushuju img {
446
+  width: 5.12rem;
447
+  height: 2.84rem;
393 448
 }
394 449
 </style>

+ 1 - 1
src/views/my.vue

@@ -190,7 +190,7 @@ export default {
190 190
       var that = this;
191 191
       this.$http
192 192
         .post("service/apply/bpm/fetchServiceTasks", {
193
-          assignee: that.loginUser.id,
193
+          assignee: that.loginUser.account,
194 194
           idx: 0,
195 195
           sum: 9999
196 196
         })

+ 1 - 1
src/views/supplementary.vue

@@ -143,7 +143,7 @@ export default {
143 143
       var that = this;
144 144
       this.$http
145 145
         .post("service/apply/bpm/fetchServiceTasks", {
146
-          assignee: that.loginUser.id,
146
+          assignee: that.loginUser.account,
147 147
           idx: 0,
148 148
           sum: 9999
149 149
         })