67 lines
1.8 KiB
JavaScript
67 lines
1.8 KiB
JavaScript
|
|
// pages/task/task.js
|
||
|
|
import {getAllTask} from '../../api/task.js'
|
||
|
|
Page({
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 页面的初始数据
|
||
|
|
*/
|
||
|
|
data: {
|
||
|
|
userInfo: {},
|
||
|
|
dataList: [
|
||
|
|
// {
|
||
|
|
// createTime: '2020-2-10 14:44:21',
|
||
|
|
// carUrl: 'http://www.baidu.com/img/bdlogo.png',
|
||
|
|
// registerFlowmanVoList: [{healthUrl: 'http://rongcloud-web.qiniudn.com/docs_demo_rongcloud_logo.png',passingUrl: 'http://rongcloud-web.qiniudn.com/docs_demo_rongcloud_logo.png'}]
|
||
|
|
// },
|
||
|
|
// {
|
||
|
|
// createTime: '2020-2-10 14:44:21',
|
||
|
|
// carUrl: 'http://www.baidu.com/img/bdlogo.png',
|
||
|
|
// registerFlowmanVoList: [{healthUrl: 'http://rongcloud-web.qiniudn.com/docs_demo_rongcloud_logo.png',passingUrl: 'http://rongcloud-web.qiniudn.com/docs_demo_rongcloud_logo.png'}]
|
||
|
|
// }
|
||
|
|
]
|
||
|
|
},
|
||
|
|
|
||
|
|
onLoad() {
|
||
|
|
let userInfo = wx.getStorageSync('userInfo')
|
||
|
|
this.setData({userInfo})
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 生命周期函数--监听页面显示
|
||
|
|
*/
|
||
|
|
onShow: function () {
|
||
|
|
this.getRecodesList()
|
||
|
|
},
|
||
|
|
// 获取近期记录
|
||
|
|
getRecodesList() {
|
||
|
|
getAllTask({page: 1, limit:5}).then(res=> {
|
||
|
|
if(res.code === 0) {
|
||
|
|
this.setData({dataList: res.data.records})
|
||
|
|
}
|
||
|
|
})
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 进入记录列表
|
||
|
|
*/
|
||
|
|
goTaskPage(e) {
|
||
|
|
wx.navigateTo({
|
||
|
|
url: '/package_A/page/alltask/index',
|
||
|
|
})
|
||
|
|
},
|
||
|
|
goUpload() {
|
||
|
|
wx.navigateTo({
|
||
|
|
url: '/package_A/page/upload/index',
|
||
|
|
})
|
||
|
|
},
|
||
|
|
/**
|
||
|
|
* 进入详情页面
|
||
|
|
*/
|
||
|
|
goTaskDetail(e) {
|
||
|
|
let detail = e.currentTarget.dataset.detail
|
||
|
|
wx.navigateTo({
|
||
|
|
url: '/package_A/page/upload/index?data=' + JSON.stringify(detail),
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
})
|