From b15e437f3e79a68fdb504f535d5971f77ab4de9d Mon Sep 17 00:00:00 2001 From: Devil Date: Thu, 7 Oct 2021 22:16:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Goods.php | 12 ------------ public/static/index/default/js/goods.js | 9 ++------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index a5c3bdb2a..257792006 100755 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -160,10 +160,6 @@ class Goods extends Common // 开始处理 $params = $this->data_post; $ret = GoodsService::GoodsSpecType($params); - if($ret['code'] == 0) - { - $ret['data'] = $ret['data']['spec_type']; - } return ApiService::ApiDataReturn($ret); } @@ -180,10 +176,6 @@ class Goods extends Common // 开始处理 $params = $this->data_post; $ret = GoodsService::GoodsSpecDetail($params); - if($ret['code'] == 0) - { - $ret['data'] = $ret['data']['spec_base']; - } return ApiService::ApiDataReturn($ret); } @@ -200,10 +192,6 @@ class Goods extends Common // 开始处理 $params = $this->data_post; $ret = GoodsService::GoodsStock($params); - if($ret['code'] == 0) - { - $ret['data'] = $ret['data']['spec_base']; - } return ApiService::ApiDataReturn($ret); } diff --git a/public/static/index/default/js/goods.js b/public/static/index/default/js/goods.js index b334d429e..4bd7aeee7 100755 --- a/public/static/index/default/js/goods.js +++ b/public/static/index/default/js/goods.js @@ -83,10 +83,9 @@ function GoodsSelectedSpec() var spec_count = $('.sku-line.selected').length; if(spec_count >= sku_count) { - $('.iteminfo_parameter .sku-items').removeClass('sku-not-active'); $('.theme-signin-left .sku-items li.selected').each(function(k, v) { - spec.push({"type": $(this).data('type-value'), "value": $(this).data('value')}) + spec.push({"type": $(this).data('type-value'), "value": $(this).data('value')}); }); } } @@ -265,11 +264,7 @@ function GoodsSpecDetail() } // 获取规格值 - var spec = []; - $('.theme-signin-left .sku-items li.selected').each(function(k, v) - { - spec.push({"type": $(this).data('type-value'), "value": $(this).data('value')}) - }); + var spec = GoodsSelectedSpec(); // 已填写数量 var stock = parseInt($('#text_box').val()) || 1;