qa-prevention-gwj-first-app/pages/my/home.vue

112 lines
2.7 KiB
Vue
Raw Permalink Normal View History

2023-11-07 09:43:46 +08:00
<template>
<view>
<cu-custom bgColor="bg-gradual-blueness">
<block slot="content">我的</block>
</cu-custom>
<view class="my-avatar">
<view class="cu-avatar xl round margin-left" :style="'background-image: url('+userPhoto+');'"></view>
<view class="right">
<view class="f30 text-bold">{{loginUser.NAME}}</view>
<view class="mt10">
<text class="text-grey">手机号</text>
<text class="text-grey">{{loginUser.USERNAME}}</text>
</view>
</view>
</view>
<view class="cu-list menu margin-top">
<view class="cu-item arrow">
<navigator class="content" hover-class="none" url="/pages/my/set/set">
<text class="text-semi">设置</text>
</navigator>
</view>
<view class="cu-item arrow">
<navigator class="content" hover-class="none" url="/pages/my/feedback/feedback">
<text class="text-semi">问题反馈</text>
</navigator>
</view>
<view class="cu-item arrow">
<navigator class="content" hover-class="none" url="/pages/my/promise/promise">
<text class="text-semi">安全承诺</text>
</navigator>
</view>
<view class="cu-item arrow">
<navigator class="content" hover-class="none" url="/pages/my/yhxy/yhxy">
<text class="text-semi">用户协议</text>
</navigator>
</view>
<view class="cu-item arrow">
<navigator class="content" hover-class="none" url="/pages/my/ysxy/ysxy">
<text class="text-semi">隐私协议</text>
</navigator>
</view>
<view class="cu-item arrow">
<navigator class="content" hover-class="none" url="/pages/my/about/about">
<text class="text-semi">关于</text>
</navigator>
</view>
</view>
</view>
</template>
<script>
import {
basePath,loginUser,baseImgPath
} from '@/common/tool.js';
export default {
data() {
return {
loginUser :'',
userPhoto :'',
};
},
mounted() {
this.loginUser = loginUser;
if(this.loginUser.USERNAME){
this.getUserInfo();
}
},
methods: {
getUserInfo(){
var _this = this;
uni.request({
url: basePath+"/app/user/getUserPhoto", //提交接口
method: 'POST',
dataType:'json',
header:{
'Content-type':'application/x-www-form-urlencoded'
},
data: {
USERNAME:this.loginUser.USERNAME,
},
success: (res) => {
if('success' == res.data.result){
_this.userPhoto =basePath +"/"+ res.data.userPhoto;
}else{
uni.showToast({
title: res.data.message,
duration: 2000
});
}
}
});
},
},
}
</script>
<style>
.my-avatar{
background-color: #fff;
padding: 40upx 20upx;
display: flex;
align-items: center;
}
.my-avatar .right{
margin-left: 30upx;
}
.cu-list.menu>.cu-item.arrow {
padding-right: 35px;
}
</style>