|
@@ -13,13 +13,13 @@ Page({
|
|
|
showText: null, //左上显示文本
|
|
|
items: [], //分类列表
|
|
|
list: [], //列表
|
|
|
+ sort: [],
|
|
|
content: {
|
|
|
pageNumber: 1,
|
|
|
pageSize: 20,
|
|
|
pageTotal: 1,
|
|
|
where: {
|
|
|
- condition: "",
|
|
|
- sorttype: 2
|
|
|
+ condition: ""
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -54,10 +54,9 @@ Page({
|
|
|
item
|
|
|
} = e.currentTarget.dataset;
|
|
|
wx.navigateTo({
|
|
|
- url: './detail?item=' + JSON.stringify(item),
|
|
|
+ url: './detail?id=' + item.sat_coursewareid,
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
/* 获取列表 */
|
|
|
selectList(init = false) {
|
|
|
if (init.detail != undefined) init = init.detail;
|
|
@@ -66,13 +65,13 @@ Page({
|
|
|
})
|
|
|
if (this.data.content.pageNumber > this.data.content.pageTotal) return;
|
|
|
let content = this.data.content;
|
|
|
- (this.data.activeId == "") ? "" : content.where.sat_courseware_classid = this.data.activeId;
|
|
|
+ (this.data.activeId == "") ? delete(content.where.sat_courseware_classid): content.where.sat_courseware_classid = this.data.activeId;
|
|
|
+ if (this.data.sort[0]) content.sort = this.data.sort;
|
|
|
_Http.basic({
|
|
|
"classname": "saletool.courseware.courseware",
|
|
|
"method": "selectList",
|
|
|
content
|
|
|
}).then(res => {
|
|
|
- console.log("列表", res)
|
|
|
this.selectComponent('#ListBox').RefreshToComplete();
|
|
|
if (res.msg != '成功') return wx.showToast({
|
|
|
title: res.data,
|
|
@@ -82,7 +81,8 @@ Page({
|
|
|
list: (res.pageNumber == 1) ? res.data : this.data.list.concat(res.data),
|
|
|
['content.pageNumber']: res.pageNumber + 1,
|
|
|
['content.pageTotal']: res.pageTotal,
|
|
|
- total: res.total
|
|
|
+ total: res.total,
|
|
|
+ sort: res.sort
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -109,7 +109,7 @@ Page({
|
|
|
detail
|
|
|
}) {
|
|
|
this.setData({
|
|
|
- 'content.where.sorttype': detail == '最新' ? 2 : 1
|
|
|
+ sort: detail
|
|
|
})
|
|
|
this.selectList(true);
|
|
|
},
|