wip
This commit is contained in:
parent
6a36c68e50
commit
f78d8f6214
|
|
@ -33,7 +33,7 @@ class TabProduct extends Component
|
||||||
public function render(): View
|
public function render(): View
|
||||||
{
|
{
|
||||||
$data['register'] = [
|
$data['register'] = [
|
||||||
'code' => 'product',
|
'code' => 'tab_product',
|
||||||
'sort' => 0,
|
'sort' => 0,
|
||||||
'name' => '选项卡商品',
|
'name' => '选项卡商品',
|
||||||
'icon' => '',
|
'icon' => '',
|
||||||
|
|
|
||||||
|
|
@ -132,33 +132,34 @@ Vue.component('module-editor-product-tab', {
|
||||||
if (!this.module.tabs[0].products.length) return;
|
if (!this.module.tabs[0].products.length) return;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
$.ajax({
|
http://beike.test/panel/products/names?product_ids=1,2,3
|
||||||
url: 'index.php?route=extension/theme/default/page/module/product/productsByIds',
|
|
||||||
data: {product_ids: this.module.tabs[this.editableTabsValue].products},
|
$http.get('panel/products/names', {product_ids: this.module.tabs[this.editableTabsValue].products}, {hload: true}).then((res) => {
|
||||||
type: 'post',
|
console.log(res)
|
||||||
dataType: 'json',
|
})
|
||||||
success: function (json) {
|
|
||||||
if (json) {
|
// $.ajax({
|
||||||
that.loading = false;
|
// url: 'index.php?route=extension/theme/default/page/module/product/productsByIds',
|
||||||
that.productData = json;
|
// data: {product_ids: this.module.tabs[this.editableTabsValue].products},
|
||||||
}
|
// type: 'post',
|
||||||
}
|
// dataType: 'json',
|
||||||
});
|
// success: function (json) {
|
||||||
|
// if (json) {
|
||||||
|
// that.loading = false;
|
||||||
|
// that.productData = json;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
|
|
||||||
querySearch(keyword, cb) {
|
querySearch(keyword, cb) {
|
||||||
if (!keyword) {
|
if (!keyword) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$.ajax({
|
|
||||||
url: 'index.php?route=extension/theme/default/page/module/product/autocomplete&filter_name=' + encodeURIComponent(keyword),
|
$http.get('products/autocomplete', {name: keyword}, null).then((res) => {
|
||||||
dataType: 'json',
|
cb(res);
|
||||||
success: function (json) {
|
})
|
||||||
if (json) {
|
|
||||||
cb(json);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleSelect(item) {
|
handleSelect(item) {
|
||||||
|
|
@ -195,4 +196,20 @@ Vue.component('module-editor-product-tab', {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
const make = {
|
||||||
|
style: {
|
||||||
|
background_color: ''
|
||||||
|
},
|
||||||
|
floor: languagesFill(''),
|
||||||
|
tabs: [{title: languagesFill('标题'), products: []}],
|
||||||
|
title: languagesFill('模块标题'),
|
||||||
|
}
|
||||||
|
|
||||||
|
let register = @json($register);
|
||||||
|
|
||||||
|
register.make = make;
|
||||||
|
app.source.modules.push(register)
|
||||||
|
}, 100)
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -9,16 +9,50 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="module-info">
|
<div class="module-info">
|
||||||
<div class="module-title">推荐品牌模块</div>
|
<div class="module-title">推荐商品模块</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
@if ($tabs)
|
||||||
@for ($i = 0; $i < 8; $i++)
|
<div class="nav justify-content-center mb-3">
|
||||||
<div class="col-6 col-md-4 col-lg-3">
|
@foreach ($tabs as $key => $category)
|
||||||
<div class="brand-item"><img src="{{ asset('image/default/banner-1.png') }}" class="img-fluid"></div>
|
<a class="nav-link {{ $loop->first ? 'active' : '' }}" href="#tab-product-{{ $loop->index }}" data-bs-toggle="tab">{{ $key }}</a>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
<div class="tab-content">
|
||||||
|
@foreach ($tabs as $products)
|
||||||
|
<div class="tab-pane fade show {{ $loop->first ? 'active' : '' }}" id="tab-product-{{ $loop->index }}">
|
||||||
|
<div class="row">
|
||||||
|
@foreach ($products as $product)
|
||||||
|
<div class="col-6 col-md-4 col-lg-3">
|
||||||
|
@include('shared.product')
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div class="nav justify-content-center mb-3">
|
||||||
|
@for ($i = 0; $i < 2; $i++)
|
||||||
|
<a class="nav-link {{ $loop->first ? 'active' : '' }}" href="#tab-product-{{ $loop->index }}" data-bs-toggle="tab">标题</a>
|
||||||
|
@endfor
|
||||||
|
</div>
|
||||||
|
<div class="tab-content">
|
||||||
|
@for ($i = 0; $i < 2; $i++)
|
||||||
|
<div class="tab-pane fade show {{ $loop->first ? 'active' : '' }}" id="tab-product-{{ $loop->index }}">
|
||||||
|
<div class="row">
|
||||||
|
@for ($s = 0; $s < 8; $s++)
|
||||||
|
<div class="col-6 col-md-4 col-lg-3">
|
||||||
|
@include('shared.product')
|
||||||
|
商品
|
||||||
|
</div>
|
||||||
|
@endfor
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endfor
|
@endfor
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue