Merge branch 'master' of github.com:devansh-webkul/bagisto
This commit is contained in:
commit
62ddf53d16
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,9 @@
|
|||
$black: #0000;
|
||||
$black: #000000;
|
||||
$blue: #0041FF;
|
||||
$dark-bg:#051e37;
|
||||
|
||||
$green: #42c067;
|
||||
$red: #FF0000;
|
||||
$seprator: rgba(162, 162, 162, 0.2);
|
||||
|
||||
$white: #ffffff;
|
||||
|
|
@ -6,9 +6,8 @@
|
|||
@import "variables";
|
||||
@import "mixins";
|
||||
|
||||
@import "partials/default";
|
||||
|
||||
@import "partials/dark";
|
||||
@import "partials/default";
|
||||
@import "partials/mobile";
|
||||
|
||||
@import "partials/dashboard";
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
color: #a2a2a2;
|
||||
}
|
||||
.name {
|
||||
color: rgba(255,255,255,.8);
|
||||
color: rgba(255,255,255,.8) !important;
|
||||
}
|
||||
.dropdown-list {
|
||||
right: 0px;
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
.navbar-left {
|
||||
background-color: $dark-bg;
|
||||
border-right: 1px solid $seprator;
|
||||
border-right: 1px solid $dark-bg;
|
||||
|
||||
ul.menubar {
|
||||
li.menu-item {
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
> a {
|
||||
padding: 5px 2px;
|
||||
display: block;
|
||||
color: $black;
|
||||
color: #000;
|
||||
width: 100%;
|
||||
|
||||
.icon {
|
||||
|
|
@ -85,13 +85,13 @@
|
|||
.sub-menu-item {
|
||||
|
||||
.menu-label {
|
||||
color: $white !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
&.active, &:hover {
|
||||
background-color: #020f1c;
|
||||
.menu-label {
|
||||
color: $white !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@
|
|||
width: calc(100% - 1px);
|
||||
|
||||
.menu-label {
|
||||
color: $white;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
ul.sub-menubar {
|
||||
|
|
@ -152,7 +152,7 @@
|
|||
&.active, &:hover {
|
||||
background-color: rgba(1, 10, 20, .5);
|
||||
.menu-label {
|
||||
color: $white !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -162,7 +162,7 @@
|
|||
&:hover {
|
||||
background: $dark-bg;
|
||||
.menu-label {
|
||||
color: $white;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -188,11 +188,11 @@
|
|||
margin-left: 40px;
|
||||
|
||||
.name{
|
||||
color: $white;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.role{
|
||||
color: $white;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -205,7 +205,7 @@
|
|||
.nav-item {
|
||||
|
||||
a{
|
||||
color: $white;
|
||||
color:#fff;
|
||||
display: block;
|
||||
padding: 5px;
|
||||
}
|
||||
|
|
@ -302,12 +302,12 @@
|
|||
}
|
||||
|
||||
.grid-dropdown-header {
|
||||
background-color: $black;
|
||||
background-color: #000;
|
||||
border: 1px solid #24384c;
|
||||
}
|
||||
|
||||
.dropdown-list{
|
||||
background-color: $black;
|
||||
background-color: #000;
|
||||
.dropdown-container {
|
||||
background-color: #02080d;
|
||||
color: rgba(255,255,255,.8);
|
||||
|
|
@ -320,7 +320,7 @@
|
|||
a{
|
||||
color: rgba(255,255,255,.8);
|
||||
&:hover{
|
||||
color: $white;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -330,7 +330,7 @@
|
|||
}
|
||||
|
||||
.notification{
|
||||
background-color: $black;
|
||||
background-color: #000;
|
||||
|
||||
.dropdown-container {
|
||||
|
||||
|
|
@ -385,7 +385,7 @@
|
|||
|
||||
.control-container {
|
||||
.control {
|
||||
background: $black;
|
||||
background: #000;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -446,18 +446,18 @@
|
|||
|
||||
.accordian, accordian {
|
||||
.accordian-header, div[slot*="header"] {
|
||||
background-color: #02080d ;
|
||||
color: rgba(255,255,255,.5)
|
||||
background-color: #02080d;
|
||||
color: rgba(255,255,255,.5);
|
||||
}
|
||||
.accordian-content, div[slot*="body"] {
|
||||
background-color: $black;
|
||||
background-color: #000;
|
||||
border-bottom: 1px solid #24384c;
|
||||
}
|
||||
&.active>.accordian-content {
|
||||
background-color: #02080d;
|
||||
}
|
||||
&.active>.accordian-header {
|
||||
background-color: $black;
|
||||
background-color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -524,7 +524,7 @@
|
|||
background: #071e37;
|
||||
box-shadow: 0 5px 10px 2px rgb(0 0 0 / 80%);
|
||||
.data {
|
||||
color: $white !important;
|
||||
color: $white;
|
||||
.progress {
|
||||
color: rgba(255,255,255,.8);
|
||||
|
||||
|
|
@ -535,15 +535,15 @@
|
|||
}
|
||||
|
||||
.pagination .page-item {
|
||||
background: $black;
|
||||
background: #000;
|
||||
border: 1px solid 000;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
.pagination .page-item.active {
|
||||
background: #0041FF;
|
||||
background-color: rgba(40, 69, 100, 0.2) !important;
|
||||
color: $white;
|
||||
border-color: #0041FF;
|
||||
border-color: rgba(2, 57, 83, 0.2) !important;
|
||||
}
|
||||
|
||||
.filter-tag .wrapper {
|
||||
|
|
@ -583,4 +583,104 @@
|
|||
border-bottom: 1px solid #232d36;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
.btn.btn-primary {
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
color: $black;
|
||||
}
|
||||
|
||||
.flatpickr-calendar {
|
||||
background: transparent;
|
||||
opacity: 0;
|
||||
display: none;
|
||||
text-align: center;
|
||||
visibility: hidden;
|
||||
padding: 0;
|
||||
-webkit-animation: none;
|
||||
animation: none;
|
||||
direction: ltr;
|
||||
border: 0;
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
border-radius: 5px;
|
||||
position: absolute;
|
||||
width: 307.875px;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
background-color: #02080d;
|
||||
-webkit-box-shadow: 1px 0 0 $black,-1px 0 0 $black,0 1px 0 $black,0 -1px 0 $black,0 3px 13px rgba(0,0,0,.08);
|
||||
box-shadow: 1px 0 0 $black,-1px 0 0 $black,0 1px 0 $black,0 -1px 0 $black,0 3px 13px rgba(0,0,0,.08);
|
||||
}
|
||||
|
||||
.flatpickr-months .flatpickr-month {
|
||||
color: $white;
|
||||
}
|
||||
.flatpickr-weekdays .flatpickr-weekdaycontainer, span.flatpickr-weekday {
|
||||
color: $white;
|
||||
}
|
||||
|
||||
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover, .flatpickr-day.nextMonthDay, .flatpickr-day.notAllowed, .flatpickr-day.notAllowed.nextMonthDay, .flatpickr-day.notAllowed.prevMonthDay, .flatpickr-day.prevMonthDay {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
background: transparent;
|
||||
border-color: transparent;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.flatpickr-weekwrapper span.flatpickr-day, .flatpickr-weekwrapper span.flatpickr-day:hover {
|
||||
color: $white;
|
||||
|
||||
}
|
||||
|
||||
.flatpickr-day {
|
||||
color: $white;
|
||||
}
|
||||
|
||||
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month {
|
||||
color: $white;
|
||||
fill: $white;
|
||||
}
|
||||
|
||||
.flatpickr-day.endRange,
|
||||
.flatpickr-day.endRange.inRange,
|
||||
.flatpickr-day.endRange.nextMonthDay,
|
||||
.flatpickr-day.endRange.prevMonthDay,
|
||||
.flatpickr-day.endRange:focus,
|
||||
.flatpickr-day.endRange:hover,
|
||||
.flatpickr-day.selected,
|
||||
.flatpickr-day.selected.inRange,
|
||||
.flatpickr-day.selected.nextMonthDay,
|
||||
.flatpickr-day.selected.prevMonthDay,
|
||||
.flatpickr-day.selected:focus,
|
||||
.flatpickr-day.selected:hover,
|
||||
.flatpickr-day.startRange,
|
||||
.flatpickr-day.startRange.inRange,
|
||||
.flatpickr-day.startRange.nextMonthDay,
|
||||
.flatpickr-day.startRange.prevMonthDay,
|
||||
.flatpickr-day.startRange:focus,
|
||||
.flatpickr-day.startRange:hover {
|
||||
background: rgb(5, 30, 55) !important;
|
||||
color: $white;
|
||||
border-color: rgb(5, 30, 55) !important;
|
||||
}
|
||||
|
||||
.flatpickr-day.inRange,
|
||||
.flatpickr-day.prevMonthDay.inRange,
|
||||
.flatpickr-day.nextMonthDay.inRange,
|
||||
.flatpickr-day.today.inRange,
|
||||
.flatpickr-day.prevMonthDay.today.inRange,
|
||||
.flatpickr-day.nextMonthDay.today.inRange,
|
||||
.flatpickr-day:hover,
|
||||
.flatpickr-day.prevMonthDay:hover,
|
||||
.flatpickr-day.nextMonthDay:hover,
|
||||
.flatpickr-day:focus,
|
||||
.flatpickr-day.prevMonthDay:focus,
|
||||
.flatpickr-day.nextMonthDay:focus {
|
||||
cursor: pointer;
|
||||
outline: 0;
|
||||
background: #24384c !important;
|
||||
border-color: #24384c !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
@import "colors";
|
||||
body {
|
||||
margin: 0;
|
||||
color: $font-color;
|
||||
|
|
@ -11,7 +10,7 @@ body {
|
|||
}
|
||||
|
||||
.dark-mode-button{
|
||||
background: #3c41ff;
|
||||
background: $blue;
|
||||
border: none;
|
||||
padding: 10px 30px;
|
||||
width: 95%;
|
||||
|
|
@ -63,7 +62,7 @@ body {
|
|||
&::before{
|
||||
content: "";
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
height: 24px;
|
||||
background-color: rebeccapurple;
|
||||
background-image: url("../assets/image/Icon-Sortable.svg");
|
||||
display: block;
|
||||
|
|
@ -381,7 +380,7 @@ body {
|
|||
font-size: 15px;
|
||||
|
||||
&:focus {
|
||||
border-color: #0041ff;
|
||||
border-color: $blue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -594,7 +593,7 @@ body {
|
|||
}
|
||||
|
||||
.canceled{
|
||||
background-color: red;
|
||||
background-color: $red;
|
||||
}
|
||||
|
||||
.closed{
|
||||
|
|
@ -602,7 +601,7 @@ body {
|
|||
}
|
||||
|
||||
.completed{
|
||||
background-color: #42c067;
|
||||
background-color: $green;
|
||||
}
|
||||
|
||||
.notif-content {
|
||||
|
|
@ -624,7 +623,7 @@ body {
|
|||
position: absolute;
|
||||
right: 13px;
|
||||
top: 6px;
|
||||
background: red;
|
||||
background: $red;
|
||||
color: $white;
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
|
|
@ -649,7 +648,7 @@ body {
|
|||
|
||||
.page-item.active {
|
||||
.page-link {
|
||||
color: #fff !important;
|
||||
color: $white !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,3 +29,28 @@
|
|||
.pagination {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.flatpickr-day.endRange,
|
||||
.flatpickr-day.endRange.inRange,
|
||||
.flatpickr-day.endRange.nextMonthDay,
|
||||
.flatpickr-day.endRange.prevMonthDay,
|
||||
.flatpickr-day.endRange:focus,
|
||||
.flatpickr-day.endRange:hover,
|
||||
.flatpickr-day.selected,
|
||||
.flatpickr-day.selected.inRange,
|
||||
.flatpickr-day.selected.nextMonthDay,
|
||||
.flatpickr-day.selected.prevMonthDay,
|
||||
.flatpickr-day.selected:focus,
|
||||
.flatpickr-day.selected:hover,
|
||||
.flatpickr-day.startRange,
|
||||
.flatpickr-day.startRange.inRange,
|
||||
.flatpickr-day.startRange.nextMonthDay,
|
||||
.flatpickr-day.startRange.prevMonthDay,
|
||||
.flatpickr-day.startRange:focus,
|
||||
.flatpickr-day.startRange:hover {
|
||||
background: $blue !important;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
color: $white;
|
||||
border-color: $blue !important;
|
||||
}
|
||||
|
|
@ -26,36 +26,40 @@
|
|||
</div>
|
||||
</tab>
|
||||
|
||||
<tab name="{{ __('admin::app.customers.customers.addresses') }}" :selected="false">
|
||||
<div class="style:overflow: auto;"> </div>
|
||||
<tab name="{{ __('admin::app.customers.customers.addresses') }}" :selected="false">
|
||||
<div class="page-content">
|
||||
<div style="float: right;">
|
||||
<a href="{{ route('admin.customer.addresses.create', ['id' => $customer->id]) }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.customers.addresses.create-btn-title') }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<a href="{{ route('admin.customer.addresses.create', ['id' => $customer->id]) }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.customers.addresses.create-btn-title') }}
|
||||
</a>
|
||||
<div class="mt-30">
|
||||
<datagrid-plus src="{{ route('admin.customer.addresses.index', $customer->id) }}"></datagrid-plus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<datagrid-plus src="{{ route('admin.customer.addresses.index', $customer->id) }}"></datagrid-plus>
|
||||
</tab>
|
||||
|
||||
<tab name="{{ __('admin::app.layouts.invoices') }}" :selected="false">
|
||||
<div class="style:overflow: auto;"> </div>
|
||||
<div class="page-content">
|
||||
|
||||
{!! view_render_event('bagisto.admin.customer.invoices.list.before') !!}
|
||||
|
||||
<datagrid-plus src="{{ route('admin.customer.invoices.data', $customer->id) }}"></datagrid-plus>
|
||||
|
||||
{!! view_render_event('bagisto.admin.customer.invoices.list.after') !!}
|
||||
</div>
|
||||
</tab>
|
||||
|
||||
<tab name="{{ __('admin::app.customers.orders.title') }}" :selected="false">
|
||||
<div class="style:overflow: auto;"> </div>
|
||||
<div class="page-content">
|
||||
|
||||
{!! view_render_event('bagisto.admin.customer.orders.list.before') !!}
|
||||
|
||||
<datagrid-plus src="{{ route('admin.customer.orders.data', $customer->id) }}"></datagrid-plus>
|
||||
|
||||
{!! view_render_event('bagisto.admin.customer.orders.list.after') !!}
|
||||
</div>
|
||||
</tab>
|
||||
|
||||
{!! view_render_event('bagisto.admin.customer.edit.after', ['customer' => $customer]) !!}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
namespace Webkul\Shop\DataGrids;
|
||||
|
||||
use Webkul\Ui\DataGrid\DataGrid;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Webkul\Ui\DataGrid\DataGrid;
|
||||
|
||||
class OrderDataGrid extends DataGrid
|
||||
{
|
||||
|
|
@ -53,7 +53,7 @@ class OrderDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'created_at',
|
||||
'label' => trans('shop::app.customer.account.order.index.date'),
|
||||
'label' => trans('shop::app.customer.account.order.view.order-date'),
|
||||
'type' => 'datetime',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
|
|
@ -83,15 +83,15 @@ class OrderDataGrid extends DataGrid
|
|||
return '<span class="badge badge-md badge-success">' . trans('shop::app.customer.account.order.index.processing') . '</span>';
|
||||
} elseif ($value->status == 'completed') {
|
||||
return '<span class="badge badge-md badge-success">' . trans('shop::app.customer.account.order.index.completed') . '</span>';
|
||||
} elseif ($value->status == "canceled") {
|
||||
} elseif ($value->status == 'canceled') {
|
||||
return '<span class="badge badge-md badge-danger">' . trans('shop::app.customer.account.order.index.canceled') . '</span>';
|
||||
} elseif ($value->status == "closed") {
|
||||
} elseif ($value->status == 'closed') {
|
||||
return '<span class="badge badge-md badge-info">' . trans('shop::app.customer.account.order.index.closed') . '</span>';
|
||||
} elseif ($value->status == "pending") {
|
||||
} elseif ($value->status == 'pending') {
|
||||
return '<span class="badge badge-md badge-warning">' . trans('shop::app.customer.account.order.index.pending') . '</span>';
|
||||
} elseif ($value->status == "pending_payment") {
|
||||
} elseif ($value->status == 'pending_payment') {
|
||||
return '<span class="badge badge-md badge-warning">' . trans('shop::app.customer.account.order.index.pending-payment') . '</span>';
|
||||
} elseif ($value->status == "fraud") {
|
||||
} elseif ($value->status == 'fraud') {
|
||||
return '<span class="badge badge-md badge-danger">' . trans('shop::app.customer.account.order.index.fraud') . '</span>';
|
||||
}
|
||||
},
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/ui.js": "/js/ui.js?id=ba11b663a9e7a34b1ca7",
|
||||
"/js/ui.js": "/js/ui.js?id=2f9fabd43a584c291335",
|
||||
"/css/ui.css": "/css/ui.css?id=9dd6a42456cc75479c1d"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
<div>
|
||||
<div class="image-wrapper">
|
||||
<image-item
|
||||
v-for='(image, index) in items'
|
||||
:key='image.id'
|
||||
v-for="image in items"
|
||||
:key="image.id"
|
||||
:image="image"
|
||||
:input-name="inputName"
|
||||
:required="required"
|
||||
|
|
@ -12,112 +12,142 @@
|
|||
></image-item>
|
||||
</div>
|
||||
|
||||
<label class="btn btn-lg btn-primary" style="display: inline-block; width: auto" @click="createFileType">{{ buttonLabel }}</label>
|
||||
<label
|
||||
class="btn btn-lg btn-primary"
|
||||
style="display: inline-block; width: auto"
|
||||
@click="createFileType"
|
||||
v-if="!hideButton"
|
||||
>{{ buttonLabel }}</label
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
buttonLabel: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'Add Image'
|
||||
},
|
||||
|
||||
removeButtonLabel: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'Remove Image'
|
||||
},
|
||||
|
||||
inputName: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'attachments'
|
||||
},
|
||||
|
||||
images: {
|
||||
type: Array|String,
|
||||
required: false,
|
||||
default: () => ([])
|
||||
},
|
||||
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
},
|
||||
|
||||
required: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
export default {
|
||||
props: {
|
||||
buttonLabel: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'Add Image'
|
||||
},
|
||||
|
||||
data: function() {
|
||||
return {
|
||||
imageCount: 0,
|
||||
items: []
|
||||
}
|
||||
removeButtonLabel: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'Remove Image'
|
||||
},
|
||||
|
||||
created () {
|
||||
var this_this = this;
|
||||
inputName: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'attachments'
|
||||
},
|
||||
|
||||
if(this.multiple) {
|
||||
if (this.images.length) {
|
||||
this.images.forEach(function(image) {
|
||||
this_this.items.push(image)
|
||||
images: {
|
||||
type: Array | String,
|
||||
required: false,
|
||||
default: () => []
|
||||
},
|
||||
|
||||
this_this.imageCount++;
|
||||
});
|
||||
} else if (this.images.length == undefined && typeof this.images == 'object') {
|
||||
var images = Object.keys(this.images).map(key => {
|
||||
return this.images[key];
|
||||
});
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
},
|
||||
|
||||
images.forEach(function(image) {
|
||||
this_this.items.push(image)
|
||||
required: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
this_this.imageCount++;
|
||||
});
|
||||
} else {
|
||||
this.createFileType();
|
||||
}
|
||||
data: function() {
|
||||
return {
|
||||
hideButton: false,
|
||||
imageCount: 0,
|
||||
items: []
|
||||
};
|
||||
},
|
||||
|
||||
created: function() {
|
||||
this.initImages();
|
||||
},
|
||||
|
||||
methods: {
|
||||
initImages: function() {
|
||||
if (this.multiple) {
|
||||
this.initMultiple();
|
||||
} else {
|
||||
if(this.images && this.images != '') {
|
||||
this.items.push({'id': 'image_' + this.imageCount, 'url': this.images})
|
||||
|
||||
this.imageCount++;
|
||||
} else {
|
||||
this.createFileType();
|
||||
}
|
||||
this.initSingle();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
createFileType () {
|
||||
var this_this = this;
|
||||
initMultiple: function() {
|
||||
let self = this;
|
||||
|
||||
if(!this.multiple) {
|
||||
this.items.forEach(function(image) {
|
||||
this_this.removeImage(image)
|
||||
});
|
||||
}
|
||||
if (this.images.length) {
|
||||
this.images.forEach(function(image) {
|
||||
self.items.push(image);
|
||||
|
||||
self.imageCount++;
|
||||
});
|
||||
} else if (
|
||||
this.images.length == undefined &&
|
||||
typeof this.images == 'object'
|
||||
) {
|
||||
let images = Object.keys(this.images).map(key => {
|
||||
return this.images[key];
|
||||
});
|
||||
|
||||
images.forEach(function(image) {
|
||||
self.items.push(image);
|
||||
|
||||
self.imageCount++;
|
||||
});
|
||||
} else {
|
||||
this.createFileType();
|
||||
}
|
||||
},
|
||||
|
||||
initSingle: function() {
|
||||
if (this.images && this.images != '') {
|
||||
this.items.push({
|
||||
id: 'image_' + this.imageCount,
|
||||
url: this.images
|
||||
});
|
||||
|
||||
this.imageCount++;
|
||||
|
||||
this.items.push({'id': 'image_' + this.imageCount});
|
||||
},
|
||||
|
||||
removeImage (image) {
|
||||
let index = this.items.indexOf(image)
|
||||
|
||||
Vue.delete(this.items, index);
|
||||
} else {
|
||||
this.createFileType();
|
||||
}
|
||||
}
|
||||
|
||||
this.hideButton = true;
|
||||
},
|
||||
|
||||
createFileType: function() {
|
||||
let self = this;
|
||||
|
||||
if (!this.multiple) {
|
||||
this.items.forEach(function(image) {
|
||||
self.removeImage(image);
|
||||
});
|
||||
|
||||
this.hideButton = true;
|
||||
}
|
||||
|
||||
this.imageCount++;
|
||||
|
||||
this.items.push({ id: 'image_' + this.imageCount });
|
||||
},
|
||||
|
||||
removeImage: function(image) {
|
||||
let index = this.items.indexOf(image);
|
||||
|
||||
if (!this.multiple) this.hideButton = false;
|
||||
|
||||
Vue.delete(this.items, index);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@
|
|||
<label class="col-12">
|
||||
{{ __('admin::app.catalog.categories.image') }}
|
||||
</label>
|
||||
|
||||
<div class="col-12">
|
||||
<image-wrapper :button-label="'{{ __('admin::app.catalog.products.add-image-btn-title') }}'" input-name="image" :multiple="false" :images='"{{ $customer->image_url }}"'></image-wrapper>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue