123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <template>
- <view class="container">
- <view class="cu-list menu text-left solid-top indexlow">
- <view class='cu-item' style='margin-bottom:10px;' @click="switchPicture">
- <view>
- <text>头像</text>
- </view>
- <view style='align-items: center;' class="flex">
- <view class="pictures">
- <image :src="headUrl" class="picture"></image>
- </view>
- <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow" ></image>
- </view>
- </view>
- <view class='cu-item' style='margin-bottom:10px;' @click="nickname(username)">
- <view>
- <text>昵称</text>
- </view>
- <view style='align-items: center;' class="flex">
- <view class="username">
- {{username}}
- </view>
- <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow" ></image>
- </view>
- </view>
- <view class='cu-item' @click='fankui'>
- <view>
- <text>意见反馈</text>
- </view>
- <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow" ></image>
- </view>
- </view>
- <view class='exitloginwrap'>
- <button @click='logout()' class='exitlogin'>退出登录</button>
- </view>
-
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- data() {
- return {
- headUrl:"../../static/img/myimg/YongHu@3x.png",
- username:"",
- gridList: [
- {
- num:0,
- name: '退出登录',
- // icon:'cuIcon-exit',
- src:'../../static/img/sign/return@3x.png',
- tips: 0,
- url:'',
- show:true
- },
- ],
- }
- },
- computed: {
- // ...mapState(['hasLogin', 'userInfo'])
- },
- onShow() {
- this.getList()
- },
- onLoad() {
- },
- methods:{
- getList(){
- this.userInfo= uni.getStorageSync('userInfo')
- this.headUrl = this.userInfo.avatarUrl
- if(this.headUrl == null || this.headUrl == ""){
- this.headUrl="../../static/img/myimg/YongHu@3x.png"
- }
- this.username = this.userInfo.userName
- },
- switchPicture(){
- uni.navigateTo({
- url: `/pages/user/set_picture`
- })
- },
- nickname(username){
- uni.navigateTo({
- url: `/pages/user/set_nickname?nickname=${username}`
- })
- },
- exitlogin(){
-
- },
- fankui(){
- uni.navigateTo({
- url: `/pages/user/fankui`
- })
- },
- logout() {
- const that = this
- uni.showModal({
- title: '询问',
- content: '您确定要退出吗?',
- cancelText: '取消',
- confirmText: '确定',
- success: (e) => {
- if (e.confirm) {
- uni.hideTabBarRedDot({
- index:3
- })
- uni.clearStorageSync();
- that.$store.commit('logout')
- that.$api.logout()
- uni.navigateTo({
- url: `/pages/public/login`
- })
- }
- }
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- page{
- background-color: #F5F6FA;
- }
- .container {
- padding: 10px 0 0px;
- }
- .headPortrait {
- width: 100%;
- height: 52px;
- margin-top: 15px;
- background-color: #FFFFFF;
- border-radius: 6px;
- // justify-content: flex-end;
- }
- .title {
- font-size: 16px;
- line-height: 50px;
- font-weight: 600;
- margin-left: 10px;
- }
- .pictures {
- justify-content: flex-end;
- width: 35px;
- height: 35px;
- background-color: #E0FAF6;
- border-radius: 18px;
- }
- .picture {
- width: 35px;
- height: 35px;
- }
- .arrow {
- margin-left: 15px;
- width: 8px;
- height: 12px;
- // justify-content: flex-end
- }
- .username{
- line-height: 50px;
- color: #6D6D72;
- }
- .sign{
- width: 18px;
- height: 18px;
- top: 4px;
- margin-right: 6px;
- }
- .cu-list>.cu-item:after{
- border:none;
- }
- .exitloginwrap{
- position:fixed;
- bottom:0;
- left:0;
- width:100%;
- padding-bottom:20px;
- }
- .exitlogin{
- width:90%;
- background:#fff;
- border-radius:30px;
- color:#FB1E1E;
- font-size:17px;
- }
- .exitlogin:after{
- border:none;
- }
- </style>
|