add file
This commit is contained in:
@@ -0,0 +1,440 @@
|
||||
import { HTTP } from './request'
|
||||
|
||||
class API extends HTTP {
|
||||
getStaticHost(){
|
||||
return `${this.staticHost}`;
|
||||
}
|
||||
//获取oss签名数据
|
||||
getOssSign(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/oss/sign`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取省份信息
|
||||
getAreaProvince(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/area/province`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
showLoading: false
|
||||
})
|
||||
}
|
||||
//获取城市信息
|
||||
getAreaCity(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/area/city`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
showLoading: false
|
||||
})
|
||||
}
|
||||
//获取区县信息
|
||||
getAreaCounty(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/area/county`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
showLoading: false
|
||||
})
|
||||
}
|
||||
//获取医院数据
|
||||
getBasicHospital(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/basic/hospital`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
showLoading: false
|
||||
})
|
||||
}
|
||||
//获取自定义科室数据
|
||||
getBasicDepartment(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/basic/department`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
showLoading: false
|
||||
})
|
||||
}
|
||||
//获取医生专长列表
|
||||
getDoctorExpertise(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/info/expertise`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
showLoading: false
|
||||
})
|
||||
}
|
||||
//使用微信手机号登陆
|
||||
wechatMobileLogin(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/login/wechat_mobile_login`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//医师端首页
|
||||
yiShiIndex(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/index`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取实名认证信息
|
||||
getDoctorAuthReal(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/auth/real`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//新增实名认证信息
|
||||
postDoctorAuthReal(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/auth/real`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取身份认证信息
|
||||
getDoctorAuthIden(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/auth/iden`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
showLoading: false
|
||||
})
|
||||
}
|
||||
//新增/修改身份认证信息
|
||||
postDoctorAuthIden(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/auth/iden`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
contentType: 'application/json'
|
||||
})
|
||||
}
|
||||
//获取多点执业认证信息
|
||||
getDoctorAuthMulti(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/auth/multi`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//新增多点执业认证信息
|
||||
postDoctorAuthMulti(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/auth/multi`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//手机号登陆
|
||||
mobileLogin(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/login/mobile_login`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取手机号验证码
|
||||
getCodePhone(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/code/phone`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取个人中心数据
|
||||
getDoctorCenter(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/center`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取银行卡列表
|
||||
getDoctorBank(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/bank`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//绑定医生银行卡
|
||||
postDoctorBank(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/bank`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//更换医生银行卡
|
||||
putDoctorBank(params) {
|
||||
let bank_card_id = params.bank_card_id;
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/bank/`+bank_card_id,
|
||||
method: 'PUT',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取我的账户日账单明细数据
|
||||
getDoctorAccountInfo(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/account/info`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取提现数据
|
||||
getDoctorWithdrawal(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/withdrawal`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//可提现问诊订单列表
|
||||
getDoctorWithdrawalOrder(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/withdrawal/order`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取医生提现记录列表
|
||||
getDoctorWithdrawalRecord(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/withdrawal/record`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取医生我的账户数据
|
||||
getDoctorCenterAccount(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/account`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取个人中心数据
|
||||
getDoctorCenter(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/center`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取银行列表
|
||||
getBasicBank(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/basic/bank`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取医生信息
|
||||
getDoctorCenterInfo(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/center/info`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取医生证书信息
|
||||
getDoctorCret(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/info/cret`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取获取医生评价
|
||||
getDoctorEvaluation(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/evaluation`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取医生问诊配置
|
||||
getDoctorInquiryConfig(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/inquiry/config`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//医生问诊开关
|
||||
putDoctorInquiryOpen(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/inquiry/open`,
|
||||
method: 'PUT',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//修改医生问诊配置
|
||||
putDoctorInquiryConfig(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/inquiry/config`,
|
||||
method: 'PUT',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取处方列表
|
||||
getDoctorPrescription(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/prescription`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取操作手册列表
|
||||
getBasicOperationManual(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/basic/operation/manual`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取操作手册详情
|
||||
getBasicOperationManualID(params) {
|
||||
let manual_id = params.manual_id;
|
||||
params = {};
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/basic/operation/manual/`+manual_id,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取常用语列表
|
||||
getDoctorWords(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/words`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//新增常用语列表
|
||||
postDoctorWords(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/words`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//搜索疾病分类-系统
|
||||
getBasicDiseaseSearch(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/basic/disease/search`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//搜索药品
|
||||
getBasicProductSearch(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/basic/product/search`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取医生名片
|
||||
getDoctorInfoCard(params) {
|
||||
return this.request({
|
||||
url: `${this.baseUrl}/doctor/info/card`,
|
||||
method: 'GET',
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export { API }
|
||||
@@ -0,0 +1,19 @@
|
||||
// 开发环境url
|
||||
export const dev = {
|
||||
baseUrl: "https://dev.hospital.applets.igandanyiyuan.com",
|
||||
staticHost: "https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com",//静态资源host
|
||||
appId: 'wxbdb4d63f81d98228' //此处为appId
|
||||
}
|
||||
// 测试环境url
|
||||
export const test = {
|
||||
baseUrl: "http://www.xxx.com",
|
||||
staticHost: "https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com",//静态资源host
|
||||
appId: 'wxbdb4d63f81d98228' //此处为appId
|
||||
}
|
||||
|
||||
// 线上环境url
|
||||
export const prod = {
|
||||
baseUrl: 'https://www.xxx.com',
|
||||
staticHost: "https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com",//静态资源host
|
||||
appId: 'wxbdb4d63f81d98228' //此处为appId
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
const env = require('./config').dev
|
||||
|
||||
class HTTP {
|
||||
constructor() {
|
||||
this.baseUrl = env.baseUrl,
|
||||
this.staticHost = env.staticHost,
|
||||
this.appId = env.appId
|
||||
}
|
||||
|
||||
request({
|
||||
url,
|
||||
data = {},
|
||||
method = 'GET',
|
||||
contentType = 'application/x-www-form-urlencoded',
|
||||
showLoading = true
|
||||
}){
|
||||
return new Promise((resolve, reject) => {
|
||||
this._request(url, resolve, reject, data, method, contentType, showLoading)
|
||||
})
|
||||
}
|
||||
|
||||
_request(url, resolve, reject, data = {}, method = 'GET', contentType = 'application/x-www-form-urlencoded', showLoading = true) {
|
||||
if(showLoading) wx.showLoading();
|
||||
wx.request({
|
||||
url: url,
|
||||
method: method,
|
||||
data: data,
|
||||
header: {
|
||||
'content-type': contentType,
|
||||
'appId': this.appId,
|
||||
'Authorization': "Bearer " + wx.getStorageSync('AUTH_TOKEN')
|
||||
},
|
||||
success: (res) => {
|
||||
console.log("header Authorization: ", res.header.Authorization);
|
||||
var Authorization_token = res.header.Authorization;
|
||||
if(Authorization_token){
|
||||
wx.setStorageSync('AUTH_TOKEN', Authorization_token);//当token快过期时,服务器会返回新token,本地刷新
|
||||
}
|
||||
if (res.data) {
|
||||
const code = res.data.code;
|
||||
if (code == 200) {
|
||||
resolve(res.data)
|
||||
} else if(code == 401 || code == 403 || code == 405 || code == 406){
|
||||
wx.navigateTo({
|
||||
url: "/Pages/index/index"
|
||||
})
|
||||
} else {
|
||||
reject(res.data.message)
|
||||
this._show_error(res.data.message)
|
||||
}
|
||||
} else {
|
||||
resolve(res.data)
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
reject()
|
||||
this._show_error(err.data.message)
|
||||
},
|
||||
complete: () => {
|
||||
if(showLoading) wx.hideLoading();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
_show_error(_message) {
|
||||
wx.showToast({
|
||||
title: `${_message}`,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
HTTP
|
||||
}
|
||||
Reference in New Issue
Block a user