合伙人运营小程序
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. const api = require('../../api/index.js');
  2. Page({
  3. data: {
  4. id: '',
  5. type: '',
  6. info: {},
  7. markers: []
  8. },
  9. onLoad(options) {
  10. console.log('司机详情参数:', options);
  11. this.setData({
  12. id: options.id,
  13. type: options.type
  14. });
  15. this.getDriverDetail();
  16. },
  17. // 获取司机详情
  18. getDriverDetail() {
  19. let data = {
  20. operationId: this.data.id
  21. };
  22. // 接口换成你真实的司机详情接口
  23. api.request('/sysoperation/selectoperationid', 'post', data).then(res => {
  24. if (res.code === 200) {
  25. let info = res.data;
  26. this.setData({ info });
  27. // 地图标记
  28. this.setData({
  29. markers: [{
  30. id: 1,
  31. longitude: Number(info.longitude),
  32. latitude: Number(info.latitude),
  33. iconPath: 'https://esos-iot.com/myminio/project/driver-icon.png',
  34. width: 40,
  35. height: 40
  36. }]
  37. });
  38. }
  39. });
  40. }
  41. });