13404089107
2025-02-14 ec43e87c75ac193eaf9b5cdac6f272b27efa24b1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
/* 
 * 小程序 Promise 封装 wx.request
 * @Author: T.y.z
 * @Last Modified by: T.y.z
 */
const app = getApp()
class Ajax {
  //定义baseURL
  constructor(parms) {
    this.baseURL = parms.baseURL
  }
 
  // get 请求
  get(url, data) {
    return this.ajax('GET', url, data)
  }
 
  // post 请求
  post(url, data) {
    return this.ajax('POST', url, data)
  }
  // 公共请求方法
  ajax(method, url, data) {
 
    wx.showLoading({
      title: '加载中',
      mask: false
    })
    return new Promise((resolve, reject) => {
      wx.request({
        url: this.baseURL + url,
        data,
        header: {
          "content-type": "application/x-www-form-urlencoded",
          Authorization: "Bearer" + " " + wx.getStorageSync('token'),
        },
        method,
        dataType: 'json',
        responseType: 'text',
        success: res => {
          if (res.data.code == 400) {
            wx.showToast({
              title: res.data.msg,
              icon: "none"
            })
            return false
          }
          if ((res.data.message == 'token验证失败' || res.data.message == 'TOKEN_INVALID') && wx.getStorageSync('token') && wx.getStorageSync('token') !== 'quit') {
            wx.showModal({
              title: '提示',
              content: '登录过期是否重新登录',
              showCancel: true,
              confirmText: "确定", //默认是“确定”
              confirmColor: '#F07207', //确定文字的颜色
              success: (res) => {
                if (res.cancel) {
                  //点击取消,默认隐藏弹框
                } else {
                  wx.redirectTo({
                    url: '/pages/index/index',
                  })
                  clearInterval(app.globalData.comparisonToken)
                }
              },
              fail: function (res) {}, //接口调用失败的回调函数
              complete: function (res) {}, //接口调用结束的回调函数(调用成功、失败都会执行)
            })
          }
          if (res.data.code == 600 && (wx.getStorageSync('token') == '' || wx.getStorageSync('token') == 'quit')) {
            wx.redirectTo({
              url: '/pages/index/index',
            })
          }
          resolve(res)
        },
        fail: res => {
          wx.showToast({
            title: '网络错误',
            icon: "none"
          })
          reject(res)
        },
        complete: res => {
 
          wx.hideLoading()
        }
      })
    })
  }
}
 
const ajax = new Ajax({
  //  baseURL: 'http://192.168.0.49:81/api',
  // baseURL:"http://192.168.110.34:7777/user"
  // baseURL:"http://221.182.45.100:7777/user"
 
  // baseURL:"http://39.108.148.228:80/user"
  // baseURL: 'http://120.220.4.138:9591/user',
  baseURL: 'https://xn95128.cn/user',
  
})
 
/**
 *  全部导出  ajax.get() 调用
 */
export default ajax
 
/**
 *  单个导出 解构赋值 { getBanner } 调用
 */
 
// 专车查询专车类型
export const queryServerCarMo = (
  endLonLat,
  startLonLat,
  type
) => {
  return ajax.post('/base/serverCarModel/queryServerCarModel', {
    endLonLat,
    startLonLat,
    type
  })
}
 
 
// 专车查询专车类型
export const saveOrderPrivateCar = (
  driverId,
  endAddress,
  endLat,
  endLon,
  orderSource,
  orderType,
  passengers,
  passengersPhone,
  placementLat,
  placementLon,
  serverCarModelId,
  startAddress,
  startLat,
  startLon,
  substitute,
  travelTime,
  type
) => {
  return ajax.post('/api/orderPrivateCar/saveOrderPrivateCar', {
    driverId,
    endAddress,
    endLat,
    endLon,
    orderSource,
    orderType,
    passengers,
    passengersPhone,
    placementLat,
    placementLon,
    serverCarModelId,
    startAddress,
    startLat,
    startLon,
    substitute,
    travelTime,
    type
  })
}
 
 
// 跨城出行 获取 起点终点 站点
export const querySite = (
  startSiteId
) => {
  return ajax.post('/base/site/querySite', {
    startSiteId
  })
}
 
 
//根据选择的起点和终点获取线路
export const queryLines = (
  endId,
  startId
) => {
  return ajax.post('/base/line/queryLines', {
    endId,
    startId
  })
}
 
//根据线路id获取线路排班数据
export const queryDriver = (
  day,
  driverId,
  lineId
) => {
  return ajax.post('/base/lineSite/queryDriver', {
    day,
    driverId,
    lineId
  })
}
 
//根据站点id获取站点的区域范围数据(设置上车点和下车点)  
 
export const queryLocation = (
  siteId
) => {
  return ajax.post('/base/site/queryLocation', {
    siteId
  })
}
 
 
 
//判断一个点是是否在区域范围内
export const areaMonitoringexport = (
  code,
  lonLat,
  siteId
) => {
  return ajax.post('/base/site/areaMonitoring', {
    code,
    lonLat,
    siteId
  })
}
 
 
//根据司机的排班id获取剩余座位数据
export const querySeat = (
  id
) => {
  return ajax.post('/base/lineSite/querySeat', {
    id
  })
}
 
//获取跨城的支付金额
export const queryOrderMoney = (
  endLonLat,
  startLonLat,
  lineId,
  peopleNumber,
  seatNumber,
  serverCarModelId,
  totalSeat,
  travelMode
) => {
  return ajax.post('/base/orderCrossCity/queryOrderMoney', {
    endLonLat,
    startLonLat,
    lineId,
    peopleNumber,
    seatNumber,
    serverCarModelId,
    totalSeat,
    travelMode
  })
}
 
 
//跨城出行下单操作
export const orderCrossCity = (
  data
) => {
  return ajax.post('/api/orderCrossCity/orderCrossCity', data)
}
 
//查询优惠券 跟  充值余额
export const queryBalance = (data) => {
  return ajax.post('/api/taxi/queryBalance', data)
}
 
 
//获取服务中的详情数据
export const queryOrderInfo = (
  data
) => {
  return ajax.post('/api/order/queryOrderInfo', data)
}
 
 
//摆渡车下单
export const saveOrderFerry = (
  data
) => {
  return ajax.post('/api/orderCrossCity/saveOrderFerry', data)
}
 
 
//跨城出行须知
export const queryByType = (
  data
) => {
  return ajax.post('/base/agreement/queryByType', data)
}
 
 
//司机信息
export const queryDriverInfo = (
  data
) => {
  return ajax.post('/api/driver/queryDriverInfo', data)
}
 
//司机信息
export const addCancle = (
  data
) => {
  return ajax.post('/api/taxi/addCancle', data)
}
 
 
//
export const queryPhones = (
  data
) => {
  return ajax.post('/base/phone/queryPhones', data)
}
 
 
//获取业务对应的所有车型
export const queryServerCarModels = (data) => {
  return ajax.post('/base/serverCarModel/queryServerCarModels', data)
}
 
 
//提交包车订单
export const orderCharteredCar = (data) => {
  return ajax.post('/api/orderCharteredCar/orderCharteredCar', data)
}
 
//获取首页小件物流订单数量
export const queryLogisticsNumber = (data) => {
  return ajax.post('/api/orderLogistics/queryLogisticsNumber', data)
}
 
 
//获取所在地区
 
 
export const queryRegion = (data) => {
  return ajax.post('/api/orderLogistics/queryRegion', data)
}
 
//获取小件物流的单价数据
export const queryLogisticsUnitPrice = (data) => {
  return ajax.post('/api/orderLogistics/queryLogisticsUnitPrice', data)
}
 
//获取支付金额
export const queryPayMoney = (data) => {
  return ajax.post('/base/orderLogistics/queryPayMoney', data)
}
 
 
 
//根据起点和终点坐标判断是不是同一个市内
export const judgingTheCity = (data) => {
  return ajax.post('/base/orderLogistics/judgingTheCity', data)
}
 
 
///小件物流下单操作(同城/跨城)
export const smallLogistics = (data) => {
  return ajax.post('/api/orderLogistics/smallLogistics', data)
}
 
 
//获取积分兑换的商品
export const queryGoods = (data) => {
  return ajax.post('/api/integralGoods/queryGoods', data)
}
 
 
 
 
//兑换商品
export const addIntegralOrder = (data) => {
  return ajax.post('/api/integralGoods/addIntegralOrder', data)
}
 
 
 
 
 
export const queryConvertHistory = (data) => {
  return ajax.post('/api/integralGoods/queryConvertHistory', data)
}