detail.js
2.78 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
import api from '../../common/api';
import config from '../../common/config';
import Yas from '../../common/yas';
export default {
/**
* 商品信息
* @param skn
* @returns {*}
*/
productInfo(uid, limitProductCode) {
let data = {
method: 'app.limitProduct.limitProductDetail'
};
if (uid) {
data.uid = uid;
}
data.limitProductCode = limitProductCode;
return api.get({
url: '',
data
});
},
/**
* 查询助力信息
*
* @param {*} uid
* @param {*} limitCode
* @returns
*/
getAssistInfo(uid, limitCode) {
return api.get({
url: '',
data: {
userId: uid,
limitProductCode: limitCode,
method: 'app.limitProduct.queryHelpInfo'
}
});
},
/**
* 增加助力
*
* @param {*} params
* @returns
*/
addAssist({userId, helpUserId, helpUserName, helpUserImgUrl, limitProductCode}) {
return api.get({
url: '',
data: {
method: 'app.limitProduct.addHelpUserInfo',
userId,
helpUserId,
helpUserName,
helpUserImgUrl,
limitProductCode
}
});
},
addQueue(userId, activityId, unionId) {
return api.post({
url: '',
data: {
method: 'app.drawline.addQueueForHelp',
userId,
activityId,
openId: unionId
}
});
},
/**
* 分享过该商品,记录一下
* @param {} uid
* @param {*} limitProductCode
*/
addShareAction(userId, limitProductCode) {
return api.post({
url: '',
data: {
method: 'app.limitProduct.addShareInfo',
userId,
limitProductCode,
isShare: 'Y'
}
});
},
/**
* 发限购码
* @param {*} uid
* @param {*} limitProductCode
*/
getLimitCode(userId, limitProductCode) {
return api.post({
url: '',
data: {
method: 'app.limitcode.addForHelp',
userId,
limitProductCode
}
});
},
getUserInfoByUnionId(name, unionId) {
return api.get({
url: '',
data: {
nickname: name,
openId: unionId,
source_type: 'wechat',
method: 'app.passport.signinByOpenID'
}
});
},
getParamsFromAppCode(code) {
return api.get({
url: '/wechat/miniapp/getMiniAppRealParam',
data: {
md5Param: code,
miniapp_type: config.mini_app_type
}
}).then(result => {
if (result.code === 200) {
if (result.data) {
let resultJson = JSON.parse(result.data);
if(resultJson){
let app = getApp();
let yas = new Yas(app);
yas.report('YB_SHARE_UNION_TYPE', resultJson);
}
return resultJson;
}
}
}).catch(e => {
console.log('error', e);
});
}
};