完善首页热榜推荐和今日上新

This commit is contained in:
魏啾
2024-05-09 15:29:29 +08:00
parent e1498a50f6
commit be2d4e1d39
6 changed files with 327 additions and 145 deletions

View File

@@ -2,11 +2,12 @@
<view class="container">
<view class="user-info-wrap">
<view style="width: 108rpx; height: 108rpx;border-radius: 50%;">
<image style="width: 108rpx; height: 108rpx; border-radius: 50%;" v-if="userInfo.avatar" :src="userInfo.avatar"
mode="aspectFill">
</image>
<image style="width: 108rpx; height: 108rpx; border-radius: 50%;" v-else src="@/static/avatar.png" mode="aspectFill">
</image>
<image style="width: 108rpx; height: 108rpx; border-radius: 50%;" v-if="userInfo.avatar"
:src="userInfo.avatar" mode="aspectFill">
</image>
<image style="width: 108rpx; height: 108rpx; border-radius: 50%;" v-else src="@/static/avatar.png"
mode="aspectFill">
</image>
</view>
<view class="info flex-colum-start">
<text class="phone">{{userInfo.telephone || '无'}}</text>
@@ -50,10 +51,34 @@
}
},
methods: {
//退出登录
boxClick() {
uni.showModal({
title: '注意',
content: '确定要退出登录吗?',
success: async (res) => {
if (res.confirm) {
try {
await this.api.loginOut();
} catch (e) {
//TODO handle the exception
}
uni.cache.clear();
uni.reLaunch({
url: '/pages/login/login'
});
}
}
});
},
clickinfo(item, index) {
switch (item.jumpType) {
case 'scan': //拉起相机
this.form.type = item.value
case 'scan': //特殊处理点击
switch (item.value) {
case 'loginOut':
this.boxClick()
break;
}
break;
case 'relative': //内部页面
uni.pro.navigateTo(item.absUrl)