提交 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;
} }
} }
......
此差异已折叠。
@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
......
此差异已折叠。
...@@ -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>
此差异已折叠。
.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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册