shopmallApi.js
13.9 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
import api from '~/utils/request/request'
const path = 'scrm.api.shopmall.weapp.'
const couponpath = 'scrm.api.coupon.'
const wechatPath = 'scrm.api.wechat.'
module.exports = {
/** 分页查询商城专区的商品信息 */
getGoodsList(data) {
return api.post({
method: `scrm.api.shopmall.zoneInfo.weapp.goodsPage`,
pageNum: 1,
pageSize: 999,
...data
})
},
/** 根据商品ID获取商品 */
getGoodsDetail(id) {
return api.post({
method: `${path}goods.getById`,
id,
viewAmount: true
},
true
)
},
/** 添加购物车 */
addShoppingcart(data) {
return api.post({
method: `${path}shoppingcart.add`,
...data
})
},
/** 购物车删除商品 */
delShoppingcart(data) {
return api.post({
method: `${path}shoppingcart.delete`,
...data
})
},
/** 分页获取购物车 */
getShoppingcartList(data) {
return api.post({
method: `${path}shoppingcart.list`,
...data
})
},
/** 购物车商品变更(比如修改数量) */
updateShoppingcart(data) {
return api.post({
method: `${path}shoppingcart.update`,
...data
})
},
/**购物车结算 */
settlementShoppingcart(data) {
return api.post({
method: `${path}shoppingcart.settlement`,
...data
})
},
/**根据规格值组合获取规格组合库存及零售价 */
getGoodsSpecificationExtra(data) {
return api.post({
method: `${path}goods.getGoodsSpecificationExtra`,
...data
})
},
/** 创建订单(立即购买) */
createOrder(data) {
return api.post({
method: `${path}order.create`,
...data
})
},
/**创建支付订单(去付款) */
payOrder(data) {
return api.post({
method: `${path}order.createPay`,
...data
})
},
/** 确认收货 */
confirmReceipt(orderCode) {
return api.post({
method: `${path}order.confirmReceipt`,
orderCode
})
},
/**订单详情 */
getOrderDetail(orderCode) {
return api.post({
method: `${path}order.detail`,
orderCode
})
},
/** 申请售后 */
afterSale(data) {
return api.post({
method: `${path}orderRefund.apply`,
...data
},
true
)
},
/**活动详情 */
getActivityDetail(id) {
return api.post({
method: `${path}activity.detail`,
id
},
true
)
},
/** 直播活动详情 */
getLiveActivityDetail(data) {
return api.post({
method: `${path}live.activity.detail`,
...data
},
true
)
},
/**获取订单的售后详情 */
getOrderRefundDetail(orderCode) {
return api.post({
method: `${path}orderRefund.detail`,
orderCode
})
},
/** 为售后添加退货快递信息 */
addDelivery(data) {
return api.post({
method: `${path}orderRefund.addDelivery`,
...data
})
},
/** 获取商品关联优惠券列表 */
getGoodscouponList(id) {
return api.post({
method: `${path}goods.user.coupons.get`,
...id
},
true
)
},
/** 获取商品关联优惠券列表 */
getEquitycouponList(id) {
return api.post({
method: `scrm.api.shopmall.weapp.equitygoods.user.coupons.get`,
...id
},
true
)
},
/** 领取商品详情优惠券 */
getCoupon(data) {
return api.post({
method: `${couponpath}customer.receive`,
...data
},
true
)
},
/** 领取确认订单最大优惠券 */
getMaxCoupon(orderGoods) {
return api.post({
method: `${path}order.coupons.get`,
orderGoods
},
true
)
},
/**更换优惠券*/
updateCoupon(orderGoods) {
return api.post({
method: `${path}order.coupons.change`,
orderGoods
},
true
)
},
//立即评价
addComment(data) {
return api.post({
method: `${path}orderGoodsComment.saveByOrder`,
...data
},
true
)
},
//评论列表
getCommentList(data) {
return api.post({
method: `${path}orderGoodsComment.page`,
...data
},
true
)
},
//获取订单的评论详情
getOrderCommentDetails(orderCode) {
return api.post({
method: `${path}orderGoodsComment.customerOrderGoodsComment`,
orderCode
},
true
)
},
//取消付款
cancelPay(orderCode) {
return api.post({
method: `${path}order.cancelPay`,
orderCode
},
true
)
},
//申请售后待审核的订单取消售后
cancelOrder(orderCode) {
return api.post({
method: `${path}orderRefund.cancel`,
orderCode
},
true
)
},
/** 直播活动详情 */
getLiveActivityId(id) {
return api.post({
method: `${wechatPath}get.scene.by.id`,
...id
},
true
)
},
/** 挪车码,道路救援scene*/
getMovingcodeId(id) {
return api.post({
method: `${wechatPath}get.movingcode.scene.by.id`,
...id
},
true
)
},
/** 获取活动分享链接 */
getActivitylink(id) {
return api.post({
method: `scrm.api.shopmall.activity.get.shared`,
id
},
true
)
},
/** 获取商品分享链接 */
getGoodslink(id) {
return api.post({
method: `scrm.api.shopmall.goods.get.shared`,
id
},
true
)
},
// scrm.api.shopmall.weapp.
requestSubscribeMessage() {
return api.post({
method: `scrm.api.shopmall.weapp.order.listSubscribeMsgTemplateIds`
},
true
)
},
/** 小程序端根据优惠券id查询可使用商品列表(分页) */
getCouponGoodsPage(data) {
// let merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
// if(merchantId) data.merchantId = merchantId
data.pageSize = 8
return api.post({
method: 'scrm.app.shopmall.coupon.goods.page',
...data
})
},
/**参团人数 */
getActivityGroup(id) {
return api.post({
method: 'scrm.api.shopmall.weapp.activity.group2',
id
},
true
)
},
/** 订单详情 */
getOrderList(activityId) {
return api.post({
method: 'scrm.api.shopmall.weapp.crowdFunding.order.list',
activityId
},
true
)
},
/**获取发现模块新车必备商品列表 */
getDiscoverGoods(data) {
return api.post({
method: 'scrm.api.shopmall.weapp.goods.page',
...data
})
},
/**平台商城接口---商品列表 */
platformGoodsList(data) {
return api.post({
method: 'scrm.api.shopmall.app.platform.goods.stockroom.page',
...data
})
},
/* B端积分商城-分页查询订单 */
platformOrderList(data) {
return api.post({
method: 'scrm.api.tobshopmall.weapp.order.page',
...data
})
},
/* B端积分商城-物流轨迹 */
orderQueryLogistics(data) {
return api.post({
method: 'scrm.api.assistant.platform.order.queryLogistics',
...data
})
},
/* B端积分商城-取消订单 */
orderCancel(data) {
return api.post({
method: 'scrm.api.assistant.platform.order.cancel',
...data
})
},
/* B端积分商城-确认收货*/
orderReceipt(data) {
return api.post({
method: 'scrm.api.assistant.platform.confirm.receipt',
...data
})
},
/**平台商城接口---商品详情 */
platformGoodsDetail(data) {
return api.post({
method: 'scrm.api.shopmall.app.stockroom.goods.detail',
...data
})
},
/**平台商城接口---创建订单 */
platformGoodsCreateOrder(data) {
return api.post({
method: 'scrm.api.shopmall.platform.order.create',
...data
})
},
/**平台商城接口---去支付订单 */
platformGoodsPayOrder(data) {
return api.post({
method: 'scrm.api.shopmall.platform.order.createPay',
...data
})
},
/**平台商城接口---省市区列表 */
platformAddressCode(data) {
return api.post({
method: 'scrm.api.shopmall.platform.base.address.list',
...data
})
},
/**平台商城接口---地址列表 */
platformAddressList(data) {
return api.post({
method: 'scrm.api.shopmall.platform.customer.address.list',
...data
})
},
/**平台商城接口---报存地址列表 */
platformAddressSave(data) {
return api.post({
method: 'scrm.api.shopmall.platform.customer.address.save',
...data
})
},
/**平台商城接口---添加购物车 */
platformAddCar(data) {
return api.post({
method: 'scrm.api.shopmall.weapp.shoppingcart.add',
...data
})
},
/**平台商城接口---购物车结算时移出购物车 */
platformRemoveShopCarGoods(data) {
return api.post({
method: 'scrm.api.shopmall.weapp.shoppingcart.yzh.settlement',
...data
})
},
/**平台商城接口---物流轨迹 */
getPlatformQueryLogistics(data) {
return api.post({
method: 'scrm.api.shopmall.platform.order.queryLogistics',
...data
})
},
/**平台商城接口---取消订单 */
cancelPlatformOrder(data) {
return api.post({
method: 'scrm.api.shopmall.platform.order.cancel',
...data
}, true)
},
/**平台商城接口---订单详情 */
getPlatformOrderDetail(data) {
return api.post({
method: 'scrm.api.shopmall.platform.order.detail',
...data
})
},
/**平台商城接口---申请售后 */
platformApplySale(data) {
return api.post({
method: 'scrm.api.shopmall.platform.afterSales.add',
...data
})
},
/**平台商城接口---取消售后 */
platformEditSale(data) {
return api.post({
method: 'scrm.api.shopmall.platform.afterSales.cancel',
...data
})
},
/**平台商城接口---售后订单详情 */
platformSaleDetail(data) {
return api.post({
method: 'scrm.api.shopmall.platform.afterSales.detail',
...data
})
},
/**平台商城接口---售后类型 */
platformSaleType(data) {
return api.post({
method: 'scrm.api.shopmall.platform.afterSales.available.type',
...data
})
},
/**平台商城接口---物流类型 */
platformExpressList(data) {
return api.post({
method: 'scrm.api.shopmall.platform.query.expressList',
...data
})
},
/**平台商城接口---售后可申请的数量 */
platformApplyCount(data) {
return api.post({
method: 'scrm.api.shopmall.platform.afterSales.available.qty',
...data
})
},
/**平台商城接口---售后寄回的商品 */
platformSendBack(data) {
return api.post({
method: 'scrm.api.shopmall.platform.sendBack.goods',
...data
})
},
/**平台商城接口---删除地址 */
platformDelAddress(data) {
return api.post({
method: 'scrm.api.shopmall.platform.customer.address.delete',
...data
})
},
/**埋点接口 */
trackHttp(data) {
return api.post({
method: "entmicro.api.customercollect.reportCustomerList",
...data,
});
},
/**获取c端我的积分*/
getMyIntegralApi(data) {
return api.post({
method: "scrm.api.shopmall.weapp.my.integral",
...data,
});
},
/**获取c端我的积分列表*/
getIntegralListApi(data) {
return api.post({
method: "scrm.api.shopmall.weapp.my.integral.page",
...data,
});
},
/**获取银行列表*/
getBankList(data) {
return api.post({
method: "scrm.api.shopmall.weapp.integral.bank.list",
...data,
});
},
/**积分提现记录列表*/
getIntegralOutList(data) {
return api.post({
method: "scrm.api.shopmall.weapp.integral.transfer.out.page",
...data,
});
},
/**用户积分提现申请*/
integralApply(data) {
return api.post({
method: "scrm.api.shopmall.weapp.integral.transfer.out.apply",
...data,
},true);
},
/**查询用户上次提现记录*/
transferOutRecord(data) {
return api.post({
method: "scrm.api.shopmall.weapp.integral.transferOut.last.record",
...data,
});
},
//积分核销
verifyIntegralApi(data) {
return api.post({
method: "scrm.api.shopmall.weapp.integral.verification",
...data,
});
},
//获取积分核销详情
getCodeDetailApi(data) {
return api.post({
method: "scrm.api.shopmall.weapp.integral.order.detail",
...data,
}, true);
},
orderDetailInfo(data) {
return api.post({
method: "scrm.api.shopmall.weapp.order.pay.detail",
...data,
});
},
removeBuuCar(data) {
return api.post({
method: "scrm.api.shopmall.weapp.shoppingcart.delete.batch",
...data,
});
},
/** 积分创建订单(立即购买) */
jfToCreateOrder(data) {
return api.post({
method: 'scrm.api.assistant.platform.order.create',
...data,
});
},
/** 积分创建订单(售后) */
jfOrderAfterSale(data) {
return api.post({
method: 'scrm.api.shopmall.platform.staff.afterSales.add',
...data,
});
},
/** 积分创建订单(售后撤销) */
jfOrderAfterSaleExit(data) {
return api.post({
method: 'scrm.api.shopmall.platform.staff.afterSales.cancel',
...data,
});
},
/**积分商城接口---售后寄回的商品 */
jfPlatformSendBack(data) {
return api.post({
method: 'scrm.api.shopmall.platform.staff.sendBack.goods',
...data
})
},
/* B端积分商城-创建订单 */
orderCreatePay(data) {
return api.post({
method: 'scrm.api.assistant.platform.order.createPay',
...data
})
},
/*分页查询我的油卡列表 */
getOilList(data){
return api.post({
method: 'scrm.api.shopmall.goods.oil.coupon.user.page',
...data
})
},
// 油劵充值(小程序)
rechargeStatus(data){
return api.post({
method: 'scrm.api.shopmall.goods.oil.coupon.user.recharge',
...data
})
},
rechargeStatus(data){
return api.post({
method: 'scrm.api.shopmall.goods.oil.coupon.user.recharge',
...data
})
},
// 判断显示是否有油卡、门店服务
getDiscoverCount(data){
return api.post({
method: 'scrm.api.shopmall.goods.discover.oil.coupon.count',
...data
})
}
}