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

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

......@@ -132,15 +132,21 @@
},
// 交互事件
setScrollHandle(instval){
if (instval >= this.baseShowHeight) {
this.isScroll = true;
this.leftIcon = leftimg2;
this.rightIcon = rightimg2;
} else {
this.isScroll = false;
this.leftIcon = leftimg1;
this.rightIcon = rightimg1;
}
if(this.isOpacity){
if (instval >= this.baseShowHeight) {
this.isScroll = true;
this.leftIcon = leftimg2;
this.rightIcon = rightimg2;
} else {
this.isScroll = false;
this.leftIcon = leftimg1;
this.rightIcon = rightimg1;
}
}else{
this.isScroll = true;
this.leftIcon = leftimg2;
this.rightIcon = rightimg2;
}
}
}
}
......
......@@ -7,14 +7,14 @@
<div
class="btn left"
:class="{'active-btn':activeBtnType}"
@click="headBtnClick">
@click="headBtnClick(true)">
{{headBtn.leftName}}
</div>
<div class="line"></div>
<div
class="btn right"
:class="{'active-btn':!activeBtnType}"
@click="headBtnClick">
@click="headBtnClick(false)">
{{headBtn.rightName}}
</div>
</div>
......@@ -74,8 +74,8 @@
this.$rocNative.goBack()
}
},
headBtnClick() {
this.$emit('handleBtn')
headBtnClick(val) {
this.$emit('handleBtn', val)
},
rightBtnClick() {
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 @@
}
}
}
.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 @@
</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-d" v-else>排行实时刷新,部分原因存在几分钟延迟</div>
<div class="ranking-title">
......@@ -74,11 +74,19 @@
<p class="num">{{itemD.score}}</p>
</div>
</div>
<footer-button
:btnText="btnText"
:btnType="btnType">
</footer-button>
</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
v-if="!noContributionRanking"
:btnText="btnText"
:btnType="btnType">
</footer-button>
</section>
</template>
......@@ -105,7 +113,8 @@
hospitalRanking: {},
contributionRanking: {},
btnText: '助力机构 创造佳绩',
btnType: true
btnType: true,
noContributionRanking: false //是否有人员贡献榜单数据
};
},
computed: {
......@@ -115,8 +124,11 @@
this.getRankData();
},
methods: {
changeRanking() {
this.activeBtnType = !this.activeBtnType;
goInActivity() {
this.$router.push('/in-activity')
},
changeRanking(val) {
this.activeBtnType = val;
this.getRankData()
},
dealRankName(hospitalType) {
......@@ -140,6 +152,7 @@
}
},
getHospitalRanking() {
this.noContributionRanking = false;
getHospitalRanking().then(res => {
if(res.code == '000000') {
this.hospitalRanking = res.data;
......@@ -150,6 +163,11 @@
getContributionRanking().then(res => {
if(res.code == '000000') {
this.contributionRanking = res.data;
if(this.contributionRanking.topRankList.length) {
this.noContributionRanking = false;
} else {
this.noContributionRanking = true;
}
}
})
......
<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
v-if="!isWeb"
title="云鹊奖2019"
:baseShowHeight="0"
title="云鹊奖2019"
:isOpacity="false"
:shareObj="shareObj"
:isCheckAuth="true"
......@@ -182,22 +182,31 @@
<div class="full-screen-mask"></div>
<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/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="message">已获得: {{vm.clockAward.mark}}勤奋分, {{vm.clockAward.bean}}云鹊豆</p>
<p class="message">已获得: {{clockAward.mark}}勤奋分, {{clockAward.bean}}云鹊豆</p>
<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 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="content-wrap activity-end">
<p class="content-text">本次活动已结束,感谢您的参与,最终获奖排名将于12月30日10点公布,届时查看</p>
<ul class="btn-list">
<li>我知道了</li>
<li @click="goBack">我知道了</li>
<li @click="goToYesterdayPrize" class="high-light">查看昨日获奖</li>
</ul>
</div>
......@@ -207,19 +216,27 @@
</template>
<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 h5header from '@/components/h5header';
import { getShareUrl } from '@/utils/index';
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')();
let vm = null;
export default {
data () {
return {
awardModalShow: false, // 根据排名是否显示中奖弹窗
showAwadModal: true, // 根据活动时间是否展示中奖弹层以及查看昨日榜单逻辑
yestodayAwards: '', // 昨日可获得
token: '',
activityId: 2, // 上线前等产品通知修改默认值
encryptId: '', // 加密后的id,(分享传参用)
serverTime: '',
isLogin: false, // 是否 已登录
isJoin: false, // 是否 已加入机构 默认为false
......@@ -245,6 +262,8 @@
eachInviteAward: { // 每邀请1位医生好友领取课程,+??勤奋分 +??云鹊豆 (默认均为20)
mark: 20, // 勤奋分
bean: 20, // 云鹊豆
taskId: '',
activityId: '',
},
doctorInfo: {
name: '', // 接口返回用户名字或者手机号带遮掩
......@@ -258,13 +277,14 @@
hospitalLevelScore: [], // 三阶段达标分值, 数组返回
targetRequiredScore: '', // 再获得多少分 // 再获得10勤奋分即可上升到前10名获得欧姆龙温度计
targetRank: '', // 上升到多少名
todayDate: 0,
yesterdayDate: 0,
todayDate: 0, // 今日服务器时间(用来展示对应奖项)
yesterdayDate: 0, // 昨日服务器时间(用来展示对应奖项)
userYesterdayRank: 0, // 用戶昨日排名
},
clockSuccessVisible: false, // 是否显示 打卡成功 弹窗
activityEndVisible: false, // 是否显示 活动结束 弹窗
yesterdayWinVisible: false,
inviteList: [], // 已邀请的用户列表
notInviteShowList: [], // 未邀请的默认显示
......@@ -279,9 +299,11 @@
clockAward: { // 打卡的奖励 默认都是5
mark: 5,
bean: 5,
activityId: '',
id: '',
},
isWeb: false,
shareObj: {},
shareObj: wxShare,
padTop: 0
}
},
......@@ -292,6 +314,9 @@
returnBeanImg() {
let hospitalScore = vm.doctorInfo.hospitalScore;
let arr = vm.doctorInfo.hospitalLevelScore;
if(arr && arr.length < 1){
return;
}
if( hospitalScore < arr[0]){
return require(`../assets/img/stage-two/bean-stage-0.png`);
}else if( ((arr[0] == hospitalScore) || (arr[0] < hospitalScore)) && (hospitalScore < arr[1]) ){
......@@ -319,25 +344,35 @@
}
return `再获得${vm.doctorInfo.targetRequiredScore}勤奋分即可上升到前${vm.doctorInfo.targetRank}名获得${award}`
}
}
},
},
created() {
vm = this;
// 取服务器时间,切换不同时间段的显示
vm.getServerTime();
},
mounted() {
vm.getUserActivityInfo();
vm.shareObj = {
shareUrl: window.location.href,
title1: '分享title分享title',
title2: '分享desc分享desc',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share.png'
}
// // 这里需要删掉!!!
// vm.getUserActivityInfo();
// vm.getTasks();
// // 这里需要删掉!!!
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.getUserInfo(); // 判断是否登录
......@@ -349,26 +384,61 @@
}
}
},
methods: {
// 获取服务器时间
getServerTime() {
// 调取接口获取服务器时间
// request else vm.serverTime = new Date().getTime();
vm.serverTime = 1577376000000;
getBEServerTime().then(res => {
// alert('服务器时间');
// alert(JSON.stringify(res))
if(res && res.code == '000000' ){
vm.serverTime = res.data;
}else{
vm.serverTime = new Date().getTime();
}
})
// vm.serverTime = 1577376000000;
},
hideClockModal() {
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() {
if(vm.currentStage == 0){
return '';
return require(`../assets/img/stage-two/stage-01-text.png`);
}else{
return require(`../assets/img/stage-two/stage-0${vm.currentStage}-text.png`);
}
},
returnAwardPic() {
if(vm.currentStage == 0){
return '';
return require(`../assets/img/stage-two/award-01-pic.png`)
}else{
return require(`../assets/img/stage-two/award-0${vm.currentStage}-pic.png`)
}
......@@ -398,7 +468,8 @@
vm.$rocNative.getUserInfo().then(params => {
// _seft.userToken = params.userToken; // 存到store里
if(params && params.userToken){
cookies.set('token', params.userToken)
cookies.set('token', params.userToken);
vm.token = params.userToken;
}
// alert(JSON.stringify(params));
if(params && params.userMobile){ // 已登录 (有手机号表示 已登录,无手机号表示 未登录)
......@@ -408,6 +479,8 @@
}else{ // 未登录
vm.isLogin = false;
}
// 登录状态确定后,再调任务接口,以便获取打卡状态
vm.getTasks();
});
},
......@@ -415,29 +488,51 @@
appLogin() {
vm.$rocNative.gotoLogin();
},
// 登陆ok后 回调: 获取邀请的医生列表等。。
// 登陆ok后 回调: 获取邀请的医生列表 & 检查是否加入机构
loginCallback() {
vm.getUserActivityInfo();
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() { // 获取用户及参加活动的具体信息
getUserScoreInfo().then(res => {
// alert('获取用户及分数信息。。。');
// alert(JSON.stringify(res));
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() { // 检查是否加入结构
checkHospitalStatus(vm.appUserInfo.userToken).then(res => {
alert('检查是否加入结构')
alert(JSON.stringify(res))
// alert('检查是否加入结构')
// alert(JSON.stringify(res))
if(res && res.code == '000000' ){
const status = res.data.status;
// const status = 15; // test。。。。。。。。。。。。。。。。。
if (status && status == 1) { // 机构状态正常
vm.isJoin = true;
vm.joinStatus = 1;
vm.getTaskStatus(vm.clockAward);
// *******************************************
vm.handleGetInviteList(); //登录且已加入机构才获取医生邀请了的列表
}else if (status && status == 15) { // 15创建机构审核中
vm.isJoin = false;
......@@ -532,6 +627,7 @@
});
},
handleLoginCheck(cb) {
vm.shareObj.shareUrl = vm.shareWxUrl();
if( !this.isLogin ){ // 未登录 >>> 去登录
this.goToLogin();
}else if( this.isLogin && !this.isJoin ){ // 已登录 && 未加入机构 >>>> 去加入机构
......@@ -562,12 +658,19 @@
name: 'hospital-ranking',
});
},
goBack(){
this.$rocNative.goBack();
},
// 昨日获奖
goToYesterdayPrize() {
alert('跳转至 昨日获奖页面')
this.$router.push({
name: 'yesterday-prize',
});
if(!this.showAwadModal){
return;
}else{
this.$router.push({
name: 'yesterday-prize',
});
}
},
// 云鹊豆中心
goToBeanCenter() {
......@@ -621,21 +724,20 @@
name: 'invite-details',
});
},
shareWxUrl() {
return `${getShareUrl()}year_end_ssr/shareActive?id=${vm.encryptId}&taskId=${vm.eachInviteAward.taskId}&activityId=${vm.eachInviteAward.activityId}`
},
// 去邀请 按钮
handleInviteClick() {
vm.shareObj.shareUrl = vm.shareWxUrl();
let cb = this.goToShare;
this.handleLoginCheck(cb);
},
goToShare() {
alert('调app分享');
// let id = vm.encryptDoctorId();
let params = {
id: '',
taskId: '',
activityId: '',
};
// 调用APP分享
this.$rocNative.shareWechat(this.shareObj);
},
encryptDoctorId() {
......@@ -643,7 +745,7 @@
// return 'dddddd'
},
// 去打卡 按钮
// 去完成任务 按钮
goToFinish(item) {
let cb = () => {
vm.goToFinishCB(item);
......@@ -669,6 +771,7 @@
if(res && res.code == '000000'){
if(res.data){ // 打卡成功
vm.clockSuccessVisible = true;
vm.isClockFinish = true;
}else{
vm.$toast(res.message);
}
......@@ -677,9 +780,17 @@
}
})
}
}else{ // 非打卡,直接走积木tims跳转逻辑
// alert('去课程或者患者招募 。。。。。。')
if(item.isFinish == 0){ // 已完成 不可点
return;
}
vm.jumpPage(item.linkId);
}
},
// 每个任务的跳转点击
handleTaskClick() {
let cb = this.goToTask;
......@@ -691,219 +802,87 @@
// 获取每日任务 及 邀请医生好友学课程里的 邀请1位医生的勤奋分及云鹊豆个数
getTasks() {
// debugger;
let res = {
"data": {
"loginStatus": 2,
"taskRuleData": [
{
"id": 14,
"activityId": 2,
"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
getTimsActivityInfo(vm.activityId).then(res => {
// alert('^^^^^获取任务信息…………………………')
// alert(JSON.stringify(res))
if(res && res.code == '000000'){
if(!vm.checkTimeStatus(res.data)){
this.activityEndVisible = true;
return;
}
},
"code": "000000",
"message": "成功"
};
let data = res.data;
let taskRuleData = data.taskRuleData || [];
for(let i=0; i<taskRuleData.length; i++){
let item = taskRuleData[i];
let rewardList = [];
// 获取 邀请节点,进行中 此时获取邀请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 || [];
for( let j=0; j<rewardList.length; j++ ){
if( rewardList[j].rewardType == 3 ){ // 勤奋分
vm.eachInviteAward.mark = rewardList[j].rewardQuantity;
}else if( rewardList[j].rewardType == 1 ){ // 云鹊豆
vm.eachInviteAward.bean = rewardList[j].rewardQuantity;
}
}
}
}else if( item.resourceType == 6 && item.timeStatus == 1 ){ // 打卡 默认奖励 5分 5豆
item.eachInviteAwardMark = 5;
item.eachInviteAwardBean = 5;
item = vm.formatEachTaskAward(item);
vm.clockAward = {
mark: item.eachInviteAwardMark,
bean: item.eachInviteAwardBean,
activityId: item.activityId,
id: item.id,
};
vm.taskObj.clock = item;
if(vm.isLogin){ // 登录后,获取打卡状态
vm.goToGetClockStatus(vm.clockAward);
}
}else if( item.resourceType == 1 && item.timeStatus == 1 ){ // 课程 默认奖励 20分 20豆
item.eachInviteAwardMark = 20;
item.eachInviteAwardBean = 20;
item = vm.formatEachTaskAward(item);
let data = res.data;
let taskRuleData = data.taskRuleData || [];
for(let i=0; i<taskRuleData.length; i++){
let item = taskRuleData[i];
let rewardList = [];
// 获取 邀请节点,进行中 此时获取邀请1个医生对应的 分数 和 豆子
if( item.resourceType == 7 && item.resourceId == 1 && item.timeStatus == 1){
rewardList = item.rewardJsonInfo || [];
for( let j=0; j<rewardList.length; j++ ){
if( rewardList[j].rewardType == 3 ){ // 勤奋分
vm.eachInviteAward.mark = rewardList[j].rewardQuantity;
}else if( rewardList[j].rewardType == 1 ){ // 云鹊豆
vm.eachInviteAward.bean = rewardList[j].rewardQuantity;
vm.taskObj.lesson = item;
}else if( item.resourceType == 4 && item.timeStatus == 1 ){ // smo 没奖励分 默认奖励100豆
item.eachInviteAwardBean = 100;
item = vm.formatEachTaskAward(item);
vm.taskObj.smo = item;
}
}
}else if( item.resourceType == 6 && item.timeStatus == 1 ){ // 打卡 默认奖励 5分 5豆
item.eachInviteAwardMark = 5;
item.eachInviteAwardBean = 5;
item = vm.formatEachTaskAward(item);
vm.clockAward = {
mark: item.eachInviteAwardMark,
bean: item.eachInviteAwardBean,
activityId: item.activityId,
id: item.id,
};
vm.taskObj.clock = item;
}else if( item.resourceType == 1 && item.timeStatus == 1 ){ // 课程 默认奖励 20分 20豆
item.eachInviteAwardMark = 20;
item.eachInviteAwardBean = 20;
item = vm.formatEachTaskAward(item);
vm.taskObj.lesson = item;
}else if( item.resourceType == 4 && item.timeStatus == 1 ){ // smo 没奖励分 默认奖励100豆
item.eachInviteAwardBean = 100;
item = vm.formatEachTaskAward(item);
vm.taskObj.smo = item;
vm.taskList = [];
if( vm.taskObj.clock ){
vm.taskList.push( vm.taskObj.clock );
}
if( vm.taskObj.lesson ){
vm.taskList.push( vm.taskObj.lesson );
}
if( vm.taskObj.smo ){
vm.taskList.push( vm.taskObj.smo );
}
}else{
vm.$toast(res.message);
}
};
vm.taskList = [];
if( vm.taskObj.clock ){
vm.taskList.push( vm.taskObj.clock );
}
if( vm.taskObj.lesson ){
vm.taskList.push( vm.taskObj.lesson );
}
if( vm.taskObj.smo ){
vm.taskList.push( vm.taskObj.smo );
})
},
// 校验活动是否结束
checkTimeStatus(data){
const { timeStatus } = data.activityData;
// timeStatus 活动时间状态 1:在活动时间范围 2.已经结束 3.未开始
if(timeStatus==2){
return false;
}
return true;
},
getTaskStatus(params) {
goToGetClockStatus(params) {
vm.isClockFinish = false;
getClockStatus(params).then(res => {
if(res && res.code == '000000'){
......@@ -968,9 +947,159 @@
}
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){
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>
......
......@@ -99,8 +99,8 @@
}
},
methods: {
changeRanking() {
this.activeBtnType = !this.activeBtnType
changeRanking(val) {
this.activeBtnType = val;
this.getData();
},
handleRightBtn() {
......
......@@ -3,8 +3,8 @@
<section>
<div class="invite-info">
<img :src="avatarImageUrl" />
<p class="title1">{{ name }}邀请您助力 为他赢大奖</p>
<p class="title2">领取课程即可助他一臂之力</p>
<p class="title1">{{ name }}邀请您领取医学课程</p>
<p class="title2">参与云鹊奖活动,学习课程赢iphone11等奖品</p>
</div>
<div class="page-info">
......@@ -54,6 +54,7 @@
<script>
import { getInviteInfo, getCourseById, getCaptchaGet, getAuthCode } from '@/service';
import { wxShare } from '@/configs/wxShare';
const TIMEALL = 60000; // 倒计时常量 60 秒
export default {
data(){
......@@ -68,7 +69,8 @@
captchaAnswer: '', // 输入的图形验证码
time: TIMEALL,
btnMsg: '点击获取',
isReq: false
isReq: false,
shareObj: wxShare,
}
},
async asyncData({ query }){
......@@ -93,17 +95,13 @@
document.querySelector('body').setAttribute('style', 'background: #FE9A51;');
this.checkCache();
// 微信分享
this.shareObj = {
shareUrl: window.location.href,
title1: '分享title分享title',
title2: '分享desc分享desc',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share.png'
}
this.shareObj.shareUrl = window.location.href;
window.localStorage.setItem('shareUrl', this.shareObj.shareUrl);
this.$picaWxShare({
// baseUrl: BASE_URL[process.env.NUXT_ENV_APP],
baseUrl: 'https://test1-sc.yunqueyi.com',
type: 15,
authUrl: window.location.href,
authUrl: this.shareObj.shareUrl,
isDebug: false,
jsApiList: [
'onMenuShareTimeline',
......@@ -112,7 +110,7 @@
},(wx)=>{
const title = this.shareObj.title1;
const desc = this.shareObj.title2;
const link = window.location.href;
const link = this.shareObj.shareUrl;
const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友
wx.onMenuShareAppMessage({
......
......@@ -53,6 +53,7 @@
</template>
<script>
import { wxShare } from '@/configs/wxShare';
export default {
asyncData({ query }){
const { status } = query; // 上个页面传递过来领取结果, false 为已领取, true 为领取成功
......@@ -61,20 +62,20 @@
statusTxt
}
},
data(){
return {
shareObj: wxShare,
}
},
mounted(){
document.querySelector('body').setAttribute('style', 'background: "";');
// 微信分享
this.shareObj = {
shareUrl: window.location.href,
title1: '分享title分享title',
title2: '分享desc分享desc',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share.png'
}
this.shareObj.shareUrl = window.localStorage.getItem('shareUrl') || window.location.href;
this.$picaWxShare({
// baseUrl: BASE_URL[process.env.NUXT_ENV_APP],
baseUrl: 'https://test1-sc.yunqueyi.com',
type: 15,
authUrl: window.location.href,
authUrl: this.shareObj.shareUrl,
isDebug: false,
jsApiList: [
'onMenuShareTimeline',
......@@ -83,7 +84,7 @@
},(wx)=>{
const title = this.shareObj.title1;
const desc = this.shareObj.title2;
const link = window.location.href;
const link = this.shareObj.shareUrl;
const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友
wx.onMenuShareAppMessage({
......
......@@ -9,10 +9,20 @@ export const getUserScoreInfo = () => {
return request({
url: `campaign/ranking/user_info`,
method: 'post',
// withCredentials: true,
headers: {
token: 'D3FFA515261C48478773C0BA17C11F52'
}
})
}
// 获取服务器时间
//
export const getBEServerTime = () => {
return request({
url: `campaign/tims/getTodayDate`,
method: 'get',
withCredentials: true,
// headers: {
// token: '8F685DEFFEAC45C393AA55A4DD9E9048'
// }
})
}
......@@ -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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册