|
@@ -10,7 +10,11 @@
|
|
|
>
|
|
|
<view class="title">{{ item.title }}</view>
|
|
|
<view :class="['text-right', item.hideArrow && 'hide-arrow']">
|
|
|
- {{ userInfo[item.textProp] || '' }}
|
|
|
+ <input class="inp" @input="inpfn" v-if="item.textProp == 'nickname'" v-model="userInfo[item.textProp]" type="text" />
|
|
|
+ <block v-else>
|
|
|
+ {{ userInfo[item.textProp] || '' }}
|
|
|
+ </block>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -21,6 +25,9 @@
|
|
|
<script>
|
|
|
const storage = require('@/common/storage.js')
|
|
|
import { QINIU_URL, defaultHeadImg } from '@/common/constant'
|
|
|
+ var config = require('../../common/config_gyq.js');
|
|
|
+ var http = require('../../common/request');
|
|
|
+ const common = require('../../common/common.js');
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -42,6 +49,20 @@
|
|
|
user_token && this.loadUserInfo()
|
|
|
},
|
|
|
methods: {
|
|
|
+ inpfn(e){
|
|
|
+ console.log(e.detail.value)
|
|
|
+ },
|
|
|
+ editAvatarFn(){
|
|
|
+ common.upLoadImgQiNiu( (imgUrl)=> {
|
|
|
+ console.log(imgUrl)
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async editUserInfoFn(){
|
|
|
+ let {data} = await http.postApi(config.API_USER_MODIFY_USER_INFO,{
|
|
|
+ nickname:this.userInfo.nickname,
|
|
|
+ head_img:this.userInfo.head_img,
|
|
|
+ })
|
|
|
+ },
|
|
|
loadUserInfo() {
|
|
|
const userInfo = storage.getUserInfoData()
|
|
|
console.log('userInfo', userInfo)
|
|
@@ -73,7 +94,11 @@
|
|
|
|
|
|
<style lang="scss">
|
|
|
@import "@/libs/css/layout.scss";
|
|
|
-
|
|
|
+ .inp{
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #060809;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
.set-page {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|