Browse Source

feat:版本

super-yimizi 2 months ago
parent
commit
bb1d51ab41

+ 91 - 91
application/admin/view/marketing/discount/add.html

@@ -1,131 +1,131 @@
 <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
 
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <textarea id="c-desc" class="form-control " rows="5" name="row[desc]" cols="50"></textarea>
+    <div class="panel panel-default" style="margin-bottom: 20px;">
+        <div class="panel-heading" style="padding: 10px 15px; border-left: 4px solid #18bc9c;">
+            <h3 class="panel-title" style="font-size: 14px; font-weight: bold;">基本信息</h3>
         </div>
     </div>
+
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('活动名称')}:</label>
         <div class="col-xs-12 col-sm-8">
             <div class="input-group">
-                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="">
-                <div class="input-group-addon no-border no-padding">
-                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
-                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
-                </div>
-                <span class="msg-box n-right" for="c-image"></span>
+                <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" placeholder="请输入活动名称" value="" maxlength="20">
+                <span class="input-group-addon" id="name-count">0/20</span>
+                <span class="msg-box n-right" for="c-name" style="position:absolute;display:inline-block;margin-top:5px;"></span>
             </div>
-            <ul class="row list-inline faupload-preview" id="p-image"></ul>
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-type" data-rule="required" class="form-control" name="row[type]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_type')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-goods_type" data-rule="required" class="form-control" name="row[goods_type]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_info')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <textarea id="c-goods_info" class="form-control " rows="5" name="row[goods_info]" cols="50"></textarea>
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Class')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-class" data-rule="required" class="form-control" name="row[class]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Class_category')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-class_category" data-rule="required" class="form-control" name="row[class_category]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Relate_member')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-relate_member" data-rule="required" class="form-control" name="row[relate_member]" type="text" value="">
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Active_value')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <textarea id="c-active_value" class="form-control " rows="5" name="row[active_value]" cols="50"></textarea>
-        </div>
-    </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}">
         </div>
     </div>
+
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('活动期限')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+            <div class="input-group">
+                <input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}" placeholder="开始时间">
+                <span class="input-group-addon">~</span>
+                <input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:date('Y-m-d H:i:s', strtotime('+7 days'))}" placeholder="结束时间">
+            </div>
         </div>
     </div>
+
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Activity_status')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-activity_status" data-rule="required" class="form-control" name="row[activity_status]" type="text" value="">
+        <label class="control-label col-xs-12 col-sm-2">{:__('活动渠道')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <label class="checkbox-inline">
+                <input type="checkbox" name="row[channels][]" value="wechat"> 微信公众号
+            </label>
+            <label class="checkbox-inline">
+                <input type="checkbox" name="row[channels][]" value="miniapp"> 微信小程序
+            </label>
+            <label class="checkbox-inline">
+                <input type="checkbox" name="row[channels][]" value="h5"> 手机浏览器H5
+            </label>
+            <label class="checkbox-inline">
+                <input type="checkbox" name="row[channels][]" value="tiktok"> 头条/抖音小程序
+            </label>
+            <label class="checkbox-inline">
+                <input type="checkbox" name="row[channels][]" value="app"> APP
+            </label>
+            <label class="checkbox-inline">
+                <input type="checkbox" name="row[channels][]" value="pc"> PC版
+            </label>
         </div>
     </div>
+
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Active_order_money')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('选择商品')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-active_order_money" data-rule="required" class="form-control" step="0.01" name="row[active_order_money]" type="number" value="0.00">
+            <button type="button" id="select-goods" class="btn btn-primary">选择商品</button>
+            <div id="selected-goods-container" class="margin-top-10"></div>
+            <input type="hidden" name="row[goods_ids]" id="goods-ids" value="">
+            <input type="hidden" name="row[discount_data]" id="discount-data" value="">
+            <p class="help-block">提示:秒杀价格将按照设置的折扣计算,折扣范围0.1~10折</p>
         </div>
     </div>
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Active_order_num')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-active_order_num" data-rule="required" class="form-control" name="row[active_order_num]" type="number" value="0">
+    <div class="panel panel-default" style="margin-bottom: 20px;">
+        <div class="panel-heading" style="padding: 10px 15px; border-left: 4px solid #18bc9c;">
+            <h3 class="panel-title" style="font-size: 14px; font-weight: bold;">规则设置</h3>
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Active_member_num')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('活动主图')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-active_member_num" data-rule="required" class="form-control" name="row[active_member_num]" type="number" value="0">
+            <div class="input-group">
+                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-image"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+            <p class="help-block">活动落地页的顶部图片,建议尺寸750px*340px</p>
         </div>
     </div>
+
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Active_success_num')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('限购次数')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-active_success_num" data-rule="required" class="form-control" name="row[active_success_num]" type="number" value="0">
+            <div style="margin-bottom: 15px;">
+                <label class="radio-inline" style="margin-right: 20px;">
+                    <input type="radio" name="row[purchase_limit_type]" value="0" checked> 不限制
+                </label>
+            </div>
+            
+            <div style="margin-bottom: 15px; display: flex; align-items: center;">
+                <label class="radio-inline" style="margin-right: 20px; min-width: 220px;">
+                    <input type="radio" name="row[purchase_limit_type]" value="1"> 活动期内每人最多购买
+                </label>
+                <div style="display: flex; align-items: center;">
+                    <input type="number" class="form-control" name="row[purchase_limit_total]" placeholder="请输入" min="1" disabled style="width: 300px;">
+                    <span style="margin-left: 10px;">件</span>
+                </div>
+            </div>
+            
+            <div style="margin-bottom: 15px; display: flex; align-items: center;">
+                <label class="radio-inline" style="margin-right: 20px; min-width: 220px;">
+                    <input type="radio" name="row[purchase_limit_type]" value="2"> 活动期内每人每天最多购买
+                </label>
+                <div style="display: flex; align-items: center;">
+                    <input type="number" class="form-control" name="row[purchase_limit_daily]" placeholder="请输入" min="1" disabled style="width: 300px;">
+                    <span style="margin-left: 10px;">件</span>
+                </div>
+            </div>
         </div>
-    </div>
+    </div>   
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Is_del')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('活动描述')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-is_del" data-rule="required" class="form-control" name="row[is_del]" type="number" value="0">
+            <textarea id="c-desc" class="form-control editor" rows="5" name="row[desc]" cols="50"></textarea>
         </div>
     </div>
+
     <div class="form-group layer-footer">
         <label class="control-label col-xs-12 col-sm-2"></label>
         <div class="col-xs-12 col-sm-8">
-            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+            <button type="submit" class="btn btn-primary btn-embossed">{:__('提交')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('重置')}</button>
         </div>
     </div>
 </form>
+

+ 1 - 9
application/admin/view/shop/goods/select.html

@@ -1,14 +1,6 @@
 <div class="panel panel-default panel-intro">
 
-    <div class="panel-heading">
-        {:build_heading(null,FALSE)}
-        <ul class="nav nav-tabs" data-field="status">
-            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
-            {foreach name="statusList" item="vo"}
-            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
-            {/foreach}
-        </ul>
-    </div>
+ 
 
 
     <div class="panel-body">

+ 32 - 0
application/api/controller/User.php

@@ -186,6 +186,38 @@ class User extends Base
             $this->error($this->auth->getError());
         }
     }
+    /**
+     * 换绑手机号
+     */
+    public function changeMobile()
+    {
+        $params = $this->request->param();
+        $mobile = $params['mobile'] ?? '';
+        $captcha = $params['captcha'] ?? '';
+        // 验证器
+        $validate = new \app\api\validate\User();
+        if (!$validate->check($params, [], 'changeMobile')) {
+            $this->error($validate->getError());
+        }
+        $user = $this->auth->getUser();
+        if ($user->mobile == $mobile) {
+            $this->error(__('手机号不能与当前手机号相同'));
+        }
+        // 换绑手机号
+        $user = \app\common\model\User::getByMobile($mobile);
+        if ($user) {
+            $this->error(__('手机号已存在'));
+        }
+        if (!Env::get('app.app_debug') && $captcha != Env::get('app.DEFAULT_SMSCODE')) {
+            $ret = Sms::check($mobile, $captcha, 'resetpwd');
+            if (!$ret) {
+                $this->error(__('Captcha is incorrect'));
+            }
+        }
+        Sms::flush($mobile, 'resetpwd');
+        $this->auth->getUser()->save(['mobile' => $mobile]);
+        $this->success(__('换绑手机号成功'));
+    }
 
     /**
      * 分享配置参数

+ 1 - 0
application/api/validate/User.php

@@ -63,5 +63,6 @@ class User extends Validate
         'login'     => ['account', 'password'],
         'mobilelogin' => ['mobile', 'captcha'],
         'profile'   => ['nickname', 'gender', 'bio', 'avatar'],
+        'changeMobile' => ['mobile', 'captcha'],
     ];
 } 

+ 1 - 1
application/config.php

@@ -300,7 +300,7 @@ return [
         //插件纯净模式,插件启用后是否删除插件目录的application、public和assets文件夹
         'addon_pure_mode'       => true,
         //允许跨域的域名,多个以,分隔
-        'cors_request_domain'   => 'localhost,127.0.0.1',
+        'cors_request_domain'   => 'localhost,127.0.0.1,*',
         //版本号
         'version'               => '1.6.1.20250430',
         //API接口地址

+ 170 - 0
public/assets/js/backend/marketing/discount.js

@@ -117,13 +117,183 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
         add: function () {
             Controller.api.bindevent();
+            
+            // 选择商品功能
+            $('#select-goods').on('click', function() {
+                Fast.api.open('shop/goods/select', '选择商品', {
+                    callback: function(data) {
+                        if (data && data.length > 0) {
+                            var goodsIds = [];
+                            
+                            // 清空容器
+                            $('#selected-goods-container').empty();
+                            
+                            // 创建表格结构
+                            var tableHtml = 
+                                '<table class="table table-striped table-bordered table-hover">' +
+                                '<thead>' +
+                                '<tr>' +
+                                '<th width="30%">商品</th>' +
+                                '<th width="10%">价格</th>' +
+                                '<th width="10%">现库存</th>' +
+                                '<th width="15%">折扣</th>' +
+                                '<th>折后价</th>' +
+                                '<th width="10%">操作</th>' +
+                                '</tr>' +
+                                '</thead>' +
+                                '<tbody>';
+                                
+                            // 添加商品行
+                            $.each(data, function(index, item) {
+                                goodsIds.push(item.id);
+                                var specTypeText = item.spectype == 0 ? "单规格" : "多规格";
+                                
+                                // 计算默认折扣价(默认9折)
+                                var defaultDiscount = 9;
+                                var discountPrice = (item.price * defaultDiscount / 10).toFixed(2);
+                                
+                                tableHtml += '<tr data-id="' + item.id + '" data-spectype="' + item.spectype + '">' +
+                                    '<td>' +
+                                    '<div class="goods-item">' +
+                                    '<img src="' + item.image + '" style="width:60px;height:60px;margin-right:10px;" class="pull-left img-thumbnail">' +
+                                    '<div style="margin-left:70px;">' +
+                                    '<h5 style="margin-top:0;">' + item.title + '</h5>' +
+                                    '<p class="text-muted">分类:' + (item.category ? item.category.name : '') + ' | 规格:' + specTypeText + '</p>' +
+                                    '</div>' +
+                                    '</div>' +
+                                    '</td>' +
+                                    '<td>¥' + item.price + '</td>' +
+                                    '<td>' + item.stocks + '</td>' +
+                                    '<td>' +
+                                    '<div class="input-group">' +
+                                    '<input type="number" class="form-control discount-input" value="' + defaultDiscount + '" min="0.1" max="10" step="0.1" data-price="' + item.price + '" style="width:60px;">' +
+                                    '<span class="input-group-addon">折</span>' +
+                                    '</div>' +
+                                    (item.spectype == 1 ? '<a href="javascript:;" class="btn btn-xs btn-info btn-spec-discount" data-id="' + item.id + '" style="margin-top:5px;">规格折扣设置</a>' : '') +
+                                    '</td>' +
+                                    '<td><span class="discount-price">¥' + discountPrice + '</span></td>' +
+                                    '<td><a href="javascript:;" class="btn btn-xs btn-danger remove-goods" data-id="' + item.id + '">删除</a></td>' +
+                                    '</tr>';
+                            });
+                            
+                            tableHtml += '</tbody></table>';
+                            
+                            // 显示表格
+                            $('#selected-goods-container').append(tableHtml);
+                            
+                            // 更新隐藏字段
+                            $('#goods-ids').val(goodsIds.join(','));
+                            
+                            // 绑定折扣输入事件
+                            $('.discount-input').on('input', function() {
+                                var discount = parseFloat($(this).val()) || 0;
+                                if(discount < 0.1) discount = 0.1;
+                                if(discount > 10) discount = 10;
+                                
+                                var price = parseFloat($(this).data('price')) || 0;
+                                var discountPrice = (price * discount / 10).toFixed(2);
+                                
+                                $(this).closest('tr').find('.discount-price').text('¥' + discountPrice);
+                                
+                                // 更新商品折扣数据
+                                var goodsId = $(this).closest('tr').data('id');
+                                var goodsDiscount = {
+                                    id: goodsId,
+                                    discount: discount,
+                                    discount_price: discountPrice
+                                };
+                                
+                                // 存储折扣数据
+                                var discountData = $('#discount-data').val() ? JSON.parse($('#discount-data').val()) : {};
+                                discountData[goodsId] = goodsDiscount;
+                                $('#discount-data').val(JSON.stringify(discountData));
+                            });
+                            
+                            // 绑定规格折扣按钮点击事件
+                            $('.btn-spec-discount').on('click', function() {
+                                var goodsId = $(this).data('id');
+                                Fast.api.open('marketing/discount/spec_discount?goods_id=' + goodsId, '规格折扣设置');
+                            });
+                        }
+                    }
+                });
+            });
+            
+            // 删除已选商品
+            $(document).on('click', '.remove-goods', function() {
+                var id = $(this).data('id');
+                $(this).closest('tr').remove();
+                
+                // 如果表格为空,则移除整个表格
+                if($('#selected-goods-container tbody tr').length === 0) {
+                    $('#selected-goods-container').empty();
+                }
+                
+                // 更新隐藏字段
+                var currentIds = $('#goods-ids').val().split(',');
+                var newIds = [];
+                $.each(currentIds, function(i, val) {
+                    if (val != id && val) {
+                        newIds.push(val);
+                    }
+                });
+                $('#goods-ids').val(newIds.join(','));
+                
+                // 移除折扣数据
+                var discountData = $('#discount-data').val() ? JSON.parse($('#discount-data').val()) : {};
+                if(discountData[id]) {
+                    delete discountData[id];
+                    $('#discount-data').val(JSON.stringify(discountData));
+                }
+            });
         },
         edit: function () {
             Controller.api.bindevent();
+            
+            // 选择商品功能和删除商品功能,与add方法相同
+            Controller.add();
         },
         api: {
             bindevent: function () {
                 Form.api.bindevent($("form[role=form]"));
+                
+                // 活动名称字数限制处理
+                var nameInput = $("#c-name");
+                var countElement = $("#name-count");
+                
+                // 初始化显示
+                countElement.text(nameInput.val().length + "/20");
+                
+                // 监听输入事件
+                nameInput.on("input propertychange", function() {
+                    var text = $(this).val();
+                    var len = text.length;
+                    
+                    // 更新显示的字数
+                    countElement.text(len + "/20");
+                    
+                    // 限制最多输入20个字符
+                    if (len > 20) {
+                        $(this).val(text.substring(0, 20));
+                        countElement.text("20/20");
+                    }
+                });
+                
+                // 限购选项处理
+                $('input[name="row[purchase_limit_type]"]').on('change', function() {
+                    var type = $(this).val();
+                    
+                    // 禁用所有输入框
+                    $('input[name="row[purchase_limit_total]"]').prop('disabled', true);
+                    $('input[name="row[purchase_limit_daily]"]').prop('disabled', true);
+                    
+                    // 根据选择启用对应输入框
+                    if(type == '1') {
+                        $('input[name="row[purchase_limit_total]"]').prop('disabled', false).focus();
+                    } else if(type == '2') {
+                        $('input[name="row[purchase_limit_daily]"]').prop('disabled', false).focus();
+                    }
+                });
             }
         }
     };

+ 24 - 38
public/assets/js/backend/shop/goods.js

@@ -120,11 +120,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             Table.api.init({
                 extend: {
                     index_url: 'shop/goods/index' + location.search,
-                    // add_url: 'shop/goods/add',
-                    // edit_url: 'shop/goods/edit',
-                    // del_url: 'shop/goods/del',
-                    // multi_url: 'shop/goods/multi',
-                    // import_url: 'shop/goods/import',
                     table: 'shop_goods',
                 }
             });
@@ -140,46 +135,37 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
-                        {field: 'category.name', title: __('Category'), operate: false},
-                        {field: 'category_id', title: __('Category'), visible: false, searchList: $.getJSON("shop/category/getList")},
-                        {field: 'brand.name', title: __('Brand'), operate: false},
-                        {field: 'brand_id', title: __('Brand'), visible: false, searchList: $.getJSON("shop/brand/getList")},
-                        {field: 'goods_sn', title: __('Goods_sn'), operate: 'LIKE'},
-                        {field: 'title', title: __('Title'), operate: 'LIKE', formatter: Controller.api.content},
-                        {field: 'marketprice', title: __('Marketprice'), operate: 'BETWEEN'},
-                        {field: 'price', title: __('Price'), operate: 'BETWEEN'},
-                        {field: 'stocks', title: __('Stocks')},
-                        {field: 'sales', title: __('Sales')},
-                        {field: 'views', title: __('Views')},
-                        {field: 'comments', title: __('Comments')},
-                        {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
-                        {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
-                        {field: 'corner', title: __('Corner'), operate: 'LIKE', visible: false},
-                        {field: 'flag', title: __('Flag'), searchList: {"recommend": __('Recommend'), "hot": __('Hot'), "new": __('New'), "best": __('Best'), "index": __('Index')}, operate: 'FIND_IN_SET', formatter: Table.api.formatter.label},
-                        {field: 'weight', title: __('Weight'), operate: 'BETWEEN'},
-                        {field: 'weigh', title: __('Weigh'), operate: false},
-                        {field: 'createtime', title: __('Createtime'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime},
-                        {field: 'status', title: __('Status'), searchList: {"normal": __('Normal'), "hidden": __('Hidden'), "soldout": __('Soldout')}, formatter: Table.api.formatter.status},
-
+                        {field: 'spectype', title: __('规格'), searchList: {0: "单规格", 1: "多规格"}, formatter: Table.api.formatter.label},
+                        {field: 'category.name', title: __('分类'), operate: false},
+                        {field: 'category_id', title: __('分类'), visible: false, searchList: $.getJSON("shop/category/getList")},
+                        {field: 'image', title: __('图片'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+                        {field: 'title', title: __('标题'), operate: 'LIKE', formatter: Controller.api.content},
+                        // {field: 'marketprice', title: __('划线价'), operate: 'BETWEEN'},
+                        {field: 'price', title: __('销售价'), operate: 'BETWEEN'},
+                        {field: 'stocks', title: __('库存')},
                     ]
                 ]
             });
             //选中商品
             $(document).on('click', '.btn-goods-select', function () {
                 let goods_ids = Table.api.selectedids(table);
-                parent.Layer.prompt({title: '输入积分', formType: 3, zIndex: 198910216}, function (score, index) {
-                    parent.Layer.close(index);
-                    parent.Fast.api.ajax({
-                        url: 'shop/exchange/creategoods',
-                        data: {
-                            goods_ids,
-                            score
-                        }
-                    }, function (res) {
-                        parent.Layer.close(parent.Layer.getFrameIndex(window.name));
-                        parent.$("#table").bootstrapTable('refresh', {});
-                    })
+                if (goods_ids.length == 0) {
+                    Layer.alert('请选择商品');
+                    return;
+                }
+                
+                // 获取选中的商品数据
+                var selectedRows = [];
+                $.each(table.bootstrapTable('getSelections'), function(index, row) {
+                    selectedRows.push(row);
                 });
+                
+                // 调用父窗口回调函数
+                var callback = parent.Fast.api.callback;
+                if (typeof callback === 'function') {
+                    callback.call(undefined, selectedRows);
+                    parent.Layer.close(parent.Layer.getFrameIndex(window.name));
+                }
             });
             // 为表格绑定事件
             Table.api.bindevent(table);