123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <template>
- <view class="content">
- <view class="row1 flex">
- <view class="left">
- 昵称
- </view>
- <u-input v-model="userInfo.nickname" :border="false" focus class="input" />
- </view>
- <view class="row2">
- <view class="btn" @click="edit">
- 保存
- </view>
- </view>
- <u-toast ref="uToast"></u-toast>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- value: '',
- userInfo: {
- nickname: ''
- }
- };
- },
- onLoad() {
- this.userInfo = uni.getStorageSync("userInfo")
- },
- methods: {
- edit() {
- this.$request.baseRequest('admin.unimall.commonUserInfo', 'update', {
- commonUserInfo: JSON.stringify(this.userInfo)
- }, failres => {
- uni.hideLoading()
- uni.showToast({
- icon:"none",
- title: failres.errmsg,
- duration: 3000
- });
- }).then(res => {
- this.userInfo = res.data
- uni.setStorageSync("userInfo", this.userInfo)
- uni.showToast({
- icon:"success",
- title: '修改成功!',
- duration: 2000,
- complete:function(){
- uni.switchTab({
- url: "/pages/my/my"
- })
- }
- })
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .row1 {
- background: #fff;
- padding: 20rpx;
- }
- .input {
- font-size: 28rpx;
- }
- .row2 {
- padding: 20rpx;
- }
- .btn {
- color: #fff;
- padding: 20rpx;
- border-radius: 8px;
- background: #eaad1a;
- text-align: center;
- font-size: 36rpx;
- }
- </style>
|