提交 5f3b916e 编写于 作者: tao.wu's avatar tao.wu

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

...@@ -4,7 +4,7 @@ img{ ...@@ -4,7 +4,7 @@ img{
-o-user-select:none; -o-user-select:none;
user-select:none; user-select:none;
} }
body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, li, a, p, h1, h2, h3, h4,h5, h6, i, b, textarea, button, input, select, figure, figcaption, { body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, li, a, p, h1, h2, h3, h4,h5, h6, i, b, textarea, button, input, select, figure, figcaption {
padding: 0; padding: 0;
margin: 0; margin: 0;
list-style: none; list-style: none;
......
@import './common.scss'; @import 'common.less';
//定位 //定位
.relative{ .relative{
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
} }
.big-bg-wrap{ .big-bg-wrap{
width: 100%; height: auto; overflow: hidden; width: 100%; height: auto; overflow: hidden;
background: url('../img/stageTwo/bg-01.png') no-repeat left top; background: url('../img/stage-two/bg-01.png') no-repeat left top;
background-size: 100% 100%; background-size: 100% 100%;
.award-wrap{ .award-wrap{
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
position: relative; position: relative;
width: 355px; height: 480px; width: 355px; height: 480px;
margin: 2px auto 0; margin: 2px auto 0;
background: url('../img/stageTwo/user-info-bg.png') no-repeat left top; background: url('../img/stage-two/user-info-bg.png') no-repeat left top;
background-size: 100% 100%; background-size: 100% 100%;
.gold-coin{ .gold-coin{
position: absolute; right: -20px; top: -32px; position: absolute; right: -20px; top: -32px;
...@@ -84,9 +84,9 @@ ...@@ -84,9 +84,9 @@
padding: 16px 15px 0; box-sizing: border-box; padding: 16px 15px 0; box-sizing: border-box;
.head-icon{ .head-icon{
float: left; float: left;
width: 50px; height: 50px; overflow: hidden; width: 50px; height: 50px; overflow: hidden; border: 0; display: block;
border-radius: 50px; border-radius: 50px;
border: 1px solid red; // border: 1px solid red;
img{ img{
width: 50px; height: 50px; width: 50px; height: 50px;
} }
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
} }
.head-icon{ .head-icon{
width: 50px; height: 50px; display: block; border: 0; width: 50px; height: 50px; display: block; border: 0;
float: left; float: left; border-radius: 50px;
} }
.content-info{ .content-info{
float: left; float: left;
...@@ -339,7 +339,7 @@ ...@@ -339,7 +339,7 @@
padding: 0 15px; padding: 0 15px;
.top-center-bar{ .top-center-bar{
width: 325px; height: 58px; overflow: hidden; width: 325px; height: 58px; overflow: hidden;
background: url('../img/stageTwo/daily-task-bar.png') no-repeat center center; background: url('../img/stage-two/daily-task-bar.png') no-repeat center center;
background-size: 128px 12px; background-size: 128px 12px;
font-size: 18px; color: #F05D30; font-weight: 700; text-align: center; line-height: 58px; font-size: 18px; color: #F05D30; font-weight: 700; text-align: center; line-height: 58px;
} }
...@@ -381,7 +381,7 @@ ...@@ -381,7 +381,7 @@
// 底部logo // 底部logo
.bottom-logo{ .bottom-logo{
width: 100%; height: 92px; width: 100%; height: 92px;
background: url('../img/stageTwo/bottom-logo.png') no-repeat center center; background: url('../img/stage-two/bottom-logo.png') no-repeat center center;
background-size: 36px 45px; background-size: 36px 45px;
} }
...@@ -444,7 +444,7 @@ ...@@ -444,7 +444,7 @@
.close-btn{ .close-btn{
position: absolute; left: 50%; bottom: -50px; margin-left: -15px; position: absolute; left: 50%; bottom: -50px; margin-left: -15px;
width: 30px; height: 30px; width: 30px; height: 30px;
background: url('../img/stageTwo/close-toast-icon.png') no-repeat center center; background: url('../img/stage-two/close-toast-icon.png') no-repeat center center;
background-size: 30px; height: 30px; background-size: 30px; height: 30px;
} }
} }
......
.index-wrap{ .index-wrap {
div{ div {
width: 375px; width: 375px;
img{
width: 375px; img {
display: block; width: 375px;
} display: block;
} }
.wrap-join{ }
height: 72.5px;
background: url(../img/img4.png) no-repeat center center; .wrap-join {
background-size: 100% 100%; height: 72.5px;
.wrap-count{ background: url(../img/img4.png) no-repeat center center;
width: 325px; background-size: 100% 100%;
height: 72.5px;
display: flex; .wrap-count {
margin: 0 auto; width: 325px;
h1{ height: 72.5px;
margin-top: 9px; display: flex;
font-size:23px; margin: 0 auto;
font-weight:700;
color:rgba(255,255,255,1); h1 {
line-height:32.5px; margin-top: 9px;
text-align: center; font-size: 23px;
} font-weight: 700;
h5{ color: rgba(255, 255, 255, 1);
font-size:14px; line-height: 32.5px;
font-weight:400; text-align: center;
color:rgba(255,255,255,0.59); }
line-height:20px;
text-align: center; h5 {
} font-size: 14px;
font-weight: 400;
color: rgba(255, 255, 255, 0.59);
line-height: 20px;
text-align: center;
}
}
}
.btn-app-share {
img {
width: 312px;
height: 51.5px;
margin: 0 auto;
}
}
.btn-appoint {
height: 94.5px;
background: url(../img/img5.png) no-repeat center center;
background-size: 100% 100%;
img {
padding-top: 15px;
}
.appoint-time {
margin-top: 5px;
text-align: center;
font-size: 12px;
color: rgba(237, 90, 44, 1);
line-height: 16.5px;
}
}
.btn-share {
height: 166px;
background: url(../img/img11.png) no-repeat center center;
background-size: 100% 100%;
img {
padding-top: 81px;
}
}
.rule-show {
background: rgba(254, 124, 86, 1);
.bird {
width: 22.5px;
height: 28.5px;
margin: 0 auto;
padding: 24px 0;
}
.rule-bg {
width: 345px;
margin: 0 auto;
box-sizing: border-box;
background: rgba(236, 107, 69, 1);
border-radius: 12px;
padding: 15px;
section {
h1 {
font-size: 16px;
font-weight: 700;
color: rgba(255, 234, 136, 1);
line-height: 18px;
margin-bottom: 12px;
} }
p {
font-size: 14px;
font-weight: 500;
color: rgba(255, 246, 202, 1);
line-height: 19px;
margin-bottom: 9px;
span {
font-weight: 700;
}
}
}
.margin-top-20 {
margin-top: 20px;
}
.line {
margin-top: 20px;
width: 309.5px;
height: .5px;
background: #FFF6CA;
}
.btn-rule {
width: 110px;
height: 15px;
font-size: 15px;
color: rgba(255, 255, 255, 1);
line-height: 15px;
margin: 0 auto;
padding: 16.5px 0 1.5px 0;
img {
width: 7px;
height: 12px;
display: inline;
vertical-align: middle;
padding-left: 5px;
}
}
}
}
.fix-btn {
width: 375px;
height: 50px;
position: fixed;
left: 0;
bottom: 0;
z-index: 10;
background: #fff;
div {
width: 345px;
height: 40px;
background: linear-gradient(270deg, rgba(255, 88, 36, 1) 0%, rgba(254, 163, 86, 1) 100%);
border-radius: 20px;
margin: 5px auto 0 auto;
font-size: 15px;
color: rgba(255, 255, 255, 1);
line-height: 40px;
text-align: center;
} }
.btn-app-share{ }
img{
width: 312px; .abs-btn {
height: 51.5px; width: 69px;
height: 25px;
position: absolute;
right: 0;
top: 260px;
img {
width: 69px;
height: 25px;
}
}
}
.padbtm50 {
padding-bottom: 50px;
}
// 微信分享助力活动
.wx-share-wrap {
width: 375px;
// height: 601.5px;
button,input{
appearance: none;
border: none;
outline: none;
}
section {
width: 375px;
// height: 601.5px;
padding-bottom: 27.5px;
background: url(../img/bgtop.png) no-repeat;
background-size: 100% 100%;
.invite-info{
img{
width: 50px;
height: 50px;
display: block;
padding-top: 20px;
margin: 0 auto;
}
.title1{
margin-top: 12px;
margin-bottom: 8px;
text-align: center;
font-size:20px;
font-weight:700;
color:rgba(255,255,255,1);
line-height:20px;
text-shadow:0px 2px 10px rgba(222,77,16,1);
}
.title2{
margin-bottom: 23px;
text-align: center;
font-size:13px;
color:rgba(255,255,255,1);
line-height:13px;
text-shadow:0px 2px 10px rgba(231,93,48,1);
}
}
.page-info{
width:345px;
height:162px;
padding: 20px 25px;
box-sizing: border-box;
margin: 0 auto 16px auto;
background:rgba(255,255,255,1);
border-radius:6px;
.title1{
margin-bottom: 8px;
text-align: center;
font-size:16px;
font-weight:700;
color:rgba(55,56,57,1);
line-height:16px;
}
.title2{
margin-bottom: 16px;
text-align: center;
font-size:12px;
color:rgba(248,94,71,1);
line-height:12px;
}
.imgs-wrap{
display: flex;
justify-content: space-between;
div{
border-radius: 6px;
img{
width: 50px;
height: 50px;
display: block;
margin: 0 auto; margin: 0 auto;
}
.img-txt{
margin-top: 8px;
font-size:12px;
color:rgba(103,104,105,1);
line-height:12px;
}
} }
}
} }
.btn-appoint{ .form-info{
height: 94.5px; width:345px;
background: url(../img/img5.png) no-repeat center center; // height:162px;
background-size: 100% 100%; padding: 15px;
img{ box-sizing: border-box;
padding-top: 15px; margin: 0 auto 16px auto;
background:rgba(255,255,255,1);
border-radius:6px;
.field-wrap{
display: flex;
justify-content: flex-start;
width: 315px;
height: 45px;
line-height: 45px;
padding: 0 20px;
box-sizing: border-box;
background:rgba(248,249,250,1);
border-radius:22.5px;
margin-bottom: 10px;
position: relative;
.cap-box{
width: 90px;
height: 35px;
top: 5px;
right: 5px;
position: absolute;
img{
width: 100%;
height: 100%;
display: block;
border-radius:22.5px;
}
} }
.appoint-time{ button{
margin-top: 5px; width:56px;
text-align: center; height:40px;
font-size:12px; top: 2.5px;
color:rgba(237,90,44,1); right: 20px;
line-height:16.5px; position: absolute;
font-size:14px;
color:rgba(151,152,153,1);
line-height:40px;
background: none;
} }
} label{
.btn-share{ margin-top: 2.5px;
height: 166px; font-size:14px;
background: url(../img/img11.png) no-repeat center center; font-weight:700;
background-size: 100% 100%; display: block;
img{ width: 112px;
padding-top: 81px; height: 40px;
line-height: 40px;
color:rgba(55,56,57,1);
} }
} input{
.rule-show{ margin-top: 2.5px;
background:rgba(254,124,86,1); font-size:14px;
.bird{ width: 130px;
width: 22.5px; height: 40px;
height: 28.5px; line-height:40px;
margin: 0 auto; background: none;
padding: 24px 0; }
::-webkit-input-placeholder { /* WebKit, Blink, Edge */
color:rgba(199,200,201,1);
height: 40px;
line-height:40px;
} }
.rule-bg{ :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
width:345px; color:rgba(199,200,201,1);
margin:0 auto; height: 40px;
box-sizing: border-box; line-height:40px;
background:rgba(236,107,69,1); }
border-radius:12px; ::-moz-placeholder { /* Mozilla Firefox 19+ */
padding: 15px; color:rgba(199,200,201,1);
section{ height: 40px;
h1{ line-height:40px;
font-size:16px; }
font-weight:700; :-ms-input-placeholder { /* Internet Explorer 10-11 */
color:rgba(255,234,136,1); color:rgba(199,200,201,1);
line-height:18px; height: 40px;
margin-bottom: 12px; line-height:40px;
} }
p{ }
font-size:14px; .btn-post{
font-weight:500; width: 315px;
color:rgba(255,246,202,1); height: 45px;
line-height:19px; margin-top: 10px;
margin-bottom: 9px; background:linear-gradient(270deg,rgba(255,88,36,1) 0%,rgba(254,163,86,1) 100%);
span{ border-radius:22.5px;
font-weight:700; font-size:15px;
} font-weight:700;
} color:rgba(255,255,255,1);
line-height:15px;
}
}
}
}
.wx-share-result{
width: 375px;
// height: 601.5px;
section{
width: 375px;
// height: 601.5px;
padding-top: 40px;
.res-wrap{
img{
width: 70px;
height: 60px;
display: block;
margin: 0 auto;
}
h1{
font-size:20px;
font-weight:700;
color:rgba(55,56,57,1);
line-height:20px;
margin: 20px 0;
text-align: center;
}
h3{
font-size:13px;
line-height:13px;
text-align: center;
margin-bottom: 30px;
color:rgba(151,152,153,1);
}
}
.btn-app{
width: 335px;
height: 40px;
line-height:40px;
border-radius:22.5px;
font-size:16px;
font-weight:700;
text-align: center;
margin: 0 auto;
}
.down-app{
background:linear-gradient(270deg,rgba(255,88,36,1) 0%,rgba(254,163,86,1) 100%);
color:rgba(255,255,255,1);
}
.has-app{
margin-top: 12px;
margin-bottom: 40px;
border:1px solid rgba(151,152,153,1);
color:rgba(103,104,105,1);
}
.line{
width: 375px;
height: 5px;
background:rgba(248,249,250,1);
}
.more-course{
padding: 30px 15px;
header{
font-size:18px;
font-weight:700;
color:rgba(51,51,51,1);
line-height:18px;
}
.course-list{
width: 345px;
.course-item{
width: 345px;
margin-top: 20px;
display: flex;
justify-content: space-between;
div{
h1{
font-size:16px;
font-weight:700;
color:rgba(55,56,57,1);
line-height:16px;
} }
.margin-top-20{ h3{
margin-top: 20px; font-size:13px;
color:rgba(151,152,153,1);
line-height:13px;
} }
.line{ }
margin-top: 20px; .course-txt{
width:309.5px; width: 240px;
height:.5px; border-bottom: .5px solid rgba(240,241,242,1);
background: #FFF6CA; h3{
margin-top: 12px;
} }
.btn-rule{ }
width: 110px; .course-img{
height: 15px; width: 90px;
font-size:15px; height: 60px;
color:rgba(255,255,255,1); img{
line-height:15px; width: 90px;
margin: 0 auto; height: 60px;
padding: 16.5px 0 1.5px 0; display: block;
img{
width: 7px;
height: 12px;
display: inline;
vertical-align: middle;
padding-left: 5px;
}
} }
}
} }
}
} }
.fix-btn{ }
width: 375px;
height: 50px;
position: fixed;
left: 0;
bottom: 0;
z-index: 10;
background: #fff;
div{
width: 345px;
height: 40px;
background:linear-gradient(270deg,rgba(255,88,36,1) 0%,rgba(254,163,86,1) 100%);
border-radius:20px;
margin: 5px auto 0 auto;
font-size:15px;
color:rgba(255,255,255,1);
line-height:40px;
text-align: center;
}
}
.abs-btn{
width: 69px;
height: 25px;
position: absolute;
right: 0;
top: 260px;
img{
width: 69px;
height: 25px;
}
}
} }
.padbtm50{
padding-bottom: 50px;
}
\ No newline at end of file
@import './global.scss'; @import 'global.less';
$blue: #3190e8; $blue: #3190e8;
$bc: #e4e4e4; $bc: #e4e4e4;
$fc:#fff; $fc:#fff;
......
.remind-success{ .remind-success {
width: 300px; width: 300px;
.van-dialog__header{
font-size:18px; .van-dialog__header {
color:rgba(51,51,51,1); font-size: 18px;
line-height:18px; color: rgba(51, 51, 51, 1);
padding-top: 30px; line-height: 18px;
padding-top: 30px;
}
.van-dialog__content {
.van-dialog__message {
padding: 14px 24px 30px 24px;
text-align: left;
font-size: 14px;
color: rgba(103, 104, 105, 1);
line-height: 21px;
span {
font-size: 14px;
color: #449284;
line-height: 21px;
}
} }
.van-dialog__content{ }
.van-dialog__message{
padding: 14px 24px 30px 24px; .van-dialog__footer {
text-align: left; .van-dialog__cancel {
font-size:14px; .van-button__text {
color:rgba(103,104,105,1); font-size: 17px;
line-height:21px; color: rgba(151, 152, 153, 1);
span{ line-height: 24px;
font-size:14px; }
color:#449284;
line-height:21px;
}
}
} }
.van-dialog__footer{
.van-dialog__cancel{ .van-dialog__confirm {
.van-button__text{ .van-button__text {
font-size:17px; font-size: 17px;
color:rgba(151,152,153,1); color: rgba(68, 146, 132, 1);
line-height:24px; line-height: 24px;
} }
}
.van-dialog__confirm{
.van-button__text{
font-size:17px;
color:rgba(68,146,132,1);
line-height:24px;
}
}
} }
}
} }
.version-toast{
width: 320px; .version-toast {
.van-dialog__header{ width: 320px;
font-size:18px;
color:rgba(51,51,51,1); .van-dialog__header {
line-height:18px; font-size: 18px;
padding-top: 30px; color: rgba(51, 51, 51, 1);
line-height: 18px;
padding-top: 30px;
}
.van-dialog__content {
.van-dialog__message {
font-size: 14px;
color: rgba(103, 104, 105, 1);
line-height: 21px;
} }
.van-dialog__content{ }
.van-dialog__message{
font-size:14px; .van-dialog__footer {
color:rgba(103,104,105,1); border: .5px solid rgba(0, 0, 0, .3);
line-height:21px;
} .van-dialog__cancel {
.van-button__text {
font-size: 17px;
color: rgba(151, 152, 153, 1);
line-height: 24px;
}
} }
.van-dialog__footer{
border: .5px solid rgba(0,0,0,.3); .van-dialog__confirm {
.van-dialog__cancel{ .van-button__text {
.van-button__text{ font-size: 17px;
font-size:17px; color: rgba(68, 146, 132, 1);
color:rgba(151,152,153,1); line-height: 24px;
line-height:24px; }
}
}
.van-dialog__confirm{
.van-button__text{
font-size:17px;
color:rgba(68,146,132,1);
line-height:24px;
}
}
} }
}
}
.wx-share-wrap {
.van-count-down {
line-height: 45px;
right: 20px;
position: absolute;
}
} }
\ No newline at end of file
<template>
<section class="footer-btn-wrap">
<div class="footer-btn" :style="{height: `${50+homeIndicatorHeight}` + 'Px'}">
<div class="btn" @click="handlerMethod">{{btnText}}</div>
</div>
</section>
</template>
<script>
export default {
name: "footer-button",
props: {
btnText: {
type: String,
default: () => {
return '确定'
}
},
btnType: {
type: Boolean,
default: () => {
return true
}
}
},
methods: {
handlerMethod() {
if(this.btnType) {
this.$router.push('/in-activity')
} else {
this.$emit('sureBtn')
}
}
}
}
</script>
<style lang="less" scoped>
.footer-btn-wrap {
.footer-btn {
width: 100%;
min-height: 50Px;
box-shadow:0px -1px 0px 0px rgba(237,237,237,1);
position: fixed;
bottom: 0;
background: #fff;
.btn {
width: 345px;
height: 40Px;
margin: 5Px auto;
line-height: 40Px;
text-align: center;
background: linear-gradient(270deg,rgba(255,88,36,1) 0%,rgba(254,163,86,1) 100%);
border-radius: 20Px;
color: #FFFFFF;
font-weight: 700;
font-size: 15px;
}
}
}
</style>
\ No newline at end of file
...@@ -3,12 +3,14 @@ header{ ...@@ -3,12 +3,14 @@ header{
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
z-index: 100; z-index: 300;
.status{ .status{
width: 375px; width: 375px;
} }
.head-wrap{ .head-wrap{
width: 375px; width: 375px;
height: 44Px;
line-height: 44Px;
box-sizing: border-box; box-sizing: border-box;
padding: 0 20px 0 16px; padding: 0 20px 0 16px;
display: flex; display: flex;
......
<template> <template>
<header> <header>
<div class="status" :class="{'bgfff': isScroll}" :style="{height: statusBarHeight + 'px', background: bgColor}"></div> <div class="status" :class="{'bgfff': isScroll}" :style="{height: statusBarHeight + 'Px', background: bgColor}"></div>
<div class="head-wrap" :class="{'bgfff': isScroll}" :style="{height: titleHeight + 'px'}"> <!-- <div class="head-wrap" :class="{'bgfff': isScroll}" :style="{height: titleHeight + 'px'}"> -->
<div class="head-wrap" :class="{'bgfff': isScroll}">
<img @click="goBack" :src="leftIcon"> <img @click="goBack" :src="leftIcon">
<span v-if="isScroll">{{title}}</span> <span v-if="isScroll">{{title}}</span>
<img @click="goShare" :src="rightIcon"> <img @click="goShare" :src="rightIcon">
...@@ -18,6 +19,10 @@ ...@@ -18,6 +19,10 @@
export default { export default {
name: 'h5header', name: 'h5header',
props: { props: {
isOpacity: { // 是否需要透明背景
type: Boolean,
default: true
},
scrollVal: { // 实际滚动的距离 scrollVal: { // 实际滚动的距离
type: Number, type: Number,
default: 25 default: 25
...@@ -42,7 +47,11 @@ ...@@ -42,7 +47,11 @@
setedScroll: { // 是否使用外部父组件的scroll事件 setedScroll: { // 是否使用外部父组件的scroll事件
type: Boolean, type: Boolean,
default: false default: false
} },
isCheckAuth: { // 是否校驗權限
type: Boolean,
default: false
}
}, },
data(){ data(){
return { return {
...@@ -55,6 +64,7 @@ ...@@ -55,6 +64,7 @@
} }
}, },
mounted(){ mounted(){
this.isScroll = !this.isOpacity;
this.setHeaderHeight(); this.setHeaderHeight();
if(!this.setedScroll){ if(!this.setedScroll){
this.scrollHandleOwn(); this.scrollHandleOwn();
...@@ -63,22 +73,28 @@ ...@@ -63,22 +73,28 @@
watch: { watch: {
scrollVal(val){ scrollVal(val){
this.setScrollHandle(val); this.setScrollHandle(val);
} },
isScroll(val){
if(val){
this.leftIcon = leftimg2;
this.rightIcon = rightimg2;
}
}
}, },
methods: { methods: {
// 从APP获取电池栏高度并设置高度 // 从APP获取电池栏高度并设置高度
setHeaderHeight(){ setHeaderHeight(){
// this.statusBarHeight = 20 * window.devicePixelRatio; // 给一个默认值,20 * 2
// this.titleHeight = 44 * window.devicePixelRatio; // title高度默认是44px
this.$rocNative.getStatusBarHeight().then(res=>{ this.$rocNative.getStatusBarHeight().then(res=>{
const dpr = window.devicePixelRatio; const dpr = window.devicePixelRatio;
if(this.$rocNative.isIOS){ if(this.$rocNative.isIOS){
this.statusBarHeight = res.statusBarHeight * dpr; // this.statusBarHeight = res.statusBarHeight * dpr;
this.titleHeight = this.titleHeight * dpr; // this.titleHeight = this.titleHeight * dpr;
this.statusBarHeight = res.statusBarHeight;
}else{ }else{
this.bgColor = '#ccc'; this.bgColor = '#ccc';
this.statusBarHeight = res.statusBarHeight / dpr; this.statusBarHeight = res.statusBarHeight / dpr;
} }
this.$emit('getHeaderHeight', this.statusBarHeight + 44);
}) })
}, },
goBack(){ goBack(){
...@@ -91,7 +107,13 @@ ...@@ -91,7 +107,13 @@
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `301#301001` component_tag: `301#301001`
}); });
this.$rocNative.shareWechat(this.shareObj); if(this.isCheckAuth){
this.$emit('checkAuth', ()=>{
this.$rocNative.shareWechat(this.shareObj);
})
}else{
this.$rocNative.shareWechat(this.shareObj);
}
}, },
// 默认滚动事件 // 默认滚动事件
scrollHandleOwn(){ scrollHandleOwn(){
...@@ -103,7 +125,7 @@ ...@@ -103,7 +125,7 @@
if(document.documentElement){ if(document.documentElement){
documentScrollTop = document.documentElement.scrollTop; documentScrollTop = document.documentElement.scrollTop;
} }
const heightVal = imgHeight1 + imgHeight2 + imgHeight3; // const heightVal = imgHeight1 + imgHeight2 + imgHeight3;
const scrollVal = bodyScrollTop || documentScrollTop; const scrollVal = bodyScrollTop || documentScrollTop;
this.setScrollHandle(scrollVal); this.setScrollHandle(scrollVal);
} }
......
<template> <template>
<section class="header-section" > <section class="header-section" >
<div class="navBar" :style="{height: `${barHeight}Px`,backgroundColor: barColor}"></div> <div class="navBar" :style="{height: `${statusBarHeight}Px`,backgroundColor: statusBarColor}"></div>
<header class="header-container"> <header class="header-container">
<img @click="goBack" src="~/assets/img/icon-back.png" alt=""> <img @click="goBack" src="~/assets/img/icon-back.png" alt="">
{{title}} {{title}}
<div class="btn-right" v-if="rightText">{{rightText}}</div>
</header> </header>
</section> </section>
</template> </template>
...@@ -18,24 +19,18 @@ ...@@ -18,24 +19,18 @@
return '' return ''
} }
}, },
backType: { rightText: {
type: Number, type: String,
default: function () { default: function () {
return 1 return ''
} }
}, },
barHeight: { backType: {
type: Number, type: Number,
default:function () {
return 0
}
},
barColor: {
type: String,
default: function () { default: function () {
return '#ffffff' return 1
} }
} },
}, },
data() { data() {
return {} return {}
...@@ -69,15 +64,29 @@ ...@@ -69,15 +64,29 @@
background: #ffffff; background: #ffffff;
color: #333333; color: #333333;
font-size: 18px; font-size: 18px;
display: flex; /*display: flex;
align-items: center; align-items: center;*/
line-height: 44Px; line-height: 44Px;
text-align: center;
position: relative;
img { img {
display: block;
width: 25px; width: 25px;
height: 25px; height: 25px;
margin-left: 15px; position: absolute;
margin-right: 111.5px; left: 13px;
top: 9px
}
/* .title {
margin: 0 auto;
}*/
.btn-right {
position: absolute;
right: 14.5px;
bottom: 13px;
font-size: 13px;
line-height: 14px;
color: #373839;
} }
} }
} }
......
<template> <template>
<section class="header-section" > <section class="header-section" >
<div class="navBar" :style="{height: `${barHeight}Px`,backgroundColor: barColor}"></div> <div class="navBar" :style="{height: `${statusBarHeight}Px`,backgroundColor: statusBarColor}"></div>
<header class="header-container"> <header class="header-container">
<img @click="goBack" src="~/assets/img/icon-back.png" alt=""> <img @click="goBack" src="~/assets/img/icon-back.png" alt="">
<div class="head-btn"> <div class="head-btn">
<div class="btn active-btn left">今日排行榜</div> <div
class="btn left"
:class="{'active-btn':activeBtnType}"
@click="headBtnClick">
{{headBtn.leftName}}
</div>
<div class="line"></div> <div class="line"></div>
<div class="btn right">累计排行榜</div> <div
class="btn right"
:class="{'active-btn':!activeBtnType}"
@click="headBtnClick">
{{headBtn.rightName}}
</div>
</div> </div>
<div class="right-btn">昨日获奖</div> <div class="right-btn" v-if="rightBtn" @click="rightBtnClick">{{rightBtn}}</div>
</header> </header>
</section> </section>
</template> </template>
...@@ -23,22 +33,31 @@ ...@@ -23,22 +33,31 @@
return '' return ''
} }
}, },
rightBtn: {
type: String,
default: function () {
return ''
}
},
backType: { backType: {
type: Number, type: Number,
default: function () { default: function () {
return 1 return 1
} }
}, },
barHeight: { headBtn: {
type: Number, type: Object,
default:function () { default: function () {
return 0 return {
leftName: '',
rightName: ''
}
} }
}, },
barColor: { activeBtnType: {
type: String, type: Boolean,
default: function () { default: function () {
return '#ffffff' return true
} }
} }
}, },
...@@ -54,6 +73,12 @@ ...@@ -54,6 +73,12 @@
}else { }else {
this.$rocNative.goBack() this.$rocNative.goBack()
} }
},
headBtnClick() {
this.$emit('handleBtn')
},
rightBtnClick() {
this.$emit('handleRightBtn')
} }
} }
} }
...@@ -97,6 +122,7 @@ ...@@ -97,6 +122,7 @@
padding: 0 15px; padding: 0 15px;
line-height: 30px; line-height: 30px;
color: #373839; color: #373839;
z-index: 2;
} }
.left { .left {
border-bottom-left-radius: 15px; border-bottom-left-radius: 15px;
......
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../assets/style/mixin.scss'; @import '../assets/style/mixin.less';
.top-title-new{ .top-title-new{
//height:px2rem(45px); //height:px2rem(45px);
line-height:px2rem(25px); line-height:px2rem(25px);
......
...@@ -52,6 +52,14 @@ module.exports = { ...@@ -52,6 +52,14 @@ module.exports = {
src: '~/plugins/vueComponent', src: '~/plugins/vueComponent',
ssr: false ssr: false
}, },
{
src: '~plugins/vue-infinite-scroll',
ssr: false
},
{
src: '~plugins/mixins',
ssr: false
}
], ],
/* /*
** Nuxt.js modules ** Nuxt.js modules
......
因为 它太大了无法显示 源差异 。您可以改为 查看blob
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
"vant": "^2.0.9", "vant": "^2.0.9",
"vconsole": "^3.3.4", "vconsole": "^3.3.4",
"web-buried-point": "^2.0.0" "vue-infinite-scroll": "^2.0.2",
"web-buried-point": "^2.1.0"
}, },
"devDependencies": { "devDependencies": {
"@nuxtjs/axios": "^5.5.4", "@nuxtjs/axios": "^5.5.4",
......
.hospital-ranking-wrap {
position: relative;
.info-container {
width: 100%;
height: 130px;
background: url(../../assets/img/person-detail/detail-top-bg.png) no-repeat;
background-size: cover;
overflow: hidden;
.info {
display: flex;
align-items: center;
padding: 0 15px;
margin-top: 20px;
img {
width: 50px;
height: 50px;
border-radius: 100%;
}
.content {
display: flex;
margin-left: 10px;
flex-flow: column;
align-items: flex-start;
.main-name {
color: #fff;
font-size: 18px;
font-weight: 700;
}
.main1-name {
color: #fff;
font-size: 12px;
margin-top: 8px;
}
.details {
display: flex;
align-items: center;
margin-top: 8px;
.item {
font-size: 14px;
font-weight: 700;
.label {
color: #fff;
}
.value {
color: #FFDD58;
}
}
}
.details-d {
margin-top: 0;
}
.line {
display: inline-block;
width: 0.5px;
height: 10px;
background: #fff;
margin: 0 6px;
}
}
.not-join {
margin-left: 10px;
.main-name {
color: #fff;
font-size: 14px;
font-weight: 700;
line-height: 14px;
}
.details {
color: #fff;
font-size: 12px;
line-height: 12px;
margin-top: 8px;
}
}
}
}
.main-content {
width: 100%;
border-radius: 20px 20px 0px 0px;
position: absolute;
top: 90px;
background: #fff;
.description {
height: 40px;
line-height: 40px;
color: #FD6037;
font-size: 13px;
display: flex;
align-items: center;
span {
display: inline-block;
color: #373839;
font-size: 16px;
font-weight: 700;
margin: 0 6px 0 20px;
}
}
.description-d {
justify-content: center;
}
.ranking-title {
display: flex;
align-items: center;
height: 40px;
background: #FFF7F2;
color: #979899;
font-size: 14px;
padding: 0 25px 0 13px;
margin-bottom: 3px;
.marginL {
margin-left: 11px;
}
.marginAuto {
margin-left: auto;
}
}
.ranking-list {
padding: 0 25px;
.item {
display: flex;
align-items: center;
padding: 13.5px 0;
.ranking-icon {
width: 25px;
height: 30px;
}
.icon-num {
width: 25px;
color: #373839;
font-size: 15px;
font-weight: 700;
text-align: center;
}
.doctor-photo {
width: 35px;
height: 35px;
border-radius: 100%;
margin-left: 25px;
}
.doctor-name {
color: #333333;
font-size: 16px;
font-weight: 700;
margin-left: 10px;
width: 130px;
}
.hospital-name {
color: #333333;
font-size: 16px;
font-weight: 700;
margin-left: 25px;
width: 130px;
}
.num {
color: #373839;
font-weight: 700;
font-size: 18px;
margin-left: auto;
}
}
}
}
}
\ No newline at end of file
<template>
<section class="hospital-ranking-wrap">
<ranking-header
:headBtn="headBtn"
:activeBtnType="activeBtnType"
@handleBtn="changeRanking">
</ranking-header>
<div class="info-container" :style="{ marginTop: `${44+statusBarHeight}Px`}">
<div class="info info-hospital" v-if="activeBtnType">
<img src="~/assets/img/hospital-ranking/icon-hospital.png" alt="">
<div class="content" v-if="hospitalRanking.score">
<div class="con main-name">{{hospitalRanking.name}}</div>
<div class="con details">
<p class="item">
<span class="label">累计排名</span>
<span class="value">{{hospitalRanking.rank}}</span>
</p>
<p class="line"></p>
<p class="item">
<span class="label">累计勤奋分 </span>
<span class="value">{{hospitalRanking.score}}</span>
</p>
</div>
</div>
<div class="not-join" v-else>
<div class="con main-name">{{hospitalRanking.name}}</div>
<div class="con details">您的机构还未参与活动</div>
</div>
</div>
<div class="info info-doctor" v-else>
<img :src="contributionRanking.avatarImageUrl" alt="">
<div class="content" v-if="contributionRanking.score">
<div class="con details details-d">
<p class="item">
<span class="label">累计排名</span>
<span class="value">{{contributionRanking.rank}}</span>
</p>
<p class="line"></p>
<p class="item">
<span class="label">累计勤奋分 </span>
<span class="value">{{contributionRanking.score}}</span>
</p>
</div>
<div class="con main1-name">{{contributionRanking.hospital}}</div>
</div>
<div class="not-join" v-else>
<div class="con main-name">您还未参加活动</div>
<div class="con details">赶快参与活动赢每日奖品</div>
</div>
</div>
</div>
<div class="main-content">
<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">
<span>TOP100</span>
<!--<span class="marginL">机构名称</span>
<span class="marginAuto">机构勤奋分</span>-->
<span class="marginL">{{activeBtnType?'机构名称':'机构成员'}}</span>
<span class="marginAuto">{{activeBtnType?'机构勤奋分':'贡献勤奋分'}}</span>
</div>
<div class="ranking-list" :style="{marginBottom: `${50+homeIndicatorHeight}` + 'Px'}">
<div class="item" v-if="activeBtnType" v-for="(itemH,index) in hospitalRanking.topRankList">
<img v-if="index<=2" :src="dealRankIcon(index)" alt="" class="ranking-icon">
<p v-else class="icon-num" >{{index+1}}</p>
<p class="hospital-name">{{itemH.name}}</p>
<p class="num">{{itemH.score}}</p>
</div>
<div class="item" v-if="!activeBtnType" v-for="(itemD,index) in contributionRanking.topRankList">
<img v-if="index<=2" :src="dealRankIcon(index)" alt="" class="ranking-icon">
<p v-else class="icon-num" >{{index+1}}</p>
<img :src="itemD.avatarImageUrl" alt="" class="doctor-photo">
<p class="doctor-name">{{itemD.name}}</p>
<p class="num">{{itemD.score}}</p>
</div>
</div>
<footer-button
:btnText="btnText"
:btnType="btnType">
</footer-button>
</div>
</section>
</template>
<script>
import RankingHeader from '@/components/ranking-header';
import FooterButton from '@/components/footer-button';
import { getContributionRanking, getHospitalRanking} from '@/service/detailsAndRanking'
export default {
name: 'hospital-ranking',
components: {
RankingHeader,
FooterButton
},
data() {
return {
showPop: false,
title: '个人明细',
headBtn: {
leftName: '机构排行榜',
rightName: '人员贡献榜'
},
activeBtnType: true, //true机构,false人员
hospitalRanking: {},
contributionRanking: {},
btnText: '助力机构 创造佳绩',
btnType: true
};
},
computed: {
},
mounted() {
this.getRankData();
},
methods: {
changeRanking() {
this.activeBtnType = !this.activeBtnType;
this.getRankData()
},
dealRankName(hospitalType) {
if(hospitalType == 0) {
return '火星榜';
} else if(hospitalType == 1) {
return '萌芽榜';
} else if(hospitalType == 2) {
return '奋进榜';
} else if(hospitalType == 3) {
return '超越榜';
}
},
dealRankIcon(index) {
if(index == 0) {
return require('../../assets/img/icon-gold.png')
} else if(index == 1) {
return require('../../assets/img/icon-silver.png')
} else if(index == 2) {
return require('../../assets/img/icon-copper.png')
}
},
getHospitalRanking() {
getHospitalRanking().then(res => {
if(res.code == '000000') {
this.hospitalRanking = res.data;
}
})
},
getContributionRanking() {
getContributionRanking().then(res => {
if(res.code == '000000') {
this.contributionRanking = res.data;
}
})
},
getRankData() {
if(this.activeBtnType) {
this.getHospitalRanking();
} else {
this.getContributionRanking()
}
}
},
};
</script>
<style lang="less" scoped>
@import 'index.less';
</style>
<template> <template>
<div class="in-activity-wrap"> <div class="in-activity-wrap" :style="{paddingTop: padTop + 'px'}">
<h5header
v-if="!isWeb"
title="云鹊奖2019"
:baseShowHeight="0"
:isOpacity="false"
:shareObj="shareObj"
:isCheckAuth="true"
@checkAuth="handleLoginCheck"
@getHeaderHeight="getHeaderHeight"
/>
<!-- 顶部的四个阶段 进度条 --> <!-- 顶部的四个阶段 进度条 -->
<ul class="top-process-bar"> <ul class="top-process-bar">
<!-- <li class="over"> <li v-for="(item, index) in stageDateList" :class="returnStageClass(item, index)">
<p class="title">高血压学习</p>
<p class="date">12月16至19日</p>
</li>
<li class="active">
<p class="title">糖尿病学习</p>
<p class="date">12月20至24日</p>
</li>
<li>
<p class="title">中医科学习</p>
<p class="date">12月24至27日</p>
</li>
<li>
<p class="title">全科学习</p>
<p class="date">12月27至30日</p>
</li> -->
<li v-for="item in stageDateList" :class="">
<p class="title">{{ item.title }}</p> <p class="title">{{ item.title }}</p>
<p class="date">{{ item.date }}</p> <p class="date">{{ item.date }}</p>
</li> </li>
...@@ -28,115 +21,136 @@ ...@@ -28,115 +21,136 @@
<div class="big-bg-wrap"> <div class="big-bg-wrap">
<div class="award-wrap"> <div class="award-wrap">
<div class="stage-rule"> <div class="stage-rule">
<img class="stage-text" src="../assets/img/stageTwo/stage-01-text.png" alt=""> <img class="stage-text" :src="returnStageText()" alt="">
<img class="rule-btn" src="../assets/img/stageTwo/rule-btn.png" alt="" @click="handleRuleBtnClick"> <img class="rule-btn" src="../assets/img/stage-two/rule-btn.png" alt="" @click="handleRuleBtnClick">
</div> </div>
<img class="reward-pic" src="../assets/img/stageTwo/award-01-pic.png" alt=""> <img class="reward-pic" :src="returnAwardPic()" alt="">
</div> </div>
<!-- 未登录 --> <!-- 未登录 -->
<div v-if="!isLogin" class="not-login-wrap"> <div v-if="!isLogin" class="not-login-wrap">
<img class="gold-coin" src="../assets/img/stageTwo/gold-coin.png" alt=""> <img class="gold-coin" src="../assets/img/stage-two/gold-coin.png" alt="">
<img class="head-icon" src="../assets/img/stageTwo/not-login-icon.png" alt=""> <img class="head-icon" src="../assets/img/stage-two/default-login-icon.png" alt="">
<div class="content-info"> <div class="content-info">
<p class="not-login-text">您还未登录</p> <p class="not-login-text">您还未登录</p>
<p class="tips">登录并加入机构参加活动</p> <p class="tips">登录并加入机构参加活动</p>
</div> </div>
<div class="go-login login-but-no-join" @click="goToLogin">去登录<img src="../assets/img/stageTwo/right-icon-small.png" alt=""></div> <div class="go-login login-but-no-join" @click="goToLogin">去登录<img src="../assets/img/stage-two/right-icon-small.png" alt=""></div>
</div> </div>
<!-- 已登录,但没有加入机构 --> <!-- 已登录,但没有加入机构 -->
<div v-if="isLogin && !isJoin" class="not-login-wrap "> <div v-if="isLogin && !isJoin" class="not-login-wrap ">
<img class="gold-coin" src="../assets/img/stageTwo/gold-coin.png" alt=""> <img class="gold-coin" src="../assets/img/stage-two/gold-coin.png" alt="">
<img class="head-icon" src="../assets/img/stageTwo/not-login-icon.png" alt=""> <img class="head-icon" v-if="doctorInfo.avatarImageUrl" :src="doctorInfo.avatarImageUrl" alt="">
<img class="head-icon" v-else src="../assets/img/stage-two/default-login-icon.png" alt="">
<div class="content-info"> <div class="content-info">
<p class="not-login-text">{{appUserInfo.userName}}</p> <p class="not-login-text">{{ doctorInfo.name }}</p>
<p class="tips">尚未加入一个机构</p> <p class="tips">尚未加入一个机构</p>
</div> </div>
<div class="go-login login-but-nojoin" @click="goToJoin">加入机构<img src="../assets/img/stageTwo/right-icon-small.png" alt=""></div> <div class="go-login login-but-nojoin" @click="goToJoin">加入机构<img src="../assets/img/stage-two/right-icon-small.png" alt=""></div>
</div> </div>
<!-- 已登录 且 已加入机构 --> <!-- 已登录 且 已加入机构 -->
<div v-if="isLogin && isJoin" class="user-info-wrap"> <div v-if="isLogin && isJoin" class="user-info-wrap">
<img class="gold-coin" src="../assets/img/stageTwo/gold-coin.png" alt=""> <img class="gold-coin" src="../assets/img/stage-two/gold-coin.png" alt="">
<div class="basic-info"> <div class="basic-info">
<div class="head-icon"> <div class="head-icon">
<img src="../assets/img/stageTwo/default-doctor-icon.png" alt=""> <img v-if="doctorInfo.avatarImageUrl" :src="doctorInfo.avatarImageUrl" alt="">
<img v-else src="../assets/img/stage-two/default-login-icon.png" alt="">
</div> </div>
<div class="name-info"> <div class="name-info">
<p class="name">召唤</p> <p class="name">{{ doctorInfo.name }}</p>
<p class="company">上海复旦大学附属中山医院</p> <p class="company">{{ doctorInfo.hospital }}</p>
</div> </div>
<div @click="goToUserDetail" class="detail">个人明细<img src="../assets/img/stageTwo/right-icon-small.png" alt=""></div> <div @click="goToUserDetail" class="detail">个人明细<img src="../assets/img/stage-two/right-icon-small.png" alt=""></div>
</div> </div>
<ul class="billboard-wrap"> <ul class="billboard-wrap">
<li> <li>
<p class="title">个人今日勤奋分</p> <p class="title">个人今日勤奋分</p>
<p class="score">{{doctorInfo.userDayScore}}</p> <p class="score">{{doctorInfo.userDayScore}}</p>
<p class="rank"><img src="../assets/img/stageTwo/billboard-flag.png" alt="">今日排名{{doctorInfo.userDayRank}}</p> <p class="rank"><img src="../assets/img/stage-two/billboard-flag.png" alt="">今日排名{{doctorInfo.userDayRank}}</p>
<div @click="goToUserBoard" class="billboard-btn">查看个人榜单<img src="../assets/img/stageTwo/right-icon-small.png" alt=""></div> <div @click="goToUserBoard" class="billboard-btn">查看个人榜单<img src="../assets/img/stage-two/right-icon-small.png" alt=""></div>
</li> </li>
<li class="organ"> <li class="organ">
<p class="title">机构累计勤奋分</p> <p class="title">机构累计勤奋分</p>
<p class="score">{{doctorInfo.hospitalScore}}</p> <p class="score">{{doctorInfo.hospitalScore}}</p>
<p class="rank"><img src="../assets/img/stageTwo/billboard-flag.png" alt="">累计排名{{doctorInfo.hospitalRank}}</p> <p class="rank"><img src="../assets/img/stage-two/billboard-flag.png" alt="">累计排名{{doctorInfo.hospitalRank}}</p>
<div @click="goToOrganBoard" class="billboard-btn">查看机构榜单<img src="../assets/img/stageTwo/right-icon-small.png" alt=""></div> <div @click="goToOrganBoard" class="billboard-btn">查看机构榜单<img src="../assets/img/stage-two/right-icon-small.png" alt=""></div>
</li> </li>
</ul> </ul>
<p class="score-tips">再获得{{doctorInfo.targetRequiredScore}}勤奋分即可上升到前{{doctorInfo.targetRank}}名获得?????????</p> <p class="score-tips">{{ returnScoreAwardTips }}</p>
<div class="bean-wrap"> <div class="bean-wrap">
<p class="personal-total-get">累计个人获得:<span>{{doctorInfo.userTotalBonus}}云鹊豆</span></p> <p class="personal-total-get">累计个人获得:<span>{{doctorInfo.userTotalBonus}}云鹊豆</span></p>
<div class="bean-center">云鹊豆中心<img src="../assets/img/stageTwo/right-icon-small.png" alt=""></div> <div @click="goToBeanCenter" class="bean-center">云鹊豆中心<img src="../assets/img/stage-two/right-icon-small.png" alt=""></div>
</div> </div>
<p class="bean-tips">机构勤奋分达成目标,全员可获云鹊豆</p> <p class="bean-tips">机构勤奋分达成目标,全员可获云鹊豆</p>
<div class="bean-stage"> <div class="bean-stage">
<img src="../assets/img/stageTwo/bean-stage01.png" alt=""> <img :src="returnBeanImg" alt="">
<ul class="score-list"> <ul class="score-list">
<li v-for="item in doctorInfo.hospitalLevelScore">{{item}}</li> <li v-for="item in doctorInfo.hospitalLevelScore">{{item}}</li>
<li>12月30日</li> <li>12月30日</li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
<!-- 邀请医生好友学课程 --> <!-- 邀请医生好友学课程 -->
<div class="invite-doctor-wrap"> <div class="invite-doctor-wrap">
<img class="top-head-icon" src="../assets/img/stageTwo/invite-doctor-top.png" alt=""> <img class="top-head-icon" src="../assets/img/stage-two/invite-doctor-top.png" alt="">
<p class="invite-tips">每邀请1位医生好友领取课程,+20勤奋分 +20云鹊豆</p> <p class="invite-tips">每邀请1位医生好友领取课程,+{{ eachInviteAward.mark }}勤奋分 +{{ eachInviteAward.bean }}云鹊豆</p>
<div class="invite-list-wrap"> <div class="invite-list-wrap">
<ul class="invite-list"> <ul class="invite-list">
<!-- 已邀请的 --> <template v-if="!isLogin || !isJoin">
<li v-for="item in inviteList"> <li>
<img @click="eachDoctorClick" v-if="item.avatarImageUrl" class="doctor-icon" :src="item.avatarImageUrl" alt="">
<img @click="eachDoctorClick" v-else class="doctor-icon" src="../assets/img/stageTwo/default-doctor-icon.png" alt="">
<p class="text">{{ item.doctorName ? item.doctorName : item.mobile }}</p>
</li>
<!-- 未邀请的 -->
<template v-if="inviteList && inviteList.length < 4">
<li v-for="item in notInviteShowList">
<div class="add-btn" @click="eachDoctorClick"> <div class="add-btn" @click="eachDoctorClick">
<img src="../assets/img/stageTwo/add-pic-icon.png" alt=""> <img src="../assets/img/stage-two/add-pic-icon.png" alt="">
</div> </div>
</li> </li>
<li>
<div class="add-btn" @click="eachDoctorClick">
<img src="../assets/img/stage-two/add-pic-icon.png" alt="">
</div>
</li>
<li>
<div class="add-btn" @click="eachDoctorClick">
<img src="../assets/img/stage-two/add-pic-icon.png" alt="">
</div>
</li>
<li>
<div class="add-btn" @click="eachDoctorClick">
<img src="../assets/img/stage-two/add-pic-icon.png" alt="">
</div>
</li>
</template>
<template v-if="isLogin && isJoin">
<!-- 已邀请的 -->
<li v-for="item in inviteList">
<img @click="eachDoctorClick" v-if="item.avatarImageUrl" class="doctor-icon" :src="item.avatarImageUrl" alt="">
<img @click="eachDoctorClick" v-else class="doctor-icon" src="../assets/img/stage-two/default-doctor-icon.png" alt="">
<p class="text">{{ item.doctorName ? item.doctorName : item.mobile }}</p>
</li>
<!-- 未邀请的 -->
<template v-if="inviteList && inviteList.length < 4">
<li v-for="item in notInviteShowList">
<div class="add-btn" @click="eachDoctorClick">
<img src="../assets/img/stage-two/add-pic-icon.png" alt="">
</div>
</li>
</template>
</template> </template>
<!-- 查看更多 --> <!-- 查看更多 -->
<li> <li>
<div @click="seeMore" class="add-btn"> <div @click="seeMore" class="add-btn">
<img class="right-icon-big" src="../assets/img/stageTwo/right-icon-big.png" alt=""> <img class="right-icon-big" src="../assets/img/stage-two/right-icon-big.png" alt="">
</div> </div>
<p class="text see-more">查看更多</p> <p class="text see-more">查看更多</p>
</li> </li>
</ul> </ul>
</div> </div>
<div class="invite-btn"> <div class="invite-btn">
<img src="../assets/img/stageTwo/invite-btn.png" alt="" class="invite-btn"> <img src="../assets/img/stage-two/invite-btn.png" alt="" class="invite-btn">
<p @click="handleInviteClick" class="text">去邀请</p> <p @click="handleInviteClick" class="text">去邀请</p>
</div> </div>
<div class="login-tips">被邀请好友登录APP,收益X4倍</div> <div class="login-tips">被邀请好友登录APP,收益X4倍</div>
...@@ -146,29 +160,14 @@ ...@@ -146,29 +160,14 @@
<div class="daily-task"> <div class="daily-task">
<div class="top-center-bar">每日任务</div> <div class="top-center-bar">每日任务</div>
<ul class="task-list"> <ul class="task-list">
<li> <!-- taskList -->
<img class="left-icon" src="../assets/img/stageTwo/daily-clock-icon.png" alt=""> <li v-for="item in taskList">
<div class="center-wrap"> <img class="left-icon" :src="returnEachTaskIcon(item)" alt="">
<p class="title">每日打卡</p>
<p class="detail-text">+5勤奋分 +5云鹊豆</p>
</div>
<div @click="handleClock" class="right-btn done">已打卡</div>
</li>
<li>
<img class="left-icon" src="../assets/img/stageTwo/hypertension-icon.png" alt="">
<div class="center-wrap">
<p class="title">高血压课程学习</p>
<p class="detail-text">+5勤奋分 +5云鹊豆</p>
</div>
<div @click="handleTaskClick" class="right-btn">去学习</div>
</li>
<li>
<img class="left-icon" src="../assets/img/stageTwo/smo-icon.png" alt="">
<div class="center-wrap"> <div class="center-wrap">
<p class="title">高血压SMO项目任务</p> <p class="title">{{ item.ruleName }}</p>
<p class="detail-text">奖励xxx勤奋分</p> <p class="detail-text">{{returnUnderAwardTips(item)}}</p>
</div> </div>
<div @click="handleTaskClick" class="right-btn">去完成</div> <div @click="goToFinish(item)" :class="returnEachTaskStatus(item)">{{ returnIconText(item) }}</div>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -182,12 +181,12 @@ ...@@ -182,12 +181,12 @@
<div v-if="clockSuccessVisible" class="toast-wrap" @touchmove.prevent> <div v-if="clockSuccessVisible" class="toast-wrap" @touchmove.prevent>
<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/stageTwo/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/stageTwo/win-award-bg.png" alt=""> --> <!-- <img class="back-image" src="../assets/img/stage-two/win-award-bg.png" alt=""> -->
<!-- <img class="back-image" src="../assets/img/stageTwo/award-cup-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">已获得: 5勤奋分, 5云鹊豆</p> <p class="message">已获得: {{vm.clockAward.mark}}勤奋分, {{vm.clockAward.bean}}云鹊豆</p>
<div class="bottom-btn">我知道了</div> <div @click="hideClockModal" class="bottom-btn">我知道了</div>
<div class="close-btn"></div> <div class="close-btn"></div>
</div> </div>
</div> </div>
...@@ -199,7 +198,7 @@ ...@@ -199,7 +198,7 @@
<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>我知道了</li>
<li class="high-light">查看昨日获奖</li> <li @click="goToYesterdayPrize" class="high-light">查看昨日获奖</li>
</ul> </ul>
</div> </div>
</div> </div>
...@@ -208,119 +207,208 @@ ...@@ -208,119 +207,208 @@
</template> </template>
<script> <script>
import { getInviteList } from '@/service/activityMainpage'; import { getUserScoreInfo, getInviteList, getClockStatus, goToUpdateClock } from '@/service/activityMainpage';
import { checkHospitalStatus } from '@/service';
import h5header from '@/components/h5header';
import { getShareUrl } from '@/utils/index';
import { Toast } from 'vant';
const cookies = require('cookie-universal')();
let vm = null; let vm = null;
export default { export default {
data () { data () {
return { return {
// isFirstFresh: true, serverTime: '',
isLogin: false, // 是否 已登录 isLogin: false, // 是否 已登录
isJoin: true, // 是否 已加入机构 默认为false isJoin: false, // 是否 已加入机构 默认为false
joinStatus: 3, // 1-已加入机构 2-机构在审核中状态 3-未加入机构
currentStage: 0, // 当前处于第几阶段 0表示不在四个阶段里,1-4表示对应阶段,取图片地址用
stageDateList: [ stageDateList: [
{ date: '12月16至19日', beginDate: '2019-12-16', endDate: '2019-12-19', title: '高血压学习' }, { date: '12月16至19日', beginDate: '2019/12/16 00:00:00', endDate: '2019/12/19 23:59:59', title: '高血压学习', award: '小米电视' },
{ date: '12月20至23日', beginDate: '2019-12-20', endDate: '2019-12-23', title: '糖尿病学习' }, { date: '12月20至23日', beginDate: '2019/12/20 00:00:00', endDate: '2019/12/23 23:59:59', title: '糖尿病学习', award: '米家洗衣机' },
{ date: '12月24至26日', beginDate: '2019-12-24', endDate: '2019-12-26', title: '中医科学习' }, { date: '12月24至26日', beginDate: '2019/12/24 00:00:00', endDate: '2019/12/26 23:59:59', title: '中医学习', award: '米家两门冰箱' },
{ date: '12月27至29日', beginDate: '2019-12-27', endDate: '2019-12-29', title: '全科学习' }, { date: '12月27至29日', beginDate: '2019/12/27 00:00:00', endDate: '2019/12/29 23:59:59', title: '全科学习', award: '荣耀 Play3' },
], ],
awardList: {
No1: '',
No3: '欧姆龙血压计',
No10: '欧姆龙体温计',
},
appUserInfo: { appUserInfo: {
userName: '', userName: '',
userMobile: '', userMobile: '',
doctorId: '', doctorId: '',
userToken: '', userToken: '',
// appVersion: '',
// systemType: '',
}, },
eachInviteAward: { // 每邀请1位医生好友领取课程,+??勤奋分 +??云鹊豆 (默认均为20)
doctorInfo: { mark: 20, // 勤奋分
userDayScore: '1000', // 用户当日勤奋分 bean: 20, // 云鹊豆
userDayRank: '5', // 用户当日排名
hospitalScore: '6000', // 机构累计勤奋分
hospitalRank: '8', // 机构累计排名
userTotalBonus: '7777', // 个人累计获得云鹊豆
hospitalLevelScore: [100, 300, 700], // 三阶段达标分值, 数组返回
targetRequiredScore: '10', // 再获得多少分 // 再获得10勤奋分即可上升到前10名获得欧姆龙温度计
targetRank: '5', // 上升到多少名
}, },
championAward: [ // 第一名的奖励名称会根据日期变化 doctorInfo: {
'小米电视 4C 32英寸', // 12.16-12.19 name: '', // 接口返回用户名字或者手机号带遮掩
'米家洗衣机', // 12.20-12.23 hospital: '', // 机构名称
'米家两门冰箱', // 12.24-12.26 avatarImageUrl: '', // 头像URL
'荣耀 Play3', // 12.27-12.29 userDayScore: '', // 用户当日勤奋分
], userDayRank: '', // 用户当日排名
rankLittleTips: { hospitalScore: '', // 机构累计勤奋分
first: '今日保持第1名,可获得小米电视', hospitalRank: '', // 机构累计排名
before3: '第1名可获得小米电视,今日再拿X分即有机会上升到第1名', userTotalBonus: '', // 个人累计获得云鹊豆
before10: '前3名可获得血压计,今日再拿X分即有机会上升到第3名', hospitalLevelScore: [], // 三阶段达标分值, 数组返回
after10: '前10名可获得体温计,今日再拿X分即有机会上升到第10名', targetRequiredScore: '', // 再获得多少分 // 再获得10勤奋分即可上升到前10名获得欧姆龙温度计
targetRank: '', // 上升到多少名
todayDate: 0,
yesterdayDate: 0,
userYesterdayRank: 0, // 用戶昨日排名
}, },
clockSuccessVisible: false, // 是否显示 打卡成功 弹窗 clockSuccessVisible: false, // 是否显示 打卡成功 弹窗
activityEndVisible: false, // 是否显示 活动结束 弹窗 activityEndVisible: false, // 是否显示 活动结束 弹窗
inviteList: [], // 已邀请的用户列表 inviteList: [], // 已邀请的用户列表
notInviteShowList: [], // 未邀请的默认显示 notInviteShowList: [], // 未邀请的默认显示
taskList: [], // 打卡、课程、SMO
taskObj: {
clock: null, // 打卡
lesson: null, // 课程
smo: null, // 患者招募
},
isClockFinish: false, // 是否打卡
clockAward: { // 打卡的奖励 默认都是5
mark: 5,
bean: 5,
},
isWeb: false,
shareObj: {},
padTop: 0
} }
}, },
components: {
h5header,
},
computed: { computed: {
// loginUserIcon() { returnBeanImg() {
// if(){ let hospitalScore = vm.doctorInfo.hospitalScore;
let arr = vm.doctorInfo.hospitalLevelScore;
// }else{ if( hospitalScore < arr[0]){
// return '../assets/img/stageTwo/not-login-icon.png'; return require(`../assets/img/stage-two/bean-stage-0.png`);
// } }else if( ((arr[0] == hospitalScore) || (arr[0] < hospitalScore)) && (hospitalScore < arr[1]) ){
// }, return require(`../assets/img/stage-two/bean-stage-1.png`);
}else if( ((arr[1] == hospitalScore) || (arr[1] < hospitalScore)) && (hospitalScore < arr[2]) ){
// 顶部类似tab的显示逻辑 return require(`../assets/img/stage-two/bean-stage-2.png`);
topDateStatus(item) { }else if( ((arr[2] == hospitalScore) || (arr[2] < hospitalScore)) ){
// 获取当前时间? 前端自己获取,还是 有个接口来返回服务器时间 return require(`../assets/img/stage-two/bean-stage-3.png`);
let currentTime = new Date().getTime(); }else{
let beginDate = item.beginDate.split('-'); return require(`../assets/img/stage-two/bean-stage-0.png`);
let endDate = item.endDate.split('-');
let beginTime = new Date(beginDate[0], beginDate[1], beginDate[2]).getTime();
let endTime = new Date(endDate[0], endDate[1], endDate[2]).getTime();
if( currentTime < beginTime ){
return '';
} }
}, },
returnScoreAwardTips() {
let award = '';
if( vm.doctorInfo && vm.doctorInfo.userDayRank ) {
let userDayRank = vm.doctorInfo.userDayRank;
if( userDayRank == 1 ){
return `今日保持第1名,可获得${vm.awardList.No1}`;
}else if( userDayRank < 4 ){ // 2-3 提示 再获得X勤奋分即可上升到前Y名获得 第1名奖品
award = vm.awardList.No1;
}else if( userDayRank < 11 ){ // 4-10 提示 再获得X勤奋分即可上升到前Y名获得 第3名奖品
award = vm.awardList.No3;
}else{ // 10名以后 提示:再获得X勤奋分即可上升到前Y名获得 第10名奖品
award = vm.awardList.No10;
}
return `再获得${vm.doctorInfo.targetRequiredScore}勤奋分即可上升到前${vm.doctorInfo.targetRank}名获得${award}`
}
}
}, },
created() { created() {
vm = this; vm = this;
// 取服务器时间,切换不同时间段的显示
vm.getServerTime();
}, },
mounted() { 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.isWeb = vm.$rocNative.isWeb;
vm.$rocNative.appInit(); vm.getTasks(); // 放到登录后或其他************************
vm.getUserInfo();
vm.$rocNative.appInit();
vm.getUserInfo(); // 判断是否登录
// if (process.client) { if (process.client) {
// window.__refresh = function(params) { window.__refresh = function(params) {
// vm.isFirstFresh = false; vm.getUserInfo(); // 判断是否登录
// }
// } }
}
}, },
methods: { methods: {
// 获取服务器时间
getServerTime() {
// 调取接口获取服务器时间
// request else vm.serverTime = new Date().getTime();
vm.serverTime = 1577376000000;
},
hideClockModal() {
vm.clockSuccessVisible = false;
},
returnStageText() {
if(vm.currentStage == 0){
return '';
}else{
return require(`../assets/img/stage-two/stage-0${vm.currentStage}-text.png`);
}
},
returnAwardPic() {
if(vm.currentStage == 0){
return '';
}else{
return require(`../assets/img/stage-two/award-0${vm.currentStage}-pic.png`)
}
},
returnStageClass(item, index){ // 返回顶部四个时间进度条状态
// debugger;
// 获取当前服务器时间 获取失败则用本地时间 ***************************************************
let currentTime = vm.serverTime || new Date().getTime();
let beginTime = new Date(item.beginDate).getTime();
let endTime = new Date(item.endDate).getTime();
let status = '';
if( currentTime < beginTime ){ // 未开始
status = '';
}else if( (currentTime == beginTime) || (beginTime < currentTime && currentTime < endTime) || (currentTime == endTime) ){ // 活动中
status = 'active';
vm.awardList.No1 = item.award; // 根据时间段来设置第1名奖品
vm.currentStage = index + 1; // 决定显示第几张图片
}else{ // 已结束
status = 'over';
};
return status;
},
// 判断用户是否登录? // 判断用户是否登录?
getUserInfo() { getUserInfo() {
vm.$rocNative vm.$rocNative
.getUserInfo() .getUserInfo()
.then(params => { .then(params => {
// _seft.userToken = params.userToken; // 存到store里 // _seft.userToken = params.userToken; // 存到store里
alert(JSON.stringify(params)); if(params && params.userToken){
if(params && params.userMobile){ cookies.set('token', params.userToken)
}
// alert(JSON.stringify(params));
if(params && params.userMobile){ // 已登录 (有手机号表示 已登录,无手机号表示 未登录)
vm.isLogin = true; vm.isLogin = true;
vm.appUserInfo = params; vm.appUserInfo = params;
alert('已经获取了 登录token了')
// 登录且加入机构才获取医生邀请了的列表 ?????????????????? 还是 已登录就获取,不论是否加入机构?
vm.loginCallback(); vm.loginCallback();
}else{ }else{ // 未登录
// alert('没获取到登录信息!!!') vm.isLogin = false;
} }
}); });
}, },
...@@ -331,20 +419,50 @@ ...@@ -331,20 +419,50 @@
}, },
// 登陆ok后 回调: 获取邀请的医生列表等。。 // 登陆ok后 回调: 获取邀请的医生列表等。。
loginCallback() { loginCallback() {
let token = '5463439BE4444FF8BC47CC4575E9D550'; // 开发时用这个调用数据 vm.getUserActivityInfo();
// let token = vm.appUserInfo.userToken; // 正式上线 用这个!!!! vm.goToCheckJoin();
getInviteList(token).then(res => { },
getUserActivityInfo() { // 获取用户及参加活动的具体信息
getUserScoreInfo().then(res => {
// alert('获取用户及分数信息。。。');
// alert(JSON.stringify(res));
vm.doctorInfo = res.data;
});
},
goToCheckJoin() { // 检查是否加入结构
checkHospitalStatus(vm.appUserInfo.userToken).then(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;
vm.joinStatus = 2;
}else { // 除了1,15 都是未加入机构
vm.isJoin = false;
vm.joinStatus = 3;
}
}else{
vm.$toast(res.message);
}
});
},
handleGetInviteList() {
getInviteList().then(res => {
alert(JSON.stringify('获取邀请的列表 OK')); alert(JSON.stringify('获取邀请的列表 OK'));
alert(JSON.stringify(res)); alert(JSON.stringify(res));
if(res && res.code == '000000'){ if(res && res.code == '000000'){
// alert
if(res.data && res.data.list){ if(res.data && res.data.list){
vm.inviteList = res.data.list; vm.inviteList = res.data.list;
alert(vm.inviteList.length) vm.notInviteShowList = [];
if( vm.inviteList.length > 4 || vm.inviteList.length == 4 ){ if( vm.inviteList.length > 4 || vm.inviteList.length == 4 ){
vm.inviteList.length = 4; vm.inviteList.length = 4;
vm.notInviteShowList = [];
}else{ }else{
let notInviteLength = 4 - vm.inviteList.length; let notInviteLength = 4 - vm.inviteList.length;
for(let i=0; i<notInviteLength; i++){ for(let i=0; i<notInviteLength; i++){
...@@ -356,7 +474,8 @@ ...@@ -356,7 +474,8 @@
}else{ }else{
vm.inviteList = []; vm.inviteList = [];
} }
}else{
vm.$toast(res.message);
} }
}) })
}, },
...@@ -366,15 +485,54 @@ ...@@ -366,15 +485,54 @@
}, },
// 去登录 // 去登录
goToLogin() { goToLogin() {
console.log('去登录...'); alert('去登录...');
vm.appLogin(); vm.appLogin();
}, },
// 去加入机构 // 去加入机构
goToJoin() { goToJoin() {
console.log('去加入机构...') alert('去加入机构...')
// 用户点击【加入机构】,继续判断用户是否有创建机构在审核状态,若有,则弹出弹窗提示。若无则跳转加入机构页面 // 用户点击【加入机构】,继续判断用户是否有创建机构在审核状态,若有,则弹出弹窗提示。若无则跳转加入机构页面
if( vm.joinStatus == 2 ){ // 机构审核中
alert('去机构审核中。。。。')
this.$dialog.confirm({
title: '提醒',
message: `抱歉,您创建的机构【${vm.doctorInfo.hospital}】正在审核中,审核通过后可参与活动<br/><br/>如有疑问可联系客:<span>400-920-8877</span><br/>(周一至周五9:00-18:00)`,
confirmButtonText: '查看进度',
cancelButtonText: '我知道了',
className: 'remind-success',
}).then(() => {
this.checkVersion(()=>{
if (this.$rocNative.isAndroid) {
this.$rocNative.setNeedClearUrl({ url: 'year_end_ssr' });
}
this.$rocNative.gotoInstitutionalReview({ url: window.location.href });
});
});
}else if( vm.joinStatus == 3 ){ // 未加入机构
alert('未加入机构。。。。。')
this.checkVersion(()=>{
if (this.$rocNative.isAndroid) {
this.$rocNative.setNeedClearUrl({ url: 'year_end_ssr' });
}
this.$rocNative.gotoActivityHospital({ url: window.location.href });
})
}
},
checkVersion(callback){
this.$rocNative.getAppVersionCode().then(res => {
const appVersion = parseFloat(res.versionCode.replace(/\./g, ''));
if(appVersion>=317){
callback();
}else{
this.$dialog.alert({
message: '当前app版本过低,请升级版本后继续操作',
className: 'version-toast'
});
}
});
}, },
handleLoginCheck(cb) { handleLoginCheck(cb) {
if( !this.isLogin ){ // 未登录 >>> 去登录 if( !this.isLogin ){ // 未登录 >>> 去登录
this.goToLogin(); this.goToLogin();
...@@ -387,32 +545,71 @@ ...@@ -387,32 +545,71 @@
// 跳转至 个人明细 // 跳转至 个人明细
goToUserDetail() { goToUserDetail() {
console.log('跳转至 个人明细') alert('跳转至 个人明细')
this.$router.push({
name: 'person-detail',
});
}, },
// 查看个人榜单 // 查看个人榜单
goToUserBoard() { goToUserBoard() {
console.log('跳转至 个人榜单') alert('跳转至 个人榜单')
this.$router.push({
name: 'person-ranking',
});
}, },
// 查看机构榜单 // 查看机构榜单
goToOrganBoard() { goToOrganBoard() {
console.log('跳转至 机构榜单') alert('跳转至 机构榜单')
this.$router.push({
name: 'hospital-ranking',
});
},
// 昨日获奖
goToYesterdayPrize() {
alert('跳转至 昨日获奖页面')
this.$router.push({
name: 'yesterday-prize',
});
}, },
// 云鹊豆中心 // 云鹊豆中心
goToBeanCenter() { goToBeanCenter() {
console.log('云鹊豆中心') let url = getShareUrl() + 'integral/#/chirpCenter';
alert(url)
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
})
}, },
// “邀请医生好友学课程” 列表中的每一个医生点击事件 // “邀请医生好友学课程” 列表中的每一个医生点击事件 跳转至邀请详情页
eachDoctorClick() { eachDoctorClick() {
let cb = this.goToDoctorPage; let cb = this.goToDoctorPage;
this.handleLoginCheck(cb); this.handleLoginCheck(cb);
}, },
// 去每个li医生详情页 ?????? // 跳转至邀请详情页
goToDoctorPage() { goToDoctorPage() { //“被邀请的用户模块“点击逻辑,点击用户头像、“+“或者查看更多,都跳转至邀请详情页
//“被邀请的用户模块“点击逻辑,点击用户头像、“+“或者查看更多,都跳转至邀请详情页 this.$router.push({
console.log('去邀请详情页....') name: 'invite-details',
});
}, },
//“邀请医生好友学课程” 查看更多 //“邀请医生好友学课程” 查看更多
...@@ -422,25 +619,67 @@ ...@@ -422,25 +619,67 @@
}, },
// 跳转至 “查看更多” 页面 // 跳转至 “查看更多” 页面
seeInviteMore() { seeInviteMore() {
console.log('去查看更多页面...'); this.$router.push({
name: 'invite-details',
});
}, },
// 去邀请 按钮 // 去邀请 按钮
handleInviteClick() { handleInviteClick() {
let cb = this.goToInvite; let cb = this.goToShare;
this.handleLoginCheck(cb); this.handleLoginCheck(cb);
}, },
goToInvite() { goToShare() {
console.log('去邀请逻辑》》》') alert('调app分享');
// let id = vm.encryptDoctorId();
let params = {
id: '',
taskId: '',
activityId: '',
};
// 调用APP分享
},
encryptDoctorId() {
// 给id加密
// return 'dddddd'
}, },
// 去打卡 按钮 // 去打卡 按钮
handleClock() { goToFinish(item) {
let cb = this.goToClock; let cb = () => {
vm.goToFinishCB(item);
};
this.handleLoginCheck(cb); this.handleLoginCheck(cb);
}, },
goToClock() { goToFinishCB(item) {
console.log('执行打卡逻辑'); // resourceType 业务类型 1.课程 2.考试 3.调查问卷 4.患者招募 5.宣教漫画 6.打卡 7.邀请
if( item.resourceType == 6 ){
// 执行打卡接口
if( vm.isClockFinish ){ // 已打卡,不执行,未打卡,去调用打卡接口
// 已打卡,不处理
// alert('已打过卡》》》》》》')
}else{ // 未打卡,去打卡
let params = {
activityId: item.activityId,
taskId: item.id,
};
goToUpdateClock(params).then(res => {
alert(JSON.stringify('goTO 更新去打卡状态'));
alert(JSON.stringify(res));
if(res && res.code == '000000'){
if(res.data){ // 打卡成功
vm.clockSuccessVisible = true;
}else{
vm.$toast(res.message);
}
}else{
vm.$toast(res.message);
}
})
}
}
}, },
// 每个任务的跳转点击 // 每个任务的跳转点击
...@@ -451,17 +690,296 @@ ...@@ -451,17 +690,296 @@
goToTask() { goToTask() {
console.log('do每个任务的跳转逻辑') console.log('do每个任务的跳转逻辑')
}, },
// 获取每日任务 及 邀请医生好友学课程里的 邀请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
}
},
"code": "000000",
"message": "成功"
};
// request let data = res.data;
getDoctorInfo() { 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;
}
}
}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 );
}
}, },
getTaskStatus(params) {
vm.isClockFinish = false;
getClockStatus(params).then(res => {
if(res && res.code == '000000'){
vm.isClockFinish = !!res.data;
}else{
vm.$toast(res.message);
}
})
},
returnUnderAwardTips(item) {
if( typeof item.eachInviteAwardMark != 'undefined' && item.eachInviteAwardMark != '0' ){
return `+${item.eachInviteAwardMark}勤奋分 +${item.eachInviteAwardBean}云鹊豆`;
}else{
return `+${item.eachInviteAwardBean}云鹊豆`;
}
},
// 格式化数据
formatEachTaskAward(item) {
let rewardList = item.rewardJsonInfo || [];
for( let j=0; j<rewardList.length; j++ ){
if( rewardList[j].rewardType == 3 ){ // 勤奋分
item.eachInviteAwardMark = rewardList[j].rewardQuantity;
}else if( rewardList[j].rewardType == 1 ){ // 云鹊豆
item.eachInviteAwardBean = rewardList[j].rewardQuantity;
}
};
return item;
},
// ddd
// 返回每个任务 icon
returnEachTaskIcon(item) { // resourceType 业务类型 1.课程 2.考试 3.调查问卷 4.患者招募 5.宣教漫画 6.打卡 7.邀请
if( item.resourceType == 6 ){
return require('../assets/img/task-icon/daily-clock-icon.png');
}else if( item.resourceType == 1 ) {
return require('../assets/img/task-icon/lesson-icon.png');
}else if( item.resourceType == 4 ){
return require('../assets/img/task-icon/smo-icon.png');
}else{
return require('../assets/img/task-icon/daily-clock-icon.png');
}
},
returnEachTaskStatus(item) {
if( item.resourceType == 6 ){
return vm.isClockFinish ? 'right-btn done' : 'right-btn'
}else{
return item.isFinish == 0 ? 'right-btn done' : 'right-btn'
}
},
// 返回任务右边的按钮文案
returnIconText(item) {
let text = '去完成';
if( item.resourceType == 6 ){
return vm.isClockFinish ? '已打卡' : '去打卡';
}
if( item.resourceType == 1 ){ // 1-课程
text = item.isFinish == 0 ? '已完成' : '去学习';
}else if( item.resourceType == 4 ){ // 4-smo
text = item.isFinish == 0 ? '已完成' : '去完成';
}
return text;
},
getHeaderHeight(val){
this.padTop = val;
},
}, },
} }
</script>> </script>>
<style lang="less"> <style lang="less">
@import '../assets/style/in-activity.less'; @import '../assets/style/in-activity.less';
</style>
<style lang="less">
@import '../assets/style/revant.less';
</style> </style>
\ No newline at end of file
.invite-details-wrap {
.main-container {
overflow: hidden;
.invite-explain {
padding: 0 15px;
margin: 20px 0 30px 0;
.title {
color: #333333;
font-size: 18px;
font-weight: 700;
}
.picture-explain {
display: flex;
justify-content: space-between;
margin-top: 18px;
.left {
width: 18px;
display: flex;
flex-flow: column;
align-items: center;
margin-top: 13px;
.step-num {
width: 18px;
height: 18px;
line-height: 18px;
text-align: center;
border-radius: 100%;
background: #F36F55;
color: #fff;
font-size: 12px;
}
.dotted-line {
border-left: 1px dashed #F36F55;
height:38px;
width: 1px;
}
.height50 {
height: 50px!important;
}
}
.right {
.bubble_diailog{
width: 275px;
padding: 12px 15px;
position: relative;
background: #FFF4F2;
border-radius: 6px;
color: #373839;
font-size: 14px;
font-weight: 700;
i,.bubble_diailog b{
position: absolute;
width: 0;
height: 0;
overflow: hidden;
border-width:5px;
display:block;
}
i.l,.bubble_diailog b.l{
border-style:dashed solid dashed dashed;
}
i.l{
top:0;
bottom: 0;
margin-top: auto;
margin-bottom: auto;
left:-10px;
border-color:transparent #FFF4F2 transparent transparent;
}
b.l{
top:0;
bottom: 0;
margin-top: auto;
margin-bottom: auto;
left:-9px;
border-color:transparent #FFF4F2 transparent transparent;
}
p {
line-height: 14px;
}
.text {
color: #373839;
font-size: 14px;
font-weight: 700;
}
.awards {
color: #979899;
font-size: 12px;
font-weight: 400;
margin-top: 6px;
}
};
.marginTop16 {
margin-top: 8px;
}
.marginTop20 {
margin-top: 10px;
}
}
}
}
.gray-line {
width: 100%;
height: 5px;
background: #F8F9FA;
}
.record-details {
width: 100%;
min-height: 294px;
background: #fff;
.tab-nav {
width: 100%;
background: #fff;
height: 52px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #E7E8E9;
.item {
height: 52px;
line-height: 52px;
position: relative;
font-size: 16px;
color: #676869;
.active-line {
width: 20px;
height: 3px;
background: #F36F55;
border-radius: 1.5px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
}
}
.left-item {
margin-left: 82.5px;
}
.right-item {
margin-right: 82.5px;
}
.activeItem {
color: #373839;
font-weight: 700;
}
}
.record-list {
padding: 15px;
.sum {
color: #676869;
font-size: 14px;
}
.loadMore {
overflow-y: auto;
.record-item {
padding: 20px 0;
display: flex;
align-items: center;
.person-photo {
width: 35px;
height: 35px;
border-radius: 100%;
}
.person-info {
margin-left: 15px;
.phone {
color: #373839;
font-size: 16px;
line-height: 16px;
}
.time {
color: #979899;
font-size: 13px;
line-height: 13px;
margin-top: 8px;
}
}
.awards {
margin-left: auto;
.item {
font-size: 13px;
font-weight: 700;
height: 13px;
margin-bottom: 9px;
.num {
color: #FD5A2F;
}
.award-name {
color: #373839;
}
}
.item:last-child {
margin-bottom: 0;
}
}
}
.no-more {
height: 62px;
display: flex;
justify-content: center;
align-items: center;
.line {
display: inline-block;
width: 84px;
height: 1px;
background:#F7F7F7;
}
.text {
color: #BEC2CC;
font-size: 13px;
margin: 0 8px;
}
}
}
}
}
.no-data {
img {
width: 150px;
height: 150px;
display: block;
margin: 5px auto;
}
p {
width: 180px;
height: 42px;
font-size: 15px;
color: #999999;
line-height: 21px;
margin: 0 auto;
text-align: center;
}
.text-get {
width: 300px;
}
}
}
}
\ No newline at end of file
<template>
<section class="invite-details-wrap">
<normal-header
:title="title"
:backType="1">
</normal-header>
<div class="main-container" :style="{ marginTop: `${44+statusBarHeight}Px`}">
<div class="invite-explain">
<p class="title">邀请形式</p>
<div class="picture-explain">
<div class="left">
<div class="step-num">1</div>
<div class="dotted-line" />
<div class="step-num">2</div>
<div class="dotted-line height50" />
<div class="step-num">3</div>
</div>
<div class="right">
<div class="bubble_diailog">
<i class="l"></i>
<b class="l"></b>
邀请医生好友
</div>
<div class="bubble_diailog marginTop16">
<i class="l"></i>
<b class="l"></b>
<p class="text">输入手机号领取课程</p>
<p class="awards">+20勤奋分 +20云鹊豆</p>
</div>
<div class="bubble_diailog marginTop20">
<i class="l"></i>
<b class="l"></b>
<p class="text">使用手机号登录云鹊APP</p>
<p class="awards">+80勤奋分 +80云鹊豆</p>
</div>
</div>
</div>
</div>
<div class="gray-line"></div>
<div class="record-details" :style="{marginBottom: `${50+homeIndicatorHeight}Px`}">
<div class="tab-nav">
<div class="item left-item" :class="{activeItem:recordType==1}" @click="changeRecordType">
领取记录
<p class="active-line" v-if="recordType==1"></p>
</div>
<div class="item right-item" :class="{activeItem:recordType==2}" @click="changeRecordType">
登录记录
<p class="active-line" v-if="recordType==2"></p>
</div>
</div>
<div class="record-list" v-if="inviteList.length" >
<p class="sum">{{recordTotal}}</p>
<div class="loadMore" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy"
infinite-scroll-distance="10">
<div class="record-item" v-if="inviteList.length" v-for="item in inviteList">
<img :src="item.avatarImageUrl" alt="" class="person-photo">
<div class="person-info">
<p class="phone">{{item.mobile}}</p>
<p class="time">{{item.inviteDate}}</p>
</div>
<div class="awards">
<p class="item" v-for="item1 in dealJsonData(item.rewardJsonInfo)">
<span class="num">+{{item1.rewardQuantity}}</span>
<span class="award-name">{{changeAwardsName(item1.rewardType)}}</span>
</p>
</div>
</div>
<div class="no-more" v-if="noMore&&inviteList.length">
<span class="line"></span>
<span class="text">到底啦</span>
<span class="line"></span>
</div>
</div>
</div>
<div class="no-data" v-if="!inviteList.length" >
<img src="~/assets/img/icon-nodata.png" alt="">
<p v-if="recordType==1">提醒您的医生好友领取课程您将获得奖励哦!</p>
<p v-if="recordType==2" class="text-get">提醒您的医生好友领取课程后登录云鹊医APP您将再获得奖励哦!</p>
</div>
</div>
</div>
<footer-button
:btnText="btnText"
:btnType="btnType">
</footer-button>
</section>
</template>
<script>
import NormalHeader from '@/components/normal-header';
import FooterButton from '@/components/footer-button';
import { getOneInviteDetails,getTwoInviteDetails } from '@/service/detailsAndRanking';
export default {
name: "index",
components: {
NormalHeader,
FooterButton,
},
data() {
return {
showPop: false,
title: '邀请明细',
inviteList: [],
recordTotal: 0,
recordType: 1,
busy: true, //分页参数--start
pageNo: 0,
pageSize: 10,
noMore: false,//分页参数--end
btnText: '去邀请',
btnType: true
};
},
mounted() {
this.pageNo++
this.getOneInviteDetails();
window.addEventListener('scroll', function (e) {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
//获取recordDetails到顶部距离
const recordDetails = document.getElementsByClassName('record-details')[0];
let recordDetailsHeight = recordDetails.getBoundingClientRect().top;
//获取headDiv部分高度
const headDiv = document.getElementsByClassName('header-container')[0];
let headDivHeight = headDiv.offsetHeight;
//获取窗口高度
const lastHeight = window.innerHeight;
console.log('recordDetailsHeight',recordDetailsHeight);
console.log('headDivHeight',headDivHeight);
const tabNab=document.getElementsByClassName('tab-nav')[0];
if(recordDetailsHeight<=headDivHeight) {
tabNab.setAttribute('style',`position:fixed;top: ${44}px;`);
} else {
console.log('sdd')
tabNab.removeAttribute('style');
}
});
},
methods: {
getOneInviteDetails() { //领取记录数据
getOneInviteDetails({
pageNo: this.pageNo,
pageSize: this.pageSize
}).then(res => {
if(res.code == '000000') {
this.recordTotal = res.data.total;
if(res.data.list.length>0) {
if(this.pageNo ==1) {
this.inviteList = res.data.list
} else {
this.inviteList = this.inviteList.concat(res.data.list);
}
this.busy = false;
this.noMore = false;
}else {
if(this.pageNo ==1) {
this.noMore = false;
} else {
this.noMore = true;
}
}
}
})
},
getTwoInviteDetails() { //登记记录数据
getTwoInviteDetails({
pageNo: this.pageNo,
pageSize: this.pageSize
}).then(res => {
if(res.code == '000000') {
this.recordTotal = res.data.total
if(res.data.list.length>0) {
if(this.pageNo ==1) {
this.inviteList = res.data.list
} else {
this.inviteList = this.inviteList.concat(res.data.list);
}
this.busy = false;
this.noMore = false;
}else {
if(this.pageNo ==1) {
this.noMore = false;
} else {
this.noMore = true;
}
}
}
})
},
dealJsonData(data) {
if(data) {
return JSON.parse(data)
}
},
changeAwardsName(type) {
if(type == 1) {
return '云鹊豆'
} else if(type == 2) {
return '现金'
} else if(type == 3) {
return '勤奋分'
} else if(type == 4) {
return '短信额度'
}
},
changeRecordType() {
this.recordType = this.recordType==1?2:1;
this.pageNo = 1;
this.inviteList = [];
this.noMore = false;
this.getData()
},
getData() {
if(this.recordType == 1) {
this.getOneInviteDetails();
} else if(this.recordType == 2) {
this.getTwoInviteDetails();
}
},
loadMore() {
this.busy = true;
this.pageNo++
//this.changeRecordType();
this.getData()
},
},
}
</script>
<style scoped lang="less">
@import 'index.less';
</style>
\ No newline at end of file
...@@ -118,7 +118,8 @@ ...@@ -118,7 +118,8 @@
font-size: 13px; font-size: 13px;
font-weight: 700; font-weight: 700;
height: 13px; height: 13px;
margin-bottom: 9px; margin-bottom: 9px ;
text-align: right;
.num { .num {
color: #FD5A2F; color: #FD5A2F;
} }
...@@ -148,22 +149,51 @@ ...@@ -148,22 +149,51 @@
-ms-transform: scaleY(0.5); -ms-transform: scaleY(0.5);
transform: scaleY(0.5); transform: scaleY(0.5);
} }
.no-more {
height: 62px;
display: flex;
justify-content: center;
align-items: center;
.line {
display: inline-block;
width: 84px;
height: 1px;
background:#F7F7F7;
}
.text {
color: #BEC2CC;
font-size: 13px;
margin: 0 8px;
}
}
} }
.no-more { .no-data {
height: 62px; margin-top: 112px;
display: flex; img {
justify-content: center; width: 150px;
align-items: center; height: 150px;
.line { display: block;
display: inline-block; margin: 0 auto;
width: 84px; }
height: 1px; p {
background:#F7F7F7; color: #999999;
font-size: 15px;
line-height: 21px;
margin-top: 5px;
margin-bottom: 30px;
text-align: center;
} }
.text { .button {
color: #BEC2CC; color: #fff;
font-size: 13px; font-size: 15px;
margin: 0 8px; 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;
} }
} }
} }
......
...@@ -2,22 +2,20 @@ ...@@ -2,22 +2,20 @@
<section class="person-detail-wrap"> <section class="person-detail-wrap">
<normal-header <normal-header
:title="title" :title="title"
:barHeight="barHeight"
:barColor="barColor"
:backType="1"> :backType="1">
</normal-header> </normal-header>
<div class="info-container" :style="{ marginTop: `${44+barHeight}Px`}"> <div class="info-container" :style="{ marginTop: `${44+statusBarHeight}Px`}">
<div class="info"> <div class="info">
<img src="https://file.yunqueyi.com/jpg/2019/01/30/1548836156602-019ADC3F.jpg" alt=""> <img :src="avatarImageUrl" alt="">
<div class="content"> <div class="content">
<p class="item"> <p class="item">
<span class="label">累计排名</span> <span class="label">累计排名</span>
<span class="value">105</span> <span class="value">{{userRank?userRank.rank:'-'}}</span>
</p> </p>
<p class="line"></p> <p class="line"></p>
<p class="item"> <p class="item">
<span class="label">累计勤奋分 </span> <span class="label">累计勤奋分 </span>
<span class="value">105</span> <span class="value">{{userRank?userRank.score:'0'}}</span>
</p> </p>
</div> </div>
</div> </div>
...@@ -30,103 +28,42 @@ ...@@ -30,103 +28,42 @@
</div> </div>
<div class="awards-details">血压计 1 支/温度计 1 支/小米电视4C 2 台/米家洗衣机 1 台/米家冰箱 2 台/华为荣耀Play3 2 部</div> <div class="awards-details">血压计 1 支/温度计 1 支/小米电视4C 2 台/米家洗衣机 1 台/米家冰箱 2 台/华为荣耀Play3 2 部</div>
</div>--> </div>-->
<div class="detail-list"> <div class="detail-list" v-if="personDetails.length" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="10">
<div class="item"> <div class="item" v-for="item in personDetails">
<div class="left">
<img src="~/assets/img/person-detail/icon-clock-in.png" alt="">
</div>
<div class="right">
<div class="r-left">
<p class="detail-name">每日打卡</p>
<p class="time">2019.12.15</p>
</div>
<div class="r-right">
<div class="award-item">
<span class="num">+5</span>
<span class="award-name">勤奋分</span>
</div>
<div class="award-item">
<span class="num">+5</span>
<span class="award-name">勤奋分</span>
</div>
</div>
</div>
</div>
<div class="item">
<div class="left"> <div class="left">
<img src="~/assets/img/person-detail/icon-invite.png" alt=""> <img :src="detailTaskIcon(item.resourceType)" alt="">
</div> </div>
<div class="right"> <div class="right">
<div class="r-left"> <div class="r-left">
<p class="detail-name">邀请好友</p> <p class="detail-name">{{item.taskName}}</p>
<p class="time">2019.12.15</p> <p class="time">{{item.finishTime}}</p>
</div> </div>
<div class="r-right"> <div class="r-right">
<div class="award-item"> <div class="award-item" v-for="item1 in item.timsRewardResp">
<span class="num">+5</span> <span class="num">+{{item1.rewardQuantity}}</span>
<span class="award-name">勤奋分</span> <span class="award-name">{{detailAwardsName(item1.rewardType)}}</span>
</div>
<div class="award-item">
<span class="num">+5</span>
<span class="award-name">勤奋分</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="item"> <div class="no-more" v-if="noMore">
<div class="left"> <span class="line"></span>
<img src="~/assets/img/person-detail/icon-study.png" alt=""> <span class="text">到底啦</span>
</div> <span class="line"></span>
<div class="right">
<div class="r-left">
<p class="detail-name">课程学习</p>
<p class="time">2019.12.15</p>
</div>
<div class="r-right">
<div class="award-item">
<span class="num">+5</span>
<span class="award-name">勤奋分</span>
</div>
<div class="award-item">
<span class="num">+5</span>
<span class="award-name">勤奋分</span>
</div>
</div>
</div>
</div>
<div class="item">
<div class="left">
<img src="~/assets/img/person-detail/icon-clock-in.png" alt="">
</div>
<div class="right">
<div class="r-left">
<p class="detail-name">每日打卡</p>
<p class="time">2019.12.15</p>
</div>
<div class="r-right">
<div class="award-item">
<span class="num">+5</span>
<span class="award-name">勤奋分</span>
</div>
<div class="award-item">
<span class="num">+5</span>
<span class="award-name">勤奋分</span>
</div>
</div>
</div>
</div> </div>
</div> </div>
<div class="no-more"> <div class="no-data" v-if="!personDetails.length">
<span class="line"></span> <img src="~/assets/img/icon-nodata.png" alt="">
<span class="text">到底啦</span> <p>暂无记录,您还没有参加活动</p>
<span class="line"></span> <div class="button" @click="goInActivity">立即参加</div>
</div> </div>
</div> </div>
</section> </section>
</template> </template>
<script> <script>;
import NormalHeader from '@/components/normal-header' import NormalHeader from '@/components/normal-header';
import { getPersonDetails } from '@/service/detailsAndRanking'
export default { export default {
name: 'person-detail', name: 'person-detail',
components: { components: {
...@@ -136,17 +73,91 @@ ...@@ -136,17 +73,91 @@
return { return {
showPop: false, showPop: false,
title: '个人明细', title: '个人明细',
barHeight: 0, personDetails: [],
barColor: '#fff', busy: true, //分页参数--start
pageNo: 0,
noMore: false,//分页参数--end
userRank: null,
avatarImageUrl: ''
}; };
}, },
computed: { computed: {
}, },
mounted() { mounted() {
this.pageNo++;
this.getPersonDetails();
},
methods: {
goInActivity() {
this.$router.push('/in-activity')
},
detailTaskIcon(taskType) {
if(taskType == 4) { //smo
return require('../../assets/img/task-icon/smo-icon.png')
} else if(taskType == 1) { //课程
return require('../../assets/img/task-icon/lesson-icon.png')
} else if(taskType == 6) { //打卡
return require('../../assets/img/task-icon/daily-clock-icon.png')
} else if(taskType == 7) { //邀请
return require('../../assets/img/task-icon/invite-icon.png')
} else if(taskType == 0) { //机构
return require('../../assets/img/task-icon/ranking-icon.png')
}
},
detailAwardsName(type) {
//type 1.云鹊豆 2.现金 3.勤奋分 4.短信额度
if(type == 1) {
return '云鹊豆'
} else if(type == 2) {
return '现金'
} else if(type == 3) {
return '勤奋分'
} else if(type == 4) {
return '短信额度'
}
},
getPersonDetails() {
getPersonDetails({
pageNo: this.pageNo,
activityId: 2
}).then(res => {
console.log(res)
if(res.code == '000000') {
this.userRank = res.data.userRank;
this.avatarImageUrl = res.data.avatarImageUrl;
if(res.data.personDetails) {
if(this.pageNo ==1) {
this.personDetails = res.data.personalDetails
if(res.data.hasNextPage) {
this.noMore = true;
} else {
this.busy = false;
}
} else {
if(res.data.hasNextPage) {
this.personDetails = this.personDetails.concat(res.data.personalDetails);
this.busy = false;
} else {
this.noMore = true
}
}
} else {
this.personDetails = []
}
}
})
},
loadMore() {
this.busy = true;
this.pageNo++
//this.changeRecordType();
this.getPersonDetails()
}
}, },
methods: {},
}; };
</script> </script>
......
...@@ -16,27 +16,51 @@ ...@@ -16,27 +16,51 @@
height: 50px; height: 50px;
border-radius: 100%; border-radius: 100%;
} }
.content { .right {
display: flex;
margin-left: 10px; margin-left: 10px;
align-items: center; .content {
.item { display: flex;
font-size: 14px; align-items: center;
.label { .item {
font-size: 14px;
.label {
color: #fff;
}
.value {
color: #FFDD58;
}
}
.line {
display: inline-block;
width: 0.5px;
height: 10px;
background: #fff;
margin: 0 6px;
}
}
.not-join {
margin-left: 10px;
.main-name {
color: #fff; color: #fff;
font-size: 14px;
font-weight: 700;
line-height: 14px;
} }
.value { .details {
color: #FFDD58; color: #fff;
font-size: 12px;
line-height: 12px;
margin-top: 8px;
} }
} }
.line { p.text {
display: inline-block; color: #FFFFFF;
width: 0.5px; font-size: 12px;
height: 10px; line-height: 12px;
background: #fff; margin-top: 8px;
margin: 0 6px;
} }
} }
} }
} }
.main-content { .main-content {
...@@ -96,6 +120,7 @@ ...@@ -96,6 +120,7 @@
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
margin-left: 10px; margin-left: 10px;
width: 130px;
} }
.num { .num {
color: #373839; color: #373839;
...@@ -105,25 +130,5 @@ ...@@ -105,25 +130,5 @@
} }
} }
} }
.footer-btn {
width: 100%;
height: 40px;
padding: 5px 0;
box-shadow:0px -1px 0px 0px rgba(237,237,237,1);
position: fixed;
bottom: 0;
.btn {
width: 345px;
height: 40px;
margin: 0 auto;
line-height: 40px;
text-align: center;
background: linear-gradient(270deg,rgba(255,88,36,1) 0%,rgba(254,163,86,1) 100%);
border-radius: 20px;
color: #FFFFFF;
font-weight: 700;
font-size: 15px;
}
}
} }
} }
\ No newline at end of file
<template> <template>
<section class="person-ranking-wrap"> <section class="person-ranking-wrap">
<ranking-header></ranking-header> <ranking-header
<div class="info-container" :style="{ marginTop: `${44+barHeight}Px`}"> :rightBtn="rightBtn"
:headBtn="headBtn"
:activeBtnType="activeBtnType"
@handleBtn="changeRanking"
@handleRightBtn="handleRightBtn">
</ranking-header>
<div class="info-container" :style="{ marginTop: `${44+statusBarHeight}Px`}">
<div class="info"> <div class="info">
<img src="https://file.yunqueyi.com/jpg/2019/01/30/1548836156602-019ADC3F.jpg" alt=""> <img :src="rankData.avatarImageUrl" alt="">
<div class="content"> <div class="right">
<p class="item"> <div class="content" v-if="rankData.score">
<span class="label">累计排名</span> <p class="item">
<span class="value">105</span> <span class="label">{{activeBtnType?'今日':'累计'}}排名</span>
</p> <span class="value">{{rankData.rank}}</span>
<p class="line"></p> </p>
<p class="item"> <p class="line"></p>
<span class="label">累计勤奋分 </span> <p class="item">
<span class="value">105</span> <span class="label">{{activeBtnType?'今日':'累计'}}勤奋分 </span>
</p> <span class="value">{{rankData.score}}</span>
</p>
</div>
<div class="not-join" v-else>
<div class="con main-name">您还未参加活动</div>
<div class="con details">赶快参与活动赢每日奖品</div>
</div>
<p class="text" v-if="activeBtnType&&rankData.score">再获得{{rankData.targetRequiredScore}}分即可上升到前{{rankData.targetRank}}名并可获得{{firstAwards}}</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -22,63 +35,123 @@ ...@@ -22,63 +35,123 @@
<div class="ranking-title"> <div class="ranking-title">
<span>TOP100</span> <span>TOP100</span>
<span class="marginL">用户名称</span> <span class="marginL">用户名称</span>
<span class="marginAuto">今日勤奋分</span> <span class="marginAuto">{{activeBtnType?'今日':'累计'}}勤奋分</span>
</div> </div>
<div class="ranking-list"> <div class="ranking-list" :style="{marginBottom: `${50+homeIndicatorHeight}Px`}">
<div class="item"> <div class="item" v-for="(item,index) in rankData.topRankList">
<img src="~/assets/img/person-ranking/icon-gold.png" alt="" class="ranking-icon"> <img v-if="index<=2" :src="dealRankIcon(index)" alt="" class="ranking-icon">
<img src="https://file.yunqueyi.com/jpg/2019/01/30/1548836156602-019ADC3F.jpg" alt="" class="doctor-photo"> <p v-else class="icon-num" >{{index+1}}</p>
<p class="doctor-name">张医生</p> <img :src="item.avatarImageUrl" alt="" class="doctor-photo">
<p class="num">1053</p> <p class="doctor-name">{{item.name}}</p>
<p class="num">{{item.score}}</p>
</div> </div>
<div class="item">
<img src="~/assets/img/person-ranking/icon-silver.png" alt="" class="ranking-icon">
<img src="https://file.yunqueyi.com/jpg/2019/01/30/1548836156602-019ADC3F.jpg" alt="" class="doctor-photo">
<p class="doctor-name">张医生</p>
<p class="num">1053</p>
</div>
<div class="item">
<img src="~/assets/img/person-ranking/icon-copper.png" alt="" class="ranking-icon">
<img src="https://file.yunqueyi.com/jpg/2019/01/30/1548836156602-019ADC3F.jpg" alt="" class="doctor-photo">
<p class="doctor-name">张医生</p>
<p class="num">1053</p>
</div>
<div class="item">
<p class="icon-num">4</p>
<img src="https://file.yunqueyi.com/jpg/2019/01/30/1548836156602-019ADC3F.jpg" alt="" class="doctor-photo">
<p class="doctor-name">张医生</p>
<p class="num">1053</p>
</div>
</div>
<div class="footer-btn">
<div class="btn">获得更多勤奋分</div>
</div> </div>
<footer-button
:btnText="btnText"
:btnType="btnType">
</footer-button>
</div> </div>
</section> </section>
</template> </template>
<script> <script>
import RankingHeader from '@/components/ranking-header' import RankingHeader from '@/components/ranking-header';
import FooterButton from '@/components/footer-button';
import { getTodayUserRanking, getAllUserRanking} from '@/service/detailsAndRanking'
import { getFirstAwards } from '@/utils'
export default { export default {
name: 'person-detail', name: 'person-ranking',
components: { components: {
RankingHeader RankingHeader,
FooterButton
}, },
data() { data() {
return { return {
showPop: false, showPop: false,
title: '个人明细', title: '个人明细',
barHeight: 0, rankData: {},
barColor: '#fff', rightBtn: '',
headBtn: {
leftName: '今日排行榜',
rightName: '累计排行榜'
},
activeBtnType: true, //true今日,false累计
btnText: '获得更多勤奋分',
btnType: true,
firstAwards: '',
todayDate: ''
}; };
}, },
computed: { computed: {
}, },
mounted() { mounted() {
this.getData();
},
watch: {
todayDate(val) {
if(Date.parse(new Date(val))<=Date.parse(new Date('2019-12-16 23:59:59'))) {
this.rightBtn = ''
} else {
this.rightBtn = '昨日获奖'
}
}
},
methods: {
changeRanking() {
this.activeBtnType = !this.activeBtnType
this.getData();
},
handleRightBtn() {
this.$router.push({
path: '/yesterday-prize'
})
},
dealRankIcon(index) {
if(index == 0) {
return require('../../assets/img/icon-gold.png')
} else if(index == 1) {
return require('../../assets/img/icon-silver.png')
} else if(index == 2) {
return require('../../assets/img/icon-copper.png')
}
},
getData() {
if(this.activeBtnType) {
this.getTodayRankingList();
} else {
this.getUserRankingList();
}
},
getTodayRankingList() {
getTodayUserRanking().then(res => {
if(res.code == '000000') {
this.rankData = res.data;
this.firstAwards = getFirstAwards(res.data.todayDate);
this.todayDate = res.data.todayDate;
if(this.rankData.score) {
this.btnText = '获得更多勤奋分'
} else {
this.btnText = '参与活动得勤奋分'
}
}
})
},
getUserRankingList() {
getAllUserRanking().then(res => {
if(res.code == '000000') {
this.rankData = res.data;
if(this.rankData.score) {
this.btnText = '获得更多勤奋分'
} else {
this.btnText = '参与活动得勤奋分'
}
}
})
}
}, },
methods: {},
}; };
</script> </script>
......
<template> <template>
<section class="index-wrap" :class="{'padbtm50': (showFixed && showRemindBtn)}"> <section class="index-wrap" :class="{'padbtm50': (showFixed && showRemindBtn)}">
<h5header v-if="isWeb" title="云鹊奖2019" :scrollVal="scrollVal" :baseShowHeight="25" :shareObj="shareObj" :setedScroll="true" /> <h5header v-if="!isWeb" title="云鹊奖2019" :scrollVal="scrollVal" :baseShowHeight="25" :shareObj="shareObj" :setedScroll="true" />
<div id="imgHeight1"> <div id="imgHeight1">
<img src="../assets/img/img1.png" /> <img src="../assets/img/img1.png" />
<img src="../assets/img/img2.png" /> <img src="../assets/img/img2.png" />
......
<template>
<div class="wx-share-wrap">
<section>
<div class="invite-info">
<img :src="avatarImageUrl" />
<p class="title1">{{ name }}邀请您助力 为他赢大奖</p>
<p class="title2">领取课程即可助他一臂之力</p>
</div>
<div class="page-info">
<p class="title1">资深医生讲师、精选专业课程</p>
<p class="title2">已有超过20,000+的医生领取以下课程</p>
<div class="imgs-wrap">
<div>
<img src="../assets/img/ico1.png" />
<div class="img-txt">高血压课程</div>
</div>
<div>
<img src="../assets/img/ico2.png" />
<div class="img-txt">糖尿病课程</div>
</div>
<div>
<img src="../assets/img/ico3.png" />
<div class="img-txt">中医课程</div>
</div>
<div>
<img src="../assets/img/ico4.png" />
<div class="img-txt">全科课程</div>
</div>
</div>
</div>
<div class="form-info">
<div class="field-wrap">
<label>联系方式</label>
<input v-model="mobilePhone" type="tel" maxlength="11" placeholder="请输入手机号">
</div>
<div class="field-wrap">
<label>图形验证码</label>
<input v-model="captchaAnswer" type="text" maxlength="6" placeholder="请输入">
<div class="cap-box"><img :src="captchaImg" @click="getCaptcha"></div>
</div>
<div class="field-wrap">
<label>短信验证码</label>
<input v-model="authCode" type="tel" maxlength="6" placeholder="请输入">
<button v-if="notSend" @click="sendSms">{{btnMsg}}</button>
<van-count-down v-if="!notSend" :time="time" @finish="finishCount" :format="'ss' + 's'" />
</div>
<button class="btn-post" @click="getCourse">领取课程</button>
</div>
</section>
</div>
</template>
<script>
import { getInviteInfo, getCourseById, getCaptchaGet, getAuthCode } from '@/service';
const TIMEALL = 60000; // 倒计时常量 60 秒
export default {
data(){
return {
notSend: true,
regMobile: /^1[3456789]\d{9}$/,
mobilePhone: '',
authCode: '', // 短信验证码
flag: 0,
captchaImg: '', // 图形验证码图片字段
captchaToken: '', // captchaToken
captchaAnswer: '', // 输入的图形验证码
time: TIMEALL,
btnMsg: '点击获取',
isReq: false
}
},
async asyncData({ query }){
const { id, taskId, activityId } = query;
let avatarImageUrl = '', name = '', captchaImg = '', captchaToken = '';
const res = await getInviteInfo(id);
if(res.code === '000000'){
const data = res.data;
avatarImageUrl = data.avatarImageUrl;
name = data.name ? data.name : data.mobilePhone;
}
const resCapt = await getCaptchaGet();
if(resCapt.code === '000000'){
captchaImg = `data:image/png;base64,${resCapt.data.content}`;
captchaToken = resCapt.data.token;
}
return {
avatarImageUrl, name, id, taskId, activityId, captchaImg, captchaToken
}
},
mounted(){
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.$picaWxShare({
// baseUrl: BASE_URL[process.env.NUXT_ENV_APP],
baseUrl: 'https://test1-sc.yunqueyi.com',
type: 15,
authUrl: window.location.href,
isDebug: false,
jsApiList: [
'onMenuShareTimeline',
'onMenuShareAppMessage'
]
},(wx)=>{
const title = this.shareObj.title1;
const desc = this.shareObj.title2;
const link = window.location.href;
const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友
wx.onMenuShareAppMessage({
title,desc,link,imgUrl
});
// 分享到朋友圈
wx.onMenuShareTimeline({
title,desc,link,imgUrl
});
})
},
methods: {
// 校验用户浏览器是否有登录缓存,此缓存为纯前端缓存,与token之类的无关
checkCache(){
const mobilePhoneCache = window.localStorage.getItem('mobilePhone');
const statusCache = window.localStorage.getItem('status');
const status = 'false';
// 如果有缓存则是第二次进入,就要显示已领取,也就是false
if(mobilePhoneCache && statusCache){
window.localStorage.setItem('status', status);
this.$router.push({
name: 'shareResult',
query: {
status
}
})
}
// 如果没有缓存,则停留当前页面
},
// 点击刷新验证码
getCaptcha(){
getCaptchaGet().then(res=>{
if(res.code === '000000'){
this.captchaImg = `data:image/png;base64,${res.data.content}`;
this.captchaToken = res.data.token;
}else{
this.$toast(res.message);
}
})
},
// 领取课程事件
getCourse(){
if(this.isReq){
this.$toast('您的登录操作过于频繁,请稍后再试');
return;
}
const { regMobile, mobilePhone, authCode, id, taskId, activityId } = this;
const mobileTrue = regMobile.test(mobilePhone);
if(!mobileTrue){
this.$toast('请输入正确的手机号');
return;
}
// 校验图形验证码
if(this.captchaAnswer==''){
this.$toast('请输入图形验证码');
return;
}
if(this.authCode==''){
this.$toast('请输入短信验证码');
return;
}
this.isReq = true;
// 调用领取课程接口
getCourseById({
mobile: mobilePhone,
authCode,
id,
taskId,
activityId
}).then(res=>{
this.isReq = false;
// res.data true 登记成功 、 false 登记失败
if(res.code === '000000'){
// 将手机号和状态存入浏览器缓存,用户再次进来就能直接进入领取结果页面
// 注意,如果清除微信或者浏览器缓存,则将停留在当前这个页面并且再次填写手机号以做登录
window.localStorage.setItem('mobilePhone', mobilePhone);
window.localStorage.setItem('status', res.data);
this.$router.push({
name: 'shareResult',
query: {
status: res.data
}
})
}else {
this.$toast(res.message);
}
})
},
// 发送获取短信验证码
sendSms(){
const { regMobile, mobilePhone, flag, captchaToken, captchaAnswer } = this;
const mobileTrue = regMobile.test(mobilePhone);
if(!mobileTrue){
this.$toast('请输入正确的手机号');
return;
}
// 校验图形验证码
if(this.captchaAnswer==''){
this.$toast('请输入图形验证码');
return;
}
getAuthCode({mobilePhone, flag, captchaToken, captchaAnswer}).then(res=>{
// 发送成功
if(res.code === '000000'){
this.notSend = false;
}else{
this.$toast(res.message);
this.getCaptcha();
}
})
},
// 倒计时结束
finishCount(){
this.time = TIMEALL;
this.notSend = true;
this.btnMsg = '重新获取';
}
}
}
</script>
<style lang="less" scoped>
@import '../assets/style/index.less';
</style>
<style lang="less">
@import '../assets/style/revant.less';
</style>
<template>
<div class="wx-share-result">
<section>
<div class="res-wrap">
<img src="../assets/img/resimg0.png">
<h1>{{statusTxt}}</h1>
<h3>登录云鹊医APP立即开始学习</h3>
</div>
<div class="btn-app down-app" @click="downApp">下载APP</div>
<div class="btn-app has-app" @click="downApp">已有APP</div>
<div class="line"></div>
<div class="more-course">
<header>更多精彩好课推荐</header>
<div class="course-list">
<div class="course-item">
<div class="course-txt">
<h1>高血压系列课程</h1>
<h3>《高血压的发病机制》等总计4门课程</h3>
</div>
<div class="course-img"><img src="../assets/img/resimg1.png"></div>
</div>
<div class="course-item">
<div class="course-txt">
<h1>糖尿病系列课程</h1>
<h3>《胰岛素的选择和管理》等总计4门课程</h3>
</div>
<div class="course-img"><img src="../assets/img/resimg2.png"></div>
</div>
<div class="course-item">
<div class="course-txt">
<h1>中医系列课程</h1>
<h3>《慢性胃炎的中医治疗》等总计3门课程</h3>
</div>
<div class="course-img"><img src="../assets/img/resimg3.png"></div>
</div>
<div class="course-item">
<div class="course-txt">
<h1>全科系列课程</h1>
<h3>《胸痛原因待查》等总计3门课程</h3>
</div>
<div class="course-img"><img src="../assets/img/resimg4.png"></div>
</div>
</div>
</div>
</section>
</div>
</template>
<script>
export default {
asyncData({ query }){
const { status } = query; // 上个页面传递过来领取结果, false 为已领取, true 为领取成功
const statusTxt = (status=='true') ? '领取成功' : '您已领取';
return {
statusTxt
}
},
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.$picaWxShare({
// baseUrl: BASE_URL[process.env.NUXT_ENV_APP],
baseUrl: 'https://test1-sc.yunqueyi.com',
type: 15,
authUrl: window.location.href,
isDebug: false,
jsApiList: [
'onMenuShareTimeline',
'onMenuShareAppMessage'
]
},(wx)=>{
const title = this.shareObj.title1;
const desc = this.shareObj.title2;
const link = window.location.href;
const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友
wx.onMenuShareAppMessage({
title,desc,link,imgUrl
});
// 分享到朋友圈
wx.onMenuShareTimeline({
title,desc,link,imgUrl
});
})
},
methods: {
downApp(){
window.location.href = 'https://android.myapp.com/myapp/detail.htm?apkName=com.picahealth.yunque&ADTAG=mobile';
}
}
}
</script>
<style lang="less" scoped>
@import '../assets/style/index.less';
</style>
<style lang="less">
@import '../assets/style/revant.less';
</style>
\ No newline at end of file
.yesterday-prize-wrap {
.prize-list {
padding-left: 25px ;
.item {
display: flex;
align-items: center;
// padding: 21px 0;
.ranking-icon {
width: 25px;
height: 30px;
}
.icon-num {
width: 25px;
color: #373839;
font-size: 15px;
font-weight: 700;
text-align: center;
}
.item-right {
flex: 1;
display: flex;
align-items: center;
position: relative;
padding: 21px 15px 21px 20px;
margin-left: 5px;
.icon-num {
width: 25px;
color: #373839;
font-size: 15px;
font-weight: 700;
text-align: center;
}
.doctor-photo {
width: 35px;
height: 35px;
border-radius: 100%;
}
.doctor-info {
margin-left: 10px;
.name {
color: #333333;
font-size: 16px;
font-weight: 700;
width: 130px;
line-height: 16px;
}
.grade {
font-size: 13px;
color: #979899;
line-height: 13px;
margin-top: 8px;
span {
color: #FD6239;
}
}
}
.awards {
color: #373839;
font-weight: 700;
font-size: 13px;
margin-left: auto;
}
}
.item-right:after {
position: absolute;
content: " ";
left: 0;
bottom: 0;
right: 0;
height: 1PX;
border-bottom: 1PX solid #F0F1F2;
color: #F0F1F2;
-webkit-transform-origin: 0 100%;
-ms-transform-origin: 0 100%;
transform-origin: 0 100%;
-webkit-transform: scaleY(0.5);
-ms-transform: scaleY(0.5);
transform: scaleY(0.5);
}
}
}
}
\ No newline at end of file
<template>
<section class="yesterday-prize-wrap">
<normal-header
:title="title"
:rightText="rightText"
:backType="1">
</normal-header>
<div class="prize-list" :style="{ marginTop: `${44+statusBarHeight}Px`,marginBottom: `${50+homeIndicatorHeight}Px`}">
<div class="item" v-for="(item, index) in rewardsList">
<img v-if="index<=2" :src="dealRankIcon(index)" alt="" class="ranking-icon">
<p v-else class="icon-num" >{{index+1}}</p>
<div class="item-right">
<img :src="item.avatarImageUrl" alt="" class="doctor-photo">
<div class="doctor-info">
<p class="name">{{item.name}}</p>
<p class="grade">昨日勤奋分:<span>{{item.score}}</span></p>
</div>
<p class="awards" v-if="index==0">{{firstAwards}}</p>
<p class="awards" v-if="1<=index&&index<=2">血压计</p>
<p class="awards" v-if="index>2">体温计</p>
</div>
</div>
</div>
<footer-button
:btnText="btnText"
:btnType="btnType">
</footer-button>
</section>
</template>
<script>
import NormalHeader from '@/components/normal-header';
import FooterButton from '@/components/footer-button';
import { getYesterdayRanking } from '@/service/detailsAndRanking'
import { getFirstAwards } from '@/utils'
export default {
name: "index",
components: {
NormalHeader,
FooterButton
},
data() {
return {
showPop: false,
title: '昨日获奖名单',
rightText: '如何领奖',
rewardsList: [],
btnText: '今日我要拿奖',
btnType: true,
yesterdayDate: '',
firstAwards: ''
};
},
mounted() {
this.getRewardList();
},
methods: {
dealRankIcon(index) {
if(index == 0) {
return require('../../assets/img/icon-gold.png')
} else if(index == 1) {
return require('../../assets/img/icon-silver.png')
} else if(index == 2) {
return require('../../assets/img/icon-copper.png')
}
},
getRewardList() {
getYesterdayRanking().then(res => {
if(res.code == '000000') {
this.rewardsList = res.data.topRankList;
this.yesterdayDate = res.data.yesterdayDate;
this.firstAwards = getFirstAwards(this.yesterdayDate);
}
})
}
},
}
</script>
<style scoped lang="less">
@import 'index.less';
</style>
\ No newline at end of file
import Vue from 'vue';
// 设置电池栏高度
const mixins = {
data() {
return {
statusBarHeight: 0,
homeIndicatorHeight: 0,
statusBarColor: '#fff'
}
},
created() {
const _this = this;
if (!_this.$rocNative.isWeb) {
_this.statusBarColor = _this.$rocNative.isAndroid?'#5C5C5C':'#fff'
_this.$rocNative.getStatusBarHeight().then(res => {
// resolve(data)
let height = _this.$rocNative.isIOS ? res.statusBarHeight : res.statusBarHeight / window.devicePixelRatio;
_this.statusBarHeight = height;
// 刘海屏底部高度
if(res.homeIndicatorHeight) {
let homeIndicatorHeight = _this.$rocNative.isIOS ? res.homeIndicatorHeight : res.homeIndicatorHeight / window.devicePixelRatio;
_this.homeIndicatorHeight = homeIndicatorHeight;
}
})
}
},
mounted() {
},
};
Vue.mixin(mixins);
import Vue from 'vue'
const infiniteScroll = require('vue-infinite-scroll');
Vue.use(infiniteScroll)
import Vue from 'vue' import Vue from 'vue'
import { BASE_URL } from '@/utils/enumerate'; import {
BASE_URL
} from '@/utils/enumerate';
import PicaWxShare from 'pica-wx-share'; import PicaWxShare from 'pica-wx-share';
Vue.prototype.$picaWxShare = PicaWxShare; Vue.prototype.$picaWxShare = PicaWxShare;
import PicaH5Login from 'pica-h5-login'; import PicaH5Login from 'pica-h5-login';
import { Dialog, Toast, Checkbox,Popup ,CheckboxGroup ,RadioGroup, Radio, Progress,ImagePreview ,Uploader,Overlay,Loading } from 'vant'; import {
import WebBuriedPoint, { sendBuriedData } from 'web-buried-point'; CountDown,
Field,
Cell,
CellGroup,
Button,
Dialog,
Toast,
Checkbox,
Popup,
CheckboxGroup,
RadioGroup,
Radio,
Progress,
ImagePreview,
Uploader,
Overlay,
Loading
} from 'vant';
import WebBuriedPoint, {
sendBuriedData
} from 'web-buried-point';
Vue.use(Popup).use(Checkbox).use(CheckboxGroup).use(RadioGroup).use(Radio).use(Progress).use(ImagePreview).use(Uploader).use(Overlay).use(Loading); Vue.use(CountDown).use(Field).use(Cell).use(CellGroup).use(Button).use(Popup).use(Checkbox).use(CheckboxGroup).use(RadioGroup).use(Radio).use(Progress).use(ImagePreview).use(Uploader).use(Overlay).use(Loading);
Vue.use(PicaH5Login); Vue.use(PicaH5Login);
Vue.use(Toast) Vue.use(Toast)
Vue.use(Dialog) Vue.use(Dialog)
const { NUXT_ENV_APP } = process.env; const {
NUXT_ENV_APP
} = process.env;
Vue.use(WebBuriedPoint, { Vue.use(WebBuriedPoint, {
class_name: `year_end_ssr`, class_name: `year_end_ssr`,
url: `${BASE_URL[NUXT_ENV_APP]}/file/log/trace1` url: `${BASE_URL[NUXT_ENV_APP]}/file/log/trace1`
}); });
Vue.prototype.$sendBuriedData = sendBuriedData; Vue.prototype.$sendBuriedData = sendBuriedData;
\ No newline at end of file \ No newline at end of file
...@@ -2,14 +2,50 @@ ...@@ -2,14 +2,50 @@
import request from './api'; import request from './api';
// 获取已邀请的医生列表 // 获取用户信息
// /ranking/user_info
export const getUserScoreInfo = () => {
return request({
url: `campaign/ranking/user_info`,
method: 'post',
withCredentials: true,
// headers: {
// token: '8F685DEFFEAC45C393AA55A4DD9E9048'
// }
})
}
export const getInviteList = (token) => { // 获取已邀请的医生列表
export const getInviteList = () => {
return request({ return request({
url: `campaign/inviteDetail/oneList?pageNo=1&pageSize=10`, url: `campaign/inviteDetail/oneList?pageNo=1&pageSize=10`,
method: 'get', method: 'get',
headers: { withCredentials: true,
token: token // headers: {
} // token: token
// }
}) })
} }
\ No newline at end of file
// 获取打卡状态
export const getClockStatus = (params) => {
return request({
url: `campaign/clock/${params.activityId}/status/${params.id}`,
method: 'get',
withCredentials: true,
})
}
// 去打卡状态
export const goToUpdateClock = (params) => {
return request({
url: `campaign/clock/clock`,
method: 'post',
data: params,
withCredentials: true,
})
}
...@@ -10,6 +10,7 @@ Axios.interceptors.request.use( ...@@ -10,6 +10,7 @@ Axios.interceptors.request.use(
// 0. Do something before request is sent // 0. Do something before request is sent
// 1. can be add loading // 1. can be add loading
// 2. make sure if need token // 2. make sure if need token
console.log('config>>>>>> ', config)
const method = config.method.toLocaleLowerCase(); const method = config.method.toLocaleLowerCase();
if (method === 'post' || method === 'put' || method === 'delete') {} if (method === 'post' || method === 'put' || method === 'delete') {}
if (config.withCredentials) { if (config.withCredentials) {
......
// 明细页排名也接口
import request from './api';
// 获取领取记录列表
export const getOneInviteDetails = (params) => {
return request({
url: `campaign/inviteDetail/oneList`,
params: params,
withCredentials: true
})
}// 获取领取记录列表
export const getTwoInviteDetails = (params) => {
return request({
url: `campaign/inviteDetail/twoList`,
params: params,
withCredentials: true
})
}
// 获取个人明细列表
export const getPersonDetails = (params) => {
return request({
url: `/campaign/tims/personalDetails`,
params: params,
withCredentials: true
})
}
// 获取今日个人排行榜
export const getTodayUserRanking = (data) => {
return request({
url: `/campaign/ranking/today_user_ranking`,
method: 'post',
data: data,
withCredentials: true
})
}
// 获取累计排行榜
export const getAllUserRanking = (data) => {
return request({
url: `/campaign/ranking/user_ranking`,
method: 'post',
data: data,
withCredentials: true
})
}
// 获取个人贡献榜
export const getContributionRanking = (data) => {
return request({
url: `/campaign/ranking/contribution_ranking`,
method: 'post',
data: data,
withCredentials: true
})
}
// 获取机构排行榜
export const getHospitalRanking = (data) => {
return request({
url: `/campaign/ranking/hospital_ranking`,
method: 'post',
data: data,
withCredentials: true
})
}
// 获取昨日获奖名单
export const getYesterdayRanking = (data) => {
return request({
url: `/campaign/ranking/yesterday_user_ranking`,
method: 'post',
data: data,
withCredentials: true
})
}
\ No newline at end of file
...@@ -42,6 +42,7 @@ export const getRemindStatus = async (token) => { ...@@ -42,6 +42,7 @@ export const getRemindStatus = async (token) => {
}) })
} }
// 校验token是否有效
export const checkToken = async (token) => { export const checkToken = async (token) => {
return request({ return request({
url: `campaign/admin/task/checkToken?token=${token}`, url: `campaign/admin/task/checkToken?token=${token}`,
...@@ -50,4 +51,44 @@ export const checkToken = async (token) => { ...@@ -50,4 +51,44 @@ export const checkToken = async (token) => {
token: token token: token
} }
}) })
} }
\ No newline at end of file
// 获取邀请人的头像和名字信息
export const getInviteInfo = async (id) => {
return request({
url: `campaign/inviteOne/info?id=${id}`,
method: 'get'
})
}
// 领取课程 POST
export const getCourseById = ({ mobile, authCode, id, taskId, activityId }) => {
return request({
url: `campaign/inviteOne/invited`,
method: 'post',
data: {
mobile, authCode, id, taskId, activityId
},
})
}
// 获取图形验证码
export const getCaptchaGet = async () => {
return request({
url: `account/account/captcha`,
method: 'get'
})
}
// 获取短信验证码
export const getAuthCode = ({ mobilePhone, flag, captchaToken, captchaAnswer }) => {
return request({
url: `account/account/authCode`,
method: 'get',
params: {
mobilePhone, flag, captchaToken, captchaAnswer
},
})
}
...@@ -184,6 +184,19 @@ function getUrlParmByCode(paramList, token) { ...@@ -184,6 +184,19 @@ function getUrlParmByCode(paramList, token) {
return `${str}token=${token}`; return `${str}token=${token}`;
} }
export const getFirstAwards = (awardsDate) => {
const awardsTime = Date.parse(new Date(awardsDate))
if (/*Date.parse(new Date('2019-12-16 00:00:00'))<=awardsTime&&*/Date.parse(new Date('2019-12-19 23:59:59'))>=awardsTime) {
return '小米电视';
} else if (Date.parse(new Date('2019-12-20 00:00:00'))<=awardsTime&&Date.parse(new Date('2019-12-23 23:59:59'))>=awardsTime) {
return '米家洗衣机';
} else if (Date.parse(new Date('2019-12-24 00:00:00'))<=awardsTime&&Date.parse(new Date('2019-12-26 23:59:59'))>=awardsTime) {
return '米家两门冰箱';
} else if (Date.parse(new Date('2019-12-27 00:00:00'))<=awardsTime/*&&Date.parse(new Date('2019-12-29 23:59:59'))>=awardsTime*/) {
return '荣耀play3';
};
}
// 根据不同环境获取topic的URL // 根据不同环境获取topic的URL
// export function getTopicUrl() { // export function getTopicUrl() {
// return getConfigByEvtType('topicUrl') // return getConfigByEvtType('topicUrl')
......
...@@ -23,7 +23,6 @@ export const JsBridgeOptions = { ...@@ -23,7 +23,6 @@ export const JsBridgeOptions = {
'gotoLogin', 'gotoLogin',
'shareWechat', 'shareWechat',
'showNativeToast', 'showNativeToast',
'dispatchEventByModuleCode',
'appBuryingPointEntrust', 'appBuryingPointEntrust',
'webLoadSuccess', 'webLoadSuccess',
'WfileImageCallBack', 'WfileImageCallBack',
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册