产出效率

This commit is contained in:
唐明明
2022-06-10 18:16:25 +08:00
parent ec2a426261
commit 33e1352965
7 changed files with 2518 additions and 898 deletions

View File

@@ -3,11 +3,19 @@
<!-- 账户信息 -->
<view class="life-header">
<view class="life-header-flex">
<view class="life-header-item">0.00GLF</view>
<view class="life-header-item">{{glz}}<text>GLF</text></view>
</view>
</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-unit">GLF/h</view>
<view class="life-sign-time">
<u-count-down :time="nextSignAt" format="HH:mm:ss"></u-count-down>
</view>
</view>
<image class="life-cover-back" :src="require('@/static/life/back.png')"></image>
<view class="life-role">
<image class="life-role-src" :src="figurePath" mode="widthFix"/>
@@ -85,6 +93,9 @@
<script>
import { life } from '@/apis/interfaces/life.js'
var account;
export default {
data() {
return {
@@ -103,18 +114,28 @@
init: 0,
pay: 0,
delivered: 0
}
},
nextSignAt : 0,
glz : 0,
base_hour : 0,
base_seconds: 0
};
},
created() {
onShow() {
// 共力人生
life().then(res => {
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.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,
@@ -123,6 +144,17 @@
})
},
methods: {
// 计时器
outTime(){
account = setInterval(() =>{
let newGlz = (Number(this.glz) + this.base_seconds)
this.glz = newGlz.toFixed(4)
}, 1000)
},
// 签到
onSign(){
this.$Router.push({name: 'Capacity'})
},
// 我的订单
onNav(name, type){
if(type){
@@ -138,6 +170,9 @@
icon : 'none'
})
}
},
onHide() {
clearInterval(account)
}
}
</script>
@@ -347,7 +382,13 @@
border-radius: 35rpx;
padding: 0 20rpx;
margin-right: 20rpx;
font-size: 28rpx;
font-size: 42rpx;
font-weight: bold;
text{
font-weight: normal;
padding-left: 5rpx;
font-size: 70%;
}
}
}
}
@@ -357,6 +398,20 @@
width: 100%;
padding-top: 134%;
overflow: hidden;
.life-sign{
position: absolute;
top: 25%;
right: $margin * 2;
z-index: 99;
background: rgba(0, 0, 0, .5);
width: 78rpx;
height: 78rpx;
border-radius: 50%;
color: white;
text-align: center;
line-height: 78rpx;
font-size: 24rpx;
}
.life-cover-back{
position: absolute;
width: 100%;