提交
This commit is contained in:
85
甲情_甲意/miniprogram/pages/wode/wode.acss
Normal file
85
甲情_甲意/miniprogram/pages/wode/wode.acss
Normal file
@ -0,0 +1,85 @@
|
||||
/* 头像盒子 */
|
||||
.box1 {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
background-color: #eec2c7;
|
||||
position: relative;
|
||||
}
|
||||
.box1 image{
|
||||
max-width: 70px;
|
||||
max-height: 70px;
|
||||
position:absolute;
|
||||
border-radius: 50%;
|
||||
top:30px;
|
||||
left:30px;
|
||||
}
|
||||
.text1{
|
||||
font-size: 20px;
|
||||
position: absolute;
|
||||
left:110px;
|
||||
top:50px;
|
||||
}
|
||||
.text2{
|
||||
color: dimgray;
|
||||
position: absolute;
|
||||
left:290px;
|
||||
}
|
||||
.text3{
|
||||
color:dimgray;
|
||||
position: absolute;
|
||||
left:340px;
|
||||
}
|
||||
/* 我的订单 */
|
||||
.box2 image{
|
||||
max-width: 35px;
|
||||
max-height: 25px;
|
||||
position:absolute;
|
||||
top:140px;
|
||||
left:25px;
|
||||
}
|
||||
.z1{
|
||||
font-size: 20px;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.image1{
|
||||
max-width: 30px;
|
||||
max-height: 30px;
|
||||
margin-left: 35rpx;
|
||||
}
|
||||
.imagejian{
|
||||
max-width: 30px;
|
||||
max-height: 30px;
|
||||
}
|
||||
/* 退出登录 */
|
||||
.box10 image{
|
||||
max-width: 35px;
|
||||
max-height: 25px;
|
||||
position:absolute;
|
||||
top:380px;
|
||||
left:25px;
|
||||
}
|
||||
.z5{
|
||||
font-size: 20px;
|
||||
position: absolute;
|
||||
left:70px;
|
||||
top:380px;
|
||||
}
|
||||
.box11 image{
|
||||
max-width: 35px;
|
||||
max-height: 25px;
|
||||
position:absolute;
|
||||
top:380px;
|
||||
left:330px;
|
||||
}
|
||||
.box3{
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.fenbu{
|
||||
width: 90%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
67
甲情_甲意/miniprogram/pages/wode/wode.axml
Normal file
67
甲情_甲意/miniprogram/pages/wode/wode.axml
Normal file
@ -0,0 +1,67 @@
|
||||
<!-- 头像盒子 -->
|
||||
<view style="width:100%">
|
||||
<view class="box1"onTap="login" >
|
||||
<image mode="aspectFill" src="{{avatarUrl}}"></image>
|
||||
<text class="text1">{{username}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 信息盒子 -->
|
||||
<!--我的订单 -->
|
||||
<view style="width:100%">
|
||||
<view class="box3" onTap="message">
|
||||
<view class="fenbu">
|
||||
<image class="image1" mode="aspectFill" src="/pages/image/message.png"></image>
|
||||
<text class="z1">我的消息</text>
|
||||
</view>
|
||||
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||
</view>
|
||||
<!-- 我的订单 -->
|
||||
<view class="box3" onTap="dingdan">
|
||||
<view class="fenbu">
|
||||
<image class="image1" mode="aspectFill" src="/pages/image/wodedingdan.png"></image>
|
||||
<text class="z1">我的订单</text>
|
||||
</view>
|
||||
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||
</view>
|
||||
<!-- 我的评价-->
|
||||
<view class="box3" onTap="pingjia">
|
||||
<view class="fenbu">
|
||||
<image class="image1" mode="aspectFill" src="/pages/image/wodepingjia.png"></image>
|
||||
<text class="z1">我的评价</text>
|
||||
</view>
|
||||
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||
</view>
|
||||
<!-- 我的收藏 -->
|
||||
<view class="box3" onTap="shoucang">
|
||||
<view class="fenbu">
|
||||
<image class="image1" mode="aspectFill" src="/pages/image/shoucang.png"></image>
|
||||
<text class="z1">我的收藏</text>
|
||||
</view>
|
||||
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||
</view>
|
||||
<!-- 商家入驻 -->
|
||||
<view class="box3" onTap="ruzhu">
|
||||
<view class="fenbu">
|
||||
<image class="image1" mode="aspectFill" src="/pages/image/shangjiaruzu.png"></image>
|
||||
<text class="z1">商家入驻</text>
|
||||
</view>
|
||||
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||
</view>
|
||||
<!-- 认证美甲师 -->
|
||||
<view class="box3" onTap="meijishi">
|
||||
<view class="fenbu">
|
||||
<image class="image1" mode="aspectFill" src="/pages/image/meijishirenzheng.png"></image>
|
||||
<text class="z1">认证美甲师</text>
|
||||
</view>
|
||||
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||
</view>
|
||||
<!-- 退出登录 -->
|
||||
<view class="box3" onTap="out">
|
||||
<view class="fenbu">
|
||||
<image class="image1" mode="aspectFill" src="/pages/image/tuichudenglu.png"></image>
|
||||
<text class="z1">退出登录</text>
|
||||
</view>
|
||||
<image class="imagejian" mode="aspectFill" src="/pages/image/jiantou.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
104
甲情_甲意/miniprogram/pages/wode/wode.js
Normal file
104
甲情_甲意/miniprogram/pages/wode/wode.js
Normal file
@ -0,0 +1,104 @@
|
||||
Page({
|
||||
data: {
|
||||
username: '请登录', // 用户名
|
||||
avatarUrl: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.jHUH4s7TQ48X_B-1iozuJgHaHa?w=207&h=207&c=7&r=0&o=5&dpr=1.5&pid=1.7' // 用户头像
|
||||
},
|
||||
|
||||
onShow() {
|
||||
my.getStorage({
|
||||
key: 'userInfo',
|
||||
success: (res) => {
|
||||
// 成功获取到用户信息
|
||||
const userInfo = res.data;
|
||||
console.log('用户信息:', userInfo);
|
||||
if(userInfo){
|
||||
this.setData({
|
||||
username: userInfo.username,
|
||||
avatarUrl: userInfo.avatarUrl,
|
||||
messagelogin:userInfo,
|
||||
});
|
||||
}else{
|
||||
this.setData({
|
||||
username: '请登录',
|
||||
avatarUrl: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.jHUH4s7TQ48X_B-1iozuJgHaHa?w=207&h=207&c=7&r=0&o=5&dpr=1.5&pid=1.7',
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('获取用户信息失败:', err);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 以下是一些页面跳转的示例函数
|
||||
dingdan() {
|
||||
my.navigateTo({
|
||||
url: '/pages/wodedingdan/wodedingdan'
|
||||
});
|
||||
},
|
||||
pingjia() {
|
||||
my.navigateTo({
|
||||
url: '/pages/wodepingjia/wodepingjia'
|
||||
});
|
||||
},
|
||||
xinxi() {
|
||||
my.navigateTo({
|
||||
url: '/pages/gerenxinxi/gerenxinxi'
|
||||
});
|
||||
},
|
||||
shoucang() {
|
||||
my.navigateTo({
|
||||
url: '/pages/wodeshoucang/wodeshoucang'
|
||||
});
|
||||
},
|
||||
ruzhu() {
|
||||
my.navigateTo({
|
||||
url: '/pages/shangjiaruzhu/shangjiaruzhu'
|
||||
});
|
||||
},
|
||||
message() {
|
||||
my.navigateTo({
|
||||
url: '/pages/message/message'
|
||||
});
|
||||
},
|
||||
login() {
|
||||
console.log(this.data.messagelogin);
|
||||
if (!this.data.messagelogin) {
|
||||
my.navigateTo({
|
||||
url: '/pages/denglu/denglu'
|
||||
});
|
||||
} else {
|
||||
my.showToast({
|
||||
content: '您已登录,无需重复登录',
|
||||
duration: 2000 // 提示持续时间
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
meijishi() {
|
||||
my.navigateTo({
|
||||
url: '/pages/meijiashirenzheng/meijiashirenzheng'
|
||||
});
|
||||
},
|
||||
out(){
|
||||
my.removeStorage({
|
||||
key: 'userInfo',
|
||||
success: () => {
|
||||
console.log('用户已退出登录,缓存已清除');
|
||||
|
||||
// 清除缓存后更新页面为默认信息
|
||||
this.setData({
|
||||
username: '请登录',
|
||||
avatarUrl: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.jHUH4s7TQ48X_B-1iozuJgHaHa?w=207&h=207&c=7&r=0&o=5&dpr=1.5&pid=1.7',
|
||||
messagelogin:""
|
||||
});
|
||||
my.alert({
|
||||
content:'您已退出登录'
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('退出登录失败:', err);
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
7
甲情_甲意/miniprogram/pages/wode/wode.json
Normal file
7
甲情_甲意/miniprogram/pages/wode/wode.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"defaultTitle": "我的",
|
||||
"usingComponents": {
|
||||
"ant-button": "antd-mini/es/Button/index"
|
||||
},
|
||||
"styleIsolation": "apply-shared"
|
||||
}
|
Reference in New Issue
Block a user