restapi.js 15.8 KB
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 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652
const restapi = require('../utils/restapi.js')
import { api } from '../utils/util.js'
module.exports = {
  //获取活动优惠券详情
  getActivityCouponById: function (activityCouponId, success, fail) {
    restapi.req(
      '/web-dj-weapp/coupon/detail',
      {
        activityCouponId: activityCouponId
      },
      {},
      'GET',
      'json',
      'text',
      success,
      fail
    )
  },
  //获取我的活动优惠券列表
  getMyActivityCoupons: function (pageNum, pageSize, flag, merchantId, success, fail) {
    restapi.req(
      '/web-dj-weapp/personal/coupons',
      {
        pageNum: pageNum,
        pageSize: pageSize,
        flag: flag,
        merchantId: merchantId
      },
      {},
      'GET',
      'json',
      'text',
      success,
      fail
    )
  },
  /** 领取活动优惠券*/
  receiveActivityCoupon: function (activityCouponId, activityId, success, fail) {
    restapi.req(
      '/web-dj-weapp/coupon/receive',
      {
        activityCouponId: activityCouponId,
        activityId: activityId
      },
      {
        'content-type': 'application/x-www-form-urlencoded'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },
  invokeWxUnifiedorder: function (activityOrderRequestVO, success, fail) {
    restapi.req(
      '/web-dj-weapp/popularActivity/invokeWxUnifiedorder',
      JSON.stringify(activityOrderRequestVO),
      {
        'content-type': 'application/json'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },

  /**
   * 获取设备绑定信息
   */
  getDeviceBindInfo: function (sourcefrom, success, fail) {
    restapi.req(
      '/web-dj-weapp/device/getBindInfo',
      {
        sourcefrom: sourcefrom
      },
      {
        'content-type': 'application/x-www-form-urlencoded'
      },
      'GET',
      'json',
      'text',
      success,
      fail
    )
  },
  /**
   * 根据id获取门店信息
   */
  getMerchantById(merchantId, success) {
    restapi.req(
      '/web-dj-weapp/personal/merchant',
      {
        merchantId: merchantId
      },
      {},
      'GET',
      'json',
      'text',
      success
    )
  },
  /**
   * 我的活动-根据id获取门店信息
   */
  getMerchantByIdMyActivity(merchantId, success) {
    restapi.req(
      '/web-dj-weapp/myactivity/merchant',
      {
        mid: merchantId
      },
      {},
      'GET',
      'json',
      'text',
      success
    )
  },

  /**
   * 根据活动订单id获取订单信息
   */
  getOrderInfoById(orderId, success) {
    restapi.req(
      '/web-dj-weapp/popularActivity/getActivityOrderById',
      {
        orderId: orderId
      },
      {},
      'GET',
      'json',
      'text',
      success
    )
  },
  /** 个人中心获取订单列表*/
  getMyActivityOrders: function (pageRequestVO, success, fail) {
    restapi.req(
      '/web-dj-weapp/personal/orders',
      pageRequestVO,
      {
        'content-type': 'application/x-www-form-urlencoded'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },
  /** 下拉加载更多活动*/
  loadMoreActivities: function (activityRequestVO, success, fail) {
    restapi.req(
      '/web-dj-weapp/popularActivity/loadMoreActivities',
      activityRequestVO,
      {
        'content-type': 'application/x-www-form-urlencoded'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },
  /**
   * 关闭订单
   */
  closeOrder(orderId, outTradeNo, success, fail) {
    restapi.req(
      '/web-dj-weapp/popularActivity/closeOrder',
      {
        orderId: orderId,
        outTradeNo: outTradeNo
      },
      {
        'content-type': 'application/x-www-form-urlencoded'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },
  /** 获取绑定信息*/
  getBindingInfo: function (merchantId, success, fail) {
    restapi.req(
      '/web-dj-weapp/home/getBindInfoByCondition',
      {
        merchantId: merchantId
      },
      {},
      'GET',
      'json',
      'text',
      success,
      fail
    )
  },

  /**
   * 获取我的顾问
   */
  getEmployeeOfAccount(success, fail) {
    restapi.req('/web-dj-weapp/servicer/getEmployeeOfAccount', {}, {}, 'GET', 'json', 'text', success, fail)
  },

  /**
   * 获取门店的服务顾问列表
   */
  getEmployeesList(merchantId, accountGroupList, success, fail) {
    restapi.req(
      '/web-dj-weapp/servicer/getEmployeesList',
      {
        merchantId: merchantId,
        accountGroupList: accountGroupList
      },
      {
        'content-type': 'application/x-www-form-urlencoded'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },

  /**
   * 设置顾问
   */
  setConsultant(ref, success) {
    restapi.req('/web-dj-weapp/servicer/setConsultant', ref, {}, 'Get', 'json', 'text', success)
  },

  /**
   * 获得个人中心模块配置
   */
  getMyModules(merchantId, success, fail) {
    restapi.req(
      '/web-dj-weapp/personal/getPersonalModules',
      {
        merchantId: merchantId
      },
      {},
      'GET',
      'json',
      'text',
      success,
      fail
    )
  },

  /**
   * 获取小程序绑定的公众号
   */
  getWxAccountInfo(merchantId, success, fail) {
    restapi.req(
      '/web-dj-weapp/personal/getWxAccountInfo',
      {
        merchantId: merchantId
      },
      {},
      'GET',
      'json',
      'text',
      success,
      fail
    )
  },

  /**
   * 判断用户是否关注公众号
   */
  subscribWechat(success, fail) {
    restapi.req('/web-dj-weapp/personal/subscribWechat', {}, {}, 'GET', 'json', 'text', success, fail)
  },
  /**
   * 获取员工分组列表
   */
  getAccountGroupList(success) {
    restapi.req('/web-dj-weapp/servicer/getAccountGroupList', {}, {}, 'GET', 'json', 'text', success)
  },
  /**
   * 返回用户信息列表
   */
  getAccountListByPhone(phone, success, fail) {
    restapi.req(
      '/web-dj-weapp/myactivity/getAccountListByPhone',
      {
        phone: phone
      },
      {},
      'GET',
      'json',
      'text',
      success,
      fail
    )
  },
  /**活动列表 */
  getActivityList(data, callBack) {
    restapi.req(
      '/web-dj-weapp/myactivity/list',
      data,
      {
        'content-type': 'application/json'
      },
      'POST',
      'json',
      'text',
      callBack
    )
  },
  /**活动详情 */
  getActivityDetail(data, callBack) {
    restapi.req(
      '/web-dj-weapp/myactivity/detail',
      data,
      {
        'content-type': 'application/json'
      },
      'POST',
      'json',
      'text',
      callBack
    )
  },
  /**获取活动操作日志 */
  getListLogRecord(data, callBack) {
    restapi.req(
      '/web-dj-weapp/myactivity/listLogRecord',
      data,
      {
        'content-type': 'application/json'
      },
      'POST',
      'json',
      'text',
      callBack
    )
  },

  /**
   * 获取门店信息
   */
  getMerchantById(merchantId, success) {
    restapi.req(
      '/web-dj-weapp/personal/merchant',
      {
        merchantId: merchantId
      },
      {},
      'GET',
      'json',
      'text',
      success
    )
  },
  /**
   * 创建记录
   */
  createLogRecord: function (obj, success, fail) {
    restapi.req(
      '/web-dj-weapp/myactivity/createLogRecord',
      JSON.stringify(obj),
      {
        'content-type': 'application/json'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },
  /**
   * 做活动链接
   */
  getDoActivityLink(success, fail) {
    restapi.req('/web-dj-weapp/myactivity/getDoActivityLink', {}, {}, 'GET', 'json', 'text', success, fail)
  },

  /**
   * 获取已激活权益列表
   */
  listEquities(info, success, fail) {
    restapi.req(
      '/web-dj-weapp/equity/list',
      info,
      {
        'content-type': 'application/x-www-form-urlencoded'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },

  /**
   * 根据权益订单号/保单号/身份证号查询并激活权益保单信息
   */
  queryEquityByEquityNo(searchCondition, success, fail) {
    restapi.req(
      '/web-dj-weapp/equity/query',
      {
        searchCondition: searchCondition
      },
      {},
      'GET',
      'json',
      'text',
      success,
      fail
    )
  },

  /**
   * 完善车牌号
   */
  editCarBrand(info, success, fail) {
    restapi.req(
      '/web-dj-weapp/equity/edit',
      info,
      {
        'content-type': 'application/x-www-form-urlencoded'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },
  /**
   * 查找是否存在权益
   */
  existEquity(searchCondition, success, fail) {
    restapi.req(
      '/web-dj-weapp/equity/exist',
      {
        searchCondition: searchCondition
      },
      {},
      'GET',
      'json',
      'text',
      success,
      fail
    )
  },

  /**
   * 添加车辆
   */
  addOrUpdateVehicle: function (vehicle, success, fail) {
    restapi.req(
      '/web-dj-weapp/home/addOrUpdateVehicle',
      vehicle,
      {
        'content-type': 'application/x-www-form-urlencoded'
      },
      'Post',
      'json',
      'text',
      success,
      fail
    )
  },
  /**
   * 删除车辆
   */
  deleteVehicle(id, success, fail) {
    restapi.req(
      '/web-dj-weapp/home/deleteVehicle',
      {
        id: id
      },
      {
        'content-type': 'application/x-www-form-urlencoded'
      },
      'POST',
      'json',
      'text',
      success,
      fail
    )
  },
  /**获得一级品牌(车牌1、2级) */
  getParentBrands: function (success) {
    restapi.req('/web-dj-weapp/home/getParentBrands', {}, {}, 'GET', 'json', 'text', success)
  },

  /**
   * 获得品牌车系
   */
  getSecondBrands: function (parentId, success) {
    restapi.req(
      '/web-dj-weapp/home/getSecondBrands',
      {
        parentId: parentId
      },
      {},
      'GET',
      'json',
      'text',
      success
    )
  },
  /** 我的消息 - 添加客服消息 */
  addCustomerMessage: function (data, success, fail) {
    restapi.req('/web-dj-weapp/remindServiceInfo/addCustomerMessage', data, { 'content-type': 'application/json' }, 'POST', 'json', 'text', success, fail)
  },
  /** 我的消息 - 获取客服消息 */
  getCustomerMessageList: function (data, success, fail) {
    restapi.req('/web-dj-weapp/remindServiceInfo/getCustomerMessageList', data, {}, 'GET', 'json', 'text', success, fail)
  },
  /** 我的消息 - 获取最新未读客服信息内容 */
  getCustomerMessageNew: function (data, success, fail) {
    restapi.req('/web-dj-weapp/remindServiceInfo/getCustomerMessageNew', data, { 'content-type': 'application/json' }, 'POST', 'json', 'text', success, fail)
  },
  /** 我的消息 - 更新客服消息 */
  updateMessage: function (data, success, fail) {
    restapi.req('/web-dj-weapp/remindServiceInfo/updateMessage', data, { 'content-type': 'application/json' }, 'POST', 'json', 'text', success, fail)
  },

  /**
   * 申请退款
   */
  refundOrder: function (data, success, fail) {
    restapi.req('/web-dj-weapp/popularActivity/refundOrder', data, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
  },
  /**获取用户地址列表 */
  getUserAddressList(success) {
    api.post('myAddress/list', {}, success)
  },
  /**新增地址 myAddress/ */
  insertUserAddressList(data, success) {
    api.post('myAddress/insert', data, success)
  },
  /**修改地址 /myAddress/update */
  updateUserAddressList(data, success) {
    api.post('myAddress/update', data, success)
  },
  /**获取地址 myAddress/getById */
  getUserAddress(data, success) {
    api.get('myAddress/getById', { id: data }, success)
  },
  /** 删除地址 myAddress/deleteById */
  delUserAddress(data, success) {
    api.get('myAddress/deleteById', { id: data }, success)
  },
  /**物流信息  */
  getListDeliveryInfo(data, success) {
    api.get('popularActivity/listDeliveryInfo', data, success)
  },
  /**
   * 根据团队编码查找拼团记录
   */
  getGroupsByGroupCode: function (groupCode, success, fail) {
    restapi.req('/web-dj-weapp/popularActivity/getGroupsByGroupCode', { groupCode: groupCode }, {}, 'GET', 'json', 'text', success, fail)
  },
  /**
   * 根据条件查找拼团(团长)信息:groupCode:团队编码,account_id:用户账号,activity_id:活动id
   */
  getGroupInfoDetail: function (record, success, fail) {
    restapi.req('/web-dj-weapp/popularActivity/getGroupInfoDetail', record, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
  },
  /**
   * 查询是否此活动已报过价
   */
  getQuoteRecord: function (activityId, success, fail) {
    restapi.req('/web-dj-weapp/quote/getQuoteRecord', { activityId: activityId }, {}, 'GET', 'json', 'text', success, fail)
  },
  /**
   * 根据车型年款和购车时间匹配报价价格
   */
  getQuoteInfo: function (quote, success, fail) {
    restapi.req('/web-dj-weapp/quote/getQuoteInfo', quote, { 'content-type': 'application/json' }, 'POST', 'json', 'text', success, fail)
  },
  /**
   * 获取商户主营品牌下车系列表
   */
  getMerchantCarSeriesList: function (success, fail) {
    restapi.req('/web-dj-weapp/quote/getMerchantCarSeriesList', {}, {}, 'GET', 'json', 'text', success, fail)
  },
  /**
   * 获取车系下的车型年款
   */
  getCarTypeList: function (carSeriesId, success, fail) {
    restapi.req('/web-dj-weapp/quote/getCarTypeList', { carSeriesId: carSeriesId }, {}, 'GET', 'json', 'text', success, fail)
  },
  /**
   * 生产报价单
   */
  generateQuoteRecord: function (record, success, fail) {
    restapi.req('/web-dj-weapp/quote/generateQuoteRecord', record, { 'content-type': 'application/json' }, 'POST', 'json', 'text', success, fail)
  },
  /**
   * 获取直播间详情
   */
  getLiveDetail: function (roomId, success, fail) {
    restapi.req('/web-dj-weapp/home/liveplayer/detail', roomId, {}, 'GET', 'json', 'text', success, fail)
  },

  /**
   * 精品交付单
   */
  /** 精品交付单首次扫码绑定订单*/
  scanCodeFromMini(data, success, fail) {
    api.get('boutiquedelivery/order/firstScan', data, success)
  },

  /** 精品交付单列表 */
  getUserBoutiqueList(data, success, fail) {
    api.post('smartcarlife/goodsOrder/listMyOrder', data, success, fail)
  },

  /** 精品交付单订单详情列表 */
  getBoutiqueOrderDetail(data, success, fail) {
    api.get('boutiquedelivery/order/getDetail', data, success, fail)
  },

  /** 精品交付单精品升级列表 */
  getBoutiqueUpgradeList(data, success, fail) {
    api.get('boutiquedelivery/order/listUpgradeList', data, success, fail)
  },

  /** 精品交付单二次扫码订单详情 */
  getBoutiqueSecondScanData(data, success, fail) {
    api.get('boutiquedelivery/order/secondScan', data, success, fail)
  },

  // 精品交付单二次扫码订单详情页-评论标签
  getBoutiqueCommentLabel(data, success, fail) {
    api.get('boutiquedelivery/order/getCommentLabelList', data, success, fail)
  },

  // 精品交付单二次扫码订单详情页-提交评级和评论结果
  sendBoutiqueCommentResult(data, success, fail) {
    api.post('boutiquedelivery/order/confirmUpgrade', data, success, fail)
  },
  /**精品礼券  */
  getCouponList(data, success, fail) {
    api.post('smartCarLife/lifeCustomerCoupon/listMyCoupon', data, success, fail)
  }
}