import request from '../../../util/http' import apiUrl from '../../../util/apiUrl' var app = getApp(); Page({ data: { isservantsettinged: true, servantName: '',//保姆姓名 weekday: '',//日前 servantTypeValue: '',//保姆工种, servantDescribleList: [], noServantList:false, }, onLoad() { this.setData({ servantName: app.globalData.relationInfo.servantName, weekday: app.globalData.relationInfo.servantTaskPeriod.workDay, servantTypeValue: app.globalData.relationInfo.servantType }), console.log("employRelationNo=" + app.globalData.employRelationNo) this.initServantDescribleInfo() }, initServantDescribleInfo() { let params = { "employRelationNo": app.globalData.employRelationNo, "subjectType": "SN000002", "userType": "1" } request.httpServicePost(apiUrl.customerDescribleInfo, params).then(data => { console.log("保姆描述信息=" + data.length); if (data.length == 0) { this.setData({ noServantList: true, servantDescribleList:[] }); } else { console.log("aaa" + data[0]) this.setData({ noServantList: false, servantDescribleList:data }); } }).catch(e => { console.log(e); }) } });