|
@@ -39,13 +39,13 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
|
|
|
typeof adpId !== 'string' ||
|
|
|
typeof onEmitOpenMiniProgram !== 'function'
|
|
|
) {
|
|
|
- catchError('参数错误', 1031)
|
|
|
+ catchError('参数错误', 1031, '用户必传参数没传')
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function getAdConfig() {
|
|
|
- http.post(`${adSelfPredict}?adpId=uh2321awe1`, {
|
|
|
+ http.post(`${adSelfPredict}?adpId=${adpId}`, {
|
|
|
baseInfo: {},
|
|
|
positionId: 1,
|
|
|
phoneModel : '',
|
|
@@ -54,19 +54,19 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
|
|
|
}, {
|
|
|
header: { 'content-type': 'application/json;' }
|
|
|
}).then((res: RequestType) => {
|
|
|
- const { code, data } = res
|
|
|
- if(code === 10001) {
|
|
|
- catchError('广告资源加载失败', 1022)
|
|
|
+ const { code, data, msg } = res
|
|
|
+ if(code === 1001) {
|
|
|
+ catchError('广告资源加载失败', 1022, msg)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if(code === 10002) {
|
|
|
- catchError('adpId 无效', 1021)
|
|
|
+ if(code === 1002) {
|
|
|
+ catchError('adpId 无效', 1021, msg)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if(code === 10003) {
|
|
|
- catchError('初始化失败', 1011)
|
|
|
+ if(code === 1003) {
|
|
|
+ catchError('初始化失败', 1011, msg)
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -75,7 +75,7 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
|
|
|
const { landingPageAddress } = platformCreativeInfo || {}
|
|
|
|
|
|
if (!landingPageAddress) {
|
|
|
- catchError('数据异常', 1013)
|
|
|
+ catchError('数据异常', 1013, '无landingPageAddress')
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -84,8 +84,7 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
|
|
|
...platformCreativeInfo
|
|
|
})
|
|
|
}).catch((e) => {
|
|
|
- console.log(e)
|
|
|
- catchError('初始化失败', 1011)
|
|
|
+ catchError('初始化失败', 1011, e.message)
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -121,7 +120,7 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
|
|
|
}
|
|
|
|
|
|
function videoError() {
|
|
|
- catchError('广告加载失败', 1012)
|
|
|
+ catchError('广告加载失败', 1012, '素材播放视频')
|
|
|
}
|
|
|
|
|
|
function videoView() {
|
|
@@ -189,12 +188,13 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function catchError(message, code) {
|
|
|
+ function catchError(message, code, errMessage) {
|
|
|
onError(code)
|
|
|
setShow(false)
|
|
|
adActionReport(reportBusinessType.adError, 'adError', {
|
|
|
errorCode: code,
|
|
|
- message
|
|
|
+ message,
|
|
|
+ errMessage
|
|
|
})
|
|
|
}
|
|
|
|