ltx529596 4 years ago
parent
commit
d2858efae1

+ 5 - 2
src/pages/index/index.vue

@@ -22,9 +22,11 @@
 				</view>
 				<view class="user">
 					<view class="user-left">
-						<image :src="userInfo.avatarUrl" mode="" class="usericon"></image>
+            <open-data type="userAvatarUrl" class="usericon"></open-data>
+						<!-- <image :src="userInfo.avatarUrl" mode="" class="usericon"></image> -->
 						<view class="message">
-							<view class="name">{{userInfo.nickName}}</view>
+							<!-- <view class="name">{{userInfo.nickName}}</view> -->
+              <open-data type="userNickName" class="name"></open-data>
 							<view class="tele"></view>
 						</view>
 					</view>
@@ -946,6 +948,7 @@ export default {
         height: 100upx;
         border-radius: 50%;
         background-color: #ffffff;
+        overflow: hidden;
       }
 
       .message {

+ 55 - 9
src/pages/index/setting/changepassword.vue

@@ -1,18 +1,18 @@
 <!-- 修改密码 -->
 <template>
   <view class="changepassword">
-    <view class="goback" @tap="navBack"
+    <view class="goback" @tap="toBack"
       ><image src="../../../static/images/backicon.png" class="backicon"></image
     ></view>
     <view class="title">修改密码</view>
     <view class="input-item cellphone">
-      <input type="text" placeholder="请输入旧密码" />
+      <input type="password" v-model="oldPwd" placeholder="请输入旧密码" />
     </view>
     <view class="input-item imgcode">
-      <input type="text" class="inputcode" placeholder="请输入新密码" />
+      <input type="password" class="inputcode" v-model="newPwd" placeholder="请输入新密码" />
     </view>
     <view class="input-item sellcode">
-      <input type="text" class="inputcode" placeholder="再次输入旧密码" />
+      <input type="password" class="inputcode" v-model="reNewPwd" placeholder="再次输入新密码" />
     </view>
     <view class="btn-warp">
       <view class="btn" @tap="next">确认</view>
@@ -25,17 +25,63 @@ export default {
   name: 'changepassword',
   data() {
     //这里存放数据
-    return {};
+    return {
+      oldPwd:'',
+      newPwd:'',
+      reNewPwd:''
+    };
   },
   onLoad() {},
   //方法集合
   methods: {
     // 返回上一页
-    navBack() {
-      this.$mRouter.back();
+    toBack() {
+      uni.navigateTo({url:'/pages/setting/setting'})
     },
-    next() {
-      console.log(1);
+    async next() {
+      if(this.oldPwd){
+				if(this.newPwd){
+					if(this.reNewPwd){
+            if(this.newPwd == this.reNewPwd){
+              await this.$http.post('/WxApplet/updatePwd', {
+                pwd:this.oldPwd,
+                newPwd:this.newPwd
+              }).then(async res => {
+                console.log(res);	
+                if(res.code == 200){
+                  this.$mRouter.push({ route: '/pages/public/login' });
+                }else{
+                  uni.showToast({
+                    title: res.msg,
+                    icon: 'none'
+                  });
+                }							
+              });
+            }else{
+              uni.showToast({
+                title: '两次密码不一致',
+                icon: 'none'
+              });
+            }
+						
+					}else{
+						uni.showToast({
+							title: '请再次输入新密码',
+							icon: 'none'
+						});
+					}
+				}else{
+					uni.showToast({
+						title: '请输入新密码',
+						icon: 'none'
+					});
+				}
+			}else{
+				uni.showToast({
+					title: '请输入旧密码',
+					icon: 'none'
+				});
+			}
     },
   },
 };

+ 35 - 14
src/pages/public/confirmpassword.vue

@@ -39,24 +39,45 @@ export default {
 		},
 		// 确认进入下一步
 		async next() {
-			await this.$http.post('/WxApplet/findPwd/finPwdSubmit', {
-				pwd:this.password,
-				newPwd:this.rePassword,
-				uuid:uni.getStorageSync('uuid')
-			}).then(async res => {
-				if(res.code == 200){
-					uni.showToast({
-						title: res.data,
-						icon: 'none'
-					});
-					this.$mRouter.push({ route: '/pages/public/login' });
+			if(this.password){
+				if(this.rePassword){
+					if(this.password == this.rePassword){
+						await this.$http.post('/WxApplet/findPwd/finPwdSubmit', {
+							newPwd:this.rePassword,
+							uuid:uni.getStorageSync('uuid')
+						}).then(async res => {
+						if(res.code == 200){
+							uni.showToast({
+								title: res.data,
+								icon: 'none'
+							});
+							this.$mRouter.push({ route: '/pages/public/login' });
+						}else{
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							});
+						}							
+						});
+					}else{
+						uni.showToast({
+							title: '两次密码不一致',
+							icon: 'none'
+						});
+					}			
 				}else{
 					uni.showToast({
-						title: res.msg,
+						title: '请再次输入新密码',
 						icon: 'none'
 					});
-				}							
-			});
+				}
+			}else{
+				uni.showToast({
+					title: '请输入新密码',
+					icon: 'none'
+				});
+			}
+			
 		}
 	}
 };

+ 2 - 7
src/pages/shop/classify.vue

@@ -52,13 +52,8 @@ export default {
       gradeList: [],
     };
   },
-  filters: {
-    grade(val) {
-      if (!val) {
-        return '无';
-      }
-    },
-  },
+
+     
   onLoad() {
     this.getCustomList();
   },