Commit 5845a9f46a4a43996d39b0f6f4dd0ca970e94778

Authored by Karnovsky A
2 parents 83be3cfb e27b3a51

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	frontend/web/css/style.css
backend/views/articles/view.php
... ... @@ -31,13 +31,10 @@ $this->params['breadcrumbs'][] = $this->title;
31 31 'id',
32 32 'date',
33 33 'title',
34   - 'body:ntext',
35   - 'image',
36 34 'translit',
37 35 'meta_title',
38 36 'meta_keywords',
39 37 'meta_description',
40   - 'seo_text:ntext',
41 38 'h1',
42 39 ],
43 40 ]) ?>
... ...
backend/views/event/view.php
... ... @@ -31,21 +31,9 @@ $this->params['breadcrumbs'][] = $this->title;
31 31 'event_id',
32 32 'name',
33 33 'alias',
34   - 'body:ntext',
35   - [
36   - 'format' => 'html',
37   - 'attribute' => 'imageUrl',
38   - 'value' => function($data) {
39   - return \common\components\artboximage\ArtboxImageHelper::getImage($data->imageUrl, 'list');
40   - },
41   - ],
42 34 'meta_title',
43 35 'description',
44 36 'h1',
45   - 'seo_text:ntext',
46   - 'created_at',
47   - 'updated_at',
48   - 'end_at',
49 37 ],
50 38 ]) ?>
51 39  
... ...
common/models/Orders.php
... ... @@ -28,7 +28,7 @@ class Orders extends \yii\db\ActiveRecord
28 28 return [
29 29 'name' => 'Ф.И.О',
30 30 'phone'=>'Телефон',
31   - 'phone2'=>'Дополнительный телефон',
  31 + 'phone2'=>'Доп. Тел.',
32 32 'body'=>'Сообщение',
33 33 'adress'=>'Адрес',
34 34 'city'=>'Город',
... ...
frontend/views/basket/index.php
... ... @@ -14,12 +14,12 @@ $this->registerMetaTag(['name' => 'keywords', 'content' => 'Корзина']);
14 14 $this->registerJsFile(Yii::$app->request->baseUrl.'/js/jquery.mask.js',['position'=>View::POS_HEAD,'depends'=>['yii\web\YiiAsset']]);
15 15  
16 16 $this->registerJs("
17   -$('#order-phone,#order-phone2').mask('(000) 000-0000');
  17 +$('#orders-phone,#orders-phone2').mask('(000) 000-0000');
18 18 ", View::POS_READY, 'mask');
19 19  
20 20  
21 21 $this->registerJs("
22   -$('#order-delivery input[type=\"radio\"]').click(function(){
  22 +$('#orders-delivery input[type=\"radio\"]').click(function(){
23 23 $('.delivery-data').hide();
24 24 $('#delivery-data-'+$(this).val()).show();
25 25 });
... ... @@ -42,34 +42,93 @@ $('#order-delivery input[type=\"radio\"]').click(function(){
42 42 <div class="ten"></div>
43 43  
44 44 <?php $form = ActiveForm::begin(['enableClientScript' => false]); ?>
45   -<div class="rightbar">
  45 +<div class="rightbar basket_rightbar">
46 46 <div class="form-order">
47   -<?php echo $form->field($modelOrder,'name'); ?>
48   -<?php echo $form->field($modelOrder,'phone'); ?>
49   -<?php echo $form->field($modelOrder,'phone2'); ?>
50   -<?php echo $form->field($modelOrder,'city'); ?>
51   -<?php echo $form->field($modelOrder,'adress'); ?>
52   -<?php echo $form->field($modelOrder,'email'); ?>
53   - <?= $form->field($modelOrder, 'delivery')
54   - ->radioList(ArrayHelper::map(Delivery::find()->where(['parent_id'=>0])->asArray()->all(), 'id', 'title'))
55   - ?>
  47 + <div class="input-blocks-group">
  48 + <div class="title_groups">контакты</div>
  49 + <div class="input-blocks-wrapper" style="margin-top: 0">
  50 + <?php echo $form->field($modelOrder, 'name', [ 'options' => [ 'class' => 'input-blocks basket_input_2' ] ])->textInput([ 'class' => 'custom-input-2' ]); ?>
  51 + </div>
  52 + <div class="input-blocks-wrapper">
  53 + <?php echo $form->field($modelOrder, 'phone', [ 'options' => [ 'class' => 'input-blocks basket_input_2' ] ])->textInput([ 'class' => 'custom-input-2' ]); ?>
  54 + </div>
  55 + <div class="input-blocks-wrapper">
  56 + <?php echo $form->field($modelOrder, 'phone2', [ 'options' => [ 'class' => 'input-blocks basket_input_2' ] ])->textInput([ 'class' => 'custom-input-2' ]); ?>
  57 + </div>
  58 + <div class="input-blocks-wrapper">
  59 + <?php echo $form->field($modelOrder, 'city', [ 'options' => [ 'class' => 'input-blocks basket_input_2' ] ])->textInput([ 'class' => 'custom-input-2' ]); ?>
  60 + </div>
  61 + <div class="input-blocks-wrapper">
  62 + <?php echo $form->field($modelOrder, 'adress', [ 'options' => [ 'class' => 'input-blocks basket_input_2' ] ])->textInput([ 'class' => 'custom-input-2' ]); ?>
  63 + </div>
  64 + <div class="input-blocks-wrapper">
  65 + <?php echo $form->field($modelOrder, 'email', [ 'options' => [ 'class' => 'input-blocks basket_input_2' ] ])->textInput([ 'class' => 'custom-input-2' ]); ?>
  66 + </div>
  67 + </div>
  68 +
  69 + <div class="input-blocks-group radio_grp">
  70 + <div class="input-blocks-wrapper">
  71 + <?= $form->field($modelOrder, 'delivery')
  72 + ->radioList(ArrayHelper::map(Delivery::find()->where(['parent_id'=>0])->asArray()->all(), 'id', 'title'),[
  73 + 'item' => function($index, $label, $name, $checked, $value) {
  74 + $return = '<div class="custom-form-buttons">';
  75 + $return .= '<input class="custom-radio" id="custom-radio-' . $value . '" ' . ( $checked ? "checked" : "" ) . ' type="radio" name="' . $name . '" value="' . $value . '" >';
  76 + $return .= '<label for="custom-radio-' . $value . '" ><span></span>' . $label . '</label>';
  77 + $return .= '</div>';
  78 + return $return;
  79 + },
  80 + ])
  81 + ?>
  82 + </div>
  83 + </div>
  84 +
  85 +
56 86 <div class="both"></div>
57 87  
58 88 <?php foreach(Delivery::find()->where(['parent_id'=>0])->all() as $item):?>
59 89 <div class='delivery-data' id='delivery-data-<?=$item->id?>'>
60 90 <?=$item->text?>
61 91 <?= $form->field($modelOrder, 'delivery')
62   - ->radioList(ArrayHelper::map(Delivery::find()->where(['parent_id'=>$item->id])->asArray()->all(), 'id', 'title'),['id' => 'order-delivery-childs'])->label(false)
63   - ?>
64   -</div>
  92 + ->radioList(ArrayHelper::map(Delivery::find()->where(['parent_id'=>$item->id])->asArray()->all(), 'id', 'title'), [
  93 + 'id'=> 'order-delivery-childs',
  94 + 'item' => function($index, $label, $name, $checked, $value) {
  95 + $return = '<div class="custom-form-buttons">';
  96 + $return .= '<input class="custom-radio" id="custom-radio-' . $value . '" ' . ( $checked ? "checked" : "" ) . ' type="radio" name="' . $name . '" value="' . $value . '" >';
  97 + $return .= '<label for="custom-radio-' . $value . '" ><span></span>' . $label . '</label>';
  98 + $return .= '</div>';
  99 + return $return;
  100 + },
  101 + ]);?>
  102 +</div>
  103 +
65 104 <?php endforeach;?>
  105 + <div class="input-blocks-group radio_grp">
  106 + <div class="input-blocks-wrapper">
  107 + <?php echo $form->field($modelOrder, 'payment')->radioList(['Оплатить наличными'=>'Оплатить наличными','Оплатить на карту Приват Банка'=>'Оплатить на карту Приват Банка','Оплатить по безналичному расчету'=>'Оплатить по безналичному расчету','Оплатить Правекс-телеграф'=>'Оплатить Правекс-телеграф','Наложенным платежом'=>'Наложенным платежом'],[
  108 + 'item' => function($index, $label, $name, $checked, $value) {
  109 + $return = '<div class="custom-form-buttons">';
  110 + $return .= '<input class="custom-radio" id="custom-radio-' . $value . '" ' . ( $checked ? "checked" : "" ) . ' type="radio" name="' . $name . '" value="' . $value . '" >';
  111 + $return .= '<label for="custom-radio-' . $value . '" ><span></span>' . $label . '</label>';
  112 + $return .= '</div>';
  113 + return $return;
  114 + },
  115 + ]); ?>
  116 + </div>
  117 + </div>
  118 +
66 119  
67   -<?php echo $form->field($modelOrder, 'payment')->radioList(['Оплатить наличными'=>'Оплатить наличными','Оплатить на карту Приват Банка'=>'Оплатить на карту Приват Банка','Оплатить по безналичному расчету'=>'Оплатить по безналичному расчету','Оплатить Правекс-телеграф'=>'Оплатить Правекс-телеграф','Наложенным платежом'=>'Наложенным платежом']); ?>
68   -<div class="both"></div>
69 120  
70 121  
71   -<?php echo $form->field($modelOrder,'body')->textarea(['rows'=>7]); ?>
72   -<?php echo Html::submitButton(' Оформить заказ ',array('class'=>'submit4')); ?>
  122 +
  123 +
  124 +<div class="input-blocks-group textareagroup" style="border-bottom: none;">
  125 + <?php echo $form->field($modelOrder,'body')->textarea(['rows'=>7]); ?>
  126 +
  127 + <?php echo Html::submitButton(' Оформить заказ ',array('class'=>'submit4')); ?>
  128 +</div>
  129 +
  130 + <div class="both"></div>
  131 +
73 132 </div>
74 133 </div>
75 134 <div class="content">
... ... @@ -77,11 +136,11 @@ $(&#39;#order-delivery input[type=\&quot;radio\&quot;]&#39;).click(function(){
77 136  
78 137 <?php foreach($basket_mods as $i=>$item):?>
79 138 <div class="basket_item">
80   - <a href="<?=Url::to(['products/show','translit_rubric'=>$item->translit_rubric,'translit'=>$item->translit,'id'=>$item->product_id])?>">
  139 + <a href="<?= Url::to(['catalog/product', 'product' => $item->product,'#' => 'm' .$item->product_variant_id]) ?>">
81 140 <?= \common\components\artboximage\ArtboxImageHelper::getImage($item->imageUrl, 'product_basket')?>
82 141 </a>
83 142 <div class="info">
84   - <a href="<?=Url::to(['products/show','translit_rubric'=>$item->translit_rubric,'translit'=>$item->translit,'id'=>$item->product_id])?>" class="link2"><?=$item->product_name?></a>
  143 + <a href="<?= Url::to(['catalog/product', 'product' => $item->product,'#' => 'm' .$item->product_variant_id]) ?>" class="link2"><?=$item->product_name?></a>
85 144 <p>Код: <?=$item->sku?>, цвет: <?=$item->name?></p>
86 145 <?php echo $form->field($item,'['.$i.']id')->hiddenInput()->label(false); ?>
87 146 <?php echo $form->field($item,'['.$i.']product_name')->hiddenInput()->label(false); ?>
... ...
frontend/views/catalog/product.php
... ... @@ -183,3 +183,16 @@ $this-&gt;registerJs (&quot;
183 183 </div>
184 184 <div class="both"></div>
185 185 </div>
  186 +
  187 +<?php
  188 +//$this->registerJs ("
  189 +// var productHash = window.location.hash;
  190 +// productHash = productHash.replace('#','')
  191 +//
  192 +// var productUl = $('ul.product_mod li')
  193 +// var productA = productUl.find('a#'+productHash)
  194 +// productUl.removeClass('active')
  195 +// productA.parent().addClass('active')
  196 +// console.log(productA)
  197 +// ", View::POS_READY, 'new_script');
  198 +//?>
186 199 \ No newline at end of file
... ...
frontend/views/catalog/product_item.php
... ... @@ -5,7 +5,7 @@ use yii\helpers\Url;
5 5 <li class="item">
6 6 <div class="boxitem">
7 7 <div class="pixbox">
8   - <a href="<?= Url::to(['catalog/product', 'product' => $product]) ?>">
  8 + <a href="<?= Url::to(['catalog/product', 'product' => $product,'#' => 'm' .$product->variant->product_variant_id]) ?>">
9 9 <?= \common\components\artboximage\ArtboxImageHelper::getImage($product->imageUrl, 'list')?>
10 10 </a>
11 11 </div>
... ... @@ -24,7 +24,8 @@ use yii\helpers\Url;
24 24 <?php endif?>
25 25 <a href="<?= Url::to([
26 26 'catalog/product',
27   - 'product' => $product])
  27 + 'product' => $product,
  28 + '#' => 'm' .$product->variant->product_variant_id])
28 29 ?>" class="name"><?= $product->fullname ?>
29 30 </a>
30 31  
... ...
frontend/web/css/style.css
... ... @@ -196,7 +196,8 @@ a.more_map{color:#99a5ad;border-bottom:1px dotted #99a5ad;text-decoration:none;f
196 196  
197 197 .loyout{padding:20px 0px;}
198 198 .leftbar{float:left;width:172px;margin-right: 20px; }
199   -.rightbar{float:right;width:380px;margin-left:35px;}
  199 +.rightbar{float:right;width:380px;margin-left:40px;}
  200 +.rightbar.basket_rightbar{margin-right: 20px;}
200 201 .rightbar2{float:right;width:320px;}
201 202 .content {overflow:hidden;min-height:500px;}
202 203 * html .content{height:1%;}
... ... @@ -522,11 +523,11 @@ ul.social {margin-top: 20px;}
522 523 .pixbox{width:160px;margin:0 auto;height:200px;overflow: hidden;text-align: center;}
523 524  
524 525  
525   -.form-order{background:#f5f5f5;padding:10px;border:1px solid #d2d2d2;}
  526 +.form-order{background:#f5f5f5;padding:0 20px 20px 20px;}
526 527 #order-payment{float:right;width:280px;}
527 528 #order-delivery{float:right;width:280px;}
528 529  
529   -.delivery-data{padding:5px;border:1px solid #1bb631;background: #b7f5bf;display:none;border-radius: 5px;}
  530 +.delivery-data{padding:5px;border:1px solid #1bb631;background: #b7f5bf;display:none;border-radius: 5px;float: left;}
530 531  
531 532 .jcarousel-next-disabled, .jcarousel-prev-disabled {display: none !important;}
532 533 .content2 br {display: none;}
... ... @@ -1274,13 +1275,116 @@ ul.product-special li.promo:after {
1274 1275 padding: 0 13px;
1275 1276 height: 28px;
1276 1277 }
1277   -.field-orders-delivery .control-label, .field-orders-payment .control-label, .field-orders-body .control-label {
  1278 +.field-orders-delivery .control-label, .field-orders-payment .control-label, .field-orders-body .control-label, .control-label {
1278 1279 width: 100%;
1279 1280 float: left;
1280 1281 }
1281 1282 .basket_title_ {
1282 1283 text-align: center;
1283 1284 }
  1285 +.cont_shopping {
  1286 + display: block !important;
  1287 + border-top: 0!important;
  1288 + border-left: 0!important;
  1289 + border-right: 0!important;
  1290 + border-bottom: 1px dashed #799920!important;
  1291 + color: #799920!important;
  1292 + margin: 0!important;
  1293 + padding: 0!important;
  1294 + font-size: 12px!important;
  1295 + float: left;
  1296 + border-radius: 0 !important;
  1297 +}
  1298 +.info.product-thumb-video {
  1299 + width: 100%;
  1300 + height: 100%;
  1301 +}
  1302 +.info.product-thumb-video iframe {
  1303 + width: 100% !important;
  1304 + height: 100% !important;
  1305 +}
  1306 +.input-blocks-wrapper, .input-blocks {
  1307 + width: 100%;
  1308 + float: left;
  1309 +}
  1310 +.form-order .input-blocks-wrapper {
  1311 + margin-top: 6px;
  1312 +}
  1313 +.input-blocks label {
  1314 + font-size: 13px;
  1315 + color: #333;
  1316 +}
  1317 +.basket_input_2 label {
  1318 + height: 30px;
  1319 + line-height: 30px;
  1320 + float: left;
  1321 + width: 70px !important;
  1322 + padding-top: 0 !important;
  1323 +}
  1324 +
  1325 +.custom-input-2 {
  1326 + width: 100%;
  1327 + height: 30px;
  1328 + border: 1px solid #d2d2d2;
  1329 + box-sizing: border-box;
  1330 + outline: none;
  1331 + color: #636363;
  1332 + font-size: 13px;
  1333 + line-height: 30px;
  1334 + padding-left: 8px;
  1335 + margin-top: 5px;
  1336 + background: #fff;
  1337 + border-radius: 4px;
  1338 +}
  1339 +.basket_input_2 .custom-input-2 {
  1340 + width: 270px;
  1341 + float: right;
  1342 + margin-top: 0;
  1343 +}
  1344 +.custom-input-2:focus, .custom-area-3:focus{box-shadow: 1px 2px 2px 0px rgba(215, 215, 215, 0.75) inset; transition: 0.1s}
  1345 +.title_groups, .radio_grp label.control-label {
  1346 + font-size: 12px;
  1347 + font-weight: bold;
  1348 + text-transform: uppercase;
  1349 + margin-bottom: 12px;
  1350 +}
  1351 +.input-blocks-group {
  1352 + width: 100%;
  1353 + float: left;
  1354 + border-bottom: 1px solid #d2d2d2;
  1355 + padding-bottom: 20px;
  1356 + margin-top: 18px;
  1357 +}
  1358 +.custom-form-buttons {
  1359 + width: 100%;
  1360 + float: left;
  1361 +}
  1362 +input.custom-radio + label, input.custom-check + label {
  1363 + font-size: 13px;
  1364 + cursor: pointer;
  1365 + margin-left: 6px;
  1366 +}
  1367 +/***radio***/
  1368 +input.custom-radio, input.custom-check {display: none}
  1369 +input.custom-radio + label span{
  1370 + width: 16px;
  1371 + height: 16px;
  1372 + background: url('../img/radio_new.png') no-repeat;
  1373 + float: left;
  1374 + transition: .2s;
  1375 + margin-top: 1px;
  1376 +}
  1377 +input.custom-radio:checked + label span, input.custom-radio:checked + label:hover span {
  1378 + background: url('../img/radio_new-active.png') no-repeat;
  1379 +}
  1380 +
  1381 +input.custom-radio + label:hover {
  1382 + text-decoration: underline;
  1383 +}
  1384 +.custom-form-buttons {
  1385 + margin-top: 7px;
  1386 +}
  1387 +.custom-form-buttons:first-child {margin-top: 0}
1284 1388 .product-thumb-video iframe {
1285 1389 width: 260px;
1286 1390 height: auto;
... ...
frontend/web/img/radio_new-active.png 0 → 100644

1.31 KB

frontend/web/img/radio_new.png 0 → 100644

1.22 KB

frontend/web/js/basket.js
... ... @@ -26,42 +26,48 @@
26 26 });
27 27 }
28 28  
29   - var popup = function(w,form){
30   - $.get("/basket/items/", {} ,function(data){
31   - $('.basket_items').html(data);
32   - $('.basket_items .delete_button').click(function(){
33   - var id =$(this).data('id');
34   - $.get("/basket/items/", {deleteID : id},function(data){
35   - popup(w,form);
36   - start_basket(w,form);
37   - });
38   - return false;
  29 +
  30 + var update = function(data,form,w){
  31 + console.log(data);
  32 + $('.basket_items').html(data);
  33 + $('.basket_items .delete_button').click(function(){
  34 + var id =$(this).data('id');
  35 + $.get("/basket/items/", {deleteID : id},function(data){
  36 + popup(w,form);
  37 + start_basket(w,form);
39 38 });
40   - $(".item_num").bind('input',function(){
  39 + return false;
  40 + });
  41 + $(".item_num").bind('input',function(){
  42 + sendformitems(w,form);
  43 + });
  44 + $(".minus").click(function(){
  45 + var a = $(this).parent().find(".item_num").attr("value");
  46 + if (a == 1) {
  47 + /* минимум 1 элемент */
  48 + }
  49 + else{
  50 + a--;
  51 + $(this).parent().find('.item_num').val(a);
41 52 sendformitems(w,form);
42   - });
43   - $(".minus").click(function(){
44   - var a = $(this).parent().find(".item_num").attr("value");
45   - if (a == 1) {
46   - /* минимум 1 элемент */
47   - }
48   - else{
49   - a--;
50   - $(this).parent().find('.item_num').val(a);
51   - sendformitems(w,form);
52   - }
53   - });
54   - $(".plus").click(function(){
55   - var a = $(this).parent().find(".item_num").attr("value");
56   - if (a == 10) {
57   - /* минимум 1 элемент */
58   - }
59   - else{
60   - a++;
61   - $(this).parent().find('.item_num').val(a);
62   - sendformitems(w,form);
63   - }
64   - });
  53 + }
  54 + });
  55 + $(".plus").click(function(){
  56 + var a = $(this).parent().find(".item_num").attr("value");
  57 + if (a == 10) {
  58 + /* минимум 1 элемент */
  59 + }
  60 + else{
  61 + a++;
  62 + $(this).parent().find('.item_num').val(a);
  63 + sendformitems(w,form);
  64 + }
  65 + });
  66 + };
  67 +
  68 + var popup = function(w,form){
  69 + $.get("/basket/items/", {} ,function(data){
  70 + update(data,form,w);
65 71 });
66 72 if(w==0) {
67 73 $(".black").removeClass("hidden");
... ... @@ -75,19 +81,20 @@
75 81 }
76 82  
77 83 var sendformitems = function(w,form){
78   - var data_form = $(form+' .basket_form2').serialize();
79   - console.log(data_form);
80   -
81   - $.ajax({
82   - type: 'POST',
83   - url: "/basket/items/",
84   - dataType: "json",
85   - data: data_form,
86   - success: function(data) {
87   - popup(w,form);
88   - start_basket();
89   - },
  84 + //var data_form = $(form+' .basket_form2').serialize();
  85 + $.post('/basket/items/', $.param($(form+' .basket_form2').serializeArray()), function(data) {
  86 + update(data,form,w);
  87 + start_basket();
90 88 });
  89 + //$.ajax({
  90 + // type: 'POST',
  91 + // url: "/basket/items/",
  92 + // dataType: "json",
  93 + // data: data_form,
  94 + // done: function(data) {
  95 + //
  96 + // },
  97 + //});
91 98 }
92 99  
93 100 var start_basket = function(){
... ...