servantDetail.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. var util = require('../../../utils/util.js');
  2. var api = require('../../../config/api.js');
  3. const app = getApp();
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. resumeInfo:{
  10. },
  11. activeDot:1,
  12. skillList:[
  13. ],
  14. servicePatternList:[]
  15. },
  16. /**
  17. * 生命周期函数--监听页面加载
  18. */
  19. onLoad: function (options) {
  20. let workerNo=options.workerNo;
  21. this.setData({
  22. workerNo:workerNo
  23. });
  24. this.servantResume(workerNo);
  25. },
  26. servantResume: function () {
  27. util.request(api.servantResume, {
  28. workerNo:this.data.workerNo
  29. },'GET')
  30. .then(res=>{
  31. console.info(res);
  32. if (res.errno === 0) {
  33. this.setData({
  34. resumeInfo:res.data,
  35. skillList:res.data.skillImg==''?[]:res.data.skillImg.split(','),
  36. servicePatternList:res.data.servicePatternName==''?[]:res.data.servicePatternName.split(',')
  37. });
  38. } else {
  39. util.showErrorToast(res.errmsg);
  40. }
  41. });
  42. },
  43. scroll(e){
  44. console.log(e);
  45. let srollLeft=e.detail.scrollLeft
  46. let index=parseInt((srollLeft+144)/180);
  47. this.setData({
  48. activeDot:index
  49. })
  50. },
  51. goAppoint(){
  52. wx.navigateTo({
  53. url: '/pages/goods/infoCollect/infoCollect',
  54. })
  55. },
  56. /**
  57. * 生命周期函数--监听页面初次渲染完成
  58. */
  59. onReady: function () {
  60. },
  61. /**
  62. * 生命周期函数--监听页面显示
  63. */
  64. onShow: function () {
  65. },
  66. /**
  67. * 生命周期函数--监听页面隐藏
  68. */
  69. onHide: function () {
  70. },
  71. /**
  72. * 生命周期函数--监听页面卸载
  73. */
  74. onUnload: function () {
  75. },
  76. /**
  77. * 页面相关事件处理函数--监听用户下拉动作
  78. */
  79. onPullDownRefresh: function () {
  80. },
  81. /**
  82. * 页面上拉触底事件的处理函数
  83. */
  84. onReachBottom: function () {
  85. },
  86. /**
  87. * 用户点击右上角分享
  88. */
  89. onShareAppMessage: function () {
  90. }
  91. })