提交 aa85463b 编写于 作者: R root

update

上级 34942f8c
......@@ -12,31 +12,13 @@ $modules = [];
foreach (glob(__DIR__ . '/modules/*.php') as $filename){
$modules = array_merge($modules,require($filename));
}
$params = require(__DIR__ .'/params.php');
# 此处也可以重写fecshop的组件。供调用。
return [
'modules'=>$modules,
/* only config in front web */
'bootstrap' => ['store'],
'params' => [
/* appfront base theme dir */
'appfrontBaseTheme' => '@fecshop/app/appfront/theme/base/front',
'appfrontBaseLayoutName'=> 'main.php',
'mailer' => [
# 用来发送邮件的函数helper类,用来处理数据,生成邮件内容,然后调用邮件service
# 通过配置的方式去访问调用的目的是为了让用户可以通过配置 重写这个类
'mailer_class' => 'fecshop\app\appfront\helper\mailer\Email',
#在邮件中显示的Store的名字
'storeName' => 'FecShop',
# 在邮件中显示的电话
'phone' => '11111111',
# 在邮件中显示的联系邮箱地址。
'contacts' => [
'emailAddress' => '2358269014@qq.com',
]
],
# 通过邮箱找回密码,发送的resetToken过期的秒数
'user.passwordResetTokenExpire' => 3600*24*1, # 一天
],
'params' => $params,
# Yii组件配置
'components' => [
......@@ -55,6 +37,7 @@ return [
'user' => [
'identityClass' => 'fecshop\models\mysqldb\Customer',
# 是否cookie 登录。
'enableAutoLogin' => true,
],
......
......@@ -72,6 +72,16 @@ return [
//'mailerConfig' => []
],
],
'leftMenu' => [
'Account Dashboard' => 'customer/account',
'Account Information' => 'customer/editaccount',
'Address Book' => 'customer/address',
'My Orders' => 'customer/order',
'My Product Reviews' => 'customer/productreview',
'My Favorite' => 'customer/productfavorite',
]
],
],
];
......
<?php
return [
/* appfront base theme dir */
'appfrontBaseTheme' => '@fecshop/app/appfront/theme/base/front',
'appfrontBaseLayoutName'=> 'main.php',
'mailer' => [
#在邮件中显示的Store的名字
'storeName' => 'FecShop',
# 在邮件中显示的电话
'phone' => '11111111',
# 在邮件中显示的联系邮箱地址。
'contacts' => [
'emailAddress' => '2358269014@qq.com',
]
],
# 通过邮箱找回密码,发送的resetToken过期的秒数
'user.passwordResetTokenExpire' => 3600*24*1, # 一天
];
\ No newline at end of file
......@@ -17,7 +17,14 @@ use yii\base\InvalidValueException;
*/
class Email
{
/**
* 说明:
* 本函数是静态函数方法,您可以直接调用,如果想要在本地重写这个文件
* 可以通过Yii 的classMap的方式进行重写,也就是,
* 在@app/config/YiiClassMap.php文件中添加配置即可
* 原理请参看文章:http://www.fancyecommerce.com/2016/10/13/%e9%80%9a%e8%bf%87%e9%85%8d%e7%bd%ae%e7%9a%84%e6%96%b9%e5%bc%8f%e9%87%8d%e5%86%99%e6%9f%90%e4%b8%aayii2-%e6%96%87%e4%bb%b6-%e6%88%96%e7%ac%ac%e4%b8%89%e6%96%b9%e6%89%a9%e5%b1%95%e6%96%87%e4%bb%b6/
*/
/**
* 得到联系我们的邮箱地址
*/
......
......@@ -34,6 +34,9 @@ class AppfrontController extends FecController
* set i18n translate category.
*/
Yii::$service->page->translate->category = 'appfront';
/**
* 自定义Yii::$classMap,用于重写
*/
}
/**
......
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\block;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use yii\base\InvalidValueException;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class LeftMenu {
public function getLastData(){
$leftMenu = \Yii::$app->getModule('customer')->params['leftMenu'];
$leftMenuArr = [];
if(is_array($leftMenu) && !empty($leftMenu)){
$current_url_key = Yii::$app->request->getPathInfo();
$arr = explode('/',$current_url_key);
if(count($arr) >=2 ){
$current_url_key_sub = $arr[0].'/'.$arr[1];
}else{
$current_url_key_sub = $arr[0];
}
foreach($leftMenu as $menu_name => $menu_url_key){
$currentClass = '';
$url = Yii::$service->url->getUrl($menu_url_key);
if(strstr($menu_url_key,$current_url_key_sub)){
//echo "$menu_url_key,$current_url_key_sub <br>";
$currentClass = 'class="current"';
}
$leftMenuArr[] = [
'name' => $menu_name,
'url' => $url,
'current'=> $currentClass,
];
}
}
//var_dump($leftMenuArr);
return [
'leftMenuArr' => $leftMenuArr,
];
}
}
......@@ -11,6 +11,7 @@ use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use yii\base\InvalidValueException;
use fecshop\app\appfront\helper\mailer\Email;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
......@@ -64,15 +65,7 @@ class Forgotpassword {
*/
public function sendForgotPasswordEmail($identity){
if($identity){
$mailerConfig = Yii::$app->params['mailer'];
$mailer_class = isset($mailerConfig['mailer_class']) ? $mailerConfig['mailer_class'] : '';
if($mailer_class){
forward_static_call(
[$mailer_class , 'sendForgotPasswordEmail'],
$identity
);
}
Email::sendForgotPasswordEmail($identity);
}
}
......
......@@ -12,6 +12,7 @@ use fec\helpers\CModule;
use fec\helpers\CRequest;
use yii\base\InvalidValueException;
use fecshop\app\appfront\helper\mailer\Email;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
......@@ -67,14 +68,7 @@ class Login {
*/
public function sendLoginEmail($emailAddress){
if($emailAddress){
$mailerConfig = Yii::$app->params['mailer'];
$mailer_class = isset($mailerConfig['mailer_class']) ? $mailerConfig['mailer_class'] : '';
if($mailer_class){
forward_static_call(
[$mailer_class , 'sendLoginEmail'],
$emailAddress
);
}
Email::sendLoginEmail($emailAddress);
}
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use yii\base\InvalidValueException;
use fecshop\app\appfront\helper\mailer\Email;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
......@@ -76,14 +77,8 @@ class Register {
*/
public function sendRegisterEmail($param){
if($param){
$mailerConfig = Yii::$app->params['mailer'];
$mailer_class = isset($mailerConfig['mailer_class']) ? $mailerConfig['mailer_class'] : '';
if($mailer_class){
forward_static_call(
[$mailer_class , 'sendRegisterEmail'],
$param
);
}
Email::sendRegisterEmail($param);
}
}
}
......
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\block\address;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use yii\base\InvalidValueException;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class Index {
public function getLastData(){
return [
];
}
}
\ No newline at end of file
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\block\editaccount;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use yii\base\InvalidValueException;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class Index {
public function getLastData(){
$identity = Yii::$app->user->identity;
return [
'firstname' => $identity['firstname'],
'email' => $identity['email'],
'lastname' => $identity['lastname'],
'actionUrl' => Yii::$service->url->getUrl('customer/editaccount'),
];
}
/**
* @property $editForm|Array
* 保存修改后的用户信息。
*/
public function saveAccount($editForm){
$identity = Yii::$app->user->identity;
$firstname = $editForm['firstname'] ? $editForm['firstname'] : '';
$lastname = $editForm['lastname'] ? $editForm['lastname'] : '';
$current_password = $editForm['current_password'] ? $editForm['current_password'] : '';
$password = $editForm['password'] ? $editForm['password'] : '';
$confirmation = $editForm['confirmation'] ? $editForm['confirmation'] : '';
if(!$firstname || !$lastname){
Yii::$service->page->message->addError('first name and last name can not empty');
return;
}
if(!$current_password){
Yii::$service->page->message->addError('current password can not empty');
return;
}
if(!$password || !$confirmation){
Yii::$service->page->message->addError('password and confirmation password can not empty');
return;
}
if($password != $confirmation){
Yii::$service->page->message->addError('password and confirmation password must be equal');
return;
}
if(!$identity->validatePassword($password)){
Yii::$service->page->message->addError('Current password is not right,If you forget your password, you can retrieve your password by forgetting your password in login page');
return;
}
$identity->firstname = $firstname;
$identity->lastname = $lastname;
$identity->password = $password;
$identity->save();
if($identity->)
}
}
\ No newline at end of file
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\block\order;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use yii\base\InvalidValueException;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class Index {
public function getLastData(){
return [
];
}
}
\ No newline at end of file
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\block\point;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use yii\base\InvalidValueException;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class Index {
public function getLastData(){
return [
];
}
}
\ No newline at end of file
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\block\productfavorite;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use yii\base\InvalidValueException;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class Index {
public function getLastData(){
return [
];
}
}
\ No newline at end of file
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\block\productreview;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use yii\base\InvalidValueException;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class Index {
public function getLastData(){
return [
];
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use fecshop\app\appfront\modules\AppfrontController;
use fecshop\app\appfront\helper\test\My;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
......@@ -39,6 +40,7 @@ class AccountController extends AppfrontController
*/
public function actionLogin()
{
/**
$toEmail = 'zqy234@126.com';
// \fecshop\app\appfront\modules\Mailer\Email::sendLoginEmail($toEmail);
......
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\controllers;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use fecshop\app\appfront\modules\AppfrontController;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class AddressController extends AppfrontController
{
//protected $_registerSuccessRedirectUrlKey = 'customer/account';
public function init(){
if(Yii::$app->user->isGuest){
Yii::$service->url->redirectByUrlKey('customer/account/login');
}
parent::init();
}
/**
*
*/
public function actionIndex(){
$data = $this->getBlock()->getLastData();
return $this->render($this->action->id,$data);
}
}
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\controllers;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use fecshop\app\appfront\modules\AppfrontController;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class EditaccountController extends AppfrontController
{
//protected $_registerSuccessRedirectUrlKey = 'customer/account';
public function init(){
if(Yii::$app->user->isGuest){
Yii::$service->url->redirectByUrlKey('customer/account/login');
}
parent::init();
}
/**
*
*/
public function actionIndex(){
$editForm = Yii::$app->request->post('editForm');
if(!empty($editForm)){
$this->getBlock()->saveAccount($editForm);
}
$data = $this->getBlock()->getLastData();
return $this->render($this->action->id,$data);
}
}
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\controllers;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use fecshop\app\appfront\modules\AppfrontController;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class OrderController extends AppfrontController
{
//protected $_registerSuccessRedirectUrlKey = 'customer/account';
public function init(){
if(Yii::$app->user->isGuest){
Yii::$service->url->redirectByUrlKey('customer/account/login');
}
parent::init();
}
/**
*
*/
public function actionIndex(){
$data = $this->getBlock()->getLastData();
return $this->render($this->action->id,$data);
}
}
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\controllers;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use fecshop\app\appfront\modules\AppfrontController;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class PointController extends AppfrontController
{
//protected $_registerSuccessRedirectUrlKey = 'customer/account';
public function init(){
if(Yii::$app->user->isGuest){
Yii::$service->url->redirectByUrlKey('customer/account/login');
}
parent::init();
}
/**
*
*/
public function actionIndex(){
$data = $this->getBlock()->getLastData();
return $this->render($this->action->id,$data);
}
}
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\controllers;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use fecshop\app\appfront\modules\AppfrontController;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class ProductfavoriteController extends AppfrontController
{
//protected $_registerSuccessRedirectUrlKey = 'customer/account';
public function init(){
if(Yii::$app->user->isGuest){
Yii::$service->url->redirectByUrlKey('customer/account/login');
}
parent::init();
}
/**
*
*/
public function actionIndex(){
$data = $this->getBlock()->getLastData();
return $this->render($this->action->id,$data);
}
}
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Customer\controllers;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use fecshop\app\appfront\modules\AppfrontController;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class ProductreviewController extends AppfrontController
{
//protected $_registerSuccessRedirectUrlKey = 'customer/account';
public function init(){
if(Yii::$app->user->isGuest){
Yii::$service->url->redirectByUrlKey('customer/account/login');
}
parent::init();
}
/**
*
*/
public function actionIndex(){
$data = $this->getBlock()->getLastData();
return $this->render($this->action->id,$data);
}
}
......@@ -11,7 +11,12 @@ h1, h2, h3, h4, h5, h6 {
line-height: 1;
padding-bottom: 23px;
}
h3 {
font-size: 16px;
font-weight: 100;
line-height: 1.25;
margin: 10px 0 5px;
}
#top_nav {background-color: #000;font-size: 0.75em;height: 40px;line-height: 40px;width: 100%;}
.top_nav_inner {height: 100%;width:1200px;}
#mainBox, .footHelp_inner, .main_inner, .social_inner, .top_main_inner, .top_nav_inner {margin-left: auto;margin-right: auto;}
......@@ -1062,3 +1067,146 @@ button.redBtn:hover span{
margin-bottom:13px;
}
/* Sidebar =============================================================================== */
.block { margin:0 0 10px; }
.block .block-title { padding:0; }
.block .block-title strong { font-size:14px; font-weight:bold; }
.block .block-title strong span { color: #4c6b99;
font-family: Georgia;
font-size: 19px;
line-height: 40px;
text-decoration: none;}
.block .block-title a { text-decoration:none !important; }
.block .block-subtitle { font-size:13px; font-weight:bold; }
.block .block-content { padding:5px 0; }
.block .block-content li.item { padding:5px 0; }
.block .btn-remove,
.block .btn-edit { float:right;}
.block .actions { text-align:right; }
.block .actions a { float:left; }
.block .empty {}
.block li.odd {}
.block li.even { background-color:#f6f6f6; }
.sidebar .block-account li {
background: rgba(0, 0, 0, 0.05);
font-size: 12px;
margin: 3px 0;
padding: 10px 0 10px 16px;
}
.welcome-msg .hello {
margin: 0 0 5px;
}
.welcome-msg p {
line-height: 20px;
}
.box-account {
margin: 40px 0 0;
}
.box-account .addressbook {
border-top: 1px solid #ccc;
}
.col2-set .col-1 {
float: left;
width: 49%;
}
.box-account .box-content {
margin: 10px 0 30px;
}
.box-account .box-title a {
display: block;
margin: 10px 0 0;
}
.box-content div {
margin: 2px 0;
}
.col2-set .col-2 {
float: right;
width: 49%;
}
.account_center{font-size:11px;}
.block-account .block-content li.current a{
font-weight:bold;
}
.sidebar .block-account li.current {
background:rgba(0, 0, 0, 0.1);
}
.sidebar .block-account li:hover{
background:rgba(0, 0, 0, 0.1);
}
.page-title {
border: medium none;
margin: 0 0 3px;
padding: 5px 0;
}
#form-validate ul li {
margin: 11px 0;
}
#form-validate ul li label {
display: block;
font-size: 13px;
margin: 10px 0 4px;
}
#form-validate input.input-text {
color: #333;
width: 250px;
}
.form-list .field {
float: left;
width: 275px;
}
.validation-advice {
background: rgba(0, 0, 0, 0) url("../images/validation_advice_bg.gif") no-repeat scroll 2px 1px;
clear: both;
color: #f00;
font-size: 11px;
line-height: 13px;
margin: 3px 0 0;
min-height: 13px;
padding-left: 17px;
}
.validation-failed {
background: #faebe7 none repeat scroll 0 0 !important;
border: 1px dashed #f00 !important;
}
.account_center h2{
font-size:18px;
}
<div class="main container one-column">
<div class="page-title">
<h1>Account Center</h1>
</div>
<div class="main container two-columns-left">
<div class="col-main account_center">
<div class="std">
<div style="margin:19px 0 0">
<div class="page-title">
<h2>My Dashboard</h2>
</div>
<div class="welcome-msg">
<p class="hello"><strong>Hello, !</strong></p>
<p>From your My Account Dashboard you have the ability to view a snapshot of your recent account activity and update your account information. Select a link below to view or edit information.</p>
</div>
<div class="box-account box-info">
<div class="col2-set">
<div class="col-1">
<div class="box">
<div class="box-title">
<h3>Contact Information</h3>
<a href="http://www.intosmile.com/customer/account/edit">Edit</a>
</div>
<div class="box-content">
<div>
<span style="margin:0 10px;">xxxx@dsfasdfdssdf.com </span>
</div>
</div>
</div>
</div>
</div>
<div class="col2-set addressbook">
<div class="col2-set">
<div class="col-1">
<div class="box">
<div class="box-title">
<h3>Address Book</h3>
</div>
<div class="box-content">
<p>You Can Manager Your Address. </p>
<a href="http://www.intosmile.com/customer/address">Manager Addresses</a>
</div>
</div>
</div>
<div class="col-2">
<div class="box">
<div class="box-title">
<h3>Order</h3>
</div>
<div class="box-content">
<p>You Can View Your Order. </p>
<a href="http://www.intosmile.com/customer/order/index">View</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-left ">
<?php
$leftMenu = [
'class' => 'fecshop\app\appfront\modules\Customer\block\LeftMenu',
'view' => 'customer/leftmenu.php'
];
?>
<?= Yii::$service->page->widget->render($leftMenu,$this); ?>
</div>
<div class="clear"></div>
</div>
\ No newline at end of file
<div class="main container two-columns-left">
<div class="col-main account_center">
</div>
<div class="col-left ">
<?php
$leftMenu = [
'class' => 'fecshop\app\appfront\modules\Customer\block\LeftMenu',
'view' => 'customer/leftmenu.php'
];
?>
<?= Yii::$service->page->widget->render($leftMenu,$this); ?>
</div>
<div class="clear"></div>
</div>
\ No newline at end of file
<div class="main container two-columns-left">
<div class="col-main account_center">
<div class="std">
<div style="margin:19px 0 0">
<div class="page-title">
<h2>Edit Account Information</h2>
</div>
<form method="post" id="form-validate" autocomplete="off" action="<?= $actionUrl ?>">
<?= \fec\helpers\CRequest::getCsrfInputHtml(); ?>
<div class="">
<ul class="">
<li>
<label for="email" class="required">Email Address</label>
<div class="input-box">
<input style="color:#ccc;" readonly="true" id="customer_email" name="editForm[email]" value="<?= $email ?>" title="Email" maxlength="255" class="input-text required-entry" type="text">
</div>
</li>
<li class="">
<div class="field name-firstname">
<label for="firstname" class="required">First Name</label>
<div class="input-box">
<input id="firstname" name="editForm[first_name]" value="<?= $firstname ?>" title="First Name" maxlength="255" class="input-text required-entry" type="text">
<div class="validation-advice" id="required_current_firstname" style="display:none;">This is a required field.</div>
</div>
</div>
</li>
<li>
<div class="field name-lastname">
<label for="lastname" class="required">Last Name</label>
<div class="input-box">
<input id="lastname" name="editForm[last_name]" value="<?= $lastname ?>" title="Last Name" maxlength="255" class="input-text required-entry" type="text">
<div class="validation-advice" id="required_current_lastname" style="display:none;">This is a required field.</div>
</div>
</div>
</li>
<li class="control">
<input name="editForm[change_password]" id="change_password" value="1" onclick="setPasswordForm(this.checked)" title="Change Password" class="checkbox" type="checkbox">
<label style="display:inline;vertical-align: middle;" for="change_password">Change Password</label>
</li>
</ul>
</div>
<div class="" id="fieldset_pass" style="display:none;">
<ul class="form-list">
<li>
<label style="font-weight:100;" for="current_password" class="required">Current Password</label>
<div class="input-box">
<input title="Current Password" class="input-text required-entry" name="editForm[current_password]" id="current_password" type="password">
<div class="validation-advice" id="required_current_password" style="display:none;">This is a required field.</div>
</div>
</li>
<li class="fields">
<div class="field">
<label style="font-weight:100;" for="password" class="required">New Password</label>
<div class="input-box">
<input title="New Password" class="input-text validate-password required-entry" name="editForm[password]" id="password" type="password">
<div class="validation-advice" id="required_new_password" style="display:none;">This is a required field.</div>
</div>
</div>
<div class="field">
<label style="font-weight:100;" for="confirmation" class="required"><em>*</em>Confirm New Password</label>
<div class="input-box">
<input title="Confirm New Password" class="input-text validate-cpassword required-entry" name="editForm[confirmation]" id="confirmation" type="password">
<div class="validation-advice" id="required_confirm_password" style="display:none;">This is a required field.</div>
</div>
</div>
<div class="clear"></div>
</li>
</ul>
</div>
<div class="buttons-set">
<button onclick="return check_edit()" type="submit" id="js_registBtn" class="redBtn"><em><span><i></i>SAVE</span></em></button>
</div>
</form>
</div>
</div>
</div>
<div class="col-left ">
<?php
$leftMenu = [
'class' => 'fecshop\app\appfront\modules\Customer\block\LeftMenu',
'view' => 'customer/leftmenu.php'
];
?>
<?= Yii::$service->page->widget->render($leftMenu,$this); ?>
</div>
<div class="clear"></div>
</div>
<script>
<?php $this->beginBlock('customer_account_info_update') ?>
function setPasswordForm(arg){
if(arg){
$('#fieldset_pass').show();
}else{
$('#fieldset_pass').hide();
}
}
function check_edit(){
$check_current_password = true;
$check_new_password = true;
$check_confir_password = true;
$check_current_firstname = true;
$check_current_lastname = true;
$firstname = $('#firstname').val();
$lastname = $('#lastname').val();
$check_confir_password_with_pass = true;
if($firstname == ''){
$('#firstname').addClass('validation-failed');
$('#required_current_firstname').show();
$check_current_firstname = false;
}else{
$('#firstname').removeClass('validation-failed');
$('#required_current_firstname').hide();
$check_current_firstname = true;
}
if($lastname == ''){
$('#lastname').addClass('validation-failed');
$('#required_current_lastname').show();
$check_current_lastname = false;
}else{
$('#lastname').removeClass('validation-failed');
$('#required_current_lastname').hide();
$check_current_lastname = true;
}
if($('#change_password').is(':checked')){
$current_password = $('#current_password').val();
$password = $('#password').val();
$confirmation = $('#confirmation').val();
if($current_password == ''){
$('#current_password').addClass('validation-failed');
$('#required_current_password').show();
$check_current_password = false;
}else{
$('#current_password').removeClass('validation-failed');
$('#required_current_password').hide();
$check_current_password = true;
}
if($password == ''){
$('#password').addClass('validation-failed');
$('#required_new_password').show().html('This is a required field.');;
$check_new_password = false;
}else{
if(!checkPass($password)){
$('#password').addClass('validation-failed');
$('#required_new_password').show();
$('#required_new_password').html('Must have 6 to 30 characters and no spaces.');
$check_new_password = false;
}else{
$('#password').removeClass('validation-failed');
$('#required_new_password').hide();
$check_new_password = true;
}
}
if($confirmation == ''){
$('#confirmation').addClass('validation-failed');
$('#required_confirm_password').show().html('This is a required field.');
$check_confir_password = false;
}else{
if(!checkPass($confirmation)){
$('#confirmation').addClass('validation-failed');
$('#required_confirm_password').show();
$('#required_confirm_password').html('Must have 6 to 30 characters and no spaces.');
$check_confir_password = false;
}else{
if($password != $confirmation){
$('#confirmation').addClass('validation-failed');
$('#required_confirm_password').show();
$('#required_confirm_password').html('Two password is not the same!');
$check_confir_password_with_pass = false;
}else{
$('#confirmation').removeClass('validation-failed');
$('#required_confirm_password').hide();
$check_confir_password = true;
}
}
}
}
if( $check_confir_password_with_pass && $check_current_firstname && $check_current_lastname && $check_confir_password && $check_new_password && $check_current_password){
return true;
}else{
return false;
}
}
function checkPass(str){
var re = /^\w{6,30}$/;
if(re.test(str)){
return true;
}else{
return false;
}
}
function checkEmail(str){
var myReg = /^[-_A-Za-z0-9]+@([_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/;
if(myReg.test(str)) return true;
return false;
}
<?php $this->endBlock(); ?>
</script>
<?php $this->registerJs($this->blocks['customer_account_info_update'],\yii\web\View::POS_END);//将编写的js代码注册到页面底部 ?>
\ No newline at end of file
<div class="col-left sidebar">
<div class="block block-account">
<div class="block-title">
<strong><span>My Account</span></strong>
</div>
<div class="block-content">
<ul>
<?php if(!empty($leftMenuArr) && is_array($leftMenuArr)){ ?>
<?php foreach($leftMenuArr as $one){ ?>
<li <?= $one['current'] ?>>
<a href="<?= $one['url'] ?>" ><?= $one['name'] ?></a>
</li>
<?php } ?>
<?php } ?>
</ul>
</div>
</div>
</div>
\ No newline at end of file
<div class="main container two-columns-left">
<div class="col-main account_center">
</div>
<div class="col-left ">
<?php
$leftMenu = [
'class' => 'fecshop\app\appfront\modules\Customer\block\LeftMenu',
'view' => 'customer/leftmenu.php'
];
?>
<?= Yii::$service->page->widget->render($leftMenu,$this); ?>
</div>
<div class="clear"></div>
</div>
\ No newline at end of file
<div class="main container two-columns-left">
<div class="col-main account_center">
</div>
<div class="col-left ">
<?php
$leftMenu = [
'class' => 'fecshop\app\appfront\modules\Customer\block\LeftMenu',
'view' => 'customer/leftmenu.php'
];
?>
<?= Yii::$service->page->widget->render($leftMenu,$this); ?>
</div>
<div class="clear"></div>
</div>
\ No newline at end of file
<div class="main container two-columns-left">
<div class="col-main account_center">
</div>
<div class="col-left ">
<?php
$leftMenu = [
'class' => 'fecshop\app\appfront\modules\Customer\block\LeftMenu',
'view' => 'customer/leftmenu.php'
];
?>
<?= Yii::$service->page->widget->render($leftMenu,$this); ?>
</div>
<div class="clear"></div>
</div>
\ No newline at end of file
......@@ -58,8 +58,8 @@ class Email extends Service
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.sendgrid.net',
'username' => 'support@onfancymail.com',
'password' => 'check301',
'username' => 'support@mail.com',
'password' => 'xxxx',
'port' => '587',
'encryption' => 'tls',
],
......
......@@ -105,6 +105,7 @@ class Store extends Service
if(!$init_compelte){
throw new InvalidValueException('this domain is not config in store component');
}
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册