This commit is contained in:
2022-07-06 14:43:14 +08:00
parent ef25cef8fb
commit f34c347c1c
3 changed files with 392 additions and 320 deletions

View File

@@ -1,319 +1,390 @@
<template>
<view class="capacity">
<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 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">成员产率({{group.effect}}/{{group.count}})<text</text></view>
<view class="capacity-block-glf">{{group.capacity}}GLF/h</view>
<!-- <view class="more" @click="onInvitation">邀请更多好友</view> -->
</view>
<view class="capacity-block-table pt30">
<view class="header">
<view class="flex-item">家族成员产率</view>
</view>
<view class="flex">
<view class="flex-item">{{recommend.vip}}人在线(会员)</view>
<view class="flex-item">{{recommend.vip_text}}</view>
</view>
<view class="flex">
<view class="flex-item">{{recommend.novip}}人在线(普通用户)</view>
<view class="flex-item">{{recommend.novip_text}}</view>
</view>
</view>
<view class="capacity-block-table">
<view class="header">
<view class="flex-item">伙伴成员</view>
</view>
<view class="flex">
<view class="flex-item">{{partner.vip}}人在线(会员)</view>
<view class="flex-item">{{partner.vip_text}}</view>
</view>
<view class="flex">
<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>{{build.capacity}}GLF/h</text></view>
<view class="subtitle">{{build.current}}/{{build.max}}</view>
</view>
<view class="capacity-block-text ">产品当前设置共建者每日可以通过看广告获得共建值暂未开放敬请期待</view>
</view>
<view class="capacity-block">
<view class="capacity-block-title">
<view class="title">共力值产率<text>{{together.capacity}}GLF/h</text></view>
<view class="subtitle">{{together.current}}/{{together.max}}</view>
</view>
<view class="capacity-block-text ">根据正常用户的使用在平台的使用习惯购物等行为产生对应共力值暂未开放敬请期待</view>
</view>
<view class="capacity-block" v-for="(item,index) in other" :keys='index'>
<view class="capacity-block-title">
<view class="title">{{item.title}}</view>
<view class="capacity-block-glf">{{item.capacity}}GLF/h</view>
</view>
<view class="capacity-block-text " v-if="item.remark">{{item.remark}}</view>
</view>
<view class="capacity-hint"> 用户须知用户所产生共力分在每日结算时平台会扣除30%的共力分用于平台运营使用 </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 : '-',
},
build:{},
together:{},
other:{}
};
},
created() {
uni.showLoading({})
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
this.build = res.build
this.together = res.together
this.other = res.other
uni.setNavigationBarTitle({
title: res.glz + 'GLF'
})
uni.hideLoading()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
onNavigationBarButtonTap() {
uni.showModal({
title:'温馨提示',
content:'重置签到只重新计算24小时时间所迭代加成的比例不变',
confirmColor:'#34CE98',
confirmText:'立即重置',
cancelColor:'#999',
cancelText:'再想想',
success: (res) => {
if(res.confirm){
console.log('再次签到。。。')
this.checkIMEI().then(res => {
switch (res) {
case 'Permanent':
uni.showModal({
title: '提示',
content: '签到功能需使用您的电话状态和网络信息,请在手机设置中权限开启您的权限',
showCancel: false,
})
break;
case 'Temporary':
uni.showModal({
title: '提示',
content: '签到功能需使用您的电话状态和网络信息,请点击设置开启应用权限',
cancelText: '获取权限',
confirmText: '稍后再说',
success: e => {
if (e.cancel) {
this.checkIMEI().then(IMEI => {
if (IMEI === 'Success') {
this.showAd()
}
})
}
}
})
break;
case 'Success':
this.showAd()
break;
}
})
}
}
})
},
methods: {
onInvitation(){
this.$Router.push({name: 'Invitation'})
},
// imei权限
checkIMEI() {
// 检查imei权限
return new Promise((resolve, reject) => {
if (plus.os.name == "Android") {
plus.android.requestPermissions(['android.permission.READ_PHONE_STATE'], (e) => {
if (e.deniedAlways.length > 0) {
resolve('Permanent');
}
if (e.deniedPresent.length > 0) {
resolve('Temporary');
}
if (e.granted.length > 0) {
resolve('Success');
}
}, (e) => {
uni.showToast({
title: JSON.stringify(e),
icon: 'none'
})
})
return
}
reject('非安卓设备');
})
}
}
}
</script>
<style lang="scss">
.capacity{
background: $window-color;
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;
line-height: 60rpx;
text{
margin-left: 10rpx;
color: $main-color;
}
}
&-sbutitle{
font-size: 26rpx;
line-height: 40rpx;
}
&-block{
background: white;
margin-top: $margin;
border-radius: $radius;
padding: $padding;
&-glf{
color: $main-color;
font-size: 30rpx;
// padding-top: 30rpx;
}
&-title{
font-weight: bold;
font-size: 34rpx;
line-height: 60rpx;
display: flex;
justify-content: space-between;
.title{
text{
color: $main-color;
font-weight: normal;
padding-left: 10rpx;
}
}
.more{
background: $main-color;
color: white;
font-weight: bold;
font-size: 28rpx;
border-radius: 25rpx;
line-height: 60rpx;
width: 230rpx;
text-align: center;
}
.subtitle{
font-weight: normal;
font-size: 24rpx;
color: $main-color;
}
.nickname{
color: gray;
font-size: 30rpx;
}
}
&-text{
font-size: 28rpx;
color: gray;
line-height: 40rpx;
padding-top: 30rpx;
}
&-table{
border:solid 1px $border-color;
margin-bottom: 20rpx;
padding-top: 30rpx;
&:last-child{
margin-top: 0;
}
.header{
background: $border-color;
line-height: 50rpx;
padding: 0 15rpx;
font-size: 26rpx;
color: gray;
}
.flex{
display: flex;
border-top: solid 1rpx $border-color;
color: gray;
.flex-item{
width: 50%;
box-sizing: border-box;
line-height: 50rpx;
padding: 0 15rpx;
font-size: 24rpx;
&:first-child{
border-right: solid 1rpx $border-color;
}
}
}
}
}
.pt30{
padding-top: 30rpx;
}
}
<template>
<view class="capacity">
<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 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">成员产率({{group.effect}}/{{group.count}})<text< /text>
</view>
<view class="capacity-block-glf">{{group.capacity}}GLF/h</view>
<!-- <view class="more" @click="onInvitation">邀请更多好友</view> -->
</view>
<view class="capacity-block-table pt30">
<view class="header">
<view class="flex-item">家族成员产率</view>
</view>
<view class="flex">
<view class="flex-item">{{recommend.vip}}人在线(会员)</view>
<view class="flex-item">{{recommend.vip_text}}</view>
</view>
<view class="flex">
<view class="flex-item">{{recommend.novip}}人在线(普通用户)</view>
<view class="flex-item">{{recommend.novip_text}}</view>
</view>
</view>
<view class="capacity-block-table">
<view class="header">
<view class="flex-item">伙伴成员</view>
</view>
<view class="flex">
<view class="flex-item">{{partner.vip}}人在线(会员)</view>
<view class="flex-item">{{partner.vip_text}}</view>
</view>
<view class="flex">
<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>{{build.capacity}}GLF/h</text></view>
<view class="subtitle">{{build.current}}/{{build.max}}</view>
</view>
<view class="capacity-block-text ">产品当前设置共建者每日可以通过看广告获得共建值暂未开放敬请期待</view>
</view>
<view class="capacity-block">
<view class="capacity-block-title">
<view class="title">共力值产率<text>{{together.capacity}}GLF/h</text></view>
<view class="subtitle">{{together.current}}/{{together.max}}</view>
</view>
<view class="capacity-block-text ">根据正常用户的使用在平台的使用习惯购物等行为产生对应共力值暂未开放敬请期待</view>
</view>
<view class="capacity-block" v-for="(item,index) in other" :keys='index'>
<view class="capacity-block-title">
<view class="title">{{item.title}}</view>
<view class="capacity-block-glf">{{item.capacity}}GLF/h</view>
</view>
<view class="capacity-block-text " v-if="item.remark">{{item.remark}}</view>
</view>
<view class="capacity-hint"> 用户须知用户所产生共力分在每日结算时平台会扣除30%的共力分用于平台运营使用 </view>
</view>
</template>
<script>
import {
glz,sign
} from '@/apis/interfaces/life.js'
import AD from '@/utils/ad.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: '-',
},
build: {},
together: {},
other: {},
can_repeat_sign: false
};
},
created() {
uni.showLoading({})
glz().then(res => {
console.log(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
this.build = res.build
this.together = res.together
this.other = res.other
this.can_repeat_sign = res.can_repeat_sign
uni.setNavigationBarTitle({
title: res.glz + 'GLF'
})
uni.hideLoading()
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
onNavigationBarButtonTap() {
if (!this.can_repeat_sign) {
uni.showModal({
title: '温馨提示',
content: '今日重置签到机会已使用过了,明日再来试试吧~',
confirmColor: '#34CE98',
confirmText: '知道了',
showCancel: false,
})
} else {
uni.showModal({
title: '温馨提示',
content: '重置签到只重新计算24小时时间所迭代加成的比例不变',
confirmColor: '#34CE98',
confirmText: '立即重置',
cancelColor: '#999',
cancelText: '再想想',
success: (res1) => {
if (res1.confirm) {
console.log('再次签到。。。')
this.checkIMEI().then(res => {
console.log(res);
switch (res) {
case 'Permanent':
uni.showModal({
title: '提示',
content: '签到功能需使用您的电话状态和网络信息,请在手机设置中权限开启您的权限',
showCancel: false,
})
break;
case 'Temporary':
uni.showModal({
title: '提示',
content: '签到功能需使用您的电话状态和网络信息,请点击设置开启应用权限',
cancelText: '获取权限',
confirmText: '稍后再说',
success: e => {
if (e.cancel) {
this.checkIMEI().then(IMEI => {
if (IMEI ===
'Success') {
this.showAd()
}
})
}
}
})
break;
case 'Success':
this.showAd()
break;
}
}).catch(err => {
console.log(err)
})
}
}
})
}
},
methods: {
showAd() {
AD.show({
adpid: 1428308887,
adType: 'RewardedVideo'
}, detail => {
if (detail && detail.isEnded) {
uni.showLoading({
title: '签到中..'
})
sign().then(res => {
uni.showToast({
title: '签到成功',
icon: 'none'
})
this.getLife()
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
}
}, err => {
uni.showToast({
title: err.errMsg,
icon: 'none'
})
})
},
onInvitation() {
this.$Router.push({
name: 'Invitation'
})
},
// imei权限
checkIMEI() {
// 检查imei权限
return new Promise((resolve, reject) => {
if (plus.os.name == "Android") {
plus.android.requestPermissions(['android.permission.READ_PHONE_STATE'], (e) => {
if (e.deniedAlways.length > 0) {
resolve('Permanent');
}
if (e.deniedPresent.length > 0) {
resolve('Temporary');
}
if (e.granted.length > 0) {
resolve('Success');
}
}, (e) => {
uni.showToast({
title: JSON.stringify(e),
icon: 'none'
})
})
return
}
reject('非安卓设备');
})
}
}
}
</script>
<style lang="scss">
.capacity {
background: $window-color;
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;
line-height: 60rpx;
text {
margin-left: 10rpx;
color: $main-color;
}
}
&-sbutitle {
font-size: 26rpx;
line-height: 40rpx;
}
&-block {
background: white;
margin-top: $margin;
border-radius: $radius;
padding: $padding;
&-glf {
color: $main-color;
font-size: 30rpx;
// padding-top: 30rpx;
}
&-title {
font-weight: bold;
font-size: 34rpx;
line-height: 60rpx;
display: flex;
justify-content: space-between;
.title {
text {
color: $main-color;
font-weight: normal;
padding-left: 10rpx;
}
}
.more {
background: $main-color;
color: white;
font-weight: bold;
font-size: 28rpx;
border-radius: 25rpx;
line-height: 60rpx;
width: 230rpx;
text-align: center;
}
.subtitle {
font-weight: normal;
font-size: 24rpx;
color: $main-color;
}
.nickname {
color: gray;
font-size: 30rpx;
}
}
&-text {
font-size: 28rpx;
color: gray;
line-height: 40rpx;
padding-top: 30rpx;
}
&-table {
border: solid 1px $border-color;
margin-bottom: 20rpx;
padding-top: 30rpx;
&:last-child {
margin-top: 0;
}
.header {
background: $border-color;
line-height: 50rpx;
padding: 0 15rpx;
font-size: 26rpx;
color: gray;
}
.flex {
display: flex;
border-top: solid 1rpx $border-color;
color: gray;
.flex-item {
width: 50%;
box-sizing: border-box;
line-height: 50rpx;
padding: 0 15rpx;
font-size: 24rpx;
&:first-child {
border-right: solid 1rpx $border-color;
}
}
}
}
}
.pt30 {
padding-top: 30rpx;
}
}
</style>

File diff suppressed because one or more lines are too long

View File

@@ -24148,7 +24148,8 @@ var render = function() {
"/" +
_vm._$g(11, "t0-1") +
")"
)
),
_vm._v("< /text>")
]
),
_c(