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

我的排行榜接口联调

上级 717acb4e
......@@ -22,7 +22,8 @@
btnText="获得更多勤奋分"
:isFixed="!isFixed"
:needBT="needBT"
btnWidth="100%" />
btnWidth="100%"
@btnClick="btnClick"/>
</div>
<div v-if="!dataList.length" class="no-content">
<img src="../../assets/no-content.png" alt="">
......@@ -31,7 +32,8 @@
style="margin-top: 30px;"
btnText="立即参加"
:isFixed="isFixed"
btnWidth="50%" />
btnWidth="50%"
@btnClick="btnClick"/>
</div>
</div>
</template>
......@@ -65,7 +67,9 @@ export default {
}
}
}
},
btnClick() {
this.$router.go(-1);
}
}
}
......
......@@ -23,6 +23,10 @@ import './index.less';
export default {
name: 'Header',
props: {
prePage: {
type: Boolean,
default: false
},
isWeb: {
type: Boolean,
default: false
......@@ -85,7 +89,7 @@ export default {
},
methods: {
goBack() {
if(this.$rocNative.isWeb) {
if(this.prePage) {
this.$router.go(-1);
} else {
this.$rocNative.goBack();
......
......@@ -29,10 +29,10 @@
{{handleData(item.rewardJsonInfo)[0].rewardQuantity}}条短信额度/人
</div>
<span class='has-bg' v-if="item.resourceType == 1 && (item.finishFrequency > item.doctorFinishFrequency)">去学习</span>
<span class='has-bg' v-if="item.resourceType == 1 && (item.finishFrequency == item.doctorFinishFrequency)">已完成</span>
<span class='has-bg' v-if="item.resourceType == 1 && !item.isFinish">去学习</span>
<span class='has-bg' v-if="(item.resourceType == 1 || item.resourceType == 8) && item.isFinish">已完成</span>
<span class='has-bg' v-if="item.resourceType == 3">去参加</span>
<span class='has-bg' v-if="item.resourceType == 7 || item.resourceType == 8">去邀请</span>
<span class='has-bg' v-if="item.resourceType == 7 || (item.resourceType == 8 && !item.isFinish)">去邀请</span>
<span class='has-bg' v-if="item.resourceType == 9">去绑定</span>
<!-- <div class="task-b" v-if="item.taskFrequency == 2 && (item.cumulativeFrequency > item.nowCumulativeFrequency)">进度 {{item.nowCumulativeFrequency}}/{{item.cumulativeFrequency}}</div>
......
......@@ -6925,8 +6925,7 @@
"js-base64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz",
"integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==",
"dev": true
"integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw=="
},
"js-beautify": {
"version": "1.10.1",
......
......@@ -19,7 +19,8 @@
"vant": "^2.0.9",
"vconsole": "^3.3.4",
"web-buried-point": "^v2.1.0",
"pica-call-app": "^1.0.42"
"pica-call-app": "^1.0.42",
"js-base64": "^2.5.1"
},
"devDependencies": {
"@nuxtjs/axios": "^5.5.4",
......
......@@ -50,6 +50,7 @@
:stepText="stepText1"
:stepTime="stepTime1"/>
<task-activity
v-if="taskTimeFlag"
:isWeb="isWeb"
:acToken="token"
:userMobile="userMobile"
......@@ -97,6 +98,7 @@ import {
getSelfAllScore } from "@/service";
import { setEventByModuleCode } from "@/utils"
import { ENV_CONFIG } from '@/utils/enumerate';
import { Base64 } from 'js-base64';
const cookies = require('cookie-universal')();
export default {
......@@ -110,6 +112,7 @@ export default {
},
data() {
return {
taskTimeFlag: true, // 任务在有效时间内
isShowRightIcon: true, // 是否显示分享按钮
isLogin: false,
userMobile: '',
......@@ -119,6 +122,8 @@ export default {
token: '',
shareTitle1: '',
shareTitle2: '',
shareTitle3: '',
shareTitle4: '',
shareIconUrl: '',
isScroll: false,
imgSrc1: require('@/static/images/score.png'),
......@@ -139,14 +144,19 @@ export default {
showCarveUp: false, //是否展示瓜分弹框
userId: '',
userName: '',
taskId: ''
taskId: '',
origin: 'tims'
}
},
async asyncData({ $axios }) {
},
created() {
let nowTime = new Date().getTime();
let lastTime = (new Date(" 2020/04/02 10:00:00")).getTime();
if(lastTime < nowTime) {
this.taskTimeFlag = false;
}
},
mounted() {
let _this = this;
......@@ -186,10 +196,12 @@ export default {
getSelfAllScore() {
let _this = this;
getSelfAllScore({ id: this.activityId, token: this.token }).then(res => {
_this.myAvatarl = res.data.avatarImageUrl;
if(res.code == '000000') {
_this.myAvatarl = res.data.avatarImageUrl;
_this.myScore = res.data.totalScore;
_this.userId = res.data.id;
_this.userName = res.data.name;
_this.userId = res.data.id;
_this.userName = res.data.name;
}
})
},
// 查看活动规则
......@@ -198,7 +210,11 @@ export default {
},
// 查看排名
gotoRank() {
this.$router.push({path: "/ranks",query: {}});
let queryData = {
id: this.activityId,
token: this.token
};
this.$router.push({path: "/ranks",query: queryData});
},
// 去登录
goToLogin() {
......@@ -207,10 +223,10 @@ export default {
// 查看个人明细
selfInfo() {
let queryData = {
id: this.activityId,
avatarImage: this.myAvatarl,
score: this.myScore,
token: this.token
id: this.activityId,
avatarImage: this.myAvatarl,
score: this.myScore,
token: this.token
};
this.$router.push({path: "/perdetails",query: queryData});
},
......@@ -220,12 +236,12 @@ export default {
},
// 活动任务
activityTaskJump(data) {
let shareUrl = '';
const { NUXT_ENV_APP } = process.env;
if(data.resourceType == 7) { // 邀请好友点赞
let shareUrl = '';
const { NUXT_ENV_APP } = process.env;
const { tempId, token, shareTitle1, shareTitle2, shareIconUrl } = this;
const { tempId, token, userId, userName, myAvatarl, shareTitle1, shareTitle2, shareIconUrl } = this;
//shareUrl = ENV_CONFIG[NUXT_ENV_APP]['shareUrl'] + '/compaign_ssr/?id=' + tempId + '&token=' + token;
shareUrl = `http://10.177.10.217:3000/compaign_ssr/login-point?activityId=${tempId}&taskId=${data.id}&id=${this.userId}&name=${this.userName}&avatar=${this.myAvatarl}`;
shareUrl = `http://10.177.10.217:3000/compaign_ssr/login-point?activityId=${tempId}&taskId=${data.id}&id=${userId}&name=${userName}&avatar=${myAvatarl}`;
this.$rocNative.shareWechat({
type: 6,
shareId: 0,
......@@ -235,7 +251,16 @@ export default {
shareImageUrl: shareIconUrl || 'https://file.yunqueyi.com/logo.png?version=' + new Date().getTime()
});
}else if(data.resourceType == 9) { // 绑定居民微信
const { userId, origin, activityId, shareTitle3, shareTitle4, shareIconUrl } = this;
shareUrl = `${ENV_CONFIG[NUXT_ENV_APP]['shareUrl']}/active_news/activity/qrcode?doctorId=${userId}&origin=${origin}&activity=${activityId}`;
this.$rocNative.shareWechat({
type: 6,
shareId: 0,
shareUrl: shareUrl,
title1: shareTitle3,
title2: shareTitle4,
shareImageUrl: shareIconUrl || 'https://file.yunqueyi.com/logo.png?version=' + new Date().getTime()
});
}else {
this.jumpPage(data.href, data.id);
}
......
......@@ -2,7 +2,7 @@
<div class="point-container">
<div class="info-text">
<img :src="avatarl" />
<p class="info-name">{{userName}}邀请您助力 为他点赞</p>
<p class="info-name">{{name}}邀请您助力 为他点赞</p>
<p class="info-award">做任务瓜分500万云鹊豆</p>
</div>
<div class="form-info">
......@@ -39,7 +39,7 @@ export default {
authCode: '', // 短信验证码
btnMsg: '点击获取',
avatarl: '',
userName: '',
name: '',
userId: '',
taskId: '',
activityId: '',
......@@ -50,10 +50,13 @@ export default {
}
},
created() {
},
mounted() {
this.activityId = this.$route.query.activityId;
this.taskId = this.$route.query.taskId;
this.userId = this.$route.query.id;
this.userName = this.$route.query.userName;
this.name = this.$route.query.name;
this.avatarl = this.$route.query.avatar;
this.getCaptchaGet();
},
......
......@@ -4,6 +4,7 @@
:is-scroll="isScroll"
:share-title1="shareTitle1"
:share-title2="shareTitle2"
:prePage="prePage"
/>
<section class="personal-details-wrapper">
<article class="user">
......@@ -34,6 +35,7 @@ export default {
},
data() {
return {
prePage: true,
token: '222',
shareTitle1: '个人明细',
shareTitle2: '',
......
......@@ -4,31 +4,32 @@
:is-scroll="isScroll"
:share-title1="shareTitle1"
:share-title2="shareTitle2"
:prePage="prePage"
/>
<!-- 我的排名 -->
<div class="rank-info">
<div class="info-text">
<div class="info-detail">
<img src="../../static/images/task-four.png" />
<img :src="avatarImage" />
<div class="info-name">
<span class="ft">用户昵称</span>
<span><span class="cl">22451</span>勤奋分</span>
<span class="ft">{{name}}</span>
<span><span class="cl">{{allScore}}</span>勤奋分</span>
</div>
</div>
<div class="info-score">
<p>45</p>
<p>{{rank}}</p>
<span>我的排名</span>
</div>
</div>
<div class="rank-detail">
<div class="rank-num">
<div class="rank-num" v-if="rank != 1">
<span class="dlot"></span>
<span class="num">前一名:<span class="score">21956</span>勤奋分</span>
<span class="num">前一名:<span class="score">{{firstScore}}</span>勤奋分</span>
</div>
<div class="line"></div>
<div class="line" v-if="rank != 1"></div>
<div class="rank-num">
<span class="dlot"></span>
<span class="num">后一名:<span class="score">21956</span>勤奋分</span>
<span class="num">后一名:<span class="score">{{lastScore}}</span>勤奋分</span>
</div>
</div>
</div>
......@@ -66,6 +67,7 @@
<script>
import Header from '../../components/header';
import DetailBtn from '../../components/bussiness/detail-btn';
import { getRankData, getSelfAllScore } from '@/service';
export default {
components: {
Header,
......@@ -73,31 +75,49 @@ export default {
},
data() {
return {
prePage: true,
token:'',
needBT: false,
shareTitle1: '我的排名',
shareTitle2: '',
isScroll: true,
topRankList: [
{
name: '张**生',
score: 23455
},
{
name: '张**生',
score: 23455
},
{
name: '张**生',
score: 23455
},
{
name: '张**生',
score: 23455
}
]
topRankList: [],
activityId: '',
avatarImage: '',
name: '',
allScore: 0,
rank: 0,
firstScore: 0,
lastScore: 0
}
},
created() {
this.activityId = this.$route.query.id;
this.token = this.$route.query.token;
this.getRankData();
this.getSelfAllScore();
},
methods: {
// 获取个人信息
getSelfAllScore() {
getSelfAllScore({ id: this.activityId, token: this.token }).then(res => {
this.avatarImage = res.data.avatarImageUrl;
this.allScore = res.data.totalScore;
this.userId = res.data.id;
this.name = res.data.name;
this.rank = res.data.rank;
this.firstScore = res.data.firstScore;
this.lastScore = res.data.lastScore;
})
},
// 获取排行榜数据
getRankData() {
getRankData({id: this.activityId}).then(res => {
if(res.code == '000000') {
this.topRankList = res.data;
}
})
},
dealRankIcon(index) {
if(index == 0) {
return require('../../static/images/icon-gold.png')
......@@ -109,14 +129,15 @@ export default {
},
// 全部奖品
allAward(){
},
goBack() {
if(this.$rocNative.isWeb) {
this.$router.go(-1);
} else {
this.$rocNative.goBack();
}
this.$router.go(-1);
// if(this.$rocNative.isWeb) {
// this.$router.go(-1);
// } else {
// this.$rocNative.goBack();
// }
},
}
}
......@@ -269,6 +290,8 @@ export default {
color:#FD5A2F;
font-size: 12px;
margin-left: auto;
text-align: center;
width: 38px;
}
}
}
......
......@@ -40,7 +40,7 @@ export const selectAppModuleParam = async ({id, token }) => {
export const getSelfAllScore = async (data) => {
const { id, token } = data;
return request({
url: `/campaign/tims/getCumulativeReward?activityId=${id}&token=${token}&setEntry=true`,
url: `campaign/rank/getTimsRankAndScore?activityId=${id}&token=${token}&setEntry=true`,
headers: {
token
}
......@@ -58,6 +58,14 @@ export const getSelfActivity = async (data) => {
});
}
// 个人排行榜
export const getRankData = async (data) => {
const { id } = data;
return request({
url: `campaign/rank/getTimsRankTop?activityId=${id}&topN=100`
})
}
// 获取图形验证码
export const getCaptchaGet = async () => {
return request({
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册