Browse Source

账户管理页面调整

liusw 8 years ago
parent
commit
5b7efa3ca3

+ 1 - 0
src/main/java/com/uas/platform/b2c/common/account/controller/UserController.java

@@ -1,5 +1,6 @@
 package com.uas.platform.b2c.common.account.controller;
 
+import com.uas.account.util.AccountUtils;
 import com.uas.message.mail.service.MailService;
 import com.uas.message.sms.service.SmsService;
 import com.uas.platform.b2c.common.account.model.*;

+ 1 - 2
src/main/java/com/uas/platform/b2c/common/account/model/SecQuestion.java

@@ -33,8 +33,7 @@ public class SecQuestion implements Serializable {
      */
     @Id
     @Column(name = "sq_id")
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "secquestion_gen")
-    @SequenceGenerator(name = "secquestion_gen", sequenceName = "secquestion_seq", allocationSize = 1)
+    @GeneratedValue
     private Long id;
 
     /**

+ 1 - 2
src/main/java/com/uas/platform/b2c/common/account/model/UserQuestion.java

@@ -28,8 +28,7 @@ public class UserQuestion implements Serializable {
      */
     @Id
     @Column(name = "uq_id")
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "userquestion_gen")
-    @SequenceGenerator(name = "userquestion_gen", sequenceName = "userquestion_seq", allocationSize = 1)
+    @GeneratedValue
     private Long id;
 
     /**

+ 17 - 1
src/main/java/com/uas/platform/b2c/common/account/service/impl/UserQuestionServiceImpl.java

@@ -1,5 +1,6 @@
 package com.uas.platform.b2c.common.account.service.impl;
 
+import com.uas.account.util.AccountUtils;
 import com.uas.platform.b2c.common.account.dao.UserQuestionDao;
 import com.uas.platform.b2c.common.account.model.UserQuestion;
 import com.uas.platform.b2c.common.account.service.UserQuestionService;
@@ -15,7 +16,8 @@ public class UserQuestionServiceImpl implements UserQuestionService {
     private UserQuestionDao userQuestionDao;
 
     @Override
-    public UserQuestion save(UserQuestion userQuestion) {
+    public UserQuestion save(UserQuestion userQuestion){
+        postToAccountCenter(userQuestion);
         return userQuestionDao.save(userQuestion);
     }
 
@@ -23,4 +25,18 @@ public class UserQuestionServiceImpl implements UserQuestionService {
     public List<UserQuestion> findUserQuestionByUserUUOrderBySortAsc(Long userUU) {
         return userQuestionDao.findUserQuestionByUserUUOrderBySortAsc(userUU);
     }
+
+    private void postToAccountCenter(UserQuestion question) {
+        com.uas.account.entity.UserQuestion accountUserQuestion = new com.uas.account.entity.UserQuestion();
+        accountUserQuestion.setAnswer(question.getAnswer());
+        accountUserQuestion.setQuestion(question.getQuestion());
+        accountUserQuestion.setId(question.getId());
+        accountUserQuestion.setUserUU(question.getUserUU());
+        accountUserQuestion.setSort(question.getSort());
+        try {
+            AccountUtils.saveUserQuestion(accountUserQuestion);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 }

+ 1 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/account_manager_ctrl.js

@@ -1013,7 +1013,7 @@ define(['app/app'], function(app) {
         $scope.ok = function () {
         	var arr = [];
         	for(var key in $scope.uq){
-            $scope.uq[key].sort=key;
+            $scope.uq[key].sort= Integer.parseInt(key)+1;
 							arr[key]=$scope.uq[key];
 					}
             User.updateUserQuestion({},arr, function(){

+ 12 - 6
src/main/webapp/resources/view/usercenter/forstore/account_manager.html

@@ -181,7 +181,8 @@
 			</li>
 			<li>
 				<span>
-					<h5><img src="static/img/user/images/ok.png"/></h5>
+					<h5 ng-show="userInfo.pwdEnable"><img src="static/img/user/images/ok.png"/></h5>
+					<h5 ng-hide="userInfo.pwdEnable"><img src="static/img/user/images/safe.png"/></h5>
 					<font>登录密码</font>
 					<span>安全性高的密码可以使账号更安全,建议您定期更换密码,并且设置一个包含数字和字母,长度超过8位以上的密码。</span>
 				</span>
@@ -189,7 +190,8 @@
 			</li>
 			<li>
 				<span>
-					<h5><img src="static/img/user/images/ok.png"/></h5>
+					<h5 ng-show="userInfo.haveUserQuestion"><img src="static/img/user/images/ok.png"/></h5>
+					<h5 ng-hide="userInfo.haveUserQuestion"><img src="static/img/user/images/safe.png"/></h5>
 					<font>密保问题</font>
 					<span>是您找回登录密码的方式之一。建议您设置一个容易记住,且最不容易被他人获取的问题及答案,更有效保障您的密...</span>
 				</span>
@@ -205,19 +207,23 @@
 			</li>
 			<li>
 				<span>
-					<h5><img src="static/img/user/images/ok.png"/></h5>
+					<h5 ng-show="userInfo.userEmail==null?false:true"><img src="static/img/user/images/ok.png"/></h5>
+					<h5 ng-hide="userInfo.userEmail==null?false:true"><img src="static/img/user/images/safe.png"/></h5>
 					<font>邮箱认证</font>
 					<span>您当前的邮箱:529010777@qq.com</span>
 				</span>
-				<a ng-click="updateUserEmail()">修改</a>
+				<a ng-show="userInfo.userEmail==null?false:true" ng-click="updateUserEmail()">修改</a>
+				<a ng-hide="userInfo.userEmail==null?false:true" ng-click="updateUserEmail()">立即设置</a>
 			</li>
 			<li>
 				<span>
-					<h5><img src="static/img/user/images/ok.png"/></h5>
+					<h5 ng-show="userInfo.havePayPwd"><img src="static/img/user/images/ok.png"/></h5>
+					<h5 ng-hide="userInfo.havePayPwd"><img src="static/img/user/images/safe.png"/></h5>
 					<font>支付密码</font>
 					<span>在使用账户中余额或确认收货时,需输入支付密码。</span>
 				</span>
-				<a ng-click="updateUserPay()" class="mall-btn-default">立即设置</a>
+				<a ng-hide="userInfo.havePayPwd" ng-click="updateUserPay()" class="mall-btn-default">立即设置</a>
+				<a ng-show="userInfo.havePayPwd" ng-click="updateUserPay()" class="mall-btn-default">修改</a>
 			</li>
 		</ul>
 	</div>