|
@@ -4,31 +4,34 @@
|
|
<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"></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' v-if='!edit' style="font-weight: bold;font-size: 32rpx;">{{userInfo.nickname?userInfo.nickname:'请点击登录'}}</view>
|
|
|
|
- <view v-else> <u--input
|
|
|
|
- placeholder="请输入内容"
|
|
|
|
- border="bottom"
|
|
|
|
- v-model='userInfo.nickname'
|
|
|
|
- clearable
|
|
|
|
- ></u--input></view>
|
|
|
|
- <u-icon v-if='!edit&&userInfo.phone' @click='edit = true' name="edit-pen-fill" color="#eaad1a" size="24"></u-icon>
|
|
|
|
- <u-icon v-if='edit&&userInfo.phone' @click='editNickName' name="checkbox-mark" color="#eaad1a" size="24"></u-icon>
|
|
|
|
|
|
+ <view @click='login' style="font-weight: bold;font-size: 32rpx;">
|
|
|
|
+ {{userInfo.nickname?userInfo.nickname:'请点击登录'}}
|
|
|
|
+ </view>
|
|
|
|
+ <!-- <view v-else>
|
|
|
|
+ <u--input placeholder="请输入内容" border="bottom" v-model='userInfo.nickname'
|
|
|
|
+ clearable></u--input>
|
|
|
|
+ </view> -->
|
|
|
|
+ <!-- <u-icon v-if='!edit&&userInfo.phone' @click='edit = true' name="edit-pen-fill"
|
|
|
|
+ color="#eaad1a" size="24"></u-icon>
|
|
|
|
+ <u-icon v-if='edit&&userInfo.phone' @click='editNickName' name="checkbox-mark"
|
|
|
|
+ color="#eaad1a" size="24"></u-icon> -->
|
|
</view>
|
|
</view>
|
|
<view>{{userInfo.phone1}}</view>
|
|
<view>{{userInfo.phone1}}</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
|
|
+ </view>
|
|
<view>
|
|
<view>
|
|
<u-icon @click='todetail' name="bell" color="#eaad1a" size="28"></u-icon>
|
|
<u-icon @click='todetail' name="bell" color="#eaad1a" size="28"></u-icon>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
<view class="wrap">
|
|
<view class="wrap">
|
|
- <!-- <view class='orderList'>
|
|
|
|
|
|
+ <!-- <view class='orderList'>
|
|
<view class="orderItem align-item-center">
|
|
<view class="orderItem align-item-center">
|
|
<view style='position:relative;'>
|
|
<view style='position:relative;'>
|
|
<u-icon name="home-fill" color="#2979ff" size="28"></u-icon>
|
|
<u-icon name="home-fill" color="#2979ff" size="28"></u-icon>
|
|
@@ -66,11 +69,7 @@
|
|
isLink
|
|
isLink
|
|
url="/pages/componentsB/tag/tag"
|
|
url="/pages/componentsB/tag/tag"
|
|
></u-cell> -->
|
|
></u-cell> -->
|
|
- <u-cell
|
|
|
|
- title="我的发布"
|
|
|
|
- isLink
|
|
|
|
- url="/pageA/my/mypublish"
|
|
|
|
- ></u-cell>
|
|
|
|
|
|
+ <u-cell title="我的发布" isLink url="/pageA/my/mypublish"></u-cell>
|
|
<!-- <u-cell
|
|
<!-- <u-cell
|
|
title="房源发布"
|
|
title="房源发布"
|
|
isLink
|
|
isLink
|
|
@@ -91,52 +90,51 @@
|
|
isLink
|
|
isLink
|
|
url="/pages/componentsB/badge/badge"
|
|
url="/pages/componentsB/badge/badge"
|
|
></u-cell> -->
|
|
></u-cell> -->
|
|
- <u-cell
|
|
|
|
- title="联系客服"
|
|
|
|
- isLink
|
|
|
|
- url="/pages/componentsB/badge/badge"
|
|
|
|
- ></u-cell>
|
|
|
|
- <u-cell
|
|
|
|
- :border='false'
|
|
|
|
- title="去商家端"
|
|
|
|
- isLink
|
|
|
|
- url="/pageA/enter/enter"
|
|
|
|
- ></u-cell>
|
|
|
|
|
|
+ <view class="kf">
|
|
|
|
+ <button class="left-btn" open-type='contact'>联系客服</button>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <u-cell :border='false' title="去商家端" isLink url="/pageA/enter/enter"></u-cell>
|
|
</u-cell-group>
|
|
</u-cell-group>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view v-if='userInfo.nickname' class='quit-login' @click='quitLogin'>退出登录</view>
|
|
|
|
|
|
+ <view v-if='userInfo.nickname' class='quit-login' @click='quitLogin'>退出账号</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
|
|
|
|
- import loginPopUp from "@/components/loginPopUp/index.vue"
|
|
|
|
|
|
+ var that;
|
|
|
|
+ import uploadImage from '@/components/ossutil/uploadFile.js';
|
|
|
|
+ import loginPopUp from "@/components/loginPopUp/index.vue"
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
loginPopUp
|
|
loginPopUp
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- edit:false,
|
|
|
|
- offset:['-2','-27%'],
|
|
|
|
- type:"warning",
|
|
|
|
- value:'88',
|
|
|
|
|
|
+ edit: false,
|
|
|
|
+ offset: ['-2', '-27%'],
|
|
|
|
+ type: "warning",
|
|
|
|
+ value: '88',
|
|
title: 'Hello',
|
|
title: 'Hello',
|
|
- userInfo:{},
|
|
|
|
|
|
+ userInfo: {},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
that = this
|
|
that = this
|
|
},
|
|
},
|
|
- onShow(){
|
|
|
|
- if(!uni.getStorageSync("userInfo").phone){
|
|
|
|
|
|
+ onShow() {
|
|
|
|
+ this.userInfo = uni.getStorageSync("userInfo")
|
|
|
|
+ if (!this.userInfo.phone) {
|
|
this.$refs.loginpopup.open()
|
|
this.$refs.loginpopup.open()
|
|
- }else{
|
|
|
|
- this.userInfo = uni.getStorageSync("userInfo")
|
|
|
|
- var reg = /1(\d{2})\d{4}(\d{4})/g;
|
|
|
|
- this.userInfo.phone1 = this.userInfo.phone.replace(reg,"1$1****$2");
|
|
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ var reg = /1(\d{2})\d{4}(\d{4})/g;
|
|
|
|
+ this.userInfo.phone1 = this.userInfo.phone.replace(reg, "1$1****$2");
|
|
console.log(this.userInfo)
|
|
console.log(this.userInfo)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -174,27 +172,73 @@
|
|
curPage.onReady()
|
|
curPage.onReady()
|
|
// 执行刷新
|
|
// 执行刷新
|
|
},
|
|
},
|
|
- editNickName(){
|
|
|
|
|
|
+ editNickName() {
|
|
this.$request.baseRequest('admin.unimall.commonUserInfo', 'update', {
|
|
this.$request.baseRequest('admin.unimall.commonUserInfo', 'update', {
|
|
- commonUserInfo:JSON.stringify(this.userInfo)
|
|
|
|
|
|
+ commonUserInfo: JSON.stringify(this.userInfo)
|
|
}, failres => {
|
|
}, failres => {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: "none",
|
|
icon: "none",
|
|
title: failres.errmsg,
|
|
title: failres.errmsg,
|
|
duration: 3000
|
|
duration: 3000
|
|
- });
|
|
|
|
|
|
+ });
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- uni.setStorageSync("userInfo",this.userInfo)
|
|
|
|
- this.edit=false
|
|
|
|
|
|
+ uni.setStorageSync("userInfo", this.userInfo)
|
|
|
|
+ this.edit = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- login(){
|
|
|
|
- if(!uni.getStorageSync("userInfo").phone){
|
|
|
|
|
|
+ login() {
|
|
|
|
+ if (!uni.getStorageSync("userInfo").phone) {
|
|
this.$refs.loginpopup.open()
|
|
this.$refs.loginpopup.open()
|
|
- }else{
|
|
|
|
-
|
|
|
|
|
|
+ } else {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/my/editNickName'
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ exit() {
|
|
|
|
+ uni.setStorageSync("userInfo", {})
|
|
|
|
+ this.userInfo = {}
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
+ },
|
|
|
|
+ editHead() {
|
|
|
|
+ if (this.userInfo.phone) {
|
|
|
|
+ uni.chooseImage({
|
|
|
|
+ count: 1,
|
|
|
|
+ sizeType: ['original', 'compressed'],
|
|
|
|
+ success: function(res) {
|
|
|
|
+ uploadImage(res.tempFilePaths[0], 'cardImages/',
|
|
|
|
+ result => {
|
|
|
|
+ that.userInfo.head = result
|
|
|
|
+ that.$request.baseRequest('admin.unimall.commonUserInfo', 'update', {
|
|
|
|
+ commonUserInfo: JSON.stringify(that.userInfo)
|
|
|
|
+ }, failres => {
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "none",
|
|
|
|
+ title: failres.errmsg,
|
|
|
|
+ duration: 3000
|
|
|
|
+ });
|
|
|
|
+ }).then(res => {
|
|
|
|
+ uni.setStorageSync("userInfo", that.userInfo)
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "success",
|
|
|
|
+ title: '修改成功!',
|
|
|
|
+ duration: 2000,
|
|
|
|
+ complete: function() {
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url: "/pages/my/my"
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.showAuthorizePhone = true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -229,33 +273,72 @@
|
|
width:92vw;
|
|
width:92vw;
|
|
padding:0 20rpx;
|
|
padding:0 20rpx;
|
|
}
|
|
}
|
|
- .orderList{
|
|
|
|
- display:flex;
|
|
|
|
|
|
+
|
|
|
|
+ .orderList {
|
|
|
|
+ display: flex;
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
- .orderItem{
|
|
|
|
- width:48%;
|
|
|
|
- padding:20rpx;
|
|
|
|
- background:#E5EBFF;
|
|
|
|
- box-sizing:border-box;
|
|
|
|
- margin:5rpx;
|
|
|
|
- border-radius:10rpx;
|
|
|
|
- display:flex;
|
|
|
|
|
|
+
|
|
|
|
+ .orderItem {
|
|
|
|
+ width: 48%;
|
|
|
|
+ padding: 20rpx;
|
|
|
|
+ background: #E5EBFF;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ margin: 5rpx;
|
|
|
|
+ border-radius: 10rpx;
|
|
|
|
+ display: flex;
|
|
}
|
|
}
|
|
- /deep/.u-badge{
|
|
|
|
- z-index:50;
|
|
|
|
|
|
+
|
|
|
|
+ /deep/.u-badge {
|
|
|
|
+ z-index: 50;
|
|
}
|
|
}
|
|
- .orderName{
|
|
|
|
- margin-left:20rpx;
|
|
|
|
|
|
+
|
|
|
|
+ .orderName {
|
|
|
|
+ margin-left: 20rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .user{
|
|
|
|
- background:#fff;
|
|
|
|
- width:100%;
|
|
|
|
- padding:10rpx 20rpx;
|
|
|
|
|
|
+
|
|
|
|
+ .user {
|
|
|
|
+ background: #fff;
|
|
|
|
+ width: 100%;
|
|
|
|
+ padding: 10rpx 20rpx;
|
|
}
|
|
}
|
|
- .userWrap{
|
|
|
|
- width:92vw;
|
|
|
|
- margin:0 auto;
|
|
|
|
|
|
+
|
|
|
|
+ .userWrap {
|
|
|
|
+ width: 92vw;
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .kf {
|
|
|
|
+ border-bottom-width: 1px;
|
|
|
|
+ border-bottom-style: solid;
|
|
|
|
+ width: 100%;
|
|
|
|
+ border-color: #d6d7d9;
|
|
|
|
+ padding: 20rpx;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .left-btn {
|
|
|
|
+ padding: 0;
|
|
|
|
+ margin: 0;
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
+ height: 42rpx;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ margin-left: 10rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .left-btn:after {
|
|
|
|
+ border: none !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .exit {
|
|
|
|
+ width: 100vw;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 20rpx;
|
|
}
|
|
}
|
|
.quit-login{
|
|
.quit-login{
|
|
background:#fff;
|
|
background:#fff;
|
|
@@ -265,4 +348,5 @@
|
|
margin:10rpx 20rpx;
|
|
margin:10rpx 20rpx;
|
|
border-radius:10rpx;
|
|
border-radius:10rpx;
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+
|
|
|
|
+</style>
|