|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- <template>
- <view style="padding: 0 30rpx;">
- <view class="header">
- <view style="padding-top: 44rpx;" class="headerContent">
- <u-avatar src="/static/image/test/test.png" size="180rpx"></u-avatar>
- <view class="right">
- <view class="name">
- 张云
- </view>
- <view class="des">
- <image src="/static/image/school.png" mode=""></image>
- 山西科技大学 | 校长
- </view>
- </view>
- </view>
- </view>
- <view class="whiteCard">
- <view class="title">
- 个人信息
- </view>
- <u-cell title="账号" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false">
- <view slot="value" class="valueBox disabled">
- 543asd25a1
- </view>
- </u-cell>
- <u-cell title="姓名" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink
- @click="cellClick('修改姓名')">
- <view slot="value" class="valueBox">
- 杨云
- </view>
- </u-cell>
- <u-cell title="手机" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink
- @click="cellClick('修改手机号')">
- <view slot="value" class="valueBox">
- 18633460001
- </view>
- </u-cell>
- <u-cell title="昵称" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink
- @click="cellClick('设置昵称')">
- <view slot="value" class="valueBox">
- 未设置
- </view>
- </u-cell>
- <picker mode="date" :value="date" @change="dateChange">
- <u-cell title="出生日期" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink>
- <view slot="value" class="valueBox">
- {{date}}
- </view>
- </u-cell>
- </picker>
- </view>
- <view class="btn" @click="loginOut">
- 退出登录
- </view>
- <u-popup :show="show" mode="center" :round="10">
- <view class="popupInfo">
- <view class="title">
- {{this.action}}
- </view>
- <u--input v-model="inputValue" :customStyle="{height: '84rpx',boxSizing:'border-box'}" placeholder="请输入" border="surround" clearable></u--input>
- <view class="bottom">
- <view class="cancel" @click="cancel">
- 取消
- </view>
- <view class="confirm" @click="confirm">
- 确定
- </view>
- </view>
- </view>
- </u-popup>
-
- </view>
- </template>
-
- <script>
- export default {
- data() {
- return {
- show: false,
- action: '',
- inputValue: '',
- date: '1990-06-15',
- }
- },
- mounted() {},
- methods: {
- cellClick(action) {
- this.action = action
- this.inputValue = ''
- this.show = true
- },
- confirm() {
- switch (this.action) {
- case '修改姓名':
- if (!this.inputValue) {
- this.TOAST('请输入姓名')
- return
- }
- break
- case '修改手机号':
- if (!this.inputValue) {
- this.TOAST('请输入手机号')
- return
- }
- if (!
- /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[1589]))\d{8}$/
- .test(this.inputValue)) {
- this.TOAST('请输入正确的手机号')
- return
- }
- break
- case '设置昵称':
- if (!this.inputValue) {
- this.TOAST('请输入昵称')
- return
- }
- break
- }
- },
- cancel() {
- this.show = false
- },
- dateChange(e) {
- this.date = e.detail.value
- },
- loginOut() {
- this.CONFIRM('您是否确认退出登录?').then(()=>{
- this.CLEAR_STORAGE()
- this.JUMP_TO('/pages/login')
- })
- }
- }
- }
- </script>
-
- <style scoped lang="scss">
- uni-page-body {
- /* #ifdef H5*/
- background-image: url('/static/image/mybgh5.png');
- /* #endif */
- /* #ifndef H5*/
- background-image: url('/static/image/mybg.png');
- /* #endif */
- background-position: top;
- background-size: 100% auto;
- background-repeat: no-repeat;
- }
-
- .header {
- /* #ifdef H5*/
- padding-top: 40rpx;
- /* #endif */
- /* #ifndef H5*/
- padding-top: 88rpx;
- /* #endif */
- color: #333;
-
- .headerContent {
- display: flex;
- }
-
- .right {
- flex: 1;
- padding-top: 24rpx;
- padding-left: 36rpx;
-
- .name {
- font-size: 46rpx;
- font-weight: 700;
- }
-
- .des {
- display: flex;
- font-size: 28rpx;
- margin-top: 30rpx;
-
- uni-image {
- width: 34rpx;
- height: 34rpx;
- margin-right: 12rpx;
- }
- }
- }
- }
-
- .whiteCard {
- background-color: #fff;
- border-radius: 20rpx;
- margin-top: 50rpx;
-
- // padding: 0 30rpx;
- .title {
- font-family: 'Alimama ShuHeiTi';
- font-weight: 700;
- color: #2388FF;
- font-size: 42rpx;
- line-height: 42rpx;
- padding: 60rpx 30rpx 30rpx;
- }
- }
-
- .u-cell {
- height: 90rpx;
- position: relative;
-
- &:not(&:last-child)::after {
- content: '';
- display: block;
- position: absolute;
- height: 1rpx;
- background-color: rgba(0, 0, 0, 0.1);
- width: calc(100% - 60rpx);
- left: 30rpx;
- bottom: 0rpx;
- }
-
- .valueBox {
- color: #333;
- font-size: 30rpx;
- font-weight: 700;
-
- &.disabled {
- font-weight: unset;
- }
- }
- }
-
- .btn {
- height: 98rpx;
- background-color: #fff;
- line-height: 98rpx;
- border-radius: 20rpx;
- text-align: center;
- color: #333;
- margin-top: 30rpx;
- font-size: 32rpx;
- }
-
- .popupInfo {
- padding: 30rpx 30rpx 0rpx;
- width: 540rpx;
- box-sizing: border-box;
-
- .title {
- font-size: 34rpx;
- font-weight: 700;
- text-align: center;
- margin-bottom: 30rpx;
- margin-top: 16rpx;
- }
-
- .bottom {
- margin-top: 30rpx;
- display: flex;
- line-height: 88rpx;
- border-top: 1rpx solid rgba(0, 0, 0, 0.1);
- margin-left: -30rpx;
- margin-right: -30rpx;
- position: relative;
-
- &::after {
- content: '';
- background-color: rgba(0, 0, 0, 0.1);
- display: block;
- position: absolute;
- width: 1rpx;
- height: 100%;
- left: 50%;
- top: 0;
- }
-
- &>* {
- width: 50%;
- text-align: center;
- color: #165DFF;
- font-weight: 32rpx;
- }
- }
- }
- </style>
|