Authored by 姜敏

完善注释

... ... @@ -30,7 +30,7 @@ const checkVerifyMobile = (req, res)=> {
let uid = req.user.uid;
let mobile = req.body.mobile;
let area = req.body.area;
accountModel.checkVerifyMobile(uid, mobile, area).then(result=> {
res.send(result);
});
... ... @@ -45,7 +45,7 @@ const sendMobileMsg = (req, res)=> {
let uid = req.user.uid;
let mobile = req.body.mobile;
let area = req.body.area || '+86';
accountModel.sendMobileMsg(uid, mobile, area).then(result=> {
res.send(result);
});
... ...
... ... @@ -15,6 +15,7 @@ const co = Promise.coroutine;
const captchaUrl = helpers.urlFormat('/passport/images', {t: Date.now()});
// const captchaUrl = 'http://localhost:6003/passport/images?t=' + new Date().getTime();
// 根据type获取标题
... ... @@ -125,7 +126,7 @@ const bindMobile = (req, res, next) => {
info.ellipsisMobile = info.verify_mobile.substring(0, 3) + '****' + info.verify_mobile.substring(7, 11);
info.checkCode = settingModel.cipheriv(info.uid + '.completeverify');
res.display('index', {
module: 'me',
page: 'setting',
... ... @@ -183,7 +184,7 @@ const bindEmail = (req, res, next) => {
const modifyPassword = (req, res) => {
let type = req.params.type;
let checkCode = settingModel.cipheriv(req.user.uid + '.completeverify');
res.display('index', {
module: 'me',
page: 'setting',
... ... @@ -219,7 +220,7 @@ const edit = (req, res)=> {
isShowPassword: _getTitle(type).isShowPassword
};
let checkCode = settingModel.cipheriv(req.user.uid + '.completeoperate');
res.display('index', {
module: 'me',
page: 'setting',
... ...
... ... @@ -75,7 +75,7 @@ const getUserInfo = (uid) => {
});
};
/*const getVerifyInfo = (uid)=> {
/* const getVerifyInfo = (uid)=> {
return api.get('', {
method: 'web.passport.getUserVerifyInfo',
uid: uid
... ...
... ... @@ -4,7 +4,8 @@
* @date: 2016/07/11
*/
const moment = require('moment');
//时间格式化
// 时间格式化
const convertUnitTime = (src) => {
return moment.unix(src).format('YYYY-MM-DD');
... ... @@ -14,12 +15,12 @@ var beginTime = convertUnitTime(new Date() / 1000 - 3600 * 24 * 90);
var type = 0;
var page = 1;
var Bll = {
//获取路由中的请求参数
getQueryString: function () {
// 获取路由中的请求参数
getQueryString: function() {
let queryArr = location.search.substr(1).split('&');
let query = {};
queryArr.forEach(function (pair) {
queryArr.forEach(function(pair) {
let arr = pair.split('=');
query[arr[0]] = arr[1];
... ... @@ -31,7 +32,7 @@ var Bll = {
paying: 1,
delivering: 2
},
getDataList: function (type1, page1, beginTime1) {
getDataList: function(type1, page1, beginTime1) {
let query = ['page=' + page1, 'queryType=' + type1, 'beginTime=' + beginTime1];
location.search = query.join('&');
... ... @@ -42,7 +43,7 @@ require('./me');
// tab切换
$('.tabs li').on('click', function () {
$('.tabs li').on('click', function() {
let $this = $(this);
type = Bll.typeMap[$this.data('type')];
... ... @@ -57,8 +58,8 @@ $('.tabs li').on('click', function () {
});
//时间控件切换
$('#begin-time').on('change', function () {
// 时间控件切换
$('#begin-time').on('change', function() {
let months = parseInt($(this).val(), 10);
type = Bll.getQueryString().queryType || 1;
... ...
... ... @@ -9,7 +9,7 @@ var _dialog = dialog.Dialog;
var _alert = dialog.Alert;
var Bll = {
setIcon: function () {
setIcon: function() {
var html = [];
html.push('<form id="upload_form" method="post" action="" onsubmit="return checkForm()">');
... ... @@ -27,7 +27,7 @@ var Bll = {
return html.join('');
},
validate: function (info) {
validate: function(info) {
var regBirth = new RegExp(/^[1-2][0-9][0-9][0-9]-[0-1]{0,1}[0-9]-[0-3]{0,1}[0-9]$/);
var regName = new RegExp(/^[\u4e00-\u9fa5_-a-zA-Z0-9]+$/);
var birthdayForm = $('#birthday');
... ... @@ -55,14 +55,14 @@ require('../me/setting/step3');
// 编辑头像移入移出切换效果
$('.user-icon').hover(function () {
$('.user-icon').hover(function() {
$(this).find('.show-ico ').addClass('hide').end().find('.edit-ico').removeClass('hide');
}, function () {
}, function() {
$(this).find('.show-ico').removeClass('hide').end().find('.edit-ico').addClass('hide');
});
// 编辑头像打开弹框
$(document).on('click', '.edit-ico', function () {
$(document).on('click', '.edit-ico', function() {
var tip = new _dialog({
className: 'settled-success',
title: '自定义头像',
... ... @@ -72,7 +72,7 @@ $(document).on('click', '.edit-ico', function () {
id: 'apply',
btnClass: ['apply'],
name: '保存',
cb: function () {
cb: function() {
tip.close();
}
},
... ... @@ -80,7 +80,7 @@ $(document).on('click', '.edit-ico', function () {
id: 'cancel',
btnClass: ['cancel'],
name: '取消',
cb: function () {
cb: function() {
tip.close();
}
}
... ... @@ -89,7 +89,7 @@ $(document).on('click', '.edit-ico', function () {
});
$(document).on('change', '#avatar', function () {
$(document).on('change', '#avatar', function() {
/* var oFile = $("#avatar")[0].files[0];
var oImage = document.getElementById('post-picture');
var oReader = new FileReader();
... ... @@ -102,7 +102,7 @@ $(document).on('change', '#avatar', function () {
});
$(function () {
$(function() {
var address = cascadingAddress({el: '#address'});
var areaCode = $('#area_code').val();
... ... @@ -115,7 +115,7 @@ $(function () {
$('.input-radio').check({
type: 'radio',
group: 'genders',
onChange: function (ele, checked, value) {
onChange: function(ele, checked, value) {
var gender = $('#gender').val();
checked ? $('#gender').val(value) : $('#gender').val(gender);
... ... @@ -125,7 +125,7 @@ $(function () {
/**
* 保存修改
*/
$(document).on('click', '#save-settings', function () {
$(document).on('click', '#save-settings', function() {
var area = address.getAreaIds();
var body = {
... ... @@ -134,9 +134,11 @@ $(function () {
gender: $('#gender').val(),
birthday: $('#birthday').val(),
area_code: area.split(',')[2],
// todo 手机号码老接口必填
mobile: $('#infoMobile').val(),
full_address: $('#full_address').val(),
// todo 邮编老接口必填字段
zip_code: $('#zip_code').val() || '210000'
};
... ... @@ -147,10 +149,10 @@ $(function () {
url: '/me/setting/editUserInfo',
dataType: 'json',
data: body,
success: function (data) {
success: function(data) {
var len = 0;
data.forEach(function (x) {
data.forEach(function(x) {
if (x.code === 200) {
len++;
}
... ...
... ... @@ -7,7 +7,7 @@ var $imgCaptchaInput = $('#captcha');
var dialog = require('../../plugins/dialog');
var _alert = dialog.Alert;
var types = location.pathname.split('/');
var type = types[types.length - 1];//界面操作类型
var type = types[types.length - 1];// 界面操作类型
/**
... ... @@ -58,7 +58,7 @@ $sms.click(function() {
});
});
//手机验证第一步提交
// 手机验证第一步提交
$('#mobile-step1').click(function() {
var code = $('#msg-code').val().trim();
var mobile = $('#real-mobile').val();
... ...
... ... @@ -7,12 +7,12 @@ var dialog = require('../../plugins/dialog');
var _alert = dialog.Alert;
var regValidate = require('../../passport/common/mail-phone-regx');
var types = location.pathname.split('/');
var type = types[types.length - 1];//界面操作类型
var type = types[types.length - 1];// 界面操作类型
var $imgCaptchaInput = $('#captcha');
var second = 60;
var $sms = $('#send-code2');// 发送短信验证码按钮
// 发送短信后倒计时显示
var disableSMSBtn = function () {
var disableSMSBtn = function() {
second -= 1;
if (second < 0) {
second = 60;
... ... @@ -27,7 +27,7 @@ var disableSMSBtn = function () {
};
// 校验手机号码格式
var validatePhoneNumLocal = function (phoneNum) {
var validatePhoneNumLocal = function(phoneNum) {
var length = phoneNum.length;
if (length === 0) {
... ... @@ -44,12 +44,12 @@ var validatePhoneNumLocal = function (phoneNum) {
/**
* 绑定手机号码部分
*/
$('#region').on('change', function () {
$('#region').on('change', function() {
$('#country-code').text($(this).val());
});
// 校验手机号码
$('#real-mobile').blur(function () {
$('#real-mobile').blur(function() {
var mobile = $(this).val();
var area = $('#country-code').text();
var self = $('#real-mobile').parent();
... ... @@ -63,7 +63,7 @@ $('#real-mobile').blur(function () {
mobile: mobile,
area: area
},
success: function (data) {
success: function(data) {
if (data.code === 200) {
self.find('.tips-success').addClass('ok').show();
self.find('.tips-error').removeClass('notok').hide();
... ... @@ -79,7 +79,7 @@ $('#real-mobile').blur(function () {
// 发送手机验证码
$sms.click(function () {
$sms.click(function() {
var mobile = $('#real-mobile').val();
var area = $('#country-code').text();
... ... @@ -95,7 +95,7 @@ $sms.click(function () {
mobile: mobile,
area: area
},
success: function (data) {
success: function(data) {
if (data.code !== 200) {
new _alert(data.message).show();
$sms.removeClass('disable');
... ... @@ -106,8 +106,8 @@ $sms.click(function () {
});
});
//绑定手机第二步提交
$('#mobile-step2').click(function () {
// 绑定手机第二步提交
$('#mobile-step2').click(function() {
var code = $('#msg-code').val();
var mobile = $('#real-mobile').val();
var self = $('#msg-code').parent();
... ... @@ -121,7 +121,7 @@ $('#mobile-step2').click(function () {
mobile: mobile,
area: area
},
success: function (data) {
success: function(data) {
if (data.code === 200) {
self.find('.tips-success').addClass('ok').show();
self.find('.tips-error').removeClass('notok').hide();
... ... @@ -140,7 +140,7 @@ $('#mobile-step2').click(function () {
* 修改密码部分
*/
// 输入确认密码
$('#checkPwd').blur(function () {
$('#checkPwd').blur(function() {
var newPwd = $('#newPwd').val().trim();
var checkPwd = $(this).val().trim();
var self = $(this).parent();
... ... @@ -155,14 +155,14 @@ $('#checkPwd').blur(function () {
});
// 校验图片验证码
$imgCaptchaInput.blur(function () {
$imgCaptchaInput.blur(function() {
$.ajax({
type: 'POST',
url: '/passport/images/check',
data: {
verifyCode: $imgCaptchaInput.val()
},
success: function (data) {
success: function(data) {
if (data.code === 200) {
$imgCaptchaInput.parent().find('.tips-success').addClass('ok').show();
$imgCaptchaInput.parent().find('.tips-error').removeClass('notok').hide();
... ... @@ -175,7 +175,7 @@ $imgCaptchaInput.blur(function () {
});
// 提交修改密码
$('#step2-pwd').click(function () {
$('#step2-pwd').click(function() {
var password = $('#newPwd').val();
if ($('.notok').length === 0) {
... ... @@ -185,7 +185,7 @@ $('#step2-pwd').click(function () {
data: {
password: password
},
success: function (data) {
success: function(data) {
if (data.code === 200) {
location.href = '/me/setting/step3/' + type + '?checkCode=' + $('#checkCode').val();
} else {
... ...