提交 61b547c4 编写于 作者: tao.wu's avatar tao.wu

Merge branch 'dev-stage2-20191125' into dev-copy-stage2

...@@ -132,6 +132,7 @@ ...@@ -132,6 +132,7 @@
}, },
// 交互事件 // 交互事件
setScrollHandle(instval){ setScrollHandle(instval){
if(this.isOpacity){
if (instval >= this.baseShowHeight) { if (instval >= this.baseShowHeight) {
this.isScroll = true; this.isScroll = true;
this.leftIcon = leftimg2; this.leftIcon = leftimg2;
...@@ -141,6 +142,11 @@ ...@@ -141,6 +142,11 @@
this.leftIcon = leftimg1; this.leftIcon = leftimg1;
this.rightIcon = rightimg1; this.rightIcon = rightimg1;
} }
}else{
this.isScroll = true;
this.leftIcon = leftimg2;
this.rightIcon = rightimg2;
}
} }
} }
} }
......
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
<div <div
class="btn left" class="btn left"
:class="{'active-btn':activeBtnType}" :class="{'active-btn':activeBtnType}"
@click="headBtnClick"> @click="headBtnClick(true)">
{{headBtn.leftName}} {{headBtn.leftName}}
</div> </div>
<div class="line"></div> <div class="line"></div>
<div <div
class="btn right" class="btn right"
:class="{'active-btn':!activeBtnType}" :class="{'active-btn':!activeBtnType}"
@click="headBtnClick"> @click="headBtnClick(false)">
{{headBtn.rightName}} {{headBtn.rightName}}
</div> </div>
</div> </div>
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
this.$rocNative.goBack() this.$rocNative.goBack()
} }
}, },
headBtnClick() { headBtnClick(val) {
this.$emit('handleBtn') this.$emit('handleBtn', val)
}, },
rightBtnClick() { rightBtnClick() {
this.$emit('handleRightBtn') this.$emit('handleRightBtn')
......
export const wxShare = {
shareUrl: '',
title1: '您的好友邀请您领取医学课程',
title2: '参与云鹊奖活动,领取免费课程,赢取iphone11等丰厚奖品',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share2.png'
}
\ No newline at end of file
...@@ -160,4 +160,33 @@ ...@@ -160,4 +160,33 @@
} }
} }
} }
.no-data {
margin-top: 112px;
img {
width: 150px;
height: 150px;
display: block;
margin: 0 auto;
}
p {
color: #999999;
font-size: 15px;
line-height: 21px;
margin-top: 5px;
margin-bottom: 30px;
text-align: center;
}
.button {
color: #fff;
font-size: 15px;
font-weight: 700;
width: 180px;
height: 45px;
line-height: 45px;
text-align: center;
background: linear-gradient(270deg,rgba(255,88,36,1) 0%,rgba(254,163,86,1) 100%);
border-radius: 22.5px;
margin: 0 auto;
}
}
} }
\ No newline at end of file
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="main-content"> <div class="main-content" v-if="!noContributionRanking">
<div class="description description-h" v-if="activeBtnType"><span>{{dealRankName(hospitalRanking.hospitalType)}}</span>排行实时刷新,部分原因存在几分钟延迟</div> <div class="description description-h" v-if="activeBtnType"><span>{{dealRankName(hospitalRanking.hospitalType)}}</span>排行实时刷新,部分原因存在几分钟延迟</div>
<div class="description description-d" v-else>排行实时刷新,部分原因存在几分钟延迟</div> <div class="description description-d" v-else>排行实时刷新,部分原因存在几分钟延迟</div>
<div class="ranking-title"> <div class="ranking-title">
...@@ -74,11 +74,19 @@ ...@@ -74,11 +74,19 @@
<p class="num">{{itemD.score}}</p> <p class="num">{{itemD.score}}</p>
</div> </div>
</div> </div>
</div>
<div class="main-content" v-if="noContributionRanking">
<div class="no-data">
<img src="~/assets/img/icon-nodata.png" alt="">
<p>暂无记录,您还没有参加活动</p>
<div class="button" @click="goInActivity">立即参加</div>
</div>
</div>
<footer-button <footer-button
v-if="!noContributionRanking"
:btnText="btnText" :btnText="btnText"
:btnType="btnType"> :btnType="btnType">
</footer-button> </footer-button>
</div>
</section> </section>
</template> </template>
...@@ -105,7 +113,8 @@ ...@@ -105,7 +113,8 @@
hospitalRanking: {}, hospitalRanking: {},
contributionRanking: {}, contributionRanking: {},
btnText: '助力机构 创造佳绩', btnText: '助力机构 创造佳绩',
btnType: true btnType: true,
noContributionRanking: false //是否有人员贡献榜单数据
}; };
}, },
computed: { computed: {
...@@ -115,8 +124,11 @@ ...@@ -115,8 +124,11 @@
this.getRankData(); this.getRankData();
}, },
methods: { methods: {
changeRanking() { goInActivity() {
this.activeBtnType = !this.activeBtnType; this.$router.push('/in-activity')
},
changeRanking(val) {
this.activeBtnType = val;
this.getRankData() this.getRankData()
}, },
dealRankName(hospitalType) { dealRankName(hospitalType) {
...@@ -140,6 +152,7 @@ ...@@ -140,6 +152,7 @@
} }
}, },
getHospitalRanking() { getHospitalRanking() {
this.noContributionRanking = false;
getHospitalRanking().then(res => { getHospitalRanking().then(res => {
if(res.code == '000000') { if(res.code == '000000') {
this.hospitalRanking = res.data; this.hospitalRanking = res.data;
...@@ -150,6 +163,11 @@ ...@@ -150,6 +163,11 @@
getContributionRanking().then(res => { getContributionRanking().then(res => {
if(res.code == '000000') { if(res.code == '000000') {
this.contributionRanking = res.data; this.contributionRanking = res.data;
if(this.contributionRanking.topRankList.length) {
this.noContributionRanking = false;
} else {
this.noContributionRanking = true;
}
} }
}) })
......
<template> <template>
<div class="in-activity-wrap" :style="{paddingTop: padTop + 'px'}"> <div class="in-activity-wrap">
<div :style="{width: '375px',height: padTop + 'px', background: '#fff'}"></div>
<h5header <h5header
v-if="!isWeb" v-if="!isWeb"
title="云鹊奖2019" title="云鹊奖2019"
:baseShowHeight="0"
:isOpacity="false" :isOpacity="false"
:shareObj="shareObj" :shareObj="shareObj"
:isCheckAuth="true" :isCheckAuth="true"
...@@ -182,22 +182,31 @@ ...@@ -182,22 +182,31 @@
<div class="full-screen-mask"></div> <div class="full-screen-mask"></div>
<div class="content-wrap"> <div class="content-wrap">
<img class="back-image" src="../assets/img/stage-two/clock-success-bg.png" alt=""> <img class="back-image" src="../assets/img/stage-two/clock-success-bg.png" alt="">
<!-- <img class="back-image" src="../assets/img/stage-two/win-award-bg.png" alt=""> -->
<!-- <img class="back-image" src="../assets/img/stage-two/award-cup-bg.png" alt=""> -->
<p class="title">打卡成功</p> <p class="title">打卡成功</p>
<p class="message">已获得: {{vm.clockAward.mark}}勤奋分, {{vm.clockAward.bean}}云鹊豆</p> <p class="message">已获得: {{clockAward.mark}}勤奋分, {{clockAward.bean}}云鹊豆</p>
<div @click="hideClockModal" class="bottom-btn">我知道了</div> <div @click="hideClockModal" class="bottom-btn">我知道了</div>
<div class="close-btn"></div> </div>
</div>
<!-- 获奖弹窗 -->
<div v-if="awardModalShow" class="toast-wrap" @touchmove.prevent>
<div class="full-screen-mask"></div>
<div class="content-wrap">
<img class="back-image" src="../assets/img/stage-two/win-award-bg.png" alt="">
<p class="title">昨日个人排名获奖啦</p>
<p class="message">恭喜您获得了{{yestodayAwards}}1台</p>
<div @click="goQuest" class="bottom-btn">领奖</div>
<div class="close-btn" @click="awardModalShow=false"></div>
</div> </div>
</div> </div>
<!-- 活动结束 弹窗--> <!-- 活动结束 弹窗-->
<div v-if="activityEndVisible" class="toast-wrap" @touchmove.prevent> <div v-if="!awardModalShow && activityEndVisible" class="toast-wrap" @touchmove.prevent>
<div class="full-screen-mask"></div> <div class="full-screen-mask"></div>
<div class="content-wrap activity-end"> <div class="content-wrap activity-end">
<p class="content-text">本次活动已结束,感谢您的参与,最终获奖排名将于12月30日10点公布,届时查看</p> <p class="content-text">本次活动已结束,感谢您的参与,最终获奖排名将于12月30日10点公布,届时查看</p>
<ul class="btn-list"> <ul class="btn-list">
<li>我知道了</li> <li @click="goBack">我知道了</li>
<li @click="goToYesterdayPrize" class="high-light">查看昨日获奖</li> <li @click="goToYesterdayPrize" class="high-light">查看昨日获奖</li>
</ul> </ul>
</div> </div>
...@@ -207,19 +216,27 @@ ...@@ -207,19 +216,27 @@
</template> </template>
<script> <script>
import { getUserScoreInfo, getInviteList, getClockStatus, goToUpdateClock } from '@/service/activityMainpage'; import { getActivityId, getBEServerTime, getUserScoreInfo, getInviteList, getClockStatus, goToUpdateClock, getTimsActivityInfo, selectAppModuleParam, checkToken, getRole, sayHello, getEncryptId } from '@/service/activityMainpage';
import { checkHospitalStatus } from '@/service'; import { checkHospitalStatus } from '@/service';
import h5header from '@/components/h5header'; import h5header from '@/components/h5header';
import { getShareUrl } from '@/utils/index'; import { getShareUrl } from '@/utils/index';
import { Toast } from 'vant'; import { Toast } from 'vant';
import { setEventByModuleCode, getFirstAwards } from '@/utils';
import { ENV_CONFIG } from '@/utils/enumerate';
import { wxShare } from '@/configs/wxShare';
const cookies = require('cookie-universal')(); const cookies = require('cookie-universal')();
let vm = null; let vm = null;
export default { export default {
data () { data () {
return { return {
awardModalShow: false, // 根据排名是否显示中奖弹窗
showAwadModal: true, // 根据活动时间是否展示中奖弹层以及查看昨日榜单逻辑
yestodayAwards: '', // 昨日可获得
token: '',
activityId: 2, // 上线前等产品通知修改默认值
encryptId: '', // 加密后的id,(分享传参用)
serverTime: '', serverTime: '',
isLogin: false, // 是否 已登录 isLogin: false, // 是否 已登录
isJoin: false, // 是否 已加入机构 默认为false isJoin: false, // 是否 已加入机构 默认为false
...@@ -245,6 +262,8 @@ ...@@ -245,6 +262,8 @@
eachInviteAward: { // 每邀请1位医生好友领取课程,+??勤奋分 +??云鹊豆 (默认均为20) eachInviteAward: { // 每邀请1位医生好友领取课程,+??勤奋分 +??云鹊豆 (默认均为20)
mark: 20, // 勤奋分 mark: 20, // 勤奋分
bean: 20, // 云鹊豆 bean: 20, // 云鹊豆
taskId: '',
activityId: '',
}, },
doctorInfo: { doctorInfo: {
name: '', // 接口返回用户名字或者手机号带遮掩 name: '', // 接口返回用户名字或者手机号带遮掩
...@@ -258,13 +277,14 @@ ...@@ -258,13 +277,14 @@
hospitalLevelScore: [], // 三阶段达标分值, 数组返回 hospitalLevelScore: [], // 三阶段达标分值, 数组返回
targetRequiredScore: '', // 再获得多少分 // 再获得10勤奋分即可上升到前10名获得欧姆龙温度计 targetRequiredScore: '', // 再获得多少分 // 再获得10勤奋分即可上升到前10名获得欧姆龙温度计
targetRank: '', // 上升到多少名 targetRank: '', // 上升到多少名
todayDate: 0, todayDate: 0, // 今日服务器时间(用来展示对应奖项)
yesterdayDate: 0, yesterdayDate: 0, // 昨日服务器时间(用来展示对应奖项)
userYesterdayRank: 0, // 用戶昨日排名 userYesterdayRank: 0, // 用戶昨日排名
}, },
clockSuccessVisible: false, // 是否显示 打卡成功 弹窗 clockSuccessVisible: false, // 是否显示 打卡成功 弹窗
activityEndVisible: false, // 是否显示 活动结束 弹窗 activityEndVisible: false, // 是否显示 活动结束 弹窗
yesterdayWinVisible: false,
inviteList: [], // 已邀请的用户列表 inviteList: [], // 已邀请的用户列表
notInviteShowList: [], // 未邀请的默认显示 notInviteShowList: [], // 未邀请的默认显示
...@@ -279,9 +299,11 @@ ...@@ -279,9 +299,11 @@
clockAward: { // 打卡的奖励 默认都是5 clockAward: { // 打卡的奖励 默认都是5
mark: 5, mark: 5,
bean: 5, bean: 5,
activityId: '',
id: '',
}, },
isWeb: false, isWeb: false,
shareObj: {}, shareObj: wxShare,
padTop: 0 padTop: 0
} }
}, },
...@@ -292,6 +314,9 @@ ...@@ -292,6 +314,9 @@
returnBeanImg() { returnBeanImg() {
let hospitalScore = vm.doctorInfo.hospitalScore; let hospitalScore = vm.doctorInfo.hospitalScore;
let arr = vm.doctorInfo.hospitalLevelScore; let arr = vm.doctorInfo.hospitalLevelScore;
if(arr && arr.length < 1){
return;
}
if( hospitalScore < arr[0]){ if( hospitalScore < arr[0]){
return require(`../assets/img/stage-two/bean-stage-0.png`); return require(`../assets/img/stage-two/bean-stage-0.png`);
}else if( ((arr[0] == hospitalScore) || (arr[0] < hospitalScore)) && (hospitalScore < arr[1]) ){ }else if( ((arr[0] == hospitalScore) || (arr[0] < hospitalScore)) && (hospitalScore < arr[1]) ){
...@@ -319,25 +344,35 @@ ...@@ -319,25 +344,35 @@
} }
return `再获得${vm.doctorInfo.targetRequiredScore}勤奋分即可上升到前${vm.doctorInfo.targetRank}名获得${award}` return `再获得${vm.doctorInfo.targetRequiredScore}勤奋分即可上升到前${vm.doctorInfo.targetRank}名获得${award}`
} }
} },
}, },
created() { created() {
vm = this; vm = this;
// 取服务器时间,切换不同时间段的显示
vm.getServerTime();
}, },
mounted() { mounted() {
vm.getUserActivityInfo(); // // 这里需要删掉!!!
vm.shareObj = { // vm.getUserActivityInfo();
shareUrl: window.location.href, // vm.getTasks();
title1: '分享title分享title', // // 这里需要删掉!!!
title2: '分享desc分享desc',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share.png'
}
vm.isWeb = vm.$rocNative.isWeb; vm.isWeb = vm.$rocNative.isWeb;
vm.getTasks(); // 放到登录后或其他************************ // 取服务器时间,切换不同时间段的显示
vm.getServerTime();
// 请求接口获取activityId (经与后端产品确认,默认没传id的话,就取接口;默认有的话就不取接口)
if( !vm.activityId ){
getActivityId().then(res => {
alert('guhui 获取id')
alert(JSON.stringify(res))
if(res && res.code == '000000' ){
let data = res.data ;
for(let i in data){
if(data[i] == 'ID'){
vm.activityId = i;
}
}
}
})
}
vm.$rocNative.appInit(); vm.$rocNative.appInit();
vm.getUserInfo(); // 判断是否登录 vm.getUserInfo(); // 判断是否登录
...@@ -349,26 +384,61 @@ ...@@ -349,26 +384,61 @@
} }
} }
}, },
methods: { methods: {
// 获取服务器时间 // 获取服务器时间
getServerTime() { getServerTime() {
// 调取接口获取服务器时间 // 调取接口获取服务器时间
// request else vm.serverTime = new Date().getTime(); getBEServerTime().then(res => {
vm.serverTime = 1577376000000; // alert('服务器时间');
// alert(JSON.stringify(res))
if(res && res.code == '000000' ){
vm.serverTime = res.data;
}else{
vm.serverTime = new Date().getTime();
}
})
// vm.serverTime = 1577376000000;
}, },
hideClockModal() { hideClockModal() {
vm.clockSuccessVisible = false; vm.clockSuccessVisible = false;
}, },
goQuest(){
// window.location.href = 'https://wj.qq.com/s2/5112128/18be/';
let url = 'https://wj.qq.com/s2/5112128/18be/';
let paramList = [
{
"key":"pageUrl",
"value": url,
"type":4,
"seqNo":1
},{
"key":"showTitle",
"value": false,
"type":1,
"seqNo":2
},{
"key":"title",
"value": '',
"type":1,
"seqNo":3
}
]
vm.$rocNative.dispatchEventByModuleCode && vm.$rocNative.dispatchEventByModuleCode({
modeCode: 'M300',
jsonString: paramList
})
},
returnStageText() { returnStageText() {
if(vm.currentStage == 0){ if(vm.currentStage == 0){
return ''; return require(`../assets/img/stage-two/stage-01-text.png`);
}else{ }else{
return require(`../assets/img/stage-two/stage-0${vm.currentStage}-text.png`); return require(`../assets/img/stage-two/stage-0${vm.currentStage}-text.png`);
} }
}, },
returnAwardPic() { returnAwardPic() {
if(vm.currentStage == 0){ if(vm.currentStage == 0){
return ''; return require(`../assets/img/stage-two/award-01-pic.png`)
}else{ }else{
return require(`../assets/img/stage-two/award-0${vm.currentStage}-pic.png`) return require(`../assets/img/stage-two/award-0${vm.currentStage}-pic.png`)
} }
...@@ -398,7 +468,8 @@ ...@@ -398,7 +468,8 @@
vm.$rocNative.getUserInfo().then(params => { vm.$rocNative.getUserInfo().then(params => {
// _seft.userToken = params.userToken; // 存到store里 // _seft.userToken = params.userToken; // 存到store里
if(params && params.userToken){ if(params && params.userToken){
cookies.set('token', params.userToken) cookies.set('token', params.userToken);
vm.token = params.userToken;
} }
// alert(JSON.stringify(params)); // alert(JSON.stringify(params));
if(params && params.userMobile){ // 已登录 (有手机号表示 已登录,无手机号表示 未登录) if(params && params.userMobile){ // 已登录 (有手机号表示 已登录,无手机号表示 未登录)
...@@ -408,6 +479,8 @@ ...@@ -408,6 +479,8 @@
}else{ // 未登录 }else{ // 未登录
vm.isLogin = false; vm.isLogin = false;
} }
// 登录状态确定后,再调任务接口,以便获取打卡状态
vm.getTasks();
}); });
}, },
...@@ -415,29 +488,51 @@ ...@@ -415,29 +488,51 @@
appLogin() { appLogin() {
vm.$rocNative.gotoLogin(); vm.$rocNative.gotoLogin();
}, },
// 登陆ok后 回调: 获取邀请的医生列表等。。 // 登陆ok后 回调: 获取邀请的医生列表 & 检查是否加入机构
loginCallback() { loginCallback() {
vm.getUserActivityInfo(); vm.getUserActivityInfo();
vm.goToCheckJoin(); vm.goToCheckJoin();
getEncryptId().then(res => {
alert('获取加密过后的id');
alert(JSON.stringify(res))
if( res && res.code && res.code == '000000' ){
vm.encryptId = res.data;
}else{
vm.$toast(res.message);
}
})
}, },
getUserActivityInfo() { // 获取用户及参加活动的具体信息 getUserActivityInfo() { // 获取用户及参加活动的具体信息
getUserScoreInfo().then(res => { getUserScoreInfo().then(res => {
// alert('获取用户及分数信息。。。'); // alert('获取用户及分数信息。。。');
// alert(JSON.stringify(res)); // alert(JSON.stringify(res));
vm.doctorInfo = res.data; vm.doctorInfo = res.data;
if(vm.doctorInfo.userYesterdayRank==1){
vm.awardModalShow = true;
vm.yestodayAwards = getFirstAwards(vm.doctorInfo.yesterdayDate);
}else if(vm.doctorInfo.userYesterdayRank>=2 && vm.doctorInfo.userYesterdayRank<=3){
vm.awardModalShow = true;
vm.yestodayAwards = vm.awardList.No3;
}else if(vm.doctorInfo.userYesterdayRank>=4 && vm.doctorInfo.userYesterdayRank<=10){
vm.awardModalShow = true;
vm.yestodayAwards = vm.awardList.No10;
}else{
vm.awardModalShow = false;
}
}); });
}, },
goToCheckJoin() { // 检查是否加入结构 goToCheckJoin() { // 检查是否加入结构
checkHospitalStatus(vm.appUserInfo.userToken).then(res => { checkHospitalStatus(vm.appUserInfo.userToken).then(res => {
alert('检查是否加入结构') // alert('检查是否加入结构')
alert(JSON.stringify(res)) // alert(JSON.stringify(res))
if(res && res.code == '000000' ){ if(res && res.code == '000000' ){
const status = res.data.status; const status = res.data.status;
// const status = 15; // test。。。。。。。。。。。。。。。。。 // const status = 15; // test。。。。。。。。。。。。。。。。。
if (status && status == 1) { // 机构状态正常 if (status && status == 1) { // 机构状态正常
vm.isJoin = true; vm.isJoin = true;
vm.joinStatus = 1; vm.joinStatus = 1;
vm.getTaskStatus(vm.clockAward); // *******************************************
vm.handleGetInviteList(); //登录且已加入机构才获取医生邀请了的列表 vm.handleGetInviteList(); //登录且已加入机构才获取医生邀请了的列表
}else if (status && status == 15) { // 15创建机构审核中 }else if (status && status == 15) { // 15创建机构审核中
vm.isJoin = false; vm.isJoin = false;
...@@ -532,6 +627,7 @@ ...@@ -532,6 +627,7 @@
}); });
}, },
handleLoginCheck(cb) { handleLoginCheck(cb) {
vm.shareObj.shareUrl = vm.shareWxUrl();
if( !this.isLogin ){ // 未登录 >>> 去登录 if( !this.isLogin ){ // 未登录 >>> 去登录
this.goToLogin(); this.goToLogin();
}else if( this.isLogin && !this.isJoin ){ // 已登录 && 未加入机构 >>>> 去加入机构 }else if( this.isLogin && !this.isJoin ){ // 已登录 && 未加入机构 >>>> 去加入机构
...@@ -562,12 +658,19 @@ ...@@ -562,12 +658,19 @@
name: 'hospital-ranking', name: 'hospital-ranking',
}); });
}, },
goBack(){
this.$rocNative.goBack();
},
// 昨日获奖 // 昨日获奖
goToYesterdayPrize() { goToYesterdayPrize() {
alert('跳转至 昨日获奖页面') alert('跳转至 昨日获奖页面')
if(!this.showAwadModal){
return;
}else{
this.$router.push({ this.$router.push({
name: 'yesterday-prize', name: 'yesterday-prize',
}); });
}
}, },
// 云鹊豆中心 // 云鹊豆中心
goToBeanCenter() { goToBeanCenter() {
...@@ -621,21 +724,20 @@ ...@@ -621,21 +724,20 @@
name: 'invite-details', name: 'invite-details',
}); });
}, },
shareWxUrl() {
return `${getShareUrl()}year_end_ssr/shareActive?id=${vm.encryptId}&taskId=${vm.eachInviteAward.taskId}&activityId=${vm.eachInviteAward.activityId}`
},
// 去邀请 按钮 // 去邀请 按钮
handleInviteClick() { handleInviteClick() {
vm.shareObj.shareUrl = vm.shareWxUrl();
let cb = this.goToShare; let cb = this.goToShare;
this.handleLoginCheck(cb); this.handleLoginCheck(cb);
}, },
goToShare() { goToShare() {
alert('调app分享'); alert('调app分享');
// let id = vm.encryptDoctorId(); // let id = vm.encryptDoctorId();
let params = {
id: '',
taskId: '',
activityId: '',
};
// 调用APP分享 // 调用APP分享
this.$rocNative.shareWechat(this.shareObj);
}, },
encryptDoctorId() { encryptDoctorId() {
...@@ -643,7 +745,7 @@ ...@@ -643,7 +745,7 @@
// return 'dddddd' // return 'dddddd'
}, },
// 去打卡 按钮 // 去完成任务 按钮
goToFinish(item) { goToFinish(item) {
let cb = () => { let cb = () => {
vm.goToFinishCB(item); vm.goToFinishCB(item);
...@@ -669,6 +771,7 @@ ...@@ -669,6 +771,7 @@
if(res && res.code == '000000'){ if(res && res.code == '000000'){
if(res.data){ // 打卡成功 if(res.data){ // 打卡成功
vm.clockSuccessVisible = true; vm.clockSuccessVisible = true;
vm.isClockFinish = true;
}else{ }else{
vm.$toast(res.message); vm.$toast(res.message);
} }
...@@ -677,9 +780,17 @@ ...@@ -677,9 +780,17 @@
} }
}) })
} }
}else{ // 非打卡,直接走积木tims跳转逻辑
// alert('去课程或者患者招募 。。。。。。')
if(item.isFinish == 0){ // 已完成 不可点
return;
}
vm.jumpPage(item.linkId);
} }
}, },
// 每个任务的跳转点击 // 每个任务的跳转点击
handleTaskClick() { handleTaskClick() {
let cb = this.goToTask; let cb = this.goToTask;
...@@ -691,164 +802,14 @@ ...@@ -691,164 +802,14 @@
// 获取每日任务 及 邀请医生好友学课程里的 邀请1位医生的勤奋分及云鹊豆个数 // 获取每日任务 及 邀请医生好友学课程里的 邀请1位医生的勤奋分及云鹊豆个数
getTasks() { getTasks() {
// debugger; // debugger;
let res = { getTimsActivityInfo(vm.activityId).then(res => {
"data": { // alert('^^^^^获取任务信息…………………………')
"loginStatus": 2, // alert(JSON.stringify(res))
"taskRuleData": [ if(res && res.code == '000000'){
{ if(!vm.checkTimeStatus(res.data)){
"id": 14, this.activityEndVisible = true;
"activityId": 2, return;
"resourceType": 7, // 业务类型 1.课程 2.考试 3.调查问卷 4.患者招募 5.宣教漫画 6.打卡 7.邀请
"resourceId": "1",
"resourceChildId": null,
"defaultBackgroundImage": "https://test1-file.yunqueyi.com/image/png/common/2019112809513020.png",
"finishBackgroundImage": null,
"taskFrequency": 1,
"finishFrequency": 1,
"cumulativeFrequency": null,
"ruleName": "邀请好友测试",
"beginTime": "2019-11-26 00:00:00",
"endTime": "2019-11-27 23:59:59",
"linkId": 1703,
"rewardJsonInfo": [{rewardType:3,rewardQuantity:"100"},{rewardType:1,rewardQuantity:"200"}],
"pushType": 1,
"pushLinkUrl": "",
"hideEndFlag": 2,
"seqNo": 1,
"deleteFlag": 1,
"createdId": 161,
"createdTime": "2019-11-28 09:51:58",
"modifiedId": 161,
"modifiedTime": "2019-11-29 15:30:54",
"beginTimeStr": null,
"endTimeStr": null,
"nowCumulativeFrequency": 0,
"isFinish": 0,
"doctorFinishFrequency": null,
"timeStatus": 1 // 项目时间状态 1.进行中 2.结束 3.未开始
},
{
"id": 15,
"activityId": 2,
"resourceType": 6, // 业务类型 1.课程 2.考试 3.调查问卷 4.患者招募 5.宣教漫画 6.打卡 7.邀请
"resourceId": "2",
"resourceChildId": null,
"defaultBackgroundImage": "https://test1-file.yunqueyi.com/image/png/common/2019112809513020.png",
"finishBackgroundImage": null,
"taskFrequency": 1,
"finishFrequency": 1,
"cumulativeFrequency": null,
"ruleName": "每日打卡test",
"beginTime": "2019-11-26 00:00:00",
"endTime": "2019-11-27 23:59:59",
"linkId": 1703,
"rewardJsonInfo": [{rewardType:3,rewardQuantity: 111},{rewardType:1,rewardQuantity:0}],
"pushType": 1,
"pushLinkUrl": "",
"hideEndFlag": 2,
"seqNo": 2,
"deleteFlag": 1,
"createdId": 161,
"createdTime": "2019-11-28 09:51:58",
"modifiedId": 161,
"modifiedTime": "2019-11-29 15:30:54",
"beginTimeStr": null,
"endTimeStr": null,
"nowCumulativeFrequency": 0,
"isFinish": 0,
"doctorFinishFrequency": null,
"timeStatus": 1
},
{
"id": 15,
"activityId": 2,
"resourceType": 1, // 业务类型 1.课程 2.考试 3.调查问卷 4.患者招募 5.宣教漫画 6.打卡 7.邀请
"resourceId": "2",
"resourceChildId": null,
"defaultBackgroundImage": "https://test1-file.yunqueyi.com/image/png/common/2019112809513020.png",
"finishBackgroundImage": null,
"taskFrequency": 1,
"finishFrequency": 1,
"cumulativeFrequency": null,
"ruleName": "高血压课程",
"beginTime": "2019-11-26 00:00:00",
"endTime": "2019-11-27 23:59:59",
"linkId": 1703,
"rewardJsonInfo": [{rewardType:3,rewardQuantity: 222},{rewardType:1,rewardQuantity:0}],
"pushType": 1,
"pushLinkUrl": "",
"hideEndFlag": 2,
"seqNo": 2,
"deleteFlag": 1,
"createdId": 161,
"createdTime": "2019-11-28 09:51:58",
"modifiedId": 161,
"modifiedTime": "2019-11-29 15:30:54",
"beginTimeStr": null,
"endTimeStr": null,
"nowCumulativeFrequency": 0,
"isFinish": 1,
"doctorFinishFrequency": null,
"timeStatus": 1
},
{
"id": 15,
"activityId": 2,
"resourceType": 4, // 业务类型 1.课程 2.考试 3.调查问卷 4.患者招募 5.宣教漫画 6.打卡 7.邀请
"resourceId": "2",
"resourceChildId": null,
"defaultBackgroundImage": "https://test1-file.yunqueyi.com/image/png/common/2019112809513020.png",
"finishBackgroundImage": null,
"taskFrequency": 1,
"finishFrequency": 1,
"cumulativeFrequency": null,
"ruleName": "SMO患者招募",
"beginTime": "2019-11-26 00:00:00",
"endTime": "2019-11-27 23:59:59",
"linkId": 1703,
"rewardJsonInfo": [{rewardType:3,rewardQuantity: 0},{rewardType:1,rewardQuantity:99}],
"pushType": 1,
"pushLinkUrl": "",
"hideEndFlag": 2,
"seqNo": 2,
"deleteFlag": 1,
"createdId": 161,
"createdTime": "2019-11-28 09:51:58",
"modifiedId": 161,
"modifiedTime": "2019-11-29 15:30:54",
"beginTimeStr": null,
"endTimeStr": null,
"nowCumulativeFrequency": 0,
"isFinish": 0,
"doctorFinishFrequency": null,
"timeStatus": 1
} }
],
"activityData": {
"id": 2,
"activityName": "hws-test",
"isDisabled": 1,
"unloginBackgroundImage": "https://test1-file.yunqueyi.com/image/png/common/20191129095943428.png",
"loginBackgroundImage": "https://test1-file.yunqueyi.com/image/png/common/20191129095948283.png",
"rewardType": "5",
"beginTime": "2019-11-25 00:00:00",
"endTime": "2019-11-30 23:59:59",
"beginTimeStr": null,
"endTimeStr": null,
"deleteFlag": 1,
"createdId": 161,
"createdTime": "2019-11-26 10:43:40",
"modifiedId": 161,
"modifiedTime": "2019-11-29 15:30:54",
"status": null
}
},
"code": "000000",
"message": "成功"
};
let data = res.data; let data = res.data;
let taskRuleData = data.taskRuleData || []; let taskRuleData = data.taskRuleData || [];
...@@ -856,7 +817,10 @@ ...@@ -856,7 +817,10 @@
let item = taskRuleData[i]; let item = taskRuleData[i];
let rewardList = []; let rewardList = [];
// 获取 邀请节点,进行中 此时获取邀请1个医生对应的 分数 和 豆子 // 获取 邀请节点,进行中 此时获取邀请1个医生对应的 分数 和 豆子
if( item.resourceType == 7 && item.resourceId == 1 && item.timeStatus == 1){ if( item.resourceType == 7 && item.resourceId == 1){
vm.eachInviteAward.taskId = item.id;
vm.eachInviteAward.activityId = item.activityId;
if( item.timeStatus == 1 ){
rewardList = item.rewardJsonInfo || []; rewardList = item.rewardJsonInfo || [];
for( let j=0; j<rewardList.length; j++ ){ for( let j=0; j<rewardList.length; j++ ){
if( rewardList[j].rewardType == 3 ){ // 勤奋分 if( rewardList[j].rewardType == 3 ){ // 勤奋分
...@@ -865,6 +829,7 @@ ...@@ -865,6 +829,7 @@
vm.eachInviteAward.bean = rewardList[j].rewardQuantity; vm.eachInviteAward.bean = rewardList[j].rewardQuantity;
} }
} }
}
}else if( item.resourceType == 6 && item.timeStatus == 1 ){ // 打卡 默认奖励 5分 5豆 }else if( item.resourceType == 6 && item.timeStatus == 1 ){ // 打卡 默认奖励 5分 5豆
item.eachInviteAwardMark = 5; item.eachInviteAwardMark = 5;
item.eachInviteAwardBean = 5; item.eachInviteAwardBean = 5;
...@@ -877,6 +842,9 @@ ...@@ -877,6 +842,9 @@
}; };
vm.taskObj.clock = item; vm.taskObj.clock = item;
if(vm.isLogin){ // 登录后,获取打卡状态
vm.goToGetClockStatus(vm.clockAward);
}
}else if( item.resourceType == 1 && item.timeStatus == 1 ){ // 课程 默认奖励 20分 20豆 }else if( item.resourceType == 1 && item.timeStatus == 1 ){ // 课程 默认奖励 20分 20豆
item.eachInviteAwardMark = 20; item.eachInviteAwardMark = 20;
item.eachInviteAwardBean = 20; item.eachInviteAwardBean = 20;
...@@ -900,10 +868,21 @@ ...@@ -900,10 +868,21 @@
if( vm.taskObj.smo ){ if( vm.taskObj.smo ){
vm.taskList.push( vm.taskObj.smo ); vm.taskList.push( vm.taskObj.smo );
} }
}else{
vm.$toast(res.message);
}
})
},
// 校验活动是否结束
checkTimeStatus(data){
const { timeStatus } = data.activityData;
// timeStatus 活动时间状态 1:在活动时间范围 2.已经结束 3.未开始
if(timeStatus==2){
return false;
}
return true;
}, },
getTaskStatus(params) { goToGetClockStatus(params) {
vm.isClockFinish = false; vm.isClockFinish = false;
getClockStatus(params).then(res => { getClockStatus(params).then(res => {
if(res && res.code == '000000'){ if(res && res.code == '000000'){
...@@ -968,9 +947,159 @@ ...@@ -968,9 +947,159 @@
} }
return text; return text;
}, },
async jumpPage(url, id) {
const _this = this;
if (!!url) {
// 判断是否有跳转
const { token } = _this;
const { data } = await selectAppModuleParam({
id: url,
token
});
alert('inJumpage'); alert(JSON.stringify(data))
const itemData = data.model;
// 增加点击图片时候,是否有loginFlag参数,有,则校验并登录。如未登录去登录,已登录,老逻辑。
const loginFlag = this.checkLoginFlag(itemData.paramList);
if(loginFlag){
_this.refreshFlag = true;
_this.$rocNative.getToken().then(res => {
const { userToken } = res;
// alert('APP拿到的token=:'+userToken)
checkToken({ token: userToken }).then(res=>{
if(res.code == '200000' || res.code == '200006') {
_this.$rocNative.gotoLogin();
}else{
_this.oldJumpHandle(itemData, userToken);
}
})
});
}else{
_this.oldJumpHandle(itemData, _this.token);
}
}
},
// 增加一个点击图片请求selectAppModuleParam这个接口时候的 loginFlag 字段校验
checkLoginFlag(paramList){
let flag = false;
for(let i=0;i<paramList.length;i++){
if(paramList[i].key === 'loginFlag' && paramList[i].value === '1'){
flag = true;
break;
}
}
return flag;
},
// 原先的点击图片跳转逻辑
oldJumpHandle(itemData, token){ alert('oldJUmpHundalsdllksllll')
// 不改动原先逻辑
if (itemData.code == 'M301') {
itemData.code = 'M300';
//鉴权 自己调用token
this.$rocNative.getToken().then(res => {
const { userToken } = res;
// setCookie('token', userToken);
// setCookie('headToken', userToken);
cookies.set('token', userToken);
cookies.set('headToken', userToken);
this.setJQ(itemData, userToken);
});
} else {
const paramList = setEventByModuleCode(
itemData,
token
);
this.$rocNative.dispatchEventByModuleCode({
modeCode: itemData.code,
jsonString: paramList
});
}
},
//鉴权 自己调用token 是否认证
setJQ(itemData, token) {
this.itemData = itemData;
this.getUserInfo2(itemData, token);
},
// 兼容Andriod新版本
getUserInfo2(itemData, token) {
this.$rocNative
.getUserInfo()
.then(params => {
this.token = params.userToken;
// setCookie('headToken', params.userToken)
cookies.set('headToken', params.userToken);
// this.prbateFun(this.itemData, this.token);
getRole({token: this.token}).then(res => {
if (res.code == '000000') {
if (res.data.role == 4) {
if (res.data.flag == 1) {
this.setJQ2(itemData, token);
} else {
this.$rocNative.showNativeToast({
message: '请加入机构,再尝试访问!'
});
}
} else if (res.data.role == 2) {
this.$rocNative.showNativeToast({
message: '仅限认证用户浏览 '
});
} else if (res.data.role == 3) {
this.$rocNative.showNativeToast({
message: '仅限认证且加入机构的用户浏'
});
}
} else {
this.$rocNative.showNativeToast({
message: res.message
});
}
});
});
},
setJQ2(itemData, token) {
let _this = this,
para = {
token: this.token,
setEntry: 'headers'
};
sayHello(para).then(res => {
if (res.code == '000000') {
_this.nonce_str = res.data.nonce_str;
itemData.paramList.push({
id: 598,
key: 'nonce_str',
seqNo: 3,
type: 4,
value: res.data.nonce_str
});
let paramList = setEventByModuleCode(
itemData,
token
);
this.$rocNative.dispatchEventByModuleCode({
modeCode: itemData.code,
jsonString: paramList
});
} else {
this.$rocNative.showNativeToast({
message: res.message
});
}
});
},
getHeaderHeight(val){ getHeaderHeight(val){
this.padTop = val; this.padTop = val;
}, },
// 校验活动结束后1天还是2天,用以判断是否展示【昨日弹层】以及【昨日榜单】逻辑
checkActiveOver() {
const time2 = new Date('2019-12-31 00:00:00').getTime(); // 活动结束 二天
const nowTime = new Date().getTime(); // 当前时间戳
if(nowTime >= time2){ // 活动结束2天以上
this.showAwadModal = false;
}
}
}, },
} }
</script> </script>
......
...@@ -99,8 +99,8 @@ ...@@ -99,8 +99,8 @@
} }
}, },
methods: { methods: {
changeRanking() { changeRanking(val) {
this.activeBtnType = !this.activeBtnType this.activeBtnType = val;
this.getData(); this.getData();
}, },
handleRightBtn() { handleRightBtn() {
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<section> <section>
<div class="invite-info"> <div class="invite-info">
<img :src="avatarImageUrl" /> <img :src="avatarImageUrl" />
<p class="title1">{{ name }}邀请您助力 为他赢大奖</p> <p class="title1">{{ name }}邀请您领取医学课程</p>
<p class="title2">领取课程即可助他一臂之力</p> <p class="title2">参与云鹊奖活动,学习课程赢iphone11等奖品</p>
</div> </div>
<div class="page-info"> <div class="page-info">
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
<script> <script>
import { getInviteInfo, getCourseById, getCaptchaGet, getAuthCode } from '@/service'; import { getInviteInfo, getCourseById, getCaptchaGet, getAuthCode } from '@/service';
import { wxShare } from '@/configs/wxShare';
const TIMEALL = 60000; // 倒计时常量 60 秒 const TIMEALL = 60000; // 倒计时常量 60 秒
export default { export default {
data(){ data(){
...@@ -68,7 +69,8 @@ ...@@ -68,7 +69,8 @@
captchaAnswer: '', // 输入的图形验证码 captchaAnswer: '', // 输入的图形验证码
time: TIMEALL, time: TIMEALL,
btnMsg: '点击获取', btnMsg: '点击获取',
isReq: false isReq: false,
shareObj: wxShare,
} }
}, },
async asyncData({ query }){ async asyncData({ query }){
...@@ -93,17 +95,13 @@ ...@@ -93,17 +95,13 @@
document.querySelector('body').setAttribute('style', 'background: #FE9A51;'); document.querySelector('body').setAttribute('style', 'background: #FE9A51;');
this.checkCache(); this.checkCache();
// 微信分享 // 微信分享
this.shareObj = { this.shareObj.shareUrl = window.location.href;
shareUrl: window.location.href, window.localStorage.setItem('shareUrl', this.shareObj.shareUrl);
title1: '分享title分享title',
title2: '分享desc分享desc',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share.png'
}
this.$picaWxShare({ this.$picaWxShare({
// baseUrl: BASE_URL[process.env.NUXT_ENV_APP], // baseUrl: BASE_URL[process.env.NUXT_ENV_APP],
baseUrl: 'https://test1-sc.yunqueyi.com', baseUrl: 'https://test1-sc.yunqueyi.com',
type: 15, type: 15,
authUrl: window.location.href, authUrl: this.shareObj.shareUrl,
isDebug: false, isDebug: false,
jsApiList: [ jsApiList: [
'onMenuShareTimeline', 'onMenuShareTimeline',
...@@ -112,7 +110,7 @@ ...@@ -112,7 +110,7 @@
},(wx)=>{ },(wx)=>{
const title = this.shareObj.title1; const title = this.shareObj.title1;
const desc = this.shareObj.title2; const desc = this.shareObj.title2;
const link = window.location.href; const link = this.shareObj.shareUrl;
const imgUrl = this.shareObj.shareImageUrl; const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友 // 分享给朋友
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
</template> </template>
<script> <script>
import { wxShare } from '@/configs/wxShare';
export default { export default {
asyncData({ query }){ asyncData({ query }){
const { status } = query; // 上个页面传递过来领取结果, false 为已领取, true 为领取成功 const { status } = query; // 上个页面传递过来领取结果, false 为已领取, true 为领取成功
...@@ -61,20 +62,20 @@ ...@@ -61,20 +62,20 @@
statusTxt statusTxt
} }
}, },
data(){
return {
shareObj: wxShare,
}
},
mounted(){ mounted(){
document.querySelector('body').setAttribute('style', 'background: "";'); document.querySelector('body').setAttribute('style', 'background: "";');
// 微信分享 // 微信分享
this.shareObj = { this.shareObj.shareUrl = window.localStorage.getItem('shareUrl') || window.location.href;
shareUrl: window.location.href,
title1: '分享title分享title',
title2: '分享desc分享desc',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share.png'
}
this.$picaWxShare({ this.$picaWxShare({
// baseUrl: BASE_URL[process.env.NUXT_ENV_APP], // baseUrl: BASE_URL[process.env.NUXT_ENV_APP],
baseUrl: 'https://test1-sc.yunqueyi.com', baseUrl: 'https://test1-sc.yunqueyi.com',
type: 15, type: 15,
authUrl: window.location.href, authUrl: this.shareObj.shareUrl,
isDebug: false, isDebug: false,
jsApiList: [ jsApiList: [
'onMenuShareTimeline', 'onMenuShareTimeline',
...@@ -83,7 +84,7 @@ ...@@ -83,7 +84,7 @@
},(wx)=>{ },(wx)=>{
const title = this.shareObj.title1; const title = this.shareObj.title1;
const desc = this.shareObj.title2; const desc = this.shareObj.title2;
const link = window.location.href; const link = this.shareObj.shareUrl;
const imgUrl = this.shareObj.shareImageUrl; const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友 // 分享给朋友
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
......
...@@ -9,10 +9,20 @@ export const getUserScoreInfo = () => { ...@@ -9,10 +9,20 @@ export const getUserScoreInfo = () => {
return request({ return request({
url: `campaign/ranking/user_info`, url: `campaign/ranking/user_info`,
method: 'post', method: 'post',
// withCredentials: true,
headers: {
token: 'D3FFA515261C48478773C0BA17C11F52'
}
})
}
// 获取服务器时间
//
export const getBEServerTime = () => {
return request({
url: `campaign/tims/getTodayDate`,
method: 'get',
withCredentials: true, withCredentials: true,
// headers: {
// token: '8F685DEFFEAC45C393AA55A4DD9E9048'
// }
}) })
} }
...@@ -47,5 +57,65 @@ export const goToUpdateClock = (params) => { ...@@ -47,5 +57,65 @@ export const goToUpdateClock = (params) => {
}) })
} }
// 获取activityId
export const getActivityId = () => {
return request({
url: `contents/commonComstant/selectByTypeCode?code=C015`,
method: 'get',
// withCredentials: true,
})
}
// 获取任务列表
export const getTimsActivityInfo = (id) => {
return request({
url: `campaign/tims/timsActivityInfo?activityId=${id}`,
method: 'get',
withCredentials: true,
})
}
export const selectAppModuleParam = async ({id, token }) => {
return request({
url: `/contents/contentAppModule/selectAppModuleParam?id=${id}&token=${token}&setEntry=true`,
withCredentials: true
});
}
export const checkToken = async({token}) => {
return request({
url: `campaign/admin/task/checkToken?token=${token}`,
withCredentials: true
})
}
export const getRole = async ({ token }) => {
return request({
url: `/contents/template/getRole?token=${token}`,
headers: {
token
}
// withCredentials: true
});
}
export const sayHello = async ({ token }) => {
return request({
method: 'POST',
// withCredentials: true,
headers: {
token
},
data: { token },
url: `/diplomat/oauth/sayhello?app_id=pica-crrs`
});
}
// 获取加密过后的id
export const getEncryptId = () => {
return request({
url: `campaign/inviteDetail/vinci`,
method: 'get',
withCredentials: true,
})
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册