quanwei
8 days ago b8961f178740f99ce54cfcbfd88235eaf8b79872
保证金和年卡放同一个页面
36 files modified
2403 ■■■■ changed files
admin/app/api/controller/branch/Activity.php 2 ●●● patch | view | raw | blame | history
admin/app/api/controller/order/Cart.php 3 ●●●●● patch | view | raw | blame | history
admin/app/api/controller/supplier/Index.php 15 ●●●●● patch | view | raw | blame | history
admin/app/api/controller/supplier/Member.php 21 ●●●●● patch | view | raw | blame | history
admin/app/api/model/branch/ActivityUser.php 14 ●●●●● patch | view | raw | blame | history
admin/app/api/model/page/Page.php 2 ●●●●● patch | view | raw | blame | history
admin/app/api/model/plus/bonus/Order.php 7 ●●●●● patch | view | raw | blame | history
admin/app/api/model/supplier/DepositOrder.php 8 ●●●● patch | view | raw | blame | history
admin/app/api/service/coupon/ProductDeductService.php 2 ●●● patch | view | raw | blame | history
admin/app/api/service/order/paysuccess/type/CashPaySuccessService.php 12 ●●●● patch | view | raw | blame | history
admin/app/api/service/order/paysuccess/type/SupplierMemberPaySuccessService.php 22 ●●●● patch | view | raw | blame | history
admin/app/common/model/plus/agent/Referee.php 1 ●●●● patch | view | raw | blame | history
admin/app/common/model/plus/agent/User.php 16 ●●●●● patch | view | raw | blame | history
admin/app/common/model/plus/bonus/Apply.php 12 ●●●● patch | view | raw | blame | history
admin/app/common/model/plus/bonus/Order.php 4 ●●●● patch | view | raw | blame | history
admin/app/common/model/plus/team/Apply.php 2 ●●● patch | view | raw | blame | history
admin/app/common/model/plus/vip/Apply.php 11 ●●●●● patch | view | raw | blame | history
admin/app/common/model/plus/vip/Order.php 2 ●●● patch | view | raw | blame | history
admin/app/common/model/supplier/member/Plan.php 11 ●●●●● patch | view | raw | blame | history
admin/app/common/service/supplier/MemberService.php 2 ●●● patch | view | raw | blame | history
mobile/components/diy/product/product.vue 284 ●●●●● patch | view | raw | blame | history
mobile/components/diy/product/productCity.vue 27 ●●●●● patch | view | raw | blame | history
mobile/pages/branch/activity/detail/detail.vue 2 ●●● patch | view | raw | blame | history
mobile/pages/branch/activity/detail/popup/user.vue 6 ●●●● patch | view | raw | blame | history
mobile/pages/branch/admin/activity/user.vue 5 ●●●●● patch | view | raw | blame | history
mobile/pages/product/category.vue 443 ●●●●● patch | view | raw | blame | history
mobile/pages/product/list/list.vue 635 ●●●●● patch | view | raw | blame | history
mobile/pages/shop/category.vue 445 ●●●●● patch | view | raw | blame | history
mobile/pages/user/my_shop/my_shop.vue 158 ●●●● patch | view | raw | blame | history
shop_vue/src/views/plus/vip/grade/part/Add.vue 15 ●●●● patch | view | raw | blame | history
shop_vue/src/views/plus/vip/grade/part/Edit.vue 11 ●●●● patch | view | raw | blame | history
shop_vue/src/views/plus/vip/grade/part/List.vue 17 ●●●●● patch | view | raw | blame | history
supplier_vue/src/views/plus/vip/grade/part/Add.vue 73 ●●●●● patch | view | raw | blame | history
supplier_vue/src/views/plus/vip/grade/part/Edit.vue 62 ●●●●● patch | view | raw | blame | history
supplier_vue/src/views/plus/vip/grade/part/List.vue 33 ●●●●● patch | view | raw | blame | history
supplier_vue/src/views/plus/vip/grade/part/Log.vue 18 ●●●● patch | view | raw | blame | history
admin/app/api/controller/branch/Activity.php
@@ -63,7 +63,7 @@
        $points = SettingModel::getItem('points');
        $detail['points_ratio'] = $points['discount']['discount_ratio']; // 积分抵扣比例
        // 获取报名用户列表
        $userList = (new ActivityUserModel())->getListForActivity(['activity_id' => $activity_id], false, 8);
        $userList = (new ActivityUserModel())->getListForActivity(['activity_id' => $activity_id], false, 7);
        return $this->renderSuccess('', compact('detail', 'userList'));
    }
admin/app/api/controller/order/Cart.php
@@ -74,9 +74,6 @@
        if ($product['is_newcomer'] == 1) {
            return $this->renderError('新人专区商品不能加入购物车');
        }
        if ($product['is_repurchase'] == 1) {
            return $this->renderError('复购专区商品不能加入购物车');
        }
        if (!$model->add($this->user, $product_id, $product_num, $spec_sku_id)) {
            return $this->renderError($model->getError() ?: '加入购物车失败');
        }
admin/app/api/controller/supplier/Index.php
@@ -5,12 +5,15 @@
use app\api\controller\Controller;
use app\api\model\supplier\DepositOrder as DepositOrderModel;
use app\api\model\supplier\DepositRefund as DepositRefundModel;
use app\api\model\supplier\member\Order as MemberOrderModel;
use app\api\model\supplier\member\Plan as MemberPlanModel;
use app\api\model\supplier\Supplier as SupplierModel;
use app\api\model\plus\coupon\Coupon as CouponModel;
use app\api\model\page\Ad as AdModel;
use app\api\model\order\Order as OrderModel;
use app\api\model\user\Visit as VisitModel;
use app\common\service\statistics\OrderService;
use app\common\service\supplier\MemberService;
use app\supplier\service\statistics\UserService;
use app\supplier\model\order\OrderSettled as OrderSettledModel;
use app\api\model\settings\Setting as SettingModel;
@@ -177,9 +180,19 @@
        }
        $params = $this->request->param();
        $plans = (new MemberPlanModel())->detail($params['plan_id']);
        $result=['data'=>['order_id'=>0]];
        if ($plans['price'] > 0){
            $memberService = new MemberService();
            $result = $memberService->createOrder($supplier['shop_supplier_id'], $params['plan_id'], $user);
            if (!$result['status']){
                return $this->renderError($result['msg'] ?: '创建订单失败');
            }
        }
        // 生成订单
        $model = new DepositOrderModel;
        $order_id = $model->createOrder($user, $supplier);
        $order_id = $model->createOrder($user, $supplier,$result);
        if (!$order_id) {
            return $this->renderError($model->getError() ?: '创建订单失败');
        }
admin/app/api/controller/supplier/Member.php
@@ -4,6 +4,7 @@
use app\api\controller\Controller;
use app\api\model\supplier\member\Plan as MemberPlanModel;
use app\api\service\order\paysuccess\type\SupplierMemberPaySuccessService;
use app\common\enum\user\balanceLog\BalanceLogSceneEnum;
use app\common\model\app\App as AppModel;
use app\common\model\supplier\Supplier as SupplierModel;
@@ -25,6 +26,14 @@
    public function plans()
    {
        $plans = (new MemberPlanModel())->getEnabledPlans();
        return $this->renderSuccess('',compact('plans'));
    }
    /**
     * 获取年卡套餐列表(包含默认年卡)
     */
    public function plansAll()
    {
        $plans = (new MemberPlanModel())->getEnabledPlansAll();
        return $this->renderSuccess('',compact('plans'));
    }
@@ -88,15 +97,9 @@
            if ($user['balance'] < $order['price']) {
                return $this->renderError('余额不足');
            }
            // 扣除余额并激活会员
            $user->where('user_id', '=', $user['user_id'])
                ->dec('balance', $order['price'])
                ->update();
            BalanceLogModel::add(BalanceLogSceneEnum::CONSUME, [
                'user_id' => $user['user_id'],
                'money' => -$order['price'],
            ], ['order_no' => $order['order_no']]);
            //$user->setDecBalance($order['price'], '购买年卡');
            $SupplierMemberPaySuccessService = new SupplierMemberPaySuccessService($order['order_no']);
            $SupplierMemberPaySuccessService->onPaySuccess(10, []);
            $memberService = new MemberService();
            $memberService->activateMember($param['order_id']);
            return $this->renderSuccess('支付成功', [
admin/app/api/model/branch/ActivityUser.php
@@ -154,7 +154,19 @@
    {
        $list=$this->where('user_id', '=', $user_id)
            ->order('create_time', 'desc')->find();
        $data=[];
        $data=[
            'province_id'=>'',
            'city_id'=>'',
            'region_id'=>'',
            'recommend_name'=>'',
            'recommend_mobile'=>'',
            'real_name'=>'',
            'mobile'=>'',
            'branch_id'=>'',
            'company'=>'',
            'branch_name'=>'',
            'region'=>'',
        ];
        if ($list){
            $branch=(new Branch())->detail($list['branch_id']);
            $data=[
admin/app/api/model/page/Page.php
@@ -119,6 +119,8 @@
            $data[] = [
                'product_id' => $product['product_id'],
                'product_name' => $product['product_name'],
                'cart' => $product['cart'],
                'product_sku' => $product['product_sku'],
                'selling_point' => $product['selling_point'],
                'image' => $product['image'][0]['file_path'],
                'product_image' => $product['image'][0]['file_path'],
admin/app/api/model/plus/bonus/Order.php
@@ -49,18 +49,17 @@
        if (empty($config['become__buy_product_ids'])) {
            return false;
        }
        // 整理商品id集
        /*// 整理商品id集
        $productIds = helper::getArrayColumn($order['product'], 'product_id');
        // 判断商品是否在设置范围内
        $intersect = array_intersect($productIds, $config['become__buy_product_ids']);
        if (empty($intersect)) {
            return false;
        }
        }*/
        // 每买一个指定商品就生成一个分红订单
        foreach ($order['product'] as $product) {
            // 检查商品是否是指定的分红商品
            if (in_array($product['product_id'], $config['become__buy_product_ids'])) {
            if (in_array($product['product_id'], $config['become__buy_product_ids'])||$product['is_vip']==1) {
                // 获取商品数量
                $quantity = $product['total_num'];
                // 为每个商品生成分红订单
admin/app/api/model/supplier/DepositOrder.php
@@ -16,7 +16,7 @@
   /**
     * 创建订单
     */
    public function createOrder($user, $supplier)
    public function createOrder($user, $supplier,$result)
    {
        if($supplier['status'] != 20){
            $this->error = '您已支付保证金';
@@ -38,8 +38,14 @@
                'user_id' => $user['user_id'],
                'pay_source' => 'wx',
                'pay_price' => $price,
                'deposit_price' => $price,
                'app_id' => self::$app_id,
            ];
            if ($result['data']['order_id'] > 0){
                $data['member_order_id'] = $result['data']['order_id'];
                $data['pay_price']=bcadd($price,$result['data']['price'],2);
                $data['member_price']=$result['data']['price'];
            }
            $this->save($data);
        }
        return $this['order_id'];
admin/app/api/service/coupon/ProductDeductService.php
@@ -65,7 +65,7 @@
    private function getProductListWeight($productList, $orderTotalPrice)
    {
        foreach ($productList as &$product) {
            $product['weight'] = $product[$this->price_column] / $orderTotalPrice;
            $product['weight'] = bcdiv($product[$this->price_column], $orderTotalPrice, 6);
        }
        return $this->arraySortByWeight($productList);
    }
admin/app/api/service/order/paysuccess/type/CashPaySuccessService.php
@@ -6,6 +6,7 @@
use app\api\model\supplier\DepositOrder as DepositOrderModel;
use app\common\enum\order\OrderPayTypeEnum;
use app\common\enum\user\balanceLog\BalanceLogSceneEnum;
use app\common\model\supplier\member\Order as MemberOrderModel;
use app\common\model\user\BalanceLog as BalanceLogModel;
use app\common\service\BaseService;
use app\common\model\supplier\User as SupplierUserModel;
@@ -86,7 +87,7 @@
            //更新
            $supplier->save([
                'status' => 0,
                'deposit_money' => $this->model['pay_price']
                'deposit_money' => $this->model['deposit_price']
            ]);
        }
    }
@@ -112,6 +113,11 @@
        if ($payType == OrderPayTypeEnum::WECHAT) {
            $order['transaction_id'] = $payData['transaction_id'];
        }
        if ($this->model['member_order_id'] > 0){
            $MemberOrder=MemberOrderModel::detail($this->model['member_order_id']);
            $SupplierMemberPaySuccessService = new SupplierMemberPaySuccessService($MemberOrder['order_no']);
            $SupplierMemberPaySuccessService->onPaySuccess($payType, $payData);
        }
        // 更新订单状态
        return $this->model->save($order);
    }
@@ -125,12 +131,12 @@
        if ($this->model['balance'] > 0) {
            // 更新用户余额
            (new UserModel())->where('user_id', '=', $this->user['user_id'])
                ->dec('balance', $this->model['balance'])
                ->dec('balance', $this->model['deposit_price'])
                ->update();
            // 余额日志
            BalanceLogModel::add(BalanceLogSceneEnum::CONSUME, [
                'user_id' => $this->user['user_id'],
                'money' => -$this->model['balance'],
                'money' => -$this->model['deposit_price'],
            ], ['描述' => '支付开店押金']);
        }
    }
admin/app/api/service/order/paysuccess/type/SupplierMemberPaySuccessService.php
@@ -2,7 +2,10 @@
namespace app\api\service\order\paysuccess\type;
use app\api\model\user\User as UserModel;
use app\common\enum\order\OrderPayTypeEnum;
use app\common\enum\user\balanceLog\BalanceLogSceneEnum;
use app\common\model\user\BalanceLog as BalanceLogModel;
use app\common\service\BaseService;
use app\common\model\supplier\member\Order as MemberOrderModel;
use app\common\service\supplier\MemberService;
@@ -14,6 +17,8 @@
{
    // 订单模型
    public $model;
    // 当前用户信息
    private $user;
    /**
     * 构造函数
@@ -22,6 +27,8 @@
    {
        // 实例化订单模型
        $this->model = MemberOrderModel::getPayDetail($orderNo);
        // 获取用户信息
        $this->user = UserModel::detail($this->model['user_id']);
    }
    /**
@@ -45,11 +52,9 @@
        if (!$status) {
            return false;
        }
        // 激活年卡
        $memberService = new MemberService();
        $result = $memberService->activateMember($this->model['order_id']);
        if (!$result) {
            $this->error = '激活年卡失败';
            return false;
@@ -69,7 +74,18 @@
            'pay_type' => $payType,
            'pay_time' => time(),
        ];
        // 余额支付
        if ($this->model['price'] > 0) {
            // 更新用户余额
            (new UserModel())->where('user_id', '=', $this->user['user_id'])
                ->dec('balance', $this->model['price'])
                ->update();
            // 余额日志
            BalanceLogModel::add(BalanceLogSceneEnum::CONSUME, [
                'user_id' => $this->user['user_id'],
                'money' => -$this->model['price'],
            ], ['描述' => '支付年卡']);
        }
        if ($payType == OrderPayTypeEnum::WECHAT || $payType == OrderPayTypeEnum::ALIPAY) {
            $order['transaction_id'] = $payData['transaction_id'];
        }
admin/app/common/model/plus/agent/Referee.php
@@ -134,6 +134,7 @@
        // 团队分红添加队长 by lyzflash
        $model = new TeamApplyModel;
        $model->becomeTeamByAgent($agent_id, 40, $app_id);
        $model->becomeTeamByAgent($user_id, 70,$app_id);
        return true;
    }
admin/app/common/model/plus/agent/User.php
@@ -79,14 +79,17 @@
        ], $data));
        $user=(new \app\common\model\user\User())->find($user_id);
        if ($user){
            $user_ids=(new ActivityUserModel)->where(['recommend_name'=>$user['real_name'],'recommend_mobile'=>$user['mobile']])->column('user_id');
            if ($user_ids){
                foreach ($user_id as $value)
                {
                    (new \app\common\model\user\User())->where(['user_id'=>$value])->update(['referee_id'=>$user_id])
                    (new refereeModel())->createRelation($value,$user_id);
            if($user['real_name']!=''&&$user['mobile']!=''){
                $user_ids=(new ActivityUserModel)->where(['recommend_name'=>$user['real_name'],'recommend_mobile'=>$user['mobile']])->column('user_id');
                if ($user_ids){
                    foreach ($user_ids as $value)
                    {
                        (new \app\common\model\user\User())->where(['user_id'=>$value])->update(['referee_id'=>$user_id])
                        (new refereeModel())->createRelation($value,$user_id);
                    }
                }
            }
        }
        event('AgentUserGrade', $model['referee_id']);
        return true;
@@ -118,6 +121,7 @@
        // 团队分红添加队长 by yj
        $teamModel = new TeamApplyModel;
        $teamModel->becomeTeamByAgent($user_id, 50, $model['app_id']);
        $teamModel->becomeTeamByAgent($user_id, 70, $model['app_id']);
        // 股东分红添加股东 by yj
        $shareholdModel = new ShareholderApplyModel;
        $shareholdModel->becomeShareholderByAgent($user_id, 50, $model['app_id']);
admin/app/common/model/plus/bonus/Apply.php
@@ -84,16 +84,11 @@
        if (empty($config['become__buy_product_ids'])) {
            return false;
        }
        // 判断商品是否在设置范围内
        $intersect = array_intersect($productIds, $config['become__buy_product_ids']);
        if (empty($intersect)) {
            return false;
        }
        $purchase_count=0;
        // 每买一个指定商品就生成一个分红订单
        foreach ($order['product'] as $product) {
            // 检查商品是否是指定的分红商品
            if (in_array($product['product_id'], $config['become__buy_product_ids'])) {
            if (in_array($product['product_id'], $config['become__buy_product_ids'])||$product['is_vip']==1) {
                // 获取商品数量
                $quantity = $product['total_num'];
                $purchase_count+=$quantity;
@@ -103,6 +98,11 @@
                }
            }
        }
        // 判断商品是否在设置范围内
        $intersect = array_intersect($productIds, $config['become__buy_product_ids']);
        if ($purchase_count<=0) {
            return false;
        }
        if(User::isBonusUser($userId)) {
            return false;
        }
admin/app/common/model/plus/bonus/Order.php
@@ -214,10 +214,10 @@
            return false;
        }
        $purchase_count=self::getUserOrderCount($order['user_id']);
        /*$user=User::detail($order['user_id']);
        $user=User::detail($order['user_id']);
        if ($user['purchase_count']<=$purchase_count&&$user['purchase_count']!=11){
            return false;
        }*/
        }
        // 检查商品是否设置独立分红
        $one_money = $setting['one_money'];
        $two_money = $setting['two_money'];
admin/app/common/model/plus/team/Apply.php
@@ -1 +1 @@
<?php namespace app\common\model\plus\team; use app\common\model\BaseModel; use app\common\model\plus\agent\User as AgentUserModel; /**  * 队长申请模型  */ class Apply extends BaseModel {     protected $name = 'team_apply';     protected $pk = 'apply_id';     /**      * 申请状态      * @var array      */     public $applyStatus = [         10 => '待审核',         20 => '审核通过',         30 => '驳回',     ];     /**      * 申请时间      * @param $value      * @return false|string      */     public function getApplyTimeAttr($value)     {         return date('Y-m-d H:i:s', $value);     }     /**      * 审核时间      * @param $value      * @return false|int|string      */     public function getAuditTimeAttr($value)     {         return $value > 0 ? date('Y-m-d H:i:s', $value) : 0;     }     /**      * 关联推荐人表      * @return \think\model\relation\BelongsTo      */     public function referee()     {         return $this->belongsTo('app\common\model\user\User', 'referee_id')             ->field(['user_id', 'nickName']);     }     /**      * 销商申请记录详情      * @param $where      * @return array|\think\Model|null      * @throws \think\db\exception\DataNotFoundException      * @throws \think\db\exception\DbException      * @throws \think\db\exception\ModelNotFoundException      */     public static function detail($where)     {         $filter = is_array($where) ? $where : ['apply_id' => $where];         return (new static())->where($filter)->find();     }     /**      * 根据分销判断成为队长      * @param $userId      * @param $appId      * @return bool      */     public function becomeTeamByAgent($userId, $become_type, $appId)     {         //log_write($become_type);         // 验证是否设置         $config = Setting::getItem('basic', $appId);         if (empty($config['is_open'])) {             return false;         }         if ($config['become'] != $become_type) {             return false;         }         $agent = AgentUserModel::detail($userId);         if (!$agent) {             return false;         }         $becomeTeam = false;         //分销商总数         if ($become_type == '40') {             $agent_total = $agent['first_num'] + $agent['second_num'] + $agent['third_num'];             if ($agent_total >= $config['totalfxs_down']) {                 $becomeTeam = true;             }         }         //分销佣金总数         if ($become_type == '50') {             $agent_money = $agent['total_money'] + $agent['money'] + $agent['freeze_money'];             if ($agent_money >= $config['total_money']) {                 $becomeTeam = true;             }         }         if($become_type == '70'){             $vipNum=(new \app\common\model\user\User)->getRefereeGradeCount([$userId],$config['referee_grade_ids']);             $supplierNum=(new \app\common\model\supplier\User)->getSubordinateNum([$userId]);             $user=(new \app\common\model\user\User)->where(['user_id'=>$userId,'is_delete'=>0])->find();             if ($vipNum >= $config['totalvip_down'] && $supplierNum >= $config['totalsh_down']&&$user['purchase_count']>=$config['purchase_count']) {                 $BecomeTeam = true;             }         }         // 新增队长用户         if ($BecomeTeam) {             User::add($userId, [                 'referee_id' => $agent['referee_id'], //推荐人id                 'app_id' => $appId,             ]);         }         return true;     }     /**      * 审核状态      * @param $value      * @return array      */     public function getApplyStatusAttr($value)     {         $method = [10 => '待审核', 20 => '审核通过', '30' => '驳回'];         return ['text' => $method[$value], 'value' => $value];     }     /**      * 审核方式      * @param $value      * @return array      */     public function getApplyTypeAttr($value)     {         $method = [10 => '后台审核', 20 => '无需审核'];         return ['text' => $method[$value], 'value' => $value];     } }
<?php namespace app\common\model\plus\team; use app\common\model\BaseModel; use app\common\model\plus\agent\User as AgentUserModel; /**  * 队长申请模型  */ class Apply extends BaseModel {     protected $name = 'team_apply';     protected $pk = 'apply_id';     /**      * 申请状态      * @var array      */     public $applyStatus = [         10 => '待审核',         20 => '审核通过',         30 => '驳回',     ];     /**      * 申请时间      * @param $value      * @return false|string      */     public function getApplyTimeAttr($value)     {         return date('Y-m-d H:i:s', $value);     }     /**      * 审核时间      * @param $value      * @return false|int|string      */     public function getAuditTimeAttr($value)     {         return $value > 0 ? date('Y-m-d H:i:s', $value) : 0;     }     /**      * 关联推荐人表      * @return \think\model\relation\BelongsTo      */     public function referee()     {         return $this->belongsTo('app\common\model\user\User', 'referee_id')             ->field(['user_id', 'nickName']);     }     /**      * 销商申请记录详情      * @param $where      * @return array|\think\Model|null      * @throws \think\db\exception\DataNotFoundException      * @throws \think\db\exception\DbException      * @throws \think\db\exception\ModelNotFoundException      */     public static function detail($where)     {         $filter = is_array($where) ? $where : ['apply_id' => $where];         return (new static())->where($filter)->find();     }     /**      * 根据分销判断成为队长      * @param $userId      * @param $appId      * @return bool      */     public function becomeTeamByAgent($userId, $become_type, $appId)     {         //log_write($become_type);         // 验证是否设置         $config = Setting::getItem('basic', $appId);         if (empty($config['is_open'])) {             return false;         }         if ($config['become'] != $become_type) {             return false;         }         $agent = AgentUserModel::detail($userId);         if (!$agent) {             return false;         }         $becomeTeam = false;         //分销商总数         if ($become_type == '40') {             $agent_total = $agent['first_num'] + $agent['second_num'] + $agent['third_num'];             if ($agent_total >= $config['totalfxs_down']) {                 $becomeTeam = true;             }         }         //分销佣金总数         if ($become_type == '50') {             $agent_money = $agent['total_money'] + $agent['money'] + $agent['freeze_money'];             if ($agent_money >= $config['total_money']) {                 $becomeTeam = true;             }         }         if($become_type == '70'){             $vipNum=(new \app\common\model\user\User)->getRefereeGradeCount([$userId],$config['referee_grade_ids']);             $supplierNum=(new \app\common\model\supplier\Supplier)->getSubordinateNum([$userId]);             $user=(new \app\common\model\user\User)->where(['user_id'=>$userId,'is_delete'=>0])->find();             if ($vipNum >= $config['totalvip_down'] && $supplierNum >= $config['totalsh_down']&&$user['purchase_count']>=$config['purchase_count']) {                 $becomeTeam = true;             }         }         // 新增队长用户         if ($becomeTeam) {             User::add($userId, [                 'referee_id' => $agent['referee_id'], //推荐人id                 'app_id' => $appId,             ]);         }         return true;     }     /**      * 审核状态      * @param $value      * @return array      */     public function getApplyStatusAttr($value)     {         $method = [10 => '待审核', 20 => '审核通过', '30' => '驳回'];         return ['text' => $method[$value], 'value' => $value];     }     /**      * 审核方式      * @param $value      * @return array      */     public function getApplyTypeAttr($value)     {         $method = [10 => '后台审核', 20 => '无需审核'];         return ['text' => $method[$value], 'value' => $value];     } }
admin/app/common/model/plus/vip/Apply.php
@@ -79,7 +79,16 @@
        }
        // 判断商品是否在设置范围内
        $intersect = array_intersect($productIds, $config['become__buy_product_ids']);
        if (empty($intersect)) {
        $purchase_count=0;
        foreach ($order['product'] as $product) {
            // 检查商品是否是指定的分红商品
            if (in_array($product['product_id'], $config['become__buy_product_ids'])||$product['is_vip']==1) {
                // 获取商品数量
                $quantity = $product['total_num'];
                $purchase_count+=$quantity;
            }
        }
        if ($purchase_count<=0){
            return false;
        }
admin/app/common/model/plus/vip/Order.php
@@ -299,7 +299,7 @@
                                if ($product['is_repurchase']==1){
                                    $viewpoint_money=bcadd($viewpoint_money,($product['is_viewpoint_money']?$product['viewpoint_money']:$vipGrade['viewpoint_money']),2);
                                }
                                if (in_array($product['product_id'], $config['become__buy_product_ids'])) {
                                if (in_array($product['product_id'], $config['become__buy_product_ids'])||$product['is_vip']) {
                                    // 获取商品数量
                                    $quantity = $product['total_num'];
                                    // 为每个商品生成分红订单
admin/app/common/model/supplier/member/Plan.php
@@ -26,7 +26,16 @@
     */
    public function getEnabledPlans()
    {
        return $this->where(['status' => 1, 'is_default' =>0])
        return $this->where(['status' => 1, 'is_default' =>0,'is_delete'=>0])
            ->order(['sort' => 'asc', 'create_time' => 'desc'])
            ->select();
    }
    /**
     * 获取启用的年卡列表(包含默认年卡)
     */
    public function getEnabledPlansAll()
    {
        return $this->where(['status' => 1,'is_delete'=>0])
            ->order(['sort' => 'asc', 'create_time' => 'desc'])
            ->select();
    }
admin/app/common/service/supplier/MemberService.php
@@ -66,7 +66,7 @@
    public function activateMember($orderId)
    {
        // 获取订单信息
        $order = MemberOrderModel::where(['order_id' => $orderId, 'pay_status' => MemberOrderStatusEnum::PENDING])->find();
        $order = MemberOrderModel::where(['order_id' => $orderId, 'pay_status' => MemberOrderStatusEnum::SUCCESS])->find();
        if (!$order) {
            return false;
        }
mobile/components/diy/product/product.vue
@@ -37,6 +37,34 @@
                                            <text>{{ product.line_price }}</text>
                                        </view>
                                    </view>
                            <!-- 购物车操作组件 -->
                            <view class="cart-action">
                                <!-- 多规格商品显示选择规格按钮 -->
                                <view class="spec-select-btn" v-if="item.spec_type === 20"
                                    @click.stop="showSpecPopup(item,index)">
                                    <text>选择规格</text>
                                    <!-- 购物车数量徽章 -->
                                    <view class="cart-badge" v-if="(item.cart && item.cart.total_num > 0)">
                                        <text class="cart-count">{{ item.cart.total_num || 0 }}</text>
                                    </view>
                                </view>
                                <!-- 单规格商品显示购物车操作 -->
                                <template v-else>
                                    <view class="cart-btn-add" v-if="!item.cart.total_num || item.cart.total_num <= 0"
                                        @click.stop="addToCart(item,index)">
                                        <text class="icon iconfont icon-jia"></text>
                                    </view>
                                    <view class="cart-number-controller" v-else>
                                        <view class="cart-btn-sub" @click.stop="decreaseCart(item,index)">
                                            <text class="icon iconfont icon-jian"></text>
                                        </view>
                                        <view class="cart-number">{{ item.cart.total_num }}</view>
                                        <view class="cart-btn-add" @click.stop="increaseCart(item,index)">
                                            <text class="icon iconfont icon-jia"></text>
                                        </view>
                                    </view>
                                </template>
                            </view>
                                </view>
                            </view>
                        </template>
@@ -285,4 +313,260 @@
    .diy-product .display__slide .column__3 .product-item {
        width: 200rpx;
    }
    //购物车
    .cart-action {
        display: flex;
        justify-content: flex-end;
    }
    .cart-btn-add,
    .cart-btn-sub {
        width: 48rpx;
        height: 48rpx;
        border-radius: 50%;
        background: #ff6b6b;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 24rpx;
    }
    .spec-select-btn {
        padding: 2rpx 4rpx;
        background: #ff6b6b;
        color: white;
        border-radius: 24rpx;
        font-size: 24rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 120rpx;
        height: 48rpx;
        position: relative;
    }
    .cart-btn-sub {
        background: #f0f0f0;
        color: #666;
    }
    .cart-number {
        margin: 0 10rpx;
        font-size: 28rpx;
    }
    .cart-number-controller {
        display: flex;
        align-items: center;
    }
    /* 规格选择弹窗样式 */
    .spec-popup {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        visibility: hidden;
        opacity: 0;
        transition: all 0.3s ease;
    }
    .spec-popup.visible {
        visibility: visible;
        opacity: 1;
    }
    .popup-mask {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
    }
    .popup-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top-left-radius: 20rpx;
        border-top-right-radius: 20rpx;
        padding: 30rpx;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        max-height: 80%;
        overflow-y: auto;
    }
    .spec-popup.visible .popup-content {
        transform: translateY(0);
    }
    .popup-header {
        display: flex;
        position: relative;
        padding-right: 60rpx;
        margin-bottom: 30rpx;
    }
    .popup-header image {
        width: 160rpx;
        height: 160rpx;
        border-radius: 10rpx;
    }
    .popup-header-info {
        margin-left: 20rpx;
        flex: 1;
    }
    .price {
        font-size: 36rpx;
        color: #ff6b6b;
        font-weight: bold;
    }
    .stock {
        font-size: 24rpx;
        color: #999;
        margin-top: 10rpx;
    }
    .selected-spec {
        font-size: 24rpx;
        color: #666;
        margin-top: 10rpx;
    }
    .popup-header-right {
        position: absolute;
        right: 0;
        top: 0;
        display: flex;
        align-items: center;
        gap: 20rpx;
    }
    .cart-badge {
        position: absolute;
        top: -12rpx;
        right: -12rpx;
        background: #ff4757;
        color: white;
        border-radius: 50%;
        min-width: 32rpx;
        height: 32rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20rpx;
        line-height: 1;
        padding: 0 6rpx;
        z-index: 10;
    }
    .cart-count {
        color: white;
        font-size: 20rpx;
        line-height: 1;
    }
    .close-btn {
        width: 50rpx;
        height: 50rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #999;
    }
    .spec-section {
        margin-bottom: 30rpx;
    }
    .spec-group {
        margin-bottom: 30rpx;
    }
    .spec-group-name {
        font-size: 28rpx;
        font-weight: bold;
        margin-bottom: 20rpx;
    }
    .spec-options {
        display: flex;
        flex-wrap: wrap;
    }
    .spec-option {
        padding: 10rpx 20rpx;
        border: 1rpx solid #ddd;
        border-radius: 10rpx;
        margin-right: 20rpx;
        margin-bottom: 20rpx;
        font-size: 26rpx;
    }
    .spec-option.active {
        border-color: #ff6b6b;
        color: #ff6b6b;
    }
    .quantity-section {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 30rpx;
    }
    .quantity-label {
        font-size: 28rpx;
    }
    .quantity-controller {
        display: flex;
        align-items: center;
    }
    .quantity-btn {
        width: 50rpx;
        height: 50rpx;
        border: 1rpx solid #ddd;
        border-radius: 10rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24rpx;
    }
    .quantity-btn.disabled {
        opacity: 0.5;
    }
    .quantity-display {
        margin: 0 20rpx;
        font-size: 28rpx;
        min-width: 60rpx;
        text-align: center;
    }
    .action-buttons {
        text-align: center;
    }
    .add-cart-btn {
        width: 100%;
        height: 80rpx;
        background: linear-gradient(90deg, #ff6b6b, #ff8e8e);
        border-radius: 40rpx;
        color: white;
        font-size: 32rpx;
        border: none;
    }
</style>
mobile/components/diy/product/productCity.vue
@@ -34,8 +34,35 @@
                                            <text>¥</text>
                                            <text>{{ product.line_price }}</text>
                                        </view>
                                    </view><!-- 购物车操作组件 -->
                            <view class="cart-action">
                                <!-- 多规格商品显示选择规格按钮 -->
                                <view class="spec-select-btn" v-if="item.spec_type === 20"
                                    @click.stop="showSpecPopup(item,index)">
                                    <text>选择规格</text>
                                    <!-- 购物车数量徽章 -->
                                    <view class="cart-badge" v-if="(item.cart && item.cart.total_num > 0)">
                                        <text class="cart-count">{{ item.cart.total_num || 0 }}</text>
                                    </view>
                                </view>
                                <!-- 单规格商品显示购物车操作 -->
                                <template v-else>
                                    <view class="cart-btn-add" v-if="!item.cart.total_num || item.cart.total_num <= 0"
                                        @click.stop="addToCart(item,index)">
                                        <text class="icon iconfont icon-jia"></text>
                                    </view>
                                    <view class="cart-number-controller" v-else>
                                        <view class="cart-btn-sub" @click.stop="decreaseCart(item,index)">
                                            <text class="icon iconfont icon-jian"></text>
                                        </view>
                                        <view class="cart-number">{{ item.cart.total_num }}</view>
                                        <view class="cart-btn-add" @click.stop="increaseCart(item,index)">
                                            <text class="icon iconfont icon-jia"></text>
                                        </view>
                                    </view>
                                </template>
                            </view>
                                </view>
                            </view>
                        </template>
mobile/pages/branch/activity/detail/detail.vue
@@ -81,7 +81,7 @@
                                    <image :src="item.avatarUrl" mode="aspectFill"></image>
                                    <text class="text-ellipsis">{{item.real_name}}</text>
                                </view>
                                <view class="more d-c-c d-c" v-if="activityData.total > 6" @click="openUser">
                                <view class="more d-c-c d-c" v-if="activityData.total > 5" @click="openUser">
                                    <view class="d-c-c more-icon">
                                        <text class="iconfont icon-gengduo"></text>
                                    </view>
mobile/pages/branch/activity/detail/popup/user.vue
@@ -6,12 +6,12 @@
                <view class="title ww100 tc f28">报名人员名单</view>
                <view class="iconfont icon-guanbi" @click="closePopup(null)"></view>
            </view>
            <scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" :show-scrollbar="false" @scroll="handleScroll" lower-threshold="50" @scrolltolower="scrolltolowerFunc">
            <scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" :show-scrollbar="false" lower-threshold="50" @scrolltolower="scrolltolowerFunc">
                <!-- 图片 -->
                <view class="user-box d-s-s f-w">
                    <view class="user-item tc" v-for="(item, index) in listData" :key="index" @click="previewImage(index)">
                        <image class="image" :src="item.avatarUrl" mode="aspectFill" lazy-load></image>
                        <text class="f28">{{item.real_name}}</text>
                        <text class="f28" style="width: 115rpx;">{{item.real_name}}</text>
                    </view>
                </view>
                <!-- 没有记录 -->
@@ -46,7 +46,7 @@
                /*当前页面*/
                page: 1,
                /*每页条数*/
                list_rows: 10,
                list_rows: 35,
                /*有没有更多*/
                no_more: false,
                /*是否正在加载*/
mobile/pages/branch/admin/activity/user.vue
@@ -31,8 +31,9 @@
                        </view>
                        <view class="flex-1 ml20 f24">
                            <view class="d-b-c mb16 f28 gray3">{{ item.nickName }}</view>
                            <view class="d-b-c mb16 f28 gray3">{{ item.real_name }}</view>
                            <view class="d-b-c mb16 f28 gray3">{{ item.mobile }}</view>
                            <view class="d-b-c mb16 f28 gray3">姓名:{{ item.real_name }}</view>
                            <view class="d-b-c mb16 f28 gray3">手机号:{{ item.mobile }}</view>
                            <view class="d-b-c mb16 f28 gray3">邀请人:{{ item.recommend_name }}</view>
                            <view class="gray9">报名时间:{{ item.create_time }}</view>
                        </view>
                        <view class="f26">
mobile/pages/product/category.vue
@@ -1,5 +1,5 @@
<template>
    <view class="category-wrap"  :data-theme='theme()' :class="theme() || ''">
    <view class="category-wrap" :data-theme='theme()' :class="theme() || ''">
        <!-- #ifdef APP-PLUS -->
        <header-bar></header-bar>
        <!-- #endif -->
@@ -45,7 +45,7 @@
                    </view>
                </scroll-view>
            </view>
            <!--一级分类 列表-->
            <view class="cotegory-type cotegory-type-3" v-if="show_type==40">
                <view class="category-tab">
@@ -57,10 +57,12 @@
                    </scroll-view>
                </view>
                <view class="category-content pr">
                    <scroll-view scroll-y="true"  @scrolltolower="scrolltolowerList" class="scroll-Y scroll-3" :style="'height:'+scrollviewHigh+'px;'">
                    <scroll-view scroll-y="true" @scrolltolower="scrolltolowerList" class="scroll-Y scroll-3"
                        :style="'height:'+scrollviewHigh+'px;'">
                        <view class="shop_body">
                            <view class="shop_body_l_item" :class="index==productData.length-1?'noborder':''" v-for="(item,index) in productData"
                             :key="index" @click="gotoList2(item.product_id)" v-if="index_open_city==0 || (index_open_city==1 && isInArray2(city_supplier_ids,item.shop_supplier_id))">
                            <view class="shop_body_l_item" :class="index==productData.length-1?'noborder':''"
                                v-for="(item,index) in productData" :key="index" @click="gotoList2(item.product_id)"
                                v-if="index_open_city==0 || (index_open_city==1 && isInArray2(city_supplier_ids,item.shop_supplier_id))">
                                <view>
                                    <image :src="item.product_image" mode=""></image>
                                </view>
@@ -68,12 +70,14 @@
                                    <view class="shop_body_l_item_info_title gray3 f32">{{item.product_name}}</view>
                                    <view class="d-b-c pb10">
                                        <view class="shop_body_l_item_info_price">
                                            <view class="f24 shop_red">¥<text class="f32 fb">{{item.product_price}}</text></view>
                                            <view class="f24 shop_red">¥<text
                                                    class="f32 fb">{{item.product_price}}</text></view>
                                        </view>
                                        <!-- 购物车操作组件 -->
                                        <view class="cart-action">
                                            <!-- 多规格商品显示选择规格按钮 -->
                                            <view class="spec-select-btn" v-if="item.spec_type === 20" @click.stop="showSpecPopup(item,index)">
                                            <view class="spec-select-btn" v-if="item.spec_type === 20"
                                                @click.stop="showSpecPopup(item,index)">
                                                <text>选择规格</text>
                                                <!-- 购物车数量徽章 -->
                                                <view class="cart-badge" v-if="(item.cart && item.cart.total_num > 0)">
@@ -82,7 +86,9 @@
                                            </view>
                                            <!-- 单规格商品显示购物车操作 -->
                                            <template v-else>
                                                <view class="cart-btn-add" v-if="!item.cart.total_num || item.cart.total_num <= 0" @click.stop="addToCart(item,index)">
                                                <view class="cart-btn-add"
                                                    v-if="!item.cart.total_num || item.cart.total_num <= 0"
                                                    @click.stop="addToCart(item,index)">
                                                    <text class="icon iconfont icon-jia"></text>
                                                </view>
                                                <view class="cart-number-controller" v-else>
@@ -100,7 +106,7 @@
                                            <view class="shop_body_l_item_info_others_sales">累计成交:{{item.product_sales}}笔</view>
                                        </view> -->
                                    </view>
                                </view>
                            </view>
                        </view>
@@ -109,6 +115,7 @@
                            <text class="iconfont icon-wushuju"></text>
                            <text class="cont">亲,暂无相关记录哦</text>
                        </view>
                        <uni-load-more v-else :loadingType="loadingType"></uni-load-more>
                    </scroll-view>
                </view>
            </view>
@@ -140,7 +147,7 @@
        </view>
        <tabBar></tabBar>
        <request-loading :loadding='isloadding'></request-loading>
        <!-- 规格选择弹窗 -->
        <view class="spec-popup" :class="specPopupVisible ? 'visible' : ''" @touchmove.stop.prevent="">
            <view class="popup-mask" @click="closeSpecPopup"></view>
@@ -158,24 +165,22 @@
                        </view>
                    </view>
                </view>
                <view class="spec-section" v-if="selectedProduct.spec_type === 20 && selectedProduct.specData">
                    <view class="spec-group" v-for="(specGroup, groupIndex) in selectedProduct.specData.spec_attr" :key="groupIndex">
                    <view class="spec-group" v-for="(specGroup, groupIndex) in selectedProduct.specData.spec_attr"
                        :key="groupIndex">
                        <view class="spec-group-name">{{ specGroup.group_name }}</view>
                        <view class="spec-options">
                            <view
                                class="spec-option"
                            <view class="spec-option"
                                :class="{ active: selectedSpecs[groupIndex] === specItem.item_id }"
                                v-for="(specItem, itemIndex) in specGroup.spec_items"
                                :key="itemIndex"
                                @click="selectSpec(groupIndex, specItem.item_id)"
                            >
                                v-for="(specItem, itemIndex) in specGroup.spec_items" :key="itemIndex"
                                @click="selectSpec(groupIndex, specItem.item_id)">
                                {{ specItem.spec_value }}
                            </view>
                        </view>
                    </view>
                </view>
                <view class="quantity-section">
                    <view class="quantity-label">数量</view>
                    <view class="quantity-controller">
@@ -183,12 +188,13 @@
                            <text class="icon iconfont icon-jian"></text>
                        </view>
                        <view class="quantity-display">{{ quantity }}</view>
                        <view class="quantity-btn" :class="{ disabled: quantity >= currentStock }" @click="increaseQuantity">
                        <view class="quantity-btn" :class="{ disabled: quantity >= currentStock }"
                            @click="increaseQuantity">
                            <text class="icon iconfont icon-jia"></text>
                        </view>
                    </view>
                </view>
                <view class="action-buttons">
                    <button class="add-cart-btn" @click="confirmAddToCart">加入购物车</button>
                </view>
@@ -198,8 +204,11 @@
</template>
<script>
    import uniLoadMore from "@/components/uni-load-more.vue";
    export default {
        components: {},
        components: {
            uniLoadMore
        },
        data() {
            return {
                isloadding: true,
@@ -216,52 +225,64 @@
                childlist: [],
                /*当前选中的分类*/
                select_index: 0,
                productData:[],
                catename:'',
                productData: [],
                catename: '',
                /*底部加载*/
                loading: true,
                index_open_city:0,
                city_supplier_ids:[],
                /*没有更多*/
                no_more: false,
                index_open_city: 0,
                city_supplier_ids: [],
                // 购物车相关数据
                cartData: {}, // 存储各商品在购物车中的数量
                // 规格弹窗相关数据
                specPopupVisible: false,
                selectedProduct: null,
                selectedSpecs: [],
                quantity: 1,
                page:1,
                last_page:1,
                page: 1,
                last_page: 1,
                category_id: 0,
                params: {
                    page: 1,
                    category_id: 0,
                    search: '',
                    sortType: '',
                    sortPrice: 0,
                    list_rows: 10,
                },
            };
        },
        computed: {
            selectedSpecText() {
                if (!this.selectedProduct || !this.selectedProduct.specData) return '请选择规格';
                const selectedNames = this.selectedSpecs
                    .map((specId, index) => {
                        const specGroup = this.selectedProduct.specData.spec_attr[index];
                        if (!specGroup) return '';
                        const selectedItem = specGroup.spec_items.find(item => item.item_id === specId);
                        return selectedItem ? selectedItem.spec_value : '';
                    })
                    .filter(name => name !== '');
                return selectedNames.length > 0 ? `已选: "${selectedNames.join(' ')}"` : '请选择规格';
            },
            // 根据选中的规格获取当前SKU
            currentSku() {
                if (!this.selectedProduct || !this.selectedProduct.sku || this.selectedSpecs.includes(null) || this.selectedSpecs.includes(undefined)) {
                if (!this.selectedProduct || !this.selectedProduct.sku || this.selectedSpecs.includes(null) || this
                    .selectedSpecs.includes(undefined)) {
                    return null;
                }
                const specSkuId = this.selectedSpecs.join('_');
                return this.selectedProduct.sku.find(sku => sku.spec_sku_id === specSkuId);
            },
            // 获取当前选中规格的价格
            currentPrice() {
                if (this.currentSku) {
@@ -269,7 +290,7 @@
                }
                return this.selectedProduct ? this.selectedProduct.product_price : '0.00';
            },
            // 获取当前选中规格的库存
            currentStock() {
                if (this.currentSku) {
@@ -277,14 +298,24 @@
                }
                return this.selectedProduct ? this.selectedProduct.product_stock : 0;
            },
            /*加载中状态*/
            loadingType() {
                if (this.isloadding) {
                    return 1;
                } else {
                    if (this.listData.length != 0 && this.no_more) {
                        return 2;
                    } else {
                        return 0;
                    }
                }
            }
        },
        mounted() {
            this.init();
            this.getData();
        },
        onShow(){
        onShow() {
            this.getData();
            this.getTabBarLinks();
        },
@@ -304,14 +335,14 @@
                    }
                });
            },
            isInArray2(arr,value){
                value=parseInt(value);
                var index = arr.indexOf(value);
                if(index >= 0){
                    return true;
                }
                return false;
            isInArray2(arr, value) {
                value = parseInt(value);
                var index = arr.indexOf(value);
                if (index >= 0) {
                    return true;
                }
                return false;
            },
            /*判断是否有图片*/
@@ -329,26 +360,32 @@
                _this.select_index = 0;
                var city_supplier_ids = '';
                if(uni.getStorageSync('citySupplierRes')){
                    let resData=uni.getStorageSync('citySupplierRes');
                    _this.city_supplier_ids=resData.supplier_ids;
                if (uni.getStorageSync('citySupplierRes')) {
                    let resData = uni.getStorageSync('citySupplierRes');
                    _this.city_supplier_ids = resData.supplier_ids;
                    city_supplier_ids = _this.city_supplier_ids.join(",")
                }
                _this.isloadding = true;
                _this._get('product.category/index', {city_supplier_ids:city_supplier_ids}, function(res) {
                _this._get('product.category/index', {
                    city_supplier_ids: city_supplier_ids
                }, function(res) {
                    _this.listData = res.data.list;
                    _this.show_type = res.data.template.category_style;
                    if(_this.listData.length>0){
                    if (_this.listData.length > 0) {
                        if (_this.listData[0].child) {
                            _this.childlist = _this.listData[0].child;
                        }
                        _this.category_id = _this.listData[0]['category_id'];
                    }
                    _this.catename = _this.listData[0].name;
                    _this.background = res.data.background;
                    _this.productData=res.data.productList.data;
                    _this.index_open_city=res.data.store.index_open_city;
                    _this.productData = res.data.productList.data;
                    _this.index_open_city = res.data.store.index_open_city;
                    _this.isloadding = false;
                    _this.last_page = res.data.productList.last_page;
                    if (_this.last_page <= 1) {
                        _this.no_more = true;
                    }
                });
            },
@@ -361,21 +398,23 @@
            },
            /*获取商品数据*/
            getProductData(e) {
                if(this.select_index!=e){
                    this.page=1
                if (this.select_index != e) {
                    this.page = 1
                }
                this.select_index = e;
                this.productData=[];
                this.productData = [];
                let self = this;
                var city_supplier_ids = '';
                if(uni.getStorageSync('citySupplierRes')){
                    let resData=uni.getStorageSync('citySupplierRes');
                    self.city_supplier_ids=resData.supplier_ids;
                if (uni.getStorageSync('citySupplierRes')) {
                    let resData = uni.getStorageSync('citySupplierRes');
                    self.city_supplier_ids = resData.supplier_ids;
                    city_supplier_ids = self.city_supplier_ids.join(",")
                }
                let page = self.page;;
                let list_rows = 10;
                let category_id =this.listData[e].category_id;
                let category_id = this.listData[e].category_id;
                this.category_id = category_id
                this.no_more = false;
                let search = '';
                let sortType = '';
                let sortPrice = 0;
@@ -387,12 +426,15 @@
                    sortType: sortType,
                    sortPrice: sortPrice,
                    list_rows: list_rows,
                    city_supplier_ids:city_supplier_ids
                    city_supplier_ids: city_supplier_ids
                }, function(res) {
                    self.isloadding = false;
                    self.productData = res.data.list.data;
                    self.last_page = res.data.list.last_page;
                    self.index_open_city=res.data.store.index_open_city;
                    self.index_open_city = res.data.store.index_open_city;
                    if (self.last_page <= 1) {
                        self.no_more = true;
                    }
                });
            },
            /*跳转产品列表*/
@@ -410,20 +452,24 @@
                    '&search=' + search +
                    '&sortPrice=' + sortPrice);
            },
            scrolltolowerList(){
                var self=this;
                if(self.page<self.last_page){
            scrolltolowerList() {
                var self = this;
                if (self.page < self.last_page) {
                    self.page++
                    self.isloadding = true;
                    var params=self.params;
                    params.category_id =self.category_id;
                    params.page =self.page;
                    var params = self.params;
                    params.category_id = self.category_id;
                    params.page = self.page;
                    self._get('product.product/lists', params, function(res) {
                        self.isloadding = false;
                        self.productData = self.productData.concat(res.data.list.data);
                        if (self.page >= self.last_page) {
                            self.no_more = true;
                            return;
                        }
                    });
                }
            },
            wxGetUserInfo: function(res) {
@@ -435,7 +481,7 @@
                    return false;
                }
            },
            /*跳转搜索页面*/
            gotoSearch() {
                this.gotoPage('/pages/product/search/search');
@@ -450,35 +496,35 @@
                    path: '/pages/product/category?' + self.getShareUrlParams()
                };
            },
            // 添加到购物车或显示规格选择
            addToCartOrShowSpec(product,index) {
            addToCartOrShowSpec(product, index) {
                if (product.spec_type === 20) {
                    // 多规格商品,显示规格选择弹窗
                    this.showSpecPopup(product);
                } else {
                    // 单规格商品,直接添加到购物车
                    this.directlyAddToCart(product,index);
                    this.directlyAddToCart(product, index);
                }
            },
            // 添加到购物车(单规格商品)
            addToCart(product,index) {
                this.directlyAddToCart(product,index);
            addToCart(product, index) {
                this.directlyAddToCart(product, index);
            },
            // 直接添加到购物车(单规格商品)
            directlyAddToCart(product,index) {
            directlyAddToCart(product, index) {
                this._post('order.cart/add', {
                    product_id: product.product_id,
                    total_num: 1,
                    spec_sku_id: 0
                }, (res) => {
                    if (res.code === 1) {
                        if(!product.cart){
                            product.cart={
                                total_num:0
                        if (!product.cart) {
                            product.cart = {
                                total_num: 0
                            }
                        }
                        // 更新商品的购物车数量
@@ -492,12 +538,12 @@
                    }
                });
            },
            // 显示规格选择弹窗
            showSpecPopup(product) {
                this.selectedProduct = product;
                this.quantity = 1;
                let url=''
                let url = ''
                //#ifdef H5
                if (this.isWeixin()) {
                    url = window.location.href;
@@ -506,35 +552,36 @@
                // 获取商品规格数据
                this._get('product.product/detail', {
                    product_id: product.product_id,
                    url:url,
                    url: url,
                    visitcode: this.getVisitcode()
                }, (res) => {
                    if (res.code === 1) {
                    // 使用正确的路径获取规格数据
                    let specData = res.data.detail.product_multi_spec || res.data.detail;
                    this.$set(this.selectedProduct, 'specData', specData);
                    // 同时设置SKU数据
                    if (res.data.detail.sku) {
                        this.$set(this.selectedProduct, 'sku', res.data.detail.sku);
                    }
                    console.log(this.selectedSpecs);
                        // 使用正确的路径获取规格数据
                        let specData = res.data.detail.product_multi_spec || res.data.detail;
                        this.$set(this.selectedProduct, 'specData', specData);
                        // 同时设置SKU数据
                        if (res.data.detail.sku) {
                            this.$set(this.selectedProduct, 'sku', res.data.detail.sku);
                        }
                        console.log(this.selectedSpecs);
                        // 初始化选中规格数组
                    if (specData && specData.spec_attr) {
                        this.selectedSpecs = specData.spec_attr.map(specGroup => {
                            return specGroup.spec_items && specGroup.spec_items.length > 0 ? specGroup.spec_items[0].item_id : null;
                        });
                        this.specPopupVisible = true;
                    } else {
                        uni.showToast({
                            title: '获取商品规格失败',
                            icon: 'none'
                        });
                        return;
                    }
                        if (specData && specData.spec_attr) {
                            this.selectedSpecs = specData.spec_attr.map(specGroup => {
                                return specGroup.spec_items && specGroup.spec_items.length > 0 ? specGroup
                                    .spec_items[0].item_id : null;
                            });
                            this.specPopupVisible = true;
                        } else {
                            uni.showToast({
                                title: '获取商品规格失败',
                                icon: 'none'
                            });
                            return;
                        }
                    } else {
                        uni.showToast({
                            title: '获取商品规格失败',
@@ -543,34 +590,34 @@
                    }
                });
            },
            // 关闭规格选择弹窗
            closeSpecPopup() {
                this.specPopupVisible = false;
                this.selectedProduct = null;
                this.selectedSpecs = [];
            },
            // 选择规格
            selectSpec(groupIndex, itemId) {
                // 使用 Vue.set 确保响应式更新
                this.$set(this.selectedSpecs, groupIndex, itemId);
            },
            // 增加数量
            increaseQuantity() {
                if (this.quantity < this.currentStock) {
                    this.quantity++;
                }
            },
            // 减少数量
            decreaseQuantity() {
                if (this.quantity > 1) {
                    this.quantity--;
                }
            },
            // 确认添加到购物车
            confirmAddToCart() {
                // 检查是否选择了所有规格
@@ -581,30 +628,31 @@
                    });
                    return;
                }
                // 构造规格SKU ID
                const specSkuId = this.selectedSpecs.join('_');
                this._post('order.cart/add', {
                    product_id: this.selectedProduct.product_id,
                    total_num: this.quantity,
                    spec_sku_id: specSkuId?specSkuId:0
                    spec_sku_id: specSkuId ? specSkuId : 0
                }, (res) => {
                    if (res.code === 1) {
                        // 更新商品的购物车数量
                        const product = this.productData.find(p => p.product_id === this.selectedProduct.product_id);
                        const product = this.productData.find(p => p.product_id === this.selectedProduct
                            .product_id);
                        if (product) {
                            if(!product.cart){
                                product.cart={
                                    total_num:0
                            if (!product.cart) {
                                product.cart = {
                                    total_num: 0
                                }
                            }
                            product.cart.total_num++;
                        }
                        // 关闭弹窗
                        this.closeSpecPopup();
                        uni.showToast({
                            title: '已添加到购物车',
                            icon: 'success'
@@ -617,9 +665,9 @@
                    }
                });
            },
            // 增加购物车商品数量
            increaseCart(product,index) {
            increaseCart(product, index) {
                this._post('order.cart/add', {
                    product_id: product.product_id,
                    total_num: 1,
@@ -636,18 +684,18 @@
                    }
                });
            },
            // 减少购物车商品数量
            decreaseCart(product,index) {
            decreaseCart(product, index) {
                if (product.cart.total_num <= 1) {
                    // 如果数量为1,执行删除操作
                    this._post('order.cart/delete', {
                        product_id: product.product_id,
                        cart_id: product.cart.cart_id,
                        spec_sku_id:product.product_sku.spec_sku_id
                        spec_sku_id: product.product_sku.spec_sku_id
                    }, (res) => {
                        if (res.code === 1) {
                            this.productData[index].cart.total_num=0;
                            this.productData[index].cart.total_num = 0;
                        } else {
                            uni.showToast({
                                title: res.msg,
@@ -659,7 +707,7 @@
                    // 否则减少数量
                    this._post('order.cart/sub', {
                        product_id: product.product_id,
                        spec_sku_id:product.product_sku.spec_sku_id
                        spec_sku_id: product.product_sku.spec_sku_id
                    }, (res) => {
                        if (res.code === 1) {
                            product.cart.total_num--;
@@ -822,18 +870,20 @@
        background: #ffffff;
        border-radius: 12px;
    }
    .catename{
    .catename {
        padding-top: 10rpx;
        line-height: 60rpx;
        border-bottom: 1rpx solid #D9D9D9;
    }
    .shop_body {
        width: 100%;
        background-color: #ffffff;
        padding: 0rpx 20rpx;
        box-sizing: border-box;
    }
    .shop_body_l_item {
        // width: 90%;
        // height: 250rpx;
@@ -845,16 +895,16 @@
        padding: 40rpx 0;
        box-sizing: border-box;
        border-bottom: 1rpx solid #D9D9D9;
    }
    .shop_body_l_item image {
        width: 150rpx;
        height: 150rpx;
        border-radius: 12rpx;
        background-color: rgba(0, 0, 0, 0.1);
    }
    .shop_body_l_item_info {
        // width: 70%;
        // height: 100%;
@@ -866,7 +916,7 @@
        box-sizing: border-box;
        position: relative;
    }
    .shop_body_l_item_info_title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
@@ -877,23 +927,23 @@
        word-break: break-all;
        overflow: hidden;
    }
    .shop_body_l_item_info_price {
        display: flex;
        align-items: flex-end;
    }
    .shop_body_l_item_info_price view {
        margin-right: 15rpx;
    }
    .shop_body_l_item_info_others {
        // width: 100%;
        height: 30rpx;
        display: flex;
        justify-content: space-between;
    }
    .shop_body_l_item_info_others_activity {
        width: 150rpx;
        height: 30rpx;
@@ -905,11 +955,11 @@
        text-align: center;
        box-sizing: border-box;
    }
    .shop_body_l_item_info_others_sales {
        color: #333333;
    }
    .shop_body2 {
        width: 100%;
        display: flex;
@@ -917,7 +967,7 @@
        flex-wrap: wrap;
        background-color: #f2f2f2;
    }
    .shop_body_t_item {
        width: 345rpx;
        // margin: 0 2.5%;
@@ -927,17 +977,17 @@
        background-color: white;
        border-radius: 12rpx;
    }
    .collect text {
        color: #FFFFFF;
    }
    .shop_body_t_item image {
        width: 100%;
        height: 337.5rpx;
        background-color: rgba(0, 0, 0, 0.1);
    }
    .shop_body_t_item_info {
        // height: 182.5rpx;
        display: flex;
@@ -946,7 +996,7 @@
        padding: 20rpx;
        box-sizing: border-box;
    }
    .shop_body_t_item_info_title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
@@ -958,55 +1008,56 @@
        overflow: hidden;
        margin-bottom: 30rpx;
    }
    .shop_body_t_item_info_price {
        display: flex;
        align-items: flex-end;
    }
    .shop_body_t_item_info_others {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8rpx;
    }
    .shop_body_t_item_info_others_activity {}
    .shop_body_t_item_info_others_sales {
        color: #999999;
    }
    .huaxianjia {
        text-decoration: line-through;
        color: #999;
        margin-left: 5rpx;
    }
    .shop_red {
        color: #F6220C;
    }
    .inner-tab .item .icon-sanjiao2 {
        font-size: 13rpx;
    }
    .inner-tab .item .icon-sanjiao1 {
        font-size: 13rpx;
    }
    .noborder {
        border: none;
    }
    /* 购物车操作样式 */
    .cart-action {
        /* position: absolute;
        right: 0;
        bottom: 0; */
    }
    .cart-btn-add, .cart-btn-sub {
    .cart-btn-add,
    .cart-btn-sub {
        width: 48rpx;
        height: 48rpx;
        border-radius: 50%;
@@ -1017,7 +1068,7 @@
        color: white;
        font-size: 24rpx;
    }
    .spec-select-btn {
        padding: 2rpx 4rpx;
        background: #ff6b6b;
@@ -1031,22 +1082,22 @@
        height: 48rpx;
        position: relative;
    }
    .cart-btn-sub {
        background: #f0f0f0;
        color: #666;
    }
    .cart-number {
        margin: 0 10rpx;
        font-size: 28rpx;
    }
    .cart-number-controller {
        display: flex;
        align-items: center;
    }
    /* 规格选择弹窗样式 */
    .spec-popup {
        position: fixed;
@@ -1059,12 +1110,12 @@
        opacity: 0;
        transition: all 0.3s ease;
    }
    .spec-popup.visible {
        visibility: visible;
        opacity: 1;
    }
    .popup-mask {
        position: absolute;
        top: 0;
@@ -1073,7 +1124,7 @@
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
    }
    .popup-content {
        position: absolute;
        bottom: 0;
@@ -1088,47 +1139,47 @@
        max-height: 80%;
        overflow-y: auto;
    }
    .spec-popup.visible .popup-content {
        transform: translateY(0);
    }
    .popup-header {
        display: flex;
        position: relative;
        padding-right: 60rpx;
        margin-bottom: 30rpx;
    }
    .popup-header image {
        width: 160rpx;
        height: 160rpx;
        border-radius: 10rpx;
    }
    .popup-header-info {
        margin-left: 20rpx;
        flex: 1;
    }
    .price {
        font-size: 36rpx;
        color: #ff6b6b;
        font-weight: bold;
    }
    .stock {
        font-size: 24rpx;
        color: #999;
        margin-top: 10rpx;
    }
    .selected-spec {
        font-size: 24rpx;
        color: #666;
        margin-top: 10rpx;
    }
    .popup-header-right {
        position: absolute;
        right: 0;
@@ -1137,7 +1188,7 @@
        align-items: center;
        gap: 20rpx;
    }
    .cart-badge {
        position: absolute;
        top: -12rpx;
@@ -1155,13 +1206,13 @@
        padding: 0 6rpx;
        z-index: 10;
    }
    .cart-count {
        color: white;
        font-size: 20rpx;
        line-height: 1;
    }
    .close-btn {
        width: 50rpx;
        height: 50rpx;
@@ -1170,26 +1221,26 @@
        justify-content: center;
        color: #999;
    }
    .spec-section {
        margin-bottom: 30rpx;
    }
    .spec-group {
        margin-bottom: 30rpx;
    }
    .spec-group-name {
        font-size: 28rpx;
        font-weight: bold;
        margin-bottom: 20rpx;
    }
    .spec-options {
        display: flex;
        flex-wrap: wrap;
    }
    .spec-option {
        padding: 10rpx 20rpx;
        border: 1rpx solid #ddd;
@@ -1198,28 +1249,28 @@
        margin-bottom: 20rpx;
        font-size: 26rpx;
    }
    .spec-option.active {
        border-color: #ff6b6b;
        color: #ff6b6b;
    }
    .quantity-section {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 30rpx;
    }
    .quantity-label {
        font-size: 28rpx;
    }
    .quantity-controller {
        display: flex;
        align-items: center;
    }
    .quantity-btn {
        width: 50rpx;
        height: 50rpx;
@@ -1230,22 +1281,22 @@
        justify-content: center;
        font-size: 24rpx;
    }
    .quantity-btn.disabled {
        opacity: 0.5;
    }
    .quantity-display {
        margin: 0 20rpx;
        font-size: 28rpx;
        min-width: 60rpx;
        text-align: center;
    }
    .action-buttons {
        text-align: center;
    }
    .add-cart-btn {
        width: 100%;
        height: 80rpx;
mobile/pages/product/list/list.vue
@@ -4,8 +4,9 @@
            <view class="index-search-box index-search-box_re d-b-c" id="searchBox">
                <view class="index-search index-search_re t-c flex-1">
                    <span class="icon iconfont icon-sousuo"></span>
                    <input type="text" v-model="search" class="flex-1 ml10 f26 gray3" value="" placeholder-class="f26 gray9"
                     placeholder="搜索商品" confirm-type="search" @confirm="searchFunc()" />
                    <input type="text" v-model="search" class="flex-1 ml10 f26 gray3" value=""
                        placeholder-class="f26 gray9" placeholder="搜索商品" confirm-type="search"
                        @confirm="searchFunc()" />
                </view>
            </view>
            <view class="inner-tab">
@@ -36,14 +37,15 @@
            </view>
        </view>
        <view class="prodcut-list-wrap">
            <scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50"
             @scrolltolower="scrolltolowerFunc">
            <scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'"
                lower-threshold="50" @scrolltolower="scrolltolowerFunc">
                <view :class="topRefresh?'top-refresh open':'top-refresh'">
                    <view class="circle" v-for="(circle,n) in 3" :key="n"></view>
                </view>
                <view class="shop_body" v-if="isLieBiao ==true">
                    <view class="shop_body_l_item" :class="index==listData.length-1?'noborder':''" v-for="(item,index) in listData"
                     :key="index" @click="gotoList(item.product_id)" v-if="index_open_city==0 || (index_open_city==1 && isInArray2(city_supplier_ids,item.shop_supplier_id))">
                    <view class="shop_body_l_item" :class="index==listData.length-1?'noborder':''"
                        v-for="(item,index) in listData" :key="index" @click="gotoList(item.product_id)"
                        v-if="index_open_city==0 || (index_open_city==1 && isInArray2(city_supplier_ids,item.shop_supplier_id))">
                        <view>
                            <image :src="item.product_image" mode=""></image>
                        </view>
@@ -51,29 +53,58 @@
                            <view class="shop_body_l_item_info_title gray3 f32">{{item.product_name}}</view>
                            <view class="d-b-c pb10">
                                <view class="shop_body_l_item_info_price">
                                    <view class="f24 shop_red">¥<text class="f32 fb">{{item.product_price}}</text></view>
                                    <view class="f24 shop_red">¥<text class="f32 fb">{{item.product_price}}</text>
                                    </view>
                                </view>
                                <view class="shop_body_l_item_info_others f22">
                                <!-- <view class="shop_body_l_item_info_others f22">
                                    <view class="shop_body_l_item_info_others_sales">累计成交:{{item.product_sales}}笔</view>
                                </view>
                                </view> -->
                            </view>
                        </view>
                    </view>
                </view>
                <view class="shop_body2" v-if="isLieBiao ==false">
                    <view class="shop_body_t_item" :class="index % 2 == 0?'ml20 mr20':' mr20'" v-for="(item,index) in listData" :key="index"
                     @click="gotoList(item.product_id)" v-if="index_open_city==0 || (index_open_city==1 && isInArray2(city_supplier_ids,item.shop_supplier_id))">
                    <view class="shop_body_t_item" :class="index % 2 == 0?'ml20 mr20':' mr20'"
                        v-for="(item,index) in listData" :key="index" @click="gotoList(item.product_id)"
                        v-if="index_open_city==0 || (index_open_city==1 && isInArray2(city_supplier_ids,item.shop_supplier_id))">
                        <image :src="item.product_image" mode=""></image>
                        <view class="shop_body_t_item_info">
                            <view class="shop_body_t_item_info_title f26">{{item.product_name}}</view>
                            <view class="shop_body_t_item_info_others f24 gray9 mt">
                            <!-- <view class="shop_body_t_item_info_others f24 gray9 mt">
                                <view class="shop_body_t_item_info_others_sales">累计成交:{{item.product_sales}}笔</view>
                            </view>
                            </view> -->
                            <view class="shop_body_t_item_info_price">
                                <view class="f20 redF6">¥<text class="f32">{{item.product_price}}</text></view>
                                <view class="f20 huaxianjia">¥<text class="24">{{item.line_price}}</text></view>
                            </view>
                            <!-- 购物车操作组件 -->
                            <view class="cart-action">
                                <!-- 多规格商品显示选择规格按钮 -->
                                <view class="spec-select-btn" v-if="item.spec_type === 20"
                                    @click.stop="showSpecPopup(item,index)">
                                    <text>选择规格</text>
                                    <!-- 购物车数量徽章 -->
                                    <view class="cart-badge" v-if="(item.cart && item.cart.total_num > 0)">
                                        <text class="cart-count">{{ item.cart.total_num || 0 }}</text>
                                    </view>
                                </view>
                                <!-- 单规格商品显示购物车操作 -->
                                <template v-else>
                                    <view class="cart-btn-add" v-if="!item.cart.total_num || item.cart.total_num <= 0"
                                        @click.stop="addToCart(item,index)">
                                        <text class="icon iconfont icon-jia"></text>
                                    </view>
                                    <view class="cart-number-controller" v-else>
                                        <view class="cart-btn-sub" @click.stop="decreaseCart(item,index)">
                                            <text class="icon iconfont icon-jian"></text>
                                        </view>
                                        <view class="cart-number">{{ item.cart.total_num }}</view>
                                        <view class="cart-btn-add" @click.stop="increaseCart(item,index)">
                                            <text class="icon iconfont icon-jia"></text>
                                        </view>
                                    </view>
                                </template>
                            </view>
                        </view>
                    </view>
                </view>
@@ -84,6 +115,57 @@
                </view>
                <uni-load-more v-else :loadingType="loadingType"></uni-load-more>
            </scroll-view>
        </view><!-- 规格选择弹窗 -->
        <view class="spec-popup" :class="specPopupVisible ? 'visible' : ''" @touchmove.stop.prevent="">
            <view class="popup-mask" @click="closeSpecPopup"></view>
            <view class="popup-content" v-if="selectedProduct">
                <view class="popup-header">
                    <image :src="selectedProduct.product_image" mode="aspectFit"></image>
                    <view class="popup-header-info">
                        <view class="price">¥{{ currentPrice }}</view>
                        <view class="stock">库存:{{ currentStock }}</view>
                        <view class="selected-spec">{{ selectedSpecText }}</view>
                    </view>
                    <view class="popup-header-right">
                        <view class="close-btn" @click="closeSpecPopup">
                            <text class="icon iconfont icon-guanbi"></text>
                        </view>
                    </view>
                </view>
                <view class="spec-section" v-if="selectedProduct.spec_type === 20 && selectedProduct.specData">
                    <view class="spec-group" v-for="(specGroup, groupIndex) in selectedProduct.specData.spec_attr"
                        :key="groupIndex">
                        <view class="spec-group-name">{{ specGroup.group_name }}</view>
                        <view class="spec-options">
                            <view class="spec-option"
                                :class="{ active: selectedSpecs[groupIndex] === specItem.item_id }"
                                v-for="(specItem, itemIndex) in specGroup.spec_items" :key="itemIndex"
                                @click="selectSpec(groupIndex, specItem.item_id)">
                                {{ specItem.spec_value }}
                            </view>
                        </view>
                    </view>
                </view>
                <view class="quantity-section">
                    <view class="quantity-label">数量</view>
                    <view class="quantity-controller">
                        <view class="quantity-btn" :class="{ disabled: quantity <= 1 }" @click="decreaseQuantity">
                            <text class="icon iconfont icon-jian"></text>
                        </view>
                        <view class="quantity-display">{{ quantity }}</view>
                        <view class="quantity-btn" :class="{ disabled: quantity >= currentStock }"
                            @click="increaseQuantity">
                            <text class="icon iconfont icon-jia"></text>
                        </view>
                    </view>
                </view>
                <view class="action-buttons">
                    <button class="add-cart-btn" @click="confirmAddToCart">加入购物车</button>
                </view>
            </view>
        </view>
    </view>
</template>
@@ -121,8 +203,19 @@
                sortPrice: 0,
                list_rows: 10,
                last_page: 0,
                index_open_city:0,
                city_supplier_ids:[],
                index_open_city: 0,
                city_supplier_ids: [],
                // 购物车相关数据
                cartData: {}, // 存储各商品在购物车中的数量
                // 规格弹窗相关数据
                specPopupVisible: false,
                selectedProduct: null,
                selectedSpecs: [],
                quantity: 1,
                page: 1,
                last_page: 1,
                category_id: 0,
            };
        },
        computed: {
@@ -185,13 +278,13 @@
                    }
                });
            },
            isInArray2(arr,value){
                value=parseInt(value);
                var index = arr.indexOf(value);
                if(index >= 0){
                    return true;
                }
                return false;
            isInArray2(arr, value) {
                value = parseInt(value);
                var index = arr.indexOf(value);
                if (index >= 0) {
                    return true;
                }
                return false;
            },
            /*还原初始化*/
            restoreData() {
@@ -229,12 +322,12 @@
            getData() {
                let self = this;
                var city_supplier_ids = '';
                if(uni.getStorageSync('citySupplierRes')){
                    let resData=uni.getStorageSync('citySupplierRes');
                    self.city_supplier_ids=resData.supplier_ids;
                if (uni.getStorageSync('citySupplierRes')) {
                    let resData = uni.getStorageSync('citySupplierRes');
                    self.city_supplier_ids = resData.supplier_ids;
                    city_supplier_ids = self.city_supplier_ids.join(",")
                }
                let page = self.page;
                let list_rows = self.list_rows;
                let category_id = self.category_id;
@@ -249,12 +342,12 @@
                    sortType: sortType,
                    sortPrice: sortPrice,
                    list_rows: list_rows,
                    city_supplier_ids:city_supplier_ids
                    city_supplier_ids: city_supplier_ids
                }, function(res) {
                    self.loading = false;
                    self.listData = self.listData.concat(res.data.list.data);
                    self.last_page = res.data.list.last_page;
                    self.index_open_city=res.data.store.index_open_city;
                    self.index_open_city = res.data.store.index_open_city;
                    if (res.data.list.last_page <= 1) {
                        self.no_more = true;
                    }
@@ -298,6 +391,231 @@
                    path: "/pages/product/category?" + this.getShareUrlParams()
                };
            },
            // 添加到购物车或显示规格选择
            addToCartOrShowSpec(product, index) {
                if (product.spec_type === 20) {
                    // 多规格商品,显示规格选择弹窗
                    this.showSpecPopup(product);
                } else {
                    // 单规格商品,直接添加到购物车
                    this.directlyAddToCart(product, index);
                }
            },
            // 添加到购物车(单规格商品)
            addToCart(product, index) {
                this.directlyAddToCart(product, index);
            },
            // 直接添加到购物车(单规格商品)
            directlyAddToCart(product, index) {
                this._post('order.cart/add', {
                    product_id: product.product_id,
                    total_num: 1,
                    spec_sku_id: 0
                }, (res) => {
                    if (res.code === 1) {
                        if (!product.cart) {
                            product.cart = {
                                total_num: 0
                            }
                        }
                        // 更新商品的购物车数量
                        product.cart.total_num++;
                        this.listData[index].cart.total_num = product.cart.total_num;
                    } else {
                        uni.showToast({
                            title: res.msg,
                            icon: 'none'
                        });
                    }
                });
            },
            // 显示规格选择弹窗
            showSpecPopup(product) {
                this.selectedProduct = product;
                this.quantity = 1;
                let url = ''
                //#ifdef H5
                if (this.isWeixin()) {
                    url = window.location.href;
                }
                //#endif
                // 获取商品规格数据
                this._get('product.product/detail', {
                    product_id: product.product_id,
                    url: url,
                    visitcode: this.getVisitcode()
                }, (res) => {
                    if (res.code === 1) {
                        // 使用正确的路径获取规格数据
                        let specData = res.data.detail.product_multi_spec || res.data.detail;
                        this.$set(this.selectedProduct, 'specData', specData);
                        // 同时设置SKU数据
                        if (res.data.detail.sku) {
                            this.$set(this.selectedProduct, 'sku', res.data.detail.sku);
                        }
                        console.log(this.selectedSpecs);
                        // 初始化选中规格数组
                        if (specData && specData.spec_attr) {
                            this.selectedSpecs = specData.spec_attr.map(specGroup => {
                                return specGroup.spec_items && specGroup.spec_items.length > 0 ? specGroup
                                    .spec_items[0].item_id : null;
                            });
                            this.specPopupVisible = true;
                        } else {
                            uni.showToast({
                                title: '获取商品规格失败',
                                icon: 'none'
                            });
                            return;
                        }
                    } else {
                        uni.showToast({
                            title: '获取商品规格失败',
                            icon: 'none'
                        });
                    }
                });
            },
            // 关闭规格选择弹窗
            closeSpecPopup() {
                this.specPopupVisible = false;
                this.selectedProduct = null;
                this.selectedSpecs = [];
            },
            // 选择规格
            selectSpec(groupIndex, itemId) {
                // 使用 Vue.set 确保响应式更新
                this.$set(this.selectedSpecs, groupIndex, itemId);
            },
            // 增加数量
            increaseQuantity() {
                if (this.quantity < this.currentStock) {
                    this.quantity++;
                }
            },
            // 减少数量
            decreaseQuantity() {
                if (this.quantity > 1) {
                    this.quantity--;
                }
            },
            // 确认添加到购物车
            confirmAddToCart() {
                // 检查是否选择了所有规格
                if (this.selectedSpecs.includes(null) || this.selectedSpecs.includes(undefined)) {
                    uni.showToast({
                        title: '请选择完整的商品规格',
                        icon: 'none'
                    });
                    return;
                }
                // 构造规格SKU ID
                const specSkuId = this.selectedSpecs.join('_');
                this._post('order.cart/add', {
                    product_id: this.selectedProduct.product_id,
                    total_num: this.quantity,
                    spec_sku_id: specSkuId ? specSkuId : 0
                }, (res) => {
                    if (res.code === 1) {
                        // 更新商品的购物车数量
                        const product = this.listData.find(p => p.product_id === this.selectedProduct
                            .product_id);
                        if (product) {
                            if (!product.cart) {
                                product.cart = {
                                    total_num: 0
                                }
                            }
                            product.cart.total_num++;
                        }
                        // 关闭弹窗
                        this.closeSpecPopup();
                        uni.showToast({
                            title: '已添加到购物车',
                            icon: 'success'
                        });
                    } else {
                        uni.showToast({
                            title: res.msg,
                            icon: 'none'
                        });
                    }
                });
            },
            // 增加购物车商品数量
            increaseCart(product, index) {
                this._post('order.cart/add', {
                    product_id: product.product_id,
                    total_num: 1,
                    spec_sku_id: 0
                }, (res) => {
                    if (res.code === 1) {
                        product.cart.total_num++;
                        this.listData[index].cart.total_num = product.cart.total_num;
                    } else {
                        uni.showToast({
                            title: res.msg,
                            icon: 'none'
                        });
                    }
                });
            },
            // 减少购物车商品数量
            decreaseCart(product, index) {
                if (product.cart.total_num <= 1) {
                    // 如果数量为1,执行删除操作
                    this._post('order.cart/delete', {
                        product_id: product.product_id,
                        cart_id: product.cart.cart_id,
                        spec_sku_id: product.product_sku.spec_sku_id
                    }, (res) => {
                        if (res.code === 1) {
                            this.listData[index].cart.total_num = 0;
                        } else {
                            uni.showToast({
                                title: res.msg,
                                icon: 'none'
                            });
                        }
                    });
                } else {
                    // 否则减少数量
                    this._post('order.cart/sub', {
                        product_id: product.product_id,
                        spec_sku_id: product.product_sku.spec_sku_id
                    }, (res) => {
                        if (res.code === 1) {
                            product.cart.total_num--;
                            this.listData[index].cart.total_num = product.cart.total_num;
                        } else {
                            uni.showToast({
                                title: res.msg,
                                icon: 'none'
                            });
                        }
                    });
                }
            }
        }
    };
</script>
@@ -602,4 +920,261 @@
    .noborder {
        border: none;
    }
</style>
    //购物车
    .cart-action {
        display: flex;
        justify-content: flex-end;
    }
    .cart-btn-add,
    .cart-btn-sub {
        width: 48rpx;
        height: 48rpx;
        border-radius: 50%;
        background: #ff6b6b;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 24rpx;
    }
    .spec-select-btn {
        padding: 2rpx 4rpx;
        background: #ff6b6b;
        color: white;
        border-radius: 24rpx;
        font-size: 24rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 120rpx;
        height: 48rpx;
        position: relative;
    }
    .cart-btn-sub {
        background: #f0f0f0;
        color: #666;
    }
    .cart-number {
        margin: 0 10rpx;
        font-size: 28rpx;
    }
    .cart-number-controller {
        display: flex;
        align-items: center;
    }
    /* 规格选择弹窗样式 */
    .spec-popup {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        visibility: hidden;
        opacity: 0;
        transition: all 0.3s ease;
    }
    .spec-popup.visible {
        visibility: visible;
        opacity: 1;
    }
    .popup-mask {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
    }
    .popup-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top-left-radius: 20rpx;
        border-top-right-radius: 20rpx;
        padding: 30rpx;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        max-height: 80%;
        overflow-y: auto;
    }
    .spec-popup.visible .popup-content {
        transform: translateY(0);
    }
    .popup-header {
        display: flex;
        position: relative;
        padding-right: 60rpx;
        margin-bottom: 30rpx;
    }
    .popup-header image {
        width: 160rpx;
        height: 160rpx;
        border-radius: 10rpx;
    }
    .popup-header-info {
        margin-left: 20rpx;
        flex: 1;
    }
    .price {
        font-size: 36rpx;
        color: #ff6b6b;
        font-weight: bold;
    }
    .stock {
        font-size: 24rpx;
        color: #999;
        margin-top: 10rpx;
    }
    .selected-spec {
        font-size: 24rpx;
        color: #666;
        margin-top: 10rpx;
    }
    .popup-header-right {
        position: absolute;
        right: 0;
        top: 0;
        display: flex;
        align-items: center;
        gap: 20rpx;
    }
    .cart-badge {
        position: absolute;
        top: -12rpx;
        right: -12rpx;
        background: #ff4757;
        color: white;
        border-radius: 50%;
        min-width: 32rpx;
        height: 32rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20rpx;
        line-height: 1;
        padding: 0 6rpx;
        z-index: 10;
    }
    .cart-count {
        color: white;
        font-size: 20rpx;
        line-height: 1;
    }
    .close-btn {
        width: 50rpx;
        height: 50rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #999;
    }
    .spec-section {
        margin-bottom: 30rpx;
    }
    .spec-group {
        margin-bottom: 30rpx;
    }
    .spec-group-name {
        font-size: 28rpx;
        font-weight: bold;
        margin-bottom: 20rpx;
    }
    .spec-options {
        display: flex;
        flex-wrap: wrap;
    }
    .spec-option {
        padding: 10rpx 20rpx;
        border: 1rpx solid #ddd;
        border-radius: 10rpx;
        margin-right: 20rpx;
        margin-bottom: 20rpx;
        font-size: 26rpx;
    }
    .spec-option.active {
        border-color: #ff6b6b;
        color: #ff6b6b;
    }
    .quantity-section {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 30rpx;
    }
    .quantity-label {
        font-size: 28rpx;
    }
    .quantity-controller {
        display: flex;
        align-items: center;
    }
    .quantity-btn {
        width: 50rpx;
        height: 50rpx;
        border: 1rpx solid #ddd;
        border-radius: 10rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24rpx;
    }
    .quantity-btn.disabled {
        opacity: 0.5;
    }
    .quantity-display {
        margin: 0 20rpx;
        font-size: 28rpx;
        min-width: 60rpx;
        text-align: center;
    }
    .action-buttons {
        text-align: center;
    }
    .add-cart-btn {
        width: 100%;
        height: 80rpx;
        background: linear-gradient(90deg, #ff6b6b, #ff8e8e);
        border-radius: 40rpx;
        color: white;
        font-size: 32rpx;
        border: none;
    }
</style>
mobile/pages/shop/category.vue
@@ -1,5 +1,5 @@
<template>
    <view class="category-wrap"  :data-theme='theme()' :class="theme() || ''">
    <view class="category-wrap" :data-theme='theme()' :class="theme() || ''">
        <!-- #ifdef APP-PLUS -->
        <header-bar></header-bar>
        <!-- #endif -->
@@ -46,7 +46,7 @@
                    </view>
                </scroll-view>
            </view>
            <!--一级分类 列表-->
            <view class="cotegory-type cotegory-type-3" v-if="show_type==40">
                <view class="category-tab">
@@ -60,8 +60,9 @@
                <view class="category-content pr">
                    <scroll-view scroll-y="true" class="scroll-Y scroll-3" :style="'height:'+scrollviewHigh+'px;'">
                        <view class="shop_body">
                            <view class="shop_body_l_item" :class="index==productData.length-1?'noborder':''" v-for="(item,index) in productData"
                             :key="index" @click="gotoList2(item.product_id)" v-if="index_open_city==0 || (index_open_city==1 && isInArray2(city_supplier_ids,item.shop_supplier_id))">
                            <view class="shop_body_l_item" :class="index==productData.length-1?'noborder':''"
                                v-for="(item,index) in productData" :key="index" @click="gotoList2(item.product_id)"
                                v-if="index_open_city==0 || (index_open_city==1 && isInArray2(city_supplier_ids,item.shop_supplier_id))">
                                <view>
                                    <image :src="item.product_image" mode=""></image>
                                </view>
@@ -69,12 +70,14 @@
                                    <view class="shop_body_l_item_info_title gray3 f32">{{item.product_name}}</view>
                                    <view class="d-b-c pb10">
                                        <view class="shop_body_l_item_info_price">
                                            <view class="f24 shop_red">¥<text class="f32 fb">{{item.product_price}}</text></view>
                                            <view class="f24 shop_red">¥<text
                                                    class="f32 fb">{{item.product_price}}</text></view>
                                        </view>
                                        <!-- 购物车操作组件 -->
                                        <view class="cart-action">
                                            <!-- 多规格商品显示选择规格按钮 -->
                                            <view class="spec-select-btn" v-if="item.spec_type === 20" @click.stop="showSpecPopup(item,index)">
                                            <view class="spec-select-btn" v-if="item.spec_type === 20"
                                                @click.stop="showSpecPopup(item,index)">
                                                <text>选择规格</text>
                                                <!-- 购物车数量徽章 -->
                                                <view class="cart-badge" v-if="(item.cart && item.cart.total_num > 0)">
@@ -83,7 +86,9 @@
                                            </view>
                                            <!-- 单规格商品显示购物车操作 -->
                                            <template v-else>
                                                <view class="cart-btn-add" v-if="!item.cart.total_num || item.cart.total_num <= 0" @click.stop="addToCart(item,index)">
                                                <view class="cart-btn-add"
                                                    v-if="!item.cart.total_num || item.cart.total_num <= 0"
                                                    @click.stop="addToCart(item,index)">
                                                    <text class="icon iconfont icon-jia"></text>
                                                </view>
                                                <view class="cart-number-controller" v-else>
@@ -101,7 +106,7 @@
                                            <view class="shop_body_l_item_info_others_sales">累计成交:{{item.product_sales}}笔</view>
                                        </view> -->
                                    </view>
                                </view>
                            </view>
                        </view>
@@ -110,6 +115,7 @@
                            <text class="iconfont icon-wushuju"></text>
                            <text class="cont">亲,暂无相关记录哦</text>
                        </view>
                        <uni-load-more v-else :loadingType="loadingType"></uni-load-more>
                    </scroll-view>
                </view>
            </view>
@@ -141,7 +147,7 @@
        </view>
        <tabBar></tabBar>
        <request-loading :loadding='isloadding'></request-loading>
        <!-- 规格选择弹窗 -->
        <view class="spec-popup" :class="specPopupVisible ? 'visible' : ''" @touchmove.stop.prevent="">
            <view class="popup-mask" @click="closeSpecPopup"></view>
@@ -159,24 +165,22 @@
                        </view>
                    </view>
                </view>
                <view class="spec-section" v-if="selectedProduct.spec_type === 20 && selectedProduct.specData">
                    <view class="spec-group" v-for="(specGroup, groupIndex) in selectedProduct.specData.spec_attr" :key="groupIndex">
                    <view class="spec-group" v-for="(specGroup, groupIndex) in selectedProduct.specData.spec_attr"
                        :key="groupIndex">
                        <view class="spec-group-name">{{ specGroup.group_name }}</view>
                        <view class="spec-options">
                            <view
                                class="spec-option"
                            <view class="spec-option"
                                :class="{ active: selectedSpecs[groupIndex] === specItem.item_id }"
                                v-for="(specItem, itemIndex) in specGroup.spec_items"
                                :key="itemIndex"
                                @click="selectSpec(groupIndex, specItem.item_id)"
                            >
                                v-for="(specItem, itemIndex) in specGroup.spec_items" :key="itemIndex"
                                @click="selectSpec(groupIndex, specItem.item_id)">
                                {{ specItem.spec_value }}
                            </view>
                        </view>
                    </view>
                </view>
                <view class="quantity-section">
                    <view class="quantity-label">数量</view>
                    <view class="quantity-controller">
@@ -184,12 +188,13 @@
                            <text class="icon iconfont icon-jian"></text>
                        </view>
                        <view class="quantity-display">{{ quantity }}</view>
                        <view class="quantity-btn" :class="{ disabled: quantity >= currentStock }" @click="increaseQuantity">
                        <view class="quantity-btn" :class="{ disabled: quantity >= currentStock }"
                            @click="increaseQuantity">
                            <text class="icon iconfont icon-jia"></text>
                        </view>
                    </view>
                </view>
                <view class="action-buttons">
                    <button class="add-cart-btn" @click="confirmAddToCart">加入购物车</button>
                </view>
@@ -199,8 +204,11 @@
</template>
<script>
    import uniLoadMore from "@/components/uni-load-more.vue";
    export default {
        components: {},
        components: {
            uniLoadMore
        },
        data() {
            return {
                isloadding: true,
@@ -217,52 +225,63 @@
                childlist: [],
                /*当前选中的分类*/
                select_index: 0,
                productData:[],
                catename:'',
                productData: [],
                catename: '',
                /*底部加载*/
                loading: true,
                index_open_city:0,
                city_supplier_ids:[],
                index_open_city: 0,
                city_supplier_ids: [],
                // 购物车相关数据
                cartData: {}, // 存储各商品在购物车中的数量
                // 规格弹窗相关数据
                specPopupVisible: false,
                selectedProduct: null,
                selectedSpecs: [],
                page:1,
                last_page:1,
                quantity: 1
                page: 1,
                last_page: 1,
                quantity: 1,
                category_id: 1,
                no_more: 1,
                params: {
                    page: 1,
                    category_id: 0,
                    search: '',
                    sortType: '',
                    sortPrice: 0,
                    list_rows: 10,
                },
            };
        },
        computed: {
            selectedSpecText() {
                if (!this.selectedProduct || !this.selectedProduct.specData) return '请选择规格';
                const selectedNames = this.selectedSpecs
                    .map((specId, index) => {
                        const specGroup = this.selectedProduct.specData.spec_attr[index];
                        if (!specGroup) return '';
                        const selectedItem = specGroup.spec_items.find(item => item.item_id === specId);
                        return selectedItem ? selectedItem.spec_value : '';
                    })
                    .filter(name => name !== '');
                return selectedNames.length > 0 ? `已选: "${selectedNames.join(' ')}"` : '请选择规格';
            },
            // 根据选中的规格获取当前SKU
            currentSku() {
                if (!this.selectedProduct || !this.selectedProduct.sku || this.selectedSpecs.includes(null) || this.selectedSpecs.includes(undefined)) {
                if (!this.selectedProduct || !this.selectedProduct.sku || this.selectedSpecs.includes(null) || this
                    .selectedSpecs.includes(undefined)) {
                    return null;
                }
                const specSkuId = this.selectedSpecs.join('_');
                return this.selectedProduct.sku.find(sku => sku.spec_sku_id === specSkuId);
            },
            // 获取当前选中规格的价格
            currentPrice() {
                if (this.currentSku) {
@@ -270,7 +289,7 @@
                }
                return this.selectedProduct ? this.selectedProduct.product_price : '0.00';
            },
            // 获取当前选中规格的库存
            currentStock() {
                if (this.currentSku) {
@@ -278,14 +297,24 @@
                }
                return this.selectedProduct ? this.selectedProduct.product_stock : 0;
            },
            /*加载中状态*/
            loadingType() {
                if (this.isloadding) {
                    return 1;
                } else {
                    if (this.listData.length != 0 && this.no_more) {
                        return 2;
                    } else {
                        return 0;
                    }
                }
            }
        },
        mounted() {
            this.init();
            this.getData();
        },
        onShow(){
        onShow() {
            this.getData();
            this.getTabBarLinks();
        },
@@ -305,14 +334,14 @@
                    }
                });
            },
            isInArray2(arr,value){
                value=parseInt(value);
                var index = arr.indexOf(value);
                if(index >= 0){
                    return true;
                }
                return false;
            isInArray2(arr, value) {
                value = parseInt(value);
                var index = arr.indexOf(value);
                if (index >= 0) {
                    return true;
                }
                return false;
            },
            /*判断是否有图片*/
@@ -330,26 +359,33 @@
                _this.select_index = 0;
                var city_supplier_ids = '';
                if(uni.getStorageSync('citySupplierRes')){
                    let resData=uni.getStorageSync('citySupplierRes');
                    _this.city_supplier_ids=resData.supplier_ids;
                if (uni.getStorageSync('citySupplierRes')) {
                    let resData = uni.getStorageSync('citySupplierRes');
                    _this.city_supplier_ids = resData.supplier_ids;
                    city_supplier_ids = _this.city_supplier_ids.join(",")
                }
                _this.isloadding = true;
                _this._get('product.category/index', {city_supplier_ids:city_supplier_ids,shop_supplier_id:uni.getStorageSync('shop_supplier_id')}, function(res) {
                _this._get('product.category/index', {
                    city_supplier_ids: city_supplier_ids,
                    shop_supplier_id: uni.getStorageSync('shop_supplier_id')
                }, function(res) {
                    _this.listData = res.data.list;
                    _this.show_type = res.data.template.category_style;
                    if(_this.listData.length>0){
                    if (_this.listData.length > 0) {
                        if (_this.listData[0].child) {
                            _this.childlist = _this.listData[0].child;
                        }
                        _this.category_id = _this.listData[0]['category_id'];
                    }
                    _this.catename = _this.listData[0].name;
                    _this.background = res.data.background;
                    _this.productData=res.data.productList.data;
                    _this.productData = res.data.productList.data;
                    _this.last_page = res.data.list.last_page;
                    _this.index_open_city=res.data.store.index_open_city;
                    _this.index_open_city = res.data.store.index_open_city;
                    _this.isloadding = false;
                    if (_this.last_page <= 1) {
                        _this.no_more = true;
                    }
                });
            },
            goback() {
@@ -367,21 +403,22 @@
            },
            /*获取商品数据*/
            getProductData(e) {
                if(this.select_index!=e){
                    this.page=1
                if (this.select_index != e) {
                    this.page = 1
                }
                this.select_index = e;
                this.productData=[];
                this.productData = [];
                let self = this;
                var city_supplier_ids = '';
                if(uni.getStorageSync('citySupplierRes')){
                    let resData=uni.getStorageSync('citySupplierRes');
                    self.city_supplier_ids=resData.supplier_ids;
                if (uni.getStorageSync('citySupplierRes')) {
                    let resData = uni.getStorageSync('citySupplierRes');
                    self.city_supplier_ids = resData.supplier_ids;
                    city_supplier_ids = self.city_supplier_ids.join(",")
                }
                let page = 1;
                let list_rows = 10;
                let category_id =this.listData[e].category_id;
                let category_id = this.listData[e].category_id;
                this.category_id = category_id;
                let search = '';
                let sortType = '';
                let sortPrice = 0;
@@ -393,29 +430,36 @@
                    sortType: sortType,
                    sortPrice: sortPrice,
                    list_rows: list_rows,
                    city_supplier_ids:city_supplier_ids,
                    shop_supplier_id:uni.getStorageSync('shop_supplier_id')
                    city_supplier_ids: city_supplier_ids,
                    shop_supplier_id: uni.getStorageSync('shop_supplier_id')
                }, function(res) {
                    self.isloadding = false;
                    self.productData = res.data.list.data;
                    self.last_page = res.data.list.last_page;
                    self.index_open_city=res.data.store.index_open_city;
                    self.index_open_city = res.data.store.index_open_city;
                    if (self.last_page <= 1) {
                        self.no_more = true;
                    }
                });
            },
            scrolltolowerList(){
                var self=this;
                if(self.page<self.last_page){
            scrolltolowerList() {
                var self = this;
                if (self.page < self.last_page) {
                    self.page++
                    self.isloadding = true;
                    var params=self.params;
                    params.category_id =self.category_id;
                    params.page =self.page;
                    var params = self.params;
                    params.category_id = self.category_id;
                    params.page = self.page;
                    self._get('product.product/lists', params, function(res) {
                        self.isloadding = false;
                        self.productData = self.productData.concat(res.data.list.data);
                        if (self.page >= self.last_page) {
                            self.no_more = true;
                            return;
                        }
                    });
                }
            },
            /*跳转产品列表*/
            gotoList2(e) {
@@ -442,7 +486,7 @@
                    return false;
                }
            },
            /*跳转搜索页面*/
            gotoSearch() {
                this.gotoPage('/pages/product/search/search');
@@ -457,35 +501,35 @@
                    path: '/pages/product/category?' + self.getShareUrlParams()
                };
            },
            // 添加到购物车或显示规格选择
            addToCartOrShowSpec(product,index) {
            addToCartOrShowSpec(product, index) {
                if (product.spec_type === 20) {
                    // 多规格商品,显示规格选择弹窗
                    this.showSpecPopup(product);
                } else {
                    // 单规格商品,直接添加到购物车
                    this.directlyAddToCart(product,index);
                    this.directlyAddToCart(product, index);
                }
            },
            // 添加到购物车(单规格商品)
            addToCart(product,index) {
                this.directlyAddToCart(product,index);
            addToCart(product, index) {
                this.directlyAddToCart(product, index);
            },
            // 直接添加到购物车(单规格商品)
            directlyAddToCart(product,index) {
            directlyAddToCart(product, index) {
                this._post('order.cart/add', {
                    product_id: product.product_id,
                    total_num: 1,
                    spec_sku_id: 0
                }, (res) => {
                    if (res.code === 1) {
                        if(!product.cart){
                            product.cart={
                                total_num:0
                        if (!product.cart) {
                            product.cart = {
                                total_num: 0
                            }
                        }
                        // 更新商品的购物车数量
@@ -499,12 +543,12 @@
                    }
                });
            },
            // 显示规格选择弹窗
            showSpecPopup(product) {
                this.selectedProduct = product;
                this.quantity = 1;
                let url=''
                let url = ''
                //#ifdef H5
                if (this.isWeixin()) {
                    url = window.location.href;
@@ -513,35 +557,36 @@
                // 获取商品规格数据
                this._get('product.product/detail', {
                    product_id: product.product_id,
                    url:url,
                    url: url,
                    visitcode: this.getVisitcode()
                }, (res) => {
                    if (res.code === 1) {
                    // 使用正确的路径获取规格数据
                    let specData = res.data.detail.product_multi_spec || res.data.detail;
                    this.$set(this.selectedProduct, 'specData', specData);
                    // 同时设置SKU数据
                    if (res.data.detail.sku) {
                        this.$set(this.selectedProduct, 'sku', res.data.detail.sku);
                    }
                    console.log(this.selectedSpecs);
                        // 使用正确的路径获取规格数据
                        let specData = res.data.detail.product_multi_spec || res.data.detail;
                        this.$set(this.selectedProduct, 'specData', specData);
                        // 同时设置SKU数据
                        if (res.data.detail.sku) {
                            this.$set(this.selectedProduct, 'sku', res.data.detail.sku);
                        }
                        console.log(this.selectedSpecs);
                        // 初始化选中规格数组
                    if (specData && specData.spec_attr) {
                        this.selectedSpecs = specData.spec_attr.map(specGroup => {
                            return specGroup.spec_items && specGroup.spec_items.length > 0 ? specGroup.spec_items[0].item_id : null;
                        });
                        this.specPopupVisible = true;
                    } else {
                        uni.showToast({
                            title: '获取商品规格失败',
                            icon: 'none'
                        });
                        return;
                    }
                        if (specData && specData.spec_attr) {
                            this.selectedSpecs = specData.spec_attr.map(specGroup => {
                                return specGroup.spec_items && specGroup.spec_items.length > 0 ? specGroup
                                    .spec_items[0].item_id : null;
                            });
                            this.specPopupVisible = true;
                        } else {
                            uni.showToast({
                                title: '获取商品规格失败',
                                icon: 'none'
                            });
                            return;
                        }
                    } else {
                        uni.showToast({
                            title: '获取商品规格失败',
@@ -550,34 +595,34 @@
                    }
                });
            },
            // 关闭规格选择弹窗
            closeSpecPopup() {
                this.specPopupVisible = false;
                this.selectedProduct = null;
                this.selectedSpecs = [];
            },
            // 选择规格
            selectSpec(groupIndex, itemId) {
                // 使用 Vue.set 确保响应式更新
                this.$set(this.selectedSpecs, groupIndex, itemId);
            },
            // 增加数量
            increaseQuantity() {
                if (this.quantity < this.currentStock) {
                    this.quantity++;
                }
            },
            // 减少数量
            decreaseQuantity() {
                if (this.quantity > 1) {
                    this.quantity--;
                }
            },
            // 确认添加到购物车
            confirmAddToCart() {
                // 检查是否选择了所有规格
@@ -588,30 +633,31 @@
                    });
                    return;
                }
                // 构造规格SKU ID
                const specSkuId = this.selectedSpecs.join('_');
                this._post('order.cart/add', {
                    product_id: this.selectedProduct.product_id,
                    total_num: this.quantity,
                    spec_sku_id: specSkuId?specSkuId:0
                    spec_sku_id: specSkuId ? specSkuId : 0
                }, (res) => {
                    if (res.code === 1) {
                        // 更新商品的购物车数量
                        const product = this.productData.find(p => p.product_id === this.selectedProduct.product_id);
                        const product = this.productData.find(p => p.product_id === this.selectedProduct
                            .product_id);
                        if (product) {
                            if(!product.cart){
                                product.cart={
                                    total_num:0
                            if (!product.cart) {
                                product.cart = {
                                    total_num: 0
                                }
                            }
                            product.cart.total_num++;
                        }
                        // 关闭弹窗
                        this.closeSpecPopup();
                        uni.showToast({
                            title: '已添加到购物车',
                            icon: 'success'
@@ -624,9 +670,9 @@
                    }
                });
            },
            // 增加购物车商品数量
            increaseCart(product,index) {
            increaseCart(product, index) {
                this._post('order.cart/add', {
                    product_id: product.product_id,
                    total_num: 1,
@@ -643,18 +689,18 @@
                    }
                });
            },
            // 减少购物车商品数量
            decreaseCart(product,index) {
            decreaseCart(product, index) {
                if (product.cart.total_num <= 1) {
                    // 如果数量为1,执行删除操作
                    this._post('order.cart/delete', {
                        product_id: product.product_id,
                        cart_id: product.cart.cart_id,
                        spec_sku_id:product.product_sku.spec_sku_id
                        spec_sku_id: product.product_sku.spec_sku_id
                    }, (res) => {
                        if (res.code === 1) {
                            this.productData[index].cart.total_num=0;
                            this.productData[index].cart.total_num = 0;
                        } else {
                            uni.showToast({
                                title: res.msg,
@@ -666,7 +712,7 @@
                    // 否则减少数量
                    this._post('order.cart/sub', {
                        product_id: product.product_id,
                        spec_sku_id:product.product_sku.spec_sku_id
                        spec_sku_id: product.product_sku.spec_sku_id
                    }, (res) => {
                        if (res.code === 1) {
                            product.cart.total_num--;
@@ -829,18 +875,20 @@
        background: #ffffff;
        border-radius: 12px;
    }
    .catename{
    .catename {
        padding-top: 10rpx;
        line-height: 60rpx;
        border-bottom: 1rpx solid #D9D9D9;
    }
    .shop_body {
        width: 100%;
        background-color: #ffffff;
        padding: 0rpx 20rpx;
        box-sizing: border-box;
    }
    .shop_body_l_item {
        // width: 90%;
        // height: 250rpx;
@@ -852,16 +900,16 @@
        padding: 40rpx 0;
        box-sizing: border-box;
        border-bottom: 1rpx solid #D9D9D9;
    }
    .shop_body_l_item image {
        width: 150rpx;
        height: 150rpx;
        border-radius: 12rpx;
        background-color: rgba(0, 0, 0, 0.1);
    }
    .shop_body_l_item_info {
        // width: 70%;
        // height: 100%;
@@ -873,7 +921,7 @@
        box-sizing: border-box;
        position: relative;
    }
    .shop_body_l_item_info_title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
@@ -884,23 +932,23 @@
        word-break: break-all;
        overflow: hidden;
    }
    .shop_body_l_item_info_price {
        display: flex;
        align-items: flex-end;
    }
    .shop_body_l_item_info_price view {
        margin-right: 15rpx;
    }
    .shop_body_l_item_info_others {
        // width: 100%;
        height: 30rpx;
        display: flex;
        justify-content: space-between;
    }
    .shop_body_l_item_info_others_activity {
        width: 150rpx;
        height: 30rpx;
@@ -912,11 +960,11 @@
        text-align: center;
        box-sizing: border-box;
    }
    .shop_body_l_item_info_others_sales {
        color: #333333;
    }
    .shop_body2 {
        width: 100%;
        display: flex;
@@ -924,7 +972,7 @@
        flex-wrap: wrap;
        background-color: #f2f2f2;
    }
    .shop_body_t_item {
        width: 345rpx;
        // margin: 0 2.5%;
@@ -934,17 +982,17 @@
        background-color: white;
        border-radius: 12rpx;
    }
    .collect text {
        color: #FFFFFF;
    }
    .shop_body_t_item image {
        width: 100%;
        height: 337.5rpx;
        background-color: rgba(0, 0, 0, 0.1);
    }
    .shop_body_t_item_info {
        // height: 182.5rpx;
        display: flex;
@@ -953,7 +1001,7 @@
        padding: 20rpx;
        box-sizing: border-box;
    }
    .shop_body_t_item_info_title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
@@ -965,55 +1013,56 @@
        overflow: hidden;
        margin-bottom: 30rpx;
    }
    .shop_body_t_item_info_price {
        display: flex;
        align-items: flex-end;
    }
    .shop_body_t_item_info_others {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8rpx;
    }
    .shop_body_t_item_info_others_activity {}
    .shop_body_t_item_info_others_sales {
        color: #999999;
    }
    .huaxianjia {
        text-decoration: line-through;
        color: #999;
        margin-left: 5rpx;
    }
    .shop_red {
        color: #F6220C;
    }
    .inner-tab .item .icon-sanjiao2 {
        font-size: 13rpx;
    }
    .inner-tab .item .icon-sanjiao1 {
        font-size: 13rpx;
    }
    .noborder {
        border: none;
    }
    /* 购物车操作样式 */
    .cart-action {
        /* position: absolute;
        right: 0;
        bottom: 0; */
    }
    .cart-btn-add, .cart-btn-sub {
    .cart-btn-add,
    .cart-btn-sub {
        width: 48rpx;
        height: 48rpx;
        border-radius: 50%;
@@ -1024,7 +1073,7 @@
        color: white;
        font-size: 24rpx;
    }
    .spec-select-btn {
        padding: 2rpx 4rpx;
        background: #ff6b6b;
@@ -1038,22 +1087,22 @@
        height: 48rpx;
        position: relative;
    }
    .cart-btn-sub {
        background: #f0f0f0;
        color: #666;
    }
    .cart-number {
        margin: 0 10rpx;
        font-size: 28rpx;
    }
    .cart-number-controller {
        display: flex;
        align-items: center;
    }
    /* 规格选择弹窗样式 */
    .spec-popup {
        position: fixed;
@@ -1066,12 +1115,12 @@
        opacity: 0;
        transition: all 0.3s ease;
    }
    .spec-popup.visible {
        visibility: visible;
        opacity: 1;
    }
    .popup-mask {
        position: absolute;
        top: 0;
@@ -1080,7 +1129,7 @@
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
    }
    .popup-content {
        position: absolute;
        bottom: 0;
@@ -1095,47 +1144,47 @@
        max-height: 80%;
        overflow-y: auto;
    }
    .spec-popup.visible .popup-content {
        transform: translateY(0);
    }
    .popup-header {
        display: flex;
        position: relative;
        padding-right: 60rpx;
        margin-bottom: 30rpx;
    }
    .popup-header image {
        width: 160rpx;
        height: 160rpx;
        border-radius: 10rpx;
    }
    .popup-header-info {
        margin-left: 20rpx;
        flex: 1;
    }
    .price {
        font-size: 36rpx;
        color: #ff6b6b;
        font-weight: bold;
    }
    .stock {
        font-size: 24rpx;
        color: #999;
        margin-top: 10rpx;
    }
    .selected-spec {
        font-size: 24rpx;
        color: #666;
        margin-top: 10rpx;
    }
    .popup-header-right {
        position: absolute;
        right: 0;
@@ -1144,7 +1193,7 @@
        align-items: center;
        gap: 20rpx;
    }
    .cart-badge {
        position: absolute;
        top: -12rpx;
@@ -1162,13 +1211,13 @@
        padding: 0 6rpx;
        z-index: 10;
    }
    .cart-count {
        color: white;
        font-size: 20rpx;
        line-height: 1;
    }
    .close-btn {
        width: 50rpx;
        height: 50rpx;
@@ -1177,26 +1226,26 @@
        justify-content: center;
        color: #999;
    }
    .spec-section {
        margin-bottom: 30rpx;
    }
    .spec-group {
        margin-bottom: 30rpx;
    }
    .spec-group-name {
        font-size: 28rpx;
        font-weight: bold;
        margin-bottom: 20rpx;
    }
    .spec-options {
        display: flex;
        flex-wrap: wrap;
    }
    .spec-option {
        padding: 10rpx 20rpx;
        border: 1rpx solid #ddd;
@@ -1205,28 +1254,28 @@
        margin-bottom: 20rpx;
        font-size: 26rpx;
    }
    .spec-option.active {
        border-color: #ff6b6b;
        color: #ff6b6b;
    }
    .quantity-section {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 30rpx;
    }
    .quantity-label {
        font-size: 28rpx;
    }
    .quantity-controller {
        display: flex;
        align-items: center;
    }
    .quantity-btn {
        width: 50rpx;
        height: 50rpx;
@@ -1237,22 +1286,22 @@
        justify-content: center;
        font-size: 24rpx;
    }
    .quantity-btn.disabled {
        opacity: 0.5;
    }
    .quantity-display {
        margin: 0 20rpx;
        font-size: 28rpx;
        min-width: 60rpx;
        text-align: center;
    }
    .action-buttons {
        text-align: center;
    }
    .add-cart-btn {
        width: 100%;
        height: 80rpx;
@@ -1262,7 +1311,7 @@
        font-size: 32rpx;
        border: none;
    }
    .reg180 {
        padding-right: 20rpx;
        text-align: right;
mobile/pages/user/my_shop/my_shop.vue
@@ -1,6 +1,6 @@
<template>
    <view class="weidian" v-if="store_open">
        <view v-if="shop_data.supplier.money>0&&shop_data.supplier.status!=20">
        <view v-if="shop_data.supplier.money>0||shop_data.supplier.status!=20">
            <view class="weidian_head">
                <!-- #ifdef MP-WEIXIN || APP-PLUS -->
                <view class="ww100" :style="'height:'+topBarTop()+'px;'"></view>
@@ -120,25 +120,51 @@
                <view class="fb">缴纳保证金</view>
            </view>
            <!-- #endif -->
            <view class="deposit_bg">
                <view class="deposit_bg">
                    <view class="deposit_tit">类目:<text class="gray9">{{category.name}}</text></view>
                    <view class="deposit_tit borderb">保证金:<text class="gray9">¥{{category.deposit_money}}</text></view>
                </view>
            </view>
            <view class="member">
                <view class="member-package" v-for="(item, index) in memberPackages" :key="index" @click="selectPackage(index)">
                    <view class="package-header" :class="{ 'selected': selectedIndex === index }">
                        <text class="package-name">{{ item.name }}</text>
                        <text class="package-price">¥{{ item.price }}</text>
                    </view>
                    <view class="package-body">
                        <view class="package-description">{{ item.particulars }}</view>
                        <view class="package-expiry">有效期:{{ item.duration }}天</view>
                <view class="common-form">保证金</view>
                <view class="member-package">
                    <view class="selected package-header">
                        <view>
                            <text class="package-name">{{category.name}}</text>
                            <text class="package-price">¥{{ category.deposit_money }}</text>
                        </view>
                        <view>
                            <radio-group activeBackgroundColor="#e43130">
                                <radio checked></radio>
                            </radio-group>
                        </view>
                    </view>
                </view>
                <view class="buy-button-container">
                    <button class="buy-button" @click="buyMemberPackage">立即购买</button>
                <view class="common-form">年卡</view>
                <radio-group activeBackgroundColor="#e43130">
                    <view class="member-package" v-for="(item, index) in memberPackages" :key="index"
                        @click="selectPackage(index)">
                        <view class="selected package-header">
                            <view>
                                <text class="package-name">{{ item.name }}</text>
                                <text class="package-price">¥{{ item.price }}</text>
                            </view>
                            <view>
                                <radio :checked="selectedIndex==index"></radio>
                            </view>
                        </view>
                        <view class="package-body">
                            <view class="package-description">{{ item.particulars }}</view>
                            <view class="package-expiry">有效期:{{ item.duration }}天</view>
                        </view>
                    </view>
                </radio-group>
                <!--底部支付-->
                <view class="foot-pay-btns">
                    <template >
                        <view>
                            应付
                            <text class="fb theme-price">¥</text>
                            <text class="num theme-price fb f38">{{ order_total_front_price }}</text>
                        </view>
                    </template>
                    <button type="primary" @tap="SubmitOrder">提交订单</button>
                </view>
            </view>
        </view>
@@ -208,7 +234,9 @@
                memberPackages: [],
                selectedIndex: 0,
                category: {},
                loading: true
                loading: true,
                plan_id:0,
                order_total_front_price:0,
            }
        },
        onShow() {
@@ -217,22 +245,42 @@
        },
        onLoad() {
            this.GetStatusBarHeight();
            this.getMemberPlans();
            this.getData();
        },
        methods: {// 获取年卡套餐列表
        methods: { // 获取年卡套餐列表
            getMemberPlans() {
                let self = this;
                self._get('supplier.member/plans', {}, function(res) {
                self._get('supplier.member/plansAll', {}, function(res) {
                    self.memberPackages = res.data.plans;
                    self.plan_id = self.memberPackages[0].plan_id;
                    console.log(self.category);
                    self.order_total_front_price = (Number(self.memberPackages[0].price)+Number(self.category.deposit_money)).toFixed(2);
                    self.loading = false;
                });
            },
            /*提交订单*/
            SubmitOrder() {
                let self = this;
                self._post(
                    'supplier.index/deposit', {
                        plan_id:self.plan_id
                    },
                    function(result) {
                        self.gotoPage('/pages/order/cashier?order_id=' + result.data.order_id+ '&order_type=20');
                    }
                );
            },
            selectPackage(index) {
                this.selectedIndex = index;
                this.plan_id = this.memberPackages[index].plan_id;
        this.order_total_front_price = (Number(this.memberPackages[index].price)+Number(this.category.deposit_money)).toFixed(2);
            },
            /*获取数据*/
            getData() {
                let self = this;
                self._get('supplier.index/deposit', {}, function(res) {
                    self.category = res.data.category;
                    self.getMemberPlans();
                });
            },
            GetStatusBarHeight() {
@@ -287,7 +335,13 @@
                })
            },
            goback() {
                uni.navigateBack();
                let self = this;
                uni.navigateBack({
                    delta:1,
                    fail:function(e){
                        self.gotoPage('/pages/tabBar/user/index');
                    }
                });
            },
            // 支付保证金
            gotoPay() {
@@ -569,6 +623,35 @@
        background-color: #FFFFFF;
        border-top: 1rpx solid #efefef;
    }
    .common-form {
        position: relative;
        height: 80rpx;
        padding-left: 40rpx;
        line-height: 80rpx;
        font-size: 28rpx;
        font-weight: 700;
        margin-top: 24rpx;
    }
    .common-form:before {
        background: #3a8ee6;
    }
    .common-form:before {
        position: absolute;
        content: "";
        width: 4px;
        height: 14px;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
    }
    .member {
        padding: 0 20rpx;
    }
    .member-package {
        background-color: white;
        border-radius: 10rpx;
@@ -576,35 +659,38 @@
        overflow: hidden;
        box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
    }
    .package-header {
        padding: 30rpx;
        background-color: #f8f8f8;
        border-left: 10rpx solid #ccc;
        display: flex;
        justify-content: space-between;
    }
    .package-header.selected {
        background-color: #eef5ff;
        border-left: 10rpx solid #409EFF;
        background-color: #ffeeee;
        border-left: 10rpx solid #e43130;
    }
    .package-name {
        font-size: 32rpx;
        font-weight: bold;
        color: #333;
    }
    .package-price {
        float: right;
        font-size: 36rpx;
        font-weight: bold;
        color: #e43130;
        margin-left: 30rpx;
    }
    .package-body {
        padding: 30rpx;
    }
    .package-description {
        font-size: 28rpx;
        color: #666;
@@ -612,33 +698,33 @@
        white-space: pre-line;
        line-height: 1.6;
    }
    .package-features {
        margin-bottom: 20rpx;
    }
    .feature {
        font-size: 26rpx;
        color: #555;
        margin-bottom: 10rpx;
    }
    .feature .icon-duigou {
        color: #4caf50;
        margin-right: 10rpx;
    }
    .package-expiry {
        font-size: 24rpx;
        color: #999;
        text-align: right;
    }
    .buy-button-container {
        padding: 40rpx 0;
        text-align: center;
    }
    .buy-button {
        width: 80%;
        background-color: #e43130;
shop_vue/src/views/plus/vip/grade/part/Add.vue
@@ -39,9 +39,14 @@
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="见点奖" :label-width="formLabelWidth" prop="viewpoint_money">
      <el-input v-model="form.viewpoint_money" type="number" placeholder="请输入见点奖">
        <template slot="append">元</template>
    <el-form-item label="复购专区级差计算" :label-width="formLabelWidth" prop="differential_prize">
      <el-input v-model="form.differential_prize" type="number" placeholder="请输入复购专区级差计算">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="复购专区平级奖" :label-width="formLabelWidth" prop="equal_level_award">
      <el-input v-model="form.equal_level_award" type="number" placeholder="请输入级复购专区平级奖">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="自动升级" :label-width="formLabelWidth" prop="auto_upgrade">
@@ -131,6 +136,10 @@
          referee_grade_count: 0,
          /*见点奖*/
          viewpoint_money: 0,
          /*平级奖*/
          equal_level_award: 0,
          /*级差计算*/
          differential_prize: 0,
          /*备注*/
          remark: '',
        },
shop_vue/src/views/plus/vip/grade/part/Edit.vue
@@ -39,9 +39,14 @@
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="见点奖" :label-width="formLabelWidth" prop="viewpoint_money">
      <el-input v-model="form.viewpoint_money" type="number" placeholder="见点奖">
        <template slot="append">元</template>
    <el-form-item label="复购专区级差计算" :label-width="formLabelWidth" prop="differential_prize">
      <el-input v-model="form.differential_prize" type="number" placeholder="请输入复购专区级差计算">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="复购专区平级奖" :label-width="formLabelWidth" prop="equal_level_award">
      <el-input v-model="form.equal_level_award" type="number" placeholder="请输入级复购专区平级奖">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item v-if="form.is_default == 0" label="自动升级" :label-width="formLabelWidth" prop="auto_upgrade">
shop_vue/src/views/plus/vip/grade/part/List.vue
@@ -23,12 +23,7 @@
            <span class="orange">¥{{ scope.row.repurchase_money }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="operating_subsidy" label="见点奖" >
          <template slot-scope="scope">
            <span class="orange">¥{{ scope.row.viewpoint_money }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="operating_subsidy" label="VIP专区补贴" >
        <el-table-column prop="operating_subsidy" label="下级收益补贴" >
          <template slot-scope="scope">
            <span class="orange">{{ scope.row.operating_subsidy }}%</span>
          </template>
@@ -43,6 +38,16 @@
            <span class="orange">{{ scope.row.supplier_money }}%</span>
          </template>
        </el-table-column>
        <el-table-column prop="operating_subsidy" label="复购专区级差计算" >
          <template slot-scope="scope">
            <span class="orange">{{ scope.row.differential_prize }}%</span>
          </template>
        </el-table-column>
        <el-table-column prop="operating_subsidy" label="复购专区平级奖" >
          <template slot-scope="scope">
            <span class="orange">{{ scope.row.equal_level_award }}%</span>
          </template>
        </el-table-column>
        <el-table-column prop="remark" label="升级条件" >
          <template slot-scope="scope">
            <div v-html="keepTextStyle(scope.row.remark)"></div>
supplier_vue/src/views/plus/vip/grade/part/Add.vue
@@ -24,8 +24,8 @@
        <template slot="append">元</template>
      </el-input>
    </el-form-item>
    <el-form-item label="VIP专区补贴" :label-width="formLabelWidth" prop="operating_subsidy">
      <el-input v-model="form.operating_subsidy" type="number" placeholder="请输入VIP专区补贴">
    <el-form-item label="下级收益补贴" :label-width="formLabelWidth" prop="operating_subsidy">
      <el-input v-model="form.operating_subsidy" type="number" placeholder="请输入下级收益补贴">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
@@ -34,6 +34,20 @@
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="直推店铺交易额佣金" :label-width="formLabelWidth" prop="commission">
      <el-input v-model="form.supplier_money" type="number" placeholder="请输入直推店铺交易额佣金">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="复购专区级差计算" :label-width="formLabelWidth" prop="differential_prize">
      <el-input v-model="form.differential_prize" type="number" placeholder="请输入复购专区级差计算">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="复购专区平级奖" :label-width="formLabelWidth" prop="equal_level_award">
      <el-input v-model="form.equal_level_award" type="number" placeholder="请输入级复购专区平级奖">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="自动升级" :label-width="formLabelWidth" prop="auto_upgrade">
      <el-radio-group v-model="form.auto_upgrade">
@@ -49,9 +63,27 @@
        </el-radio-group>
      </div>
      <div class="d-s-c mt16">
        <el-checkbox v-model="form.is_purchase_count">购买次数</el-checkbox>
        <el-checkbox v-model="form.is_purchase_count">购买次数VIP专区商品</el-checkbox>
        <el-input v-model="form.purchase_count" type="number" :disabled="!form.is_purchase_count" style="width: 160px; margin-left: 10px;" ></el-input>
        <span class="ml10">次</span>
      </div>
      <div class="d-s-c mt16">
        <el-checkbox v-model="form.is_supplier_count">直推商家</el-checkbox>
        <el-input v-model="form.supplier_count" type="number" :disabled="!form.is_supplier_count" style="width: 160px; margin-left: 10px;" ></el-input>
        <span class="ml10">家</span>
      </div>
      <div class="d-s-c mt16">
        <el-checkbox v-model="form.is_referee_grade">直推指定会员等级</el-checkbox>
        <el-select v-model="form.referee_grade_ids" multiple :disabled="!form.is_referee_grade" style="width: 160px; margin-left: 10px;">
          <el-option
            v-for="item in userGradeList"
            :key="item.grade_id"
            :label="item.name"
            :value="item.grade_id">
          </el-option>
        </el-select>
        <el-input v-model="form.referee_grade_count" type="number" :disabled="!form.is_referee_grade" style="width: 160px; margin-left: 10px;" ></el-input>
        <span class="ml10">人</span>
      </div>
    </el-form-item>
  </el-form>
@@ -65,6 +97,7 @@
<script>
  import vipApi from '@/api/plus/vip.js';
  import UserApi from '@/api/user.js';
  export default {
    data() {
      return {
@@ -77,10 +110,12 @@
          agent_money: 0,
          /*推广复购佣金*/
          repurchase_money: 0,
          /*VIP专区补贴*/
          /*下级收益补贴*/
          operating_subsidy: 0,
          /*平台直推佣金*/
          commission: 0,
          /*直推店铺交易额佣金*/
          supplier_money: 0,
          /*自动升级*/
          auto_upgrade: 1,
          /*升级条件*/
@@ -89,9 +124,27 @@
          is_purchase_count: 0,
          /*购买次数*/
          purchase_count: 0,
          /*是否开放直推商家*/
          is_supplier_count: 0,
          /*直推商家*/
          supplier_count: 0,
          /*是否开放直推指定会员等级*/
          is_referee_grade: 0,
          /*直推指定会员等级IDs*/
          referee_grade_ids: [],
          /*直推指定会员等级人数*/
          referee_grade_count: 0,
          /*见点奖*/
          viewpoint_money: 0,
          /*平级奖*/
          equal_level_award: 0,
          /*级差计算*/
          differential_prize: 0,
          /*备注*/
          remark: '',
        },
        /*用户管理模块的等级列表*/
        userGradeList: [],
        /*左边长度*/
        formLabelWidth: '120px',
        /*是否显示*/
@@ -103,8 +156,18 @@
    props: ['open_add'],
    created() {
      this.dialogVisible = this.open_add;
      this.getUserGradeList();
    },
    methods: {
      /*获取用户管理模块的等级列表*/
      getUserGradeList() {
        let self = this;
        UserApi.gradelist({}, true)
          .then(res => {
            self.userGradeList = res.data.list.data || res.data.list;
          })
          .catch(error => {});
      },
      /*添加等级*/
      addGrade() {
        let self = this;
@@ -113,6 +176,8 @@
          if (valid) {
            self.submit_loading = true;
            params.is_purchase_count = params.is_purchase_count == true ? 1 : 0;
            params.is_supplier_count = params.is_supplier_count == true ? 1 : 0;
            params.is_referee_grade = params.is_referee_grade == true ? 1 : 0;
            vipApi.addgrade(params, true).then(data => {
                self.submit_loading = false;
                self.$message({
supplier_vue/src/views/plus/vip/grade/part/Edit.vue
@@ -24,13 +24,28 @@
        <template slot="append">元</template>
      </el-input>
    </el-form-item>
    <el-form-item label="VIP专区补贴" :label-width="formLabelWidth" prop="operating_subsidy">
      <el-input v-model="form.operating_subsidy" type="number" placeholder="请输入VIP专区补贴">
    <el-form-item label="下级收益补贴" :label-width="formLabelWidth" prop="operating_subsidy">
      <el-input v-model="form.operating_subsidy" type="number" placeholder="请输入下级收益补贴">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="平台直推佣金" :label-width="formLabelWidth" prop="commission">
      <el-input v-model="form.commission" type="number" placeholder="请输入平台直推佣金">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="直推店铺交易额佣金" :label-width="formLabelWidth" prop="commission">
      <el-input v-model="form.supplier_money" type="number" placeholder="请输入直推店铺交易额佣金">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="复购专区级差计算" :label-width="formLabelWidth" prop="differential_prize">
      <el-input v-model="form.differential_prize" type="number" placeholder="请输入复购专区级差计算">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
    <el-form-item label="复购专区平级奖" :label-width="formLabelWidth" prop="equal_level_award">
      <el-input v-model="form.equal_level_award" type="number" placeholder="请输入级复购专区平级奖">
        <template slot="append">%</template>
      </el-input>
    </el-form-item>
@@ -48,9 +63,27 @@
        </el-radio-group>
      </div>
      <div class="d-s-c mt16">
        <el-checkbox v-model="form.is_purchase_count">购买次数</el-checkbox>
        <el-checkbox v-model="form.is_purchase_count">购买次数VIP专区商品</el-checkbox>
        <el-input v-model="form.purchase_count" type="number" :disabled="!form.is_purchase_count" style="width: 160px; margin-left: 10px;" ></el-input>
        <span class="ml10">次</span>
      </div>
      <div class="d-s-c mt16">
        <el-checkbox v-model="form.is_supplier_count">直推商家</el-checkbox>
        <el-input v-model="form.supplier_count" type="number" :disabled="!form.is_supplier_count" style="width: 160px; margin-left: 10px;" ></el-input>
        <span class="ml10">家</span>
      </div>
      <div class="d-s-c mt16">
        <el-checkbox v-model="form.is_referee_grade">直推指定会员等级</el-checkbox>
        <el-select v-model="form.referee_grade_ids" multiple :disabled="!form.is_referee_grade" style="width: 160px; margin-left: 10px;">
          <el-option
            v-for="item in userGradeList"
            :key="item.grade_id"
            :label="item.name"
            :value="item.grade_id">
          </el-option>
        </el-select>
        <el-input v-model="form.referee_grade_count" type="number" :disabled="!form.is_referee_grade" style="width: 160px; margin-left: 10px;" ></el-input>
        <span class="ml10">人</span>
      </div>
    </el-form-item>
  </el-form>
@@ -63,9 +96,12 @@
<script>
  import vipApi from '@/api/plus/vip.js';
  import UserApi from '@/api/user.js';
  export default {
    data() {
      return {
        /*用户管理模块的等级列表*/
        userGradeList: [],
        /*左边长度*/
        formLabelWidth: '120px',
        /*是否显示*/
@@ -77,9 +113,25 @@
    props: ['open_edit', 'form'],
    created() {
      this.form.is_purchase_count = this.form.is_purchase_count == 1 ? true : false;
      this.form.is_supplier_count = this.form.is_supplier_count == 1 ? true : false;
      this.form.is_referee_grade = this.form.is_referee_grade == 1 ? true : false;
      // 等级id转换成数组
      for (let i = 0; i < this.form.referee_grade_ids.length; i++) {
        this.form.referee_grade_ids[i] = parseInt(this.form.referee_grade_ids[i]);
      }
      this.dialogVisible = this.open_edit;
      this.getUserGradeList();
    },
    methods: {
      /*获取用户管理模块的等级列表*/
      getUserGradeList() {
        let self = this;
        UserApi.gradelist({}, true)
          .then(res => {
            self.userGradeList = res.data.list.data || res.data.list;
          })
          .catch(error => {});
      },
      /*修改等级*/
      editGrade() {
        let self = this;
@@ -88,6 +140,8 @@
          if (valid) {
            self.submit_loading = true;
            params.is_purchase_count = params.is_purchase_count == true ? 1 : 0;
            params.is_supplier_count = params.is_supplier_count == true ? 1 : 0;
            params.is_referee_grade = params.is_referee_grade == true ? 1 : 0;
            vipApi.editGrade(params, true)
              .then(data => {
                self.submit_loading = false;
@@ -122,4 +176,4 @@
  };
</script>
<style></style>
<style></style>
supplier_vue/src/views/plus/vip/grade/part/List.vue
@@ -18,7 +18,12 @@
            <span class="orange">¥{{ scope.row.agent_money }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="operating_subsidy" label="VIP专区补贴" >
        <el-table-column prop="operating_subsidy" label="推广复购佣金" >
          <template slot-scope="scope">
            <span class="orange">¥{{ scope.row.repurchase_money }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="operating_subsidy" label="下级收益补贴" >
          <template slot-scope="scope">
            <span class="orange">{{ scope.row.operating_subsidy }}%</span>
          </template>
@@ -28,7 +33,26 @@
            <span class="orange">{{ scope.row.commission }}%</span>
          </template>
        </el-table-column>
        <el-table-column prop="remark" label="升级条件" ></el-table-column>
        <el-table-column prop="supplier_money" label="直推商家交易佣金" >
          <template slot-scope="scope">
            <span class="orange">{{ scope.row.supplier_money }}%</span>
          </template>
        </el-table-column>
        <el-table-column prop="operating_subsidy" label="复购专区级差计算" >
          <template slot-scope="scope">
            <span class="orange">{{ scope.row.differential_prize }}%</span>
          </template>
        </el-table-column>
        <el-table-column prop="operating_subsidy" label="复购专区平级奖" >
          <template slot-scope="scope">
            <span class="orange">{{ scope.row.equal_level_award }}%</span>
          </template>
        </el-table-column>
        <el-table-column prop="remark" label="升级条件" >
          <template slot-scope="scope">
            <div v-html="keepTextStyle(scope.row.remark)"></div>
          </template>
        </el-table-column>
        <el-table-column prop="create_time" label="创建时间" width="160">
          <template slot-scope="scope">
            <span>{{ scope.row.create_time }}</span>
@@ -80,6 +104,11 @@
    this.getData();
  },
  methods: {
    /*换行*/
    keepTextStyle(val){
      let str=val.replace(/(\\r\\n)/g,'<br/>');
      return str;
    },
    /*获取列表数据*/
    getData() {
      let self = this;
supplier_vue/src/views/plus/vip/grade/part/Log.vue
@@ -25,28 +25,28 @@
    <div class="table-wrap">
      <el-table :data="tableData" style="width: 100%" v-loading="loading">
        <el-table-column prop="log_id" label="ID" width="80"></el-table-column>
        <el-table-column prop="user.nickName" label="用户信息">
        <el-table-column prop="vipUser.nickName" label="用户信息">
          <template slot-scope="scope">
            <div class="d-s-c">
              <div class="head-img mr10">
                <img :src="scope.row.user.avatarUrl" alt="" />
                <img :src="scope.row.vipUser.avatarUrl" alt="" />
              </div>
              <div>
                <p>{{ scope.row.user.nickName }}</p>
                <p>{{ scope.row.vipUser.nickName }}</p>
                <p class="gray9">ID: {{ scope.row.user_id }}</p>
              </div>
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="old_grade.name" label="变更前等级">
        <el-table-column prop="oldGrade.name" label="变更前等级">
          <template slot-scope="scope">
            <span v-if="scope.row.old_grade">{{ scope.row.old_grade.name }}</span>
            <span v-if="scope.row.oldGrade">{{ scope.row.oldGrade.name }}</span>
            <span v-else class="gray9">无</span>
          </template>
        </el-table-column>
        <el-table-column prop="new_grade.name" label="变更后等级">
        <el-table-column prop="grade.name" label="变更后等级">
          <template slot-scope="scope">
            <span v-if="scope.row.new_grade">{{ scope.row.new_grade.name }}</span>
            <span v-if="scope.row.grade">{{ scope.row.grade.name }}</span>
            <span v-else class="gray9">无</span>
          </template>
        </el-table-column>
@@ -57,7 +57,7 @@
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="remark" label="备注"">
        <el-table-column prop="remark" label="备注">
          <template slot-scope="scope">
            <span>{{ scope.row.remark || '无' }}</span>
          </template>
@@ -133,4 +133,4 @@
};
</script>
<style></style>
<style></style>