fix: 完善后台信息审核与表单编辑规范,优化前端发布交互
这个提交包含在:
@@ -18,6 +18,8 @@ class Category extends Backend
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
protected $noNeedRight = ['selectpage'];
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
@@ -25,6 +27,16 @@ class Category extends Backend
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* SelectPage搜索(供信息/草稿表单选择同城分类)
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function selectpage()
|
||||
{
|
||||
return parent::selectpage();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -144,9 +144,7 @@ class Postaudit extends Backend
|
||||
'content' => $auditStatus === 1
|
||||
? sprintf('您发布的信息「%s」已通过审核并上架展示。', $post['title'])
|
||||
: sprintf('您发布的信息「%s」未通过审核,原因:%s', $post['title'], $reason),
|
||||
'target_id' => $post['id'],
|
||||
'target_type'=> 'post',
|
||||
'status' => 0,
|
||||
'isread' => 0,
|
||||
'createtime' => time(),
|
||||
]);
|
||||
|
||||
@@ -159,7 +157,7 @@ class Postaudit extends Backend
|
||||
}
|
||||
|
||||
$actionText = $auditStatus === 1 ? '审核通过' : '审核驳回';
|
||||
AdminLog::record(sprintf('%s,涉及 %d 条信息(成功 %d 条,跳过 %d 条)', $actionText, count($ids), $changed, $skipped));
|
||||
AdminLog::setTitle(sprintf('%s,涉及 %d 条信息(成功 %d 条,跳过 %d 条)', $actionText, count($ids), $changed, $skipped));
|
||||
|
||||
$msg = $changed > 0
|
||||
? sprintf('%s成功(已处理 %d 条)', $actionText, $changed)
|
||||
@@ -258,6 +256,22 @@ class Postaudit extends Backend
|
||||
return $this->view->fetch('fc/post/detail');
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核队列位置(供审核工作台显示「第 x / y 条」和上/下一条)
|
||||
* GET fc/postaudit/queue?id=123
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function queue()
|
||||
{
|
||||
$id = (int)$this->request->param('id', 0);
|
||||
$row = Db::name('fc_post')->where('id', $id)->whereNull('deletetime')->find();
|
||||
if (!$row) {
|
||||
$this->error('信息不存在或已删除');
|
||||
}
|
||||
$this->success('', null, $this->auditQueue($row));
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算待审核队列的上下文(第几条、总数、上一条、下一条)
|
||||
*
|
||||
|
||||
@@ -4,6 +4,9 @@ return [
|
||||
'Id' => 'ID',
|
||||
'User_id' => '发布者ID',
|
||||
'Category_id' => '分类ID',
|
||||
'Identity_type' => '发布身份',
|
||||
'Identity_type 1' => '个人',
|
||||
'Identity_type 2' => '商家',
|
||||
'Title' => '标题',
|
||||
'Content' => '内容',
|
||||
'Cover' => '封面图',
|
||||
|
||||
@@ -28,6 +28,7 @@ class FcPost extends Model
|
||||
protected $append = [
|
||||
'user_name',
|
||||
'category_name',
|
||||
'identity_type_text',
|
||||
];
|
||||
|
||||
public function getUserNameAttr($value, $data)
|
||||
@@ -40,6 +41,19 @@ class FcPost extends Model
|
||||
return FcRelation::categoryName(isset($data['category_id']) ? $data['category_id'] : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发布身份文本(个人 / 商家)
|
||||
*
|
||||
* @param mixed $value 字段原始值
|
||||
* @param array $data 行数据
|
||||
* @return string
|
||||
*/
|
||||
public function getIdentityTypeTextAttr($value, $data)
|
||||
{
|
||||
$type = isset($data['identity_type']) ? (int)$data['identity_type'] : 1;
|
||||
return $type === 2 ? '商家' : '个人';
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取多媒体相册属性(兼容 JSON 数组与逗号分隔格式,供后台上传控件预览)
|
||||
*
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Post_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-post_id" data-rule="required" min="0" data-source="post/index" class="form-control selectpage" name="row[post_id]" type="text" value="">
|
||||
<input id="c-post_id" data-rule="required" min="0" data-source="fc/post/index" data-field="title" class="form-control selectpage" name="row[post_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Post_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-post_id" data-rule="required" min="0" data-source="post/index" class="form-control selectpage" name="row[post_id]" type="text" value="{$row.post_id|htmlentities}">
|
||||
<input id="c-post_id" data-rule="required" min="0" data-source="fc/post/index" data-field="title" class="form-control selectpage" name="row[post_id]" type="text" value="{$row.post_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('From_user_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-from_user_id" data-rule="required" min="0" data-source="from/user/index" class="form-control selectpage" name="row[from_user_id]" type="text" value="">
|
||||
<input id="c-from_user_id" data-rule="required" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[from_user_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Order_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-order_id" data-rule="required" min="0" data-source="order/index" class="form-control selectpage" name="row[order_id]" type="text" value="">
|
||||
<input id="c-order_id" data-rule="required" min="0" data-source="fc/order/index" data-field="order_no" class="form-control selectpage" name="row[order_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('From_user_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-from_user_id" data-rule="required" min="0" data-source="from/user/index" class="form-control selectpage" name="row[from_user_id]" type="text" value="{$row.from_user_id|htmlentities}">
|
||||
<input id="c-from_user_id" data-rule="required" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[from_user_id]" type="text" value="{$row.from_user_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Order_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-order_id" data-rule="required" min="0" data-source="order/index" class="form-control selectpage" name="row[order_id]" type="text" value="{$row.order_id|htmlentities}">
|
||||
<input id="c-order_id" data-rule="required" min="0" data-source="fc/order/index" data-field="order_no" class="form-control selectpage" name="row[order_id]" type="text" value="{$row.order_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Parent_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-parent_id" data-rule="required" min="0" data-source="parent/index" class="form-control selectpage" name="row[parent_id]" type="text" value="">
|
||||
<input id="c-parent_id" data-rule="required" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[parent_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Parent_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-parent_id" data-rule="required" min="0" data-source="parent/index" class="form-control selectpage" name="row[parent_id]" type="text" value="{$row.parent_id|htmlentities}">
|
||||
<input id="c-parent_id" data-rule="required" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[parent_id]" type="text" value="{$row.parent_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-category_id" data-rule="required" data-source="category/selectpage" data-params='{"custom[type]":"fc_draft"}' class="form-control selectpage" name="row[category_id]" type="text" value="">
|
||||
<input id="c-category_id" data-rule="required" data-source="fc/category/selectpage" data-field="name" class="form-control selectpage" name="row[category_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-category_id" data-rule="required" data-source="category/selectpage" data-params='{"custom[type]":"fc_draft"}' class="form-control selectpage" name="row[category_id]" type="text" value="{$row.category_id|htmlentities}">
|
||||
<input id="c-category_id" data-rule="required" data-source="fc/category/selectpage" data-field="name" class="form-control selectpage" name="row[category_id]" type="text" value="{$row.category_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Related_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-related_id" data-rule="required" data-source="related/index" class="form-control selectpage" name="row[related_id]" type="text" value="">
|
||||
<input id="c-related_id" data-rule="required;integer" class="form-control" name="row[related_id]" type="number" min="0" value="" placeholder="关联业务ID:会员开通填订单ID、充值填用户ID、发布填信息ID">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Related_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-related_id" data-rule="required" data-source="related/index" class="form-control selectpage" name="row[related_id]" type="text" value="{$row.related_id|htmlentities}">
|
||||
<input id="c-related_id" data-rule="required;integer" class="form-control" name="row[related_id]" type="number" min="0" value="{$row.related_id|htmlentities}" placeholder="关联业务ID:会员开通填订单ID、充值填用户ID、发布填信息ID">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Related_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-related_id" data-rule="required" data-source="related/index" class="form-control selectpage" name="row[related_id]" type="text" value="">
|
||||
<input id="c-related_id" data-rule="required;integer" class="form-control" name="row[related_id]" type="number" min="0" value="" placeholder="按订单类型填写:信息ID / 套餐ID / 付费查看ID,充值订单填 0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Related_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-related_id" data-rule="required" data-source="related/index" class="form-control selectpage" name="row[related_id]" type="text" value="{$row.related_id|htmlentities}">
|
||||
<input id="c-related_id" data-rule="required;integer" class="form-control" name="row[related_id]" type="number" min="0" value="{$row.related_id|htmlentities}" placeholder="按订单类型填写:信息ID / 套餐ID / 付费查看ID,充值订单填 0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Post_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-post_id" data-rule="required" min="0" data-source="post/index" class="form-control selectpage" name="row[post_id]" type="text" value="">
|
||||
<input id="c-post_id" data-rule="required" min="0" data-source="fc/post/index" data-field="title" class="form-control selectpage" name="row[post_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Order_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-order_id" data-rule="required" min="0" data-source="order/index" class="form-control selectpage" name="row[order_id]" type="text" value="">
|
||||
<input id="c-order_id" data-rule="required" min="0" data-source="fc/order/index" data-field="order_no" class="form-control selectpage" name="row[order_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Post_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-post_id" data-rule="required" min="0" data-source="post/index" class="form-control selectpage" name="row[post_id]" type="text" value="{$row.post_id|htmlentities}">
|
||||
<input id="c-post_id" data-rule="required" min="0" data-source="fc/post/index" data-field="title" class="form-control selectpage" name="row[post_id]" type="text" value="{$row.post_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Order_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-order_id" data-rule="required" min="0" data-source="order/index" class="form-control selectpage" name="row[order_id]" type="text" value="{$row.order_id|htmlentities}">
|
||||
<input id="c-order_id" data-rule="required" min="0" data-source="fc/order/index" data-field="order_no" class="form-control selectpage" name="row[order_id]" type="text" value="{$row.order_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-4">所属分类 <span class="text-danger">*</span>:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-category_id" data-rule="required" data-source="category/selectpage" data-params='{"custom[type]":"fc_post"}' class="form-control selectpage" name="row[category_id]" type="text" value="" placeholder="请选择分类">
|
||||
<input id="c-category_id" data-rule="required" data-source="fc/category/selectpage" data-field="name" class="form-control selectpage" name="row[category_id]" type="text" value="" placeholder="请选择分类">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -26,6 +26,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-4">发布身份 <span class="text-danger">*</span>:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="radio-group" style="padding-top:7px;">
|
||||
<label class="radio-inline"><input type="radio" name="row[identity_type]" value="1" checked> <span class="label label-info"><i class="fa fa-user"></i> 个人</span></label>
|
||||
<label class="radio-inline"><input type="radio" name="row[identity_type]" value="2"> <span class="label label-warning"><i class="fa fa-briefcase"></i> 商家</span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">信息标题 <span class="text-danger">*</span>:</label>
|
||||
<div class="col-xs-12 col-sm-10">
|
||||
|
||||
@@ -100,9 +100,9 @@
|
||||
{if empty($mediaList)}
|
||||
<div style="text-align: center; color: #94A3B8; padding: 20px;">用户未上传任何附加图片</div>
|
||||
{else /}
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 12px;">
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 12px;" class="fc-media-gallery">
|
||||
{volist name="mediaList" id="media"}
|
||||
<a href="{$media}" target="_blank" title="点击查看大图" style="display: block; width: 110px; height: 110px; border-radius: 6px; overflow: hidden; border: 1px solid #E2E8F0; background: #000;">
|
||||
<a href="{$media}" class="fc-media-preview" target="_blank" title="点击预览大图" style="display: block; width: 110px; height: 110px; border-radius: 6px; overflow: hidden; border: 1px solid #E2E8F0; background: #000;">
|
||||
<img src="{$media}" style="width: 100%; height: 100%; object-fit: cover;">
|
||||
</a>
|
||||
{/volist}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-4">所属分类 <span class="text-danger">*</span>:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-category_id" data-rule="required" data-source="category/selectpage" data-params='{"custom[type]":"fc_post"}' class="form-control selectpage" name="row[category_id]" type="text" value="{$row.category_id|htmlentities}" placeholder="请选择分类">
|
||||
<input id="c-category_id" data-rule="required" data-source="fc/category/selectpage" data-field="name" class="form-control selectpage" name="row[category_id]" type="text" value="{$row.category_id|htmlentities}" placeholder="请选择分类">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -26,6 +26,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-4">发布身份 <span class="text-danger">*</span>:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="radio-group" style="padding-top:7px;">
|
||||
<label class="radio-inline"><input type="radio" name="row[identity_type]" value="1" {if !isset($row.identity_type) || $row.identity_type != 2}checked{/if}> <span class="label label-info"><i class="fa fa-user"></i> 个人</span></label>
|
||||
<label class="radio-inline"><input type="radio" name="row[identity_type]" value="2" {if isset($row.identity_type) && $row.identity_type == 2}checked{/if}> <span class="label label-warning"><i class="fa fa-briefcase"></i> 商家</span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">信息标题 <span class="text-danger">*</span>:</label>
|
||||
<div class="col-xs-12 col-sm-10">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Target_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-target_id" data-rule="required" data-source="target/index" class="form-control selectpage" name="row[target_id]" type="text" value="">
|
||||
<input id="c-target_id" data-rule="required;integer" class="form-control" name="row[target_id]" type="number" min="1" value="" placeholder="填写举报对象对应的ID(信息ID / 评论ID 等)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -21,7 +21,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Reporter_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-reporter_id" data-rule="required" min="0" data-source="reporter/index" class="form-control selectpage" name="row[reporter_id]" type="text" value="">
|
||||
<input id="c-reporter_id" data-rule="required" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[reporter_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Target_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-target_id" data-rule="required" data-source="target/index" class="form-control selectpage" name="row[target_id]" type="text" value="{$row.target_id|htmlentities}">
|
||||
<input id="c-target_id" data-rule="required;integer" class="form-control" name="row[target_id]" type="number" min="1" value="{$row.target_id|htmlentities}" placeholder="填写举报对象对应的ID(信息ID / 评论ID 等)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -21,7 +21,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Reporter_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-reporter_id" data-rule="required" min="0" data-source="reporter/index" class="form-control selectpage" name="row[reporter_id]" type="text" value="{$row.reporter_id|htmlentities}">
|
||||
<input id="c-reporter_id" data-rule="required" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[reporter_id]" type="text" value="{$row.reporter_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Inviter_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-inviter_id" data-rule="required" min="0" data-source="inviter/index" class="form-control selectpage" name="row[inviter_id]" type="text" value="">
|
||||
<input id="c-inviter_id" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[inviter_id]" type="text" value="" placeholder="不填写表示无邀请人">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Inviter_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-inviter_id" data-rule="required" min="0" data-source="inviter/index" class="form-control selectpage" name="row[inviter_id]" type="text" value="{$row.inviter_id|htmlentities}">
|
||||
<input id="c-inviter_id" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[inviter_id]" type="text" value="{$row.inviter_id|htmlentities}" placeholder="不填写表示无邀请人">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -89,7 +89,7 @@ class FcConfig
|
||||
],
|
||||
'fc_member' => [
|
||||
'name' => 'fc_member',
|
||||
'title' => '会员配置',
|
||||
'title' => '会员权益配置',
|
||||
'active' => false,
|
||||
'list' => [
|
||||
self::item('fc_member_freeView', '每日免费查看条数', 'number', $freeView, '会员每日可免费查看联系方式条数(默认 20 条)', 'required;number'),
|
||||
|
||||
@@ -306,7 +306,7 @@ return [
|
||||
//允许跨域的域名,多个以,分隔
|
||||
'cors_request_domain' => 'localhost,127.0.0.1',
|
||||
//版本号
|
||||
'version' => '1.7.1.20261021',
|
||||
'version' => '1.7.1.20261023',
|
||||
//API接口地址
|
||||
'api_url' => 'https://api.fastadmin.net',
|
||||
],
|
||||
|
||||
@@ -201,6 +201,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
return row.category_name ? '<span class="label label-default" style="font-weight:normal;background:#eef4f1;color:#16382b;">' + esc(row.category_name) + '</span>' : '-';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'identity_type',
|
||||
title: '发布身份',
|
||||
align: 'center',
|
||||
width: '85px',
|
||||
searchList: {1: '个人', 2: '商家'},
|
||||
formatter: function (value, row) {
|
||||
var val = Number(value || (row && row.identity_type) || 1);
|
||||
if (val === 2) {
|
||||
return '<span class="label" style="background:#FEF3C7;color:#B45309;border:1px solid #FDE68A;font-weight:600;"><i class="fa fa-briefcase"></i> 商家</span>';
|
||||
}
|
||||
return '<span class="label" style="background:#E0F2FE;color:#0369A1;border:1px solid #BAE6FD;font-weight:normal;"><i class="fa fa-user"></i> 个人</span>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'price',
|
||||
title: '价格',
|
||||
@@ -516,6 +530,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹出通过二次确认弹层
|
||||
*/
|
||||
function askPass() {
|
||||
Layer.confirm('确认该信息内容及资质合规,通过审核并正式上架?', {
|
||||
title: '审核通过确认',
|
||||
btn: ['确认通过', '取消'],
|
||||
icon: 3
|
||||
}, function (index) {
|
||||
Layer.close(index);
|
||||
submitAudit(1, '');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 快捷键:A 通过 / R 驳回 / ← → 切换 / Esc 关闭
|
||||
* 若当前有弹层(如驳回原因输入框)则不响应,避免误触
|
||||
@@ -530,7 +558,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
var key = (e.key || '').toLowerCase();
|
||||
if (key === 'a') {
|
||||
e.preventDefault();
|
||||
submitAudit(1, '');
|
||||
askPass();
|
||||
} else if (key === 'r') {
|
||||
e.preventDefault();
|
||||
askReject();
|
||||
@@ -558,7 +586,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
}
|
||||
|
||||
$('#btn-pass').off('click').on('click', function () {
|
||||
submitAudit(1, '');
|
||||
askPass();
|
||||
});
|
||||
$('#btn-reject').off('click').on('click', function () {
|
||||
askReject();
|
||||
|
||||
@@ -122,6 +122,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
return row.category_name ? '<span class="label label-default" style="font-weight:normal;background:#eef4f1;color:#16382b;">' + esc(row.category_name) + '</span>' : '-';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'identity_type',
|
||||
title: '发布身份',
|
||||
align: 'center',
|
||||
width: '85px',
|
||||
searchList: {1: '个人', 2: '商家'},
|
||||
formatter: function (value, row) {
|
||||
var val = Number(value || (row && row.identity_type) || 1);
|
||||
if (val === 2) {
|
||||
return '<span class="label" style="background:#FEF3C7;color:#B45309;border:1px solid #FDE68A;font-weight:600;"><i class="fa fa-briefcase"></i> 商家</span>';
|
||||
}
|
||||
return '<span class="label" style="background:#E0F2FE;color:#0369A1;border:1px solid #BAE6FD;font-weight:normal;"><i class="fa fa-user"></i> 个人</span>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'price',
|
||||
title: '价格',
|
||||
@@ -279,6 +293,214 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 审核工作台与详情弹窗交互逻辑
|
||||
*
|
||||
* 负责通过/驳回操作、快捷键监听(A/R/左右方向键)、上下条切换及父窗口列表刷新
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
detail: function () {
|
||||
var postId = Fast.api.query('ids') || Fast.api.query('id');
|
||||
var queue = window.postQueue || {index: 0, total: 0, prev: 0, next: 0};
|
||||
var esc = Controller.api.esc;
|
||||
|
||||
/**
|
||||
* 刷新父页面表格
|
||||
*/
|
||||
function refreshParent() {
|
||||
try {
|
||||
if (parent.$ && parent.$('.btn-refresh').length) {
|
||||
parent.$('.btn-refresh').trigger('click');
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭当前弹窗
|
||||
*/
|
||||
function closeDialog() {
|
||||
refreshParent();
|
||||
Fast.api.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换到上一条/下一条待审信息
|
||||
*
|
||||
* @param {string} dir 'prev' | 'next'
|
||||
*/
|
||||
function go(dir) {
|
||||
var id = dir === 'prev' ? queue.prev : queue.next;
|
||||
if (!id) {
|
||||
Toastr.info(dir === 'prev' ? '已经是第一条了' : '已经是最后一条了');
|
||||
return;
|
||||
}
|
||||
location.href = Fast.api.fixurl('fc/postaudit/detail') + '?ids=' + id + '&mode=audit&dialog=1';
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核完成后更新队列:若存在下一条则直接切入,否则提示完成并关闭窗口
|
||||
*/
|
||||
function afterAudit() {
|
||||
refreshParent();
|
||||
Fast.api.ajax({
|
||||
url: 'fc/postaudit/queue',
|
||||
type: 'GET',
|
||||
loading: false,
|
||||
data: {id: postId}
|
||||
}, function (data, ret) {
|
||||
queue = ret.data || queue;
|
||||
if (queue.next) {
|
||||
go('next');
|
||||
} else {
|
||||
Toastr.success('待审核队列已处理完');
|
||||
Fast.api.close();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交审核结果
|
||||
*
|
||||
* @param {number} status 1=通过, 2=驳回
|
||||
* @param {string} reason 驳回原因
|
||||
*/
|
||||
function submitAudit(status, reason) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/postaudit/audit',
|
||||
data: {
|
||||
ids: postId,
|
||||
auditStatus: status,
|
||||
reason: reason || ''
|
||||
}
|
||||
}, function (data, ret) {
|
||||
Toastr.success(ret.msg || '操作成功');
|
||||
afterAudit();
|
||||
return false;
|
||||
}, function (data, ret) {
|
||||
Toastr.error(ret.msg || '操作失败');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
// 纯查看模式时仅绑定关闭事件
|
||||
if (!$('#btn-pass').length) {
|
||||
$('#btn-close').off('click').on('click', function () {
|
||||
closeDialog();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹出通过二次确认弹层
|
||||
*/
|
||||
function askPass() {
|
||||
Layer.confirm('确认该信息内容及资质合规,通过审核并正式上架?', {
|
||||
title: '审核通过确认',
|
||||
btn: ['确认通过', '取消'],
|
||||
icon: 3
|
||||
}, function (index) {
|
||||
Layer.close(index);
|
||||
submitAudit(1, '');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹出驳回理由选择/输入弹层
|
||||
*/
|
||||
function askReject() {
|
||||
Controller.api.askReason({
|
||||
title: '驳回原因',
|
||||
tip: '请选择或填写驳回原因,原因会通过站内信通知发布用户。',
|
||||
presets: ['虚假或欺诈信息', '联系方式违规', '重复发布', '类目选择错误', '内容含违规词', '图片不合规'],
|
||||
okText: '确认驳回'
|
||||
}, function (reason) {
|
||||
submitAudit(2, reason);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 全局快捷键监听:A 通过 · R 驳回 · ← → 切换 · Esc 关闭
|
||||
*/
|
||||
$(document).off('keydown.postAudit').on('keydown.postAudit', function (e) {
|
||||
if ($(e.target).is('input, textarea, select')) {
|
||||
return;
|
||||
}
|
||||
if ($('.layui-layer').length > 0) {
|
||||
return;
|
||||
}
|
||||
var key = (e.key || '').toLowerCase();
|
||||
if (key === 'a') {
|
||||
e.preventDefault();
|
||||
askPass();
|
||||
} else if (key === 'r') {
|
||||
e.preventDefault();
|
||||
askReject();
|
||||
} else if (key === 'arrowleft') {
|
||||
e.preventDefault();
|
||||
go('prev');
|
||||
} else if (key === 'arrowright') {
|
||||
e.preventDefault();
|
||||
go('next');
|
||||
} else if (key === 'escape') {
|
||||
e.preventDefault();
|
||||
closeDialog();
|
||||
}
|
||||
});
|
||||
|
||||
// 绑定工作台底部按钮事件
|
||||
$('#btn-pass').off('click').on('click', function () {
|
||||
askPass();
|
||||
});
|
||||
$('#btn-reject').off('click').on('click', function () {
|
||||
askReject();
|
||||
});
|
||||
$('#btn-close').off('click').on('click', function () {
|
||||
closeDialog();
|
||||
});
|
||||
$('#btn-prev').off('click').on('click', function () {
|
||||
go('prev');
|
||||
});
|
||||
$('#btn-next').off('click').on('click', function () {
|
||||
go('next');
|
||||
});
|
||||
|
||||
// 送审图片相册画廊大图预览
|
||||
$('.fc-detail-container').on('click', '.fc-media-preview', function (e) {
|
||||
e.preventDefault();
|
||||
var photos = [];
|
||||
var currentSrc = $(this).attr('href');
|
||||
var startIndex = 0;
|
||||
$('.fc-media-preview').each(function (i) {
|
||||
var src = $(this).attr('href');
|
||||
if (src) {
|
||||
photos.push({src: src, thumb: src});
|
||||
if (src === currentSrc) {
|
||||
startIndex = i;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (photos.length > 0) {
|
||||
Layer.photos({
|
||||
photos: {
|
||||
title: '送审图片质检',
|
||||
start: startIndex,
|
||||
data: photos
|
||||
},
|
||||
anim: 5
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 页面加载后自动聚焦主窗口,保证快捷键开箱即用
|
||||
try {
|
||||
document.body.focus();
|
||||
} catch (e) {
|
||||
}
|
||||
},
|
||||
|
||||
api: {
|
||||
/**
|
||||
* HTML 转义防注入
|
||||
|
||||
@@ -279,10 +279,12 @@ export default {
|
||||
uni.navigateTo({ url: `/pages/detail/detail?id=${p.id}` })
|
||||
},
|
||||
/**
|
||||
* 跳转到信息发布页
|
||||
* 跳转到信息发布页(自动携带当前选中的分类参数)
|
||||
*/
|
||||
goCreate() {
|
||||
uni.navigateTo({ url: '/pages/post/create' })
|
||||
const targetCatId = Number(this.categoryId || this.fixedCategoryId || 0)
|
||||
const url = targetCatId > 0 ? `/pages/post/create?categoryId=${targetCatId}` : '/pages/post/create'
|
||||
uni.navigateTo({ url })
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -29,10 +29,11 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 2. 发布身份选择(仅已认证商家展示,个人 / 商家二选一) -->
|
||||
<view v-if="isMerchantUser" class="fc-card create__section">
|
||||
<!-- 2. 发布身份选择(个人 / 商家二选一,未认证商家同样展示并支持跳转认证) -->
|
||||
<view class="fc-card create__section">
|
||||
<view class="create__label-row">
|
||||
<text class="create__label">发布身份</text>
|
||||
<text v-if="!isMerchantUser" class="create__label-tip">认证商家享专属标识与引流</text>
|
||||
</view>
|
||||
<view class="create__identity-group">
|
||||
<view
|
||||
@@ -41,18 +42,23 @@
|
||||
@click="switchIdentity('person')"
|
||||
>
|
||||
<text class="create__identity-title">个人</text>
|
||||
<text class="create__identity-desc">发布便民信息</text>
|
||||
<text class="create__identity-desc">发布便民闲置信息</text>
|
||||
</view>
|
||||
<view
|
||||
class="create__identity-item"
|
||||
:class="{ 'create__identity-item--active': form.identityType === 'merchant' }"
|
||||
:class="{
|
||||
'create__identity-item--active': form.identityType === 'merchant',
|
||||
'create__identity-item--unauth': !isMerchantUser
|
||||
}"
|
||||
@click="switchIdentity('merchant')"
|
||||
>
|
||||
<view class="create__identity-title-row">
|
||||
<text class="create__identity-title">商家</text>
|
||||
<text class="create__merchant-badge">已认证</text>
|
||||
<text class="create__merchant-badge" :class="'create__merchant-badge--' + merchantBadgeClass">
|
||||
{{ merchantBadgeText }}
|
||||
</text>
|
||||
</view>
|
||||
<text class="create__identity-desc fc-ellipsis">{{ merchantShopName || '展示店铺信息' }}</text>
|
||||
<text class="create__identity-desc fc-ellipsis">{{ merchantDescText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -356,14 +362,14 @@
|
||||
v-for="c in categories"
|
||||
:key="c.id"
|
||||
class="cat-drawer__item"
|
||||
:class="{ 'cat-drawer__item--active': form.categoryId === c.id }"
|
||||
:class="{ 'cat-drawer__item--active': Number(form.categoryId) === Number(c.id) }"
|
||||
@click="onSelectDrawerCat(c)"
|
||||
>
|
||||
<view class="cat-drawer__icon-box">
|
||||
<image class="cat-drawer__icon" :src="catIcon(c)" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="cat-drawer__name">{{ c.name }}</text>
|
||||
<view v-if="form.categoryId === c.id" class="cat-drawer__check">✓</view>
|
||||
<view v-if="Number(form.categoryId) === Number(c.id)" class="cat-drawer__check">✓</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cat-drawer__space"></view>
|
||||
@@ -446,27 +452,87 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
/** 当前用户是否已认证为商家 */
|
||||
/**
|
||||
* 当前用户是否已认证为商家
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isMerchantUser() {
|
||||
try {
|
||||
const u = useUserStore().state.userInfo
|
||||
return !!(u && (u.isMerchant || u.merchantStatus === 1))
|
||||
return !!(u && (u.isMerchant || Number(u.merchantStatus) === 1))
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
/** 商家店铺名称 */
|
||||
/**
|
||||
* 商家资质审核状态
|
||||
* @returns {number} -1未申请, 0审核中, 1已通过, 2未通过
|
||||
*/
|
||||
merchantAuditStatus() {
|
||||
try {
|
||||
const u = useUserStore().state.userInfo
|
||||
if (u && u.merchantStatus != null) {
|
||||
return Number(u.merchantStatus)
|
||||
}
|
||||
if (u && u.isMerchant) return 1
|
||||
return -1
|
||||
} catch (e) {
|
||||
return -1
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 商家店铺名称
|
||||
* @returns {string}
|
||||
*/
|
||||
merchantShopName() {
|
||||
try {
|
||||
const u = useUserStore().state.userInfo
|
||||
return (u && u.merchant && u.merchant.shop_name) || ''
|
||||
return (u && u.merchant && (u.merchant.shop_name || u.merchant.name)) || ''
|
||||
} catch (e) {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
/** 当前选中的分类对象 */
|
||||
/**
|
||||
* 商家身份徽章展示文案
|
||||
* @returns {string}
|
||||
*/
|
||||
merchantBadgeText() {
|
||||
if (this.isMerchantUser) return '已认证'
|
||||
const s = this.merchantAuditStatus
|
||||
if (s === 0) return '审核中'
|
||||
if (s === 2) return '未通过'
|
||||
return '去认证'
|
||||
},
|
||||
/**
|
||||
* 商家身份徽章样式类名
|
||||
* @returns {'approved'|'pending'|'rejected'|'unauth'}
|
||||
*/
|
||||
merchantBadgeClass() {
|
||||
if (this.isMerchantUser) return 'approved'
|
||||
const s = this.merchantAuditStatus
|
||||
if (s === 0) return 'pending'
|
||||
if (s === 2) return 'rejected'
|
||||
return 'unauth'
|
||||
},
|
||||
/**
|
||||
* 商家身份卡片副描述文案
|
||||
* @returns {string}
|
||||
*/
|
||||
merchantDescText() {
|
||||
if (this.isMerchantUser) {
|
||||
return this.merchantShopName || '展示店铺专属信息'
|
||||
}
|
||||
const s = this.merchantAuditStatus
|
||||
if (s === 0) return '资质审核中,点击查看'
|
||||
if (s === 2) return '资质未通过,点击修改'
|
||||
return '未认证,点击立即前往认证'
|
||||
},
|
||||
/**
|
||||
* 当前选中的分类对象
|
||||
* @returns {Object|null}
|
||||
*/
|
||||
currentCat() {
|
||||
return this.categories.find((c) => c.id === this.form.categoryId) || null
|
||||
return this.categories.find((c) => Number(c.id) === Number(this.form.categoryId)) || null
|
||||
},
|
||||
balance() {
|
||||
try {
|
||||
@@ -527,7 +593,7 @@ export default {
|
||||
* 当前分类对应的常用计价单位
|
||||
*/
|
||||
currentUnits() {
|
||||
const catId = this.form.categoryId
|
||||
const catId = Number(this.form.categoryId || 0)
|
||||
if (catId === 1) return ['元/月', '元/天', '元/小时', '元/次']
|
||||
if (catId === 2) return ['元/月', '万元', '元/天', '元/季']
|
||||
if (catId === 3) return ['元']
|
||||
@@ -541,7 +607,7 @@ export default {
|
||||
* 当前分类对应的常用同城亮点标签
|
||||
*/
|
||||
recommendTags() {
|
||||
const catId = this.form.categoryId
|
||||
const catId = Number(this.form.categoryId || 0)
|
||||
const map = {
|
||||
1: ['日结', '包吃住', '双休', '五险一金', '经验不限', '就近分配'],
|
||||
2: ['精装修', '近地铁', '随时看房', '押一付一', '家电齐全', '独立卫浴'],
|
||||
@@ -566,9 +632,17 @@ export default {
|
||||
loadUiConfig()
|
||||
this.init()
|
||||
},
|
||||
onShow() {
|
||||
// 每次切入页面刷新草稿数量,保持右上角数字精准
|
||||
/**
|
||||
* 页面每次显示时触发:刷新草稿数并静默同步最新用户资料(如认证状态)
|
||||
*/
|
||||
async onShow() {
|
||||
this.updateDraftCount()
|
||||
try {
|
||||
const userStore = useUserStore()
|
||||
if (userStore.isLogin.value) {
|
||||
await userStore.fetchProfile()
|
||||
}
|
||||
} catch (e) {}
|
||||
},
|
||||
methods: {
|
||||
iconUrl,
|
||||
@@ -586,7 +660,13 @@ export default {
|
||||
this.categories = Array.isArray(cats) ? cats : []
|
||||
// 若未指定分类且已有分类列表,默认选中第一个
|
||||
if (!this.form.categoryId && this.categories.length) {
|
||||
this.form.categoryId = this.categories[0].id
|
||||
this.form.categoryId = Number(this.categories[0].id)
|
||||
} else if (this.form.categoryId) {
|
||||
this.form.categoryId = Number(this.form.categoryId)
|
||||
}
|
||||
// 联动初始化当前分类的首选计价单位
|
||||
if (this.currentUnits && this.currentUnits.length && (!this.form.priceUnit || this.form.priceUnit === '元')) {
|
||||
this.form.priceUnit = this.currentUnits[0]
|
||||
}
|
||||
} catch (e) {
|
||||
uni.showToast({ title: '分类数据加载失败', icon: 'none' })
|
||||
@@ -795,24 +875,59 @@ export default {
|
||||
},
|
||||
/**
|
||||
* 切换发布身份(个人 / 商家)
|
||||
* @param {'person'|'merchant'} type
|
||||
* 商家未认证时弹窗提示并引导跳转商家资质认证页面
|
||||
* @param {'person'|'merchant'} type 身份类型
|
||||
*/
|
||||
switchIdentity(type) {
|
||||
this.form.identityType = type
|
||||
if (type === 'merchant') {
|
||||
// 未认证商家时,提示并跳转商家认证页面
|
||||
if (!this.isMerchantUser) {
|
||||
const status = this.merchantAuditStatus
|
||||
let title = '商家认证提示'
|
||||
let content = '发布商家信息需先完成商家资质认证,认证后尊享商家标识与店铺展示。是否立即前往认证?'
|
||||
let confirmText = '去认证'
|
||||
|
||||
if (status === 0) {
|
||||
content = '您的商家资质正在审核中,工作人员将在1-3个工作日内完成审核。是否前往查看进度?'
|
||||
confirmText = '查看进度'
|
||||
} else if (status === 2) {
|
||||
content = '您的商家资质审核未通过,请核对资料后重新提交。是否前往修改?'
|
||||
confirmText = '重新提交'
|
||||
}
|
||||
|
||||
uni.showModal({
|
||||
title,
|
||||
content,
|
||||
confirmText,
|
||||
cancelText: '取消',
|
||||
confirmColor: '#00e070',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({ url: '/pages/merchant/info' })
|
||||
}
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
this.form.identityType = 'merchant'
|
||||
// 自动带入商家的认证信息
|
||||
const u = useUserStore().state.userInfo
|
||||
if (u && u.merchant) {
|
||||
if (!this.form.contact && u.merchant.contact_name) {
|
||||
this.form.contact = u.merchant.contact_name
|
||||
const contact = u.merchant.contact_name || u.merchant.contactName || ''
|
||||
const phone = u.merchant.contact_phone || u.merchant.contactPhone || ''
|
||||
const address = u.merchant.address || ''
|
||||
if (!this.form.contact && contact) {
|
||||
this.form.contact = contact
|
||||
}
|
||||
if (!this.form.phone && u.merchant.contact_phone) {
|
||||
this.form.phone = u.merchant.contact_phone
|
||||
if (!this.form.phone && phone) {
|
||||
this.form.phone = phone
|
||||
}
|
||||
if (!this.form.address && u.merchant.address) {
|
||||
this.form.address = u.merchant.address
|
||||
if (!this.form.address && address) {
|
||||
this.form.address = address
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.form.identityType = 'person'
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -988,8 +1103,13 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 表单合法性验证
|
||||
* @returns {string} 错误信息,为空则验证通过
|
||||
*/
|
||||
validate() {
|
||||
if (!this.form.categoryId) return '请选择所属分类'
|
||||
if (this.form.identityType === 'merchant' && !this.isMerchantUser) return '请先完成商家资质认证'
|
||||
if (!this.form.title || !this.form.title.trim()) return '请填写标题'
|
||||
if (!this.form.content || !this.form.content.trim()) return '请填写详细内容'
|
||||
if (!this.form.areaId) return '请选择所属区域'
|
||||
@@ -1201,6 +1321,13 @@ export default {
|
||||
color: #04874a;
|
||||
}
|
||||
|
||||
.create__label-tip {
|
||||
font-size: 22rpx;
|
||||
color: $fc-text-placeholder;
|
||||
font-weight: 400;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
/* 2. 身份切换组 */
|
||||
.create__identity-group {
|
||||
display: grid;
|
||||
@@ -1227,6 +1354,11 @@ export default {
|
||||
color: #04874a;
|
||||
}
|
||||
}
|
||||
|
||||
&--unauth {
|
||||
border-style: dashed;
|
||||
background: #fafdfb;
|
||||
}
|
||||
}
|
||||
|
||||
.create__identity-title-row {
|
||||
@@ -1241,13 +1373,37 @@ export default {
|
||||
}
|
||||
|
||||
.create__merchant-badge {
|
||||
background: #f5a623;
|
||||
color: #ffffff;
|
||||
font-size: 18rpx;
|
||||
font-weight: 700;
|
||||
border-radius: 6rpx;
|
||||
padding: 2rpx 8rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
margin-left: 10rpx;
|
||||
line-height: 26rpx;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
&--approved {
|
||||
background: #f5a623;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
&--unauth {
|
||||
background: #e6f9ef;
|
||||
color: #04874a;
|
||||
border: 1rpx solid #b8ebd0;
|
||||
}
|
||||
|
||||
&--pending {
|
||||
background: #eff6ff;
|
||||
color: #2563eb;
|
||||
border: 1rpx solid #bfdbfe;
|
||||
}
|
||||
|
||||
&--rejected {
|
||||
background: #fef2f2;
|
||||
color: #dc2626;
|
||||
border: 1rpx solid #fecaca;
|
||||
}
|
||||
}
|
||||
|
||||
.create__identity-desc {
|
||||
|
||||
在新工单中引用
屏蔽一个用户