|
@@ -93,7 +93,7 @@
|
|
|
import * as GoodsApi from '@/api/goods'
|
|
|
import { getEmptyPaginateObj, getMoreListData } from '@/core/app'
|
|
|
import Search from '@/components/search'
|
|
|
- import { goodsList } from '@/common/mock.js'
|
|
|
+ // import { goodsList } from '@/common/mock.js'
|
|
|
|
|
|
const pageSize = 15
|
|
|
const showViewKey = 'GoodsList-ShowView';
|
|
@@ -145,10 +145,6 @@
|
|
|
*/
|
|
|
upCallback(page) {
|
|
|
const app = this
|
|
|
- // const curPageLen = goodsList.data.length
|
|
|
- // const totalSize = goodsList.data.total
|
|
|
- // app.mescroll.endBySize(curPageLen, totalSize)
|
|
|
- // app.mescroll.endErr()
|
|
|
// 设置列表数据
|
|
|
app.getGoodsList(page.num)
|
|
|
.then(list => {
|
|
@@ -170,7 +166,6 @@
|
|
|
*/
|
|
|
getGoodsList(pageNo = 1) {
|
|
|
const app = this
|
|
|
- console.log(app.options)
|
|
|
const param = {
|
|
|
sortType: app.sortType,
|
|
|
sortPrice: Number(app.sortPrice),
|
|
@@ -179,18 +174,18 @@
|
|
|
page: pageNo
|
|
|
}
|
|
|
// 合并新数据
|
|
|
- const newList = goodsList.data.list
|
|
|
- app.list.data = getMoreListData(newList, app.list, pageNo)
|
|
|
- // return new Promise((resolve, reject) => {
|
|
|
- // GoodsApi.list(param)
|
|
|
- // .then(result => {
|
|
|
- // // 合并新数据
|
|
|
- // const newList = result.data.list
|
|
|
- // app.list.data = getMoreListData(newList, app.list, pageNo)
|
|
|
- // resolve(newList)
|
|
|
- // })
|
|
|
- // .catch(reject)
|
|
|
- // })
|
|
|
+ // const newList = goodsList.data.list
|
|
|
+ // app.list.data = getMoreListData(newList, app.list, pageNo)
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ GoodsApi.list(param)
|
|
|
+ .then(result => {
|
|
|
+ // 合并新数据
|
|
|
+ const newList = result.data.list
|
|
|
+ app.list.data = getMoreListData(newList, app.list, pageNo)
|
|
|
+ resolve(newList)
|
|
|
+ })
|
|
|
+ .catch(reject)
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 切换排序方式
|