Commit b7efbf80d32173e085996f116cffe50161b159b2

Authored by 王强
1 parent d9bf55ae

购好物+工会页面,云测Bug处理~

src/components/searchBar/searchBar.less
@@ -46,6 +46,10 @@ @@ -46,6 +46,10 @@
46 .search-input { 46 .search-input {
47 color: #000000; 47 color: #000000;
48 width: 100%; 48 width: 100%;
  49 + &::-webkit-search-results-decoration
  50 + &::-webkit-search-cancel-button {
  51 + display: none;
  52 + }
49 } 53 }
50 } 54 }
51 } 55 }
src/pages/labourUnion/labourUnion.vue
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 <div class="buttons-box"> 49 <div class="buttons-box">
50 <div class="btn btn-active" @click="toOrderList"> 50 <div class="btn btn-active" @click="toOrderList">
51 <div class="text">购买记录</div> 51 <div class="text">购买记录</div>
52 - <img src="static/img/icon_arrow_right_color.png" class="icon" mode="aspectFill" /> 52 + <img src="/static/img/icon_arrow_right_color.png" class="icon" mode="aspectFill" />
53 </div> 53 </div>
54 </div> 54 </div>
55 </div> 55 </div>
src/pages/labourUnionSearch/labourUnionSearch.vue
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 </template> 51 </template>
52 52
53 <!-- 没有搜索数据 --> 53 <!-- 没有搜索数据 -->
54 - <template v-else-if="tabs && tabs.keyword"> 54 + <template v-else-if="tabs && tabs.keyword && initialized">
55 55
56 <!-- 未找到您搜索的内容 --> 56 <!-- 未找到您搜索的内容 -->
57 <div class="no-data"> 57 <div class="no-data">
@@ -131,6 +131,7 @@ @@ -131,6 +131,7 @@
131 navsSearch: null, // 导航栏对象 131 navsSearch: null, // 导航栏对象
132 searchHistoryArr: [], // 搜索历史记录数组 132 searchHistoryArr: [], // 搜索历史记录数组
133 tabs: {}, // tabsBar数据对象 133 tabs: {}, // tabsBar数据对象
  134 + initialized: false, // 已初始化过标识,默认false
134 interface: 'goodsSearch', // 列表页接口名称 135 interface: 'goodsSearch', // 列表页接口名称
135 lists: [] // 列表数据 136 lists: [] // 列表数据
136 } 137 }
@@ -304,6 +305,9 @@ @@ -304,6 +305,9 @@
304 // 获取数据列表失败 305 // 获取数据列表失败
305 Toast('获取数据列表失败'); 306 Toast('获取数据列表失败');
306 } 307 }
  308 +
  309 + // 设置已初始化过
  310 + this.$set(this, 'initialized', true);
307 }, 311 },
308 312
309 /** 313 /**
@@ -340,51 +344,58 @@ @@ -340,51 +344,58 @@
340 * @param {String} keyword [搜索关键字] 344 * @param {String} keyword [搜索关键字]
341 */ 345 */
342 doSearch(keyword) { 346 doSearch(keyword) {
343 - console.log(keyword); 347 +
344 if (this.debug) { 348 if (this.debug) {
345 console.log('doSearch', keyword); 349 console.log('doSearch', keyword);
346 } 350 }
347 351
348 // 判断必要参数 352 // 判断必要参数
349 - if (keyword && typeof keyword === 'string' && keyword.trim()) { 353 + if (keyword && typeof keyword === 'string' && keyword.trim()) {
350 354
351 - // 清空列表  
352 - this.$set(this, 'lists', []); 355 + // 清空列表
  356 + this.$set(this, 'lists', []);
353 357
354 - // 初始化tabs对象  
355 - this.setTabs(keyword); 358 + // 初始化tabs对象
  359 + this.setTabs(keyword);
356 360
357 - /* 记录搜搜历史 开始 */ 361 + /* 记录搜搜历史 开始 */
358 362
359 - // 最多8个历史搜索结果  
360 - if (this.searchHistoryArr.length >= 8) { 363 + // 最多8个历史搜索结果
  364 + if (this.searchHistoryArr.length >= 8) {
361 365
362 - // 弹出一个数据  
363 - this.searchHistoryArr.pop();  
364 - } 366 + // 弹出一个数据
  367 + this.searchHistoryArr.pop();
  368 + }
365 369
366 - // 向前插入搜索历史  
367 - this.searchHistoryArr.unshift(keyword); 370 + // 向前插入搜索历史
  371 + this.searchHistoryArr.unshift(keyword);
368 372
369 - // 搜索历史放入Storage中  
370 - this.setSearchHistoryArr(keyword); 373 + // 搜索历史放入Storage中
  374 + this.setSearchHistoryArr(keyword);
371 375
372 - /* 记录搜搜历史 结束 */ 376 + /* 记录搜搜历史 结束 */
373 377
374 - // 下一周期执行  
375 - this.$nextTick(() => { 378 + // 下一周期执行
  379 + this.$nextTick(() => {
376 380
377 - // 请求搜索接口  
378 - this.getLists(this.tabs, this.CALL_STATUS.INIT);  
379 - });  
380 - } 381 + // 请求搜索接口
  382 + this.getLists(this.tabs, this.CALL_STATUS.INIT);
  383 + });
  384 + }
381 }, 385 },
382 - /** 386 +
  387 + /**
383 * 搜索异常 388 * 搜索异常
384 */ 389 */
385 - exceptions(){  
386 - Toast("请输入要搜索的商品");  
387 - }, 390 + exceptions() {
  391 +
  392 + // 提示
  393 + Toast("请输入要搜索的商品");
  394 +
  395 + // 设置未初始化过
  396 + this.$set(this, 'initialized', false);
  397 + },
  398 +
388 /** 399 /**
389 * 清除输入框事件监听 400 * 清除输入框事件监听
390 */ 401 */
@@ -399,6 +410,9 @@ @@ -399,6 +410,9 @@
399 410
400 // 初始化tabs对象 411 // 初始化tabs对象
401 this.setTabs(); 412 this.setTabs();
  413 +
  414 + // 设置未初始化过
  415 + this.$set(this, 'initialized', false);
402 }, 416 },
403 417
404 /** 418 /**