会员卡页面

This commit is contained in:
唐明明
2022-06-07 19:04:08 +08:00
parent 6a6cea4198
commit e48ff8b7ad
11 changed files with 2364 additions and 983 deletions

25
pages/account/dt.vue Normal file
View File

@@ -0,0 +1,25 @@
<template>
<view>
账户
<button @click="onNav">充值</button>
</view>
</template>
<script>
export default {
data() {
return {
};
},
methods: {
onNav(){
this.$Router.push({name: 'AccountRecharge'})
}
}
}
</script>
<style lang="scss">
</style>

View File

@@ -0,0 +1,19 @@
<template>
<view>
共力值
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>

View File

@@ -0,0 +1,19 @@
<template>
<view>
充值
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>

View File

@@ -43,31 +43,20 @@
<view class="subtitle">
<u-notice-bar :text="cardText" icon="" bgColor="" duration="3000" color="#fcc692" direction="column">
</u-notice-bar>
</view>
<view class="btn" @click="openVip" v-if="userInfo.identity.length === 0">开通</view>
</view>
<!-- v-if="userInfo.identity.length === 0" -->
<view class="btn" @click="openVip">开通</view>
</view>
<!-- 健康数据 -->
<view class="health-flex" v-if="userInfo.has_record">
<view class="health-flex-item">
<view class="title">
共力值
<image class="icon" src="@/static/user/icon_04.png" mode="widthFix" />
</view>
<view class="num">
{{ userInfo.record.fat.fat }}
</view>
<view class="hith">{{ userInfo.record.fat.text }}</view>
<view class="health-flex">
<view class="health-flex-item" @click="onBtn('AccountIntegral', {})">
<view class="title">共力值</view>
<view class="num">0.00</view>
</view>
<view class="health-flex-item">
<view class="title">
DT积分
<image class="icon" src="@/static/user/icon_05.png" mode="widthFix" />
</view>
<view class="num">
{{ userInfo.record.weight.weight }}
</view>
<view class="hith">{{ userInfo.record.weight.text }}</view>
<view class="health-flex-item" @click="onBtn('AccountDt', {})">
<view class="title">DT积分</view>
<view class="num">0.00</view>
</view>
</view>
<!-- 订单 -->
@@ -182,50 +171,7 @@
},
// 开通会员
openVip() {
if (this.isLogin()) {
uni.showActionSheet({
itemList: ['我是新用户', '我是老用户'],
success: res => {
switch (res.tapIndex) {
case 0:
uni.showModal({
title: '开通提示',
content: '平台新用户完成首笔订单即可获赠ZH健康会员',
showCancel: false,
cancelText: '去完成',
success: res => {
console.log(res);
this.$Router.pushTab({
name: 'Store'
});
}
});
break;
case 1:
uni.showToast({
title: '老用户渠道暂未开放',
icon: 'none'
});
break;
}
}
});
}
},
// 开通钱包
onWallet() {
if (this.isLogin()) {
if (this.userInfo.is_wallet) this.$Router.push({
name: 'WalletProperty'
});
else this.$Router.push({
name: 'WalletAdd'
});
}
},
// 个人档案
onFiles() {
console.log("登录")
this.$Router.push({name: 'Vip'})
},
// 按钮导航
onBtn(name, params) {
@@ -448,7 +394,6 @@
border-radius: $radius;
padding: $padding;
box-sizing: border-box;
.title {
font-size: $title-size-lg;
@@ -460,22 +405,15 @@
margin-bottom: 2rpx;
}
}
.num {
font-weight: bold;
font-size: $title-size + 10;
padding: $padding/3 0;
padding: $padding/3 0 0;
text {
font-size: 70%;
padding-left: 10rpx;
}
}
.hith {
font-size: $title-size-sm;
color: $text-gray;
}
}
}

19
pages/vip/agreement.vue Normal file
View File

@@ -0,0 +1,19 @@
<template>
<view>
会员开通协议
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>

117
pages/vip/vip.vue Normal file
View File

@@ -0,0 +1,117 @@
<template>
<view class="vip">
<view class="vip-card">
<view class="user-nickname">唐明阳</view>
<view class="user-date">到期日期2023-06-07</view>
<view class="user-cards">
<view class="vip-lv">践行者</view>
<view class="vip-loding">1/3 在邀请3个家庭成员可升级</view>
<navigator class="vip-more">成长体系<uni-icons size="14" type="forward" color="#9f5529"></uni-icons></navigator>
</view>
</view>
<view class="vip-content">
<view class="">会员成长值</view>
<view class="">会员权益</view>
</view>
<view class="footer-vip">
<button @click="onOpenVip">开通会员</button>
<view class="footer-text">开通即表示同意共力生态<navigator url="./agreement">会员开通协议</navigator></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
methods: {
onOpenVip(){
uni.requestPayment({
provider : "wxpay",
success: res => {
console.log(res)
},
fail: err=> {
console.log(err)
}
})
}
}
}
</script>
<style lang="scss">
// 会员卡
.vip-card{
background-color: #242430;
padding: $padding $padding 0;
.user-nickname{
color: #fcc590;
font-weight: bold;
}
.user-date{
color: rgba(255, 255, 255, .5);
font-size: 26rpx;
}
.user-cards{
padding: $padding;
box-sizing: border-box;
position: relative;
z-index: 1;
background: linear-gradient(to bottom right, #fce3c5, #fcc590);
border-radius: 30rpx 30rpx 0 0;
height: 300rpx;
margin-top: $margin;
border-radius: $radius;
color: #9f5529;
.vip-lv{
font-weight: bold;
font-size: 40rpx;
}
.vip-more{
font-size: 28rpx;
font-weight: bold;
display: inline-block;
}
}
}
// 会员权益
.vip-content{
padding: 180rpx $padding $padding $padding;
margin-top: -150rpx;
background-color: white;
border-radius: 30rpx 30rpx 0 0;
}
// 会员支付
.footer-vip{
padding: $padding;
button{
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
border: none;
background: linear-gradient(to right, #fce3c5, #fcc590);
color: #31364a;
font-size: 32rpx;
font-weight: bold;
&::after{
display: none;
}
}
.footer-text{
font-size: 26rpx;
color: #888;
text-align: center;
padding: $padding 0;
navigator{
display: inline-block;
color: #fcc590;
font-weight: bold;
}
}
}
</style>