app验收反馈
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
<template>
|
||||
<Cn-page :loading='loading'>
|
||||
<view slot='body'>
|
||||
<view class='change-name'>
|
||||
<Cn-page :loading="loading">
|
||||
<view slot="body">
|
||||
<view class="change-name">
|
||||
<view class="content">
|
||||
<uni-easyinput type="text" v-model="name" placeholder="请输入昵称" />
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item " @click="submit"> 提交 </view>
|
||||
<view class="btn-wrap-item" @click="submit"> 提交 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import { apiUpdateUser } from '@/common/api/user'
|
||||
export default {
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
// 表单数据
|
||||
@@ -22,20 +23,36 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit () {
|
||||
console.log(this.name)
|
||||
uni.navigateBack()
|
||||
submit() {
|
||||
apiUpdateUser({
|
||||
name: this.name,
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none',
|
||||
})
|
||||
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
userInfo.nickname = this.name
|
||||
uni.setStorageSync(this.$cacheKey.userInfo, userInfo)
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.name = uni.getStorageSync(this.$cacheKey.userInfo).nickname
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
<style lang="scss">
|
||||
.change-name {
|
||||
padding: 34rpx;
|
||||
padding: 34rpx;
|
||||
|
||||
.content {
|
||||
margin-bottom: 20rpx;
|
||||
padding: 34rpx;
|
||||
padding: 34rpx;
|
||||
background: $uni-theme-white;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
@@ -58,4 +75,4 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user