You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jiansheng/pages/user/index.vue

319 lines
6.3 KiB

5 months ago
<template>
<view>
3 months ago
<image src="@/static/bg.png" mode="widthFix" class="bg" style="width: 100%;height: 928rpx;"></image>
<view class="top" :style="{'padding-top': top+'px'}">
5 months ago
<view class="xuzou">
3 months ago
<text class="title" style="margin-left: 25rpx;">我的</text>
5 months ago
</view>
3 months ago
<image src="@/static/bg.png" mode="widthFix" class="hs"></image>
5 months ago
</view>
3 months ago
<view class="content" :style="{'top': (top+44)+'px'}">
<view class="mendian" @click="gengx">
<image class="img" :src="userxixin.avatar?userxixin.avatar:avatar" mode=""></image>
<view class="xinxi" v-if="userxixin.mobile">
2 months ago
<view class="">{{userxixin.nickname?userxixin.nickname:'微信用户'}}<text v-if="userxixin.attendance_num>=1">出勤次数{{userxixin.attendance_num}}</text></view>
3 months ago
<view class="">{{userxixin.mobile?userxixin.mobile:'暂无手机号'}}</view>
</view>
<view class="xinxi" v-else>
<view class=""style="text-align: left;">登录</view>
</view>
<view class="renlbtn" v-if="userxixin.mobile" @click.stop="face(userxixin.face_id)">{{userxixin.face_id!=0?'已认证':'人脸录入'}}</view>
5 months ago
</view>
3 months ago
<view class="huiy" v-if="viplist.length>0">
<view class="" v-for="(item,index) in viplist" :key="index" style="height: 223rpx;">
<image class="huiyimg" src="@/static/hbg.png" mode=""></image>
<view class="huiybox">
<image class="huiyboximg" src="@/static/huangguan.png" mode=""></image>
3 months ago
<view class="huiywz">会员套餐<text style="float: right; font-weight: normal; font-size: 26rpx; margin-right: 50rpx;">{{item.status_name}}</text></view>
3 months ago
</view>
<view class="huiyxx">
<view class="">{{item.card_name}}
<text v-if="item.card_type!==2">{{item.validity_day}}</text>
</view>
<view class="" v-if="item.card_type==2">{{item.validity_num}}</view>
<view class="" v-else>
<text v-if='item.validity_date'>
到期时间{{item.validity_date}}
</text>
</view>
</view>
</view>
</view>
3 months ago
<template v-else>
<view class="huiy" v-if="!userxixin.mobile" @click="face()">
<image class="huiyimg" src="@/static/hbg.png" mode=""></image>
<view class="huiybox">
<image class="huiyboximg" src="@/static/huangguan.png" mode=""></image>
<view class="huiywz">会员套餐</view>
</view>
<view class="huiyxx">
<view class="">9.9元套餐
<text>7</text>
</view>
4 months ago
</view>
</view>
3 months ago
</template>
3 months ago
</view>
5 months ago
</view>
</template>
<script>
export default {
data() {
return {
4 months ago
userxixin: {},
3 months ago
avatar: require("@/static/logo.png"),
viplist: [],
top: 0
5 months ago
}
},
3 months ago
onLoad() {
this.top = uni.getSystemInfoSync().statusBarHeight
},
4 months ago
onShow() {
3 months ago
if(uni.getStorageSync("token")){
this.memberInfo()
}else{
this.userxixin={}
}
3 months ago
},
onShareAppMessage() {
return {
title: '运动湾24小时健身',
path: '/pages/uesr/index'
}
4 months ago
},
5 months ago
methods: {
4 months ago
chooseAvatar(e) {
console.log(123, e);
},
4 months ago
4 months ago
gengx() {
3 months ago
if(!uni.getStorageSync("token")) {
uni.navigateTo({
url: "/pages/login/login"
})
return ;
}
4 months ago
uni.navigateTo({
url: "/pages/user/portrait/portrait"
})
},
memberInfo() {
this.$api.memberInfo().then(res => {
this.userxixin = res.data
})
3 months ago
this.memberCardList()
4 months ago
},
memberCardList(page) {
this.$api.memberCardList(page).then(res => {
this.viplist = res.data.list;
4 months ago
})
},
5 months ago
previous() {
uni.navigateBack()
},
4 months ago
face(face_id) {
3 months ago
if(!uni.getStorageSync("token")) {
uni.navigateTo({
url: "/pages/login/login"
})
return ;
}
4 months ago
if (face_id != 0) {
uni.showToast({
icon: "none",
title: '人脸已认证',
duration: 3000
});
} else {
uni.navigateTo({
url: "/pages/face/face"
})
}
5 months ago
}
}
}
</script>
<style scoped>
3 months ago
.bg{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 1;
background: #f5f5f5;
}
.content{
width: 100%;
position: relative;
left: 0;
top: 0;
z-index: 2;
}
.top {
width: 100%;
left: 0;
z-index: 22;
top: 0;
height: 88rpx;
overflow: hidden;
position: fixed;
}
.top .xuzou{
width: 100%;
height: 88rpx;
display: flex;
position: fixed;
align-items: center;
position: relative;
z-index: 23;
}
.top .hs{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 1;
}
4 months ago
.huiybox {
5 months ago
display: flex;
margin-left: 50rpx;
4 months ago
position: relative;
top: -200rpx;
5 months ago
font-family: PingFang SC;
3 months ago
align-items: center;
5 months ago
font-weight: bold;
font-size: 34rpx;
color: #E7CAAD;
}
4 months ago
.huiywz {
5 months ago
margin-left: 22rpx;
3 months ago
margin-top: 10rpx;
3 months ago
flex: 1;
5 months ago
}
4 months ago
.huiyxx {
5 months ago
display: flex;
justify-content: space-between;
margin-left: 50rpx;
margin-right: 50rpx;
margin-top: 41rpx;
4 months ago
position: relative;
top: -200rpx;
5 months ago
font-family: PingFang SC;
font-weight: 500;
font-size: 30rpx;
color: #E7CAAD;
4 months ago
5 months ago
}
4 months ago
.huiyboximg {
5 months ago
width: 70rpx;
height: 55rpx;
}
4 months ago
.huiy {
3 months ago
padding: 0 25rpx 25rpx;
overflow: hidden;
5 months ago
}
4 months ago
.huiyimg {
5 months ago
width: 722rpx;
height: 230rpx;
4 months ago
5 months ago
}
4 months ago
5 months ago
.img {
width: 110rpx;
height: 110rpx;
4 months ago
border-radius: 50%;
5 months ago
}
.xinxi {
margin-left: 26rpx;
width: 365rpx;
}
2 months ago
.xinxi text{
font-size: 26rpx;
color: #F8A617;
margin-left: 20rpx;
}
5 months ago
.renlbtn {
width: 200rpx;
height: 80rpx;
background: #F8A617;
4 months ago
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(19, 14, 4, 0.14);
5 months ago
border-radius: 40rpx;
text-align: center;
line-height: 80rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
}
.title {
padding-left: 14rpx;
}
.mddz1img2 {
width: 44rpx;
height: 44rpx;
float: right;
}
.mddz2 {
margin-top: 32rpx;
}
.dz {
margin-left: 17rpx;
}
.mddz1img1 {
width: 22rpx;
height: 27rpx;
}
.mddz1 {
display: flex;
}
.mddz1img {
width: 60rpx;
height: 60rpx;
}
.mddz1wz {
font-family: PingFang SC;
font-weight: bold;
font-size: 30rpx;
color: #222222;
margin-left: 21rpx;
margin-top: 12rpx;
}
.mddz {
width: 680rpx;
height: 152rpx;
background: #FFFFFF;
box-shadow: 0rpx 3rpx 9rpx 0rpx rgba(19, 14, 4, 0.08);
border-radius: 20rpx;
margin-top: 24rpx;
padding: 20rpx 17rpx;
}
.mendian {
3 months ago
padding: 40rpx 25rpx 20rpx;
5 months ago
display: flex;
3 months ago
align-items: center;
overflow: hidden;
5 months ago
}
</style>