mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-22 01:59:36 +08:00
71 lines
1.4 KiB
JavaScript
71 lines
1.4 KiB
JavaScript
![]() |
let app = getApp()
|
||
|
Page({
|
||
|
data: {
|
||
|
currentTab: 0
|
||
|
},
|
||
|
|
||
|
onShow() {
|
||
|
this.getList()
|
||
|
},
|
||
|
|
||
|
getList(status) {
|
||
|
let that = this
|
||
|
let url = ''
|
||
|
if (that.data.currentTab == 0) {
|
||
|
url = '/suggestion/list'
|
||
|
} else if (that.data.currentTab == 1) {
|
||
|
url = '/suggestion/list?status=1'
|
||
|
} else if (that.data.currentTab == 2) {
|
||
|
url = '/suggestion/list?status=2'
|
||
|
} else if (that.data.currentTab == 3) {
|
||
|
url = '/suggestion/list?status=3'
|
||
|
}
|
||
|
app.AjaxRequest('GET', {
|
||
|
'content-type': 'application/json',
|
||
|
'Authorization': 'Bearer ' + app.Getopenid()
|
||
|
}, url, {}, function (res) {
|
||
|
if (res.code == 0) {
|
||
|
that.setData({
|
||
|
list: res.data
|
||
|
})
|
||
|
}
|
||
|
})
|
||
|
},
|
||
|
|
||
|
//滑动切换
|
||
|
swiperTab (e) {
|
||
|
var that = this
|
||
|
that.setData({
|
||
|
currentTab: e.detail.current
|
||
|
})
|
||
|
that.getList()
|
||
|
},
|
||
|
|
||
|
//点击切换
|
||
|
clickTab (e) {
|
||
|
var that = this
|
||
|
if (this.data.currentTab === e.target.dataset.current) {
|
||
|
return false
|
||
|
} else {
|
||
|
that.setData({
|
||
|
currentTab: e.target.dataset.current
|
||
|
})
|
||
|
}
|
||
|
},
|
||
|
|
||
|
scrollToLower() {
|
||
|
|
||
|
},
|
||
|
|
||
|
create() {
|
||
|
wx.navigateTo({
|
||
|
url: '/pages/complaint/newComplaint/newComplaint',
|
||
|
})
|
||
|
},
|
||
|
|
||
|
repairDetail(e) {
|
||
|
wx.navigateTo({
|
||
|
url: '/pages/complaint/complaintDetail/complaintDetail?id=' + e.currentTarget.dataset.id,
|
||
|
})
|
||
|
}
|
||
|
})
|