| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- const api = require('../../api/index.js');
-
- Page({
- data: {
- id: '',
- type: '',
- info: {},
- markers: []
- },
-
- onLoad(options) {
- console.log('司机详情参数:', options);
- this.setData({
- id: options.id,
- type: options.type
- });
- this.getDriverDetail();
- },
-
- // 获取司机详情
- getDriverDetail() {
- let data = {
- operationId: this.data.id
- };
-
- // 接口换成你真实的司机详情接口
- api.request('/sysoperation/selectoperationid', 'post', data).then(res => {
- if (res.code === 200) {
- let info = res.data;
- this.setData({ info });
-
- // 地图标记
- this.setData({
- markers: [{
- id: 1,
- longitude: Number(info.longitude),
- latitude: Number(info.latitude),
- iconPath: 'https://esos-iot.com/myminio/project/driver-icon.png',
- width: 40,
- height: 40
- }]
- });
- }
- });
- }
- });
|