servantdetail.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.servantInfo.employerName,
  17. weekday: app.globalData.servantInfo.servantTaskPeriod.workDay,
  18. servantTypeValue: app.globalData.servantInfo.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": "SN000001",
  27. "userType": "2"
  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. for(let i=0;i<data.length;i++){
  40. data[i]=(i+1)+'.'+data[i];
  41. }
  42. this.setData({
  43. noServantList: true,
  44. noServantPic:false,
  45. servantDescribleList:data
  46. });
  47. }
  48. }).catch(e => {
  49. console.log(e);
  50. })
  51. }
  52. });