# 获取电子卡卡面信息
# 请求方法:
POST(application/json)
# 请求地址:
https://open.wecard.qq.com/cgi-bin/campus/cardface-list?access_token=access_token
# 参数说明:
参数 | 必填 | 说明 |
---|---|---|
access_token | 是 | 获取应用有效凭证 (opens new window) |
# 响应说明:
{
"errcode": 0,
"errmsg": "OK",
"mnp": [
{
"name": "卡面1",
"cardface_configure": {
"global": {
"height": 600,
"width": 1000,
"color": "#ffffff",
"background": "https://ty-public-1251448646.file.myqcloud.com/cardface/qu683661wxg8oxd6bdweca82e08a37ef1300cd34361df3407ee8.png"
},
"info": [
{
"index": "name",
"name": "姓名",
"value": "张三",
"type": "text",
"left": 60,
"top": 234,
"xAlign": "left",
"yAlign": "top",
"fontSize": 30,
"fontWeight": "bold",
"display": true
},
{
"index": "card_number",
"name": "电子卡号",
"value": "zhangsan",
"type": "text",
"left": 60,
"top": 270,
"xAlign": "left",
"yAlign": "top",
"fontSize": 30,
"fontWeight": "normal",
"display": true
},
{
"index": "organization",
"name": "部门",
"value": "党支部分组",
"type": "text",
"left": 60,
"top": 458,
"xAlign": "left",
"yAlign": "top",
"fontSize": 30,
"fontWeight": "normal",
"display": true
},
{
"index": "head_image",
"name": "头像",
"value": "https://static-1251448646.file.myqcloud.com/uni/mnp/template-card-avatar.png",
"type": "image",
"left": 1028,
"top": 0,
"xAlign": "right",
"yAlign": "top",
"height": 600,
"width": 600,
"radius": 2,
"display": true
},
{
"index": "profession",
"name": "专业",
"value": "计算数学",
"type": "text",
"display": true,
"left": 60,
"top": 410,
"xAlign": "left",
"yAlign": "top",
"fontSize": 30,
"fontWeight": "normal"
},
{
"index": "grade",
"name": "年级",
"value": "2019级",
"type": "text",
"display": true,
"left": 60,
"top": 322,
"xAlign": "left",
"yAlign": "top",
"fontSize": 30,
"fontWeight": "normal"
},
{
"index": "job_title",
"name": "职务",
"value": "助理",
"type": "text",
"display": true,
"left": 60,
"top": 366,
"xAlign": "left",
"yAlign": "top",
"fontSize": 30,
"fontWeight": "normal"
},
{
"index": "serial_number",
"name": "编号",
"value": "123456",
"type": "text",
"display": true,
"left": 60,
"top": 504,
"xAlign": "left",
"yAlign": "top",
"fontSize": 30,
"fontWeight": "normal"
},
{
"index": "valid_text",
"name": "有效期",
"value": "有效期:永久有效",
"type": "text",
"display": true,
"left": 60,
"top": 540,
"xAlign": "left",
"yAlign": "top",
"fontSize": 30,
"fontWeight": "normal"
}
]
}
},
{
"name": "卡面2",
"cardface_configure": {
"global": {
"height": 600,
"width": 1000,
"color": "#ffffff",
"background": "https://ty-public-1251448646.file.myqcloud.com/cardface/qqkc7t7l7yt3r4kkc10195c52b42a6e368eb449d1fc8896d6f0.png"
},
"info": [
{
"index": "name",
"name": "姓名",
"value": "李四",
"type": "text",
"left": 940,
"top": 300,
"xAlign": "right",
"yAlign": "top",
"fontSize": 48,
"fontWeight": "bold",
"display": true
},
{
"index": "organization",
"name": "部门",
"value": "党支部分组",
"type": "text",
"left": 940,
"top": 420,
"xAlign": "right",
"yAlign": "top",
"fontSize": 30,
"fontWeight": "normal",
"display": true
},
{
"index": "head_image",
"name": "头像",
"value": "https://static-1251448646.file.myqcloud.com/uni/mnp/template-card-avatar.png",
"type": "image",
"left": 940,
"top": 280,
"xAlign": "right",
"yAlign": "bottom",
"height": 180,
"width": 180,
"radius": 20,
"display": true
},
{
"index": "job_title",
"name": "职务",
"value": "助理",
"type": "text",
"display": true,
"left": 940,
"top": 370,
"xAlign": "right",
"yAlign": "top",
"fontSize": 30,
"fontWeight": "normal"
},
{
"index": "serial_number",
"name": "编号",
"value": "123456",
"type": "text",
"display": true,
"left": 940,
"top": 470,
"xAlign": "right",
"yAlign": "top",
"fontSize": 30,
"fontWeight": "normal"
}
]
}
}
]
}
参数 | 说明 |
---|---|
errcode | 错误码 |
errmsg | 错误信息 |
mnp | 小程序电子卡卡面信息 |
name | 电子卡名称 |
cardface_configure | 卡面配置信息 |
global | 卡面全局信息 |
global.height | 卡面高度 |
global.width | 卡面宽度 |
global.color | 卡面颜色 |
global.background | 卡面背景 |
info | 卡面信息项明细 |
info.index | 用户信息对应字段,包括 name:姓名/card_number:电子卡号/学工号/organization:部门/head_image:头像/college:学院/profession:专业/grade:年级/class:班级/job_title:职务/serial_number:编号/valid_text:有效期/identity_type:身份/gender:性别 |
info.name | 用户信息对应字段名称 |
info.value | 用户信息对应字段值 |
info.type | 信息类型:text/image,分别代表文本/图片 |
info.left | 距离左侧距离 可以理解为横坐标 |
info.top | 距离顶部距离 可以理解为纵坐标 |
info.xAlign | 水平对齐方式,包括left/middle/right,分别表示左对齐/居中/右对齐 |
info.yAlign | 竖直对齐方式,包括top/middle/bottom,分别表示上对齐/居中/下对齐 |
info.fontSize | 字体大小,单位为像素(px),type为text时返回 |
info.fontWeight | 字重,包括 normal/bold,对应 正常/加粗 ,type为text时返回 |
info.height | 高度,type为image时返回,表示图片的高度 |
info.width | 宽度,type为image时返回,表示图片的宽度 |
info.radius | 圆角半径,type为image时返回,表示图片的圆角半径 |
info.display | 信息项是否展示,接口已过滤不展示的信息项返回的都是需展示项 |