Commit 2996062b by 高淑倩

销售任务&&招募任务

parent 52c53bdc
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 55, "current": 50,
"list": [ "list": [
{ {
"id": -1, "id": -1,
...@@ -375,7 +375,7 @@ ...@@ -375,7 +375,7 @@
"scene": null "scene": null
}, },
{ {
"id": -1, "id": 50,
"name": "kpi", "name": "kpi",
"pathName": "pages/shopping/kpi/kpi", "pathName": "pages/shopping/kpi/kpi",
"query": "", "query": "",
......
// shoppingGuid/page/pages/kpi/kpi.js // shoppingGuid/page/pages/kpi/kpi.js
const app = getApp()
const wxService = require('../../../../utils/wxService') const wxService = require('../../../../utils/wxService')
wxService.page({ wxService.page({
...@@ -13,7 +14,9 @@ wxService.page({ ...@@ -13,7 +14,9 @@ wxService.page({
// { name: '维护任务', type: 4, isActive: false } // { name: '维护任务', type: 4, isActive: false }
], ],
current: 1, current: 1,
list : [{id:1,},{id:2},{id:3},{id:4},{id:5},{id:6},{id:7},{id:8}] list : [{id:1,},{id:2},{id:3},{id:4},{id:5},{id:6},{id:7},{id:8}],
pageSize: 10,
pageNo: 1
}, },
/** /**
...@@ -28,9 +31,33 @@ wxService.page({ ...@@ -28,9 +31,33 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
const {pageSize, pageNo,current} = this.data
this.getTaskPage(pageSize, pageNo,current)
},
getTaskPage(pageSize, pageNo,current) { // 1 销售任务 2 招募任务
wx.showLoading({
title: '加载中'
})
const query = {
type: current,
brandId: app.globalData.brandId,
pageSize,
pageNo,
}
wxService.post(`/marketing/shoppingguide/task/page`,query).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
// pageNo == 1? [...data.content]: [...this.data.couponList,...data.content],
// this.setData({
// cartList:
// })
}
}
})
}, },
// 点击事件 // 点击事件
//分类点击 //分类点击
onTopBarTap(e){ onTopBarTap(e){
...@@ -44,8 +71,17 @@ wxService.page({ ...@@ -44,8 +71,17 @@ wxService.page({
this.data.current = this.data.navBar[index].type; this.data.current = this.data.navBar[index].type;
this.setData({ this.setData({
pageNo: 1,
navBar: this.data.navBar, navBar: this.data.navBar,
current: this.data.current current: this.data.current
},()=>{
if (wx.pageScrollTo) {
wx.pageScrollTo({
scrollTop: 0
})
}
const {pageSize, pageNo,current} = this.data
this.getTaskPage(pageSize, pageNo,current)
}); });
}, },
//销售任务item点击事件 //销售任务item点击事件
...@@ -79,7 +115,12 @@ wxService.page({ ...@@ -79,7 +115,12 @@ wxService.page({
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
console.log('-------------')
}, this.setData({
pageNo: this.data.pageNo + 1,
},()=>{
const {pageSize, pageNo,current} = this.data
this.getTaskPage(pageSize, pageNo,current)
})
}
}) })
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment