mirror of
https://gitee.com/coder-xiaomo/flashsale
synced 2025-09-12 06:51:38 +08:00
添加Metronic(作为LFS)
This commit is contained in:
95
frontend/static/js/pages/changepassword.js
Normal file
95
frontend/static/js/pages/changepassword.js
Normal file
@@ -0,0 +1,95 @@
|
||||
$(document).ready(function() {
|
||||
$('#changePassForm').formValidation({
|
||||
framework: 'bootstrap',
|
||||
icon: {
|
||||
valid: 'glyphicon glyphicon-ok',
|
||||
invalid: 'glyphicon glyphicon-remove',
|
||||
validating: 'glyphicon glyphicon-refresh'
|
||||
},
|
||||
fields: {
|
||||
oldpass: {
|
||||
trigger: 'blur',
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '原密码还没有输噢'
|
||||
},
|
||||
stringLength: {
|
||||
min: 6,
|
||||
max: 20,
|
||||
message: '6到20个字符'
|
||||
}
|
||||
}
|
||||
},
|
||||
newpass: {
|
||||
trigger: 'blur',
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '快输个新密码吧'
|
||||
},
|
||||
stringLength: {
|
||||
min: 6,
|
||||
max: 20,
|
||||
message: '6到20个字符'
|
||||
}
|
||||
}
|
||||
},
|
||||
newpass_confirm: {
|
||||
trigger: 'blur',
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '再输一次新密码,别打错了'
|
||||
},
|
||||
identical: {
|
||||
field: 'newpass',
|
||||
message: '两次新密码输入的不一样'
|
||||
},
|
||||
stringLength: {
|
||||
min: 6,
|
||||
max: 20,
|
||||
message: '6到20个字符'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("button#submit").click(function(){
|
||||
doChange();
|
||||
});
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
doChange();
|
||||
}
|
||||
});
|
||||
|
||||
function doChange(){
|
||||
var oldPass = $("#changePassForm #oldpass").val();
|
||||
var newPass = $("#changePassForm #newpass").val();
|
||||
|
||||
$.ajax( {
|
||||
url:'/home/users/changepassword',// 跳转到 action
|
||||
data:JSON.stringify(
|
||||
{
|
||||
oldPassword : oldPass,
|
||||
newPassword : newPass
|
||||
}),
|
||||
type:'post',
|
||||
cache:false,
|
||||
dataType:'json',
|
||||
contentType:"application/json;charset=utf-8",
|
||||
success:function(data) {
|
||||
if(data.status=="success"){
|
||||
alert("修改成功");
|
||||
window.location.reload(true);
|
||||
}else if(data.status=="fail"){
|
||||
alert(data.data.errMessage);
|
||||
}
|
||||
},
|
||||
error : function() {
|
||||
// view("异常!");
|
||||
alert("异常!");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
38
frontend/static/js/pages/forget.js
Normal file
38
frontend/static/js/pages/forget.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* forget.js
|
||||
*/
|
||||
$("button#submit").click(function(){
|
||||
doForget();
|
||||
});
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
doForget();
|
||||
}
|
||||
});
|
||||
|
||||
function doForget(){
|
||||
var email = $("#forgetForm #email").val();
|
||||
if(email=="")
|
||||
return;
|
||||
|
||||
$.ajax( {
|
||||
url:'/home/users/forgetpassword',// 跳转到 action
|
||||
data:$('#forgetForm').serialize(),
|
||||
type:'POST',
|
||||
processData:true,
|
||||
contentType:"application/x-www-form-urlencoded",
|
||||
success:function(data) {
|
||||
alert(data.status);
|
||||
if(data.status=="success"){
|
||||
location.href = "/home/users/login";
|
||||
}else if(data.status=="fail"){
|
||||
alert(data.data.errMessage);
|
||||
}
|
||||
},
|
||||
error : function(e) {
|
||||
// view("异常!");
|
||||
alert(e);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
44
frontend/static/js/pages/login.js
Normal file
44
frontend/static/js/pages/login.js
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* login.js
|
||||
*/
|
||||
$("button#submit").click(function(){
|
||||
doLogin();
|
||||
});
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
doLogin();
|
||||
}
|
||||
});
|
||||
|
||||
function doLogin(){
|
||||
var email = $("#loginForm #email").val();
|
||||
var password = $("#loginForm #password").val();
|
||||
//alert(email + " "+password);
|
||||
if(email=="" || password=="")
|
||||
return;
|
||||
|
||||
$.ajax( {
|
||||
url:'/home/users/login',// 跳转到 action
|
||||
data:JSON.stringify(
|
||||
{
|
||||
email : email,
|
||||
password : password
|
||||
}),
|
||||
type:'post',
|
||||
cache:false,
|
||||
dataType:'json',
|
||||
contentType:"application/json;charset=utf-8",
|
||||
success:function(data) {
|
||||
if(data.status=="success"){
|
||||
location.href = "/home/index/index";
|
||||
}else if(data.status=="fail"){
|
||||
alert(data.data.errMessage);
|
||||
}
|
||||
},
|
||||
error : function() {
|
||||
// view("异常!");
|
||||
alert("异常!");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
49
frontend/static/js/pages/register.js
Normal file
49
frontend/static/js/pages/register.js
Normal file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* register.js
|
||||
*/
|
||||
$("button#submit").click(function(){
|
||||
doRegister();
|
||||
});
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
doRegister();
|
||||
}
|
||||
});
|
||||
|
||||
function doRegister(){
|
||||
var email = $("#signinForm #email").val();
|
||||
var password = $("#signinForm #password").val();
|
||||
var domain = $("#signinForm #personalDomain").val();
|
||||
var userName = $("#signinForm #userName").val();
|
||||
|
||||
if(email=="" || password=="" || domain=="" || userName=="")
|
||||
return;
|
||||
|
||||
$.ajax( {
|
||||
url:'/home/users/register',// 跳转到 action
|
||||
data:JSON.stringify(
|
||||
{
|
||||
email : email,
|
||||
password : password,
|
||||
personalDomain : domain,
|
||||
userName : userName
|
||||
}),
|
||||
type:'post',
|
||||
cache:false,
|
||||
dataType:'json',
|
||||
contentType:"application/json;charset=utf-8",
|
||||
success:function(data) {
|
||||
if(data.status=="success"){
|
||||
location.href = "/home/index/index";
|
||||
}else if(data.status=="fail"){
|
||||
alert(data.data.errMessage);
|
||||
}
|
||||
},
|
||||
error : function() {
|
||||
// view("异常!");
|
||||
alert("异常!");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
38
frontend/static/js/pages/reset.js
Normal file
38
frontend/static/js/pages/reset.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* reset.js
|
||||
*/
|
||||
$("button#submit").click(function(){
|
||||
doReset();
|
||||
});
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
doReset();
|
||||
}
|
||||
});
|
||||
|
||||
function doReset(){
|
||||
var email = $("#resetForm #email").val();
|
||||
if(email=="")
|
||||
return;
|
||||
|
||||
$.ajax( {
|
||||
url:'/home/users/resetpassword',// 跳转到 action
|
||||
data:$('#resetForm').serialize(),
|
||||
type:'POST',
|
||||
processData:true,
|
||||
contentType:"application/x-www-form-urlencoded",
|
||||
success:function(data) {
|
||||
alert(data.status);
|
||||
if(data.status=="success"){
|
||||
location.href = "/home/user/validate.jsp";
|
||||
}else if(data.status=="fail"){
|
||||
alert(data.data.errMessage);
|
||||
}
|
||||
},
|
||||
error : function(e) {
|
||||
// view("异常!");
|
||||
alert(e);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
183
frontend/static/js/pages/usersetting.js
Normal file
183
frontend/static/js/pages/usersetting.js
Normal file
@@ -0,0 +1,183 @@
|
||||
//表单验证
|
||||
$(document).ready(function() {
|
||||
$('#profileForm').formValidation({
|
||||
framework: 'bootstrap',
|
||||
icon: {
|
||||
valid: 'glyphicon glyphicon-ok',
|
||||
invalid: 'glyphicon glyphicon-remove',
|
||||
validating: 'glyphicon glyphicon-refresh'
|
||||
},
|
||||
fields: {
|
||||
nickname: {
|
||||
trigger: 'blur',
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '快想个昵称'
|
||||
},
|
||||
stringLength: {
|
||||
min: 2,
|
||||
max: 20,
|
||||
message: '2到20个字符'
|
||||
}
|
||||
}
|
||||
},
|
||||
domain: {
|
||||
trigger: 'blur',
|
||||
validators: {
|
||||
stringLength: {
|
||||
min: 1,
|
||||
max: 200,
|
||||
message: '最多200个字符'
|
||||
}
|
||||
}
|
||||
},
|
||||
intro: {
|
||||
trigger: 'blur',
|
||||
validators: {
|
||||
stringLength: {
|
||||
min: 1,
|
||||
max: 140,
|
||||
message: '最多140个字符'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#changePassForm').formValidation({
|
||||
framework: 'bootstrap',
|
||||
icon: {
|
||||
valid: 'glyphicon glyphicon-ok',
|
||||
invalid: 'glyphicon glyphicon-remove',
|
||||
validating: 'glyphicon glyphicon-refresh'
|
||||
},
|
||||
fields: {
|
||||
oldpass: {
|
||||
trigger: 'blur',
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '原密码还没有输噢'
|
||||
},
|
||||
stringLength: {
|
||||
min: 6,
|
||||
max: 20,
|
||||
message: '6到20个字符'
|
||||
}
|
||||
}
|
||||
},
|
||||
newpass: {
|
||||
trigger: 'blur',
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '快输个新密码吧'
|
||||
},
|
||||
stringLength: {
|
||||
min: 6,
|
||||
max: 20,
|
||||
message: '6到20个字符'
|
||||
}
|
||||
}
|
||||
},
|
||||
newpass_confirm: {
|
||||
trigger: 'blur',
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '再输一次新密码,别打错了'
|
||||
},
|
||||
identical: {
|
||||
field: 'newpass',
|
||||
message: '两次新密码输入的不一样'
|
||||
},
|
||||
stringLength: {
|
||||
min: 6,
|
||||
max: 20,
|
||||
message: '6到20个字符'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//个人资料的请求
|
||||
$("button#submit_profile").click(function(){
|
||||
doUpdate();
|
||||
});
|
||||
$(document).keydown(function(e) {
|
||||
if (e.keyCode == 13 && $('#profile-panel').hasClass("active")) {
|
||||
doUpdate();
|
||||
}else if (e.keyCode == 13 && $('#password-panel').hasClass("active")) {
|
||||
doChange();
|
||||
}
|
||||
});
|
||||
|
||||
function doUpdate(){
|
||||
var nickname = $("#profileForm #nickname").val();
|
||||
var domain = $("#profileForm #domain").val();
|
||||
var intro = $("#profileForm #intro").val();
|
||||
var avatarID = "";
|
||||
|
||||
$.ajax( {
|
||||
url:'/home/users/usersetting',// 跳转到 action
|
||||
data:JSON.stringify(
|
||||
{
|
||||
userName : nickname,
|
||||
personalDomain : domain,
|
||||
word : intro,
|
||||
avatarId : avatarID
|
||||
}),
|
||||
type:'post',
|
||||
cache:false,
|
||||
dataType:'json',
|
||||
contentType:"application/json;charset=utf-8",
|
||||
success:function(data) {
|
||||
if(data.status=="success"){
|
||||
alert("资料修改成功!");
|
||||
window.location.reload(true);
|
||||
}else if(data.status=="fail"){
|
||||
alert(data.data.errMessage);
|
||||
}
|
||||
},
|
||||
error : function() {
|
||||
// view("异常!");
|
||||
alert("异常!");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//修改密码的请求
|
||||
$("button#submit_password").click(function(){
|
||||
doChange();
|
||||
});
|
||||
|
||||
function doChange(){
|
||||
var oldPass = $("#changePassForm #oldpass").val();
|
||||
var newPass = $("#changePassForm #newpass").val();
|
||||
|
||||
$.ajax( {
|
||||
url:'/home/users/changepassword',// 跳转到 action
|
||||
data:JSON.stringify(
|
||||
{
|
||||
oldPassword : oldPass,
|
||||
newPassword : newPass
|
||||
}),
|
||||
type:'post',
|
||||
cache:false,
|
||||
dataType:'json',
|
||||
contentType:"application/json;charset=utf-8",
|
||||
success:function(data) {
|
||||
if(data.status=="success"){
|
||||
alert("密码修改成功!");
|
||||
window.location.reload(true);
|
||||
}else if(data.status=="fail"){
|
||||
alert(data.data.errMessage);
|
||||
}
|
||||
},
|
||||
error : function() {
|
||||
// view("异常!");
|
||||
alert("异常!");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
Reference in New Issue
Block a user