新增签名。
This commit is contained in:
parent
5844d45e65
commit
b147206385
@ -17,13 +17,24 @@
|
||||
<view class="left">
|
||||
昵称设置
|
||||
</view>
|
||||
<view class="right" @click="toName">
|
||||
<view class="right" @click="toName('nc')">
|
||||
<!-- <u--input color="#000000" v-model="niName" placeholder="请输入昵称" disabled border="none"
|
||||
inputAlign="right"></u--input> -->
|
||||
<text>{{niName}}</text>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<view class="left">
|
||||
签名
|
||||
</view>
|
||||
<view class="right" @click="toName('qm')">
|
||||
<!-- <u--input color="#000000" v-model="niName" placeholder="请输入昵称" disabled border="none"
|
||||
inputAlign="right"></u--input> -->
|
||||
<text>{{signature}}</text>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-item" @click="openUrl('/packageB/wallet/add_bank')">
|
||||
<view class="left">
|
||||
银行卡
|
||||
@ -159,7 +170,10 @@
|
||||
border: 'none',
|
||||
fontFamily: "YouSheBiaoTiHei"
|
||||
},
|
||||
//昵称
|
||||
niName: '',
|
||||
//签名
|
||||
signature: '带着热爱,在搭子圈里撒野~',
|
||||
realname: '',
|
||||
gender: '',
|
||||
// ages: '',
|
||||
@ -228,6 +242,7 @@
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
debugger
|
||||
if (options) {
|
||||
this.typeop = options.type;
|
||||
}
|
||||
@ -236,7 +251,8 @@
|
||||
this.niName = userInfo.nickname
|
||||
this.realname = userInfo.username
|
||||
this.avatar = userInfo.avatar
|
||||
this.$refs.datetimePicker.setFormatter(this.formatter)
|
||||
this.signature = userInfo.bio != '' ? userInfo.bio : '带着热爱,在搭子圈里撒野~'
|
||||
// this.$refs.datetimePicker.setFormatter(this.formatter)
|
||||
// this.handelData()
|
||||
// this.getDetail()
|
||||
},
|
||||
@ -259,9 +275,10 @@
|
||||
url: '/packageB/card/index'
|
||||
})
|
||||
},
|
||||
toName(){
|
||||
toName(e){
|
||||
debugger;
|
||||
uni.navigateTo({
|
||||
url: '/packageB/names/index'
|
||||
url: '/packageB/names/index?type='+ e
|
||||
})
|
||||
},
|
||||
getSfInfo() {
|
||||
|
@ -1,12 +1,23 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view style="padding:30rpx;">
|
||||
<view class="nav">
|
||||
<u-navbar :is-back="true" leftIconColor="#000000" :autoBack="true" :bgColor="'#ffffff'" :title="title"
|
||||
></u-navbar>
|
||||
</view>
|
||||
<view style="padding:30rpx;margin-top: 180rpx;" v-if="istype">
|
||||
<view style="display: flex;align-items: center;">
|
||||
<view style="width: 100%;">
|
||||
<input placeholder-class="plasty" placeholder="输入您的昵称" class="input" v-model="form.nickname" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding:30rpx;margin-top: 180rpx;" v-else>
|
||||
<view style="display: flex;align-items: center;">
|
||||
<view style="width: 100%;">
|
||||
<input placeholder-class="plasty" placeholder="输入您的签名" class="input" v-model="form.bio" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn_1" @click="save()">保存</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -15,30 +26,57 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
istype:false,
|
||||
title:"",
|
||||
form: {
|
||||
nickname: '',
|
||||
bio: ''
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.form.nickname = uni.getStorageSync('userInfo').nickname;
|
||||
onLoad(options) {
|
||||
if (options.type == 'nc') {
|
||||
this.istype = true;
|
||||
this.title = '修改昵称'
|
||||
this.form.nickname = uni.getStorageSync('userInfo').nickname;
|
||||
}else{
|
||||
this.istype = false;
|
||||
this.title = '修改签名'
|
||||
this.form.bio = uni.getStorageSync('userInfo').bio;
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
save() {
|
||||
if (this.form.nickname == '') {
|
||||
uni.showToast({
|
||||
title: '请输入昵称',
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
return;
|
||||
if (this.istype) {
|
||||
if (this.form.nickname == '') {
|
||||
uni.showToast({
|
||||
title: '请输入昵称',
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
if (this.form.bio == '') {
|
||||
uni.showToast({
|
||||
title: '请输入签名',
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let nickname = this.form.nickname;
|
||||
let bio = this.form.bio;
|
||||
uni.$u.http
|
||||
.post("/api/user/profile", {
|
||||
nickname: nickname,
|
||||
update_fields: ['nickname']
|
||||
bio: bio,
|
||||
update_fields: ['nickname','bio']
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
@ -53,11 +91,18 @@ export default {
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
uni.setStorageSync('userInfo', {
|
||||
...uni.getStorageSync('userInfo'),
|
||||
nickname: nickname
|
||||
});
|
||||
uni.setStorageSync('niName', nickname);
|
||||
if (this.istype) {
|
||||
uni.setStorageSync('userInfo', {
|
||||
...uni.getStorageSync('userInfo'),
|
||||
nickname: nickname
|
||||
});
|
||||
uni.setStorageSync('niName', nickname);
|
||||
}else{
|
||||
uni.setStorageSync('userInfo', {
|
||||
...uni.getStorageSync('userInfo'),
|
||||
bio: bio
|
||||
});
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
|
@ -314,7 +314,8 @@
|
||||
{
|
||||
"path": "names/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "昵称修改"
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
"path": "wallet/index",
|
||||
|
@ -12,11 +12,11 @@
|
||||
style="display: flex;align-items: center;;margin-bottom: 20rpx;font-weight: 800;font-size: 34rpx;color: #181818;">
|
||||
<view>{{ userName }}</view>
|
||||
<view style="padding-left: 20rpx; height: 35rpx;">
|
||||
<image v-if="shop_auth_info.auth_status==1" src="/static/my/owenr.png" mode="" style="width: 35rpx; height: 35rpx;">
|
||||
<image v-if="shop_auth_info.auth_status == 1" src="/static/my/owenr.png" mode="" style="width: 35rpx; height: 35rpx;">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
<view style="color: #909090; font-size: 24rpx;">带着热爱,在搭子圈里撒野~</view>
|
||||
<view style="color: #909090; font-size: 24rpx;">{{ bio || '带着热爱,在搭子圈里撒野~'}}</view>
|
||||
</view>
|
||||
<image src="../../static/shezhi.png" mode=""
|
||||
style="width: 50rpx; height: 50rpx;position: absolute;right: 0;" @click="clickTop">
|
||||
@ -195,6 +195,7 @@
|
||||
hotList: [],
|
||||
showPopup: false,
|
||||
userName: '请登录',
|
||||
bio:'',
|
||||
actives: 0,
|
||||
pushActives: 0,
|
||||
show: false,
|
||||
@ -753,6 +754,7 @@
|
||||
|
||||
this.showPopup = false
|
||||
this.userName = res.data.user_info.nickname;
|
||||
this.bio = res.data.user_info.bio;
|
||||
this.avatar = res.data.user_info.avatar;
|
||||
this.actives = res.data.activity_info.join_num;
|
||||
this.pushActives = res.data.activity_info.release_num;
|
||||
|
Loading…
x
Reference in New Issue
Block a user