ReedawFoodApp/toolJs/model.js

374 lines
9.4 KiB
JavaScript

import http from './https.js'
import tools from './tools.js'
import store from '@/store'
export default {
// 登录
getonlogin(param) { // 登录
return http.post("/login_action", param).then(res => {
return res
})
},
getSendCode(param) { // 验证码
return http.post("/send_phone_email_code", param).then(res => {
return res
})
},
getregister(param) { // 注册
return http.post("/register_action", param).then(res => {
return res
})
},
getRegisterPhone(param) { // 手机号快捷登录
return http.post("/wechat_quick_login", param).then(res => {
return res
})
},
getdeleteAccount(param) { // 删除用户
return http.post("/delete_account", param).then(res => {
return res
})
},
getResetPassword(param) { // 重置密码
return http.post("/reset_password", param).then(res => {
return res
})
},
getloginOut(param) { // 退出登录
return http.post("/user_quit_account", param).then(res => {
return res
})
},
getloginversion(param) { // 版本检测
return http.post("/login_invalid_version", param).then(res => {
return res
})
},
// 账户信息
getAccountNumber(param) { // 获取账号信息
return http.post("/get_my_account_msg", param).then(res => {
return res
})
},
getAccountPassword(param) { // 修改密码
return http.post("/update_my_password", param).then(res => {
return res
})
},
getAccountNickname(param) { // 修改昵称
return http.post("/update_my_nickname", param).then(res => {
return res
})
},
getAccountMsg(param) { // 邮箱/手机号绑定
return http.post("/update_my_account_msg", param).then(res => {
return res
})
},
// 首页
getUserInfo(param) { // 成员详情
return http.post("/get_user_data_information", param).then(res => {
return res
})
},
getUserList(param) { // 成员列表
return http.post("/get_user_card_list", param).then(res => {
if (res.data.length) {
let options = [{
text: '删除',
style: {
backgroundColor: '#dd524d'
}
}]
res.data.forEach(item => {
item.options = options
})
}
return res
})
},
getDelUser(param) { // 删除成员
return http.post("/del_user_data", param).then(res => {
return res
})
},
getEditUser(param) { // 修改成员资料
return http.post("/update_user_data", param).then(res => {
return res
})
},
getAddUser(param) { // 添加成员
return http.post("/create_user_data", param).then(res => {
return res
})
},
getGradeList(param) { // 获取年级、身份、地区列表
return http.post("/get_grade_list", param).then(res => {
return res
})
},
getCardAllList(param) { // 获取所有卡片
return http.post("/get_card_all_list", param).then(res => {
return res
})
},
getCardAllOrder(param) { // 保存卡片顺序
return http.post("/save_user_card_order", param).then(res => {
return res
})
},
// 身体数据卡片
getfirstweight(param) { //修改初始体重
return http.post("/card_modify_weight", param).then(res => {
return res
})
},
getinsertmeasure(param) { //手动记录
return http.post('/card_manual_recording', param).then(res => {
return res
})
},
getResult(param) { //获取测量报告
return http.post("/card_data_detailed", param).then(res => {
return res
})
},
getTrendList(param) { //趋势
return http.post("/card_curve_chart", param).then(res => {
return res
})
},
getmeasurefunit(param) { //保存测量结果
return http.post("/card_manual_recording_device", param).then(res => {
return res
})
},
// 跳绳
getSkipResult(param) { //获取测量报告
return http.post("/skip_today_data", param).then(res => {
return res
})
},
getskipmeasure(param) { //手动记录
return http.post('/skip_manual_recording', param).then(res => {
return res
})
},
getskipResult(param) { //测量报告
return http.post('/skip_manual_recording_device', param).then(res => {
return res
})
},
getSkipTrendList(param) { //趋势
return http.post("/skip_curve_chart", param).then(res => {
return res
})
},
// 肺活量
getLungResult(param) { //获取测量报告
return http.post("/vitalcapacity_data_report", param).then(res => {
return res
})
},
getLungmeasure(param) { //手动记录
return http.post('/vitalcapacity_save_record_data', param).then(res => {
return res
})
},
getMeasureLung(param) { //添加测量记录
return http.post('/vitalcapacity_save_record_data_device', param).then(res => {
return res
})
},
getLungTrendList(param) { //趋势
return http.post("/vitalcapacity_curve_chart", param).then(res => {
return res
})
},
// 估分
getSportshistory(param) { //历史
return http.post("/sportstesting_get_all_list", param).then(res => {
return res
})
},
getSportshistorydetail(param) { //历史详情
return http.post("/sportstesting_get_one_details", param).then(res => {
return res
})
},
getSportsListAll(param) { //获取地区所有项目列表
return http.post("/sportstesting_get_region_list", param).then(res => {
return res
})
},
getSportsList(param) { //获取单个项目列表
return http.post("/sportstesting_get_type_list", param).then(res => {
return res
})
},
getSportsData(param) { //开始估分
return http.post("/sportstesting_set_once_data", param).then(res => {
return res
})
},
getCityList(param) { //获取地区
return http.post("/sportstesting_get_city_list", param).then(res => {
return res
})
},
// 设备管理
getDeviceList(param) { //获取系统设备列表
return http.post("/device_data_list", param).then(res => {
return res
})
},
getBinding(param) { //绑定系统设备
return http.post("/device_binding", param).then(res => {
return res
})
},
getUserDeviceList(param) { //获取用户设备列表
return http.post("/device_user_data_list", param).then(res => {
return res
})
},
getUnbinding(param) { //解绑系统设备
return http.post("/device_unbinding", param).then(res => {
return res
})
},
getdevdetail(param) { //根据Mac地址获取设备详情
return http.post("/device_mac_get_content", param).then(res => {
return res
})
},
// 公共
gethistory(param) { //历史记录
return http.post("/get_all_record_data_page", param).then(res => {
return res
})
},
gethistorydetail(param) { //历史记录详情
return http.post("/get_all_record_detailed_information", param).then(res => {
return res
})
},
gethistorydelete(param) { //删除历史记录
return http.post("/card_del_record_data", param).then(res => {
return res
})
},
getresultdiff(param) { //记录对比
return http.post("/get_all_record_data_group", param).then(res => {
if (res.code == 0) {
let Dlist = []
for (var i = 0; i < res.data.length; i++) {
if (!Dlist.includes(res.data[i].r_t)) { //includes 检测数组是否有某个值
Dlist.push(res.data[i].r_t);
}
}
res.Dlist = Dlist
console.log("111111", res)
}
return res
})
},
getresultcontrast(param) { //对比详情
return http.post("/get_all_card_data_contrast", param).then(res => {
return res
})
},
// 通用卡片
getPublicRecord(param) { //手动记录内容
return http.post("/obtain_manual_record_content", param).then(res => {
return res
})
},
getpublicmeasure(param) { //手动记录
return http.post("/public_data_save", param).then(res => {
return res
})
},
getpublicContent(param) { //卡片内容详情
return http.post("/get_card_content", param).then(res => {
return res
})
},
getLabelList(param) { //卡片内标签项目信息
return http.post("/get_label_list", param).then(res => {
return res
})
},
getPublicTrendList(param) { //公共曲线
return http.post("/card_motion_curve", param).then(res => {
return res
})
},
getPublicHistory(param) { //公共历史
return http.post("/obtain_history_record", param).then(res => {
return res
})
},
getPublicHistoryDel(param) { //公共历史删除
return http.post("/history_record_del", param).then(res => {
return res
})
},
getPublicResultdiff(param) { //公共对比
return http.post("/data_contrast_obtain_data", param).then(res => {
if (res.code == 0) {
let Dlist = []
for (var i = 0; i < res.data.length; i++) {
if (!Dlist.includes(res.data[i].r_t)) { //includes 检测数组是否有某个值
Dlist.push(res.data[i].r_t);
}
}
res.Dlist = Dlist
}
return res
})
},
// 身高预测
GetPredictheight(param) { //公共历史删除
return http.post("/card_height_prediction", param).then(res => {
return res
})
},
// BMI预测
calcbmi(param) { //公共历史删除
return http.post("/card_bmi_evaluation", param).then(res => {
return res
})
},
// 资讯
getContentMsg(param) { //获取资讯信息
return http.post("/get_sector_content_msg", param).then(res => {
return res
})
},
getContentLabel(param) { //资讯标签类别信息
return http.post("/get_sector_label_msg", param).then(res => {
return res
})
},
getContentLike(param) { //点赞
return http.post("/user_like_it", param).then(res => {
return res
})
},
getContentDetail(param) { //资讯详情
return http.get("/model_content", param).then(res => {
return res
})
},
getBannerList(param) { //banner
return http.post("/get_recommend_information", param).then(res => {
return res
})
},
getCooperationUrl(param) { //合作服务
return http.post("/get_business_cooperation_url", param).then(res => {
return res
})
},
}