From 6d15ce19fee2482eca9748feb1193bc943c91fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=81=B0=E7=81=B0?= Date: Mon, 19 Jul 2021 02:38:22 +0000 Subject: [PATCH 1/5] =?UTF-8?q?!52=20=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=89=8D=E5=90=8E=E7=AB=AF=E5=88=86=E7=A6=BB=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E6=9C=AA=E5=A2=9E=E5=8A=A0=E5=88=B0html=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82=20*=20=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0=E5=89=8D?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E5=88=86=E7=A6=BB=E5=9F=9F=E5=90=8D=E6=9C=AA?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=B0html=E9=97=AE=E9=A2=98=E3=80=82=20*?= =?UTF-8?q?=20Merge=20branch=20'develop'=20into=20dahuihui/develop=20*=20?= =?UTF-8?q?=E3=80=90=E5=90=8E=E7=AB=AF=E3=80=91=E4=BF=AE=E5=A4=8D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=99=BB=E5=BD=95=E7=94=A8=E6=88=B7=E7=9C=9F=E5=AE=9E?= =?UTF-8?q?=E5=A7=93=E5=90=8D=E9=95=BF=E5=BA=A6=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=20*=20=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=85=8D=E9=80=81=E6=96=B9=E5=BC=8F=E7=BB=B4=E6=8A=A4=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98=20*=201=E3=80=81=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=B3=A8=E5=86=8C=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E4=BA=A4=E4=BA=92=E4=BA=8B=E6=83=85?= =?UTF-8?q?=E3=80=82=E4=B8=8D=E7=84=B6=E7=9B=9B=E6=B4=BE=E7=9A=84=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=9C=89bug=EF=BC=8C=E5=9C=A8=E4=B8=8D=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E5=BE=AE=E4=BF=A1=E5=85=AC=E4=BC=97=E5=8F=B7=E5=8F=AA?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E8=BF=9B=E8=A1=8C=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E6=B6=88=E6=81=AF=E6=93=8D=E4=BD=9C=EF=BC=8C?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=BF=98=E6=98=AF=E8=B5=B0=E7=9A=84=E6=98=AF?= =?UTF-8?q?=E5=BE=AE=E2=80=A6=20*=20=E4=BF=AE=E5=A4=8D=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=8D=E6=8E=A8=E9=80=81=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20*=20Merge=20branch=20'develop'=20into=20dahuihui/de?= =?UTF-8?q?velop=20*=20Merge=20branch=20'develop'=20into=20dahuihui/develo?= =?UTF-8?q?p=20*=20=E4=BF=AE=E5=A4=8D=E8=BF=87=E6=9C=9F=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E6=96=87=E6=A1=A3=20*=20=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=99=A8=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E4=BA=8B=E5=8A=A1=20*=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=AB=AF=E6=8F=90=E7=A4=BA=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=20*=20=E4=BF=AE=E5=A4=8D=E5=BC=B9=E7=AA=97=E4=B8=8D=E5=B1=85?= =?UTF-8?q?=E4=B8=AD=E9=97=AE=E9=A2=98=20*=20=E8=B0=83=E6=95=B4=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E5=91=BD=E5=90=8D=E6=96=B9=E5=BC=8F=20*=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Duni-app=E5=89=8D=E7=AB=AF=EF=BC=8C=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E3=80=90=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E6=94=B6=E8=B4=A7=E3=80=91=E6=8C=89=E9=92=AE=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20*=201=E3=80=81=E4=BF=AE=E5=A4=8Dmysql?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E4=B8=8B,=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1sql=E7=9A=84=E8=AF=AD=E6=B3=95=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E3=80=822=E3=80=81=E4=B8=BA=E6=96=B9=E4=BE=BF?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=9C=A8=E4=B8=8D=E9=83=A8=E7=BD=B2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=8F=8A=E5=90=8E=E7=AB=AF=E7=9A=84=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E6=B5=8B=E8=AF=95uni-app=E5=89=8D=E7=AB=AF=EF=BC=8C?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80=E2=80=A6=20*=20Merge=20bra?= =?UTF-8?q?nch=20'develop'=20into=20dahuihui/develop=20*=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=91=BD=E5=90=8D=20*=20=E5=A2=9E=E5=8A=A0docker-comp?= =?UTF-8?q?ose=E9=83=A8=E7=BD=B2=20*=20Merge=20branch=20'develop'=20into?= =?UTF-8?q?=20dahuihui/develop=20*=20=E4=BF=AE=E5=A4=8D=E5=9B=A0linux?= =?UTF-8?q?=E4=B8=8B=E5=AD=98=E5=9C=A8=E6=95=B0=E6=8D=AE=E4=B8=8E=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=E7=A7=B0=E5=A4=A7=E5=B0=8F=E5=86=99=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E6=95=B0=E6=8D=AE=E5=BA=93=E8=A1=A8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E7=89=B9=E9=87=8D=E6=96=B0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E4=B8=80=E4=BB=BD=E8=A1=A8=E5=90=8D=E4=B8=8E=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=B8=80=E4=B8=80=E5=AF=B9=E5=BA=94=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E3=80=82=20*=20=E6=96=B0mysql=E8=A1=A8=E5=90=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=A4=A7=E5=B0=8F=E5=86=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wwwroot/views/advert/advertisement/getArticle.html | 2 +- .../wwwroot/views/advert/advertisement/index.html | 2 +- .../wwwroot/views/advert/advertposition/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/agent/agentGoods/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/agent/agentGrade/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/agent/agentOrder/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/agent/agents/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/agent/setting/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/article/articles/index.html | 2 +- .../wwwroot/views/article/articletype/index.html | 2 +- .../wwwroot/views/distribution/distributor/index.html | 2 +- .../wwwroot/views/distribution/grade/index.html | 2 +- .../wwwroot/views/distribution/order/index.html | 2 +- .../wwwroot/views/distribution/setting/index.html | 2 +- .../wwwroot/views/financial/billpayments/index.html | 2 +- .../wwwroot/views/financial/billrefund/index.html | 2 +- .../wwwroot/views/financial/invoice/index.html | 2 +- .../wwwroot/views/financial/payments/index.html | 2 +- .../wwwroot/views/financial/userbalance/index.html | 2 +- .../wwwroot/views/financial/usertocash/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/good/goods/create.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/good/goods/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/good/goodsbrand/index.html | 2 +- .../wwwroot/views/good/goodscategory/index.html | 2 +- .../wwwroot/views/good/goodscomment/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/good/goodsinfos/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/good/goodsparams/index.html | 2 +- .../wwwroot/views/good/goodstype/getgoodsparams.html | 2 +- .../wwwroot/views/good/goodstype/getgoodstypespec.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/good/goodstype/index.html | 2 +- .../wwwroot/views/good/goodstypespec/index.html | 2 +- .../wwwroot/views/intelligentForms/form/index.html | 2 +- .../wwwroot/views/intelligentForms/formsubmit/index.html | 2 +- .../wwwroot/views/logs/sysloginrecord/index.html | 2 +- .../wwwroot/views/logs/sysnlogrecords/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/logs/systasklog/index.html | 2 +- .../wwwroot/views/message/messagecenter/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/message/smslog/index.html | 2 +- .../wwwroot/views/message/smssetting/index.html | 2 +- .../wwwroot/views/message/wechatappletsmessage/index.html | 2 +- .../wwwroot/views/order/billaftersales/index.html | 2 +- .../wwwroot/views/order/billdelivery/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/order/billlading/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/order/billreship/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/order/orders/index.html | 2 +- .../wwwroot/views/promotion/coupon/couponlist.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/promotion/coupon/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/promotion/group/index.html | 2 +- .../wwwroot/views/promotion/pintuan/pintuanrecord/index.html | 2 +- .../wwwroot/views/promotion/pintuan/pintuanrule/index.html | 2 +- .../wwwroot/views/promotion/promotion/index.html | 2 +- .../wwwroot/views/serviceGoods/services/index.html | 2 +- .../wwwroot/views/serviceGoods/servicesorder/index.html | 2 +- .../wwwroot/views/serviceGoods/servicesticket/index.html | 2 +- .../views/serviceGoods/servicesticketverificationlog/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/shop/area/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/shop/logistics/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/shop/notice/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/shop/pages/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/shop/pagesitems/index.html | 2 +- .../wwwroot/views/shop/servicedescription/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/setting.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/shop/ship/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/shop/store/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/stock/products/details.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/stock/products/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/stock/stocklog/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/stock/stocks/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/system/setManager/info.html | 2 +- .../wwwroot/views/system/sysdictionary/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/system/sysmenu/index.html | 2 +- .../wwwroot/views/system/sysorganization/index.html | 2 +- .../wwwroot/views/system/sysorganization/index2.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/system/sysrole/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/system/sysuser/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/user/userInfo/index.html | 2 +- CoreCms.Net.Web.Admin/wwwroot/views/user/usergrade/index.html | 2 +- 78 files changed, 78 insertions(+), 78 deletions(-) diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/advert/advertisement/getArticle.html b/CoreCms.Net.Web.Admin/wwwroot/views/advert/advertisement/getArticle.html index 7a35964..20ad3b0 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/advert/advertisement/getArticle.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/advert/advertisement/getArticle.html @@ -10,7 +10,7 @@ -
diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/agent/agentGrade/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/agent/agentGrade/index.html index 31e227d..9120dec 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/agent/agentGrade/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/agent/agentGrade/index.html @@ -10,7 +10,7 @@ -
diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/financial/userbalance/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/financial/userbalance/index.html index ef577a8..35bfd2b 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/financial/userbalance/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/financial/userbalance/index.html @@ -10,7 +10,7 @@ -
diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/good/goodstypespec/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/good/goodstypespec/index.html index cfd11b9..c0b1773 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/good/goodstypespec/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/good/goodstypespec/index.html @@ -10,7 +10,7 @@ -
diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/message/smslog/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/message/smslog/index.html index 101983e..87670c5 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/message/smslog/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/message/smslog/index.html @@ -10,7 +10,7 @@ -
diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/order/billlading/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/order/billlading/index.html index 4734ec1..d01ed52 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/order/billlading/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/order/billlading/index.html @@ -10,7 +10,7 @@ -
diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/shop/pagesitems/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/shop/pagesitems/index.html index 20f6ae1..c2252d9 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/shop/pagesitems/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/shop/pagesitems/index.html @@ -10,7 +10,7 @@ -
diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/shop/store/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/shop/store/index.html index 7a4b03a..6add3ef 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/shop/store/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/shop/store/index.html @@ -14,7 +14,7 @@ #storeTable + .layui-table-view .layui-table-body tbody > tr.layui-table-click { background-color: #fff3e0; } #storeTable + .layui-table-view .layui-table-body tbody > tr.layui-table-click td:last-child > div:before { position: absolute; right: 6px; content: "\e602"; font-size: 12px; font-style: normal; font-family: layui-icon !important; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } - + + + + + + + + + + + + + \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/create.html b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/create.html index 8dfefe0..a46a088 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/create.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/create.html @@ -17,7 +17,8 @@
  • 基础信息
  • 图集/视频
  • -
  • 货品信息
  • +
  • SKU/货品设置
  • +
  • 参数设置
  • 会员折扣
  • 商品详情
@@ -166,13 +167,13 @@
-
- 1、选择对应的【商品类型】,将进入多规格货品模式。同时如果类别有参数,也将进行显示设置。
- 2、设置多规格后,商品本身的价格只做对外展示用,实际以进入商品详情选择不同货品为准。
- 3、货品规格组合属性值只支持:中文、英文、数字、大写符号,小写符号三个(-、/、.))
- 4、货号必须为SN字母开头
+
@@ -183,23 +184,21 @@
- +
- +
-
+
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+ +
@@ -275,7 +294,7 @@ 默认货品 图片 货号 - 规格 + SKU 重量(克) 库存 *销售价 @@ -305,13 +324,13 @@
- 选择图片 + 上传图片 - + {{item.spesDesc}} @@ -347,11 +366,11 @@ + + + - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/edit.html b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/edit.html index 47b3598..59d4434 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/edit.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/edit.html @@ -16,7 +16,8 @@
  • 基础信息
  • 图集/视频
  • -
  • 货品信息
  • +
  • SKU/货品设置
  • +
  • 参数设置
  • 会员折扣
  • 商品详情
@@ -120,7 +121,6 @@
-
请选择小于5M的图片进行裁剪上传 @@ -169,13 +169,13 @@
-
- 1、选择对应的【商品类型】,将进入多规格货品模式。同时如果类别有参数,也将进行显示设置。
- 2、设置多规格后,商品本身的价格只做对外展示用,实际以进入商品详情选择不同货品为准。
- 3、货品规格组合属性值只支持:中文、英文、数字、大写符号,小写符号三个(-、/、.))
+
@@ -186,29 +186,47 @@
- +
- +
- 选择图片 + 上传图片 - + {{item.spesDesc}} @@ -352,10 +370,11 @@ + + - @@ -500,9 +519,20 @@ viewBox.innerHTML = html; }); } + + //初始化已经确认商品SKU + if (d.data.goodsTypeSpec) { + var tmpData = { goodsTypeSpec: d.data.goodsTypeSpec, model: d.data.model }; + //赋值商品参数数据 + var getTpl = sku_tpl.innerHTML, viewBox = document.getElementById('product-info'); + laytpl(getTpl).render(tmpData, function (html) { + viewBox.innerHTML = html; + }); + } + var arrParameters = []; //初始化已经确认商品参数 - if (d.data.goodsParams || d.data.goodsTypeSpec) { + if (d.data.goodsParams) { if (d.data.model.parameters) { var arr = d.data.model.parameters.split('|'); for (var i = 0; i < arr.length; i++) { @@ -510,14 +540,15 @@ arrParameters.push(arrChild); } } - var tmpData = { goodsParams: d.data.goodsParams, goodsTypeSpec: d.data.goodsTypeSpec, arrParameters: arrParameters, model: d.data.model }; + var tmpData = { goodsParams: d.data.goodsParams, arrParameters: arrParameters }; //赋值商品参数数据 - var getTpl = params_tpl.innerHTML, viewBox = document.getElementById('product-info'); + var getTpl = params_tpl.innerHTML, viewBox = document.getElementById('parametersBox'); laytpl(getTpl).render(tmpData, function (html) { viewBox.innerHTML = html; }); } + //初始化数据 enptyProducts = { id: 0, @@ -556,7 +587,7 @@ $("#parametersBox").show(); $("#goodsTypeIdViewBox").show(); var btn = $('#openSpecBtn'); - $(btn).html("取消规格"); + $(btn).html("取消SKU"); } // 渲染商品分类 @@ -626,6 +657,77 @@ } }); + var arrParams = []; + if (d.data.model.goodsParamsIds) { + arrParams = d.data.model.goodsParamsIds.split(','); + } + + //渲染商品扩展分类 + var insGoodsParams = xmSelect.render({ + el: '#goodsParams_SelectCreateTree', + height: '250px', + data: d.data.paramsList, + //model: { label: { type: 'text' } }, + name: 'goodsParamsIds', + prop: { + name: 'name', + value: 'id' + }, + initValue: arrParams, + tree: { + //是否显示树状结构 + show: true, + //是否展示三角图标 + showFolderIcon: true, + //是否显示虚线 + showLine: true, + //间距 + indent: 20, + //默认展开节点的数组, 为 true 时, 展开所有节点 + expandedKeys: true, + //是否严格遵守父子模式 + strict: false, + //是否开启极简模式 + simple: false, + } + }); + + var arrSku = []; + if (d.data.model.goodsSkuIds) { + arrSku = d.data.model.goodsSkuIds.split(','); + } + + //渲染商品扩展分类 + var insgoodsSKU = xmSelect.render({ + el: '#goodsSku_SelectCreateTree', + height: '250px', + data: d.data.skuList, + //model: { label: { type: 'text' } }, + name: 'goodsSkuIds', + prop: { + name: 'name', + value: 'id' + }, + initValue: arrSku, + tree: { + //是否显示树状结构 + show: true, + //是否展示三角图标 + showFolderIcon: true, + //是否显示虚线 + showLine: true, + //间距 + indent: 20, + //默认展开节点的数组, 为 true 时, 展开所有节点 + expandedKeys: true, + //是否严格遵守父子模式 + strict: false, + //是否开启极简模式 + simple: false, + } + }); + + //封面图图片上传 $('#upBtn').click(function () { cropperImg.cropImg({ @@ -646,6 +748,7 @@ }); } }); + form.render(); }); //封面图图片上传 @@ -672,9 +775,10 @@ }); } }); + form.render(); }); - //规格缩略图上传 + //SKU缩略图上传 $('.upSpecImage').click(function () { var _that = this; cropperImg.cropImg({ @@ -697,6 +801,7 @@ }); } }); + form.render(); }); //表单验证规则 @@ -733,7 +838,7 @@ //重新渲染分类下拉 insXmSelGoodsCategoryId.update({ data: e.data.categories.data, autoRow: true, }) insXmSelGoodsCategoryIdExtend.update({ data: e.data.categories.data, autoRow: true, }) - + form.render(); layer.close(index); //再执行关闭 layer.msg(e.msg); } else { @@ -749,78 +854,85 @@ } }); }); - //添加类型 - $(document).on('click', '.add-type', function () { - coreHelper.Post("Api/CoreCmsGoodsType/GetCreate", null, function (e) { + //添加sku + $(document).on('click', '.add-Sku', function () { + coreHelper.Post("Api/CoreCmsGoodsTypeSpec/GetCreate", null, function (e) { if (e.code === 0) { admin.popup({ shadeClose: false, - title: '添加类型', - area: ['700px', '540px'], - id: 'LAY-popup-CoreCmsGoodsType-create', + title: '创建数据', + area: ['550px', '90%'], + id: 'LAY-popup-CoreCmsGoodsTypeSpec-create', success: function (layero, index) { - view(this.id).render('good/goodstype/create', { data: e.data }).done(function () { + view(this.id).render('good/goodstypespec/create', { data: e.data }).done(function () { //监听提交 - form.on('submit(LAY-app-CoreCmsGoodsType-createForm-submit)', + form.on('submit(LAY-app-CoreCmsGoodsTypeSpec-createForm-submit)', function (data) { var field = data.field; //获取提交的字段 var keys = Object.keys(field); - var paramsIds = 0; - var typeIds = 0; + field.value = []; for (var i = 0; i < keys.length; i++) { - if (keys[i].indexOf("params_id") != -1) { paramsIds++; }; - if (keys[i].indexOf("type_id") != -1) { typeIds++; }; + if (keys[i].indexOf("value") != -1) { + var keyName = Object.keys(field)[i]; + field.value.push(field[keyName]); + }; } - if (paramsIds > 0) { - var arr = []; - for (var i = 0; i < paramsIds; i++) { - var id = 'params_id[' + i + ']'; - var name = 'params_name[' + i + ']'; - var type = 'params_type[' + i + ']'; - var value = 'params_value[' + i + ']'; - if (field[name]) { - var paramsModel = {}; - paramsModel.paramsId = parseInt(field[id]); - paramsModel.paramsName = field[name]; - paramsModel.paramsType = field[type]; - paramsModel.paramsValue = field[value]; - arr.push(paramsModel) - } - } - field.parameters = arr; - }; - if (typeIds > 0) { - var arr = []; - for (var i = 0; i < typeIds; i++) { - var id = 'type_id[' + i + ']'; - var name = 'type_name[' + i + ']'; - var type = 'type_sort[' + i + ']'; - var value = 'type_value[' + i + ']'; - if (field[name]) { - var typeModel = {}; - typeModel.typeId = parseInt(field[id]); - typeModel.typeName = field[name]; - typeModel.typeType = field[type]; - typeModel.typeValue = field[value]; - arr.push(typeModel) + + if (debug) { console.log(field); } //开启调试返回数据 + //提交 Ajax 成功后,关闭当前弹层并重载表格 + coreHelper.Post("Api/CoreCmsGoodsTypeSpec/DoCreate", field, function (e) { + if (e.code === 0) { + var ids = insgoodsSKU.getValue(); + var arrSku = []; + if (ids.length > 0) { + arrSku = ids; } + insgoodsSKU.update({ data: e.data.skuList, initValue: arrSku, autoRow: true, }) + form.render(); + layer.close(index); //再执行关闭 + layer.msg(e.msg); + } else { + layer.msg(e.msg); } - field.types = arr; - } + }); + }); + }); + } + }); + } else { + layer.msg(e.msg); + } + }); + return false; + }); - if (debug) { console.log(field); console.log('paramsIds:' + paramsIds); console.log('typeIds:' + typeIds); } //开启调试返回数据 + //添加参数模型 + $(document).on('click', '.add-goodsParams', function () { + coreHelper.Post("Api/CoreCmsGoodsParams/GetCreate", null, function (e) { + if (e.code === 0) { + admin.popup({ + shadeClose: false, + title: '创建数据', + area: ['550px', '400px'], + id: 'LAY-popup-CoreCmsGoodsParams-create', + success: function (layero, index) { + view(this.id).render('good/goodsparams/create', { data: e.data }).done(function () { + //监听提交 + form.on('submit(LAY-app-CoreCmsGoodsParams-createForm-submit)', + function (data) { + var field = data.field; //获取提交的字段 + + if (debug) { console.log(field); } //开启调试返回数据 //提交 Ajax 成功后,关闭当前弹层并重载表格 - coreHelper.Post("Api/CoreCmsGoodsType/DoCreate", field, function (e) { + coreHelper.Post("Api/CoreCmsGoodsParams/DoCreate", field, function (e) { if (e.code === 0) { - //下拉重新赋值 - var getTpl = type_tpl.innerHTML, view = document.getElementById('goodsTypeIdView'); - var tmpData = {}; - tmpData.list = e.data.types; - laytpl(getTpl).render(tmpData, function (html) { - view.innerHTML = html; - }); + var ids = insGoodsParams.getValue(); + var arrSku = []; + if (ids.length > 0) { + arrSku = ids; + } + insGoodsParams.update({ data: e.data.paramsList, initValue: arrSku, autoRow: true, }) form.render(); - layer.close(index); //再执行关闭 layer.msg(e.msg); } else { @@ -837,6 +949,7 @@ }); return false; }); + //添加品牌 $(document).on('click', '.add-brand', function () { coreHelper.Post("Api/CoreCmsBrand/GetCreate", null, function (e) { @@ -858,7 +971,7 @@ coreHelper.Post("Api/CoreCmsBrand/DoCreate", field, function (e) { if (e.code === 0) { //下拉重新赋值 - var getTpl = type_tpl.innerHTML, view = document.getElementById('brandIdView'); + var getTpl = brand_tpl.innerHTML, view = document.getElementById('brandIdView'); var tmpData = {}; tmpData.list = e.data.brands; laytpl(getTpl).render(tmpData, function (html) { @@ -881,35 +994,7 @@ }); return false; }); - //切换商品类型赋值参数 - form.on('select(goodsTypeId)', function (data) { - var typeId = data.value; - if (typeId) { - layer.confirm('更换类型后,货品需重新生成,确定要更换吗?', { - btn: ['确定', '取消'] - , title: '提示', - }, function (index) { - coreHelper.Post("Api/CoreCmsGoods/GetTypeSpec", { id: typeId }, function (e) { - if (debug) { console.log(e); } //开启调试返回数据 - if (e.data) { - //赋值商品参数数据 - var getTpl = params_tpl.innerHTML, view = document.getElementById('product-info'); - var tmpData = { goodsParams: e.data.goodsParams, goodsTypeSpec: e.data.goodsTypeSpec, arrParameters: arrParameters, model: d.data.model }; - laytpl(getTpl).render(tmpData, function (html) { - view.innerHTML = html; - }); - if (e.data.goodsTypeSpec.length > 0) { - openSpecBox('0'); - } - form.render(); - } - }); - layer.close(index); - }, function () { - }); - } - }); //默认货品选择 form.on('checkbox(isdefalut)', function (data) { console.log(data.elem.checked); @@ -939,10 +1024,9 @@ if (is_open == '0') { $("input[name=openSpec]").val("1"); $("#spec_select").show(); - $("#parametersBox").show(); $("#goodsTypeIdViewBox").show(); - $("#openSpecBtn").html("取消规格"); - console.log("取消规格"); + $("#openSpecBtn").html("取消SKU"); + console.log("取消SKU"); if (_that.tempMultitermData.length == 0) { $('#more_spec').html(''); @@ -958,10 +1042,9 @@ } else { $("input[name=openSpec]").val("0"); $("#spec_select").hide(); - $("#parametersBox").hide(); $("#goodsTypeIdViewBox").hide(); - $("#openSpecBtn").html("开启"); - console.log("开启规则"); + $("#openSpecBtn").html("启用SKU"); + console.log("启用SKU"); var arr = []; arr.push(_that.oldSingleData); @@ -976,6 +1059,69 @@ //处理属性 为 lay-active 的所有元素事件 util.event('lay-active', { + doSetGoodsSku: function () { + var ids = insgoodsSKU.getValue(); + if (ids.length <= 0) { + layer.msg("请先选择SKU模型"); + return false; + } + var delidsStr = []; + layui.each(ids, function (index, item) { + delidsStr.push(item.id); + }); + + layer.confirm('更换SKU模型后,货品需重新生成,确定要更换吗?', { + btn: ['确定', '取消'] + , title: '提示', + }, function (index) { + coreHelper.Post("Api/CoreCmsGoods/GetSkuDetail", { id: delidsStr }, function (e) { + if (debug) { console.log(e); } //开启调试返回数据 + if (e.data) { + //赋值商品参数数据 + var tmpData = { goodsTypeSpec: e.data.goodsTypeSpec, model: d.data.model }; + + var getTpl = sku_tpl.innerHTML, view = document.getElementById('product-info'); + laytpl(getTpl).render(tmpData, function (html) { + view.innerHTML = html; + }); + if (e.data.goodsTypeSpec.length > 0) { + openSpecBox('0'); + } + form.render(); + } + }); + layer.close(index); + + }, function () { + }); + form.render(); + }, + doSetGoodsParams: function () { + var ids = insGoodsParams.getValue(); + if (ids.length <= 0) { + layer.msg("请先选择参数"); + return false; + } + if (d.data.model.parameters) { + var arr = d.data.model.parameters.split('|'); + for (var i = 0; i < arr.length; i++) { + var arrChild = arr[i].split(':'); + arrParameters.push(arrChild); + } + } + var tmpData = { goodsParams: ids, arrParameters: arrParameters }; + var getTpl = params_tpl.innerHTML, viewBox = document.getElementById('parametersBox'); + laytpl(getTpl).render(tmpData, function (html) { + viewBox.innerHTML = html; + }); + form.render(); + }, + doClearGoodsParams: function () { + $('#parametersBox').html(""); + layer.msg("已清空,请重新选择"); + form.render(); + + }, delTr: function () { $(this).parent().parent('tr').remove(); var productsCount = parseInt($('#productsCount').val()); @@ -1052,7 +1198,7 @@ $('#newSpec').val(e.data.newSpecStr); $('#productsCount').val(tmpData.length); - //规格缩略图上传 + //SKU缩略图上传 $('.upSpecImage').click(function () { var _that = this; cropperImg.cropImg({ @@ -1076,7 +1222,7 @@ } }); }); - layer.msg("规格拉取成功"); + layer.msg("Sku列表获取成功"); } else { layer.msg(e.msg, { icon: 5, anim: 6 }); } @@ -1085,7 +1231,7 @@ }); return false; } else { - layer.msg("请选择属性"); + layer.msg("请选择Sku具体明细"); return false; } return false; @@ -1161,6 +1307,10 @@ goods.costprice = field['goods[costprice]']; goods.goodsCategoryId = field['goods[goodsCategoryId]']; goods.goodsTypeId = field['goods[goodsTypeId]']; + + goods.goodsSkuIds = field.goodsSkuIds; + goods.goodsParamsIds = field.goodsParamsIds; + goods.images = field['goods[images]']; goods.image = field['goods[image]']; goods.video = field['goods[video]']; @@ -1327,7 +1477,7 @@ } return value; } - //判断规格是否选中 + //判断SKU是否选中 function isSelectedTypeSpec(parameters, id, value) { if (parameters) { var arr = parameters.split('|'); diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/index.html index 6f0b625..c6cd6f4 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/index.html @@ -44,16 +44,6 @@
-
-
- -
-