import request from '../../../util/http' import apiUrl from '../../../util/apiUrl' var app = getApp(); Page({ data: { isservantsettinged: true, servantName: '',//保姆姓名 weekday: '',//日前 servantTypeValue: '',//保姆工种, servantDescribleList: [], noServantList:false, noServantPic: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({ noServantPic: true, noServantList:false, servantDescribleList:[] }); } else { console.log("aaa" + data[0]) this.setData({ noServantList: true, noServantPic:false, servantDescribleList:data }); } }).catch(e => { console.log(e); }) } });