提交 ffa57138 编写于 作者: guangjun.yang's avatar guangjun.yang

联调接口等

上级 ef8a9652
...@@ -11,12 +11,13 @@ const service = axios.create({ ...@@ -11,12 +11,13 @@ const service = axios.create({
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
// debugger
if (config.data && config.data.setEntry) { if (config.data && config.data.setEntry) {
config.headers['sysCode'] = config.data.sysCode || 10 config.headers['sysCode'] = config.data.sysCode || 10
if(config.data.token){ if(config.data.token){
config.headers['token'] = config.data.token || '0F32D60C3D7042158BCF1FB574E482BE' config.headers['token'] = config.data.token || '0F32D60C3D7042158BCF1FB574E482BE'
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境 if( process.env.BUILD_ENV == "development" ){ // 本地开发环境
config.headers['token'] = '11B8076631AE45999D350EC08A7E66AE'; config.headers['token'] = 'A92C95FD752C413FA3244767177344B7' || 'F5CE3BAEC4934864B1022C1C4D39EB40';
} }
} }
......
...@@ -4,26 +4,15 @@ import { getBaseUrl, getApiUrl } from '@/utils/index' ...@@ -4,26 +4,15 @@ import { getBaseUrl, getApiUrl } from '@/utils/index'
module.exports = { module.exports = {
data: function () { data: function () {
return { return {
// isIpx: Utils.env.isIPhoneX(),//是不是iphoneX
// isAndroid: Utils.env.isAndroid(),
// isIOS: false,
// isWeb: false,
token: null token: null
} }
}, },
created: function () { created: function () {
// let query = (this.$router && this.$router.query) || {};
// let query = this.$router.query
let query; let query;
if(this.$router !== undefined) { if(this.$route !== undefined) {
query = this.$router.query query = this.$route.query
} }
// this.token = this.getUrlSearch(location.href, 'token') || (query && query.token) || null this.token = this.getUrlKey('token') || (query && query.token) || 'A92C95FD752C413FA3244767177344B7'
// this.token = this.getUrlKey('token') || (query && query.token) || '1540EC1ECF7042CFA7F43363A72A7C81'
// this.token = this.getUrlKey('token') || (query && query.token) || '40C891A41D774DAEABF809071BD4B3BF'
// this.token = this.getUrlKey('token') || (query && query.token) || '5782BC5A96A44C2E8B1EC48F54462A6E'
this.token = this.getUrlKey('token') || (query && query.token) || '006EAC5D201B4547A27C842505F0E368'
}, },
mounted() { mounted() {
...@@ -83,46 +72,6 @@ module.exports = { ...@@ -83,46 +72,6 @@ module.exports = {
return d; return d;
}, },
// 根据条件排序
async searchForOrder(searchCategory = '1', searchValue = '', sortItem = 1, pageSize = 10, sourceData = []) {
if(pageSize <=0 ) return;
let str2 = (searchValue || '').replace(/[\-\_\,\!\|\~\`\(\)\#\$\%\^\&\*\{\}\:\;\"\L\<\>\?]/g, '');// 去掉特殊字符
let _this = this,
para = {
searchCategory: searchCategory,
searchValue: str2,
keywordColor: 'rgba(244,122,72,1)',
sortItem: sortItem,
pageNo: 1,
pageSize: pageSize,
token: _this.token,
setEntry: 'headers',
}
let url = 'contents/searchKeyword/searchContent'
let csourceData = await this.GET(url, para).then(res => {
// _this.searchText = ''
if (res.code == '000000') {
// 课程
if(searchCategory.indexOf('1') >= 0) {
sourceData = (res.data && res.data.contentAppModels) || []
}
if(searchCategory.indexOf('2') >= 0) {
// sourceData = []
sourceData = this.handelFive(res.data.fiveMinutesMedicalContentList || [])
}
if(searchCategory.indexOf('3') >= 0) {
sourceData = (res.data && res.data.pCourseDoctorModels) || []
}
if(searchCategory.indexOf('4') >= 0) {
sourceData = res.data.educationContents
}
}
return sourceData || []
})
return csourceData
},
setEventByModuleCode(itemData){ setEventByModuleCode(itemData){
let modeCode = itemData.appModuleInfo.code || ''; let modeCode = itemData.appModuleInfo.code || '';
let paramList = itemData.appModuleInfo.paramList ? itemData.appModuleInfo.paramList : '' let paramList = itemData.appModuleInfo.paramList ? itemData.appModuleInfo.paramList : ''
...@@ -159,6 +108,7 @@ module.exports = { ...@@ -159,6 +108,7 @@ module.exports = {
// 通用GET请求 // 通用GET请求
GET(api, para, callback,str) { GET(api, para, callback,str) {
// debugger
para.token = para.token || this.token || '006EAC5D201B4547A27C842505F0E368' para.token = para.token || this.token || '006EAC5D201B4547A27C842505F0E368'
let url = api + this.getUrlPara(para) let url = api + this.getUrlPara(para)
return fetch({ return fetch({
......
...@@ -144,13 +144,33 @@ export default { ...@@ -144,13 +144,33 @@ export default {
} }
}, },
btnClick() { btnClick() {
if(this.status == 1) {
// 判断是否加入机构
// 判断加入机构与学习范围是否一致
alert('去学习');
}
if(this.status == 2) { if(this.status == 2) {
alert('调用申请学分的接口'); alert('调用申请学分的接口');
} }
if(this.status == 4) { if(this.status == 4) {
alert('调用重新提交的接口'); alert('调用重新提交的接口');
} }
} },
// 根据token获取用户信息
getUserInfoByToken() {
let _this = this;
let param = {
doctorId: '2222',
token: this.token,
setEntry: true
};
this.GET("api-ws/doctors/personal/info/v1", param).then(res => {
isShowDialog = true
})
},
// /credit/applyCheck
}, },
}; };
</script> </script>
......
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
borderStyle="0px solid #fff" borderStyle="0px solid #fff"
:backMethod="from" :backMethod="from"
></CommonNavbar> ></CommonNavbar>
<van-cell-group style="margin: 10px 15px;"> <van-cell-group class="group">
<van-field label-width="150" v-model="formData.name" label="姓名" placeholder="请填写您的姓名" /> <van-field label-width="150" disabled v-model="formData.name" label="姓名" placeholder="请填写您的姓名" />
<van-field label-width="150" v-model="formData.idCardNumber" label="身份证号" placeholder="请填写您的真实身份证号" /> <van-field label-width="150" v-model="formData.idCardNumber" label="身份证号" maxlength=18 placeholder="请填写您的真实身份证号" />
<van-field label-width="150" v-model="formData.icCardNumber" label="继续医学教育IC卡号" placeholder="请填写您的IC卡号" /> <van-field label-width="150" v-model="formData.icCardNumber" label="继续医学教育IC卡号" maxlength=9 placeholder="请填写您的IC卡号" />
</van-cell-group> </van-cell-group>
<div class="credit-edit-tips"> <div class="tips">
您的身份证号将用于生成项目学分证书对应的编号,请确保您所填写的身份证号的真实性 您的身份证号将用于生成项目学分证书对应的编号,请确保您所填写的身份证号的真实性
</div> </div>
<CommonButton :type="buttonStyleType" @btnClick="isShowDialog = true" btnText="提交"></CommonButton> <CommonButton :type="buttonStyleType" @btnClick="applyCredit" btnText="提交"></CommonButton>
<CommonDialog content="提交成功" subContent="您可在“个人中心-证书与学分”中查看审核结果" cancleBtnText="我知道了" isSingle needSubContent :isShowDialog="isShowDialog" @handlerAction="handlerDialogAction"></CommonDialog> <CommonDialog content="提交成功" subContent="您可在“个人中心-证书与学分”中查看审核结果" cancleBtnText="我知道了" isSingle needSubContent :isShowDialog="isShowDialog" @handlerAction="handlerDialogAction"></CommonDialog>
</section> </section>
</template> </template>
...@@ -36,12 +36,15 @@ export default { ...@@ -36,12 +36,15 @@ export default {
data() { data() {
return { return {
formData: { formData: {
creditId: '', creditId: "",
id: '', id: "",
name: "", name: "测试",
idCardNumber: "", idCardNumber: "",
icCardNumber: "", icCardNumber: "",
}, },
projectId: "",
token: "A92C95FD752C413FA3244767177344B7",
buttonStyleType: 'disabled',
from: "outer", from: "outer",
isBlack: true, isBlack: true,
bgColor: "#fff", bgColor: "#fff",
...@@ -49,40 +52,86 @@ export default { ...@@ -49,40 +52,86 @@ export default {
isShowNavbar: true, isShowNavbar: true,
isFixNavbar: false, isFixNavbar: false,
pointStyle: "activity", pointStyle: "activity",
buttonStyleType: 'disabled1',
isShowDialog: false isShowDialog: false
}; };
}, },
watch: {
formData: {
handler(newVal) {
let idCardReg = /^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$/;
let icCardReg = /^[a-zA-Z0-9]{9}$/;
if(newVal.name && newVal.idCardNumber && newVal.icCardNumber
&& idCardReg.test(newVal.idCardNumber)
&& icCardReg.test(newVal.icCardNumber)) {
this.buttonStyleType = 'primary';
} else {
this.buttonStyleType = 'disabled';
}
},
deep: true
}
},
created() { created() {
this.formData.id = this.$route && this.$route.query && this.$route.query.id || 393 // 前一页面传projectId,token
this.projectId = this.$route && this.$route.query && this.$route.query.projectId || 393;
this.formData.id = this.projectId;
this.token = this.$route && this.$route.query && this.$route.query.token || this.token || ''
this.getUserInfoByToken();
}, },
methods: { methods: {
handlerDialogAction(type) {
this.isShowDialog = false; // 提交申请
},
applyCredit() { applyCredit() {
let _this = this; let _this = this;
let param = { let param = {
portalProjectId: projectId, ...this.formData,
token: _this.userInfo.userToken, token: this.token,
setEntry: true setEntry: true
}; };
this.GET("cme/credit/apply", param).then(res => {
// this.GET("cme/credit/certificate/list", param).then(res => {
this.POST("cme/credit/apply", param).then(res => {
this.isShowDialog = true
}) })
} },
// 根据token获取用户信息
getUserInfoByToken() {
let _this = this;
let param = {
token: this.token,
setEntry: true
};
this.GET("cme/credit/doctor/info", param).then(res => {
this.formData.name = res.data.name;
this.formData.idCardNumber = res.data.card;
this.formData.icCardNumber = res.data.icCardNumber;
this.isShowDialog = true
})
},
// 显示提交成功的提示信息
handlerDialogAction(type) {
this.isShowDialog = false;
},
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../style/mixin"; @import "../style/mixin";
.credit-edit-tips { .credit-edit-wrapper {
margin: px2rem(10px) px2rem(15px) px2rem(50px); .group {
font-weight: 400; margin: 10px 15px;
font-size: px2rem(14px); }
line-height: px2rem(21px); .tips {
color: #979899; margin: px2rem(10px) px2rem(15px) px2rem(50px);
font-weight: 400;
font-size: px2rem(14px);
line-height: px2rem(21px);
color: #979899;
}
} }
</style> </style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册