Просмотр исходного кода

管理后台产品编辑页变体模块前端逻辑--save-variants接口variants数据结构缺少code问题

fogwind 1 месяц назад
Родитель
Сommit
2af85e0141

+ 17 - 2
packages/Longyi/Core/src/Resources/views/admin/catalog/products/edit/types/flexible_variant.blade.php

@@ -240,7 +240,9 @@
     
 
     <script type="module">
-
+        /***
+         * @todo option code和 value code 是否开放编辑问题
+        */
         app.component('flexible-variant', {
             template: '#flexible-variant-template',
 
@@ -256,6 +258,17 @@
                     optionsFormData: {
                         list: []
                     },
+                    /**@todo 改造数据结构,满足设置图片需求(参考shopify)
+                     * variantsFormData:{
+                     *     list: [
+                     *         {
+                     *         
+                     *         },
+                     *         {}
+                     *     ]
+                     * }
+                     * 
+                    */
                     variantsFormData: {
                         list:[]
                     },
@@ -294,6 +307,7 @@
                     /**
                      * @todo 把对应的变体更新
                     */
+
                 },
                 clickVariantEdit(rowIndex,rowData) {
                     this.editVariantId = rowData.id;
@@ -379,7 +393,8 @@
                                     code: val.code,
                                     label: val.label,
                                     position: val.position,
-                                    isNewCreate: false
+                                    isNewCreate: false,
+                                    parent_code: val.option.code
                                 };
                             })
                         });

+ 1 - 1
packages/Longyi/Core/src/Resources/views/admin/catalog/products/edit/types/flexible_variant/edit.blade.php

@@ -54,7 +54,7 @@
                 }
                 
             },
-            emits: ['update:isShow'], // 显式声明事件(推荐)
+            emits: ['update:isShow','confirm'], // 显式声明事件(推荐)
             data() {
                 return {
                     form: {

+ 2 - 2
resources/admin-themes/default/views/catalog/products/index.blade.php

@@ -5,9 +5,9 @@
 
     <div class="flex items-center justify-between gap-4 max-sm:flex-wrap">
         <p class="text-xl font-bold text-gray-800 dark:text-white">
-            @lang('admin::app.catalog.products.index.title') 八服赤眉
+            @lang('admin::app.catalog.products.index.title')
         </p>
-        <x-longyi::test />
+        {{--<x-longyi::test /> 测试blade组件--}}
         <div class="flex items-center gap-x-2.5">
             <!-- Export Modal -->
             <x-admin::datagrid.export :src="route('admin.catalog.products.index')" />