Files
shoot-miniprograms/src/pages/point-book-profile.vue

196 lines
4.4 KiB
Vue
Raw Normal View History

2025-10-27 13:56:27 +08:00
<script setup>
import { ref } from "vue";
import Avatar from "@/components/Avatar.vue";
import useStore from "@/store";
import { storeToRefs } from "pinia";
const store = useStore();
const { user } = storeToRefs(store);
2025-10-27 14:40:17 +08:00
const editAvatar = ref(false);
2025-10-27 13:56:27 +08:00
const toEditPage = () => {
uni.navigateTo({
url: "/pages/point-book-edit",
});
};
</script>
<template>
<view class="container">
<view class="header">
<image :src="user.avatar" mode="widthFix" />
2025-10-27 14:40:17 +08:00
<button hover-class="none" @click="editAvatar = true">
2025-10-27 13:56:27 +08:00
<image src="../static/pen-yellow.png" mode="widthFix" />
</button>
</view>
<view class="body">
<view>
<button hover-class="none">
<image src="../static/user-yellow.png" mode="widthFix" />
<text>Name</text>
<image src="../static/back-grey.png" mode="widthFix" />
</button>
<button hover-class="none">
<image src="../static/email-yellow.png" mode="widthFix" />
<text>Email</text>
<image src="../static/back-grey.png" mode="widthFix" />
</button>
<button hover-class="none">
<image src="../static/password-yellow.png" mode="widthFix" />
<text>Password</text>
<image src="../static/back-grey.png" mode="widthFix" />
</button>
</view>
<button hover-class="none">Log out</button>
2025-10-27 14:21:31 +08:00
<view>
<text>Have questions? Please contact us through email: </text>
<text>shelingxingqiu@163.com</text>
</view>
2025-10-27 13:56:27 +08:00
</view>
2025-10-27 14:40:17 +08:00
<view
class="edit-avatar"
:style="{ height: editAvatar ? '100vh' : '0' }"
@click="editAvatar = false"
>
<image :src="user.avatar" mode="widthFix" />
<view>
<button hover-class="none">
<text>Take a photo</text>
<image src="../static/back-grey.png" mode="widthFix" />
</button>
<button hover-class="none">
<text>Choose photo</text>
<image src="../static/back-grey.png" mode="widthFix" />
</button>
</view>
</view>
2025-10-27 13:56:27 +08:00
</view>
</template>
<style scoped lang="scss">
.container {
display: flex;
flex-direction: column;
align-items: center;
2025-10-27 14:21:31 +08:00
height: 100%;
2025-10-27 13:56:27 +08:00
}
.header {
position: relative;
margin-top: -120rpx;
}
.header > image {
width: 180rpx;
height: 180rpx;
border-radius: 50%;
border: 4rpx solid #fff;
}
.header > button {
position: absolute;
right: 0;
bottom: 0;
}
.header > button > image {
width: 60rpx;
height: 60rpx;
}
.body {
width: 100%;
margin-top: 20rpx;
2025-10-27 14:21:31 +08:00
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
2025-10-27 13:56:27 +08:00
}
2025-10-27 14:21:31 +08:00
.body > view:first-child {
2025-10-27 13:56:27 +08:00
background-color: $uni-bg-color;
border-radius: 25px;
padding: 0 20px;
2025-10-27 14:21:31 +08:00
width: calc(100% - 80rpx);
2025-10-27 13:56:27 +08:00
}
2025-10-27 14:21:31 +08:00
.body > view:first-child > button {
2025-10-27 13:56:27 +08:00
display: flex;
align-items: center;
padding: 20px 0;
}
2025-10-27 14:21:31 +08:00
.body > view:first-child > button:not(:last-child) {
2025-10-27 13:56:27 +08:00
border-bottom: 1rpx solid #e3e3e3;
}
2025-10-27 14:21:31 +08:00
.body > view:first-child > button > image:first-child {
2025-10-27 13:56:27 +08:00
width: 40rpx;
height: 40rpx;
}
2025-10-27 14:21:31 +08:00
.body > view:first-child > button > text {
2025-10-27 13:56:27 +08:00
flex: 1;
font-size: 26rpx;
color: #333333;
text-align: left;
padding-left: 20rpx;
}
2025-10-27 14:21:31 +08:00
.body > view:first-child > button > image:last-child {
2025-10-27 13:56:27 +08:00
width: 28rpx;
height: 28rpx;
}
2025-10-27 14:21:31 +08:00
.body > button {
2025-10-27 13:56:27 +08:00
margin-top: 24rpx;
background: $uni-bg-color;
border-radius: 24rpx;
font-size: 26rpx;
color: $uni-link-color;
text-align: center;
padding: 20px 0;
2025-10-27 14:21:31 +08:00
width: 100%;
}
.body > view:last-child {
margin-top: auto;
padding-bottom: 25rpx;
display: flex;
flex-direction: column;
align-items: center;
font-size: 24rpx;
color: #666666;
}
.body > view:last-child > text:last-child {
color: $uni-link-color;
2025-10-27 13:56:27 +08:00
}
2025-10-27 14:40:17 +08:00
.edit-avatar {
position: fixed;
top: 0;
right: 0;
width: 100vw;
background: rgba(0, 0, 0, 0.7);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
}
.edit-avatar > image {
width: 85vw;
height: 85vw;
border-radius: 50%;
}
.edit-avatar > view {
border-radius: 25rpx;
margin-top: 100rpx;
width: calc(100% - 150rpx);
padding: 0 40rpx;
background: #585858;
}
.edit-avatar > view > button {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 30rpx;
color: #ffffff;
padding: 40rpx 0;
}
.edit-avatar > view > button:not(:last-child) {
border-bottom: 1rpx solid #fff3;
border-radius: 0;
}
.edit-avatar > view > button > image {
width: 28rpx;
}
2025-10-27 13:56:27 +08:00
</style>