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

申请逻辑修改

上级 86acc5e7
......@@ -8,11 +8,16 @@ import '@/utils/rem' // 引入自适应
import '@/utils/yqy-bridge' // 移动端服务
// import FastClick from 'fastclick'
import vueFilters from '@/utils/filter'
// import VConsole from 'vconsole/dist/vconsole.min.js'
// if(!(process.env.BUILD_ENV === 'uat' || process.env.BUILD_ENV === 'pro')) {
import VConsole from 'vconsole/dist/vconsole.min.js'
import BuriedPoint,{ sendBuriedData} from 'web-buried-point';
import Vant from 'vant';
import 'vant/lib/index.css';
if(!(process.env.BUILD_ENV === 'uat' || process.env.BUILD_ENV === 'pro')) {
// if(!(process.env.BUILD_ENV === 'pro')) {
// let vConsole = new VConsole() // 初始化
// }
let vConsole = new VConsole() // 初始化
}
// 可调试
// Vue.config.devtools = true;
......@@ -53,7 +58,6 @@ Vue.mixin({
})
// import './plugins';
import BuriedPoint,{ sendBuriedData} from 'web-buried-point';
// import { buriedURL } from './apiConfig';
let domain = '';
if (process.env.BUILD_ENV === 'prod') {
......@@ -74,8 +78,6 @@ Vue.use(BuriedPoint, {
});
Vue.prototype.$sendBuriedData = sendBuriedData;
import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);
new Vue({
......
......@@ -17,8 +17,9 @@ service.interceptors.request.use(config => {
if(config.data.token){
config.headers['token'] = config.data.token || '0F32D60C3D7042158BCF1FB574E482BE'
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境
config.headers['token'] = 'A92C95FD752C413FA3244767177344B7' || 'F5CE3BAEC4934864B1022C1C4D39EB40';
config.headers['token'] = 'C85C482D4E854364815C85485C6277F1' || 'F5CE3BAEC4934864B1022C1C4D39EB40';
}
delete config.data.token;
}
config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
......
......@@ -25,8 +25,8 @@ function getConfigByEnvType(urlType) {
// 日期与时间解析函数
export function parseTime(time, cFormat) {
if (arguments.length === 0) {
return null
if (arguments.length === 0 || !time) {
return ''
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
let date
......@@ -117,4 +117,23 @@ export function deepCopy(obj) {
export function mergeObjs(...ojbs){
}
export function gotoPage(context, pageUrl) {
if(__isWeb) {
context.$router.push(pageUrl)
} else {
let paramList = [
{
key: "pageUrl",
value: getWebPageUrl(pageUrl),
type: 4,
seqNo: 1
}
];
rocNative.dispatchEventByModuleCode({
modeCode: "M300",
jsonString: paramList
});
}
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ module.exports = {
if(this.$route !== undefined) {
query = this.$route.query
}
this.token = this.getUrlKey('token') || (query && query.token) || 'A92C95FD752C413FA3244767177344B7'
this.token = this.getUrlKey('token') || (query && query.token) || 'C85C482D4E854364815C85485C6277F1'
},
mounted() {
......
......@@ -4,38 +4,9 @@
e.rocNative = {
// 参数说明 e:回传回来的移动端服务名称; t:前端自己传递的回调JS方法
__nativeCall: function (e, t, n) {
// if(t == '__refresh'){
// console.log('!__refresh: ',t,n);
// __refresh(n);
// // return;
// }
if( window[t] ){
if (window[t]) {
window[t](n)
}
// if(t == '__getUserInfo64Comp') {
// __getUserInfo64Comp(n);
// }
// if(t == '__getUserInfo'){
// __getUserInfo(n);
// // return;
// }
// if(t == '__getUserInfo4Comp'){
// __getUserInfo4Comp(n);
// // return;
// }
// if(t == '__getUserInfo4Coop'){
// __getUserInfo4Coop(n);
// // return;
// }
// if (t == '__sendBuriedPoint') {
// __sendBuriedPoint(n);
// // return
// }
// if (t == '__openErrorDebug') {
// __openErrorDebug(n);
// // return
// }
},
__callNative: function (t, a, o) {
"function" == typeof o && (n++ , i[n] = o);
......@@ -82,7 +53,7 @@
})
}
})
}("gotoLogin", "dispatchEventByModuleCode", "gotoAuthentication", "shareWechat", "backPreviousPage", "bindingWechat", "getDeviceInfo", "goBack", "appBuryingPointEntrust", "getAuthPermission", "getAppVersionCode", "getToken", "gotoNewActivity", "gotoNewActivityWithParams", "gotoNewWebActivity", "gotoYidianActivity", "readMessage", "openFiveMintusAudio", "getStatusBarSize", "showNativeDialog", "showNativeToast", "gotoViewTop", "appInit", "checkPermissions", "getStatusBarHeight", "setTabMiniIcon", "getUserInfo", "pauseAudioView", "sendBuriedPoint", "openErrorDebug", "upGradeVersion","getLocalData");
}("gotoLogin", "dispatchEventByModuleCode", "gotoAuthentication", "shareWechat", "backPreviousPage", "bindingWechat", "getDeviceInfo", "goBack", "appBuryingPointEntrust", "getAuthPermission", "getAppVersionCode", "getToken", "gotoNewActivity", "gotoNewActivityWithParams", "gotoNewWebActivity", "gotoYidianActivity", "readMessage", "openFiveMintusAudio", "getStatusBarSize", "showNativeDialog", "showNativeToast", "gotoViewTop", "appInit", "checkPermissions", "getStatusBarHeight", "setTabMiniIcon", "getUserInfo", "pauseAudioView", "sendBuriedPoint", "openErrorDebug", "upGradeVersion", "getLocalData");
if (e.__rocAndroid) {
e.__isAndroid = true
e.__isIOS = false
......@@ -96,7 +67,7 @@
e.__isIOS = false
e.__isWeb = true
}
if(window.__isIOS){
if (window.__isIOS) {
rocNative.appInit()
}
}(window);
......@@ -16,28 +16,30 @@
<ul>
<li>
<span>项目名称</span>
<span>人工髋关节翻修手术的策略及技术</span>
<span>{{formData.projectName}}</span>
</li>
<li>
<span>学分等级</span>
<span>国家级Ⅰ类</span>
<span>{{formData.grade}}</span>
</li>
<li>
<span>学分</span>
<span>5学分</span>
<span>{{formData.value}}</span>
</li>
<li>
<span>申请范围</span>
<span>河北省 石家庄市</span>
<span>{{formData.projectName}}</span>
</li>
<li>
<span>状态</span>
<span :class="statusStyle">{{statusText}}</span>
<!-- <span :class="statusStyle">{{statusText}}</span> -->
<span :class="statusStyle">{{formData.statusDesc}}</span>
</li>
</ul>
<div v-show="needShowTips" class="tips" >
<div v-show="needShowTips" class="tips">
<span class="triangle"></span>
您提交的信息不准确,请重新提交或联系云鹊医官方客服
{{formData.tips}}
<!-- 您提交的信息不准确,请重新提交或联系云鹊医官方客服 -->
</div>
</div>
<CommonSpliteLine v-show="needShowUserInfo"></CommonSpliteLine>
......@@ -45,19 +47,19 @@
<ul>
<li>
<span>申请人</span>
<span>王小丫</span>
<span>{{formData.name}}</span>
</li>
<li>
<span>身份证号</span>
<span>210182198012240988</span>
<span>{{formData.idCardNumber}}</span>
</li>
<li>
<span>继续医学教育IC卡号</span>
<span>150NMKL91</span>
<span>{{formData.icCardNumber}}</span>
</li>
<li>
<span>申请时间</span>
<span>2019年11月18日 23:56:56</span>
<span>{{formData.applyTime | formatTime('{y}年{m}月{d}日 {h}:{i}:{s}')}}</span>
</li>
</ul>
</div>
......@@ -65,23 +67,40 @@
<CommonButton v-if="needShowBtn" @btnClick="btnClick" :btnText="btnText"></CommonButton>
<CommonBottomInfo></CommonBottomInfo>
<CommonDialog
:isShowDialog="isShowDialog"
:isSingle="isSingle"
:cancleBtnText="cancleBtnText"
:confirmBtnText="confirmBtnText"
:content="dialogContent"
@handlerAction="handlerAction"
/>
</section>
</template>
<script>
import CommonNavbar from "@/components/common/common-navbar";
import CommonButton from "@/components/cme/common-button";
import CommonSpliteLine from "@/components/common/common-splite-line";
import CommonBottomInfo from "@/components/cme/common-bottom-info";
import CommonDialog from "@/components/cme/common-dialog";
import { gotoPage } from "@/utils/index";
export default {
components: {
CommonNavbar,
CommonButton,
CommonSpliteLine,
CommonBottomInfo
CommonBottomInfo,
CommonDialog
},
data() {
return {
from: "outer",
isSingle: false,
dialogContent: "", // 弹框内容
confirmBtnText: "", // 弹框按钮
cancleBtnText: "",
isShowDialog: false,
from: "native",
isBlack: true,
bgColor: "#fff",
navTitle: "学分详情",
......@@ -99,83 +118,194 @@ export default {
status: 5,
statusStyle: "continue",
statusText: "学习中",
statusDescText: "",
// statusDescText: "",
needShowTips: false,
needShowUserInfo: true,
needShowBtn: false,
btnText: "去学习"
btnText: "去学习",
formData: {
creditId: 0,
projectName: "",
grade: "",
value: 0,
status: 1,
statusDesc: "",
applyRange: null,
tips: "",
name: null,
idCardNumber: null,
icCardNumber: null,
applyTime: null
},
projectId: 1,
token: "AAA613F74B7A4746AEE8354458FF4896"
};
},
created() {
this.statusChanged(this.status);
let _this = this;
window.__getUserInfoInCDetail = function(param) {
_this.token = param.userToken;
_this.getLatestApplyRecord();
};
window.__refresh = function() {
_this.getUserInfo();
};
this.projectId =
(this.$route && this.$route.query && this.$route.query.projectId) || this.projectId;
this.from =
(this.$route && this.$route.query && this.$route.query.from) || this.from;
this.creditId =
(this.$route && this.$route.query && this.$route.query.creditId) || 393;
this.token =
(this.$route && this.$route.query && this.$route.query.token) ||
this.token;
this.status =
(this.$route && this.$route.query && this.$route.query.status) || 1; // 测试用
if (__isWeb) {
this.getLatestApplyRecord();
} else {
this.getUserInfo();
}
},
methods: {
//(判断是否加入机构,是否为认证用户,是否在申请范围内)
permission() {
let _this = this;
let param = {
// id: _this.projectId,
creditId: _this.formData.creditId,
token: _this.token,
setEntry: true
};
_this.POST("cme/credit/applyCheck", param).then(res => {
if(res.code == '000000') {
gotoPage(this, `cme/#/coop?id=${this.projectId}`);
} else if (res.code == "219004" || res.code == "219012") {
// 未加入机构 219004 未身份认证 219005 不在申请范围 219012
this.dialogContent = `该项目仅对${_this.formData.applyRange}的用户开放`;
this.cancleBtnText = "我知道了";
this.isShowDialog = true;
this.isSingle = true;
}
});
},
// 获取用户信息
getUserInfo() {
rocNative.getUserInfo({
__funcName: "__getUserInfoInCDetail"
});
},
// 根据状态显示不同的文本
statusChanged(status) {
this.needShowUserInfo = false;
this.needShowTips = false;
this.statusDescText = '';
// this.statusDescText = '';
this.statusText = "学习中";
this.statusStyle = 'continue';
this.statusStyle = "continue";
this.needShowBtn = true;
this.btnText = '去学习';
if(status == 1) {
} else if(status == 2){
this.btnText = "去学习";
if (status == 1) {
} else if (status == 2) {
this.statusText = "学习已经完成";
this.btnText = '申请学分';
this.statusStyle = 'completed';
} else if(status == 3){
this.btnText = "申请学分";
this.statusStyle = "completed";
} else if (status == 3) {
this.needShowUserInfo = true;
this.needShowTips = true;
this.needShowBtn = false;
this.statusText = "审核中";
this.statusDescText = '预计2019年12月10日前有反馈结果';
} else if(status == 4){
// this.statusDescText = '预计2019年12月10日前有反馈结果';
} else if (status == 4) {
this.needShowUserInfo = true;
this.needShowTips = true;
this.statusText = "审核失败";
this.statusStyle = 'error';
this.btnText = '重新提交';
this.statusDescText = '您提交的信息不准确,请重新提交或联系云鹊医官方客服';
} else if(status == 5){
this.statusStyle = "error";
this.btnText = "重新提交";
// this.statusDescText = '您提交的信息不准确,请重新提交或联系云鹊医官方客服';
} else if (status == 5) {
this.needShowUserInfo = true;
this.needShowBtn = false;
this.statusText = "审核通过";
}
},
btnClick() {
if(this.status == 1) {
if (this.formData.status == 1) {
// 判断是否加入机构
// 判断加入机构与学习范围是否一致
alert('去学习');
this.permission();
// alert("去学习");
} else if (this.formData.status == 2) {
this.applicationCredit();
// alert("调用申请学分的接口");
} else if (this.formData.status == 4) {
gotoPage(this, `cme/#/credit-edit?creditId=${this.creditId}`);
// alert("调用重新提交的接口");
}
if(this.status == 2) {
alert('调用申请学分的接口');
}
if(this.status == 4) {
alert('调用重新提交的接口');
},
// 弹框按钮事件
handlerAction(data) {
// alert(data)
if(this.formData.status == 1) {
gotoPage(this, `cme/#/coop?id=${this.projectId}`);
} else if(this.formData.status == 2) {
if (window.__isWeb) {
this.$router.back(-1);
} else {
rocNative.goBack();
}
}
},
// 根据token获取用户信息
getUserInfoByToken() {
// 立即申请学分
applicationCredit() {
let _this = this;
let param = {
doctorId: '2222',
token: this.token,
// id: _this.projectId,
creditId: _this.project.creditId || 1,
token: _this.token,
setEntry: true
};
this.GET("api-ws/doctors/personal/info/v1", param).then(res => {
isShowDialog = true
})
_this.POST("cme/credit/applyCheck", param).then(res => {
if (res.code == "000000") {
gotoPage(_this, `cme/#/credit-edit?creditId=${this.creditId}`);
} else if (res.code == "219004" || res.code == "219005") {
// 未加入机构 219004 未身份认证 219005 不在申请范围 219012
let params = {
__funcName: "__checkPermissions",
permCode: "009014"
};
rocNative.checkPermissions(params);
} else if (res.code == "219012") {
this.dialogContent = `您的所属机构不在可申请范围(${_this.formData.applyRange})内`;
this.cancleBtnText = "我知道了";
this.isShowDialog = true;
this.isSingle = true;
}
});
},
// /credit/applyCheck
},
// 最后一次提交信息
getLatestApplyRecord() {
let param = {
token: this.token,
setEntry: true
};
this.POST("cme/credit/latestApplyRecord/" + this.creditId, param).then(
res => {
this.formData = res.data;
this.statusChanged(this.formData.status);
}
);
}
}
};
</script>
<style lang="scss" scoped>
@import "../style/mixin";
.credit-detail {
&-wrapper {
.tips {
......@@ -191,6 +321,7 @@ export default {
line-height: px2rem(12px);
color: #979899;
background: #f8f9fa;
.triangle {
position: absolute;
top: px2rem(-5px);
......@@ -201,16 +332,20 @@ export default {
background: #f8f9fa;
}
}
.info {
font-size: px2rem(14px);
font-weight: 400;
margin-bottom: px2rem(50px);
.credit-basic {
margin: px2rem(20px) px2rem(15px);
}
.credit-user {
margin: px2rem(20px) px2rem(15px);
}
ul {
li {
display: flex;
......@@ -218,19 +353,24 @@ export default {
justify-content: space-between;
height: px2rem(30px);
line-height: px2rem(30px);
span {
&:nth-child(1) {
color: #979899;
}
&:nth-child(2) {
color: #373839;
}
&.continue {
color: #449284;
}
&.error {
color: #FB5B52;
color: #fb5b52;
}
&.completed {
color: #373839;
}
......@@ -240,4 +380,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -38,14 +38,14 @@ export default {
formData: {
creditId: "",
id: "",
name: "测试",
name: "",
idCardNumber: "",
icCardNumber: "",
},
projectId: "",
token: "A92C95FD752C413FA3244767177344B7",
// projectId: "",
token: "C85C482D4E854364815C85485C6277F1",
buttonStyleType: 'disabled',
from: "outer",
from: "native",
isBlack: true,
bgColor: "#fff",
navTitle: "申请学分",
......@@ -72,32 +72,64 @@ export default {
}
},
created() {
// 前一页面传projectId,token
this.projectId = this.$route && this.$route.query && this.$route.query.projectId || 393;
this.formData.id = this.projectId;
let _this = this;
window.__getUserInfoInCEdit = function(param) {
_this.token = param.userToken;
_this.getUserInfoByToken();
_this.getLatestApplyRecord();
};
window.__refresh = function() {
_this.getUserInfo();
};
// 前一页面传creditId
// this.projectId = this.$route && this.$route.query && this.$route.query.projectId || '';
this.from = this.$route && this.$route.query && this.$route.query.from || this.from;
this.creditId = this.$route && this.$route.query && this.$route.query.creditId || 393;
// this.formData.id = this.projectId;
this.formData.creditId = this.creditId;
this.token = this.$route && this.$route.query && this.$route.query.token || this.token || ''
this.getUserInfoByToken();
if (__isWeb) {
this.getUserInfoByToken();
this.getLatestApplyRecord();
} else {
this.getUserInfo()
}
},
methods: {
getUserInfo() {
rocNative.getUserInfo({
__funcName: "__getUserInfoInCEdit"
});
},
// 提交申请
applyCredit() {
let _this = this;
let param = {
...this.formData,
token: this.token,
setEntry: true
};
// this.GET("cme/credit/certificate/list", param).then(res => {
this.POST("cme/credit/apply", param).then(res => {
this.isShowDialog = true
if(res.code == '000000') {
this.isShowDialog = true
}
})
},
// 最后一次提交信息:获取用户的idCardNumber
getLatestApplyRecord() {
let param = {
token: this.token,
setEntry: true
};
this.POST("cme/credit/latestApplyRecord/" + this.creditId, param).then(res => {
this.formData.icCardNumber = res.data.icCardNumber;
})
},
// 根据token获取用户信息
getUserInfoByToken() {
let _this = this;
let param = {
token: this.token,
setEntry: true
......@@ -105,7 +137,6 @@ export default {
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
})
},
......@@ -113,13 +144,19 @@ export default {
// 显示提交成功的提示信息
handlerDialogAction(type) {
this.isShowDialog = false;
// 跳转到前一页面
if (window.__isWeb) {
this.$router.back(-1);
} else {
rocNative.goBack();
}
},
},
};
</script>
<style lang="scss" scoped>
<style lang="scss">
@import "../style/mixin";
.credit-edit-wrapper {
.group {
......@@ -132,6 +169,14 @@ export default {
line-height: px2rem(21px);
color: #979899;
}
.van-cell {
padding: px2rem(20px) 0 !important;
font-size: px2rem(15px) !important;
color: #373839 !important;
}
.van-cell__title span {
font-weight: 400 !important;
}
}
</style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册