共力人生首页签到功能,GLF收益率数据

This commit is contained in:
唐明明
2022-06-11 11:01:27 +08:00
parent 33e1352965
commit 2b47c91313
25 changed files with 1114 additions and 6327 deletions

View File

@@ -1,14 +1,17 @@
<template>
<view class="capacity">
<view class="capacity-title">共力分总产率/小时<text>0.04GLF/h</text></view>
<view class="capacity-title">共力分总产率/小时<text>{{baseHour}}GLF/h</text></view>
<view class="capacity-sbutitle">总产率=角色产率+团队产率+共建产率+共力值产率</view>
<view class="capacity-block">
<view class="capacity-block-title">我的角色</view>
<view class="capacity-block-glf">普通用户:0.04GLF/h</view>
<view class="capacity-block-title">
<view class="title">我的角色</view>
<view class="nickname">{{nickname}}</view>
</view>
<view class="capacity-block-glf">{{identityText}}:{{base}}GLF/h</view>
</view>
<view class="capacity-block">
<view class="capacity-block-title">
<view class="title">成员产率<text>0GLF/h</text></view>
<view class="title">成员产率({{group.effect}}/{{group.count}})<text>{{group.capacity}}GLF/h</text></view>
<view class="more" @click="onInvitation">邀请更多好友</view>
</view>
<view class="capacity-block-table">
@@ -16,12 +19,12 @@
<view class="flex-item">家族成员产率</view>
</view>
<view class="flex">
<view class="flex-item">0人在线(会员)</view>
<view class="flex-item">-</view>
<view class="flex-item">{{recommend.vip}}人在线(会员)</view>
<view class="flex-item">{{recommend.vip_text}}</view>
</view>
<view class="flex">
<view class="flex-item">0人在线(会员)</view>
<view class="flex-item">-</view>
<view class="flex-item">{{recommend.novip}}人在线(普通用户)</view>
<view class="flex-item">{{recommend.novip_text}}</view>
</view>
</view>
<view class="capacity-block-table">
@@ -29,39 +32,90 @@
<view class="flex-item">伙伴成员</view>
</view>
<view class="flex">
<view class="flex-item">0人在线(会员)</view>
<view class="flex-item">-</view>
<view class="flex-item">{{partner.vip}}人在线(会员)</view>
<view class="flex-item">{{partner.vip_text}}</view>
</view>
<view class="flex">
<view class="flex-item">0人在线(会员)</view>
<view class="flex-item">-</view>
<view class="flex-item">{{partner.novip}}人在线(会员)</view>
<view class="flex-item">{{partner.novip_text}}</view>
</view>
</view>
</view>
<view class="capacity-block">
<view class="capacity-block-title">
<view class="title">共建产率<text>0GLF/h</text></view>
<view class="subtitle">0/1200</view>
<view class="subtitle">-/-</view>
</view>
<view class="capacity-block-text">产品当设置</view>
<view class="capacity-block-text">产品当设置共建者每日可以通过看广告获得共建值暂未开放敬请期待</view>
</view>
<view class="capacity-block">
<view class="capacity-block-title">
<view class="title">共力值产率<text>0GLF/h</text></view>
<view class="subtitle">0/1200</view>
<view class="subtitle">-/-</view>
</view>
<view class="capacity-block-text">产品当日设置的</view>
<view class="capacity-block-text">根据正常用户的使用在平台的使用习惯购物等行为产生对应共力值暂未开放敬请期待</view>
</view>
<view class="capacity-hint">
PS产品设置每100个共力值或共建值可以加速5%的角色产率
</view>
</view>
</template>
<script>
import { glz } from '@/apis/interfaces/life.js'
export default {
data() {
return {
identityText: '普通用户',
baseHour : 0,
base : 0,
group : {
count : 0,
effect : 0,
capacity: 0,
},
nickname : '',
recommend : {
vip : '-',
vip_count : '-',
novip : '-',
novip_count : '-',
vip_text : '-',
novip_text : '-',
},
partner : {
vip : '-',
vip_count : '-',
novip : '-',
novip_count : '-',
vip_text : '-',
novip_text : '-',
}
};
},
created() {
uni.showLoading({
title: '加载中...'
})
glz().then(res => {
this.nickname = res.nickname
this.identityText = res.identity_text
this.baseHour = res.base_hour
this.base = res.base
this.group = res.group
this.recommend = res.recommend
this.partner = res.partner
uni.setNavigationBarTitle({
title: res.glz + 'GLF'
})
uni.hideLoading()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
methods: {
onInvitation(){
this.$Router.push({name: 'Invitation'})
@@ -76,6 +130,12 @@
min-height: 100vh;
padding: $padding;
box-sizing: border-box;
&-hint{
font-size: 26rpx;
color: gray;
line-height: 40rpx;
padding: $padding 0;
}
&-title{
font-size: 38rpx;
font-weight: bold;
@@ -127,6 +187,10 @@
font-size: 24rpx;
color: $main-color;
}
.nickname{
color: gray;
font-size: 30rpx;
}
}
&-text{
font-size: 28rpx;

View File

@@ -8,12 +8,21 @@
</view>
<!-- 共力人生 -->
<view class="life-cover">
<view class="life-sign" @click="onSign">
<view class="life-sign-icon">签到</view>
<view class="life-sign-num">{{}}</view>
<view class="life-sign">
<view class="life-sign-icon number-float" @click="onSign">
<view class="life-sign-icon-text">{{isSign ? 'GLF': '签到'}}</view>
<image class="life-sign-icon-image" :src="require('@/static/icon/sign_btn.png')" alt="签到"></image>
</view>
<view class="life-sign-num">0</view>
<view class="life-sign-unit">GLF/h</view>
<view class="life-sign-time">
<u-count-down :time="nextSignAt" format="HH:mm:ss"></u-count-down>
<u-count-down :time="nextSignAt" format="HH:mm:ss" @change="TimeDown">
<view class="time">
<text class="time__item">{{ timeData.hours > 9 ? timeData.hours: '0'+timeData.hours}}:</text>
<text class="time__item">{{ timeData.minutes > 9 ? timeData.minutes: '0'+timeData.minutes }}:</text>
<text class="time__item">{{ timeData.seconds > 9 ? timeData.seconds: '0'+timeData.seconds }}</text>
</view>
</u-count-down>
</view>
</view>
<image class="life-cover-back" :src="require('@/static/life/back.png')"></image>
@@ -92,7 +101,7 @@
</template>
<script>
import { life } from '@/apis/interfaces/life.js'
import { life, sign } from '@/apis/interfaces/life.js'
var account;
@@ -118,32 +127,43 @@
nextSignAt : 0,
glz : 0,
base_hour : 0,
base_seconds: 0
base_seconds: 0,
timeData : {},
isSign : false,
};
},
onShow() {
// 共力人生
life().then(res => {
this.glz = res.account.glz
this.base_hour = res.account.base_hour
this.base_seconds = res.account.base_seconds
this.nextSignAt = res.next_sign_at * 1000
this.nickname = res.nickname
this.figurePath = res.figure_path
this.identity = res.identity
this.children = res.children
this.message = res.message
this.order = res.order
this.outTime()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
this.getLife()
},
methods: {
// 倒计时
TimeDown(e){
this.timeData = e
},
// 共力人生
getLife(){
life().then(res => {
this.glz = res.account.glz
this.base_hour = res.account.base_hour
this.base_seconds = res.account.base_seconds
this.nextSignAt = res.next_sign_at * 1000
this.nickname = res.nickname
this.figurePath = res.figure_path
this.identity = res.identity
this.children = res.children
this.message = res.message
this.order = res.order
this.isSign = res.is_sign
if(res.is_sign){
this.outTime()
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 计时器
outTime(){
account = setInterval(() =>{
@@ -153,7 +173,28 @@
},
// 签到
onSign(){
this.$Router.push({name: 'Capacity'})
console.log(this.isSign)
if(this.isSign){
this.$Router.push({name: 'Capacity'})
return
}
uni.showLoading({
title: '签到中..'
})
sign().then(res => {
uni.showToast({
title: '签到成功',
icon : 'none'
})
this.getLife()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 我的订单
onNav(name, type){
@@ -177,6 +218,24 @@
}
</script>
<style scoped>
/* 气泡漂浮 */
.number-float{
animation: 4s octfloat infinite;
}
@keyframes octfloat{
0%{
margin-top: 0;
}
50%{
margin-top: 15rpx;
}
100%{
margin-top: 0;
}
}
</style>
<style lang="scss" scoped>
.life{
min-height: 100vh;
@@ -400,17 +459,61 @@
overflow: hidden;
.life-sign{
position: absolute;
top: 25%;
top: 15vh;
right: $margin * 2;
z-index: 99;
background: rgba(0, 0, 0, .5);
width: 78rpx;
height: 78rpx;
border-radius: 50%;
color: white;
z-index: 999;
text-align: center;
line-height: 78rpx;
font-size: 24rpx;
.life-sign-icon{
display: inline-block;
width: 98rpx;
height: 98rpx;
border-radius: 50%;
position: relative;
.life-sign-icon-image{
position: absolute;
top: 0;
left: 0;
width: 98rpx;
height: 98rpx;
}
.life-sign-icon-text{
position: absolute;
top: 0;
left: 0;
width: 98rpx;
height: 98rpx;
display: flex;
justify-content: space-around;
align-items: center;
z-index: 1;
font-size: 28rpx;
color: white;
}
}
.life-sign-num{
color: #f79824;
font-size: 36rpx;
line-height: 30rpx;
height: 30rpx;
text-shadow: 0 2rpx 2rpx rgba(0, 0, 0, .3);
}
.life-sign-unit{
font-weight: bold;
color: #f79824;
font-size: 30rpx;
line-height: 40rpx;
text-shadow: 0 2rpx 2rpx rgba(0, 0, 0, .3);
}
.life-sign-time{
.time{
@include flex;
align-items: center;
&__item {
color: #333;
font-size: 14px;
}
}
}
}
.life-cover-back{
position: absolute;

View File

@@ -48,7 +48,7 @@
{name: "全部", type: ""},
{name: "待付款", type: "unpay"},
{name: "待发货", type: "paid"},
{name: "待收", type: "delivered"},
{name: "待收", type: "delivered"},
{name: "已完成", type: "completed"},
],
index: 0,