demingshangjia/pages/user/info.vue

127 lines
2.7 KiB
Vue
Raw Normal View History

2020-06-12 15:08:37 +08:00
<template>
<view class="info">
2020-06-12 18:05:39 +08:00
<view class="head" @click="showImage=true">
2020-06-12 15:08:37 +08:00
<image></image>
<text>更换头像</text>
</view>
<view class="item">
2020-06-12 18:05:39 +08:00
<text class="title">用户名</text>
<text class="value">兽兽</text>
2020-06-12 15:08:37 +08:00
</view>
2020-06-12 18:05:39 +08:00
<view class="item">
<text class="title">个性签名</text>
<text class="value">变瘦变高变有钱</text>
</view>
<view class="password" @click="updatePwd">
<text>修改密码</text>
<image src="/static/image/user/1.png"></image>
</view>
<u-popup v-model="showImage" mode="bottom">
<view class="image-popup">
<view @click="chooseImage('camera')">拍摄新照片</view>
<view @click="chooseImage('album')">从相册选取</view>
</view>
</u-popup>
2020-06-12 15:08:37 +08:00
</view>
</template>
<script>
export default {
2020-06-12 18:05:39 +08:00
name:"info",
data() {
return {
showImage: false
}
},
methods: {
chooseImage(sourceType) {
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: [sourceType],
success: function (res) {
console.log(JSON.stringify(res.tempFilePaths));
}
});
},
updatePwd() {
uni.navigateTo({
url: '/pages/user/updatePassword'
});
}
},
2020-06-12 15:08:37 +08:00
}
</script>
<style lang="scss" scoped>
.info{
2020-06-12 18:05:39 +08:00
min-height: calc(100vh - var(--window-top));
2020-06-12 15:08:37 +08:00
background: #ececec;
.head{
height: 202rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #fff;
2020-06-12 18:05:39 +08:00
margin-bottom: 2rpx;
2020-06-12 15:08:37 +08:00
>image{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
2020-06-12 18:05:39 +08:00
background-color: #0f0;
2020-06-12 15:08:37 +08:00
}
>text{
font-size: 24rpx;
color: #FF780F;
margin-top: 20rpx;
}
margin-bottom: 2rpx;
}
2020-06-12 18:05:39 +08:00
.item {
display: flex;
align-items: center;
height: 98rpx;
background: rgba(255,255,255,1);
padding: 0 30rpx;
margin-bottom: 2rpx;
.title {
width: 120rpx;
font-size: 30rpx;
color: rgba(51,51,51,1);
margin-right: 120rpx;
}
.value {
font-size: 30rpx;
color: rgba(101,101,101,1);
}
}
.password {
margin-top: 20rpx;
padding: 0 30rpx;
height: 98rpx;
display: flex;
align-items: center;
justify-content: space-between;
background: rgba(255,255,255,1);
> text {
font-size: 30rpx;
color: rgba(51,51,51,1);
}
> image {
width: 11rpx;
height: 22rpx;
}
}
.image-popup {
padding: 0 30rpx;
> view {
font-size: 28rpx;
color: rgba(51,51,51,1);
line-height: 98rpx;
text-align: center;
&:first-child {
border-bottom: 2rpx solid #EBEBEB;
}
}
}
2020-06-12 15:08:37 +08:00
}
</style>