This commit is contained in:
2022-06-08 20:09:50 +08:00
157 changed files with 3239 additions and 2802 deletions

View File

@@ -1,19 +1,195 @@
<template>
<view>
充值
<view class="recharge">
<view class="recharge-block">
<view class="recharge-title">
充值金额 <uni-icons class="recharge-title-icon" size="20" @click="rechargeToast" type="info-filled" color="#ddd"></uni-icons>
</view>
<view class="recharge-input">
<label></label>
<input type="digit" v-model="priceValue" placeholder="输入充值金额" />
</view>
</view>
<view class="recharge-block">
<view class="recharge-title">
快速充值
</view>
<view class="recharge-fast">
<view class="recharge-fast-item" @click="onRecharge(50)">
<view class="recharge-fast-price">50<text></text></view>
<view class="recharge-fast-numb">50<text>DT积分</text></view>
</view>
<view class="recharge-fast-item" @click="onRecharge(100)">
<view class="recharge-fast-price">100<text></text></view>
<view class="recharge-fast-numb">100<text>DT积分</text></view>
</view>
<view class="recharge-fast-item" @click="onRecharge(200)">
<view class="recharge-fast-price">200<text></text></view>
<view class="recharge-fast-numb">200<text>DT积分</text></view>
</view>
<view class="recharge-fast-item" @click="onRecharge(500)">
<view class="recharge-fast-price">500<text></text></view>
<view class="recharge-fast-numb">500<text>DT积分</text></view>
</view>
<view class="recharge-fast-item" @click="onRecharge(1000)">
<view class="recharge-fast-price">1000<text></text></view>
<view class="recharge-fast-numb">1000<text>DT积分</text></view>
</view>
<view class="recharge-fast-item" @click="onRecharge(5000)">
<view class="recharge-fast-price">5000<text></text></view>
<view class="recharge-fast-numb">5000<text>DT积分</text></view>
</view>
</view>
</view>
<view class="recharge-btn">
<button :disabled="this.priceValue === ''" @click="onRecharge">充值</button>
<view class="recharge-text">提示暂时仅支持使用微信支付充值</view>
</view>
</view>
</template>
<script>
import { recharge } from "@/apis/interfaces/account"
export default {
data() {
return {
priceValue: ''
};
},
methods: {
// 充值说明
rechargeToast(){
uni.showModal({
title: '充值说明',
content: '充值比例为11',
showCancel:false
})
},
// 充值
onRecharge(value){
uni.showLoading({
title: '加载中'
})
recharge({
amount: typeof(value) === 'number' ? value: this.priceValue
}).then(res => {
console.log(res)
uni.requestPayment({
provider: 'wxpay',
orderInfo: res,
success: res => {
console.log(res)
},
fail(err) {
console.log(err)
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
},
onNavigationBarButtonTap() {
console.log('充值记录')
}
}
</script>
<style lang="scss">
.recharge{
background: $window-color;
min-height: 100vh;
padding-top: $padding;
box-sizing: border-box;
.recharge-block{
background-color: white;
border-radius: $radius;
padding: $padding;
margin: 0 $margin $margin $margin;
.recharge-title{
font-weight: bold;
color: #333;
font-size: 30rpx;
line-height: 50rpx;
.recharge-title-icon{
margin-left: $margin/2;
vertical-align: middle;
}
}
.recharge-input{
position: relative;
height: 90rpx;
padding-left: 40rpx;
padding-top: 20rpx;
label{
position: absolute;
bottom: 0;
left: 0;
line-height: 74rpx;
font-weight: bold;
font-size: 34rpx;
}
input{
height: 90rpx;
font-size: 46rpx;
}
}
}
// 充值金额选择
.recharge-fast{
padding-top: $padding/2;
display: flex;
flex-wrap: wrap;
margin: 0 -10rpx;
&-item{
width: calc(33.33% - 20rpx);
margin: 10rpx;
text-align: center;
border:solid 1px $main-color;
box-sizing: border-box;
border-radius: 10rpx;
height: 140rpx;
display: flex;
justify-content: center;
flex-direction: column;
}
.recharge-fast-numb{
font-size: 24rpx;
color: gray;
}
.recharge-fast-price{
color: $main-color;
font-weight: bold;
font-size: 34rpx;
}
}
// 充值
.recharge-btn{
padding: $padding;
button{
height: 90rpx;
line-height: 90rpx;
background: $main-color;
color: white;
font-weight: bold;
font-size: 34rpx;
border-radius: 45rpx;
&::after{
display: none;
}
&[disabled]{
opacity: .6;
}
}
.recharge-text{
padding: $padding 0;
font-size: 26rpx;
text-align: center;
color: gray;
}
}
}
</style>

View File

@@ -3,71 +3,56 @@
<!-- 账户信息 -->
<view class="life-header">
<view class="life-header-flex">
<view class="life-header-item">共力值0.00</view>
<view class="life-header-item">余额0.00</view>
<view class="life-header-item">0.00共力值</view>
</view>
</view>
<!-- 共力人生 -->
<view class="life-cover">
<image class="life-cover-back" :src="require('@/static/life/back.png')"></image>
<view class="life-role">
<image class="life-role-src" :src="require('@/static/role/1.png')" mode="widthFix"/>
<image class="life-role-src" :src="figurePath" mode="widthFix"/>
<view class="life-role-content">
<view class="life-role-nick">唐明明</view>
<view class="life-role-nick">{{nickname || '-'}}</view>
<view class="life-role-card">
<image :src="require('@/static/role/role_icon_00.png')" mode="widthFix"></image>
<image :src="identity.button_cover_url" mode="widthFix"></image>
</view>
</view>
</view>
</view>
<!-- 功能入口 -->
<view class="life-nav">
<view class="life-nav-item">
<image :src="require('@/static/life/icon_00.png')" mode="widthFix" />
<view>共力健康</view>
</view>
<view class="life-nav-item">
<image :src="require('@/static/life/icon_01.png')" mode="widthFix" />
<view>共力文娱</view>
</view>
<view class="life-nav-item">
<image :src="require('@/static/life/icon_02.png')" mode="widthFix" />
<view>共力发展</view>
</view>
</view>
<view class="life-flex">
<view class="life-flex-item house">
<view class="life-flex-item house" @click="onNav({name: 'Store'}, 'tab')">
<view class="house-content">
<view class="house-title">共力生活</view>
<view class="house-title">DT商城</view>
<view class="house-subtitle">共力共慧</br>健康生活馆</view>
</view>
<image src="../../static/img/house_back.jpg" mode="aspectFill"></image>
</view>
<view class="life-flex-item both">
<view class="both-item team">
<view class="both-item team" @click="onToast('共力文娱暂未开放尽情期待')">
<view class="team-content">
<view class="team-title">DTS</view>
<view class="team-subtitle">数字化产权交易</view>
<view class="team-title">共力文娱</view>
<view class="team-subtitle">文娱短视频近期开放</view>
</view>
<image src="../../static/img/text_back.jpg" mode="aspectFill"></image>
</view>
<view class="both-item team">
<view class="both-item team" @click="onNav({name: 'Team'})">
<view class="team-content">
<view class="team-title">共力团队</view>
<view class="team-subtitle">
近期3人加入家族</br>
近期3人加入部落
近期{{children.indirect}}人成为伙伴</br>
近期{{children.recommend}}人加入家族
</view>
</view>
<image src="../../static/img/team_back.jpg" mode="aspectFill"></image>
</view>
</view>
<view class="life-flex-item other">
<view class="life-flex-item other" @click="onToast('消息中心暂未开放尽情期待')">
<view class="other-title">
<image src="../../static/life/icon_05.png" mode="widthFix"></image>
消息中心
</view>
<view class="other-subtitle">1条消息</view>
<view class="other-subtitle">{{message > 0 ? message + '条未读消息': '暂无消息'}}</view>
<image class="other-back" src="../../static/life/icon_07.png"></image>
</view>
<view class="life-flex-item other">
@@ -75,18 +60,18 @@
<image src="../../static/life/icon_03.png" mode="widthFix"></image>
邀请朋友
</view>
<view class="other-subtitle">2个邀请码可使用</view>
<view class="other-subtitle">加速共力值增长</view>
<image class="other-back" src="../../static/life/icon_08.png"></image>
</view>
<view class="life-flex-item other">
<view class="life-flex-item other" @click="onNav({name: 'Order'})">
<view class="other-title">
<image src="../../static/life/icon_04.png" mode="widthFix"></image>
我的订单
</view>
<view class="other-subtitle">暂无订单</view>
<view class="other-subtitle">{{order.all || '暂无订单'}}</view>
<image class="other-back" src="../../static/life/icon_09.png"></image>
</view>
<view class="life-flex-item other">
<view class="life-flex-item other" @click="onToast('共力好友暂未开放尽情期待')">
<view class="other-title">
<image src="../../static/life/icon_06.png" mode="widthFix"></image>
共力好友
@@ -99,25 +84,79 @@
</template>
<script>
import { life } from '@/apis/interfaces/life.js'
export default {
data() {
return {
nickname: '',
figurePath: '',
identity: {
button_cover_url: ''
},
children: {
recommend: 0,
indirect : 0
},
message: 0,
order: {
all: 0,
init: 0,
pay: 0,
delivered: 0
}
};
}
},
created() {
// 共力人生
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
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
methods: {
// 我的订单
onNav(name, type){
if(type){
this.$Router.pushTab({...name})
return
}
this.$Router.push({...name})
},
// 开发中提示
onToast(title){
uni.showToast({
title,
icon : 'none'
})
}
}
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.life{
min-height: 100vh;
background: #f8f8f8;
}
// 功能栏目
.life-flex{
padding: 0 20rpx 30rpx;
padding: 30rpx 20rpx 30rpx;
border-radius: 30rpx;
margin-top: -30rpx;
background: $window-color;
display: flex;
flex-wrap: wrap;
position: relative;
z-index: 1;
.life-flex-item{
background: white;
border-radius: 20rpx;
@@ -147,12 +186,12 @@
justify-content: space-between;
.house-title{
color: white;
font-size: 46rpx;
font-size: 36rpx;
font-weight: bold;
}
.house-subtitle{
color: white;
font-size: 30rpx;
font-size: 26rpx;
}
}
}
@@ -219,12 +258,12 @@
justify-content: space-between;
.team-title{
color: white;
font-size: 46rpx;
font-size: 36rpx;
font-weight: bold;
}
.team-subtitle{
color: white;
font-size: 26rpx;
font-size: 24rpx;
}
}
}
@@ -244,14 +283,14 @@
right: 0;
}
.other-title{
font-size: 40rpx;
font-size: 36rpx;
font-weight: bold;
color: #333;
image{
width: 42rpx;
width: 36rpx;
vertical-align: middle;
margin-bottom: 4rpx;
margin-right: 5rpx;
margin-right: 10rpx;
}
}
.other-subtitle{
@@ -297,15 +336,14 @@
left: 0;
right: 0;
z-index: 999;
background-color: rgba(255, 255, 255, 1);
@extend .ios-top;
.life-header-flex{
padding: 20rpx 30rpx 30rpx;
display: flex;
justify-content: center;
height: 70rpx;
line-height: 70rpx;
.life-header-item{
border:solid 1px #ddd;
border-radius: 35rpx;
padding: 0 20rpx;
margin-right: 20rpx;
@@ -341,12 +379,12 @@
font-weight: bold;
.life-role-nick{
color: #333;
font-size: 50rpx;
font-size: 40rpx;
}
.life-role-card{
padding-top: 10rpx;
image{
width: 150rpx;
width: 240rpx;
}
}
}

23
pages/team/index.vue Normal file
View File

@@ -0,0 +1,23 @@
<template>
<view>
共力团队
<view>共力家族</view>
<view>共力伙伴</view>
<view>供应商</view>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>

View File

@@ -1,33 +1,37 @@
<template>
<view class="vip">
<view :class="{'vip': isOpen}">
<view class="vip-card">
<view class="vip-user">
<image class="user-cover" src="" mode="aspectFill"></image>
<view class="user-nickname">唐明阳</view>
<view class="user-date">到期日期2023-06-07</view>
<view class="vip-renewal">续费</view>
<image class="user-cover" :src="user.avatar" mode="aspectFill"></image>
<view class="user-nickname">{{user.nickname}}</view>
<view class="user-date">到期日期{{identity.ended_at}}</view>
<view class="vip-renewal" v-if="!isOpen">续费</view>
</view>
<view class="user-cards">
<image class="vip-icon" src="/static/vip/lv_04.png" mode="widthFix"></image>
<image class="vip-icon" :src="identity.cover_url" mode="widthFix"></image>
<view>
<view class="vip-lv">共力践行者</view>
<view class="vip-progress">
<view class="vip-progress-loding" style="width: 50%;"></view>
</view>
<view class="vip-loding">
<view>0/0共分</view>
</view>
<view class="vip-lv">{{identity.identity_text}}</view>
<block>
<view class="vip-progress">
<view class="vip-progress-loding" style="width: 50%;"></view>
</view>
<view class="vip-loding">
<view>0/0共分</view>
</view>
</block>
</view>
<navigator class="vip-more">成长体系<uni-icons size="14" type="forward" color="#9f5529"></uni-icons></navigator>
<navigator class="vip-more" hover-class="none">成长体系<uni-icons size="14" type="forward" color="#9f5529"></uni-icons></navigator>
</view>
</view>
<view class="vip-content">
<view class="vip-content-title">距离 *** 还需条件</view>
<view class="vip-up-conditions">
<view class="vip-up-conditions-item"><text>10/10</text>家庭会员</view>
<view class="vip-up-conditions-item"><text>9/100</text>邀请家族会员</view>
<view class="vip-up-conditions-item"><text>10/10000</text>伙伴</view>
</view>
<block v-if="secondRule.length > 0">
<view class="vip-content-title">距离<text>{{nextIdentity.identity_text}}</text>还需条件</view>
<view class="vip-up-conditions">
<view class="vip-up-conditions-item"><text>10/10</text>家庭会</view>
<view class="vip-up-conditions-item"><text>9/100</text>邀请家族会员员</view>
<view class="vip-up-conditions-item"><text>10/10000</text>伙伴</view>
</view>
</block>
<view class="vip-content-title">会员特权</view>
<view class="vip-privilege">
<view class="vip-privilege-item" v-for="(item, index) in 8" :key="index">
@@ -38,12 +42,11 @@
</view>
<view class="vip-content-title">会员折扣说明</view>
<view class="vip-content-rich">
<view>前1000名会员享受会员费5折优惠</view>
<view>1001-2000名会员享受会员费5折优惠</view>
<view>前2001-5000名会员享受会员费5折优惠</view>
<view v-for="(item,index) in prices" :key="index">{{item.open_number}} - {{item.open_number + item.stock}}名享开通会员折扣价{{item.price}}</view>
<view>10000后会员恢复原价199.00</view>
</view>
</view>
<view class="footer-vip">
<view class="footer-vip" v-if="isOpen">
<button @click="onOpenVip">开通会员</button>
<view class="footer-text">开通即表示同意共力生态<navigator url="./agreement">会员开通协议</navigator></view>
</view>
@@ -51,22 +54,79 @@
</template>
<script>
import { vip, vipPay, submitOrder } from '@/apis/interfaces/vip.js'
export default {
data() {
return {
// 用户信息
user: {
username: '-',
nickname: '-',
avatar : '-',
},
// 当前身份
identity: {
identity_text: '',
cover_url: '',
ended_at: ''
},
// 下级身份
nextIdentity:{
identity_text: ''
},
// 升级条件
secondRule: [],
// 会员特权
rights: [],
// 会员折扣说明
prices: [],
// 是否可续费
isOpen: true
};
},
onShow() {
vip().then(res =>{
console.log(res)
this.isOpen = res.is_open
this.prices = res.prices
this.rights = res.rights
this.secondRule = res.second_rule
this.nextIdentity = res.next_identity
this.identity = res.identity
this.user = res.user
}).catch(err => {
console.log(err)
})
},
methods: {
onOpenVip(){
uni.requestPayment({
provider : "wxpay",
success: res => {
console.log(res)
},
fail: err=> {
console.log(err)
}
// 获取订单
vipPay().then(orderNo => {
// 支付参数
submitOrder({
orderNo
}).then(orderInfo => {
uni.requestPayment({
provider : "wxpay",
orderInfo,
success: res => {
console.log(res)
},
fail: err=> {
console.log(err)
}
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
@@ -187,6 +247,10 @@
width: 10rpx;
height: 30rpx;
}
text{
color: #fcc590;
padding: 0 10rpx;
}
}
.vip-up-conditions{
padding-top: 10rpx;
@@ -203,7 +267,6 @@
}
}
.vip-content-rich{
padding: 30rpx 0 0;
font-size: 28rpx;
line-height: 50rpx;
color: gray;
@@ -238,9 +301,18 @@
}
}
}
// 会员
.vip{
padding-bottom: ($padding*3) + 140;
}
// 会员支付
.footer-vip{
position: fixed;
bottom: 0;
width: 100%;
padding: $padding;
box-sizing: border-box;
background: white;
button{
height: 90rpx;
line-height: 90rpx;
@@ -258,6 +330,7 @@
.footer-text{
font-size: 26rpx;
color: #888;
line-height: 50rpx;
text-align: center;
padding: $padding 0;
navigator{