244 lines
6.7 KiB
JavaScript
244 lines
6.7 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
|
|
})
|
|
},
|
|
getloginOut(param) { // 退出登录
|
|
return http.post("/user_quit_account", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getRegisterPhone(param) { // 手机号快捷登录
|
|
return http.post("/kitchenscale2/wechat_quick_login", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getResetPassword(param) { // 重置密码
|
|
return http.post("/kitchenscale2/reset_password", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getAccountPassword(param) { // 修改密码
|
|
return http.post("/kitchenscale2/update_my_password", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getAccountMsg(param) { // 邮箱/手机号绑定
|
|
return http.post("/kitchenscale2/update_my_account_msg", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
|
|
// 首页
|
|
getHomeInfo(param) { // 默认数据
|
|
return http.post("/kitchenscale2/get_homepage_information", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getHomeUserInfo(param) { // 用户信息
|
|
return http.post("/kitchenscale2/get_user_msg", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getHomeConfig(param) { // 配置
|
|
return http.post("/kitchenscale2/get_default_config", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getHomeSearch(param) { // 首页搜索
|
|
return http.post("/kitchenscale2/search_column", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getUserInfoEdit(param) { // 修改用户信息
|
|
return http.post("/kitchenscale2/update_user_msg", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getSearchPopularFood(param) { //获取搜索页面常用食材
|
|
return http.post("/kitchenscale2/get_search_food_page_list", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getFoodSearch(param) { //搜索食材
|
|
return http.post("/kitchenscale2/get_food_list", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getMenuSearch(param) { //搜索菜谱
|
|
return http.post("/find_by_food", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getMenuSearchColumn(param) { //搜索菜谱2
|
|
return http.post("/kitchenscale2/search_column", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getPhotoSearch(param) { //图像识别
|
|
return http.post("/kitchenscale2/baidu_identify_food", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
|
|
// 通用
|
|
getUploadImg(param) { // 上传素材
|
|
return http.upload("/kitchenscale2/pic_upload_one_action", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
|
|
// 菜谱
|
|
getAddCookbook(param) { // 添加菜谱
|
|
return http.post("/kitchenscale2/add_cookbook", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getEditCookbook(param) { // 修改菜谱
|
|
return http.post("/kitchenscale2/update_cookbook", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getCookListLabel(param) { // 菜谱查询(根据菜谱标签拉取)
|
|
return http.post("/kitchenscale2/find_by_cook_label", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getCookListFood(param) { // 菜谱列表(根据食材名称拉取)
|
|
return http.post("/kitchenscale2/find_by_food", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getCookListDetails(param) { // 查询菜谱详情
|
|
return http.post("/kitchenscale2/cookbook_details", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getCookFollow(param) { // 关注行为
|
|
return http.post("/kitchenscale2/cookbook_follow", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getCookLike(param) { // 点赞收藏菜谱
|
|
return http.post("/kitchenscale2/cookbook_like", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getCookKcal(param) { // 食材卡路里计算
|
|
return http.post("/kitchenscale2/food_count_kcal", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
// 食材
|
|
getCookFoodList(param) { // 食材列表
|
|
return http.post("/kitchenscale2/get_food_list", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getCookListSave(param) { // 食材列表查询
|
|
return http.post("/kitchenscale2/save_food_list", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
// 计食器
|
|
getAddIntakeFood(param) { // 添加每日摄入记录
|
|
return http.post("/kitchenscale2/add_intake_food", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getCountfootCon(param) { // 每日记食器板块详细内容
|
|
return http.post("/kitchenscale2/get_countfoot_content", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
delCEatAction(param) { // 删除餐饮食物
|
|
return http.post("/kitchenscale2/del_user_eat_log", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getLogList(param) { // 记食器角色饮食记录列表
|
|
return http.post("/kitchenscale2/get_log_list", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getSetUpContent(param) { // 计食器板块-设置里的内容
|
|
return http.post("/kitchenscale2/set_up_content", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getSetUserKcal(param) { // 设置用户的卡路里
|
|
return http.post("/kitchenscale2/set_user_kcal", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
// 个人中心
|
|
getUserCollectList(param) { // 用户收藏点赞列表
|
|
return http.post("/kitchenscale2/get_user_collect_list", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getMyCookbook(param) { // 我的菜谱
|
|
return http.post("/kitchenscale2/get_my_cookbook", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getMyCookbookDel(param) { // 删除我的菜谱
|
|
return http.post("/kitchenscale2/del_my_cookbook", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getMyLogList(param) { // 饮食列表
|
|
return http.post("/kitchenscale2/get_log_list", param).then(res => {
|
|
let pkList = {
|
|
list: [],
|
|
Dlist: []
|
|
}
|
|
if (res.code == 0) {
|
|
for (var i = 0; i < res.data.content_list.length; i++) {
|
|
pkList.list.push(res.data.content_list[i])
|
|
if (!pkList.Dlist.includes(res.data.content_list[i].time)) { //includes 检测数组是否有某个值
|
|
pkList.Dlist.push(res.data.content_list[i].time);
|
|
}
|
|
}
|
|
}
|
|
res.data.pkList = pkList
|
|
return res.data
|
|
})
|
|
},
|
|
// 计食器
|
|
getAddIntakeFood(param) { // 添加每日摄入记录
|
|
return http.post("/kitchenscale2/add_intake_food", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getCountFoodInfo(param) { // 获取记食器板块详细内容
|
|
return http.post("/kitchenscale2/get_countfoot_content", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getCountSetKcal(param) { // 获取记食器设置里的内容
|
|
return http.post("/kitchenscale2/set_up_content", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
getCountSetUserKcal(param) { // 获取记食器设置里的内容
|
|
return http.post("/kitchenscale2/set_user_kcal", param).then(res => {
|
|
return res
|
|
})
|
|
},
|
|
} |