This commit is contained in:
Diatrex 2019-12-25 14:33:19 +03:00
commit dbe6fdcbe4
13 changed files with 169 additions and 121 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View File

@ -179,7 +179,7 @@ return [
"edit_adv" => "İlanı Düzenle", "edit_adv" => "İlanı Düzenle",
"mandatory_fields" => "Zorunlu alanlar", "mandatory_fields" => "Zorunlu alanlar",
"ad_post" => "İlan Yayını", "ad_post" => "İlan Yayını",
"sell_item" => "Bir ürün veya hizmet satmak", "sell_item" => "Detaylı bilgileri giriniz",
"search_save" => "Favori arama başarıyla kaydedildi", "search_save" => "Favori arama başarıyla kaydedildi",
"address" => "Adres", "address" => "Adres",
"email" => "E-Posta", "email" => "E-Posta",

View File

@ -4,13 +4,12 @@
{% set background_user = img('visiosoft.module.advs::images/user_section_back.png').url %} {% set background_user = img('visiosoft.module.advs::images/user_section_back.png').url %}
{% else %} {% else %}
{% set background_user = userProfile.adv_listing_banner.url %} {% set background_user = userProfile.adv_listing_banner.url %}
{% endif %} {% endif %}
<div class="col-md-12 upper-list-banner" style="background-image: url('{{ background_user }}');"> <div class="col-md-12 upper-list-banner" style="background-image: url('{{ background_user }}');">
<div class="row"> <div class="row">
<div class="col-md-3 col-xs-3"> <div class="col-md-3 col-xs-3">
<div class="card m-4"> <div class="card m-4">
<img src="https://i.pinimg.com/736x/9a/a7/1a/9aa71a7ce0656e55d083fa07fc36b8cc.jpg" <img src="{{ img('visiosoft.module.advs::images/sample-logo.jpg').url }}"
class="card-img-top"> class="card-img-top">
{# <img src="{{ user.file.url }}" class="card-img-top">#} {# <img src="{{ user.file.url }}" class="card-img-top">#}
<div class="card-body"> <div class="card-body">

View File

@ -36,23 +36,17 @@
<input type="hidden" name="update_id" value="{{ id }}"> <input type="hidden" name="update_id" value="{{ id }}">
<fieldset> <fieldset>
<div class="section postdetails"> <div class="section postdetails">
<h4>
{{ trans('visiosoft.module.advs::field.sell_item') }}
<span class="pull-right">
* {{ trans('visiosoft.module.advs::field.mandatory_fields') }}
</span>
</h4>
<div class="row form-group add-title"> <div class="row form-group add-title">
<div class="col-md-12"> <div class="col-md-12">
{{ nameField|raw }} {{ nameField|raw }}
</div> </div>
{{ addBlock('new-ad/fields')|raw }}
<div style="display: none"> <div style="display: none">
{{ form.fields.slug|raw }} {{ form.fields.slug|raw }}
</div> </div>
</div> </div>
{{ addBlock('new-ad/fields')|raw }}
<div class="row form-group select-price"> <div class="row form-group select-price">
<label class="col-sm-2 label-title col-xs-12"> <label class="col-sm-2 col-xs-12">
{{ form.fields.price.label|raw }} {{ form.fields.price.label|raw }}
<span class="required">*</span> <span class="required">*</span>
</label> </label>
@ -76,9 +70,7 @@
{{ form.fields.files.input |raw }} {{ form.fields.files.input |raw }}
</div> </div>
</div> </div>
{% if entries('advs').isEnabled('customfields') %} {{ addBlock('new-ad/other-fields',{'custom_fields':custom_fields})|raw }}
{% include "visiosoft.module.customfields::new-ad/fields" %}
{% endif %}
{% include "visiosoft.module.location::new-ad/map" %} {% include "visiosoft.module.location::new-ad/map" %}
@ -119,6 +111,7 @@
var default_GET = "{{ setting_value('visiosoft.module.advs::default_GET') }}"; var default_GET = "{{ setting_value('visiosoft.module.advs::default_GET') }}";
var adv_id = "{{ id }}"; var adv_id = "{{ id }}";
</script> </script>
<script src="https://maps.googleapis.com/maps/api/js?key={{ setting_value('visiosoft.module.advs::google_map_key') }}&callback=" <script src="https://maps.googleapis.com/maps/api/js?key={{ setting_value('visiosoft.module.advs::google_map_key') }}&callback="
type="text/javascript"></script> type="text/javascript"></script>
{{ asset_add("scripts.js", "visiosoft.module.advs::js/new-create.js") }} {{ asset_add("scripts.js", "visiosoft.module.advs::js/new-create.js") }}

View File

@ -1,6 +1,11 @@
#main { #main {
margin: 3rem 0; margin: 3rem 0;
} }
.hidden { .hidden {
display: none; display: none;
} }
.table-img-100 {
max-width: 100px;
}

View File

@ -1,12 +1,12 @@
<nav class="navbar navbar-expand-lg navbar-dark bg-dark"> <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container"> <div class="container">
<a class="navbar-brand" href="{{ url("/") }}">{{ setting_value('streams::name', config_get('streams::distribution.name')) }}</a> <a class="navbar-brand" href="{{ url("/") }}">{{ setting_value('streams::name', config_get('streams::distribution.name')) }}</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExample07" <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarContent"
aria-controls="navbarsExample07" aria-expanded="false" aria-label="Toggle navigation"> aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<div class="collapse navbar-collapse"> <div class="collapse navbar-collapse" id="navbarContent">
{{ structure() {{ structure()
.linkAttributesDropdown({'data-toggle': 'dropdown'}) .linkAttributesDropdown({'data-toggle': 'dropdown'})
.item_class('nav-item') .item_class('nav-item')
@ -20,8 +20,23 @@
.childListClass('dropdown-menu') .childListClass('dropdown-menu')
.cache({'namespace': 'user'}) .cache({'namespace': 'user'})
.render()|raw }} .render()|raw }}
<ul class="nav navbar-nav navbar-right d-block d-sm-none">
<li class="nav-item">
{% if auth_check() %}
<a class="nav-link" href="{{ url_route('anomaly.module.users::logout') }}">Logout</a>
{% else %}
<a class="nav-link" href="{{ url_route('anomaly.module.users::login') }}">Login</a>
{% endif %}
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_route('profile::profile') }}">Profile</a>
</li>
<li class="nav-item">
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("theme::button.post_ad.name") }}</a>
</li>
</ul>
</div> </div>
<div> <div class="d-none d-sm-block">
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li class="nav-item"> <li class="nav-item">
{% if auth_check() %} {% if auth_check() %}
@ -31,7 +46,7 @@
{% endif %} {% endif %}
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{ url_route('visiosoft.module.profile::profile') }}">Profile</a> <a class="nav-link" href="{{ url_route('profile::profile') }}">Profile</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("theme::button.post_ad.name") }}</a> <a href="/advs/create_adv" class="btn btn-primary">{{ trans("theme::button.post_ad.name") }}</a>

View File

@ -0,0 +1,34 @@
<?php namespace Visiosoft\LocationModule\City\Command;
use Visiosoft\LocationModule\City\CityModel;
class GetCity
{
/**
* @var $id
*/
protected $id;
/**
* GetProduct constructor.
* @param $id
*/
public function __construct($id)
{
$this->id = $id;
}
/**
* @param CityModel $groups
* @return |null
*/
public function handle(CityModel $groups)
{
if ($this->id) {
return $groups->find($this->id);
}
return null;
}
}

View File

@ -0,0 +1,33 @@
<?php namespace Visiosoft\LocationModule\Country\Command;
use Visiosoft\LocationModule\Country\CountryModel;
class GetCountry
{
/**
* @var $id
*/
protected $id;
/**
* GetProduct constructor.
* @param $id
*/
public function __construct($id)
{
$this->id = $id;
}
/**
* @param CountryModel $groups
* @return |null
*/
public function handle(CountryModel $groups)
{
if ($this->id) {
return $groups->find($this->id);
}
return null;
}
}

View File

@ -1,6 +1,8 @@
<?php namespace Visiosoft\LocationModule; <?php namespace Visiosoft\LocationModule;
use Anomaly\Streams\Platform\Addon\Plugin\Plugin; use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
use Visiosoft\LocationModule\City\Command\GetCity;
use Visiosoft\LocationModule\Country\Command\GetCountry;
use Visiosoft\LocationModule\District\Command\GetDistrict; use Visiosoft\LocationModule\District\Command\GetDistrict;
use Visiosoft\LocationModule\Neighborhood\Command\GetNeighborhood; use Visiosoft\LocationModule\Neighborhood\Command\GetNeighborhood;
@ -32,6 +34,28 @@ class LocationModulePlugin extends Plugin
return null; return null;
} }
return $ad;
}
),
new \Twig_SimpleFunction(
'getCity',
function ($id) {
if (!$ad = $this->dispatch(new GetCity($id))) {
return null;
}
return $ad;
}
),
new \Twig_SimpleFunction(
'getCountry',
function ($id) {
if (!$ad = $this->dispatch(new GetCountry($id))) {
return null;
}
return $ad; return $ad;
} }
), ),

View File

@ -0,0 +1,34 @@
<?php namespace Visiosoft\ProfileModule\Adress\Command;
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
class GetAddress
{
/**
* @var $id
*/
protected $id;
/**
* GetProduct constructor.
* @param $id
*/
public function __construct($id)
{
$this->id = $id;
}
/**
* @param AdressRepositoryInterface $adressRepository
* @return \Anomaly\Streams\Platform\Model\EloquentModel|null
*/
public function handle(AdressRepositoryInterface $adressRepository)
{
if ($this->id) {
return $adressRepository->find($this->id);
}
return null;
}
}

View File

@ -68,8 +68,6 @@ class MyProfileController extends PublicController
$isActive = new AdvModel(); $isActive = new AdvModel();
$isActiveMessages = $isActive->is_enabled('messages'); $isActiveMessages = $isActive->is_enabled('messages');
$isActiveOrders = $isActive->is_enabled('orders');
$isBalanceActive = $isActive->is_enabled('balances');
$isActivePackages = $isActive->is_enabled('packages'); $isActivePackages = $isActive->is_enabled('packages');
@ -86,19 +84,6 @@ class MyProfileController extends PublicController
$menu_fields[] = $menu_messages; $menu_fields[] = $menu_messages;
} }
if ($isActiveOrders) {
$advModel = new AdvModel();
$OrderModel = new OrderModel();
$OrderDetailModel = new OrderdetailModel();
$myPurchase = $OrderModel->listMyOrders();
$mySales = $OrderDetailModel->listMySales();
foreach ($mySales as $index => $mySale) {
if ($mySale->item_type == 'adv') {
$mySales[$index]->detail_url = $advModel->getAdvDetailLinkByAdId($mySale->item_id);
}
$mySales[$index]->detail_url = "#";
}
}
$advs_count = new AdvModel(); $advs_count = new AdvModel();
$advs_count = count($advs_count->myAdvsByUser()->get()); $advs_count = count($advs_count->myAdvsByUser()->get());
@ -341,82 +326,6 @@ class MyProfileController extends PublicController
return redirect('/'); return redirect('/');
} }
public function orderDetail($id)
{
$advModel = new AdvModel();
$orderDetailModel = new OrderdetailModel();
$details = $orderDetailModel->getDetail($id);
foreach ($details as $index => $detail) {
if ($detail->item_type == "adv") {
$details[$index]->detail_url = $advModel->getAdvDetailLinkByAdId($detail->item_id);
} else {
$details[$index]->detail_url = "#";
}
}
return $this->view->make('visiosoft.module.profile::profile.show-order', compact('details'));
}
public function saleDetail($id)
{
$advModel = new AdvModel();
$orderDetailModel = new OrderdetailModel();
$details = $orderDetailModel->getOrder($id);
if ($details->item_type == "adv") {
$details->detail_url = $advModel->getAdvDetailLinkByAdId($details->item_id);
} else {
$details->detail_url = "#";
}
return $this->view->make('visiosoft.module.profile::profile.show-my-sale', compact('details'));
}
public function addTrackingNumber(Request $request, OrderdetailRepository $orderdetailRepository)
{
$orderdetailRepository->addTransportnumber($request->id, $request->transportNumber, $request->transportDays);
return back()->with('success', ['Success']);
}
public function orderDelivered($id)
{
$orderDetailModel = new OrderdetailModel();
$details = $orderDetailModel->status($id, 'paid_buyer');
$orderPaymentModel = new OrderpaymentModel();
$orderPaymentModel->addSalesPayment($id);
return back()->with('success', [trans('visiosoft.module.profile::message.success')]);
}
public function orderNotDelivered($id)
{
$orderDetailModel = new OrderdetailModel();
$details = $orderDetailModel->status($id, 'error_buyer');
return back()->with('success', [trans('visiosoft.module.profile::message.success')]);
}
public function reportSales(Request $request, OrderdetailRepository $orderdetailRepository, Dispatcher $events)
{
if ($request->status == 'sendAgain') {
$seller = Auth::user();
$buyer = $orderdetailRepository->getOrderUser($request->id);
$orderdetailRepository->report($request->id, $request->reportContent, 'awaiting_tracking_number');
$events->dispatch(new AgainPurchaseOrder($request->reportContent, $buyer));
$events->dispatch(new AgainSaleOrder($request->reportContent, $seller));
// $buyer->notify(new AgainPuchaseOrder($request->reportContent, $buyer['display_name']));/*notify*/
// $seller->notify(new AgainSaleOrder($request->reportContent, $seller['display_name']));/*notify*/
} else {
$orderdetailRepository->report($request->id, $request->reportContent);
$user = $orderdetailRepository->getOrderUser($request->id);
$orderPaymentModel = new OrderpaymentModel();
$orderPaymentModel->addCancelPayment($request->id, $request->reportContent);
$events->dispatch(new ReportOrder($request->reportContent, $user));
// $user->notify(new ReportOrder($request->reportContent, $user['display_name']));/*notify*/
}
return back()->with('success', [trans('visiosoft.module.profile::message.success')]);
}
public function notification(Request $request) public function notification(Request $request)
{ {
$all = $request->all(); $all = $request->all();

View File

@ -1,6 +1,7 @@
<?php namespace Visiosoft\ProfileModule; <?php namespace Visiosoft\ProfileModule;
use Anomaly\Streams\Platform\Addon\Plugin\Plugin; use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
use Visiosoft\ProfileModule\Adress\Command\GetAddress;
use Visiosoft\ProfileModule\Profile\Command\FindUserProfile; use Visiosoft\ProfileModule\Profile\Command\FindUserProfile;
class ProfileModulePlugin extends Plugin class ProfileModulePlugin extends Plugin
@ -20,6 +21,17 @@ class ProfileModulePlugin extends Plugin
return null; return null;
} }
return $ad;
}
),
new \Twig_SimpleFunction(
'getAddress',
function ($id) {
if (!$ad = $this->dispatch(new GetAddress($id))) {
return null;
}
return $ad; return $ad;
} }
) )

View File

@ -110,16 +110,6 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
'profile/class/extendTime/{id},{type}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@extendAds', 'profile/class/extendTime/{id},{type}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@extendAds',
'profile/message/show/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@showMessage', 'profile/message/show/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@showMessage',
'profile/closeAccount' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@disableAccount', 'profile/closeAccount' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@disableAccount',
'profile/order/{id}' => [
'as' => 'visiosoft.module.profile::profile_order',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@orderDetail'
],
'profile/my-sale/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@saleDetail',
'profile/orders/add-transport-number' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@addTrackingNumber',
'profile/orders/delivered-purchase/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@orderDelivered',
'profile/orders/not-delivered-purchase/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@orderNotDelivered',
'profile/orders/report-sales' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@reportSales',
'profile/notification' => [ 'profile/notification' => [
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@notification', 'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@notification',
], ],