将分类改为多选
修复活动报名
实现成为vip会员时根据活动报名信息绑定下级
3 files added
27 files modified
| | |
| | | return $this->renderSuccess('', compact('order_id')); |
| | | } |
| | | } |
| | | public function getRegistrationInformation($user_id = 0) |
| | | public function getRegistrationInformation($user_id = 0,$activity_id=0) |
| | | { |
| | | // 生成报名用户 |
| | | $model = new ActivityUserModel(); |
| | | $userId = $user_id!=0?$user_id:$this->getUser()['user_id']; |
| | | $registrationInformation = $model->getRegistrationInformation($userId); |
| | | $user=$this->getUser(); |
| | | $userId = $user_id!=0?$user_id:$user['user_id']; |
| | | $registrationInformation = $model->getRegistrationInformation($userId,$activity_id); |
| | | return $this->renderSuccess('', compact('registrationInformation')); |
| | | } |
| | | /** |
| | |
| | | if ($product['is_newcomer'] == 1) { |
| | | return $this->renderError('新人专区商品不能加入购物车'); |
| | | } |
| | | if ($product['is_vip'] == 1) { |
| | | return $this->renderError('vip专区商品不能加入购物车'); |
| | | } |
| | | if ($product['is_vip'] == 1) { |
| | | return $this->renderError('vip专区商品不能加入购物车'); |
| | | } |
| | | if ($product['is_repurchase'] == 1) { |
| | | return $this->renderError('复购专区商品不能加入购物车'); |
| | | } |
| | |
| | | { |
| | | $postData =$this->postData(); |
| | | $city_supplier_ids = empty($postData["city_supplier_ids"]) ? '' : $postData["city_supplier_ids"]; |
| | | $shop_supplier_id = empty($postData["shop_supplier_id"]) ? 0 : $postData["shop_supplier_id"]; |
| | | // 分类模板 |
| | | $template = PageCategoryModel::detail(); |
| | | // 商品分类列表 |
| | | $list = array_values(CategoryModel::getCacheTree()); |
| | | $list = array_values(CategoryModel::getCacheTreeShop($shop_supplier_id)); |
| | | $list =$this->hideCate($list); |
| | | $category_id=0; |
| | | if(count($list)>0){ |
| | |
| | | 'product_status' => 10, |
| | | 'audit_status' => 10 |
| | | ]); |
| | | |
| | | |
| | | $param['shop_supplier_id'] = empty($postData["shop_supplier_id"]) ? 0 : $postData["shop_supplier_id"]; |
| | | // 获取列表数据 |
| | | $model = new ProductModel; |
| | | $productList = $model->getList($param, $this->getUser(false)); |
| | |
| | | namespace app\api\controller\user; |
| | | |
| | | use app\api\controller\Controller; |
| | | |
| | | use app\api\model\settings\Setting as SettingModel; |
| | | /** |
| | | * 手动注册 by yj |
| | | */ |
| | | class Register extends Controller |
| | | { |
| | | // 用户 |
| | | private $user; |
| | | // 注册设置 |
| | | private $setting; |
| | | |
| | | /** |
| | | * 构造方法 |
| | | */ |
| | | public function initialize() |
| | | { |
| | | // 注册设置 |
| | | $this->setting = SettingModel::getItem('register'); |
| | | } |
| | | /** |
| | | * 提交注册 |
| | | */ |
| | |
| | | } |
| | | return $this->renderError($model->getError() ?: '注册失败'); |
| | | } |
| | | /** |
| | | * 先检查是否需要注册 |
| | | */ |
| | | public function need() |
| | | { |
| | | $setting = $this->setting; |
| | | // 临时解决办法(解决如果设置了授权时完善头像昵称,首次进入商城会跳转到注册页面) |
| | | if ($setting['is_skip']) { |
| | | $setting['is_manual'] = 0; |
| | | } |
| | | return $this->renderSuccess('',compact('setting')); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | return $this->renderError($model->getError() ?: '转换失败'); |
| | | } |
| | | /** |
| | | * 获取注册设置 by lyzflash |
| | | */ |
| | | public function registerSetting() |
| | | { |
| | | $register = SettingModel::getItem('register'); |
| | | return $this->renderSuccess('', compact('register')); |
| | | } |
| | | } |
| | |
| | | |
| | | namespace app\api\model\branch; |
| | | |
| | | use app\api\model\user\User; |
| | | use app\common\enum\order\OrderPayTypeEnum; |
| | | use app\common\model\branch\ActivityUser as ActivityUserModel; |
| | | use app\api\model\branch\Member as MemberModel; |
| | |
| | | use app\common\model\branch\User as BranchUserModel; |
| | | use app\common\model\branch\Setting as BranchSettingModel; |
| | | use app\common\model\settings\Region as RegionModel; |
| | | use app\api\model\user\User as UserModel; |
| | | /** |
| | | * 用户模型 |
| | | */ |
| | |
| | | { |
| | | // 构建查询规则 |
| | | $model = $this->alias('auser') |
| | | ->field('auser.*,user.nickName,user.real_name,user.avatarUrl') |
| | | ->field('auser.*,user.nickName,auser.real_name,user.avatarUrl') |
| | | ->join('user', 'user.user_id = auser.user_id') |
| | | ->where('auser.is_delete', '=', 0) |
| | | ->where('auser.status', '=', 1) |
| | |
| | | if (!$this->validateData($detail, $params, $user)) { |
| | | return false; |
| | | } |
| | | |
| | | $data = [ |
| | | 'user_id' => $user['user_id'], |
| | | 'order_no' => $this->orderNo(), |
| | | 'activity_id' => $detail['activity_id'], |
| | | 'total_price' => $detail['fee'], |
| | | 'pay_price' => $detail['fee'], |
| | | 'points_num' => $params['points_num'], // 积分抵扣数量 |
| | | 'points_money' => $params['points_money'], // 积分抵扣金额 |
| | | 'balance' => $params['balance'], // 余额 |
| | | 'online_money' => $params['online_money'], // 需在线支付的金额 |
| | | 'activity_id' => $detail['activity_id']?:0, |
| | | 'total_price' => $detail['fee']?:0, |
| | | 'pay_price' => $detail['fee']?:0, |
| | | 'points_num' => $params['points_num']?:0, // 积分抵扣数量 |
| | | 'points_money' => $params['points_money']?:0, // 积分抵扣金额 |
| | | 'balance' => $params['balance']?:0, // 余额 |
| | | 'online_money' => $params['online_money']?:0, // 需在线支付的金额 |
| | | 'status' => $params['online_money'] > 0 ? 0 : 1, //报名状态,如果不需要在线支付则则直接报名成功 |
| | | 'pay_type' => $params['pay_type'], |
| | | 'in_radius' => $params['in_radius'], |
| | | 'province_id' => $params['province_id'], |
| | | 'city_id' => $params['city_id'], |
| | | 'region_id' => $params['region_id'], |
| | | 'company' => $params['company'], |
| | | 'recommend_name' => $params['recommend_name'], |
| | | 'recommend_mobile' => $params['recommend_mobile'], |
| | | 'real_name' => $params['recommend_name'], |
| | | 'mobile' => $params['mobile'], |
| | | 'branch_id' => $params['branch_id'], |
| | | 'pay_type' => $params['pay_type']?:0, |
| | | 'in_radius' => $params['in_radius']?:0, |
| | | 'province_id' => $params['province_id']?:0, |
| | | 'city_id' => $params['city_id']?:0, |
| | | 'region_id' => $params['region_id']?:0, |
| | | 'company' => $params['company']?:'', |
| | | 'recommend_name' => $params['recommend_name']?:'', |
| | | 'recommend_mobile' => $params['recommend_mobile']?:'', |
| | | 'real_name' => $params['real_name']?:'', |
| | | 'mobile' => $params['mobile']?:'', |
| | | 'branch_id' => $params['branch_id']?:0, |
| | | 'app_id' => self::$app_id, |
| | | ]; |
| | | // 如果是帮朋友报名,把用户信息记录下来 |
| | |
| | | $data['reg_user_id'] = $user['user_id']; // 记录是谁帮注册的,因为核销的时候会把user_id改为实际报名人的 |
| | | } |
| | | $data['trade_no'] = $data['order_no']; |
| | | $refereeUser=(new UserModel())->where(['real_name'=>$params['recommend_name'],'mobile'=>$params['recommend_mobile']])->find(); |
| | | if ($refereeUser){ |
| | | $data['referee_id']=$refereeUser['user_id']; |
| | | } |
| | | $this->save($data); |
| | | // 如果不需要在线支付 |
| | | if ($data['online_money'] == 0) { |
| | |
| | | } |
| | | return $this; |
| | | } |
| | | public function getRegistrationInformation($user_id) |
| | | public function getRegistrationInformation($user_id,$activity_id=0) |
| | | { |
| | | $list=$this->where('user_id', '=', $user_id) |
| | | ->order('create_time', 'desc')->find(); |
| | | if (!$list){ |
| | | }else{ |
| | | $data=[]; |
| | | if ($list){ |
| | | $branch=(new Branch())->detail($list['branch_id']); |
| | | $data=[ |
| | | 'province_id'=>$list['province_id'], |
| | | 'city_id'=>$list['city_id'], |
| | |
| | | 'mobile'=>$list['mobile'], |
| | | 'branch_id'=>$list['branch_id'], |
| | | 'company'=>$list['company'], |
| | | 'branch_name'=>(new Branch())->detail($list['branch_id'])['name'], |
| | | 'branch_name'=>$branch?$branch['name']:'', |
| | | 'region'=>RegionModel::getNameById($list['province_id']).','.RegionModel::getNameById($list['city_id']).','.RegionModel::getNameById($list['region_id']), |
| | | |
| | | ]; |
| | | } |
| | | |
| | | if($activity_id){ |
| | | $activity=(new ActivityModel())->find($activity_id); |
| | | if ($activity){ |
| | | $data['activity_number']=(new ActivityModel())->where(['branch_id'=>$activity['branch_id'],'category_id'=>$activity['category_id']])->count(); |
| | | } |
| | | } |
| | | return $data; |
| | | } |
| | | public function addMember($activity, $params, $user) |
| | |
| | | use app\common\model\plus\team\Apply as TeamApplyModel; |
| | | use app\common\model\plus\shareholder\Apply as ShareholderApplyModel; |
| | | use app\common\model\plus\agent\Grade as AgentGradeModel; |
| | | |
| | | use app\common\model\branch\ActivityUser as ActivityUserModel; |
| | | use app\common\model\plus\agent\Referee as refereeModel; |
| | | /** |
| | | * 分销商用户模型 |
| | | */ |
| | |
| | | 'app_id' => $model::$app_id, |
| | | 'grade_id' => AgentGradeModel::getDefaultGradeId() |
| | | ], $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); |
| | | } |
| | | } |
| | | } |
| | | event('AgentUserGrade', $model['referee_id']); |
| | | return true; |
| | | } |
| | |
| | | { |
| | | $model = new static; |
| | | if (!Cache::get('category_' . $model::$app_id)) { |
| | | $data = $model->with(['images'])->order(['sort' => 'asc', 'create_time' => 'asc'])->select(); |
| | | $data = $model->with(['images'])->where(['shop_supplier_id'=>0])->order(['sort' => 'asc', 'create_time' => 'asc'])->select(); |
| | | $all = !empty($data) ? $data->toArray() : []; |
| | | $tree = []; |
| | | foreach ($all as $first) { |
| | |
| | | */ |
| | | public static function getCacheTree() |
| | | { |
| | | return self::getALL()['tree']; |
| | | } |
| | | public static function getCacheTreeShop($shop_supplier_id=0) |
| | | { |
| | | if ($shop_supplier_id){ |
| | | return self::getSupplierCacheTree($shop_supplier_id); |
| | | } |
| | | return self::getALL()['tree']; |
| | | } |
| | | |
| | |
| | | { |
| | | return $this->field(['category_id', 'name', 'parent_id'])->where('category_id', 'in', $ids)->select(); |
| | | } |
| | | /** |
| | | * 所有分类(商户) |
| | | */ |
| | | public static function getSupplierALL($shop_supplier_id) |
| | | { |
| | | $model = new static; |
| | | if (!Cache::get('category_supplier_' . $shop_supplier_id)) { |
| | | $data = $model->with(['images']) |
| | | ->where('shop_supplier_id','in',[0,$shop_supplier_id]) |
| | | ->order(['sort' => 'asc', 'create_time' => 'asc'])->select(); |
| | | $all = !empty($data) ? $data->toArray() : []; |
| | | $tree = []; |
| | | foreach ($all as $first) { |
| | | if ($first['parent_id'] != 0) continue; |
| | | $twoTree = []; |
| | | foreach ($all as $two) { |
| | | if ($two['parent_id'] != $first['category_id']) continue; |
| | | $threeTree = []; |
| | | foreach ($all as $three) |
| | | $three['parent_id'] == $two['category_id'] |
| | | && $threeTree[$three['category_id']] = $three; |
| | | !empty($threeTree) && $two['child'] = $threeTree; |
| | | array_push($twoTree, $two); |
| | | } |
| | | if (!empty($twoTree)) { |
| | | $temp_two_tree = array_column($twoTree, 'sort'); |
| | | array_multisort($temp_two_tree, SORT_ASC, $twoTree); |
| | | $first['child'] = $twoTree; |
| | | } |
| | | array_push($tree, $first); |
| | | } |
| | | Cache::tag('cache')->set('category_supplier_' .$shop_supplier_id, compact('all', 'tree')); |
| | | } |
| | | return Cache::get('category_supplier_' . $shop_supplier_id); |
| | | } |
| | | |
| | | /** |
| | | * 获取所有分类 |
| | | */ |
| | | public static function getSupplierCacheAll($shop_supplier_id) |
| | | { |
| | | return self::getSupplierALL($shop_supplier_id)['all']; |
| | | } |
| | | |
| | | /** |
| | | * 获取所有分类(树状结构) |
| | | */ |
| | | public static function getSupplierCacheTree($shop_supplier_id) |
| | | { |
| | | return self::getSupplierALL($shop_supplier_id)['tree']; |
| | | } |
| | | |
| | | /** |
| | | * 获取所有分类(树状结构) |
| | | * @return string |
| | | */ |
| | | public static function getSupplierCacheTreeJson($shop_supplier_id) |
| | | { |
| | | return json_encode(static::getSupplierCacheTree($shop_supplier_id)); |
| | | } |
| | | /** |
| | | * 获取所有一级分类 |
| | | */ |
| | | public static function getSupplierFirstCategory($shop_supplier_id) |
| | | { |
| | | return (new static())->where('parent_id', '=', 0) |
| | | ->where('shop_supplier_id', '=', $shop_supplier_id) |
| | | ->order(['sort' => 'asc', 'create_time' => 'asc']) |
| | | ->select(); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 关联商品多分类表 |
| | | */ |
| | | public function categorys() |
| | | { |
| | | return $this->hasMany('app\\common\\model\\product\\ProductCategory', 'product_id', 'product_id'); |
| | | } |
| | | |
| | | /** |
| | | * 关联商品多分类表 |
| | | */ |
| | | public function category_ids() |
| | | { |
| | | return $this->hasMany('app\\common\\model\\product\\ProductCategory', 'product_id', 'product_id'); |
| | | } |
| | | |
| | | /** |
| | | * 关联商品分类表 |
| | | */ |
| | | public function category() |
| | |
| | | $model = $this; |
| | | if ($params['category_id'] > 0) { |
| | | $arr = Category::getSubCategoryId($params['category_id']); |
| | | $model = $model->where('product.category_id', 'IN', $arr); |
| | | $productIds = ProductCategory::getProductIds($params['category_id']); |
| | | if ($productIds) { |
| | | $model = $model->whereRaw('product.category_id in (' . implode(',', $arr) . ') OR product_id in (' . implode(',', $productIds) . ')'); |
| | | } else { |
| | | $model = $model->where('product.category_id', 'IN', $arr); |
| | | } |
| | | } |
| | | if (!empty($params['product_name'])) { |
| | | $model = $model->where('product_name', 'like', '%' . trim($params['product_name']) . '%'); |
| | |
| | | if($product['verify_type'] == 20){ |
| | | $product['verify_time'] = [date('Y-m-d H:i:s', $product['verify_start_time']), date('Y-m-d H:i:s', $product['verify_end_time'])]; |
| | | } |
| | | // 商品多分类 by lyzflash |
| | | $product['category_ids'] = []; |
| | | if (!$product['categorys']->isEmpty()) { |
| | | $product['category_ids'] = helper::getArrayColumn($product['categorys'], 'category_id'); |
| | | $product['category_names'] = implode('、', helper::getArrayColumn((new Category)->getListByIds($product['category_ids']), 'name')); |
| | | } else { |
| | | // 兼容没有多分类前的数据 by lyzflash |
| | | if ($product['category_id']) { |
| | | $product['category_ids'] = [$product['category_id']]; |
| | | } |
| | | } |
| | | // 回调函数 |
| | | is_callable($callback) && call_user_func($callback, $product); |
| | | } |
| | |
| | | 'supplier.logo', |
| | | 'video', |
| | | 'poster', |
| | | 'categorys.category', |
| | | 'contentImage.file', |
| | | ])->where('product_id', '=', $product_id) |
| | | ->find(); |
| New file |
| | |
| | | <?php |
| | | |
| | | namespace app\common\model\product; |
| | | |
| | | use app\common\model\BaseModel; |
| | | |
| | | /** |
| | | * 商品多分类模型 |
| | | */ |
| | | class ProductCategory extends BaseModel |
| | | { |
| | | protected $name = 'product_category'; |
| | | protected $pk = 'product_category_id'; |
| | | |
| | | /** |
| | | * 关联商品分类表 |
| | | */ |
| | | public function category() |
| | | { |
| | | return $this->belongsTo('app\\common\\model\\product\\Category', 'categary_id', 'categary_id'); |
| | | } |
| | | |
| | | /** |
| | | * 根据 |
| | | */ |
| | | public static function getProductIds($category_id) |
| | | { |
| | | return (new self)->where('category_id', '=', $category_id)->column('product_id'); |
| | | } |
| | | |
| | | /** |
| | | * 根据多个分类获取商品 |
| | | */ |
| | | public static function getProductIdsByCategorys($category_ids) |
| | | { |
| | | return (new self)->where('category_id', 'in', $category_ids)->column('product_id'); |
| | | } |
| | | |
| | | /** |
| | | * 获取商品所有分类 |
| | | */ |
| | | public static function getProductCategoryIds($product_id) |
| | | { |
| | | return (new ProductCategory)->where('product_id', '=', $product_id) |
| | | ->column('category_id'); |
| | | } |
| | | } |
| New file |
| | |
| | | <?php |
| | | |
| | | namespace app\shop\controller\product; |
| | | |
| | | use app\common\model\product\ProductCategory as ProductCategoryModel; |
| | | |
| | | /** |
| | | * 商品多分类模型 |
| | | */ |
| | | class ProductCategory extends ProductCategoryModel |
| | | { |
| | | /** |
| | | * 添加商品分类关系记录 |
| | | */ |
| | | public function addCategoryList($product_id, $category_ids) |
| | | { |
| | | $data = []; |
| | | $model = new self; |
| | | foreach ($category_ids as $item) { |
| | | $data[] = [ |
| | | 'product_id' => $product_id, |
| | | 'category_id' => $item, |
| | | 'app_id' => self::$app_id, |
| | | ]; |
| | | } |
| | | count($data) > 0 && $model->saveAll($data); |
| | | } |
| | | |
| | | /** |
| | | * 移除指定商品的所有分类 |
| | | */ |
| | | public function removeAll($product_id) |
| | | { |
| | | $model = new self; |
| | | return $model->where('product_id','=', $product_id)->delete(); |
| | | } |
| | | |
| | | } |
| | |
| | | namespace app\shop\model\product; |
| | | |
| | | use app\common\model\product\Product as ProductModel; |
| | | use app\shop\controller\product\ProductCategory; |
| | | use app\shop\service\ProductService; |
| | | use app\common\library\helper; |
| | | /** |
| | |
| | | |
| | | $data['grade_ids'] = implode(',', $data['grade_ids']); |
| | | $data['app_id'] = $data['sku']['app_id'] = self::$app_id; |
| | | if ($data['category_ids']) { |
| | | $data['category_id'] = $data['category_ids'][0]; // 从商品多分类中获取第一个作为主分类 by lyzflash |
| | | } |
| | | // 开启事务 |
| | | $this->startTrans(); |
| | | try { |
| | |
| | | if($data['is_picture'] == 1){ |
| | | $this->addProductContentImages($data['contentImage']); |
| | | } |
| | | // 保存商品多分类 |
| | | $data['category_ids'] && $this->saveProductCategorys($data['category_ids']); |
| | | $this->commit(); |
| | | return true; |
| | | } catch (\Exception $e) { |
| | |
| | | $this->rollback(); |
| | | return false; |
| | | } |
| | | } |
| | | /** |
| | | * 添加商品多分类 by lzyflash 2023.06.15 |
| | | */ |
| | | private function saveProductCategorys($data) |
| | | { |
| | | // 先删除所有分类 |
| | | $model = new ProductCategory; |
| | | $model->removeAll($this['product_id']); |
| | | $model->addCategoryList($this['product_id'], $data); |
| | | } |
| | | |
| | | /** |
| | |
| | | $data['grade_ids'] = implode(',', $data['grade_ids']); |
| | | $data['app_id'] = $data['sku']['app_id'] = self::$app_id; |
| | | $productSkuIdList = helper::getArrayColumn(($this['sku']), 'product_sku_id'); |
| | | // 获取分类 by lyzflash 2023.06.15 |
| | | if ($data['category_ids']) { |
| | | $data['category_id'] = $data['category_ids'][0]; // 从商品多分类中获取第一个作为主分类 by lyzflash |
| | | } |
| | | return $this->transaction(function () use ($data, $productSkuIdList) { |
| | | // 审核商品 |
| | | if($data['submit_type'] == 'edit'){ |
| | | unset($data['audit_status']); |
| | | } |
| | | |
| | | |
| | | $this->save($data); |
| | | // 商品规格 |
| | | $this->addProductSpec($data, true, $productSkuIdList); |
| | |
| | | } |
| | | // 店铺商品总销量 |
| | | $this->reSupplierTotalSales($this['shop_supplier_id']); |
| | | // 保存商品多分类 |
| | | $data['category_ids'] && $this->saveProductCategorys($data['category_ids']); |
| | | return true; |
| | | }); |
| | | } |
| | |
| | | if (isset($data['spec_type']) && $data['spec_type'] == '10' && isset($data['sku']['weight'])) { |
| | | $data['product_weight'] = $data['sku']['weight']; |
| | | } |
| | | // 获取分类 by lyzflash 2023.06.15 |
| | | if ($data['category_ids']) { |
| | | $data['category_id'] = $data['category_ids'][0]; // 从商品多分类中获取第一个作为主分类 by lyzflash |
| | | } |
| | | |
| | | $this->processContent($data); |
| | | // 开启事务 |
| | |
| | | if($data['is_picture'] == 1){ |
| | | $this->addProductContentImages($data['contentImage']); |
| | | } |
| | | // 保存商品多分类 |
| | | $data['category_ids'] && $this->saveProductCategorys($data['category_ids']); |
| | | $this->commit(); |
| | | return true; |
| | | } catch (\Exception $e) { |
| | |
| | | $this->rollback(); |
| | | return false; |
| | | } |
| | | } |
| | | /** |
| | | * 添加商品多分类 by lzyflash 2023.06.15 |
| | | */ |
| | | private function saveProductCategorys($data) |
| | | { |
| | | // 先删除所有分类 |
| | | $model = new ProductCategory; |
| | | $model->removeAll($this['product_id']); |
| | | $model->addCategoryList($this['product_id'], $data); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (isset($data['spec_type']) && $data['spec_type'] == '10' && isset($data['sku']['weight'])) { |
| | | $data['product_weight'] = $data['sku']['weight']; |
| | | } |
| | | // 获取分类 by lyzflash 2023.06.15 |
| | | if ($data['category_ids']) { |
| | | $data['category_id'] = $data['category_ids'][0]; // 从商品多分类中获取第一个作为主分类 by lyzflash |
| | | } |
| | | $productSkuIdList = helper::getArrayColumn(($this['sku']), 'product_sku_id'); |
| | | return $this->transaction(function () use ($data, $productSkuIdList) { |
| | | // 商品状态,如果已审核过的,看平台配置是否需要再次审核 |
| | |
| | | if($data['is_picture'] == 1){ |
| | | $this->addProductContentImages($data['contentImage']); |
| | | } |
| | | // 保存商品多分类 |
| | | $data['category_ids'] && $this->saveProductCategorys($data['category_ids']); |
| | | return true; |
| | | }); |
| | | } |
| New file |
| | |
| | | <?php |
| | | |
| | | namespace app\supplier\model\product; |
| | | |
| | | use app\common\model\product\ProductCategory as ProductCategoryModel; |
| | | |
| | | /** |
| | | * 商品多分类模型 |
| | | */ |
| | | class ProductCategory extends ProductCategoryModel |
| | | { |
| | | /** |
| | | * 添加商品分类关系记录 |
| | | */ |
| | | public function addCategoryList($product_id, $category_ids) |
| | | { |
| | | $data = []; |
| | | $model = new self; |
| | | foreach ($category_ids as $item) { |
| | | $data[] = [ |
| | | 'product_id' => $product_id, |
| | | 'category_id' => $item, |
| | | 'app_id' => self::$app_id, |
| | | ]; |
| | | } |
| | | count($data) > 0 && $model->saveAll($data); |
| | | } |
| | | |
| | | /** |
| | | * 移除指定商品的所有分类 |
| | | */ |
| | | public function removeAll($product_id) |
| | | { |
| | | $model = new self; |
| | | return $model->where('product_id','=', $product_id)->delete(); |
| | | } |
| | | |
| | | } |
| | |
| | | public function setDefault() |
| | | { |
| | | $this->save(['is_default' => 1]); |
| | | $this->where('page_id', '<>', $this['page_id'])->update(['is_default' => 0]); |
| | | $this->where('page_id', '<>', $this['page_id'])->where(['shop_supplier_id'=>$this['shop_supplier_id']])->update(['is_default' => 0]); |
| | | return true; |
| | | } |
| | | |
| | |
| | | public static function getEditData($model = null, $scene = 'edit', $shop_supplier_id) |
| | | { |
| | | // 商品分类 |
| | | $category = CategoryModel::getCacheAll(); |
| | | $category = CategoryModel::getCacheTreeShop($shop_supplier_id); |
| | | // 配送模板 |
| | | $delivery = DeliveryModel::getAll($shop_supplier_id); |
| | | // 商品sku数据 |
| | |
| | | |
| | | onReg(e) { |
| | | this.$refs.regForm.activityData = this.activityData; |
| | | this.$refs.regForm.branch_name = this.activityData.branch.name; |
| | | this.$refs.regForm.formData.branch_id = this.activityData.branch_id; |
| | | /* this.$refs.regForm.branch_name = this.activityData.branch.name; |
| | | this.$refs.regForm.formData.branch_id = this.activityData.branch_id; */ |
| | | this.is_friend = e; |
| | | if (this.activityData.fee > 0 || e || !this.activityData.is_member) { |
| | | this.isOpenReg = true; |
| | |
| | | <view class="tips f28 p20 radius12 friend" v-if="is_friend"><text class="iconfont icon-gantanhao mr10"></text>您正在帮朋友报名,以下信息请填写您朋友的信息</view> --> |
| | | <view class="common-form">报名信息</view> |
| | | <view class="item d-s-c"> |
| | | <view class="item-name">走访活动编号</view> |
| | | <input type="text" maxlength="30" class="flex-1 f28" placeholder="请输入走访活动编号" |
| | | v-model="formData.real_name" placeholder-class="placeholder" /> |
| | | <view class="item-name">活动编号</view> |
| | | <input type="text" maxlength="30" class="flex-1 f28" placeholder="请输入活动编号" |
| | | v-model="formData.activity_number" placeholder-class="placeholder" /> |
| | | </view> |
| | | <view class="item d-s-c"> |
| | | <view class="item-name">真实姓名</view> |
| | |
| | | province_id: 0, |
| | | city_id: 0, |
| | | region_id: 0, |
| | | activity_number:'' |
| | | }, |
| | | /*尺寸比例*/ |
| | | ratio: 1, |
| | |
| | | }, |
| | | getRegistrationInformation() { |
| | | let self = this; |
| | | self._get('branch.activity/getRegistrationInformation', {}, function(res) { |
| | | self._get('branch.activity/getRegistrationInformation', {activity_id:self.activityData.activity_id}, function(res) { |
| | | if (res.data.registrationInformation) { |
| | | let data=res.data.registrationInformation; |
| | | self.formData.province_id = data.province_id; |
| | |
| | | self.formData.mobile = data.mobile; |
| | | self.formData.branch_id = data.branch_id; |
| | | self.formData.company = data.company; |
| | | self.formData.activity_number = data.activity_number; |
| | | self.selectCity = res.data.registrationInformation.region; |
| | | if (res.data.registrationInformation.branch_name) { |
| | | self.branch_name = res.data.registrationInformation.branch_name; |
| | |
| | | </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="gray9">报名时间:{{ item.create_time }}</view> |
| | | </view> |
| | | <view class="f26"> |
| | |
| | | listData: [] |
| | | } |
| | | }, |
| | | created() { |
| | | // 获取注册/登录方式 by lyzflash |
| | | this.getRegisterSetting(); |
| | | }, |
| | | onShow(){ |
| | | //wx.login(); //重新登录 |
| | | }, |
| | |
| | | </scroll-view> |
| | | </view> |
| | | <view class="category-content pr"> |
| | | <scroll-view scroll-y="true" 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))"> |
| | |
| | | specPopupVisible: false, |
| | | selectedProduct: null, |
| | | selectedSpecs: [], |
| | | quantity: 1 |
| | | quantity: 1, |
| | | page:1, |
| | | last_page:1, |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | _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; |
| | | }); |
| | | }, |
| | | |
| | |
| | | }, |
| | | /*获取商品数据*/ |
| | | getProductData(e) { |
| | | if(this.select_index!=e){ |
| | | this.page=1 |
| | | } |
| | | this.select_index = e; |
| | | this.productData=[]; |
| | | let self = this; |
| | |
| | | self.city_supplier_ids=resData.supplier_ids; |
| | | city_supplier_ids = self.city_supplier_ids.join(",") |
| | | } |
| | | let page = 1; |
| | | let page = self.page;; |
| | | let list_rows = 10; |
| | | let category_id =this.listData[e].category_id; |
| | | let search = ''; |
| | |
| | | }, 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; |
| | | }); |
| | | }, |
| | |
| | | '&search=' + search + |
| | | '&sortPrice=' + sortPrice); |
| | | }, |
| | | 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; |
| | | self._get('product.product/lists', params, function(res) { |
| | | self.isloadding = false; |
| | | self.productData = self.productData.concat(res.data.list.data); |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | |
| | | wxGetUserInfo: function(res) { |
| | | if (!res.detail.iv) { |
| | |
| | | specPopupVisible: false, |
| | | selectedProduct: null, |
| | | selectedSpecs: [], |
| | | page:1, |
| | | last_page:1, |
| | | quantity: 1 |
| | | }; |
| | | }, |
| | |
| | | _this.catename = _this.listData[0].name; |
| | | _this.background = res.data.background; |
| | | _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.isloadding = false; |
| | | }); |
| | |
| | | }, |
| | | /*获取商品数据*/ |
| | | getProductData(e) { |
| | | if(this.select_index!=e){ |
| | | this.page=1 |
| | | } |
| | | this.select_index = e; |
| | | this.productData=[]; |
| | | let self = this; |
| | |
| | | sortType: sortType, |
| | | sortPrice: sortPrice, |
| | | list_rows: list_rows, |
| | | city_supplier_ids:city_supplier_ids |
| | | 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; |
| | | }); |
| | | }, |
| | | 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; |
| | | self._get('product.product/lists', params, function(res) { |
| | | self.isloadding = false; |
| | | self.productData = self.productData.concat(res.data.list.data); |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | /*跳转产品列表*/ |
| | | gotoList2(e) { |
| | | let url = 'pages/product/detail/detail?product_id=' + e |
| | |
| | | <template> |
| | | <view class="weidian" v-if="store_open"> |
| | | <view class="weidian_head"> |
| | | <!-- #ifdef MP-WEIXIN || APP-PLUS --> |
| | | <view class="ww100" :style="'height:'+topBarTop()+'px;'"></view> |
| | | <view class="tc head_top" :style="topBarHeight() == 0 ? '': 'height:'+topBarHeight()+'px;'"> |
| | | <view class="reg180" @click="goback"><text class="icon iconfont icon-jiantou"></text></view> |
| | | <view class="fb">我的店铺</view> |
| | | </view> |
| | | <!-- #endif --> |
| | | <view> |
| | | <view class="weidian_head_body_bottom"> |
| | | <view class="weidian_head_body_bottom_item" @click="onGotoPage('pages/user/my_shop/cash/list/list')"> |
| | | <view class="f24 gray3 mb20">累计提现(元)</view> |
| | | <text class="f36 gray3 fb">{{shop_data.supplier.cash_money}}</text> |
| | | </view> |
| | | <view class="weidian_head_body_bottom_item" @click="onGotoPage('pages/user/my-wallet/my-supplier-balance')"> |
| | | <view class="f24 gray3 mb20">累计成交(笔)</view> |
| | | <text class="f36 gray3 fb">{{shop_data.totalCount}}</text> |
| | | </view> |
| | | <view class="weidian_head_body_bottom_item"> |
| | | <view class="f24 gray3 mb20">今日成交(笔)</view> |
| | | <text class="f36 gray3 fb">{{shop_data.todayCount}}</text> |
| | | </view> |
| | | <view class="weidian_head_body_bottom_item" @click="onGotoPage('pages/user/my_shop/cash/apply/apply')"> |
| | | <view class="f24 gray3 mb20">可提现</view> |
| | | <text class="f36 gray3 fb">{{shop_data.supplier.money}}</text> |
| | | </view> |
| | | <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> |
| | | <view class="tc head_top" :style="topBarHeight() == 0 ? '': 'height:'+topBarHeight()+'px;'"> |
| | | <view class="reg180" @click="goback"><text class="icon iconfont icon-jiantou"></text></view> |
| | | <view class="fb">我的店铺</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="weidian_body"> |
| | | <view class="seller_center_body_order"> |
| | | <view class="seller_center_body_order_head"> |
| | | <text class="f32 gray3 fb">我的订单</text> |
| | | <text class="seller_center_body_order_head_more" @click="jumpPage('/pages/user/my_shop/my_shop_order?fill=1')">全部订单<text |
| | | class="icon iconfont icon-jiantou f24"></text></text> |
| | | </view> |
| | | <view class="seller_center_body_order_body"> |
| | | <view class="seller_center_body_order_body_item" v-for="(item,index) in order_menu_list" :key="index"> |
| | | <view @click="jumpPage(item.url)"> |
| | | <image :src="item.image" mode=""></image> |
| | | <view class="f26 gray3">{{item.title}}</view> |
| | | <!-- #endif --> |
| | | <view> |
| | | <view class="weidian_head_body_bottom"> |
| | | <view class="weidian_head_body_bottom_item" |
| | | @click="onGotoPage('pages/user/my_shop/cash/list/list')"> |
| | | <view class="f24 gray3 mb20">累计提现(元)</view> |
| | | <text class="f36 gray3 fb">{{shop_data.supplier.cash_money}}</text> |
| | | </view> |
| | | <view class="weidian_head_body_bottom_item" |
| | | @click="onGotoPage('pages/user/my-wallet/my-supplier-balance')"> |
| | | <view class="f24 gray3 mb20">累计成交(笔)</view> |
| | | <text class="f36 gray3 fb">{{shop_data.totalCount}}</text> |
| | | </view> |
| | | <view class="weidian_head_body_bottom_item"> |
| | | <view class="f24 gray3 mb20">今日成交(笔)</view> |
| | | <text class="f36 gray3 fb">{{shop_data.todayCount}}</text> |
| | | </view> |
| | | <view class="weidian_head_body_bottom_item" |
| | | @click="onGotoPage('pages/user/my_shop/cash/apply/apply')"> |
| | | <view class="f24 gray3 mb20">可提现</view> |
| | | <text class="f36 gray3 fb">{{shop_data.supplier.money}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="weidian_body_menu_list"> |
| | | <view class="weidian_body_menu_list_item" v-for="(item,index) in menu_list" :key="index" @click="jumpPage(item.url)"> |
| | | <view class="weidian_body_menu_list_left_icon"> |
| | | <image class="left_iconimg" :src="item.left_icon" mode=""></image> |
| | | <view class="weidian_body"> |
| | | <view class="seller_center_body_order"> |
| | | <view class="seller_center_body_order_head"> |
| | | <text class="f32 gray3 fb">我的订单</text> |
| | | <text class="seller_center_body_order_head_more" |
| | | @click="jumpPage('/pages/user/my_shop/my_shop_order?fill=1')">全部订单<text |
| | | class="icon iconfont icon-jiantou f24"></text></text> |
| | | </view> |
| | | <view class="weidian_body_menu_list_title_left">{{item.title_left}}</view> |
| | | <view class="weidian_body_menu_list_right_icon icon iconfont icon-jiantou"></view> |
| | | <view class="weidian_body_menu_list_title_right"></view> |
| | | </view> |
| | | <view class="weidian_body_menu_list_item"> |
| | | <view class="weidian_body_menu_list_left_icon"> |
| | | <image class="left_iconimg" src="../../../static/icon/store_deposit.png" mode=""></image> |
| | | <view class="seller_center_body_order_body"> |
| | | <view class="seller_center_body_order_body_item" v-for="(item,index) in order_menu_list" |
| | | :key="index"> |
| | | <view @click="jumpPage(item.url)"> |
| | | <image :src="item.image" mode=""></image> |
| | | <view class="f26 gray3">{{item.title}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="weidian_body_menu_list_title_left">店铺保证金</view> |
| | | <view class="weidian_body_menu_list_right_icon icon iconfont icon-jiantou"></view> |
| | | <view class="weidian_body_menu_list_title_right" v-if="shop_data.supplier.status==10">申请退出中</view> |
| | | <view class="weidian_body_menu_list_title_right" v-if="shop_data.supplier.status==0" @click="requestForWithdrawal">申请退出</view> |
| | | <view class="weidian_body_menu_list_title_right" v-if="shop_data.supplier.status==20" @click="gotoPay">立即交纳</view> |
| | | </view> |
| | | <view v-if="is_open==1" class="weidian_body_menu_list_item" @click="toLive"> |
| | | <view class="weidian_body_menu_list_left_icon"> |
| | | <image class="left_iconimg" src="../../../static/icon/store_live.png" mode=""></image> |
| | | <view class="weidian_body_menu_list"> |
| | | <view class="weidian_body_menu_list_item" v-for="(item,index) in menu_list" :key="index" |
| | | @click="jumpPage(item.url)"> |
| | | <view class="weidian_body_menu_list_left_icon"> |
| | | <image class="left_iconimg" :src="item.left_icon" mode=""></image> |
| | | </view> |
| | | <view class="weidian_body_menu_list_title_left">{{item.title_left}}</view> |
| | | <view class="weidian_body_menu_list_right_icon icon iconfont icon-jiantou"></view> |
| | | <view class="weidian_body_menu_list_title_right"></view> |
| | | </view> |
| | | <view class="weidian_body_menu_list_title_left">我的直播</view> |
| | | <view class="weidian_body_menu_list_right_icon icon iconfont icon-jiantou"></view> |
| | | </view> |
| | | <!-- <view class="weidian_body_menu_list_item" @click="gotoPage('/pages/plus/chat/supplier_chat_list')"> |
| | | <view class="weidian_body_menu_list_item"> |
| | | <view class="weidian_body_menu_list_left_icon"> |
| | | <image class="left_iconimg" src="../../../static/icon/store_deposit.png" mode=""></image> |
| | | </view> |
| | | <view class="weidian_body_menu_list_title_left">店铺保证金</view> |
| | | <view class="weidian_body_menu_list_right_icon icon iconfont icon-jiantou"></view> |
| | | <view class="weidian_body_menu_list_title_right" v-if="shop_data.supplier.status==10">申请退出中 |
| | | </view> |
| | | <view class="weidian_body_menu_list_title_right" v-if="shop_data.supplier.status==0" |
| | | @click="requestForWithdrawal">申请退出</view> |
| | | <view class="weidian_body_menu_list_title_right" v-if="shop_data.supplier.status==20" |
| | | @click="gotoPay">立即交纳</view> |
| | | </view> |
| | | <view v-if="is_open==1" class="weidian_body_menu_list_item" @click="toLive"> |
| | | <view class="weidian_body_menu_list_left_icon"> |
| | | <image class="left_iconimg" src="../../../static/icon/store_live.png" mode=""></image> |
| | | </view> |
| | | <view class="weidian_body_menu_list_title_left">我的直播</view> |
| | | <view class="weidian_body_menu_list_right_icon icon iconfont icon-jiantou"></view> |
| | | </view> |
| | | <!-- <view class="weidian_body_menu_list_item" @click="gotoPage('/pages/plus/chat/supplier_chat_list')"> |
| | | <view class="weidian_body_menu_list_left_icon"> |
| | | <image class="left_iconimg" src="../../../static/icon/store_live.png" mode=""></image> |
| | | </view> |
| | |
| | | <view class="weidian_body_menu_list_right_icon icon iconfont icon-jiantou"></view> |
| | | <view class="weidian_body_menu_list_title_right">{{msg_count}}</view> |
| | | </view> --> |
| | | <view class="weidian_body_menu_list_item" @click="gotoPage('/pages/user/my_shop/member/member')"> |
| | | <view class="weidian_body_menu_list_left_icon"> |
| | | <image class="left_iconimg" src="../../../static/icon/commodity_management.png" mode=""></image> |
| | | <view class="weidian_body_menu_list_item" @click="gotoPage('/pages/user/my_shop/member/member')"> |
| | | <view class="weidian_body_menu_list_left_icon"> |
| | | <image class="left_iconimg" src="../../../static/icon/commodity_management.png" mode=""> |
| | | </image> |
| | | </view> |
| | | <view class="weidian_body_menu_list_title_left">激活年卡</view> |
| | | <view class="weidian_body_menu_list_right_icon icon iconfont icon-jiantou"></view> |
| | | <view class="weidian_body_menu_list_title_right"> |
| | | {{member?member.plan_name+' '+member.expire_time_text:''}} |
| | | </view> |
| | | </view> |
| | | <view class="weidian_body_menu_list_title_left">激活年卡</view> |
| | | <view class="weidian_body_menu_list_right_icon icon iconfont icon-jiantou"></view> |
| | | <view class="weidian_body_menu_list_title_right">{{member?member.plan_name+' '+member.expire_time_text:''}}</view> |
| | | <view class="weidian_body_menu_list_item" @click="gotoPage('/pages/user/my_shop/my_shop_password')"> |
| | | <view class="weidian_body_menu_list_left_icon"> |
| | | <image class="left_iconimg" src="../../../static/icon/store_pwd.png" mode=""></image> |
| | | </view> |
| | | <view class="weidian_body_menu_list_title_left">修改密码</view> |
| | | <view class="weidian_body_menu_list_right_icon icon iconfont icon-jiantou"></view> |
| | | <view class="weidian_body_menu_list_title_right">修改PC端登录密码</view> |
| | | </view> |
| | | </view> |
| | | <view class="weidian_body_menu_list_item" @click="gotoPage('/pages/user/my_shop/my_shop_password')"> |
| | | <view class="weidian_body_menu_list_left_icon"> |
| | | <image class="left_iconimg" src="../../../static/icon/store_pwd.png" mode=""></image> |
| | | </view> |
| | | </view> |
| | | <view style="background-color: #f6f6f6;" v-else> |
| | | |
| | | <!-- #ifdef MP-WEIXIN || APP-PLUS --> |
| | | <view class="ww100" :style="'height:'+topBarTop()+'px;'"></view> |
| | | <view class="tc head_top" :style="topBarHeight() == 0 ? '': 'height:'+topBarHeight()+'px;'"> |
| | | <view class="reg180" @click="goback"><text class="icon iconfont icon-jiantou"></text></view> |
| | | <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="weidian_body_menu_list_title_left">修改密码</view> |
| | | <view class="weidian_body_menu_list_right_icon icon iconfont icon-jiantou"></view> |
| | | <view class="weidian_body_menu_list_title_right">修改PC端登录密码</view> |
| | | <view class="package-body"> |
| | | <view class="package-description">{{ item.particulars }}</view> |
| | | <view class="package-expiry">有效期:{{ item.duration }}天</view> |
| | | </view> |
| | | </view> |
| | | <view class="buy-button-container"> |
| | | <button class="buy-button" @click="buyMemberPackage">立即购买</button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | is_open: 0, |
| | | is_full: 0, |
| | | statusBarHeight: 0, |
| | | titleBarHeight:0, |
| | | titleBarHeight: 0, |
| | | msg_count: 0, |
| | | member:{}, |
| | | member: {}, |
| | | // 是否显示店铺信息 by lyzflash |
| | | store_open: false |
| | | store_open: false, |
| | | memberPackages: [], |
| | | selectedIndex: 0, |
| | | category: {}, |
| | | loading: true |
| | | } |
| | | }, |
| | | onShow() { |
| | |
| | | }, |
| | | onLoad() { |
| | | this.GetStatusBarHeight(); |
| | | this.getMemberPlans(); |
| | | this.getData(); |
| | | }, |
| | | methods: { |
| | | methods: {// 获取年卡套餐列表 |
| | | getMemberPlans() { |
| | | let self = this; |
| | | self._get('supplier.member/plans', {}, function(res) { |
| | | self.memberPackages = res.data.plans; |
| | | self.loading = false; |
| | | }); |
| | | }, |
| | | /*获取数据*/ |
| | | getData() { |
| | | let self = this; |
| | | self._get('supplier.index/deposit', {}, function(res) { |
| | | self.category = res.data.category; |
| | | }); |
| | | }, |
| | | GetStatusBarHeight() { |
| | | const SystemInfo = uni.getSystemInfoSync(); |
| | | // #ifdef MP-WEIXIN |
| | |
| | | // #endif |
| | | }, |
| | | jumpPage(path) { |
| | | if(path.indexOf('?') != -1){ |
| | | if (path.indexOf('?') != -1) { |
| | | this.gotoPage(path + '&shop_supplier_id=' + this.shop_supplier_id); |
| | | }else{ |
| | | } else { |
| | | this.gotoPage(path + '?shop_supplier_id=' + this.shop_supplier_id); |
| | | } |
| | | }, |
| | |
| | | gotoPay() { |
| | | this.gotoPage('/pages/order/deposit-pay'); |
| | | }, |
| | | requestForWithdrawal(){ |
| | | let self=this; |
| | | requestForWithdrawal() { |
| | | let self = this; |
| | | wx.showModal({ |
| | | title: '提示', |
| | | content: '您确定要申请退出吗?', |
| | |
| | | }, |
| | | toLive() { |
| | | //if (this.is_full == 1) { |
| | | this.gotoPage('/pages/user/my_shop/my_live/my-live/my-live?') |
| | | this.gotoPage('/pages/user/my_shop/my_live/my-live/my-live?') |
| | | /*} else { |
| | | uni.showModal({ |
| | | title: '提示', |
| | |
| | | }) |
| | | }*/ |
| | | }, |
| | | onGotoPage(e){ |
| | | onGotoPage(e) { |
| | | this.gotoPage(e) |
| | | } |
| | | } |
| | |
| | | height: 36rpx; |
| | | display: inline-block; |
| | | } |
| | | </style> |
| | | |
| | | .deposit_bg { |
| | | background-color: #FFFFFF; |
| | | } |
| | | |
| | | .deposit_tit { |
| | | padding: 0 30rpx; |
| | | margin: 20rpx 0; |
| | | height: 94rpx; |
| | | line-height: 94rpx; |
| | | font-size: 32rpx; |
| | | background-color: #FFFFFF; |
| | | border-top: 1rpx solid #efefef; |
| | | } |
| | | .member-package { |
| | | background-color: white; |
| | | border-radius: 10rpx; |
| | | margin-bottom: 20rpx; |
| | | 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; |
| | | } |
| | | |
| | | .package-header.selected { |
| | | background-color: #eef5ff; |
| | | border-left: 10rpx solid #409EFF; |
| | | } |
| | | |
| | | .package-name { |
| | | font-size: 32rpx; |
| | | font-weight: bold; |
| | | color: #333; |
| | | } |
| | | |
| | | .package-price { |
| | | float: right; |
| | | font-size: 36rpx; |
| | | font-weight: bold; |
| | | color: #e43130; |
| | | } |
| | | |
| | | .package-body { |
| | | padding: 30rpx; |
| | | } |
| | | |
| | | .package-description { |
| | | font-size: 28rpx; |
| | | color: #666; |
| | | margin-bottom: 20rpx; |
| | | 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; |
| | | color: white; |
| | | font-size: 32rpx; |
| | | border-radius: 50rpx; |
| | | height: 80rpx; |
| | | line-height: 80rpx; |
| | | margin: auto; |
| | | } |
| | | </style> |
| | |
| | | }) |
| | | .then(() => { |
| | | self.loading = true; |
| | | BranchApi.delete( |
| | | BranchApi.deleteActivity( |
| | | { |
| | | activity_id: e |
| | | activity_id: e.activity_id |
| | | }, |
| | | true |
| | | ) |
| | |
| | | product_name: '', |
| | | /*商品分类*/ |
| | | category_id: null, |
| | | category_ids: null, |
| | | /*商品图片*/ |
| | | image: [], |
| | | /*商品卖点*/ |
| | |
| | | /*商品名称*/ |
| | | product_name: '', |
| | | /*商品分类*/ |
| | | category_ids: [], |
| | | category_id: null, |
| | | /*商品图片*/ |
| | | image: [], |
| | |
| | | <el-form-item label="商品名称:" :rules="[{ required: true, message: '请填写商品名称' }]" prop="model.product_name"> |
| | | <el-input v-model="form.model.product_name" class="max-w460"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="所属分类:" :rules="[{ required: true, message: '你选择商品分类' }]" prop="model.category_id"> |
| | | <el-select v-model="form.model.category_id"> |
| | | <!--<el-form-item label="所属分类:" :rules="[{ required: true, message: '你选择商品分类' }]" prop="model.category_id"> |
| | | <el-select v-model="form.model.category_id" multiple> |
| | | <template v-for="cat in form.category"> |
| | | <el-option :value="cat.category_id" :key="cat.category_id" :label="cat.name"></el-option> |
| | | <template v-if="cat.child !== undefined" v-for="two in cat.child"> |
| | | <el-option :value="two.category_id" :key="two.category_id" :label="two.name" style="padding-left: 30px;"></el-option> |
| | | <template v-if="two.child !== undefined" v-for="three in two.child"> |
| | | <el-option :value="three.category_id" :key="three.category_id" :label="three.name" style="padding-left: 60px;"></el-option> |
| | | </template> |
| | | </template> |
| | | </template> |
| | | </el-select> |
| | | </el-form-item>--> |
| | | <el-form-item label="所属分类:" :rules="[{ required: true, message: '请选择商品分类' }]" prop="model.category_ids"> |
| | | <el-select v-model="form.model.category_ids" multiple style="width:460px"> |
| | | <template v-for="cat in form.category" v-if="cat.dish_store_id==dish_store_id"> |
| | | <el-option :value="cat.category_id" :key="cat.category_id" :label="cat.name"></el-option> |
| | | <template v-if="cat.child !== undefined" v-for="two in cat.child"> |
| | | <el-option :value="two.category_id" :key="two.category_id" :label="two.name" style="padding-left: 30px;"></el-option> |
| | |
| | | .draggable-list .img-select i { |
| | | color: #409eff; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | product_no: '', |
| | | /*商品分类*/ |
| | | category_id: null, |
| | | category_ids: null, |
| | | /*商品图片*/ |
| | | image: [], |
| | | is_picture: 0, |
| | |
| | | /*模型数据*/ |
| | | model: { |
| | | supplierName:'', |
| | | category_ids: null, |
| | | /*商品名称*/ |
| | | product_name: '', |
| | | /*商品分类*/ |
| | |
| | | <el-form-item label="商品名称:" :rules="[{ required: true, message: '请填写商品名称' }]" prop="model.product_name"> |
| | | <el-input v-model="form.model.product_name" class="max-w460"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="所属分类:" :rules="[{ required: true, message: '请选择商品分类' }]" prop="model.category_id"> |
| | | <el-form-item label="所属分类:" :rules="[{ required: true, message: '请选择商品分类' }]" prop="model.category_ids"> |
| | | <el-select v-model="form.model.category_ids" multiple style="width:460px"> |
| | | <template v-for="cat in form.category" v-if="cat.dish_store_id==dish_store_id"> |
| | | <el-option :value="cat.category_id" :key="cat.category_id" :label="cat.name"></el-option> |
| | | <template v-if="cat.child !== undefined" v-for="two in cat.child"> |
| | | <el-option :value="two.category_id" :key="two.category_id" :label="two.name" style="padding-left: 30px;"></el-option> |
| | | <template v-if="two.child !== undefined" v-for="three in two.child"> |
| | | <el-option :value="three.category_id" :key="three.category_id" :label="three.name" style="padding-left: 60px;"></el-option> |
| | | </template> |
| | | </template> |
| | | </template> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="所属分类:" :rules="[{ required: true, message: '请选择商品分类' }]" prop="model.category_id"> |
| | | <el-select v-model="form.model.category_id"> |
| | | <template v-for="cat in form.category"> |
| | | <el-option :value="cat.category_id" :key="cat.category_id" :label="cat.name"></el-option> |
| | |
| | | </template> |
| | | </template> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form-item>--> |
| | | <el-form-item v-if="form.is_newcomer" label="归属供应商:" prop="model.belonging_shop_supplier_id"> |
| | | <el-row> |
| | | <el-button @click="openSupplier" icon="el-icon-plus">选择供应商</el-button> |