Authored by 姜敏

修复个人设置中默认头像,以及收不到短信的问题

... ... @@ -12,15 +12,15 @@ const helpModel = require('../models/help');
* @param id
* @returns {*}
*/
/* const getData = (id)=> {
let contentData = helpModel.contentData().content;
const getData = (id)=> {
let contentData = helpModel.contentData().content;
for (var i = 0; i < contentData.length; i++) {
if (contentData[i].id === id) {
return contentData[i]
}
}
};*/
for (let i = 0; i < contentData.length; i++) {
if (contentData[i].id === id) {
return contentData[i];
}
}
};
/**
* 根据id获取当前所在位置,拼接面包屑
... ... @@ -57,48 +57,27 @@ const getNav = (id)=> {
/**
* 主界面
*/
const index = (req, res, next) => {
let id = req.query.id || '11';
helpModel.getHelpDetail('81', 1, 15, '').then(result=> {
let content = {content: result.helpdetail_list[0].content};
let data = Object.assign(content, helpModel.menuData());
let nav = [
{
link: global.yoho.config.sitUrl,
name: 'YOHO!BLK首页'
},
{
name: '帮助中心'
}
];
if (!(typeof (getNav(id)) === 'undefined')) {
nav = nav.concat(getNav(id));
const index = (req, res) => {
let id = req.query.id || '1';
let data = Object.assign(getData(id), helpModel.menuData());
let nav = [
{
link: global.yoho.config.sitUrl,
name: 'YOHO!BLK首页'
},
{
name: '帮助中心'
}
res.display('detail', {
module: 'help',
page: 'help',
content: Object.assign({nav}, data)
});
}).catch(next);
];
/* let data = Object.assign(getData(id), helpModel.menuData());
let nav = [
{
link: global.yoho.config.sitUrl,
name: 'YOHO!BLK首页'
},
{
name: '帮助中心'
}
];
nav = nav.concat(getNav(id));
res.display('detail', {
module: 'help',
page: 'help',
content: Object.assign({nav}, data)
});*/
if (!(typeof (getNav(id)) === 'undefined')) {
nav = nav.concat(getNav(id));
}
res.display('detail', {
module: 'help',
page: 'help',
content: Object.assign({nav}, data)
});
};
... ...
... ... @@ -6,8 +6,6 @@
'use strict';
const api = global.yoho.API;
/**
* 分类数据
* @returns {{}}
... ... @@ -72,41 +70,39 @@ const contentData = ()=> {
return {
content: [
{
id: '11',
content: '<h1>你好</h1><p>测试11</p>'
id: '1',
content: '<h1>购物指南</h1>'
},
{
id: '2',
content: '<h1>支付方式</p>'
},
{
id: '12',
content: '<h1>你好</h1><p>测试12</p>'
id: '31',
content: '<h1>配送方式-配送时间与范围</p>'
},
{
id: '13',
content: '<h1>你好</h1><p>测试13</p>'
id: '32',
content: '<h1>配送方式-商品验收与签收</p>'
},
{
id: '41',
content: '<h1>售后服务-投诉与建议</p>'
},
{
id: '42',
content: '<h1>售后服务-退换货流程</p>'
},
{
id: '43',
content: '<h1>售后服务-退换货政策</p>'
}
]
};
};
/**
* 查看问题详情
* @param cateId
* @param page
* @param limit
* @param problem
*/
const getHelpDetail = (cateId, page, limit, problem)=> {
return api.get('', {
method: 'web.help.getHelpDetailList',
category_id: cateId,
page: page,
limit: limit,
problem: problem
}).then(result => result.data);
};
module.exports = {
menuData,
contentData,
getHelpDetail
contentData
};
... ...
... ... @@ -31,7 +31,7 @@ const changePwd = (req, res, next) => {
const checkVerifyMobile = (req, res, next)=> {
let uid = req.user.uid;
let mobile = req.body.mobile;
let area = req.body.area;
let area = req.body.area || '86';
accountModel.checkVerifyMobile(uid, mobile, area).then(result=> {
res.send(result);
... ... @@ -47,7 +47,7 @@ const checkVerifyMobile = (req, res, next)=> {
const sendMobileMsg = (req, res, next)=> {
let uid = req.user.uid;
let mobile = req.body.mobile;
let area = req.body.area || '+86';
let area = req.body.area || '86';
accountModel.sendMobileMsg(uid, mobile, area).then(result=> {
res.send(result);
... ... @@ -64,7 +64,7 @@ const sendMobileMsg = (req, res, next)=> {
const checkVerifyMsg = (req, res, next)=> {
let code = req.body.code;
let mobile = req.body.mobile;
let area = req.body.area || '+86';
let area = req.body.area || '86';
accountModel.checkVerifyMsg(code, mobile, area).then(result=> {
res.send(result);
... ...
... ... @@ -23,6 +23,8 @@ $subsets.click(function() {
$child.hide();
$this.removeClass('open').children('.plus').css('background-image', 'url(\'../img/help/plus.png\')');
} else {
$('.smll-category').hide();
$('.subsets').children('.plus').css('background-image', 'url(\'../img/help/plus.png\')');
$child.show();
$this.addClass('open').children('.plus').css('background-image', 'url(\'../img/help/minus.png\')');
}
... ...
... ... @@ -25,7 +25,7 @@ require('yoho-jquery-placeholder');
$('[placeholder]').placeholder();
$(function () {
$(function() {
var address = cascadingAddress({el: '#address'});
/**
... ... @@ -33,7 +33,7 @@ $(function () {
*/
var Bll = {
// 获取输入框输入的值
getInfo: function () {
getInfo: function() {
return {
id: $addressId.val(),
... ... @@ -45,7 +45,7 @@ $(function () {
},
// 清空输入框
clearInput: function () {
clearInput: function() {
$consignee.val('');
$address.val('');
$mobile.val('');
... ... @@ -54,7 +54,7 @@ $(function () {
},
// 校验
check: function (info) {
check: function(info) {
var flag = true;
info.consignee === '' ? $consignee.next().show() : $consignee.next().hide();
... ... @@ -72,7 +72,7 @@ $(function () {
},
// 拼接一条数据的html
getHtml: function (info) {
getHtml: function(info) {
var html = '<tr class="table-body">';
html += '<input type="hidden" id="tr_' + info.address_id + '" value="' + info.address_id + '">' +
... ... @@ -90,7 +90,7 @@ $(function () {
},
// 获取一条数据
setInfo: function (id, td) {
setInfo: function(id, td) {
$addressId.val(id);
$consignee.val(td.eq(0).text());
$address.val(td.eq(2).text());
... ... @@ -99,7 +99,7 @@ $(function () {
},
// 设置表格头部
setTableTile: function () {
setTableTile: function() {
$('.table-title').text('已保存了' + currentLength +
'条地址,还能保存' + leftLength + '条地址');
}
... ... @@ -107,7 +107,7 @@ $(function () {
// 保存收货地址
$(document).on('click', '#save-address', function () {
$(document).on('click', '#save-address', function() {
var info,
area,
areaInfo;
... ... @@ -131,7 +131,7 @@ $(function () {
url: '/me/address/add',
dataType: 'json',
data: info,
success: function (data) {
success: function(data) {
var html;
if (data.code === 200) {
... ... @@ -154,7 +154,7 @@ $(function () {
url: '/me/address/update',
dataType: 'json',
data: info,
success: function (data) {
success: function(data) {
if (data.code === 200) {
info.mobile = info.mobile.substring(0, 3) + '****' + info.mobile.substring(7, 11);
info.address_id = info.id;
... ... @@ -171,7 +171,7 @@ $(function () {
});
// 修改收货地址
$(document).on('click', '.update-address', function () {
$(document).on('click', '.update-address', function() {
var id = $(this).data('id');
var tr = $(this).parents('.table-body');
var td = tr.find('td');
... ... @@ -185,13 +185,13 @@ $(function () {
});
// 删除收货地址
$(document).on('click', '.del-address', function () {
$(document).on('click', '.del-address', function() {
var id = $(this).data('id');
var tr = $(this).parents('.table-body');
var a = new _confirm({
content: '您确定要删除收货地址吗?',
cb: function () {
cb: function() {
$.ajax({
type: 'POST',
url: '/me/address/del',
... ... @@ -199,7 +199,7 @@ $(function () {
data: {
id: id
},
success: function () {
success: function() {
currentLength--;
leftLength++;
tr.remove();
... ... @@ -214,7 +214,7 @@ $(function () {
});
// 设置默认收货地址
$(document).on('click', '.set-default', function () {
$(document).on('click', '.set-default', function() {
var tr = $(this).parents('.table-body');
var tbody = tr.parent();
var id = $(this).data('id');
... ... @@ -227,7 +227,7 @@ $(function () {
data: {
id: id
},
success: function () {
success: function() {
$('.current-default').removeClass('current-default').text('设为默认');
$(self).addClass('current-default').text('默认地址');
tbody.find('.table-body').eq(0).before('<tr class=\'table-body\'>' + tr.html() + '</tr>');
... ...
... ... @@ -11,6 +11,7 @@ var type = types[types.length - 1];// 界面操作类型
var $imgCaptchaInput = $('#captcha');
var second = 60;
var $sms = $('#send-code2');// 发送短信验证码按钮
var area = $('#country-code').text().substring(0);// 地区码
// 发送短信后倒计时显示
var disableSMSBtn = function() {
second -= 1;
... ... @@ -55,7 +56,6 @@ $('#region').on('change', function() {
// 校验手机号码
$('#real-mobile').blur(function() {
var mobile = $(this).val();
var area = $('#country-code').text();
var self = $('#real-mobile').parent();
if (validatePhoneNumLocal(mobile)) {
... ... @@ -85,7 +85,6 @@ $('#real-mobile').blur(function() {
// 发送手机验证码
$sms.click(function() {
var mobile = $('#real-mobile').val();
var area = $('#country-code').text();
if ($(this).hasClass('disable')) {
return;
... ... @@ -115,7 +114,7 @@ $('#mobile-step2').click(function() {
var code = $('#msg-code').val();
var mobile = $('#real-mobile').val();
var self = $('#msg-code').parent();
var area = $('#country-code').text();
$.ajax({
type: 'POST',
... ...
... ... @@ -77,7 +77,7 @@
.show-ico {
height: 120px;
width: 120px;
background-image: resolve('me/setting/normal-icon.png');
background-image: resolve('me/setting/default-head.png');
background-repeat: no-repeat;
background-size: 120px 120px;
}
... ...