2 files added
16 files renamed
36 files modified
| | |
| | | $product_num = $data['total_num']; |
| | | $spec_sku_id = $data['spec_sku_id']; |
| | | $model = $this->model; |
| | | $product = ProductModel::detail($product_id); |
| | | if ($product['is_newcomer'] == 1) { |
| | | return $this->renderError('新人专区商品不能加入购物车'); |
| | | } |
| | | if (!$model->add($this->user, $product_id, $product_num, $spec_sku_id)) { |
| | | return $this->renderError($model->getError() ?: '加入购物车失败'); |
| | | } |
| | |
| | | public function index($category_id = 0) |
| | | { |
| | | $model = new ArticleModel; |
| | | $list = $model->getList($category_id, $this->postData()); |
| | | $data = $this->postData(); |
| | | $shop_supplier_id = $data['shop_supplier_id']??-1; |
| | | $list = $model->getList($category_id, $this->postData(),$shop_supplier_id,$shop_supplier_id); |
| | | return $this->renderSuccess('', compact('list')); |
| | | } |
| | | |
| | |
| | | use app\api\controller\Controller; |
| | | use app\api\model\product\Product as ProductModel; |
| | | use app\supplier\service\ProductService; |
| | | use app\api\model\supplier\Supplier as SupplierModel; |
| | | |
| | | /** |
| | | * 供应商产品 |
| | |
| | | $params['shop_supplier_id'] = $this->supplierUser['shop_supplier_id']; |
| | | |
| | | $model = new ProductModel; |
| | | $supplier = SupplierModel::detail($this->supplierUser['shop_supplier_id']); |
| | | $params['is_newcomer'] = $supplier['is_newcomer']; |
| | | $params['is_repurchase'] = $supplier['is_repurchase']; |
| | | if ($model->add($params)) { |
| | | return $this->renderSuccess('添加成功'); |
| | | } |
| | |
| | | if($this->supplierUser['shop_supplier_id'] != $model['shop_supplier_id']){ |
| | | return $this->renderError('非法请求'); |
| | | } |
| | | |
| | | $supplier = SupplierModel::detail($this->supplierUser['shop_supplier_id']); |
| | | $params['is_newcomer'] = $supplier['is_newcomer']; |
| | | $params['is_repurchase'] = $supplier['is_repurchase']; |
| | | if ($model->edit($params)) { |
| | | return $this->renderSuccess('编辑成功'); |
| | | } |
| | |
| | | { |
| | | // 获取文章数据 |
| | | $model = new Article; |
| | | $articleList = $model->getList($item['params']['auto']['category'], $item['params']['auto']['showNum']); |
| | | $articleList = $model->getList($item['params']['auto']['category'], $item['params']['auto']['showNum'],0); |
| | | return $articleList->isEmpty() ? [] : $articleList->toArray()['data']; |
| | | } |
| | | |
| | |
| | | { |
| | | // 获取头条数据 |
| | | $model = new Article; |
| | | $articleList = $model->getList($item['params']['auto']['category'], $item['params']['auto']['showNum']); |
| | | $articleList = $model->getList($item['params']['auto']['category'], $item['params']['auto']['showNum'],0); |
| | | return $articleList->isEmpty() ? [] : $articleList->toArray()['data']; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 获取文章列表 |
| | | */ |
| | | public function getList($category_id = 0, $params) |
| | | public function getList($category_id = 0, $params,$shop_supplier_id=-1) |
| | | { |
| | | $model = $this; |
| | | $shop_supplier_id >= 0 && $model = $model->where('shop_supplier_id', '=', $shop_supplier_id); |
| | | $category_id > 0 && $model = $model->where('category_id', '=', $category_id); |
| | | return $model ->with(['image', 'category']) |
| | | ->where('article_status', '=', 1) |
| | |
| | | public function getDetail($data, $user) |
| | | { |
| | | $detail = $this->alias('s')->where(['shop_supplier_id' => $data['shop_supplier_id']]) |
| | | ->field("name as store_name,shop_supplier_id,logo_id,category_id,server_score,fav_count,user_id,product_sales,address,notice") |
| | | ->field("name as store_name,shop_supplier_id,logo_id,category_id,server_score,fav_count,user_id,product_sales,address,notice,description") |
| | | ->with(['logo', 'category']) |
| | | ->find(); |
| | | if ($detail) { |
| | |
| | | |
| | | namespace app\api\service\order\settled; |
| | | |
| | | use app\api\model\order\OrderProduct; |
| | | use app\common\enum\order\OrderSourceEnum; |
| | | use app\api\model\order\Order as OrderModel; |
| | | /** |
| | |
| | | */ |
| | | public function validateProductList() |
| | | { |
| | | $newcomerNum =(new OrderModel()) |
| | | ->where('is_newcomer', 1)->count(); |
| | | foreach ($this->supplierData as $supplier) { |
| | | foreach ($supplier['productList'] as $product) { |
| | | // 判断商品是否下架 |
| | |
| | | $this->error = "很抱歉,商品 [{$product['product_name']}] 已下架"; |
| | | return false; |
| | | } |
| | | // 判断商品是否下架 |
| | | if ($product['is_newcomer'] == 1 && $product['total_num'] > 1) { |
| | | $this->error = "很抱歉,商品为新人专区商品只能购买1件"; |
| | | return false; |
| | | } |
| | | if ($product['is_newcomer'] == 1 && $newcomerNum > 0) { |
| | | $this->error = "很抱歉,您已购买过新人专区商品,不能购买新人专区商品"; |
| | | return false; |
| | | } |
| | | // 判断商品库存 |
| | | if ($product['total_num'] > $product['product_sku']['stock_num']) { |
| | | $this->error = "很抱歉,商品 [{$product['product_name']}] 库存不足"; |
| | |
| | | 'order_source' => $this->orderSource['source'], |
| | | 'points_bonus' => $supplier['orderData']['points_bonus'], |
| | | 'is_agent' => $this->settledRule['is_agent']? 1:0, |
| | | 'shop_supplier_id' => $supplier['shop_supplier_id'], |
| | | 'shop_supplier_id' => ($supplier['productList'][0]['is_newcomer'] == 0||$supplier['productList'][0]['belonging_shop_supplier_id'] == 0)?$supplier['shop_supplier_id']:$supplier['productList'][0]['belonging_shop_supplier_id'], |
| | | 'supplier_money' => $order['supplier_money'], |
| | | 'is_newcomer' => $supplier['productList'][0]['is_newcomer'], |
| | | 'sys_money' => $order['sys_money'], |
| | | 'app_id' => $this->app_id, |
| | | 'room_id' => $commomOrder['room_id'], |
| | |
| | | 'is_verify' => $product['is_verify'], |
| | | 'verify_type' => $product['verify_type'], |
| | | 'verify_day' => $product['verify_day'], |
| | | 'is_newcomer' => $product['is_newcomer'], |
| | | 'is_repurchase' => $product['is_repurchase'], |
| | | 'is_viewpoint_money' => $product['is_viewpoint_money'], |
| | | 'viewpoint_money' => $product['viewpoint_money'], |
| | | 'deduction_price' => empty($product['deduction_price']) ? 0 : $product['deduction_price'],//券商品的抵扣金额 by yj 2024.1.10 |
| | | ]; |
| | | // 记录订单商品来源id |
| | |
| | | if(!empty($params['search'])){ |
| | | $model = $model->where('nickName|mobile', 'like', '%' . trim($params['search']) . '%'); |
| | | } |
| | | if(!empty($params['user_id'])){ |
| | | $model = $model->where('user_id', $params['user_id']); |
| | | } |
| | | if (!empty($params['reg_source'])) { |
| | | $model = $model->where('reg_source', $params['reg_source']); |
| | | } |
| | |
| | | |
| | | // 支付宝支付 |
| | | const ALIPAY = 30; |
| | | // 连盟币支付 |
| | | const SUPPLY = 40; |
| | | |
| | | // 积分兑换(特殊场景使用 by lyzflash) |
| | | const POINTS = 60; |
| | | |
| | | |
| | | /** |
| | | * 获取枚举数据 |
| | |
| | | 'name' => '支付宝支付', |
| | | 'value' => self::ALIPAY, |
| | | ], |
| | | self::SUPPLY => [ |
| | | 'name' => '连盟币', |
| | | 'value' => self::SUPPLY, |
| | | ], |
| | | self::POINTS => [ |
| | | 'name' => '积分兑换', |
| | | 'value' => self::POINTS, |
| | |
| | | const DIRECT_REFEREE = 40; // 平台直推佣金 |
| | | const DIRECT_SUPPLIER = 50; // 直推供应商佣金 |
| | | |
| | | const VIEWPOINT_MONEY = 60; // 见点佣金 |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | self::VIP_SUBSIDY => '下级收益补贴', |
| | | self::DIRECT_REFEREE => '平台直推佣金', |
| | | self::DIRECT_SUPPLIER => '直推商家佣金', |
| | | self::VIEWPOINT_MONEY => '见点佣金', |
| | | ]; |
| | | } |
| | | |
| | |
| | | <?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\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];
}
} |
| | |
| | | |
| | | /** |
| | | * 创建VIP专区订单记录 |
| | | * @param array $order 订单信息数组 |
| | | * @param int $order_type 订单类型,默认为OrderTypeEnum::MASTER |
| | | * @return bool|\think\Collection 是否成功创建订单 |
| | | */ |
| | | public static function createOrder($order, $order_type = OrderTypeEnum::MASTER) |
| | | { |
| | |
| | | $list=[]; |
| | | // 计算佣金金额 |
| | | $orderPrice = bcsub($order['pay_price'], $order['express_price'], 2); |
| | | $viewpoint_money=0; |
| | | // 获取当前买家的推荐人信息 |
| | | $userModel = UserModel::detail($order['user_id']); |
| | | if (!empty($userModel) && !empty($userModel['referee_id'])) { |
| | |
| | | if (!empty($config['become__buy_product_ids'])) { |
| | | $purchase_count=(new self())->getPurchaseCount($order['user_id']); |
| | | foreach ($order['product'] as $product){ |
| | | 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'])) { |
| | | // 获取商品数量 |
| | | $quantity = $product['total_num']; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 检查并处理直推佣金 |
| | | $directReferralsCount=0; |
| | | $user=UserModel::detail($order['user_id']); |
| | | if (!empty($user['referee_id'])){ |
| | | // 检查推荐人是否满足直推条件(直推用户数量) |
| | | $directReferralsCount = UserModel::where('referee_id', '=', $user['referee_id'])->count(); |
| | | if ($viewpoint_money>0&&(new User())->getViewpointMoneyQualification($user['referee_id'],$setting)){ |
| | | $list[]=array_merge($data,['vip_area_type'=>60,'vip_area_money'=>$viewpoint_money]); |
| | | } |
| | | } |
| | | $requiredReferralCount = $setting['referee_buy_count'] ?? 0; |
| | | if ($vipGrade['commission']>0 && $directReferralsCount >= $requiredReferralCount){ |
| | |
| | | } |
| | | } |
| | | } |
| | | log_write($order['supplier']->toArray()); |
| | | if( $order['supplier']['referee_id']!=0){ |
| | | // 处理供应商推荐人佣金 |
| | | if($order['supplier']['referee_id']!=0){ |
| | | $supplierReferee=VipUserModel::detail($order['supplier']['referee_id']); |
| | | log_write('供应商推荐人:'.$supplierReferee['user_id']); |
| | | if ($supplierReferee){ |
| | | $vipGradeSupplier=Grade::detail($supplierReferee['grade_id']); |
| | | if ($vipGradeSupplier['supplier_money']>0){ |
| | |
| | | } |
| | | } |
| | | } |
| | | log_write($list); |
| | | if (empty($list)){ |
| | | return true; |
| | | } |
| | |
| | | namespace app\common\model\plus\vip; |
| | | |
| | | use app\common\model\BaseModel; |
| | | use app\common\model\order\OrderProduct; |
| | | use app\common\model\plus\vip\GradeLog as GradeLogModel; |
| | | use app\common\enum\user\grade\ChangeTypeEnum; |
| | | |
| | |
| | | 'freeze_money' => $model['freeze_money'] + $money, |
| | | ]); |
| | | } |
| | | |
| | | |
| | | public function getViewpointMoneyQualification($user_id,$setting) |
| | | { |
| | | $userNum=$this->where('referee_id','=',$user_id)->count(); |
| | | $consumption=(new OrderProduct()) |
| | | ->alias('order_product') |
| | | ->where('order_product.user_id','=',$user_id) |
| | | ->join('order','order_product.order_id=order.order_id') |
| | | ->where('order.order_status','=',30) |
| | | ->where('order_product.create_time','>=',strtotime(date('Y-m-01 00:00:00'))) |
| | | ->where('order_product.create_time','<',strtotime('+1 month',strtotime(date('Y-m-01 00:00:00')))) |
| | | ->where('order_product.is_repurchase','=',1)->sum('order_product.total_pay_price'); |
| | | if($userNum>=$setting['viewpoint_buy_count']&&$consumption>=$setting['repurchase_consumption']){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | } |
| | | // 发放分销商佣金,发放团队分红 |
| | | foreach ($orderList as $order) { |
| | | if ($order['is_newcomer']==1){ |
| | | // 赠送等级积分给用户 |
| | | $user = UserModel::detail($order['user_id']); |
| | | $points = $order['pay_price']; |
| | | $user->setIncPoints($points, '新人专区购买商品专享订单奖励积分'); |
| | | } |
| | | AgentOrderModel::grantMoney($order, $this->orderType); |
| | | // 发放团队分红 by yj |
| | | TeamOrderModel::grantMoney($order, $this->orderType); |
| | |
| | | $purchase_count = true; |
| | | } |
| | | $supplier_count = false; |
| | | $referee_supplier_count = (new Supplier())->where('referee_id', $user['user_id'])->count(); |
| | | // 直推供应商多少人 |
| | | if($grade['is_supplier_count'] == 1 && $referee_supplier_count >= $grade['supplier_count']){ |
| | | $supplier_count = true; |
| | | if($grade['is_supplier_count'] == 1 ){ |
| | | $referee_supplier_count = (new Supplier())->where('referee_id', $user['user_id'])->count(); |
| | | if ($referee_supplier_count >= $grade['supplier_count']){ |
| | | $supplier_count = true; |
| | | } |
| | | |
| | | } |
| | | // 推荐人等级 |
| | | $user_referee_grade_count = (new UserModel())->getRefereeGradeCount($user['user_id'], $grade['referee_grade_ids']); |
| | | $referee_grade_count=false; |
| | | if($grade['is_referee_grade'] == 1 && $user_referee_grade_count >= $grade['referee_grade_count']){ |
| | | $referee_grade_count = true; |
| | | if($grade['is_referee_grade'] == 1){ |
| | | // 推荐人等级 |
| | | $user_referee_grade_count = (new UserModel())->getRefereeGradeCount([$user['user_id']], $grade['referee_grade_ids']); |
| | | if ($user_referee_grade_count >= $grade['referee_grade_count']){ |
| | | $referee_grade_count = true; |
| | | } |
| | | |
| | | } |
| | | if($grade['condition_type'] == 'and'){ |
| | | $grade['is_purchase_count']!=1 && $purchase_count=true; |
| | |
| | | */ |
| | | public function add($scene = 'add') |
| | | { |
| | | $supplier = SupplierModel::detail($this->getSupplierId()); |
| | | // get请求 |
| | | if($this->request->isGet()){ |
| | | return $this->getBaseData(); |
| | | return $this->getBaseData($supplier); |
| | | } |
| | | //post请求 |
| | | $data = json_decode($this->postData()['params'], true); |
| | | $data['is_newcomer'] = $supplier['is_newcomer']; |
| | | $data['is_repurchase'] = $supplier['is_repurchase']; |
| | | // 添加商品 |
| | | if($scene == 'copy'){ |
| | | unset($data['create_time']); |
| | | unset($data['sku']['product_sku_id']); |
| | |
| | | /** |
| | | * 获取基础数据 |
| | | */ |
| | | public function getBaseData() |
| | | public function getBaseData($supplier) |
| | | { |
| | | return $this->renderSuccess('', array_merge(ProductService::getEditData(null, 'add', $this->getSupplierId()), [])); |
| | | return $this->renderSuccess('', array_merge(ProductService::getEditData(null, 'add', $this->getSupplierId()),['is_newcomer'=>$supplier['is_newcomer'],'is_repurchase'=>$supplier['is_repurchase']])); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public function edit($product_id, $scene = 'edit') |
| | | { |
| | | $supplier = SupplierModel::detail($this->getSupplierId()); |
| | | if($this->request->isGet()){ |
| | | $model = ProductModel::detail($product_id); |
| | | return $this->renderSuccess('', array_merge(ProductService::getEditData($model, $scene, $this->getSupplierId()), compact('model'))); |
| | | $is_newcomer = $supplier['is_newcomer']; |
| | | $is_repurchase = $supplier['is_repurchase']; |
| | | $supplierName=''; |
| | | if($model['belonging_shop_supplier_id']){ |
| | | $belonging_shop_supplier= SupplierModel::detail($model['belonging_shop_supplier_id']); |
| | | $supplierName=$belonging_shop_supplier['name']; |
| | | } |
| | | return $this->renderSuccess('', array_merge(ProductService::getEditData($model, $scene, $this->getSupplierId()), compact('model','is_newcomer','is_repurchase','supplierName'))); |
| | | } |
| | | if ($scene == 'copy') { |
| | | return $this->add($scene); |
| | | } |
| | | // 商品详情 |
| | | $model = ProductModel::detail($product_id); |
| | | $data = json_decode($this->postData()['params'], true); |
| | | $data['is_newcomer'] = $supplier['is_newcomer']; |
| | | $data['is_repurchase'] = $supplier['is_repurchase']; |
| | | // 更新记录 |
| | | if ($model->edit(json_decode($this->postData()['params'], true),$this->getSupplierId())) { |
| | | if ($model->edit($data,$this->getSupplierId())) { |
| | | return $this->renderSuccess('更新成功'); |
| | | } |
| | | return $this->renderError($model->getError() ?: '更新失败'); |
| | |
| | | class Supplier extends Controller |
| | | { |
| | | /** |
| | | * 店员列表 |
| | | */ |
| | | public function index() |
| | | { |
| | | // 供应商列表 |
| | | $model = new SupplierModel; |
| | | $postData = $this->postData(); |
| | | /*//获取该角色管理的区域 by yj 2023.12.20 |
| | | $shop_supplier_ids = SupplierModel::getSupplierIdsByUser($this->store['user']); |
| | | if(!empty($shop_supplier_ids)){ |
| | | $postData["shop_supplier_ids"] = $shop_supplier_ids; |
| | | }*/ |
| | | $list = $model->getList($postData); |
| | | return $this->renderSuccess('', compact('list')); |
| | | } |
| | | /** |
| | | * 获取用户信息 |
| | | */ |
| | | public function getUserInfo() |
| | |
| | | 'freeze_money' => $this['freeze_money'] + $money, |
| | | ]); |
| | | } |
| | | |
| | | /** |
| | | * 获取列表数据 |
| | | */ |
| | | public function getList($params) |
| | | { |
| | | $model = $this; |
| | | if (isset($params['search']) && $params['search']) { |
| | | $model = $model->where('name', 'like', '%' . $params['search'] . '%'); |
| | | } |
| | | if(isset($params['shop_supplier_ids'])&&$params['shop_supplier_ids']){ |
| | | $model = $model->where('shop_supplier_id', 'in', $params['shop_supplier_ids']); |
| | | } |
| | | if(isset($params['is_takeout']) && $params['is_takeout'] > -1){ |
| | | $model = $model->where('is_takeout', '=', $params['is_takeout']); |
| | | } |
| | | // 查询列表数据 |
| | | return $model->with(['logo', 'superUser', 'business', 'qyQrcode']) |
| | | ->where('is_delete', '=', '0') |
| | | ->order(['create_time' => 'desc']) |
| | | ->paginate($params); |
| | | } |
| | | } |
| | |
| | | <div class="common-seach-wrap"> |
| | | <el-form size="small" :inline="true" :model="formInline" class="demo-form-inline"> |
| | | <el-form-item label="昵称"><el-input placeholder="请输入微信昵称/电话号码" v-model="formInline.search"></el-input></el-form-item> |
| | | <el-form-item label="用户id"><el-input placeholder="请输入用户id" v-model="formInline.user_id"></el-input></el-form-item> |
| | | <el-form-item> |
| | | <el-button icon="el-icon-search" @click="search">查询</el-button> |
| | | </el-form-item> |
| | |
| | | <el-option v-for="(item,index) in positionList" :key="index" :label="item.name" :value="item.position_id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="所属企业" prop="shop_supplier_id" :label-width="formLabelWidth" :rules="[{required: true,message: '请选择企业'}]"> |
| | | <el-form-item label="所属企业" prop="shop_supplier_id" :label-width="formLabelWidth" :rules="[{required: false,message: '请选择企业'}]"> |
| | | <el-row> |
| | | <el-button @click="selectSupplier" icon="el-icon-plus">选择企业</el-button> |
| | | <div v-if="formData.shop_supplier_id!=''" class="mt10"> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="item" @click="select_type()"> |
| | | <!-- <view class="item" @click="select_type()"> |
| | | <view class="box" style="height: 100%;"> |
| | | <image style="width: 36rpx;height: 36rpx;" :src="isLieBiao == true?'/static/shop/liebiao.png':'/static/shop/tubiao.png'"></image> |
| | | </view> |
| | | </view> |
| | | </view> --> |
| | | </view> |
| | | </view> |
| | | <view class="prodcut-list-wrap"> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | isLieBiao: true, |
| | | isLieBiao: false, |
| | | /*手机高度*/ |
| | | phoneHeight: 0, |
| | | /*可滚动视图区域高度*/ |
| | |
| | | <view class="tc d-s-c head_top_box" :style="topBarHeight() == 0 ? '': 'height:'+topBarHeight()+'px;'"> |
| | | <view class="reg180" @click="goback"><text class="icon iconfont icon-jiantou"></text></view> |
| | | <view class="d-s-c ml20 flex-1"> |
| | | <view class="index-search-cate flex-1" :style="'height:'+topBarHeight()+' px;'" |
| | | @click="gotoSearch"> |
| | | <view class="index-search-cate flex-1" :style="'height:'+topBarHeight()+' px;'" @click="gotoSearch"> |
| | | <text class="icon iconfont icon-sousuo"></text>搜索店内商品 |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | </view> |
| | | <!-- #endif --> |
| | | |
| | | |
| | | <scroll-view v-if="" scroll-y="true" :style="'height:' + scrollviewHigh + 'px;'" class="scroll-Y pr bg-f2" |
| | | lower-threshold="50" @scrolltolower="scrolltolowerFunc" @scroll="scrollChnage"> |
| | | lower-threshold="50" @scrolltolower="scrolltolowerFunc" @scroll="scrollChnage"> |
| | | <view class="shop_head"> |
| | | <!-- #ifdef MP-WEIXIN || APP-PLUS --> |
| | | <view class="ww100" :style="'height:'+topBarTop()+'px;'"></view> |
| | |
| | | </view> --> |
| | | </view> |
| | | <view class="shop_list_body_item_shop_others"> |
| | | <view v-if="isfollow == 0" class="collect_btn" @click="guanzhu()"><text class="icon iconfont icon-guanzhu1 mr10"></text>关注</view> |
| | | <view v-if="isfollow == 0" class="collect_btn" @click="guanzhu()"><text |
| | | class="icon iconfont icon-guanzhu1 mr10"></text>关注</view> |
| | | <view v-if="isfollow == 1" class="collect_btn collected" @click="guanzhu()">已关注</view> |
| | | </view> |
| | | </view> |
| | |
| | | <view :class="{'tab-fixed':isFixed}" :style="isFixed?'top:' + topHeight + 'px;':''"> |
| | | <!-- 导航栏 --> |
| | | <view class="inner-tab tab-top"> |
| | | <view :class="nav_type==99?'item active':'item'" @click="changeNavType(99)"> |
| | | <view class="box">精选</view> |
| | | <view :class="nav_type==4?'item active':'item'" @click="changeNavType(4)"> |
| | | <view class="box">简介</view> |
| | | </view> |
| | | <!-- <view :class="nav_type==99?'item active':'item'" @click="changeNavType(99)"> |
| | | <view class="box">精选</view> |
| | | </view> --> |
| | | <view :class="nav_type==0?'item active':'item'" @click="changeNavType(0)"> |
| | | <view class="box">商品</view> |
| | | </view> |
| | | <view :class="nav_type==2?'item active':'item'" @click="changeNavType(2)"> |
| | | <view class="box">优惠券</view> |
| | | <view :class="nav_type==5?'item active':'item'" @click="changeNavType(5)"> |
| | | <view class="box">活动列表</view> |
| | | </view> |
| | | <view :class="nav_type==1?'item active':'item'" @click="changeNavType(1)" v-if="is_record==1&&is_open==1"> |
| | | <!-- <view :class="nav_type==2?'item active':'item'" @click="changeNavType(2)"> |
| | | <view class="box">优惠券</view> |
| | | </view> --> |
| | | <view :class="nav_type==1?'item active':'item'" @click="changeNavType(1)" |
| | | v-if="is_record==1&&is_open==1"> |
| | | <view class="box">直播</view> |
| | | </view> |
| | | <view :class="nav_type==3?'item active':'item'" @click="changeNavType(3)"> |
| | | <view class="box">商家</view> |
| | | <view :class="nav_type==6?'item active':'item'" @click="changeNavType(6)"> |
| | | <view class="box">案例</view> |
| | | </view> |
| | | <!-- <view :class="nav_type==3?'item active':'item'" @click="changeNavType(3)"> |
| | | <view class="box">商家</view> |
| | | </view> --> |
| | | </view> |
| | | <!-- 导航栏 --> |
| | | </view> |
| | | <view class="ww100" style="height: 80rpx;" v-if="isFixed"></view> |
| | | <view class="shop" :class="nav_type==0?'shop-product':''" v-if="shop_info!=''" :style="'min-height:' + scrollviewHigh + 'px;'"> |
| | | <view class="shop" :class="nav_type==0?'shop-product':''" v-if="shop_info!=''" |
| | | :style="'min-height:' + scrollviewHigh + 'px;'"> |
| | | <view class="shop_head_banner pr bg-white" v-if="adList!= ''"> |
| | | <swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000"> |
| | | <swiper-item class="swiper-item" v-for="(item,index) in adList" :key="index"> |
| | | <image :src="item.image.file_path" mode=""></image> |
| | | </swiper-item> |
| | | </swiper> |
| | | </view> |
| | | <view v-if="nav_type==4"> |
| | | <view class="shop_info_description" v-html="shop_info.description"> |
| | | |
| | | </view> |
| | | </view> |
| | | <view v-if="nav_type==6"> |
| | | <scroll-view scroll-y="true" class="scroll-Y" lower-threshold="50" |
| | | @scrolltolower="scrolltolowerFunc"> |
| | | <view class="article-list"> |
| | | <view class="item" v-for="(item, index) in articlelistData" :key="index" |
| | | @click="gotoDetail(item.article_id)"> |
| | | <view class="info"> |
| | | <view class="title">{{ item.article_title }}</view> |
| | | <view class="summary">{{ item.dec }}</view> |
| | | <view class="datatime d-s-c"> |
| | | <text>{{ item.create_time }}</text> |
| | | <text class="icon iconfont icon-chakan ml30"></text> |
| | | <text class="ml10">{{ item.actual_views }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="pic" v-if="item.image != null"> |
| | | <image :src="item.image.file_path" mode="aspectFill"></image> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 没有记录 --> |
| | | <view class="d-c-c p30" v-if="listData.length == 0 && !loading"> |
| | | <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 v-if="nav_type==99"> |
| | | <!-- <view class="bg-white pt30"> |
| | |
| | | <view class="swiper swiper-list"> |
| | | <view class="" v-for="(item, index) in listData" :key="index" v-if="index<=5"> |
| | | <view class="coupon-item" :class="'bg-' + item.color.text"> |
| | | <view class="side-line left-side-line"><text class="round" v-for="(round, num) in 8" :key="num"></text></view> |
| | | <view class="side-line right-side-line"><text class="round" v-for="(round, num) in 8" :key="num"></text></view> |
| | | <view class="side-line left-side-line"><text class="round" |
| | | v-for="(round, num) in 8" :key="num"></text></view> |
| | | <view class="side-line right-side-line"><text class="round" |
| | | v-for="(round, num) in 8" :key="num"></text></view> |
| | | <view class="left-type d-s-c"> |
| | | <template v-if="item.coupon_type.value == 10"> |
| | | <text class="f20">¥</text> |
| | |
| | | </view> |
| | | </view> |
| | | <!--领取--> |
| | | <view v-if="item.is_get == 0" class="right-receive d-c-c" @click="receiveCoupon(index)"> |
| | | <view v-if="item.is_get == 0" class="right-receive d-c-c" |
| | | @click="receiveCoupon(index)"> |
| | | 领 |
| | | </view> |
| | | <view v-else class="right-receive no-receive d-c-c"> |
| | |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | <view class="shop_head_banner pr bg-white" v-if="adList!= ''"> |
| | | <swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000"> |
| | | <swiper-item class="swiper-item" v-for="(item,index) in adList" :key="index"> |
| | | <image :src="item.image.file_path" mode=""></image> |
| | | </swiper-item> |
| | | </swiper> |
| | | </view> |
| | | <!-- 商品导航栏 --> |
| | | <view class="inner-tab tab-product tab-index" :style="tabIndexFixed?'position:fixed;width:100%;top:' + (topHeight*1+34) + 'px;':''"> |
| | | <view class="inner-tab tab-product tab-index" |
| | | :style="tabIndexFixed?'position:fixed;width:100%;top:' + (topHeight*1+34) + 'px;':''"> |
| | | <view :class="type_active=='all'?'item active':'item'" @click="tabTypeFunc('all')"> |
| | | <view class="box">推荐</view> |
| | | </view> |
| | |
| | | <view class="ww100" style="height: 80rpx;" v-if="tabIndexFixed"></view> |
| | | <!-- 商品导航栏 --> |
| | | <view class="shop_body2"> |
| | | <view class="shop_body_t_item" v-for="(item,index) in product_list" :key="index" @click="goto_product(item.product_id)"> |
| | | <view class="shop_body_t_item" v-for="(item,index) in product_list" :key="index" |
| | | @click="goto_product(item.product_id)"> |
| | | <image :src="item.product_image" mode=""></image> |
| | | <view class="shop_body_t_item_info"> |
| | | <view class="shop_body_t_item_info_title h1">{{item.product_name}}</view> |
| | |
| | | </view> |
| | | </view> |
| | | <!-- 商品导航栏 --> |
| | | <view class="inner-tab tab-product tab-product-list" v-if="nav_type==0" :style="tabProductFixed?'position:fixed;width:100%;top:' + (topHeight*1+34) + 'px;':''"> |
| | | <view class="inner-tab tab-product tab-product-list" v-if="nav_type==0" |
| | | :style="tabProductFixed?'position:fixed;width:100%;top:' + (topHeight*1+34) + 'px;':''"> |
| | | <view :class="type_active=='all'?'item active':'item'" @click="tabTypeFunc('all')"> |
| | | <view class="box">综合</view> |
| | | </view> |
| | |
| | | </view> |
| | | <view class="item"> |
| | | <view class="box"> |
| | | <image @click="select_type()" :src="isLieBiao == true?'/static/shop/liebiao.png':'/static/shop/tubiao.png'"></image> |
| | | <image @click="select_type()" |
| | | :src="isLieBiao == true?'/static/shop/liebiao.png':'/static/shop/tubiao.png'"></image> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="ww100" style="height: 80rpx;" v-if="tabProductFixed"></view> |
| | | <!-- 商品导航栏 --> |
| | | <view class="shop_body" v-if="isLieBiao ==true&&nav_type==0"> |
| | | <view class="shop_body_l_item" :class="index==listData.length-1?'noborder':''" v-for="(item,index) in product_list" |
| | | :key="index" @click="goto_product(item.product_id)"> |
| | | <view class="shop_body_l_item" :class="index==listData.length-1?'noborder':''" |
| | | v-for="(item,index) in product_list" :key="index" @click="goto_product(item.product_id)"> |
| | | <view> |
| | | <image :src="item.product_image" mode=""></image> |
| | | </view> |
| | |
| | | <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 class="h4 huaxianjia">¥<text class="h3">{{item.line_price}}</text></view> --> |
| | | </view> |
| | | <view class="shop_body_l_item_info_others f22"> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="shop_body2" v-if="isLieBiao ==false&&nav_type==0"> |
| | | <view class="shop_body_t_item" v-for="(item,index) in product_list" :key="index" @click="goto_product(item.product_id)"> |
| | | <view class="shop_body_t_item" v-for="(item,index) in product_list" :key="index" |
| | | @click="goto_product(item.product_id)"> |
| | | <image :src="item.product_image" mode=""></image> |
| | | <view class="shop_body_t_item_info"> |
| | | <view class="shop_body_t_item_info_title h1">{{item.product_name}}</view> |
| | |
| | | <!-- 直播 --> |
| | | <view v-if="nav_type==1"> |
| | | <view class="live_list" v-if="liveList.length>0"> |
| | | <view v-for="(liveitem,liveindex) in liveList" :key="liveindex" class="live_item" @click="toRoom(liveitem)"> |
| | | <view v-for="(liveitem,liveindex) in liveList" :key="liveindex" class="live_item" |
| | | @click="toRoom(liveitem)"> |
| | | <view v-if="liveitem.record_url!=''" class="record">可回放</view> |
| | | <view v-if="liveitem.record_url==''" class="record_off">回放生成中</view> |
| | | <view class="live_img"> |
| | |
| | | <!-- 客服 --> |
| | | <view v-if="nav_type==3"> |
| | | <view class="d-s-s d-c p-0-30 mt20 mpservice-wrap" v-if="!isloding"> |
| | | <view class="noDatamodel" v-if="dataModel==null||(dataModel.qq==''&&dataModel.wechat==''&&dataModel.phone=='')">该商家尚未设置客服</view> |
| | | <view class="noDatamodel" |
| | | v-if="dataModel==null||(dataModel.qq==''&&dataModel.wechat==''&&dataModel.phone=='')"> |
| | | 该商家尚未设置客服</view> |
| | | <template v-if="dataModel!=null"> |
| | | <view v-if="dataModel.qq!=''" class="d-b-c p-20-0 f30 ww100 border-b" @click="copyQQ(dataModel.qq)"> |
| | | <text class="gray9" style="width: 140rpx;"><text class='icon iconfont icon-qq'></text></text> |
| | | <view v-if="dataModel.qq!=''" class="d-b-c p-20-0 f30 ww100 border-b" |
| | | @click="copyQQ(dataModel.qq)"> |
| | | <text class="gray9" style="width: 140rpx;"><text |
| | | class='icon iconfont icon-qq'></text></text> |
| | | <text class="p-0-30 flex-1">{{dataModel.qq}}</text> |
| | | <text class="blue">复制</text> |
| | | </view> |
| | | <view v-if="dataModel.wechat!=''" class="d-b-c p-20-0 f30 ww100 border-b" @click="copyQQ(dataModel.qq)"> |
| | | <text class="gray9" style="width: 140rpx;"><text class='icon iconfont icon-weixin'></text></text> |
| | | <view v-if="dataModel.wechat!=''" class="d-b-c p-20-0 f30 ww100 border-b" |
| | | @click="copyQQ(dataModel.qq)"> |
| | | <text class="gray9" style="width: 140rpx;"><text |
| | | class='icon iconfont icon-weixin'></text></text> |
| | | <text class="p-0-30 flex-1">{{dataModel.wechat}}</text> |
| | | <text class="blue">复制</text> |
| | | </view> |
| | | <view v-if="dataModel.phone!=''" class="d-b-c p-20-0 f30 ww100" @click="callPhone(dataModel.phone)"> |
| | | <text class="gray9" style="width: 140rpx;"><text class='icon iconfont icon-002dianhua'></text></text> |
| | | <view v-if="dataModel.phone!=''" class="d-b-c p-20-0 f30 ww100" |
| | | @click="callPhone(dataModel.phone)"> |
| | | <text class="gray9" style="width: 140rpx;"><text |
| | | class='icon iconfont icon-002dianhua'></text></text> |
| | | <text class="p-0-30 flex-1">{{dataModel.phone}}</text> |
| | | <text class="blue">拨打</text> |
| | | </view> |
| | |
| | | <view class="diy-coupon"> |
| | | <view class=" mt20 mb20" v-for="(item, index) in listData" :key="index"> |
| | | <view class="coupon-item" :class="'bg-' + item.color.text"> |
| | | <view class="side-line left-side-line"><text class="round" v-for="(round, num) in 8" :key="num"></text></view> |
| | | <view class="side-line right-side-line"><text class="round" v-for="(round, num) in 8" :key="num"></text></view> |
| | | <view class="side-line left-side-line"><text class="round" v-for="(round, num) in 8" |
| | | :key="num"></text></view> |
| | | <view class="side-line right-side-line"><text class="round" v-for="(round, num) in 8" |
| | | :key="num"></text></view> |
| | | <view class="left-type d-c-c">{{ item.coupon_type.text }}</view> |
| | | <view class="center-content pr"> |
| | | <view class="content-top"> |
| | |
| | | 已领取 |
| | | </view> |
| | | </view> |
| | | <view class="range_item d-b-c" v-if="item.apply_range == 20" @click.stop="gotoPage('/pages/coupon/detail?coupon_id='+ item.coupon_id)"> |
| | | <view class="range_item d-b-c" v-if="item.apply_range == 20" |
| | | @click.stop="gotoPage('/pages/coupon/detail?coupon_id='+ item.coupon_id)"> |
| | | <view>限购店铺部分商品</view> |
| | | <view><text class="icon iconfont icon-jiantou" style="color: #999999; font-size: 24rpx;"></text></view> |
| | | <view><text class="icon iconfont icon-jiantou" |
| | | style="color: #999999; font-size: 24rpx;"></text></view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | return { |
| | | isLieBiao: true, |
| | | shop_info: '', //店铺信息 |
| | | articlelistData: [], |
| | | /*是否有更多*/ |
| | | no_more: null, |
| | | /*一页多少条*/ |
| | | list_rows: 10, |
| | | /*当前第几页*/ |
| | | page: 1, |
| | | product_list: '', //商品列表 |
| | | adList: '', //banner列表 |
| | | dataList: '', |
| | |
| | | last_page: 0, |
| | | /*可滚动视图区域高度*/ |
| | | scrollviewHigh: 0, |
| | | nav_type: 99, |
| | | nav_type: 4, |
| | | is_open: 0, |
| | | is_record: 0, |
| | | liveList: [], |
| | |
| | | headHight: 0, |
| | | topHeight: 0, |
| | | tabIndexTop: 0, |
| | | tabIndexFixed : false, |
| | | tabIndexFixed: false, |
| | | tabProductTop: 0, |
| | | tabProductFixed : false, |
| | | tabProductFixed: false, |
| | | card_num: 0, |
| | | store_id:'' |
| | | store_id: '' |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | self.shop_supplier_id = option.shop_supplier_id; |
| | | }, |
| | | onShow() { |
| | | if(this.store_id > 0){ |
| | | if (this.store_id > 0) { |
| | | uni.navigateBack({}); |
| | | } |
| | | }, |
| | |
| | | /*下拉到顶,页面值还原初始化*/ |
| | | this.restoreData(); |
| | | this.getData(); |
| | | this.getProduct(this.type_active); |
| | | this.getProduct(this.type_active); |
| | | }, |
| | | methods: { |
| | | changeNavType(e) { |
| | | this.nav_type = e; |
| | | this.page=1; |
| | | if (e == 0) { |
| | | this.initTabProduct(); |
| | | }else if(e==6){ |
| | | this.articleGetData(); |
| | | } |
| | | }, |
| | | initTabProduct() { |
| | |
| | | shop_supplier_id: self.shop_supplier_id, |
| | | visitcode: self.getVisitcode() |
| | | }, (res) => { |
| | | if(res.data.store_id){ |
| | | if (res.data.store_id) { |
| | | self.gotoPage('/pages2/goodstore/detail?store_id=' + res.data.store_id); |
| | | self.store_id = res.data.store_id; |
| | | return; |
| | |
| | | if (this.service_type == 10 || this.shop_info.user_id == uni.getStorageInfoSync('user_id')) { |
| | | this.nav_type = 3; |
| | | } else if (this.service_type == 20) { |
| | | this.gotoPage('/pages/plus/chat/chat?user_id=' + this.shop_info.supplier_user_id + '&shop_supplier_id=' + this.shop_info.shop_supplier_id + |
| | | '&nickName=' + this.shop_info.store_name); |
| | | this.gotoPage('/pages/plus/chat/chat?user_id=' + this.shop_info.supplier_user_id + |
| | | '&shop_supplier_id=' + this.shop_info.shop_supplier_id + |
| | | '&nickName=' + this.shop_info.store_name); |
| | | } |
| | | }, |
| | | goback() { |
| | |
| | | gotoSearch() { |
| | | this.gotoPage('/pages/shop/search?shop_supplier_id=' + this.shop_supplier_id); |
| | | }, |
| | | /*获取数据*/ |
| | | articleGetData() { |
| | | let self = this; |
| | | let page = self.page; |
| | | let list_rows = self.list_rows; |
| | | self.loading = true; |
| | | uni.showLoading({ |
| | | title: '加载中' |
| | | }); |
| | | self._get( |
| | | 'plus.article.article/index', { |
| | | page: page || 1, |
| | | list_rows: list_rows, |
| | | category_id: self.type_active, |
| | | shop_supplier_id: self.shop_supplier_id |
| | | }, |
| | | function(res) { |
| | | self.articlelistData = self.listData.concat(res.data.list.data); |
| | | self.last_page = res.data.list.last_page; |
| | | if (res.data.list.last_page <= 1) { |
| | | self.no_more = true; |
| | | } |
| | | self.loading = false; |
| | | uni.hideLoading(); |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | /*可滚动视图区域到底触发*/ |
| | | scrolltolowerFunc() { |
| | | let self = this; |
| | | self.bottomRefresh = true; |
| | | self.page++; |
| | | self.loading = true; |
| | | if (self.page > self.last_page) { |
| | | self.loading = false; |
| | | self.no_more = true; |
| | | return; |
| | | } |
| | | self.getData(); |
| | | }, |
| | | |
| | | /*跳转文章详情*/ |
| | | gotoDetail(e) { |
| | | this.gotoPage('/pages/article/detail/detail?article_id=' + e); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | box-sizing: border-box; |
| | | border-top: 1rpx solid #eeeeee; |
| | | } |
| | | |
| | | |
| | | .shop_body .shop_body_l_item:first-child { |
| | | border-top: 0; |
| | | } |
| | |
| | | font-size: 26rpx; |
| | | padding: 0 24rpx; |
| | | } |
| | | |
| | | |
| | | .shop_list_body_item_shop_others .collected { |
| | | border: 1rpx solid #FFFFFF; |
| | | color: #FFFFFF; |
| | |
| | | .noborder { |
| | | border: none; |
| | | } |
| | | .range_item{ |
| | | |
| | | .range_item { |
| | | border: 1rpx solid #D9D9D9; |
| | | border-top: none; |
| | | padding: 8rpx; |
| | | border-bottom-left-radius:10rpx ; |
| | | border-bottom-right-radius:10rpx ; |
| | | border-bottom-left-radius: 10rpx; |
| | | border-bottom-right-radius: 10rpx; |
| | | color: #666666; |
| | | box-shadow: 0 0 8rpx rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .top_search_right { |
| | | font-size: 20rpx; |
| | | line-height: normal; |
| | | } |
| | | .top_search_right .icon { |
| | | } |
| | | |
| | | .top_search_right .icon {} |
| | | |
| | | .top_search_right .icon-31guanzhu1xuanzhong { |
| | | color: #F6220C; |
| | | } |
| | | |
| | | .shop_top { |
| | | position: fixed; |
| | | width: 100%; |
| | |
| | | padding-bottom: 16rpx; |
| | | transition: 500ms; |
| | | } |
| | | |
| | | .head_top_box { |
| | | color: #FFFFFF; |
| | | } |
| | | |
| | | .shop_list_body_item_shop_info .icon-htmal5icon24 { |
| | | color: #F6220C; |
| | | } |
| | | |
| | | /* ***************************************** */ |
| | | /* ***************************************** */ |
| | | /* ***************************************** */ |
| | | .swiper-list { |
| | | display: flex; |
| | | } |
| | | |
| | | .shop-coupon { |
| | | padding: 30rpx 20rpx; |
| | | position: relative; |
| | | } |
| | | |
| | | |
| | | .shop-coupon scroll-view { |
| | | height: 94rpx; |
| | | } |
| | |
| | | background: #acacac; |
| | | color: #787878; |
| | | } |
| | | |
| | | /* ***************************** */ |
| | | .topbg { |
| | | background-color: #333648; |
| | | transition: 500ms; |
| | | } |
| | | |
| | | .topbg-white .icon-jiantou { |
| | | color: #333333; |
| | | } |
| | | |
| | | .topbg-white .top_search_right { |
| | | color: #555555; |
| | | } |
| | | |
| | | .topbg-white .index-search-cate { |
| | | background: #E5E5E5; |
| | | } |
| | | |
| | | .tab-product { |
| | | display: flex; |
| | | margin-top: 16rpx; |
| | | border-bottom: 1rpx solid #eeeeee; |
| | | background-color: #FFFFFF; |
| | | } |
| | | |
| | | .tab-product .item { |
| | | color: #999999; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .shop-product { |
| | | margin-top: 0; |
| | | } |
| | | |
| | | .tab-product .item.active { |
| | | font-weight: normal; |
| | | } |
| | | |
| | | .tab-product .item.active::after { |
| | | width: 30rpx; |
| | | } |
| | | .tab-fixed{ |
| | | |
| | | .tab-fixed { |
| | | position: fixed; |
| | | top: 0; |
| | | width: 100%; |
| | | background-color: #333648; |
| | | z-index: 99; |
| | | } |
| | | .tab-top .item, .tab-top .item.active { |
| | | |
| | | .tab-top .item, |
| | | .tab-top .item.active { |
| | | color: #FFFFFF; |
| | | } |
| | | |
| | | .tab-top .item.active:after { |
| | | background: #FFFFFF; |
| | | height: 6rpx; |
| | | } |
| | | |
| | | .head_top_box .index-search-cate { |
| | | background: rgba(255, 255, 255, .4); |
| | | border: 0; |
| | | color: #eeeeee; |
| | | } |
| | | |
| | | .head_top_box .index-search-cate text { |
| | | color: #eeeeee; |
| | | } |
| | | |
| | | /* 会员卡 */ |
| | | .card-box{ |
| | | .card-box { |
| | | pposition: relative; |
| | | margin: 0 20rpx; |
| | | // height: 114rpx; |
| | |
| | | background: linear-gradient(to right, #2F2F2F, #776047); |
| | | border-radius: 16rpx; |
| | | } |
| | | .btn-card-box{ |
| | | |
| | | .btn-card-box { |
| | | width: 164rpx; |
| | | height: 52rpx; |
| | | line-height: 52rpx; |
| | |
| | | text-align: center; |
| | | font-weight: 600; |
| | | } |
| | | .btn-card-box .icon.iconfont.icon-jiantou{ |
| | | |
| | | .btn-card-box .icon.iconfont.icon-jiantou { |
| | | font-size: 22rpx; |
| | | color: #54412c; |
| | | color: #54412c; |
| | | } |
| | | .v-log{ |
| | | |
| | | .v-log { |
| | | width: 31rpx; |
| | | height: 28rpx; |
| | | margin-right: 8rpx; |
| | | } |
| | | </style> |
| | | |
| | | .shop_info_description { |
| | | padding: 20rpx; |
| | | font-size: 28rpx; |
| | | line-height: 2; |
| | | } |
| | | |
| | | .article-list-wrap .type-list .tab-item { |
| | | padding: 0 30rpx; |
| | | font-size: 34rpx; |
| | | height: 86rpx; |
| | | line-height: 86rpx; |
| | | white-space: nowrap; |
| | | border-bottom: 4rpx solid #FFFFFF; |
| | | } |
| | | .article-list-wrap .type-list .tab-item.active{ |
| | | border-bottom: 4rpx solid; |
| | | @include border_color('border_color'); |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .article-list { |
| | | background: #ffffff; |
| | | } |
| | | |
| | | .article-list .item { |
| | | padding: 30rpx; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border-bottom: 1px solid #e3e3e3; |
| | | } |
| | | |
| | | .article-list .item .info { |
| | | flex: 1; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .article-list .item .title { |
| | | font-size: 36rpx; |
| | | } |
| | | |
| | | .article-list .item .summary { |
| | | margin-top: 20rpx; |
| | | font-size: 28rpx; |
| | | color: #999999; |
| | | } |
| | | |
| | | .article-list .item .title, |
| | | .article-list .item .summary { |
| | | display: -webkit-box; |
| | | overflow: hidden; |
| | | -webkit-line-clamp: 2; |
| | | -webkit-box-orient: vertical; |
| | | } |
| | | |
| | | .article-list .item .pic { |
| | | padding-left: 30rpx; |
| | | } |
| | | |
| | | .article-list .item .pic, |
| | | .article-list .item .pic image { |
| | | width: 160rpx; |
| | | height: 160rpx; |
| | | } |
| | | |
| | | .article-list .item .datatime { |
| | | margin-top: 20rpx; |
| | | font-size: 24rpx; |
| | | color: #999999; |
| | | } |
| | | </style> |
| | |
| | | <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="searchtxt" class="flex-1 ml10 f30 gray3" value="" placeholder-class="f24 gray6" |
| | | placeholder="搜索名称" confirm-type="search" @confirm="search()" /> |
| | | <input type="text" v-model="searchtxt" class="flex-1 ml10 f30 gray3" value="" |
| | | placeholder-class="f24 gray6" placeholder="搜索名称" confirm-type="search" @confirm="search()" /> |
| | | </view> |
| | | </view> |
| | | <view class="inner-tab"> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="category-box pt20" v-if="category.length>0"> |
| | | <scroll-view class="scroll-category" scroll-x="true" :scroll-left="scrollLeft" scroll-with-animation="true"> |
| | | <scroll-view class="scroll-category" scroll-x="true" :scroll-left="scrollLeft" |
| | | scroll-with-animation="true"> |
| | | <view class="category-list"> |
| | | <view class="category-item" v-for="(item,index) in category" :key="item.category_id" @click="tabChange(index)" :id="'item-' + index" :class="{current: index === currentIndex}"> |
| | | <view class="category-item" v-for="(item,index) in category" :key="item.category_id" |
| | | @click="tabChange(index)" :id="'item-' + index" :class="{current: index === currentIndex}"> |
| | | <text class="category-btn p-0-20">{{item.name}}</text> |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="prodcut-list-wrap" v-if="store_open"> |
| | | <scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50" |
| | | :refresher-triggered="triggered" @scrolltolower="scrolltolowerFunc" refresher-enabled="true" @refresherrefresh="onRefresh" |
| | | @refresherrestore="onRestore"> |
| | | <scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" |
| | | lower-threshold="50" :refresher-triggered="triggered" @scrolltolower="scrolltolowerFunc" |
| | | refresher-enabled="true" @refresherrefresh="onRefresh" @refresherrestore="onRestore"> |
| | | <view class="shop_list_body"> |
| | | <view class="shop_list_body_item" v-for="(item,index) in shopData" :key="index"> |
| | | <view class="shop_list_body_item_shop" @click="goto_shop(item.shop_supplier_id)"> |
| | |
| | | </view> |
| | | <view class="shop_list_body_item_shop_info"> |
| | | <view class="h1 title">{{item.name}}</view> |
| | | <view class="h3 brand">主营:{{item.category_name}}</view> |
| | | <view class="h3 brand address-row">主营:{{item.category_name}}</view> |
| | | <view class="h3 address-row"> |
| | | <text class="address-text">地址:{{item.address}}</text> |
| | | </view> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view v-if="shopData[index].productList.length>0" :class="shopData[index].productList.length<3?'shop_list_body_item_product2':'shop_list_body_item_product'"> |
| | | <view class="shop_list_body_item_product_item" v-for="(item1,index2) in shopData[index].productList" :key="index2" |
| | | @click="goto_product(item1.product_id)"> |
| | | <view v-if="shopData[index].productList.length>0" |
| | | :class="shopData[index].productList.length<3?'shop_list_body_item_product2':'shop_list_body_item_product'"> |
| | | <view class="shop_list_body_item_product_item" |
| | | v-for="(item1,index2) in shopData[index].productList" :key="index2" |
| | | @click="goto_product(item1.product_id)"> |
| | | <view> |
| | | <image :src="item1.image[0].file_path"></image> |
| | | </view> |
| | |
| | | <view class="f22 red">¥ |
| | | <text class="f32"> |
| | | {{item1.product_price}} |
| | | </text></view> |
| | | </text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | screenWidth: 0, |
| | | currentIndex: 0, |
| | | category_id: '', |
| | | store_open:false |
| | | store_open: false |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | category_id: self.category_id // 分类id by lyzflash |
| | | }, (res) => { |
| | | self.loading = false; |
| | | self.store_open = res.data.store_open; |
| | | if(!self.store_open){ |
| | | self.store_open = res.data.store_open; |
| | | if (!self.store_open) { |
| | | uni.setNavigationBarTitle({ |
| | | title: '我的订单', |
| | | title: '我的订单', |
| | | }); |
| | | self.gotoPage('/pages/index/index'); |
| | | }else{ |
| | | } else { |
| | | uni.setNavigationBarTitle({ |
| | | title: '人气好店', |
| | | title: '人气好店', |
| | | }); |
| | | } |
| | | } |
| | | self.last_page = res.data.list.last_page; |
| | | self.shopData = self.shopData.concat(res.data.list.data); |
| | | if (res.data.list.last_page <= 1) { |
| | |
| | | /*获取分类*/ |
| | | getCategory() { |
| | | let self = this; |
| | | self._post('supplier.index/category', { |
| | | }, (res) => { |
| | | self._post('supplier.index/category', {}, (res) => { |
| | | self.category = res.data.category; |
| | | }) |
| | | }, |
| | |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 分类导航 |
| | | * 点击事件 |
| | |
| | | |
| | | .shop_list_body_item_shop { |
| | | width: 100%; |
| | | height: 150rpx; |
| | | min-height: 150rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 10rpx; |
| | | } |
| | |
| | | } |
| | | |
| | | .address-row { |
| | | display: flex; |
| | | /* display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | width: 100%; |
| | | width: 100%; */ |
| | | display: -webkit-box; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | word-wrap: break-word; |
| | | } |
| | | |
| | | .address-text { |
| | |
| | | } |
| | | |
| | | .action-btn { |
| | | width: 60rpx; |
| | | height: 60rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | |
| | | .collect { |
| | | margin-bottom: 26rpx; |
| | | } |
| | | |
| | | // 分类相关 by lyzflash |
| | | .scroll-category { |
| | | width: 100%; |
| | |
| | | white-space: nowrap; |
| | | text-align: start; |
| | | } |
| | | |
| | | .scroll-category .current .category-btn { |
| | | @include border_color("border_color"); |
| | | @include text_color("font_color"); |
| | | } |
| | | |
| | | .scroll-category .category-item { |
| | | height: 50rpx; |
| | | text-align: center; |
| | |
| | | display: inline-block; |
| | | position: relative; |
| | | } |
| | | |
| | | .category-btn { |
| | | display: inline-block; |
| | | border-radius: 50rpx; |
| | |
| | | font-size: 28rpx; |
| | | border: 2rpx solid #ccc; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | } |
| | | }); |
| | | } |
| | | /*供需发布*/ |
| | | if (this.tab_type == 'demandapply') { |
| | | this.$router.push({ |
| | | path: '/plus/demandapply/index', |
| | | query: { |
| | | type: e.name |
| | | } |
| | | }); |
| | | } |
| | | /*vip专区*/ |
| | | if (this.tab_type == 'vip') { |
| | | this.$router.push({ |
| | |
| | | <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-input> |
| | | </el-form-item> |
| | | <el-form-item label="自动升级" :label-width="formLabelWidth" prop="auto_upgrade"> |
| | | <el-radio-group v-model="form.auto_upgrade"> |
| | | <el-radio :label="1">允许自动升级</el-radio> |
| | |
| | | referee_grade_ids: [], |
| | | /*直推指定会员等级人数*/ |
| | | referee_grade_count: 0, |
| | | /*见点奖*/ |
| | | viewpoint_money: 0, |
| | | /*备注*/ |
| | | remark: '', |
| | | }, |
| | |
| | | }; |
| | | </script> |
| | | |
| | | <style></style> |
| | | <style></style> |
| | |
| | | <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-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.is_default == 0" label="自动升级" :label-width="formLabelWidth" prop="auto_upgrade"> |
| | | <el-radio-group v-model="form.auto_upgrade"> |
| | | <el-radio :label="1">允许自动升级</el-radio> |
| | |
| | | <span class="orange">¥{{ scope.row.agent_money }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <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.viewpoint_money }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="operating_subsidy" label="VIP专区补贴" > |
| | | <template slot-scope="scope"> |
| | | <span class="orange">{{ scope.row.operating_subsidy }}%</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="operating_subsidy" label="平台直推佣金" > |
| | | <template slot-scope="scope"> |
| | | <span class="orange">{{ scope.row.commission }}%</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="operating_subsidy" label="平台直推佣金" > |
| | |
| | | </el-input> |
| | | <div class="tips">用户直推指定数量的用户后,即可享受平台佣金</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="见点奖条件" name="second"> |
| | | <label>推荐VIP会员人数</label> |
| | | <el-input v-model="form.viewpoint_buy_count" type="number" class="max-w460"> |
| | | <template slot="append">人</template> |
| | | </el-input> |
| | | <label>每月复购专区消费</label> |
| | | <el-input v-model="form.repurchase_consumption" type="number" class="max-w460"> |
| | | <template slot="append">元</template> |
| | | </el-input> |
| | | <div class="tips">用户满足条件后,即可享受见点奖</div> |
| | | </el-form-item> |
| | | <!--提交--> |
| | | <div class="common-button-wrapper"> |
| | | <el-button size="small" type="primary" @click="onSubmit" :loading="loading">提交</el-button> |
| | |
| | | </el-table> |
| | | </div> |
| | | </el-form-item> |
| | | <div v-if="form.model.is_repurchase" class="common-form">见点奖设置</div> |
| | | <el-form-item label="见点奖设置:" v-if="form.model.is_repurchase"> |
| | | <el-radio-group v-model="form.model.is_viewpoint_money"> |
| | | <el-radio :label="0">平台规则</el-radio> |
| | | <el-radio :label="1">单独规则</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.model.is_viewpoint_money == 1" label="见点奖:" :rules="[{ required: true, message: ' ' }]" prop="model.viewpoint_money"> |
| | | <el-input type="number" min="0" v-model="form.model.viewpoint_money" class="max-w460"></el-input> |
| | | </el-form-item> |
| | | <!--分红比例设置--> |
| | | <div class="common-form mt50">分红比例设置</div> |
| | | <el-form-item label="分红比例设置:"> |
| | |
| | | </div> |
| | | <div class="tips">如设置了是,则该商户的订单按该商户后台设置的支付信息来收款</div> |
| | | </el-form-item> |
| | | <el-form-item label="是否是新人专区" :label-width="formLabelWidth"> |
| | | <el-radio-group v-model="form.supplier.is_newcomer"> |
| | | <el-radio :label="1">是</el-radio> |
| | | <el-radio :label="0">否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="是否是复购专区" :label-width="formLabelWidth"> |
| | | <el-radio-group v-model="form.supplier.is_repurchase"> |
| | | <el-radio :label="1">是</el-radio> |
| | | <el-radio :label="0">否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="营业时间"> |
| | | <el-time-picker v-model="form.supplier.business_start_time" placeholder="选择营业开始时间" format="HH:mm" value-format="HH:mm"> |
| | | </el-time-picker>至 |
| | |
| | | is_alone_commission_rate:0, |
| | | commission_rate:0, |
| | | area_id:'', |
| | | is_independent:0 |
| | | is_independent:0, |
| | | is_newcomer:0 |
| | | ,is_repurchase:0 |
| | | }, |
| | | }, |
| | | logo_file_path: '', |
| | |
| | | </div> |
| | | <div class="tips">如设置了是,则该商户的订单按该商户后台设置的支付信息来收款</div> |
| | | </el-form-item> |
| | | <el-form-item label="是否是新人专区" :label-width="formLabelWidth"> |
| | | <el-radio-group v-model="form.supplier.is_newcomer"> |
| | | <el-radio :label="1">是</el-radio> |
| | | <el-radio :label="0">否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="是否是复购专区" :label-width="formLabelWidth"> |
| | | <el-radio-group v-model="form.supplier.is_repurchase"> |
| | | <el-radio :label="1">是</el-radio> |
| | | <el-radio :label="0">否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="营业时间"> |
| | | <el-time-picker v-model="form.supplier.business_start_time" placeholder="选择营业开始时间" format="HH:mm" value-format="HH:mm"> |
| | | </el-time-picker>至 |
| | |
| | | is_alone_commission_rate:0, |
| | | commission_rate:0, |
| | | area_id:'', |
| | | is_independent:0 |
| | | is_independent:0, |
| | | is_newcomer:0, |
| | | is_repurchase:0 |
| | | }, |
| | | }, |
| | | logo_file_path: '', |
| New file |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | let SupplierApi = { |
| | | /*供应商列表*/ |
| | | supplierList(data, errorback) { |
| | | return request._post('/supplier/supplier.supplier/index', data, errorback); |
| | | }, |
| | | /*添加供应商*/ |
| | | toaddSupplier(data, errorback) { |
| | | return request._get('/supplier/supplier.supplier/add', data, errorback); |
| | | }, |
| | | /*添加供应商*/ |
| | | addSupplier(data, errorback) { |
| | | return request._post('/supplier/supplier.supplier/add', data, errorback); |
| | | }, |
| | | /*供应商编辑*/ |
| | | toEditSupplier(data, errorback) { |
| | | return request._get('/supplier/supplier.supplier/edit', data, errorback); |
| | | }, |
| | | /*供应商编辑*/ |
| | | editSupplier(data, errorback) { |
| | | return request._post('/supplier/supplier.supplier/edit', data, errorback); |
| | | }, |
| | | /*删除供应商*/ |
| | | deleteSupplier(data, errorback) { |
| | | return request._post('/supplier/supplier.supplier/delete', data, errorback); |
| | | }, |
| | | /*提现记录*/ |
| | | cashList(data, errorback) { |
| | | return request._post('/supplier/supplier.cash/index', data, errorback); |
| | | }, |
| | | /*提现审核*/ |
| | | cashSubmit(data, errorback) { |
| | | return request._post('/supplier/supplier.cash/submit', data, errorback); |
| | | }, |
| | | /*提现确认打款*/ |
| | | cashMoney(data, errorback) { |
| | | return request._post('/supplier/supplier.cash/money', data, errorback); |
| | | }, |
| | | /*供应商待审核列表*/ |
| | | supplierPendList(data, errorback) { |
| | | return request._post('/supplier/supplier.supplier/apply', data, errorback); |
| | | }, |
| | | /*供应商审核详情*/ |
| | | toAudit(data, errorback) { |
| | | return request._get('/supplier/supplier.supplier/audit', data, errorback); |
| | | }, |
| | | /*供应商审核*/ |
| | | audit(data, errorback) { |
| | | return request._post('/supplier/supplier.supplier/audit', data, errorback); |
| | | }, |
| | | /*获取主营分类*/ |
| | | Category(data, errorback) { |
| | | return request._post('/supplier/supplier.Category/index', data, errorback); |
| | | }, |
| | | /*添加分类*/ |
| | | addCategory(data, errorback) { |
| | | return request._post('/supplier/supplier.Category/add', data, errorback); |
| | | }, |
| | | /*编辑分类*/ |
| | | editCategory(data, errorback) { |
| | | return request._post('/supplier/supplier.Category/edit', data, errorback); |
| | | }, |
| | | /*删除分类*/ |
| | | deleteCategory(data, errorback) { |
| | | return request._post('/supplier/supplier.Category/delete', data, errorback); |
| | | }, |
| | | /*押金列表*/ |
| | | supplierOrder(data, errorback) { |
| | | return request._post('/supplier/supplier.Order/index', data, errorback); |
| | | }, |
| | | /*押金列表*/ |
| | | refundList(data, errorback) { |
| | | return request._post('/supplier/supplier.supplier/refund', data, errorback); |
| | | }, |
| | | /*退押金操作*/ |
| | | refundSubmit(data, errorback) { |
| | | return request._post('/supplier/supplier.supplier/submit', data, errorback); |
| | | }, |
| | | /*服务保障申请列表*/ |
| | | securityList(data, errorback) { |
| | | return request._post('/supplier/supplier.supplier/security', data, errorback); |
| | | }, |
| | | /*服务保障操作*/ |
| | | securityVerify(data, errorback) { |
| | | return request._post('/supplier/supplier.supplier/verify', data, errorback); |
| | | }, |
| | | /*获取广告分类*/ |
| | | SecurityList(data, errorback) { |
| | | return request._post('/supplier/supplier.Security/index', data, errorback); |
| | | }, |
| | | /*添加分类*/ |
| | | addSecurity(data, errorback) { |
| | | return request._post('/supplier/supplier.Security/add', data, errorback); |
| | | }, |
| | | /*编辑分类*/ |
| | | editSecurity(data, errorback) { |
| | | return request._post('/supplier/supplier.Security/edit', data, errorback); |
| | | }, |
| | | /*删除分类*/ |
| | | deleteSecurity(data, errorback) { |
| | | return request._post('/supplier/supplier.Security/delete', data, errorback); |
| | | }, |
| | | /*开启禁止*/ |
| | | supplierRecycle(data, errorback) { |
| | | return request._post('/supplier/supplier.supplier/recycle', data, errorback); |
| | | }, |
| | | /*获取区域*/ |
| | | Region(data, errorback) { |
| | | return request._post('/supplier/supplier.Area/index', data, errorback); |
| | | }, |
| | | /*添加区域*/ |
| | | addRegion(data, errorback) { |
| | | return request._post('/supplier/supplier.Area/add', data, errorback); |
| | | }, |
| | | /*编辑区域*/ |
| | | editRegion(data, errorback) { |
| | | return request._post('/supplier/supplier.Area/edit', data, errorback); |
| | | }, |
| | | /*删除区域*/ |
| | | deleteRegion(data, errorback) { |
| | | return request._post('/supplier/supplier.Area/delete', data, errorback); |
| | | }, |
| | | /*商户券数据统计*/ |
| | | supplierstatistics(data, errorback) { |
| | | return request._post('/supplier/supplier.supplier/statistics', data, errorback); |
| | | }, |
| | | } |
| | | export default SupplierApi; |
| New file |
| | |
| | | <template> |
| | | <!-- |
| | | 作者:lyzflash |
| | | 时间:2025-09-24 |
| | | 描述:组件-选择企业(商户) |
| | | --> |
| | | <el-dialog title="选择商户" :visible.sync="dialogVisible" @close="dialogFormVisible" :close-on-click-modal="false" :close-on-press-escape="false" width="900px" append-to-body> |
| | | <div class="common-seach-wrap"> |
| | | <el-form :inline="true" size="small" :model="formInline" class="demo-form-inline"> |
| | | <el-form-item label="商户名称"> |
| | | <el-input placeholder="请输入商户名称" v-model="formInline.search"> |
| | | <el-button slot="append" icon="el-icon-search" @click="getData">查询</el-button> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <!--内容--> |
| | | <div class="product-content"> |
| | | <div class="table-wrap"> |
| | | <el-table size="small" :data="supplierList" border style="width: 100%" highlight-current-row v-loading="loading" @selection-change="tableCurrentChange"> |
| | | <el-table-column prop="name" label="商户名称"></el-table-column> |
| | | <el-table-column prop="link_name" width="100" label="联系人"></el-table-column> |
| | | <el-table-column prop="link_phone" width="140" label="联系电话"></el-table-column> |
| | | <el-table-column prop="create_time" width="140" label="添加时间"></el-table-column> |
| | | <el-table-column type="selection" :selectable="selectableFunc" width="44" v-if="islist"></el-table-column> |
| | | <el-table-column width="80" label="单选" v-if="!islist"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" v-if="scope.row.noChoose" @click="SingleFunc(scope.row)">选择</el-button> |
| | | <el-button size="mini" v-else disabled>已选</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <!--分页--> |
| | | <div class="pagination"> |
| | | <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | background |
| | | :current-page="curPage" |
| | | :page-sizes="[2, 10, 20, 50, 100]" |
| | | :page-size="pageSize" |
| | | layout="total, prev, pager, next, jumper" |
| | | :total="totalDataNumber" |
| | | ></el-pagination> |
| | | </div> |
| | | </div> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button size="small" @click="dialogVisible=false">取 消</el-button> |
| | | <el-button size="small" type="primary" @click="onSubmit" v-if="islist">确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import SupplierApi from '@/api/supplier.js'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | /*是否加载完成*/ |
| | | loading: true, |
| | | /*当前是第几页*/ |
| | | curPage: 1, |
| | | /*一页多少条*/ |
| | | pageSize: 20, |
| | | /*一共多少条数据*/ |
| | | totalDataNumber: 0, |
| | | formInline: {}, |
| | | //商品分类列表 |
| | | cateList: [], |
| | | //商品列表 |
| | | supplierList: [], |
| | | multipleSelection: [], |
| | | /*左边长度*/ |
| | | formLabelWidth: '120px', |
| | | /*是否显示*/ |
| | | dialogVisible: false, |
| | | /*结果类别*/ |
| | | type:'error', |
| | | /*传出去的参数*/ |
| | | params:null |
| | | }; |
| | | }, |
| | | props: ['open', 'excludeIds','islist'], |
| | | watch:{ |
| | | open:function(n, o){ |
| | | if(n!=o) { |
| | | if(n) { |
| | | this.dialogVisible = n; |
| | | this.type = 'error'; |
| | | this.params = null; |
| | | this.getData(); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | methods: { |
| | | |
| | | /*是否可以勾选*/ |
| | | selectableFunc(e){ |
| | | if(typeof e.noChoose !=='boolean'){ |
| | | return true; |
| | | } |
| | | return e.noChoose; |
| | | }, |
| | | |
| | | /*选择第几页*/ |
| | | handleCurrentChange(val) { |
| | | this.curPage = val; |
| | | this.getData(); |
| | | }, |
| | | |
| | | /*每页多少条*/ |
| | | handleSizeChange(val) { |
| | | this.curPage = 1; |
| | | this.pageSize = val; |
| | | this.getData(); |
| | | }, |
| | | |
| | | /*获取商品列表*/ |
| | | getData() { |
| | | let self = this; |
| | | let params = self.formInline; |
| | | params.page = self.curPage; |
| | | params.list_rows = self.pageSize; |
| | | SupplierApi.supplierList(params, true) |
| | | .then(res => { |
| | | if (res.code == 1) { |
| | | self.loading = false; |
| | | // self.cateList = res.data.category; |
| | | /*判断是否需要去重*/ |
| | | if(self.excludeIds&&typeof(self.excludeIds)!='undefined'&&self.excludeIds.length>0){ |
| | | res.data.list.data.forEach(item=>{ |
| | | if(self.excludeIds.indexOf(item.shop_supplier_id)>-1){ |
| | | item.noChoose=false; |
| | | } else { |
| | | item.noChoose=true; |
| | | } |
| | | }); |
| | | } else { |
| | | if(!self.islist){ |
| | | res.data.list.data.forEach(item=>{ |
| | | item.noChoose=true; |
| | | }); |
| | | } |
| | | } |
| | | self.supplierList = res.data.list.data; |
| | | self.totalDataNumber = res.data.list.total; |
| | | } |
| | | }) |
| | | .catch(error => {}); |
| | | }, |
| | | |
| | | /*单选*/ |
| | | SingleFunc(row){ |
| | | this.multipleSelection=[row]; |
| | | this.onSubmit(); |
| | | }, |
| | | |
| | | //点击确定 |
| | | onSubmit() { |
| | | let self = this; |
| | | let params = null; |
| | | let type = 'success'; |
| | | if (self.multipleSelection.length < 1) { |
| | | self.$message({ |
| | | message: '请至少选择一个商户!', |
| | | type: 'error' |
| | | }); |
| | | return; |
| | | } |
| | | if (self.islist&&typeof(self.islist) != 'undefined') { |
| | | params = self.multipleSelection; |
| | | } else { |
| | | params = self.multipleSelection[0]; |
| | | } |
| | | self.params = params; |
| | | self.type = 'success'; |
| | | self.dialogVisible = false; |
| | | }, |
| | | |
| | | /*关闭弹窗*/ |
| | | dialogFormVisible() { |
| | | this.$emit('close', { |
| | | type: this.type, |
| | | openDialog: false, |
| | | params: this.params |
| | | }); |
| | | }, |
| | | |
| | | /*监听复选按钮选中事件*/ |
| | | tableCurrentChange(val) { |
| | | this.multipleSelection = val; |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | .no-list .el-checkbox{ display: none;} |
| | | </style> |
| | |
| | | virtual_auto: 0, |
| | | /*虚拟商品发货内容*/ |
| | | virtual_content: '', |
| | | /*商品预告*/ |
| | | /*商品预告*/ |
| | | is_preview: 0, |
| | | /*商品预告时间*/ |
| | | preview_time: '', |
| | |
| | | verify_time: [], |
| | | // 可核销门店 |
| | | verify_store_ids: [], |
| | | // 是否开启单独见点奖设置 |
| | | is_viewpoint_money: 0, |
| | | // 见点奖 |
| | | viewpoint_money: 0, |
| | | belonging_shop_supplier_id:0, |
| | | }, |
| | | /*商品分类*/ |
| | | category: [], |
| | |
| | | agentSetting: {}, |
| | | audit_setting: {}, |
| | | verifyStoreList: [], |
| | | is_newcomer: 0, |
| | | is_repurchase: 0, |
| | | } |
| | | }; |
| | | }, |
| | |
| | | agentSetting: {}, |
| | | audit_setting: {}, |
| | | verifyStoreList: [], |
| | | is_newcomer: 0, |
| | | is_repurchase: 0, |
| | | }, |
| | | /*模型数据*/ |
| | | model: { |
| | | supplierName:'', |
| | | /*商品名称*/ |
| | | product_name: '', |
| | | /*商品分类*/ |
| | |
| | | virtual_auto: 0, |
| | | /*虚拟商品发货内容*/ |
| | | virtual_content: '', |
| | | /*商品预告*/ |
| | | /*商品预告*/ |
| | | is_preview: 0, |
| | | /*商品预告时间*/ |
| | | preview_time: '', |
| | |
| | | verify_store_ids: [], |
| | | verifyStoreList: [], |
| | | //自定义表单id |
| | | table_id: 0 |
| | | table_id: 0, |
| | | viewpoint_money: 0, |
| | | is_viewpoint_money: 0, |
| | | belonging_shop_supplier_id:0, |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | </template> |
| | | </el-select> |
| | | </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> |
| | | <div v-if="form.model.belonging_shop_supplier_id" class="mt10"> |
| | | <el-tag closable @close="clearSupplier">{{ form.supplierName }}</el-tag> |
| | | </div> |
| | | <div class="gray9">生成订单时归属的供应商,不选择则默认为当前供应商</div> |
| | | </el-row> |
| | | </el-form-item> |
| | | <el-form-item label="预告商品:"> |
| | | <el-radio-group v-model="form.model.is_preview"> |
| | | <el-radio :label="1">开启</el-radio> |
| | |
| | | <el-form-item label="商品属性:"> |
| | | <el-radio-group v-model="form.model.is_virtual"> |
| | | <el-radio :label="0">实物商品</el-radio> |
| | | <el-radio :label="1">虚拟商品(无需发货)</el-radio> |
| | | <el-radio :label="1">服务商品(无需发货)</el-radio> |
| | | <el-radio :label="2">券商品</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | |
| | | <el-radio :label="0">手动</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="虚拟内容:" :rules="[{ required: true, message: '请填写虚拟内容' }]" prop="model.virtual_content" v-if="form.model.is_virtual==1"> |
| | | <el-form-item label="服务商品:" :rules="[{ required: true, message: '请填写服务商品' }]" prop="model.virtual_content" v-if="form.model.is_virtual==1"> |
| | | <el-input type="text" v-model="form.model.virtual_content" class="max-w460"></el-input> |
| | | <div class="gray9">虚拟物品内容</div> |
| | | <div class="gray9">服务商品内容</div> |
| | | </el-form-item> |
| | | |
| | | <template v-if="form.model.virtual_auto==0&&form.model.is_virtual==1"> |
| | |
| | | <Upload v-if="isProductUpload" :config="config" :isupload="isProductUpload" @returnImgs="returnProductImgsFunc">上传图片</Upload> |
| | | <!--选择门店--> |
| | | <StoreSelect :isstore="isstore" :excludeIds="excludeStoreIds" :islist="isstorelist" @closeDialog="closeStoreDialogFunc($event)"></StoreSelect> |
| | | <!--选择供应商--> |
| | | <Supplier :open="isSupplierOpen" :islist="false" @close="closeSupplierFunc"></Supplier> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import Upload from '@/components/file/Upload'; |
| | | import draggable from 'vuedraggable'; |
| | | import StoreSelect from '@/components/store/StoreSelect'; |
| | | import Supplier from '@/components/supplier/Supplier.vue'; |
| | | export default { |
| | | components: { |
| | | Upload, |
| | | draggable, |
| | | StoreSelect |
| | | StoreSelect, |
| | | Supplier |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | isstorelist: true, |
| | | /*门店需要去重的*/ |
| | | excludeStoreIds: [], |
| | | /*是否显示供应商选择*/ |
| | | isSupplierOpen: false, |
| | | }; |
| | | }, |
| | | inject: ['form'], |
| | |
| | | self.form.verifyStoreList.splice(index, 1); |
| | | }, |
| | | |
| | | /*打开供应商选择*/ |
| | | openSupplier() { |
| | | this.isSupplierOpen = true; |
| | | }, |
| | | |
| | | /*关闭供应商选择*/ |
| | | closeSupplierFunc(e) { |
| | | this.isSupplierOpen = false; |
| | | if (e.type == 'success') { |
| | | this.form.model.belonging_shop_supplier_id = e.params.shop_supplier_id; |
| | | this.form.supplierName = e.params.name; |
| | | } |
| | | }, |
| | | |
| | | /*清除供应商*/ |
| | | clearSupplier() { |
| | | this.form.model.belonging_shop_supplier_id = null; |
| | | this.form.supplierName = ''; |
| | | } |
| | | |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | <el-input type="number" v-model="form.model.max_points_discount" class="max-w460"></el-input> |
| | | <div class="gray9">最大抵扣积分数量,-1为使用通用设置</div> |
| | | </el-form-item> |
| | | |
| | | <div v-if="form.is_repurchase" class="common-form">见点奖设置</div> |
| | | <el-form-item v-if="form.is_repurchase" label="见点奖设置:"> |
| | | <el-radio-group v-model="form.model.is_viewpoint_money"> |
| | | <el-radio :label="1">单独见点奖</el-radio> |
| | | <el-radio :label="0">默认见点奖</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.model.is_viewpoint_money == 1" label="见点奖:" :rules="[{ required: true, message: ' ' }]" prop="model.viewpoint_money"> |
| | | <el-input type="number" v-model="form.model.viewpoint_money" class="max-w460"></el-input> |
| | | </el-form-item> |
| | | <!--分销设置--> |
| | | <!-- <div class="common-form" v-if="form.basicSetting.is_open == 1">分销设置</div> |
| | | <el-form-item label="是否开启分销:" v-if="form.basicSetting.is_open == 1"> |
| | |
| | | </el-form-item> |
| | | </template> |
| | | </template> --> |
| | | |
| | | |
| | | <!--团队分红设置--> |
| | | <div class="common-form mt50">团队分红设置</div> |
| | | <el-form-item label="是否参与团队分红:"> |