|
|
@@ -11,6 +11,8 @@ Page({
|
|
|
data: {
|
|
|
recommendationList: [], //推荐列表
|
|
|
particulars: {}, //详情
|
|
|
+ ceiling: false, //是否吸顶
|
|
|
+ Heitop: 0, //吸顶高度
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -27,10 +29,16 @@ Page({
|
|
|
"tsupplyanddemandid": options.tsupplyanddemandid
|
|
|
}
|
|
|
}).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
let checkdate = res.data[0].checkdate;
|
|
|
- res.data[0].checkdate = checkdate.slice(0, checkdate.lastIndexOf('.'));
|
|
|
+ if (checkdate != '' && checkdate != null && checkdate != undefined) res.data[0].checkdate = checkdate.slice(0, checkdate.lastIndexOf('.'));
|
|
|
+ const particulars = handleList.imageType(res.data[0], "default");
|
|
|
this.setData({
|
|
|
- particulars: res.data[0]
|
|
|
+ particulars
|
|
|
})
|
|
|
});
|
|
|
/* 获取推荐列表 */
|
|
|
@@ -40,15 +48,20 @@ Page({
|
|
|
"method": "query_supplyanddemandList",
|
|
|
"content": {
|
|
|
"getdatafromdbanyway": true,
|
|
|
- "pageNumber": 1,
|
|
|
+ "pageNumber": 2,
|
|
|
"pageSize": 10,
|
|
|
"where": {}
|
|
|
}
|
|
|
}).then(res => {
|
|
|
+ console.log("查询列表", res)
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
const data = handleList.checkdate(res.data)
|
|
|
- const productList = handleList.listOrdering(data);
|
|
|
+ const recommendationList = handleList.imageType(data, "default");
|
|
|
this.setData({
|
|
|
- recommendationList: productList
|
|
|
+ recommendationList
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
@@ -132,5 +145,44 @@ Page({
|
|
|
*/
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
+ },
|
|
|
+ /* 页面滑动 */
|
|
|
+ onPageScroll: function (e) {
|
|
|
+ const that = this;
|
|
|
+ const query = wx.createSelectorQuery()
|
|
|
+ query.select('#Description').boundingClientRect(function (fres) {
|
|
|
+ if (fres.top > that.data.Heitop) that.setData({
|
|
|
+ Heitop: fres.top
|
|
|
+ });
|
|
|
+ if (that.data.ceiling) {
|
|
|
+ if (fres.top > 15) {
|
|
|
+ that.setData({
|
|
|
+ ceiling: false
|
|
|
+ })
|
|
|
+ if (!that.data.ceiling) console.log('false', fres.top)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (fres.top < 15) {
|
|
|
+ that.setData({
|
|
|
+ ceiling: true
|
|
|
+ })
|
|
|
+ if (that.data.ceiling) console.log('true', fres.top)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ query.selectViewport().scrollOffset()
|
|
|
+ query.exec(function (res) {
|
|
|
+ // console.log(res)
|
|
|
+ })
|
|
|
+
|
|
|
+ /* if (this.data.ceiling) {
|
|
|
+ if (e.scrollTop == 0) this.setData({
|
|
|
+ ceiling: false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ if (e.scrollTop != 0) this.setData({
|
|
|
+ ceiling: true
|
|
|
+ })
|
|
|
+ } */
|
|
|
}
|
|
|
})
|