编辑推荐: |
本文来自于简书,文章介绍了微信用户获取和更新用户个人信息,接口所用的请求方式和参数等相关内容。 |
|
微信用户登录
请求URL:
./public/wxAppUserCodeComes
请求方式:
POST
参数:
返回示例
{ "code":"OK",
"data":{ "token": 'IamTokenFromWxAPPAPI',
"user_info": { "wx_app_open_id":
"IamOpenId", "wx_app_session_key":
"12154545"
}
}
} |
返回参数说明
备注
公众号尚未被用户授权时,user_info中nick_name,province等信息暂无,前端调用wx.getUserInfo获取raw_data,session_key用于encryptedData解密;
系统目前open_id和系统账号只是绑定关联,没有绝对依赖,可以暂不考虑wx.checkSession;
微信用户更新微信用户信息接口(用户授权后)
请求URL:
./public/updateWxUserInfo
请求方式:
POST
参数:
返回示例
{ "code":"OK",
"data":{ "done": true
}
} |
返回参数说明
高校推荐模块
获取高校信息列表
请求URL:
./public/HomeController/universityList
请求方式:
POST
参数:
返回示例
{ "code":
"OK", "data": { "list":
[
{ "university_id": 1, "university_name":
"Harvard", "badge": "jss292424.png",
"image": "bsdihdjaass.png",
"rank": 1, "status": "NORMAL",
"desc": "Philadelphia University
is located in Philadelphia, Pennsylvania, USA.
In 1884, the Philadelphia Philology School",
"address": "Philadelphia, Pennsylvania,
USA"
},
{ "university_id": 2, "university_name":
"William and Mary College", "badge":
"jss26524.png", "image":
"bsdihd455ss.png", "rank":
2, "status": "NORMAL",
"desc": "Founded in 1693, the William
and Mary College, also known as the William and
Mary College, is the second oldest institution
of higher education in the nation with a history
just behind Harvard University founded in 1636",
"address": "Virginia, United States"
},
]
} |
获取某高校详情
请求URL:
./public/HomeController/universityItem
请求方式:
POST
参数:
返回示例
{ "code":
"OK", "data": { "universityItem":
{ "university_id": 1, "university_name":
"Harvard", "badge": "jss292424.png",
"image": "bsdihdjaass.png",
"rank": 1, "status": "NORMAL",
"desc": "Philadelphia University
is located in Philadelphia, Pennsylvania, USA.
In 1884, the Philadelphia Philology School",
"address": "Philadelphia, Pennsylvania,
USA"
}
} |
搜索高校
请求URL:
./public/HomeController/search
请求方式:
POST
参数:
返回示例
{ "code":
"OK", "data": { "list":
[
{ "university_id": 1, "university_name":
"Harvard", "badge": "jss292424.png",
"image": "bsdihdjaass.png",
"rank": 1, "status": "NORMAL",
"desc": "Philadelphia University
is located in Philadelphia, Pennsylvania, USA.
In 1884, the Philadelphia Philology School",
"address": "Philadelphia, Pennsylvania,
USA"
}
]
} |
评估模块
当用户符合评估条件时,小程序获取用户个人信息,若在返回信息中获取不到用户邮箱(这里只是用来做判断)则要求用户填写详细信息,上传用户详细个人信息,若用户上传成功则提示用户可下单,当用户点击下单则创建订单,当用户点击支付确定取消或者则记录订单支付结果。
获取用户个人信息
请求URL:
./public/UserController/getUserInfo
请求方式:
POST
参数:
返回示例
{ "code":
"OK", "data": { "user_info":
{ "open_id": "olx8H0UHfk3RrzTe4ofZBWzl8J-0",
"nick_name": "小样儿960",
"user_name": "刘小倪", "avatar_url":
"https://wx.qlogo.cn/mmopen/vi_32/wUMSLGCic1FOh TM5yV1Nw3S7txib7v0Fp0TPogtegNUeqvKS9t0OFxRiaqo27K gxtwReJmicUkeHl3FX2fxVVuZwmA/0",
"gender": 2, "city": "Hangzhou",
"province": "Zhejiang",
"country": "China", "language":
"zh_CN", "status": "NORMAL",
"mobile": "13588235393",
"email": "xiaoni960@163.com",
"university": "杭州电子科技大学",
"subject": "数字媒体技术", "degree":
"本科",
}
}
} |
更新用户个人信息
请求URL:
./public/updateWxUserInfo
请求方式:
POST
参数:
返回示例
{ "code":"OK",
"data":{ "done": true
}
} |
创建订单
请求URL:
./OrderController/placeOrder
请求方式:
POST
参数:
返回示例
{ "code":
"OK", "data": { "order_info":
{ "order_id": 2, "order_sn":
"18021250445844", "open_id":
"olx8H0Tx0rlev97sa2bCIOQcWVKo",
"status": "INIT", "payment":
"200.00", "order_time":
"2018-02-05 10:31:42", "pay_time":
null, "publication": 200, "citation":
200, "review": 100, "immigration_type":
"EB1A", "user_info":{
"open_id": "olx8H0UHfk3RrzTe4ofZBWzl8J-0",
"nick_name": "小样儿960",
"user_name": "刘小倪", "avatar_url":
"https://wx.qlogo.cn/mmopen/vi_32/wUMSL GCic1FOhTM5yV1Nw3S7txib7v0Fp0TPogtegNUeqvKS9t0OFxR iaqo27KgxtwReJmicUkeHl3FX2fxVVuZwmA/0",
"gender": 2, "city": "Hangzhou",
"province": "Zhejiang",
"country": "China", "language":
"zh_CN", "status": "NORMAL",
"mobile": "13588235393",
"email": "xiaoni960@163.com",
"university": "杭州电子科技大学",
"subject": "数字媒体技术", "degree":
"本科",
}
}
}
} |
记录支付结果
请求URL:
./OrderController/recordOrder
请求方式:
POST
参数:
返回示例
{ "code":"OK",
"data":{ "done": true
}
} |
status为订单状态,分为INIT(待付款),PAID(已付款),SERVED(已服务),CANCELLED(已取消)。
注:只要订单的状态为已付款则系统将把订单信息发送至管理员邮箱
个人中心模块
获取订单列表
请求URL:
./OrderController/getOrderList
请求方式:
POST
参数:
返回示例
{ "code":
"OK", "data": { "order_list":
[
{ "order_id": 1, "order_sn":
"18021250445844", "open_id":
"olx8H0Tx0rlev97sa2bCIOQcWVKo",
"status": "INIT", "payment":
"200.00", "order_time":
"2018-02-05 10:31:42", "pay_time":
null, "publication": 200, "citation":
200, "review": 100, "immigration_type":
"EB1A", "user_info":{
"open_id": "olx8H0UHfk3RrzTe4ofZBWzl8J-0",
"nick_name": "小样儿960",
"user_name": "刘小倪", "avatar_url":
"https://wx.qlogo.cn/mmopen/vi_32/wUMS LGCic1FOhTM5yV1Nw3S7txib7v0Fp0TPogtegNUeqvKS9t0O FxRiaqo27KgxtwReJmicUkeHl3FX2fxVVuZwmA/0",
"gender": 2, "city": "Hangzhou",
"province": "Zhejiang",
"country": "China", "language":
"zh_CN", "status": "NORMAL",
"mobile": "13588235393",
"email": "xiaoni960@163.com",
"university": "杭州电子科技大学",
"subject": "数字媒体技术", "degree":
"本科",
}
},
{ "order_id": 2, "order_sn":
"18021250445844", "open_id":
"olx8H0Tx0rlev97sa2bCIOQcWVKo",
"status": "INIT", "payment":
"200.00", "order_time":
"2018-02-05 10:31:42", "pay_time":
null, "publication": 200, "citation":
200, "review": 100, "immigration_type":
"EB1A", "user_info":{
"open_id": "olx8H0UHfk3RrzTe4ofZBWzl8J-0",
"nick_name": "小样儿960",
"user_name": "刘小倪", "avatar_url":
"https://wx.qlogo.cn/mmopen/vi_32/wUMSLGCic 1FOhTM5yV1Nw3S7txib7v0Fp0TPogtegNUeqvKS9t0OFxRiaqo27K gxtwReJmicUkeHl3FX2fxVVuZwmA/0",
"gender": 2, "city": "Hangzhou",
"province": "Zhejiang",
"country": "China", "language":
"zh_CN", "status": "NORMAL",
"mobile": "13588235393",
"email": "xiaoni960@163.com",
"university": "杭州电子科技大学",
"subject": "数字媒体技术", "degree":
"本科",
}
}
]
}
} |
|