This commit is contained in:
Meylis Gazakow 2022-04-28 15:09:59 +03:00
commit 9da0953d0f
25 changed files with 869 additions and 126 deletions

16
config/bank.php Normal file
View File

@ -0,0 +1,16 @@
<?php
return [
'halkbank' => [
'bank_name' => 'Halkbank',
'class' => 'TPS\Birzha\Classes\Halkbank'
],
'rysgal' => [
'bank_name' => 'Rysgal bank',
'class' => 'TPS\Birzha\Classes\Rysgal'
],
'senagat' => [
'bank_name' => 'Senagat PTB',
'class' => 'TPS\Birzha\Classes\Senagat'
],
];

View File

@ -1,12 +1,12 @@
<?php namespace AhmadFatoni\ApiGenerator\Controllers\API;
use Illuminate\Http\Request;
use Cms\Classes\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use October\Rain\Support\Facades\Event;
use TPS\Birzha\Classes\TranslatedErrSucMsgResponseApi;
use TPS\Birzha\Models\Payment;
use TPS\Birzha\Classes\Payment as PaymentAPI;
use TPS\Birzha\Classes\TransactionResource;
class TransactionsApiController extends KabinetAPIController
@ -45,6 +45,7 @@ class TransactionsApiController extends KabinetAPIController
$validator = Validator::make($request->all(), [
'type' => 'required|in:bank,online',
'card_type' => 'required_if:type,online|in:halkbank,rysgal,senagat',
'amount' => 'required_if:type,online|numeric|gt:0',
'bank_file' => 'required_if:type,bank|mimes:pdf,jpg,png',
]);
@ -53,31 +54,35 @@ class TransactionsApiController extends KabinetAPIController
return response()->json($validator->errors(), 400);
}
$payment = $this->createNewPayment(false, $request->all());
$formData = $request->all();
$payment = $this->createNewPayment(false, $formData);
if($payment->payment_type == 'online'){
$payment->amount = $request->get('amount');
$url = url('bank_result', ['payment_id' => $payment->id]);
try {
$response = PaymentAPI::registerOrder($payment, $url);
// Halkbank or Rysgal or Senagat
$onlinePaymentClass = Config::get('bank.' . $formData['card_type'] . '.class');
$onlinePayment = new $onlinePaymentClass;
$response = $onlinePayment->registerOrder($payment, $url);
$result = json_decode($response->body, true);
if($result['errorCode'] == 0) {
$successfullyRegistered = $onlinePayment->checkRegisterOrderErrorCode($result);
if($successfullyRegistered) {
$payment->order_id = $result['orderId'];
$payment->save();
return response()->json(['formUrl' => $result['formUrl']], 200);
} else {
return response()->json(['error' => [
'ru' => trans('validation.api.bank_services_unavailable', [], 'ru'),
'en' => trans('validation.api.bank_services_unavailable', [], 'en'),
'tm' => trans('validation.api.bank_services_unavailable', [], 'tm'),
]], 200);
return response()->json(TranslatedErrSucMsgResponseApi::translateErrorMessage('error', 'api.bank_services_unavailable'), 200);
}
} catch(\Throwable $th){
@ -86,11 +91,7 @@ class TransactionsApiController extends KabinetAPIController
Log::info($th->getMessage());
return response()->json(['error' => [
'ru' => trans('validation.api.online_payment_failed', [], 'ru'),
'en' => trans('validation.api.online_payment_failed', [], 'en'),
'tm' => trans('validation.api.online_payment_failed', [], 'tm'),
]], 500);
return response()->json(TranslatedErrSucMsgResponseApi::translateErrorMessage('error', 'api.online_payment_failed'), 200);
}
}
elseif($payment->payment_type == 'bank'){
@ -99,17 +100,9 @@ class TransactionsApiController extends KabinetAPIController
if($payment->save()){
Event::fire('tps.payment.received',$payment);
return response()->json(['success' => [
'ru' => trans('validation.api.bank_payment_saved', [], 'ru'),
'en' => trans('validation.api.bank_payment_saved', [], 'en'),
'tm' => trans('validation.api.bank_payment_saved', [], 'tm'),
]], 200);
return response()->json(TranslatedErrSucMsgResponseApi::translateErrorMessage('success', 'api.bank_payment_saved'), 200);
} else {
return response()->json(['error' => [
'ru' => trans('validation.api.bank_payment_failed', [], 'ru'),
'en' => trans('validation.api.bank_payment_failed', [], 'en'),
'tm' => trans('validation.api.bank_payment_failed', [], 'tm'),
]], 500);
return response()->json(TranslatedErrSucMsgResponseApi::translateErrorMessage('error', 'api.bank_payment_failed'), 500);
}
}
@ -123,6 +116,7 @@ class TransactionsApiController extends KabinetAPIController
$newPayment->user_id = $this->user->id;
$newPayment->amount = $formData['amount'] ?? 0;
$newPayment->payment_type = $formData['type'];
$newPayment->card_type = isset($formData['card_type']) ? $formData['card_type'] : null;
$newPayment->save();
// attach file to payment

View File

@ -0,0 +1,68 @@
<?php namespace TPS\Birzha\Classes;
use TPS\Birzha\Models\Settings;
class Halkbank extends Payment
{
protected function getApiCredentials()
{
return [
'userName' => Settings::getValue('api_login'),
'password' => Settings::getValue('api_password'),
];
}
protected function getApiUrl()
{
return 'https://mpi.gov.tm/payment/rest/';
}
protected function getRegistrationUri()
{
return 'register.do';
}
protected function getStatusUri()
{
return 'getOrderStatus.do';
}
protected function registerOrderParams($payment, $url)
{
return [
'amount' => $payment->amount * 100, //multiply by 100 to obtain tenge
'currency' => 934,
'description' => 'Balansa pul goşmak - Birža şahsy otag',
'orderNumber' => strtoupper(str_random(5)) . date('jn'),
'failUrl' => $url . '?status=failed',
'returnUrl' => $url . '?status=success',
];
}
public function checkRegisterOrderErrorCode($registerOrderResponse)
{
return $registerOrderResponse['errorCode'] == 0;
}
public function checkReturnUrlParams($returnUrlParams, $payment)
{
if (!array_key_exists('status', $returnUrlParams)) {
return false;
}
if($payment && $returnUrlParams['status'] === 'success' && $returnUrlParams['orderId'] === $payment->order_id) {
return true;
} else {
return false;
}
}
public function checkOrderStatusResponseCodes($orderStatusResponse)
{
return $orderStatusResponse['ErrorCode'] == 0 && $orderStatusResponse['OrderStatus'] == 2;
}
}

View File

@ -1,40 +1,33 @@
<?php namespace TPS\Birzha\Classes;
use October\Rain\Network\Http;
use TPS\Birzha\Models\Settings;
class Payment
abstract class Payment
{
abstract protected function getApiCredentials();
abstract protected function getApiUrl();
abstract protected function getRegistrationUri();
abstract protected function getStatusUri();
abstract protected function registerOrderParams($payment, $url);
abstract public function checkRegisterOrderErrorCode($registerOrderResponse);
abstract public function checkReturnUrlParams($returnUrlParams, $payment);
abstract public function checkOrderStatusResponseCodes($orderStatusResponse);
const REGISTRATION_URI = 'register.do';
const STATUS_URI = 'getOrderStatus.do';
const API_URL = 'https://mpi.gov.tm/payment/rest/';
private static function getClient($url){
return Http::make(self::API_URL.$url, Http::METHOD_POST)->data([
'userName' => Settings::getValue('api_login'),
'password' => Settings::getValue('api_password'),
])->timeout(3600);
private function getClient($url){
return Http::make($this->getApiUrl() . $url, Http::METHOD_POST)
->data($this->getApiCredentials())
->timeout(3600);
}
public static function registerOrder($payment, $url) {
$client = self::getClient(self::REGISTRATION_URI);
public function registerOrder($payment, $url) {
$client = $this->getClient($this->getRegistrationUri());
$client->data([
'amount' => $payment->amount * 100,//multiply by 100 to obtain tenge
'currency' => 934,
'description' => 'Balansa pul goşmak - Birža şahsy otag',
'orderNumber' => strtoupper(str_random(5)) . date('jn'),
'failUrl' => $url . '?status=failed',
'returnUrl' => $url . '?status=success',
]);
$client->data($this->registerOrderParams($payment, $url));
$client->setOption(CURLOPT_POSTFIELDS,$client->getRequestData());
return $client->send();
}
public static function getStatus($order_id) {
$client = self::getClient(self::STATUS_URI);
public function getStatus($order_id) {
$client = $this->getClient($this->getStatusUri());
$client->data([
'orderId' => $order_id

View File

@ -0,0 +1,62 @@
<?php namespace TPS\Birzha\Classes;
use TPS\Birzha\Models\Settings;
class Rysgal extends Payment
{
protected function getApiCredentials()
{
return [
'userName' => Settings::getValue('api_login_rysgal'),
'password' => Settings::getValue('api_password_rysgal'),
];
}
protected function getApiUrl()
{
return 'https://epg2.rysgalbank.tm/epg/rest/';
}
protected function getRegistrationUri()
{
return 'register.do';
}
protected function getStatusUri()
{
return 'getOrderStatusExtended.do';
}
protected function registerOrderParams($payment, $url)
{
return [
'amount' => $payment->amount * 100, //multiply by 100 to obtain tenge
'currency' => 934,
'description' => 'Balansa pul goşmak - Birža şahsy otag',
'orderNumber' => strtoupper(str_random(5)) . date('jn'),
'returnUrl' => $url,
];
}
public function checkRegisterOrderErrorCode($registerOrderResponse)
{
return !isset($registerOrderResponse['errorCode']);
}
public function checkReturnUrlParams($returnUrlParams, $payment)
{
if($payment) {
return true;
} else {
return false;
}
}
public function checkOrderStatusResponseCodes($orderStatusResponse)
{
return $orderStatusResponse['errorCode'] == 0 && $orderStatusResponse['orderStatus'] == 2;
}
}

View File

@ -0,0 +1,61 @@
<?php namespace TPS\Birzha\Classes;
use TPS\Birzha\Models\Settings;
class Senagat extends Payment
{
protected function getApiCredentials()
{
return [
'userName' => Settings::getValue('api_login_senagat'),
'password' => Settings::getValue('api_password_senagat'),
];
}
protected function getApiUrl()
{
return 'https://epg.senagatbank.com.tm/epg/rest/';
}
protected function getRegistrationUri()
{
return 'register.do';
}
protected function getStatusUri()
{
return 'getOrderStatus.do';
}
protected function registerOrderParams($payment, $url)
{
return [
'orderNumber' => strtoupper(str_random(5)) . date('jn'),
'amount' => $payment->amount * 100, //multiply by 100 to obtain tenge
'currency' => 934,
'description' => 'Balansa pul goşmak - Birža şahsy otag',
'returnUrl' => $url,
];
}
public function checkRegisterOrderErrorCode($registerOrderResponse)
{
return !isset($registerOrderResponse['errorCode']);
}
public function checkReturnUrlParams($returnUrlParams, $payment)
{
if($payment) {
return true;
} else {
return false;
}
}
public function checkOrderStatusResponseCodes($orderStatusResponse)
{
return $orderStatusResponse['ErrorCode'] == 0 && $orderStatusResponse['OrderStatus'] == 2;
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace TPS\Birzha\Classes;
class TranslatedErrSucMsgResponseApi
{
public static function translateErrorMessage($status, $key)
{
return [$status => [
'ru' => trans("validation.{$key}", [], 'ru'),
'en' => trans("validation.{$key}", [], 'en'),
'tm' => trans("validation.{$key}", [], 'tm'),
]];
}
}

View File

@ -1,14 +1,10 @@
<?php namespace TPS\Birzha\Components;
use Cms\Classes\ComponentBase;
use Cms\Classes\Page;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Config;
use October\Rain\Exception\AjaxException;
use October\Rain\Support\Facades\Event;
use TPS\Birzha\Models\Payment;
use October\Rain\Network\Http;
use TPS\Birzha\Models\Settings;
use TPS\Birzha\Classes\Payment as CardApi;
class Balance extends ComponentBase
{
@ -27,8 +23,8 @@ class Balance extends ComponentBase
$data = post();
$rules = [
// 'payment_type' => 'required',
'amount' => 'required|numeric'
'amount' => 'required|numeric',
'card_type' => 'required_if:payment_type,online|in:halkbank,rysgal,senagat',
];
$this->validateForm($data, $rules);
@ -60,19 +56,27 @@ class Balance extends ComponentBase
$url = $this->controller->pageUrl('bank_result.htm', ['payment_id' => $payment->id]);
$response = CardApi::registerOrder($payment, $url);
// Halkbank or Rysgal or Senagat
$onlinePaymentClass = Config::get('bank.' . $formData['card_type'] . '.class');
$onlinePayment = new $onlinePaymentClass;
$response = $onlinePayment->registerOrder($payment, $url);
$result = json_decode($response->body,true);
if($result['errorCode'] == 0) {
$successfullyRegistered = $onlinePayment->checkRegisterOrderErrorCode($result);
if($successfullyRegistered) {
$payment->order_id = $result['orderId'];
$payment->save();
return $result['formUrl'];
} else {
return false;
}
}
/**
@ -91,8 +95,7 @@ class Balance extends ComponentBase
$newPayment->user_id = \Auth::user()->id;
$newPayment->amount = 0;
$newPayment->payment_type = "bank";
// $newPayment->status = "new";
// $newPayment->save();
// attach file to payment
$newPayment->bank_file = \Input::file('bank_file');
@ -120,7 +123,7 @@ class Balance extends ComponentBase
$newPayment->user_id = \Auth::user()->id;
$newPayment->amount = $formData['amount'];
$newPayment->payment_type = $formData['payment_type'];
// $newPayment->status = "new";
$newPayment->card_type = isset($formData['card_type']) ? $formData['card_type'] : null;
$newPayment->save();
// attach file to payment

View File

@ -1,12 +1,10 @@
<?php namespace Tps\Birzha\Components;
use Cms\Classes\ComponentBase;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Redirect;
use October\Rain\Support\Facades\Event;
use TPS\Birzha\Models\Payment;
use October\Rain\Network\Http;
use TPS\Birzha\Models\Settings;
use TPS\Birzha\Classes\Payment as CardApi;
class PaymentApi extends ComponentBase
{
@ -38,56 +36,41 @@ class PaymentApi extends ComponentBase
if(is_null($payment)) {
return Redirect::to('/404');
} elseif($payment->payment_type == 'bank') {
return Redirect::to('/404');
}
if($payment && \Input::get('status') === 'success' && \Input::get('orderId') === $payment->order_id) {
$responce = json_decode(CardApi::getStatus($payment->order_id), true);
$onlinePaymentClass = Config::get('bank.' . $payment->card_type . '.class');
$onlinePayment = new $onlinePaymentClass;
// if( $responce['ErrorCode'] == 0 && $responce['OrderStatus'] == 2) {
if( $responce['ErrorCode'] == 0) {
if($onlinePayment->checkReturnUrlParams(\Input::all(), $payment)) {
// todo check order Status
$responce = json_decode($onlinePayment->getStatus($payment->order_id), true);
if($onlinePayment->checkOrderStatusResponseCodes($responce)) {
// if page bank_result page is refreshed
if($payment->status === 'approved') {
return Redirect::to('/');
}
$this->orderStatusCode = $responce['OrderStatus'];
$payment->status = 'approved';
switch ($this->orderStatusCode) {
case 2: // OrderStatus 2 OK - the best scenario
$payment->status = 'approved';
if($payment->save()){
Event::fire('tps.payment.received',[$payment]);
$this->balance_message = trans('validation.balance.fill_up_succes');
}
break;
case 0:
$this->balance_message = trans('validation.balance.fill_up_succes_but_delayed');
break;
default:
$payment->status = 'failed';
if($payment->save()) {
$this->balance_message = trans('validation.balance.fill_up_fail');
}
break;
if($payment->save()){
Event::fire('tps.payment.received',[$payment]);
$this->balance_message = trans('validation.balance.fill_up_succes');
}
} else {
// if page bank_result page is refreshed
if($payment->status === 'approved') {
return Redirect::to('/');
}
$payment->status = 'failed';
if($payment->save()) {
$this->balance_message = trans('validation.balance.fill_up_fail');
}
}
} else {
// if page bank_result page is refreshed
@ -101,5 +84,6 @@ class PaymentApi extends ComponentBase
$this->balance_message = trans('validation.balance.fill_up_fail');
}
}
}
}

View File

@ -40,6 +40,11 @@ class Singleoffer extends ComponentBase
$product = Product::find($this->property('offerId'));
if($product && $product->status == 'approved' && $product->ends_at >= \Carbon\Carbon::now()) {
// todo increment number of views
$product->number_of_views = $product->number_of_views + 1;
$product->save();
return $product;
}
return null;

View File

@ -35,7 +35,21 @@
<span class="error_txt" data-validate-for="amount"></span>
</div>
<button type="submit" class="send_btn">
<!-- todo select box with banks -->
<div class="post_input p-b">
<label>Bank <span>*</span> </label>
<div class="my-select">
<select class="category-select" name="card_type">
<option value="halkbank">Halkbank</option>
<option value="halkbank">Halkbank</option>
<!-- <option value="rysgal">Rysgal Bank</option> -->
<option value="senagat">Senagat PBT</option>
</select>
</div>
</div>
<!-- end select box -->
<button type="submit" class="pay_btn">
{{'account.pay'|_}}
</button>
@ -132,7 +146,7 @@
</div>
</div>
<button class="send_btn" type="submit">
<button class="pay_btn" type="submit">
{{'account.send'|_}}
</button>

View File

@ -66,9 +66,19 @@
{{ offer.ends_at|date('d.m.Y') }}
</div>
</div>
<a href="{{ 'offer'|page({ slug: offer.slug, id: offer.id }) }}" class="item_btn">
{{ 'page.more'|_ }}
</a>
<div class="item_row">
<a href="{{ 'offer'|page({ slug: offer.slug, id: offer.id }) }}" class="item_btn">
{{ 'page.more'|_ }}
</a>
<div class="views">
<span>
<img src="{{ 'assets/images/svg/watched.svg'|theme }}" alt="eye-icon">
</span>
<p>
{{ offer.number_of_views }}
</p>
</div>
</div>
</div>
{% endfor %}
</div>

View File

@ -6,7 +6,9 @@
<div class="detail_photo_box">
{% if offer.images[0] %}
{% for image in offer.images %}
<div class="detail_photo">
<div class="detail_photo fancybox" href="{{ image.path }}" data-fancybox="images-preview-1"
data-width="1500" data-height="1000">
<img src="{{ image.thumb(575,290,{'mode':'crop'}) }}" alt="">
</div>
{% endfor %}

View File

@ -21,3 +21,6 @@ columns:
status:
label: Status
type: status
card_type:
label: 'Card (Bank)'
type: text

View File

@ -53,12 +53,32 @@ tabs:
api_login:
tab: Payment
label: Payment api Login
label: Payment api Login (Halkbank)
span: left
api_password:
tab: Payment
label: Payment api password
label: Payment api password (Halkbank)
span: right
api_login_rysgal:
tab: Payment
label: Payment api Login (Rysgal Bank)
span: left
api_password_rysgal:
tab: Payment
label: Payment api password (Rysgal Bank)
span: right
api_login_senagat:
tab: Payment
label: Payment api Login (Senagat PTB)
span: left
api_password_senagat:
tab: Payment
label: Payment api password (Senagat PTB)
span: right
fee:
tab: Payment
label: Fee per product

View File

@ -0,0 +1,23 @@
<?php namespace TPS\Birzha\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateTpsBirzhaPayments5 extends Migration
{
public function up()
{
Schema::table('tps_birzha_payments', function($table)
{
$table->string('card_type')->nullable();
});
}
public function down()
{
Schema::table('tps_birzha_payments', function($table)
{
$table->dropColumn('card_type');
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace TPS\Birzha\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateTpsBirzhaProducts25 extends Migration
{
public function up()
{
Schema::table('tps_birzha_products', function($table)
{
$table->integer('number_of_views')->default(0);
});
}
public function down()
{
Schema::table('tps_birzha_products', function($table)
{
$table->dropColumn('number_of_views');
});
}
}

View File

@ -272,3 +272,9 @@
1.0.97:
- 'Updated table users'
- builder_table_update_users_table_04_02_2022_15_20.php
1.0.98:
- 'Updated table tps_birzha_payments'
- builder_table_update_tps_birzha_payments_5.php
1.0.99:
- 'Updated table tps_birzha_products'
- builder_table_update_tps_birzha_products_25.php

File diff suppressed because one or more lines are too long

View File

@ -815,6 +815,19 @@ li {
display: block;
}
.pay_btn {
background: var(--blue);
color: #fff;
border: none;
border-radius: 5px;
padding: 20px 50px;
cursor: pointer;
font-size: var(--text-18);
font-weight: 400;
line-height: 1;
display: block;
}
.post_footer-text {
color: #E2E2E2;
font-size: 20px;
@ -1175,25 +1188,25 @@ li {
}
@keyframes top {
0% {
30% {
fill: #aba17d;
}
25% {
35% {
fill: #003197;
}
50% {
40% {
fill: #0056ff;
}
75% {
45% {
fill: #003197;
}
100% {
/* 100% {
fill: #aba17d;
}
} */
}
.link {
@ -2229,6 +2242,41 @@ li {
opacity: .8;
}
.item_row {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 15px;
}
.item_row .item_btn {
margin-top: 0;
}
.views {
display: flex;
align-items: center;
}
.views span {
width: 20px;
height: 20px;
margin-right: 7px;
}
.views span img {
width: 100%;
height: 100%;
object-fit: contain;
-o-object-fit: contain;
}
.views p {
font-size: 16px;
font-weight: 400;
line-height: 1.4;
}
/* Product end =================================================== */
/* Footer =================================================== */
@ -2501,6 +2549,139 @@ li {
margin-left: 20px;
}
.category_block {
padding-top: 100px;
}
.main_title {
font-size: var(--text-32);
font-weight: 700;
line-height: 1.4;
margin-bottom: 50px;
}
/* News ======================================== */
.news {
padding-top: 100px;
}
.news.news_page {
padding: 50px 0 100px;
}
.news .cat_end {
margin-top: 40px;
}
.news_box {
display: flex;
flex-wrap: wrap;
-webkit-flex-wrap: wrap;
-moz-flex-wrap: wrap;
margin: -10px;
}
.news_box-item {
width: calc(33.33% - 20px);
margin: 0 10px 40px 10px;
}
.news_box-item-photo {
width: 100%;
height: 300px;
position: relative;
overflow: hidden;
border-radius: 10px;
margin-bottom: 15px;
}
.news_box-item-photo img {
width: 100%;
height: 100%;
object-fit: cover;
-o-object-fit: cover;
transition: all .3s linear;
-ms-transition: all .3s linear;
-moz-transition: all .3s linear;
-webkit-transition: all .3s linear;
}
.news_box-item-photo img:hover {
transform: scale(1.05);
}
.news_link {
position: absolute;
top: 20px;
right: 20px;
width: 40px;
height: 40px;
z-index: 2;
background: var(--blue);
border-radius: 3px;
display: flex;
align-items: center;
justify-content: center;
transition: all .3s linear;
-ms-transition: all .3s linear;
-moz-transition: all .3s linear;
-webkit-transition: all .3s linear;
}
.news_link:hover {
transform: scale(1.2);
}
.news_link img {
width: 40%;
height: 40%;
object-fit: contain;
-o-object-fit: contain;
}
.news_box-item-title {
font-size: 16px;
font-weight: 600;
line-height: 1.4;
color: var(--blue);
font-family: 'Poppins', sans-serif;
}
.news_box-item-date {
font-size: 14px;
font-weight: 400;
line-height: 1.3;
margin: 10px 0;
font-family: 'Poppins', sans-serif;
}
.news_box-item-txt {
font-size: 14px;
font-weight: 400;
line-height: 1.6;
letter-spacing: .5px;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
font-family: 'Poppins', sans-serif;
}
/* News end ==================================== */
/* Product detail Page
==================================================================== */
/* Product detail ======================================================== */
@ -2538,6 +2719,7 @@ li {
.detail_photo {
width: 380px;
height: 225px;
cursor: pointer;
}
.detail_photo img {
@ -2977,6 +3159,115 @@ li {
margin-top: 100px;
}
/* New post ================================ */
.news_post {
padding: 70px 0 100px;
}
.news_post-box {
display: flex;
align-items: flex-start;
}
.news_post-info {
width: calc(100% - 450px);
margin-right: 50px;
}
.news_post-info-title {
color: #000;
font-weight: 700;
font-size: 22px;
line-height: 28px;
}
.news_post-info-date {
font-size: 16px;
line-height: 26px;
color: #a2a2a2;
font-weight: 400;
margin: 10px 0 20px;
}
.news_post-info-photo {
width: 100%;
height: 500px;
background: #e5e5e5;
margin-bottom: 40px;
}
.news_post-info-photo img {
width: 100%;
height: 100%;
object-fit: contain;
-o-object-fit: contain;
}
.news_post-info-txt {
margin-bottom: 15px;
font-size: 16px;
line-height: 26px;
margin-bottom: 20px;
letter-spacing: 0.5px;
}
.news_box-item-txt:last-child {
margin-bottom: 0;
}
.news_post-aside {
width: 400px;
}
.news_aside-title {
font-size: 16px;
line-height: 20px;
font-weight: 700;
text-transform: uppercase;
/* margin-bottom: 20px; */
color: #242424;
border-bottom: 1px solid #dcdcdc;
padding-bottom: 20px;
}
.news_aside-item {
border-bottom: 1px solid #dcdcdc;
padding: 18px 0;
}
.news_aside-item:last-child {
border-bottom: unset;
}
.news_aside-item-date {
font-size: 12px;
line-height: 20px;
color: #a2a2a2;
font-weight: 400;
}
.news_aside-item-title {
color: #000;
font-weight: 500;
font-size: 15px;
line-height: 20px;
margin: 10px 0 0 0;
display: block;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
/* New post end ============================ */
/* Add post =========================================== */
.post {
@ -5190,13 +5481,13 @@ input::-webkit-calendar-picker-indicator {
flex-wrap: wrap;
-ms-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
margin: 50px -20px 0;
margin: 50px -10px 0;
}
.cat_item {
padding: 30px 10px;
margin: 20px;
width: calc(25% - 40px);
margin: 10px;
width: calc(25% - 20px);
}
.cat_photo {
@ -5219,16 +5510,22 @@ input::-webkit-calendar-picker-indicator {
width: calc(50% - 40px);
}
/*
.tab_link:nth-child(2) {
margin-right: 0;
} */
.profile_drop {
/* bottom: -431px; */
top: calc(100% + 41px);
}
.category_block {
padding-top: 50px;
}
/* News ===================== */
.news_box-item-photo {
height: 230px;
}
/* News end ================= */
/* Basket =============== */
.basket_item_title {
@ -5426,6 +5723,19 @@ input::-webkit-calendar-picker-indicator {
width: calc(40% - 20px);
}
/* News post ============================ */
.news_post-info {
width: calc(100% - 330px);
margin-right: 30px;
}
.news_post-aside {
width: 300px;
}
/* News post end ======================== */
/* Replenishment History ======================================= */
.history_table {
@ -5706,8 +6016,51 @@ input::-webkit-calendar-picker-indicator {
-o-object-fit: contain;
}
.pay_btn {
margin: 20px auto 0;
}
/* Mobile User links end ================= */
/* News ========================= */
.news_box-item {
width: calc(50% - 20px);
margin-bottom: 30px;
}
/* News end ===================== */
/* News post ============================ */
.news_post-info {
width: 100%;
margin-right: 0px;
}
.news_post-aside {
display: none;
}
.news_post-info-title {
font-size: 18px;
}
.news_post-info-date {
font-size: 14px;
}
.news_post-info-photo {
height: 350px;
}
.news_post-info-txt {
font-size: 14px;
}
/* News post end ======================== */
.info_block:last-child .header_contact:last-child {
display: none;
}
@ -6399,6 +6752,25 @@ input::-webkit-calendar-picker-indicator {
margin: 0;
}
.pay_btn {
font-size: 14px;
padding: 15px 50px;
}
/* News ========================= */
.news_box-item {
width: calc(100% - 20px);
margin-bottom: 30px;
}
.news_box-item-photo {
width: 80%;
margin: 0 auto 15px;
}
/* News end ===================== */
/* --------------------------------- */
@ -6477,6 +6849,15 @@ input::-webkit-calendar-picker-indicator {
white-space: nowrap;
}
.item_row {
flex-direction: column;
align-items: unset;
}
.views {
margin-top: 15px;
}
.profile_drop {
width: 270px;
/* bottom: -445px; */
@ -6842,6 +7223,19 @@ input::-webkit-calendar-picker-indicator {
height: 320px;
}
/* News post ============================ */
.news_post {
padding: 40px 0 60px;
}
.news_post-info-photo {
height: 250px;
}
/* News post end ======================== */
/* Seller ---------------- */
.seller_inner {
@ -7042,6 +7436,24 @@ input::-webkit-calendar-picker-indicator {
display: none;
}
/* .item_row {
align-items: center;
} */
.views {
margin: 15px auto 0 auto;
}
/* News ========================= */
.news_box-item-photo {
width: 100%;
height: 210px;
}
/* News end ===================== */
.product_box {
margin: 0;
}
@ -7332,6 +7744,15 @@ input::-webkit-calendar-picker-indicator {
font-size: 14px;
}
/* News post ============================ */
.news_post-info-photo {
height: 100%;
background: transparent;
margin-bottom: 30px;
}
/* News post end ======================== */
/* Add post 3 ======================================= */
.add_post_box-item {

View File

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="18.001" viewBox="0 0 22 18.001">
<g id="eye" transform="translate(-1.455 -2.979)">
<path id="Path_3390" data-name="Path 3390" d="M12,16.33A4.33,4.33,0,1,1,16.33,12,4.332,4.332,0,0,1,12,16.33Zm0-7.16A2.83,2.83,0,1,0,14.83,12,2.834,2.834,0,0,0,12,9.17Z" transform="translate(0.46 -0.02)" fill="#003197"/>
<path id="Path_3391" data-name="Path 3391" d="M12.46,20.98c-3.924,0-7.629-2.2-10.176-6.007a5.815,5.815,0,0,1,0-5.987C4.842,5.175,8.547,2.98,12.46,2.98s7.619,2.2,10.165,6.007a5.815,5.815,0,0,1,0,5.987C20.079,18.785,16.374,20.98,12.46,20.98Zm0-16.5c-3.371,0-6.6,1.936-8.85,5.318a4.36,4.36,0,0,0,0,4.37c2.254,3.382,5.479,5.318,8.85,5.318s6.6-1.936,8.85-5.318a4.36,4.36,0,0,0,0-4.37C19.056,6.412,15.831,4.477,12.46,4.477Z" transform="translate(0 0)" fill="#003197"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 849 B

File diff suppressed because one or more lines are too long

View File

@ -565,7 +565,7 @@ if (inline != undefined) {
selectElement('#card').style.opacity = .5;
selectElement('.item_btn').style.display = 'none';
document.querySelectorAll('.item_btn').forEach(el => { el.style.display = 'none'; })
document.querySelectorAll('.item_row').forEach(el => { el.style.display = 'none'; })
document.querySelectorAll('.item_head').forEach(el => { el.style.display = 'none'; })
document.querySelectorAll('.item_sub_name').forEach(el => { el.style.display = 'none'; })
document.querySelectorAll('.inline_head').forEach(el => { el.style.display = 'flex'; })
@ -580,7 +580,7 @@ if (card != undefined) {
document.documentElement.setAttribute("data-theme", "col");
selectElement('#inline').style.opacity = .5;
selectElement('#card').style.opacity = 1;
document.querySelectorAll('.item_btn').forEach(el => { el.style.display = 'block'; })
document.querySelectorAll('.item_row').forEach(el => { el.style.display = 'flex'; })
document.querySelectorAll('.item_head').forEach(el => { el.style.display = 'block'; })
document.querySelectorAll('.item_sub_name').forEach(el => { el.style.display = 'block'; })
document.querySelectorAll('.inline_head').forEach(el => { el.style.display = 'none'; })

View File

@ -10,7 +10,7 @@ localeUrl[en] = "/bank_result/:payment_id"
localeUrl[ru] = "/bank_result/:payment_id"
[session]
security = "user"
security = "all"
redirect = "vojti"
[paymentapi]

View File

@ -24,7 +24,7 @@ productSlug = "{{ :slug }}"
offerId = "{{ :id }}"
==
{% put styles %}
<link rel="stylesheet" href="{{['assets/css/slick-theme.css','assets/css/slick.css']|theme}}">
<link rel="stylesheet" href="{{['assets/css/slick-theme.css','assets/css/slick.css','assets/css/jquery.fancybox.min.css']|theme}}">
{% endput %}
@ -52,5 +52,5 @@ offerId = "{{ :id }}"
<!--Product detail end ==================================================== -->
{% put scripts %}
<script src="{{['assets/js/slick.js','assets/js/slider.js']|theme}}"></script>
<script src="{{['assets/js/slick.js','assets/js/slider.js','assets/js/jquery.fancybox.min.js']|theme}}"></script>
{% endput %}