接单部分完成
This commit is contained in:
86
pages/wodejiedan/wodejiedan.js
Normal file
86
pages/wodejiedan/wodejiedan.js
Normal file
@ -0,0 +1,86 @@
|
||||
import {url} from '../../request'
|
||||
Page({
|
||||
data: {
|
||||
items: [null, null, null,null],
|
||||
},
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
onReady() {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
const that = this
|
||||
wx.getStorage({
|
||||
key: "logmessage",
|
||||
success(res) {
|
||||
const userinfo = res.data.Authorization
|
||||
wx.request({
|
||||
url: url + '/project/get/running',
|
||||
method: 'POST',
|
||||
data: {
|
||||
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': userinfo
|
||||
},
|
||||
success(res) {
|
||||
console.log('登录成功', res);
|
||||
if(res.data.code==1){
|
||||
that.setData({
|
||||
list:res.data.data
|
||||
})
|
||||
wx.showToast({
|
||||
title: '查询成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.message,
|
||||
icon:"error",
|
||||
duration:2000
|
||||
})
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.error('请求失败', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user