<template>
|
<view class="content">
|
<view class="my-info">
|
<view class="avatar">
|
<up-avatar :src="userStore.userinfo.avatarurl" size="70"></up-avatar>
|
</view>
|
<view class="user-name">
|
<view>
|
<text >{{ userStore.userinfo.nickname }}</text>
|
</view>
|
<!-- <view>
|
<text class="info-text">{{ userStore.schoolName }}</text>
|
</view> -->
|
<!-- <view>
|
<text class="info-text">{{ userStore.collegeName }}</text>
|
</view>
|
<view>
|
<text class="info-text">{{ userStore.majorName }}</text>
|
</view> -->
|
</view>
|
<!--
|
<view class="name">
|
|
</view> -->
|
|
</view>
|
<view class="menu">
|
<u-cell-group>
|
<u-cell iconStyle="color:#52ba9d" icon="file-text-fill" title="我的题库" isLink
|
url="/pages/my/myquestion"></u-cell>
|
<!-- <u-cell iconStyle="color:#1684fc" icon="integral-fill" title="VIP" isLink :value="vipTerm"
|
url="/pages/my/vip"></u-cell> -->
|
<u-cell iconStyle="color:#52ba9d" icon="rmb-circle-fill" title="充值" :value="balance" isLink
|
url="/pages/my/recharge"></u-cell>
|
<!-- <u-cell iconStyle="color:#1684fc" icon="phone-fill" title="手机绑定" :value="phone" isLink
|
url="/pages/my/phnoe"></u-cell> -->
|
<u-cell iconStyle="color:#52ba9d" icon="setting-fill" title="设置" isLink url="/pages/my/setting"></u-cell>
|
<u-cell iconStyle="color:#52ba9d" icon="share-square" title="分享" isLink url="/pages/my/share"></u-cell>
|
</u-cell-group>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import { ref, reactive, toRefs, onMounted } from "vue";
|
import { useBasicInfoStore } from "../../store/basicInfo"
|
|
export default {
|
setup() {
|
const userStore = useBasicInfoStore()
|
const state = reactive({
|
// vipTerm: '未开通',
|
balance: '',
|
phone: '',
|
})
|
|
onMounted(() => {
|
Init();
|
});
|
|
const Init = () => {
|
// if (userStore.vip) {
|
// state.vipTerm = "有效期 " + userStore.vipTerm
|
// }
|
// state.balance = "余额 " + userStore.balance
|
// if (userStore.phone) {
|
// state.phone = userStore.phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
|
// } else {
|
// state.phone = "未绑定 "
|
// }
|
}
|
|
|
return { ...toRefs(state), userStore }
|
}
|
}
|
|
</script>
|
|
<style scoped lang="scss">
|
.center {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
//justify-content: center;
|
}
|
|
.content {
|
@extend .center;
|
//background-color: #f5efd9;
|
height: 100vh;
|
width: 100%;
|
}
|
|
.my-info {
|
// @extend .center;
|
height: 15vh;
|
width: 100%;
|
background-color: #52ba9d;
|
padding-top: 5vh;
|
display: flex;
|
justify-content: flex-start;
|
.avatar {
|
width: 70px;
|
height: 70px;
|
margin-left: 35rpx;
|
}
|
|
.user-name{
|
line-height: 70px;
|
color: #fff;
|
margin-left: 35rpx;
|
}
|
|
.info-text {
|
font-size: 12px;
|
color: gray;
|
}
|
}
|
|
.menu {
|
@extend .center;
|
height: 50vh;
|
width: 100%;
|
margin-top: 3vh;
|
|
::v-deep .u-cell-group {
|
width: 90%;
|
margin: 0 rpx auto;
|
}
|
}
|
</style>
|