提交 fb8ae893 编写于 作者: huangwensu's avatar huangwensu

项目列表接口联调

上级 9b7fface
......@@ -10,36 +10,37 @@
>
<div class="coop-item-left">
<img :src="item.imgUrl">
<span v-if="item.projectStatus"
<span v-if="item.projectStatusValue"
class="coop-container-status"
:style="{'background': cBgColor(item)}"
>{{item.projectStatus | statusText}}</span>
>{{item.projectStatusValue | statusText}}</span>
</div>
<div class="coop-item-right">
<span class="coop-item-right-title">{{item.projectName}}</span>
<span class="coop-item-right-other">发起机构 {{item.organizationName}}</span>
<span v-if="item.pType == 1"
<span class="coop-item-right-title">{{item.name}}</span>
<span class="coop-item-right-other">{{item.level}} | {{item.credit}} | {{item.scope}}</span>
<!-- <span v-if="item.pType == 1"
class="coop-item-right-other"
>起止日期 {{item.oldTime}}</span>
<span v-else
>起止日期 {{item.oldTime}}</span> -->
<!-- <span v-else
class="coop-item-right-other"
>起止日期 {{item.projectBegintimeLong | formatTime}}-{{item.projectEndtimeLong | formatTime}}</span>
>起止日期 {{item.projectBegintimeLong | formatTime}}-{{item.projectEndtimeLong | formatTime}}</span> -->
<span class="coop-item-right-other">{{item.startDate}}{{item.endTime}}</span>
</div>
</div>
<NoMoreContent v-show="paramData.length > 9"></NoMoreContent>
<NoContent v-show="!paramData.length && isShow"></NoContent>
<NoContent v-show="!paramData.length && isShow" :tabNum="tabTo"></NoContent>
<!--<UpdateDialog :showGoUpdate="showGoUpdate" @goUpdateHandler="goUpdateHandler"></UpdateDialog>-->
<van-popup
<!-- <van-popup
v-model="showGoUpdate"
position="bottom"
:style="{ height: '4.427rem' }"
>
<div class="update-dialog-content">
<p class="title">本项目需要更新至最新版本才能参加哦</p>
<p class="update-btn v-hairline-top confirm-btn" @click="goUpdateHandler">立即更新</p>
<p class="title">该项目仅对河北石家庄市的用户开放</p>
<p class="update-btn v-hairline-top confirm-btn" @click="goUpdateHandler">确定</p>
<p class="update-btn v-hairline-top" @click="showGoUpdate = false">取消</p>
</div>
</van-popup>
</van-popup> -->
</section>
</template>
......@@ -78,6 +79,10 @@ export default {
type: Number,
default: 1
},
userMobile: {
type: String,
default: ""
}
},
computed: {
...mapGetters(["userInfo"])
......@@ -117,51 +122,57 @@ export default {
}
},
coopDetails(item) {
if(this.userMobile) {
this.$router.push({path: '/coop',query: {id: item.id}});
}else {
rocNative.gotoLogin();
}
this.$sendBuriedData({
component_tag: '089#400081#0#'+item.projectName
});
if (item.courseRequire == 1) { //对课程完成度有控制,需判断版本号
let appVersion = getAppVersion(this.userInfo.appVersion);
// alert('版本'+appVersion)
let flag = appVersion < 315;
if (flag === true) {
// 小于315版本,添加去更新弹层
this.showGoUpdate = true;
}else {
// 跳转到老项目
if(this.tabTo != 3) {
this.setProjectTabIndex(this.tabTo)
}
if (item.pType == 1) {
this.goToPage(item);
// 跳转到新项目
} else {
this.showModule(item, this.coopType, this.tabTo, item.courseRequire)
}
// if (item.courseRequire == 1) { //对课程完成度有控制,需判断版本号
// let appVersion = getAppVersion(this.userInfo.appVersion);
// // alert('版本'+appVersion)
// let flag = appVersion < 315;
// if (flag === true) {
// // 小于315版本,添加去更新弹层
// this.showGoUpdate = true;
// }else {
// // 跳转到老项目
// if(this.tabTo != 3) {
// this.setProjectTabIndex(this.tabTo)
// }
// if (item.pType == 1) {
// this.goToPage(item);
// // 跳转到新项目
// } else {
// this.showModule(item, this.coopType, this.tabTo, item.courseRequire)
// }
}
// }
} else {
// } else {
// 跳转到老项目
if(this.tabTo != 3) {
this.setProjectTabIndex(this.tabTo)
}
if (item.pType == 1) {
this.goToPage(item);
// 跳转到新项目
} else {
this.showModule(item, this.coopType, this.tabTo, item.courseRequire)
// this.$router.push({
// path: "/coop",
// query: {
// id: item.id,
// coopType: this.coopType
// // 跳转到老项目
// if(this.tabTo != 3) {
// this.setProjectTabIndex(this.tabTo)
// }
// if (item.pType == 1) {
// this.goToPage(item);
// // 跳转到新项目
// } else {
// this.showModule(item, this.coopType, this.tabTo, item.courseRequire)
// // this.$router.push({
// // path: "/coop",
// // query: {
// // id: item.id,
// // coopType: this.coopType
// // }
// // });
// }
// });
}
}
// }
},
// 跳转到新项目
showModule(item, coopType, tabTo, courseRequire) {
......
......@@ -3,15 +3,21 @@
<section class="nc-container">
<img
class="nc-container-img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/2019/03/07/cooperation/no-content.png"
src="../../images/cme/no-content.png"
>
<span class="nc-container-text">暂无内容</span>
<span v-if="tabNum == 1" class="nc-container-text">您还未参加CME项目哦~</span>
<span v-if="tabNum == 2" class="nc-container-text">当前无可学CME项目哦~</span>
</section>
</template>
<script>
export default {
name: "no-content",
props: {
tabNum: {
default: 1
}
},
data() {
return {};
}
......@@ -26,7 +32,7 @@ export default {
flex-direction: column;
justify-content: center;
align-content: center;
margin-top: px2rem(20px);
margin-top: px2rem(150px);
margin-bottom: px2rem(20px);
text-align: center;
// margin: 0 auto;
......
......@@ -12,13 +12,13 @@
<p :class="{'actived': step2 || step3 || step4}">申请学分</p>
</div>
<div class="step-line step-two-line" :class="{'actived': step3 || step4}"></div>
<p class="step-text step3-text" v-if="step3" @click="verifyResult">审核中></p>
<p class="step-text step3-text" v-if="step3" @click="verifyResult">{{progressText}}></p>
<div class="step-item">
<span :class="{'actived': step3 || step4}">3</span>
<p :class="{'actived': step3 || step4}">学分审核</p>
</div>
<div class="step-line step-three-line" :class="{'actived': step4}"></div>
<p class="step-text step4-text" v-if="step4">获得3学分></p>
<p class="step-text step4-text" v-if="step4" @click="getScore">获得{{credit}}学分></p>
<div class="step-item">
<span :class="{'actived': step4}">4</span>
<p :class="{'actived': step4}">申请成功</p>
......@@ -35,45 +35,71 @@ export default {
studyProgress: {
type: String,
default: "0%"
},
credit: {
type: String,
default: ""
}
},
data() {
return {
step1: false,
step2: false,
step2: true,
step3: false,
step4: false
step4: false,
progressText: ""
}
},
created() {
if(this.currentProgress == 1) { // 项目学习
watch: {
currentProgress(n,o) {
if(o == 1) { // 项目学习
this.step1 = true;
this.step2 = false;
this.step3 = false;
this.step4 = false;
}else if(this.currentProgress == 2) { // 申请学分
}else if(o == 2) { // 申请学分
this.step1 = false;
this.step2 = true;
this.step3 = false;
this.step4 = false;
}else if(this.currentProgress == 3) { // 学分审核
}else if(o == 3) { // 学分审核
this.step1 = false;
this.step2 = false;
this.step3 = true;
this.step4 = false;
this.progressText = "审核中";
}else if(o == 4) { // 审核失败
this.step1 = false;
this.step2 = false;
this.step3 = true;
this.step4 = false;
}else if(this.currentProgress == 4) { // 申请成功
this.progressText = "审核失败";
}else if(o == 5) { // 申请成功
this.step1 = false;
this.step2 = false;
this.step3 = false;
this.step4 = true;
}
}
},
created() {
},
methods: {
// 立即申请
applyFor() {
this.$emit("applicationCredit");
},
// 审核
verifyResult() {
if(this.currentProgress == 3) { // 审核中
this.$router.push({path: '/credit-detail',query: {flag: false}})
}else if(this.currentProgress == 4) { // 审核失败
this.$router.push({path: '/credit-detail',query: {flag: true}})
}
},
// 获得学分
getScore() {
}
}
......
......@@ -22,7 +22,7 @@
<td @click="changeTab(2)" :class="{'active': tabIndex === 2}">
<div class="tap-title">
<!-- <span>其它项目</span> -->
<span :style="{'color': tabIndex === 2 ? '#333' : '#999'}">其它项目</span>
<span :style="{'color': tabIndex === 2 ? '#333' : '#999'}">全部项目</span>
<span></span>
</div>
</td>
......@@ -30,10 +30,19 @@
</table>
<article class="page-content-list">
<section v-if="tabIndex === 1">
<CoopListItem :paramData="joinProjectList" :coopType="1" :tabTo="1" :isShow="isShow"></CoopListItem>
<CoopListItem
:paramData="joinProjectList"
:coopType="1"
:tabTo="1"
:isShow="isShow"></CoopListItem>
</section>
<section v-if="tabIndex === 2">
<CoopListItem :paramData="otherProjectList" :coopType="1" :tabTo="2" :isShow="isShow"></CoopListItem>
<CoopListItem
:paramData="otherProjectList"
:coopType="1"
:tabTo="2"
:isShow="isShow"
:userMobile="userMobile"></CoopListItem>
</section>
</article>
</section>
......@@ -65,8 +74,8 @@ export default {
pointStyle: "activity",
descTitle: "规定从何处开始选取。如果是负数",
tabIndex: 1,
joinProjectList: [],
otherProjectList: [],
joinProjectList: [], // 我的项目
otherProjectList: [], // 全部项目
token: "",
toastTitle: "",
userMobile: ""
......@@ -96,8 +105,8 @@ export default {
_this.getCoopData();
}
window.__refresh = function() {
_this.tabIndex = _this.projectTabIndex;
// _this.getUserInfo();
//_this.tabIndex = _this.projectTabIndex;
_this.getUserInfo();
// document.documentElement.scrollTop = 0;
// document.body.scrollTop = 0;
};
......@@ -124,8 +133,11 @@ export default {
},
changeTab(index) {
let tag = index == 1 ? '089#400079' : '089#400080';
this.tabIndex = index;
if(index == 1 && !this.userMobile) {
rocNative.gotoLogin();
this.tabIndex = 2;
}
this.$sendBuriedData({
component_tag: tag
});
......@@ -142,45 +154,48 @@ export default {
let cachedOtherProjectList = []
_this.otherProjectList = []
_this.showLoading = true;
this.GET("portal/portalApp/queryProjectCooperationInfoV2", param).then(
this.GET("cme/project/list", param).then(
res => {
_this.showLoading = false;
if (res.code == "000000") {
let oldProjects1 = [];
let oldProjects2 = [];
for(let i=0;i<res.data.oldProjects.length;i++) {
if(res.data.oldProjects[i].roleFlag == 1) {
oldProjects1.push(res.data.oldProjects[i]);
} else if (res.data.oldProjects[i].roleFlag == 0) {
oldProjects2.push(res.data.oldProjects[i]);
}
}
// let oldProjects1 = [];
// let oldProjects2 = [];
// for(let i = 0; i < res.data.oldProjects.length; i++) {
// if(res.data.oldProjects[i].roleFlag == 1) {
// oldProjects1.push(res.data.oldProjects[i]);
// } else if (res.data.oldProjects[i].roleFlag == 0) {
// oldProjects2.push(res.data.oldProjects[i]);
// }
// }
// console.log('项目1',oldProjects1,'项目2',oldProjects2);
// cachedJoinProjectList = res.data.myProjectList;
// _this.joinProjectList = res.data.myProjectList;
// _this.otherProjectList = res.data.otherProjectList;
cachedJoinProjectList = _this.handleOldProject(
oldProjects1,
res.data.myProjectList
);
cachedOtherProjectList = _this.handleOldProject(
oldProjects2,
res.data.otherProjectList
);
cachedJoinProjectList = res.data.myCMEProjectListDtoList;
cachedOtherProjectList = res.data.allCMEProjectListDtoList;
_this.joinProjectList = res.data.myCMEProjectListDtoList;
_this.otherProjectList = res.data.allCMEProjectListDtoList;
// cachedJoinProjectList = _this.handleOldProject(
// oldProjects1,
// res.data.myProjectList
// );
// cachedOtherProjectList = _this.handleOldProject(
// oldProjects2,
// res.data.otherProjectList
// );
// 如果用户已经登陆,则将"至今"的几个项目移到我的列表中
if(_this.userMobile) {
cachedOtherProjectList.map(item => {
if(item.projectName && item.projectName.indexOf('国家基本公共卫生服务项目基层高血压管理办公室') >= 0) {
cachedJoinProjectList.unshift(item);
// cachedOtherProjectList.map(item => {
// if(item.projectName && item.projectName.indexOf('国家基本公共卫生服务项目基层高血压管理办公室') >= 0) {
// cachedJoinProjectList.unshift(item);
// } else {
// _this.otherProjectList.push(item);
// }
// })
_this.tabIndex = 1;
} else {
_this.otherProjectList.push(item);
}
})
} else {
_this.otherProjectList = cachedOtherProjectList
_this.tabIndex = 2;
// _this.otherProjectList = cachedOtherProjectList
}
_this.joinProjectList = cachedJoinProjectList;
// _this.joinProjectList = cachedJoinProjectList;
if (_this.joinProjectList && _this.joinProjectList.length === 0) {
_this.tabIndex = 2;
}
......
......@@ -31,6 +31,7 @@
<CmeStep
:currentProgress="project.currentProgress"
:studyProgress="project.studyProgress"
:credit="project.credit"
@applicationCredit="applicationCredit"/>
<!-- 简介和目录 -->
<div class="intro-catalogue-container">
......@@ -70,8 +71,10 @@
<Loading v-show="showLoading"/>
<CommonDialog
:isShowDialog="isShowDialog"
:isSingle="isSingle"
:confirmBtnText="confirmBtnText"
:content="dialogContent"></CommonDialog>
:content="dialogContent"
@handlerAction="handlerAction"/>
</div>
</template>
......@@ -102,6 +105,7 @@ import vueFilters from '@/utils/filter';
export default {
data() {
return {
isSingle: false,
dialogContent: "", // 弹框内容
confirmBtnText: "", // 弹框按钮
isShowDialog: false,
......@@ -182,7 +186,7 @@ export default {
this.from = this.$route.query.from || this.from || "native";
this.projectId = this.$route.query.id || 1;
//this.componentId = this.$route.query.componentId;
this.moduleId = this.$route.query.moduleId;
// this.moduleId = this.$route.query.moduleId;
this.moduleName = this.$route.query.moduleName;
this.courseRequire = this.$route.query.courseRequire;
......@@ -191,6 +195,7 @@ export default {
_this.setUserInfo(param);
_this.checkToken();
_this.getProjectParticularsV2();
_this.permission();
};
_this.getUserInfo();
if (__isWeb && process.env.BUILD_ENV == "development") {
......@@ -240,8 +245,8 @@ export default {
this.tabFlag = true;
}
},
// 立即申请学分(判断是否加入机构,是否为认证用户,是否在申请范围内)
applicationCredit() {
//(判断是否加入机构,是否为认证用户,是否在申请范围内)
permission() {
let _this = this;
let param = {
id: _this.projectId,
......@@ -251,24 +256,39 @@ export default {
};
_this.NEW_POST("cme/credit/applyCheck", param).then(res => {
if (res.code == "000000") {
if(res.data == "219004") { // 未加入机构
this.dialogContent = "您暂未加入机构,加入机构后且认证身份后可申请学分";
this.confirmBtnText = "加入机构";
this.isShowDialog = true;
}else if(res.data == "219005") { // 未身份认证
this.dialogContent = "您暂未认证身份,完成认证身份后可申请学分";
this.confirmBtnText = "去认证";
this.isShowDialog = true;
}else if(res.data == "219006") { // 不在申请范围
this.dialogContent = "您的所属机构不在可申请范围(河北石家庄内)";
if(res.data == "219004" || res.data == "219012") { // 未加入机构 219004 未身份认证 219005 不在申请范围 219012
this.dialogContent = `该项目仅对${_this.project.scope}的用户开放`;
this.confirmBtnText = "我知道了";
this.isShowDialog = true;
this.isSingle = true;
}else {
this.isShowDialog = false;
//this.$router.push('/credit-edit');
}
}
});
},
// 立即申请学分
applicationCredit() {
},
// 弹框按钮事件
handlerAction(data) {
if(data == 2) {
if(this.confirmBtnText == '加入机构') {
let params = {
type:1,
url:"https://dev-m.yunqueyi.com/resident/#/patients-manage/choose-patients?bizType=1&projectId=df7756fd2b2dedf74b373decbd57e595",
param:""
};
rocNative.gotoActivityHospital(params)
}else if(this.confirmBtnText == '去认证') {
rocNative.gotoAuthentication();
}
}else {
this.isShowDialog = false;
}
},
// 锚点到简介
jumpIntro() {
this.tabFlag = true;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册