|
@@ -1,21 +1,102 @@
|
|
<template>
|
|
<template>
|
|
- <view>
|
|
|
|
- <button @click="loginOut">退出登录</button>
|
|
|
|
- <button @click="logOff">注销</button>
|
|
|
|
|
|
+ <view class="container">
|
|
|
|
+ <view class="uesrInfo">
|
|
|
|
+ <view class="userPhoto">
|
|
|
|
+ <image class="img" :src="userInfo.avatar"></image>
|
|
|
|
+ <uni-file-picker
|
|
|
|
+ ref="picker"
|
|
|
|
+ class="picker"
|
|
|
|
+ limit="1"
|
|
|
|
+ mode="list"
|
|
|
|
+ file-mediatype="image"
|
|
|
|
+ @select="select"
|
|
|
|
+ @progress="progress"
|
|
|
|
+ @success="success"
|
|
|
|
+ @fail="fail"
|
|
|
|
+ >
|
|
|
|
+ <image class="icon" src="https://mall.rongtongh.cn/storage/img/mine/icon1.png" mode="widthFix"></image>
|
|
|
|
+ </uni-file-picker>
|
|
|
|
+ </view>
|
|
|
|
+ <uni-list class="list">
|
|
|
|
+ <uni-list-item class="listItem" title="用户昵称" :rightText="userInfo.nickname" showArrow clickable @click="onClick" />
|
|
|
|
+ <uni-list-item class="listItem" title="手机号" :rightText="userInfo.mobile" clickable @click="onClick">
|
|
|
|
+ <template v-slot:footer>
|
|
|
|
+ <view class="right">
|
|
|
|
+ <button class="m_button button" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">
|
|
|
|
+ <span v-if="userInfo.mobile">更换</span>
|
|
|
|
+ <span v-else>绑定</span>
|
|
|
|
+ </button>
|
|
|
|
+ <span>{{userInfo.mobile}}</span>
|
|
|
|
+ </view>
|
|
|
|
+ </template>
|
|
|
|
+ </uni-list-item>
|
|
|
|
+ </uni-list>
|
|
|
|
+ </view>
|
|
|
|
+ <!-- <uni-popup ref="inputDialog" type="dialog">
|
|
|
|
+ <uni-popup-dialog
|
|
|
|
+ ref="inputClose"
|
|
|
|
+ mode="input"
|
|
|
|
+ title="修改用户昵称" :
|
|
|
|
+ value=""
|
|
|
|
+ placeholder="请输入用户昵称"
|
|
|
|
+ @confirm="dialogInputConfirm"
|
|
|
|
+ >
|
|
|
|
+ </uni-popup-dialog>
|
|
|
|
+ </uni-popup> -->
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import {
|
|
import {
|
|
- logOffApi
|
|
|
|
|
|
+ logOffApi,
|
|
|
|
+ bindPhoneApi,
|
|
|
|
+ userInfoApi
|
|
} from "@/api/user.js"
|
|
} from "@/api/user.js"
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
-
|
|
|
|
|
|
+ userInfo: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ onShow() {
|
|
|
|
+ this.getUserInfo()
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 获取上传状态
|
|
|
|
+ select(e){
|
|
|
|
+ console.log('选择文件:',e)
|
|
|
|
+ },
|
|
|
|
+ // 获取上传进度
|
|
|
|
+ progress(e){
|
|
|
|
+ console.log('上传进度:',e)
|
|
|
|
+ },
|
|
|
|
+ // 上传成功
|
|
|
|
+ success(e){
|
|
|
|
+ console.log(e, '上传成功')
|
|
|
|
+ },
|
|
|
|
+ // 上传失败
|
|
|
|
+ fail(e){
|
|
|
|
+ console.log('上传失败:',e)
|
|
|
|
+ },
|
|
|
|
+ dialogInputConfirm() {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ getUserInfo() {
|
|
|
|
+ userInfoApi().then(res => {
|
|
|
|
+ this.userInfo = res.data
|
|
|
|
+ console.log(this.userInfo, '用户信息')
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ decryptPhoneNumber(e) {
|
|
|
|
+ console.log(e, 'eeee')
|
|
|
|
+ let params = {
|
|
|
|
+ iv: e.detail.iv,
|
|
|
|
+ encryptedData: e.detail.encryptedData
|
|
|
|
+ }
|
|
|
|
+ bindPhoneApi(params).then(res => {
|
|
|
|
+ console.log(res, 'rrr')
|
|
|
|
+ })
|
|
|
|
+ },
|
|
loginOut() {
|
|
loginOut() {
|
|
wx.removeStorageSync('userInfo')
|
|
wx.removeStorageSync('userInfo')
|
|
wx.removeStorageSync('userId')
|
|
wx.removeStorageSync('userId')
|
|
@@ -51,6 +132,58 @@
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
|
-
|
|
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
+ .uesrInfo {
|
|
|
|
+ background: #fff;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ padding: 0 15px;
|
|
|
|
+ }
|
|
|
|
+ .userPhoto {
|
|
|
|
+ width: 74px;
|
|
|
|
+ height: 74px;
|
|
|
|
+ position: relative;
|
|
|
|
+ margin: 30px auto 30px auto;
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ .img {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ background: #dedede;
|
|
|
|
+ }
|
|
|
|
+ .icon {
|
|
|
|
+ width: 20px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 0;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .list {
|
|
|
|
+ // margin: 0 10px;
|
|
|
|
+ }
|
|
|
|
+ .right {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ }
|
|
|
|
+ .button {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ font-size: 11px;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ width: 34px;
|
|
|
|
+ height: 22px;
|
|
|
|
+ line-height: 22px;
|
|
|
|
+ padding: 0;
|
|
|
|
+ margin-right: 5px;
|
|
|
|
+ }
|
|
|
|
+</style>
|
|
|
|
+<style scoped>
|
|
|
|
+ .listItem >>> .uni-list-item__extra-text {
|
|
|
|
+ color: #000;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ }
|
|
|
|
+ .userPhoto >>> .uni-file-picker__lists {
|
|
|
|
+ display: none !important;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|