Browse Source

修改昵称

achao 2 years ago
parent
commit
13a014a831

+ 4 - 1
xiaochengxu/pages/cardHolder/cardHolder.vue

@@ -334,7 +334,8 @@
 							</button>
 						</u-form-item>
 						<u-form-item label="昵称">
-							<input type="nickname" :value="userInfo.nickname" class="weui-input" @blur="userNameInput" placeholder="请输入昵称"/>
+								<u-input v-model="userInfo.nickname" class="weui-input" @blur="userNameInput" placeholder="请输入昵称" border="false"/>
+							<!-- <input type="nickname" :value="userInfo.nickname" class="weui-input" @blur="userNameInput" placeholder="请输入昵称"/> -->
 						</u-form-item>
 					</u-form>
 				</div>
@@ -352,6 +353,7 @@
 </template>
 
 <script>
+	var that;
 	import Poster from '../../components/zhangyuhao-poster/Poster.vue'
 	import { pathToBase64, base64ToPath } from 'image-tools'
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
@@ -425,6 +427,7 @@
 
 		},
 		onLoad: function(options) {
+			that = this
 			console.log(uni.getLaunchOptionsSync().scene, 1011)
 			if (uni.getStorageSync("userInfo").phone) {
 				this.userInfo = uni.getStorageSync("userInfo")

+ 1 - 0
xiaochengxu/pages/cardHolder/scanCodeAddCard.vue

@@ -228,5 +228,6 @@
 		justify-content: space-between;
 		// padding: 20rpx;
 		width: 100vw;
+		height: auto;
 	}
 </style>

+ 1 - 0
xiaochengxu/pages/circle/circle.vue

@@ -330,5 +330,6 @@
 		position: fixed;
 		bottom: 26rpx;
 		right: 26rpx;
+		height: auto;
 	}
 </style>

+ 86 - 0
xiaochengxu/pages/mySet/editNickName.vue

@@ -0,0 +1,86 @@
+<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('commonUserApp', 'edit', {
+					commonUserInfo: JSON.stringify(this.userInfo)
+				}, failres => {
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					this.userInfo = res.data
+					uni.setStorageSync("userInfo", this.userInfo)
+					let params = {
+						type: 'success',
+						message: "修改成功",
+						url: '/pages/mySet/mySet'
+					}
+					this.$refs.uToast.show({
+						...params,
+						complete() {
+							params.url && uni.switchTab({
+								url: params.url
+							})
+						}
+					})
+				})
+			}
+		}
+	}
+</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: rgba(17, 34, 83, 1);
+		text-align: center;
+		font-size: 36rpx;
+
+	}
+</style>

+ 13 - 1
xiaochengxu/pages/mySet/mySet.vue

@@ -94,6 +94,11 @@
 						type: "contactCustomer",
 						src: '../../static/imgs/mySet/kf.png'
 					},
+					{
+						name: "修改昵称",
+						type: 'editNickName',
+						src: '../../static/imgs/mySet/set.png'
+					},
 					{
 						name: "设置",
 						type: 'set',
@@ -102,7 +107,11 @@
 				]
 			};
 		},
-		onShow() {
+		beforeDestroy(){
+			this.show=false
+		},
+		
+		onLoad() {
 			if (uni.getStorageSync("userInfo").phone) {
 				this.userInfo = uni.getStorageSync("userInfo")
 				this.$request.baseRequest('admin.unimall.cardManagementInfo', 'list', {
@@ -493,6 +502,7 @@
 			width: 124rpx;
 			border-radius: 50%;
 			margin-right: 32rpx;
+			height: auto;
 		}
 
 		.position {
@@ -500,6 +510,7 @@
 			.right-img {
 				width: 44rpx;
 				margin-left: 40rpx;
+				height: auto;
 			}
 		}
 	}
@@ -515,6 +526,7 @@
 		.nav-img {
 			width: 32rpx;
 			margin-right: 20rpx;
+			height: auto;
 		}
 
 		.row {