Skip to content

Commit d41db2e

Browse files
committed
update
1 parent fd4c4ab commit d41db2e

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-19
lines changed

elm/static/js/food.4e5779427eae45401876.min.js renamed to elm/static/js/food.b2f26d224a87cd793db4.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

elm/static/js/manifest.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

elm/static/js/msite.0cc647ba693d372c36da.min.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

elm/static/js/msite.6e025f794604829050b4.min.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/common/shoplist.vue

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,22 @@ export default {
106106
return
107107
}
108108
this.showLoading = true;
109-
}
110-
this.preventRepeatReuqest = true;
109+
this.preventRepeatReuqest = true;
111110
112-
//数据的定位加20位
113-
this.offset += 20;
114-
let res = await shopList(this.latitude, this.longitude, this.offset, this.restaurantCategoryId);
115-
this.preventRepeatReuqest = false;
116-
this.shopListArr = [...this.shopListArr, ...res];
117-
if (process.env.NODE_ENV == 'development') {
111+
//数据的定位加20位
112+
this.offset += 20;
113+
let res = await shopList(this.latitude, this.longitude, this.offset, this.restaurantCategoryId);
114+
this.preventRepeatReuqest = false;
115+
this.shopListArr = [...this.shopListArr, ...res];
118116
this.hideLoading();
119117
//当获取数据小于20,说明没有更多数据,不需要再次请求数据
120118
if (res.length < 20) {
121119
return
122120
}
121+
}else{
122+
this.showLoading = true;
123+
this.shopListArr = [...this.shopListArr, ...this.shopListArr.splice(0,20)];
124+
this.hideLoading();
123125
}
124126
},
125127
//返回顶部
@@ -128,9 +130,13 @@ export default {
128130
},
129131
//监听父级传来的数据发生变化时,触发此函数重新根据属性值获取数据
130132
async listenPropChange(){
131-
this.offset = 0;
132133
this.showLoading = true;
133-
this.shopListArr = await shopList(this.latitude, this.longitude, this.offset, '', this.restaurantCategoryIds, this.sortByType, this.deliveryMode, this.supportIds);
134+
if (process.env.NODE_ENV == 'development') {
135+
this.offset = 0;
136+
this.shopListArr = await shopList(this.latitude, this.longitude, this.offset, '', this.restaurantCategoryIds, this.sortByType, this.deliveryMode, this.supportIds);
137+
}else{
138+
this.shopListArr = this.shopListArr.reverse();
139+
}
134140
this.hideLoading();
135141
},
136142
hideLoading(){

0 commit comments

Comments
 (0)