servantdetail.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import request from '../../../util/http'
  2. import apiUrl from '../../../util/apiUrl'
  3. var app = getApp();
  4. Page({
  5. data: {
  6. isservantsettinged: true,
  7. servantName: '',//保姆姓名
  8. weekday: '',//日前
  9. servantTypeValue: '',//保姆工种,
  10. servantDescribleList: [],
  11. noServantList:false,
  12. noServantPic:false
  13. },
  14. onLoad() {
  15. this.setData({
  16. servantName: app.globalData.relationInfo.servantName,
  17. weekday: app.globalData.relationInfo.servantTaskPeriod.workDay,
  18. servantTypeValue: app.globalData.relationInfo.servantType
  19. }),
  20. console.log("employRelationNo=" + app.globalData.employRelationNo)
  21. this.initServantDescribleInfo()
  22. },
  23. initServantDescribleInfo() {
  24. let params = {
  25. "employRelationNo": app.globalData.employRelationNo,
  26. "subjectType": "SN000002",
  27. "userType": "1"
  28. }
  29. request.httpServicePost(apiUrl.customerDescribleInfo, params).then(data => {
  30. console.log("保姆描述信息=" + data.length);
  31. if (data.length == 0) {
  32. this.setData({
  33. noServantPic: true,
  34. noServantList:false,
  35. servantDescribleList:[]
  36. });
  37. } else {
  38. console.log("aaa" + data[0])
  39. this.setData({
  40. noServantList: true,
  41. noServantPic:false,
  42. servantDescribleList:data
  43. });
  44. }
  45. }).catch(e => {
  46. console.log(e);
  47. })
  48. }
  49. });