shopmallApi.js
2.91 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
import api from '~/utils/request/request'
import USERAPI from '~/api/usersApi/index'
export default {
/**众筹详情 */
getActivityDetail(id) {
return api.post({
method: 'scrm.api.shopmall.weapp.activity.detail',
id
},
true
)
},
/**参团人数 */
getActivityGroup(id) {
return api.post({
method: 'scrm.api.shopmall.weapp.activity.group2',
id
},
true
)
},
/** 创建订单(立即购买) */
createOrder(data) {
return api.post({
method: 'scrm.api.shopmall.weapp.order.create',
...data
},
true
)
},
/**创建支付订单(去付款) */
payOrder(data) {
return api.post({
method: 'scrm.api.shopmall.weapp.order.createPay',
...data
},
true
)
},
/**海报 */
getPoster(data) {
data.sessionId = wx.$util.getSessionId()
return api.post({
method: 'scrm.api.shopmall.weapp.crowdFunding.poster',
...data
},
true
)
},
/** 订单详情 */
getOrderList(activityId) {
return api.post({
method: 'scrm.api.shopmall.weapp.crowdFunding.order.list',
activityId
},
true
)
},
// 根据众筹id获取直播详情
getLiveDetail(id) {
return api.post({
method: 'scrm.api.shopmall.weapp.activity.live.broadcast.detail',
id
},
true
)
},
// 直播IM用户签名
getLiveSig(data) {
return api.post({
method: 'scrm.api.shopmall.weapp.live.activity.usersig',
...data
},
true
)
},
/** 查询分享人信息 */
getStaffInfo(data) {
return api.post({
method: 'scrm.api.shopmall.activity.share.user.info',
...data
})
},
/** 广汇留资 */
recordSave(data) {
return api.post({
method: `scrm.api.shopmall.gh.customer.record.save`,
...data
})
},
/**直播间埋点*/
async liveRoomReport(data) {
const userInfo = wx.$util.getUserInfo(),
userProfile = wx.$storage.get('user_profile'),
{
openId
} = await USERAPI.getWXUserInfo()
let obj = {
accountId: userInfo.accountId || '',
accountName: userInfo.nickName || userProfile.nickName || '微信用户',
customerAvatar: userInfo.headImgUrl || userProfile.avatarUrl || 'https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132',
customerOpenId: openId || userInfo.openId || '',
customerUnionId: userInfo.unionId || '',
customerPhone: userInfo.phone || '',
merchantId: userInfo.merchantId || '',
merchantName: userInfo.merchantName || '',
bizDataType: 1,
operationType: 3,
operationDate: new Date().format('yyyy-MM-dd hh:mm:ss'),
visitSource: '小程序-众筹'
}
return api.post({
method: 'scrm.api.shopmall.livebroadcast.report',
...data,
...obj
})
},
}