servantdetail.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. },
  13. onLoad() {
  14. this.setData({
  15. servantName: app.globalData.relationInfo.servantName,
  16. weekday: app.globalData.relationInfo.servantTaskPeriod.workDay,
  17. servantTypeValue: app.globalData.relationInfo.servantType
  18. }),
  19. console.log("employRelationNo=" + app.globalData.employRelationNo)
  20. this.initServantDescribleInfo()
  21. },
  22. initServantDescribleInfo() {
  23. let params = {
  24. "employRelationNo": app.globalData.employRelationNo,
  25. "subjectType": "SN000002",
  26. "userType": "1"
  27. }
  28. request.httpServicePost(apiUrl.servantDescribleInfo, params).then(data => {
  29. console.log("保姆描述信息=" + data.length);
  30. if (data.length == 0) {
  31. this.setData({
  32. noServantList: true,
  33. servantDescribleList:[]
  34. });
  35. } else {
  36. console.log("aaa" + data[0])
  37. this.setData({
  38. noServantList: false,
  39. servantDescribleList:data
  40. });
  41. }
  42. }).catch(e => {
  43. console.log(e);
  44. })
  45. }
  46. });