|
@@ -4,18 +4,19 @@
|
|
<view class='flex userWrap justify-space-between'>
|
|
<view class='flex userWrap justify-space-between'>
|
|
<view class='flex'>
|
|
<view class='flex'>
|
|
<view style='margin-right:20rpx;'>
|
|
<view style='margin-right:20rpx;'>
|
|
- <u--image width='60' height='60' :src="userInfo.head" shape="circle" @click="editHead"></u--image>
|
|
|
|
|
|
+ <u--image width='60' height='60' :src="userInfo.head" shape="circle"
|
|
|
|
+ @click="editHead"></u--image>
|
|
</view>
|
|
</view>
|
|
<view>
|
|
<view>
|
|
<view class='flex'>
|
|
<view class='flex'>
|
|
<view @click='login' style="font-weight: bold;font-size: 32rpx;">
|
|
<view @click='login' style="font-weight: bold;font-size: 32rpx;">
|
|
{{userInfo.nickname?userInfo.nickname:'请点击登录'}}
|
|
{{userInfo.nickname?userInfo.nickname:'请点击登录'}}
|
|
</view>
|
|
</view>
|
|
- <!-- <view v-else>
|
|
|
|
|
|
+ <!-- <view v-else>
|
|
<u--input placeholder="请输入内容" border="bottom" v-model='userInfo.nickname'
|
|
<u--input placeholder="请输入内容" border="bottom" v-model='userInfo.nickname'
|
|
clearable></u--input>
|
|
clearable></u--input>
|
|
</view> -->
|
|
</view> -->
|
|
- <!-- <u-icon v-if='!edit&&userInfo.phone' @click='edit = true' name="edit-pen-fill"
|
|
|
|
|
|
+ <!-- <u-icon v-if='!edit&&userInfo.phone' @click='edit = true' name="edit-pen-fill"
|
|
color="#eaad1a" size="24"></u-icon>
|
|
color="#eaad1a" size="24"></u-icon>
|
|
<u-icon v-if='edit&&userInfo.phone' @click='editNickName' name="checkbox-mark"
|
|
<u-icon v-if='edit&&userInfo.phone' @click='editNickName' name="checkbox-mark"
|
|
color="#eaad1a" size="24"></u-icon> -->
|
|
color="#eaad1a" size="24"></u-icon> -->
|
|
@@ -97,13 +98,16 @@
|
|
</u-cell-group>
|
|
</u-cell-group>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="exit" @click="exit" v-if="userInfo.phone">
|
|
|
|
+ 退出账号
|
|
|
|
+ </view>
|
|
<login-pop-up ref='loginpopup' :content='"手机登录后才能查看我的哦~"'></login-pop-up>
|
|
<login-pop-up ref='loginpopup' :content='"手机登录后才能查看我的哦~"'></login-pop-up>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
var that;
|
|
var that;
|
|
- import uploadImage from '@/components/ossutil/uploadFile.js';
|
|
|
|
|
|
+ import uploadImage from '@/components/ossutil/uploadFile.js';
|
|
import loginPopUp from "@/components/loginPopUp/index.vue"
|
|
import loginPopUp from "@/components/loginPopUp/index.vue"
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -123,10 +127,11 @@
|
|
that = this
|
|
that = this
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
- if (!uni.getStorageSync("userInfo").phone) {
|
|
|
|
|
|
+ this.userInfo = uni.getStorageSync("userInfo")
|
|
|
|
+ if (!this.userInfo.phone) {
|
|
this.$refs.loginpopup.open()
|
|
this.$refs.loginpopup.open()
|
|
} else {
|
|
} else {
|
|
- this.userInfo = uni.getStorageSync("userInfo")
|
|
|
|
|
|
+
|
|
var reg = /1(\d{2})\d{4}(\d{4})/g;
|
|
var reg = /1(\d{2})\d{4}(\d{4})/g;
|
|
this.userInfo.phone1 = this.userInfo.phone.replace(reg, "1$1****$2");
|
|
this.userInfo.phone1 = this.userInfo.phone.replace(reg, "1$1****$2");
|
|
console.log(this.userInfo)
|
|
console.log(this.userInfo)
|
|
@@ -156,6 +161,11 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ exit() {
|
|
|
|
+ uni.setStorageSync("userInfo", {})
|
|
|
|
+ this.userInfo = {}
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
+ },
|
|
editHead() {
|
|
editHead() {
|
|
if (this.userInfo.phone) {
|
|
if (this.userInfo.phone) {
|
|
uni.chooseImage({
|
|
uni.chooseImage({
|
|
@@ -287,4 +297,13 @@
|
|
.left-btn:after {
|
|
.left-btn:after {
|
|
border: none !important;
|
|
border: none !important;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .exit {
|
|
|
|
+ width: 100vw;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 20rpx;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|