猫妈狗爸伴宠师小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

115 lines
2.1 KiB

import request from '@/utils/request'
export const getLicenseList = () => {
return request({
url: '/applet/examination/licenseList',
method: "get"
}).then(res => {
return res.data
})
}
export const getPetTypeList = () => {
return request({
url: '/applet/examination/petTypeList',
method: "get"
}).then(res => {
return res.data
})
}
export const getServiceList = (params) => {
return request({
url: '/applet/config/serviceList',
method: "get",
params
}).then(res => {
return res.data?.map?.(item => {
const { id, title, video } = item
return { id, title, video }
}) || []
})
}
export const getTrainList = (params) => {
return request({
url: '/applet/config/trainList',
method: "get",
params
}).then(res => {
return res.data?.map?.(item => {
const { id, title, content } = item
return { id, title, content }
}) || []
})
}
export const getQuestionList = (params) => {
return request({
url: '/applet/examination/questionList',
method: "get",
params
}).then(res => {
return res.data
})
}
export const getQuestionOptions = (params) => {
return request({
url: '/applet/examination/insertUser',
method: "get",
params
}).then(res => {
return res.data
})
}
export const addBaseAnswer = (data) => {
return request({
url: '/applet/examination/addBaseAnswer',
headers: {
isToken: true
},
method: 'post',
data
})
}
export const answeBaseByQuestionId = (params) => {
return request({
url: '/applet/examination/answeBaseByQuestionId',
headers: {
isToken: true
},
method: "get",
params
}).then(res => {
return res.data?.[0] || {}
})
}
export const addTrainAnswer = (data) => {
return request({
url: '/applet/examination/addTrainAnswer',
headers: {
isToken: true
},
method: 'post',
data
})
}
export const answeTrainByQuestionId = (params) => {
return request({
url: '/applet/examination/answeTrainByQuestionId',
headers: {
isToken: true
},
method: "get",
params
}).then(res => {
return res.data?.[0] || {}
})
}