# 开启或关闭评价器 useEvaluator
● 接口函数
zwexplorer.Evaluator.useEvaluator
● 接口说明
开启或关闭评价器
可以通过政务浏览器侧边栏或菜单栏开启或关闭(此方法开启时为使用配置项内的地址进行打开)
可以通过传入参数实现自定义打开
当评价器窗口时打开时再调用次窗口将关闭评价器
● Typescript 类型参考
type ResBody = {
resultCode: number, resultMessage: string, data: {}
}
type ReqBody = {
evaluationUrl?:string,
isFullscreen?:boolean,
bounds?:{
width: number,
height: number,
x?: number,
y?: number,
}
}
zwexplorer.Evaluator.useEvaluator(data: ReqBody, callback?: (res: ResBody)=>void): Promise<ResBody>
● 参数说明
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
data.evaluationUrl | String | 否 | 评价页面地址(不传入地址时将使用默认评价器界面) |
data.isFullscreen | Boolean | 否 | 是否全屏并置顶 |
data.bounds | Object | 否 | 窗口位置(不传入时通过配置页面中设定的屏幕打开) |
data.bounds.width | Number | 是 | 窗口位置(宽)(传入bounds为必填) |
data.bounds.height | Number | 是 | 窗口位置(高)(传入bounds为必填) |
data.bounds.x | Number | 否 | 窗口位置(x轴)(不传入x,y时通过配置页面中设定的屏幕居中显示) |
data.bounds.y | Number | 否 | 窗口位置(y轴) |
● 返回数据
参数 | 类型 | 必然存在 | 说明 |
---|---|---|---|
res.resultCode | Number | 是 | 状态码,0 为正常,其它为异常 [状态码参考] |
res.data | Object | 否 | 接口返回的详细数据 |
res.resultMessage | String | 否 | 接口消息 |
● 示例
zwexplorer.Evaluator.useEvaluator(data,(res)=>{
// 返回数据
})
# 关闭评价器 endEvaluator
● 接口函数
zwexplorer.Evaluator.endEvaluator
● 接口说明
关闭评价器
● Typescript 类型参考
type ResBody = {
resultCode: number, resultMessage: string, data: {}
}
zwexplorer.Evaluator.endEvaluator(data?: {}, callback?: (res: ResBody)=>void): Promise<ResBody>
● 返回数据
参数 | 类型 | 必然存在 | 说明 |
---|---|---|---|
res.resultCode | Number | 是 | 状态码,0 为正常,其它为异常 [状态码参考] |
res.data | Object | 否 | 接口返回的详细数据 |
res.resultMessage | String | 否 | 接口消息 |
● 示例
zwexplorer.Evaluator.endEvaluator({},(res)=>{
// 返回数据
})
# 获取评价分数 getScore
● 接口函数
zwexplorer.Evaluator.getScore
● 接口说明
使用默认评价器时获取评价分数,在完成评价15s内完成获取,15s后评价分数将过期
● Typescript 类型参考
type ResBody = {
resultCode: number, resultMessage: string, data: {
score: number | null
}
}
zwexplorer.Evaluator.getScore(data?: {}, callback?: (res: ResBody)=>void): Promise<ResBody>
● 返回数据
参数 | 类型 | 必然存在 | 说明 |
---|---|---|---|
res.resultCode | Number | 是 | 状态码,0 为正常,其它为异常 [状态码参考] |
res.data | Object | 否 | 状态码为 0 时,返回评分信息 |
res.resultMessage | String | 否 | 接口消息 |
res.data.score | Number | 否 | 正确返回时获得评分成绩 |
● 示例
zwexplorer.Evaluator.getScore({},(res)=>{
// 返回数据
})