Files
app-govern/pages/user/basic.vue

96 lines
2.8 KiB
Vue
Raw Normal View History

2023-02-10 16:32:41 +08:00
<template>
2023-08-11 11:03:31 +08:00
<Cn-page :loading="loading">
<view slot="body">
<view class="index">
<view class="mine-nav" @click="jump('head')" style="box-shadow: 0 4rpx 8rpx #e7e7e74c">
2023-02-10 16:32:41 +08:00
<view class="mine-nav-label">头像</view>
2023-08-11 11:03:31 +08:00
<image
style="height: 120rpx; width: 120rpx; border-radius: 12rpx"
:src="userInfo.avatar"
mode="scaleToFill"
v-if="userInfo.avatar"
/>
<image
style="height: 120rpx; width: 120rpx; border-radius: 12rpx"
src="/static/head.png"
mode="scaleToFill"
v-else
/>
2023-02-10 16:32:41 +08:00
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
2023-08-11 11:03:31 +08:00
<view class="mine-nav" @click="jump('changeName')">
2023-02-10 16:32:41 +08:00
<view class="mine-nav-label">名字</view>
2023-08-11 11:03:31 +08:00
<view class="mine-nav-des">{{ userInfo.nickname }}</view>
2023-02-10 16:32:41 +08:00
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
2023-08-11 11:03:31 +08:00
<view class="mine-nav" @click="jump('erweima')" style="border-bottom: none">
2023-02-20 14:19:28 +08:00
<view class="mine-nav-label">我的二维码</view>
<image
src="/static/erweima.png"
2023-08-11 11:03:31 +08:00
style="height: 50rpx; width: 50rpx; border-radius: 12rpx"
2023-02-20 14:19:28 +08:00
mode="scaleToFill"
/>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
2023-02-10 16:32:41 +08:00
</view>
</view>
</Cn-page>
</template>
<script>
export default {
2023-08-11 11:03:31 +08:00
data() {
2023-02-10 16:32:41 +08:00
return {
2023-08-11 11:03:31 +08:00
loading: false,
userInfo: {},
2023-02-10 16:32:41 +08:00
}
},
methods: {
2023-08-11 11:03:31 +08:00
jump(type) {
console.log(type)
2023-02-10 16:32:41 +08:00
uni.navigateTo({
url: `/pages/user/${type}`,
fail: (err) => {
2023-08-11 11:03:31 +08:00
console.log(err)
},
2023-02-10 16:32:41 +08:00
})
2023-08-11 11:03:31 +08:00
},
},
onShow() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
},
2023-02-10 16:32:41 +08:00
}
</script>
2023-08-11 11:03:31 +08:00
<style lang="scss">
2023-02-10 16:32:41 +08:00
.index {
2023-02-20 14:19:28 +08:00
padding: 20rpx;
2023-02-10 16:32:41 +08:00
.mine-nav {
2023-08-11 11:03:31 +08:00
padding: 34rpx;
2023-02-10 16:32:41 +08:00
display: flex;
align-items: center;
background: $uni-theme-white;
border-bottom: 1rpx solid #e8e8e8;
&-icon {
margin-right: 30rpx;
height: 44rpx;
width: 44rpx;
border-radius: $uni-theme-radius;
overflow: hidden;
}
&-label {
margin-right: 30rpx;
flex: 1;
font-size: 28rpx;
color: #111;
}
&-des {
font-size: 28rpx;
color: #999;
}
}
}
</style>