feat: 完善分销提现审核与转账流程,增强帖子详情交互
这个提交包含在:
@@ -153,7 +153,7 @@ class Post extends Backend
|
||||
$mediaList[] = $row->cover;
|
||||
}
|
||||
|
||||
// 获取用户画像
|
||||
// 获取用户画像与关联商家门店资料
|
||||
$userInfo = [
|
||||
'id' => $row->user_id,
|
||||
'nickname' => $row->user_name ?: '未知用户',
|
||||
@@ -169,6 +169,11 @@ class Post extends Backend
|
||||
$userInfo['post_count'] = Db::name('fc_post')->where('user_id', $user['id'])->count();
|
||||
}
|
||||
|
||||
$merchantInfo = null;
|
||||
if (!empty($row->user_id)) {
|
||||
$merchantInfo = Db::name('fc_merchant')->where('user_id', $row->user_id)->find();
|
||||
}
|
||||
|
||||
// 支持请求 JSON 详情
|
||||
if ($this->request->param('format') === 'json') {
|
||||
$data = [
|
||||
@@ -196,7 +201,8 @@ class Post extends Backend
|
||||
'likes' => $row->likes,
|
||||
'createtime_text' => date('Y-m-d H:i:s', $row->createtime),
|
||||
'media_list' => $mediaList,
|
||||
'user' => $userInfo
|
||||
'user' => $userInfo,
|
||||
'merchant' => $merchantInfo
|
||||
];
|
||||
$this->success('获取成功', null, $data);
|
||||
}
|
||||
@@ -207,6 +213,7 @@ class Post extends Backend
|
||||
$this->view->assign('mode', $mode);
|
||||
$this->view->assign('row', $row);
|
||||
$this->view->assign('userInfo', $userInfo);
|
||||
$this->view->assign('merchantInfo', $merchantInfo);
|
||||
$this->view->assign('mediaList', $mediaList);
|
||||
$this->view->assign('queue', $this->auditQueue($row->getData()));
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ use app\common\controller\Backend;
|
||||
use think\Db;
|
||||
|
||||
/**
|
||||
* 同城-提现
|
||||
* 同城-提现管理与审核控制器
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
@@ -19,6 +19,11 @@ class Withdraw extends Backend
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
/**
|
||||
* 初始化控制器
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
@@ -26,16 +31,115 @@ class Withdraw extends Backend
|
||||
$this->view->assign("statusList", $this->model->getStatusList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
* 提现审核详情与核验
|
||||
*
|
||||
* @param mixed $ids 提现记录ID
|
||||
* @return string
|
||||
*/
|
||||
public function edit($ids = null)
|
||||
{
|
||||
$row = $this->model->get($ids);
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
$adminIds = $this->getDataLimitAdminIds();
|
||||
if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) {
|
||||
$this->error(__('You have no permission'));
|
||||
}
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post('row/a');
|
||||
if ($params) {
|
||||
$params = $this->preExcludeFields($params);
|
||||
// 资金安全:严禁在编辑中篡改提现单号、金额、用户ID、渠道与微信单号
|
||||
unset($params['withdraw_no'], $params['amount'], $params['user_id'], $params['channel'], $params['out_bill_no'], $params['transfer_id']);
|
||||
|
||||
$result = false;
|
||||
Db::startTrans();
|
||||
try {
|
||||
// 只允许修改备注、处理时间等辅助信息
|
||||
$result = $row->allowField(['reason', 'paytime', 'updatetime'])->save($params);
|
||||
Db::commit();
|
||||
} catch (\Throwable $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
if ($result !== false) {
|
||||
$this->success();
|
||||
} else {
|
||||
$this->error(__('No rows were updated'));
|
||||
}
|
||||
}
|
||||
$this->error(__('Parameter %s can not be empty', ''));
|
||||
}
|
||||
|
||||
$userId = (int)$row['user_id'];
|
||||
|
||||
// 1. 获取申请用户信息
|
||||
$user = Db::name('user')
|
||||
->where('id', $userId)
|
||||
->field('id,username,nickname,mobile,avatar,money,score,createtime')
|
||||
->find();
|
||||
|
||||
// 2. 获取用户同城扩展信息(微信OpenID、实名认证等)
|
||||
$userExt = Db::name('fc_user_ext')
|
||||
->where('user_id', $userId)
|
||||
->field('openid,realname,realname_status,is_member,member_level')
|
||||
->find();
|
||||
|
||||
// 3. 计算用户分销佣金与提现对账数据
|
||||
$totalCommission = (float)Db::name('fc_commission')
|
||||
->where('user_id', $userId)
|
||||
->where('status', '<>', 2)
|
||||
->sum('amount');
|
||||
|
||||
$settledCommission = (float)Db::name('fc_commission')
|
||||
->where('user_id', $userId)
|
||||
->where('status', 1)
|
||||
->sum('amount');
|
||||
|
||||
$totalWithdrawn = (float)Db::name('fc_withdraw')
|
||||
->where('user_id', $userId)
|
||||
->where('status', 'paid')
|
||||
->sum('amount');
|
||||
|
||||
$appliedTotal = (float)Db::name('fc_withdraw')
|
||||
->where('user_id', $userId)
|
||||
->where('status', 'in', ['auditing', 'paying', 'paid'])
|
||||
->sum('amount');
|
||||
|
||||
// 当前剩余可提现金额
|
||||
$withdrawable = max(0, $settledCommission - $appliedTotal);
|
||||
|
||||
// 4. 预设快捷驳回原因模板
|
||||
$rejectReasons = [
|
||||
'微信未实名或实名与提现账户不一致',
|
||||
'提现用户未绑定微信或OpenID失效',
|
||||
'关联分销订单存在售后退款,佣金核验中',
|
||||
'账号涉嫌虚假刷单/违规套现,暂缓打款',
|
||||
'用户联系客服主动申请撤回提现',
|
||||
'微信商家转账账户余额不足,请稍后重试',
|
||||
];
|
||||
|
||||
$this->view->assign([
|
||||
'row' => $row,
|
||||
'userInfo' => $user ?: [],
|
||||
'userExt' => $userExt ?: [],
|
||||
'totalCommission' => round($totalCommission, 2),
|
||||
'settledCommission' => round($settledCommission, 2),
|
||||
'totalWithdrawn' => round($totalWithdrawn, 2),
|
||||
'withdrawable' => round($withdrawable, 2),
|
||||
'rejectReasons' => $rejectReasons,
|
||||
]);
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现打款/驳回
|
||||
* 提现打款/驳回操作处理
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function pay()
|
||||
{
|
||||
@@ -134,6 +238,63 @@ class Withdraw extends Backend
|
||||
$this->success($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步微信商家转账状态(主动查询)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function sync()
|
||||
{
|
||||
$ids = $this->request->post('ids');
|
||||
$ids = is_array($ids) ? $ids : explode(',', (string)$ids);
|
||||
$ids = array_filter($ids);
|
||||
if (!$ids) {
|
||||
$this->error('请选择要同步的提现记录');
|
||||
}
|
||||
|
||||
$withdraws = Db::name('fc_withdraw')
|
||||
->where('id', 'in', $ids)
|
||||
->where('status', 'paying')
|
||||
->select();
|
||||
|
||||
if (!$withdraws) {
|
||||
$this->error('选中的记录中没有处于「转账中」的提现单');
|
||||
}
|
||||
|
||||
$successCount = 0;
|
||||
$failedCount = 0;
|
||||
$payingCount = 0;
|
||||
$errors = [];
|
||||
|
||||
foreach ($withdraws as $withdraw) {
|
||||
try {
|
||||
$state = \app\common\library\WxTransfer::sync((int)$withdraw['id']);
|
||||
if ($state === 'paid') {
|
||||
$successCount++;
|
||||
} elseif ($state === 'failed') {
|
||||
$failedCount++;
|
||||
} else {
|
||||
$payingCount++;
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$errors[] = $withdraw['withdraw_no'] . ':' . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
$msg = '状态同步完成:';
|
||||
if ($successCount > 0) {
|
||||
$msg .= $successCount . ' 笔已确认到账;';
|
||||
}
|
||||
if ($payingCount > 0) {
|
||||
$msg .= $payingCount . ' 笔仍待用户确认或处理中;';
|
||||
}
|
||||
if ($failedCount > 0) {
|
||||
$msg .= $failedCount . ' 笔转账失败;';
|
||||
}
|
||||
if ($errors) {
|
||||
$msg .= ' 异常:' . implode(';', $errors);
|
||||
}
|
||||
|
||||
$this->success($msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,39 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 商家门店资料(仅商家发布或有关联门店时展示) -->
|
||||
{if !empty($merchantInfo)}
|
||||
<div class="panel panel-default" style="border: 1px solid #BBF7D0; background: #F0FDF4; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); margin-bottom: 15px;">
|
||||
<div class="panel-body" style="padding: 14px 16px;">
|
||||
<div style="display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px;">
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<span class="label label-warning" style="font-size: 11px; padding: 3px 8px;"><i class="fa fa-briefcase"></i> 认证商家门店</span>
|
||||
<strong style="font-size: 15px; color: #166534;">{$merchantInfo.name|htmlentities}</strong>
|
||||
{if $merchantInfo.audit_status == 1}
|
||||
<span class="badge" style="background: #15803D; font-size: 10px;">资质已核验</span>
|
||||
{/if}
|
||||
</div>
|
||||
{if !empty($merchantInfo.category)}
|
||||
<span style="font-size: 12px; color: #166534; background: #DCFCE7; padding: 2px 8px; border-radius: 4px;">经营类目:{$merchantInfo.category|htmlentities}</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="row" style="font-size: 12px; color: #166534; line-height: 1.8;">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<i class="fa fa-map-marker text-success"></i> 门店地址:<strong>{$merchantInfo.address|default='未填写实体地址'|htmlentities}</strong>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<i class="fa fa-phone text-success"></i> 门店联系人:{$merchantInfo.contact|default='-'|htmlentities}
|
||||
</div>
|
||||
{if !empty($merchantInfo.notice)}
|
||||
<div class="col-xs-12" style="margin-top: 4px;">
|
||||
<i class="fa fa-bullhorn text-warning"></i> 门店公告:<span style="color: #14532D;">{$merchantInfo.notice|htmlentities}</span>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- 送审核心内容核验卡 -->
|
||||
<div class="panel panel-default" style="border: 1px solid #E2E8F0; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); margin-bottom: 15px;">
|
||||
<div class="panel-body" style="padding: 20px;">
|
||||
|
||||
@@ -102,6 +102,39 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 商家门店资料(仅商家发布或有关联门店时展示) -->
|
||||
{if !empty($merchantInfo)}
|
||||
<div class="panel panel-default" style="border: 1px solid #BBF7D0; background: #F0FDF4; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); margin-bottom: 15px;">
|
||||
<div class="panel-body" style="padding: 14px 16px;">
|
||||
<div style="display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px;">
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<span class="label label-warning" style="font-size: 11px; padding: 3px 8px;"><i class="fa fa-briefcase"></i> 认证商家门店</span>
|
||||
<strong style="font-size: 15px; color: #166534;">{$merchantInfo.name|htmlentities}</strong>
|
||||
{if $merchantInfo.audit_status == 1}
|
||||
<span class="badge" style="background: #15803D; font-size: 10px;">资质已核验</span>
|
||||
{/if}
|
||||
</div>
|
||||
{if !empty($merchantInfo.category)}
|
||||
<span style="font-size: 12px; color: #166534; background: #DCFCE7; padding: 2px 8px; border-radius: 4px;">经营类目:{$merchantInfo.category|htmlentities}</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="row" style="font-size: 12px; color: #166534; line-height: 1.8;">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<i class="fa fa-map-marker text-success"></i> 门店地址:<strong>{$merchantInfo.address|default='未填写实体地址'|htmlentities}</strong>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<i class="fa fa-phone text-success"></i> 门店联系人:{$merchantInfo.contact|default='-'|htmlentities}
|
||||
</div>
|
||||
{if !empty($merchantInfo.notice)}
|
||||
<div class="col-xs-12" style="margin-top: 4px;">
|
||||
<i class="fa fa-bullhorn text-warning"></i> 门店公告:<span style="color: #14532D;">{$merchantInfo.notice|htmlentities}</span>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- 业务核心卡片 -->
|
||||
<div class="panel panel-default" style="border: 1px solid #E2E8F0; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); margin-bottom: 15px;">
|
||||
<div class="panel-body" style="padding: 20px;">
|
||||
|
||||
@@ -1,26 +1,95 @@
|
||||
<form id="edit-form" class="form-horizontal fc-modal-form" role="form" data-toggle="validator" method="POST" action="">
|
||||
<div class="fc-modal-form" style="padding-bottom:70px;">
|
||||
|
||||
<!-- 提现申请核心凭据 -->
|
||||
<!-- 1. 核心账单凭据详情 -->
|
||||
<div class="fc-form-section">
|
||||
<div class="fc-form-section__header">
|
||||
<span class="fc-form-section__badge">1</span>
|
||||
<span class="fc-form-section__title">提现账单详情</span>
|
||||
<div class="fc-form-section__header" style="justify-content:space-between;">
|
||||
<div style="display:flex;align-items:center;">
|
||||
<span class="fc-form-section__badge" style="background:#04874A;">1</span>
|
||||
<span class="fc-form-section__title">提现核心账单凭据</span>
|
||||
</div>
|
||||
<div>
|
||||
{switch name="row.status"}
|
||||
{case value="auditing"}<span class="label label-warning" style="font-size:12px;padding:4px 8px;"><i class="fa fa-clock-o"></i> 待审核</span>{/case}
|
||||
{case value="paying"}<span class="label label-info" style="font-size:12px;padding:4px 8px;"><i class="fa fa-spinner fa-spin"></i> 微信转账中</span>{/case}
|
||||
{case value="paid"}<span class="label label-success" style="font-size:12px;padding:4px 8px;background:#04874A;"><i class="fa fa-check"></i> 已成功到账</span>{/case}
|
||||
{case value="failed"}<span class="label label-danger" style="font-size:12px;padding:4px 8px;"><i class="fa fa-exclamation-triangle"></i> 转账失败</span>{/case}
|
||||
{case value="rejected"}<span class="label label-default" style="font-size:12px;padding:4px 8px;"><i class="fa fa-ban"></i> 已拒绝</span>{/case}
|
||||
{/switch}
|
||||
</div>
|
||||
</div>
|
||||
<div class="fc-form-section__body">
|
||||
<!-- 核心金额突出展示 -->
|
||||
<div style="background:#F2FEF7;border:1px solid #C8F2DD;border-radius:6px;padding:14px 18px;margin-bottom:16px;display:flex;align-items:center;justify-content:space-between;">
|
||||
<div>
|
||||
<div style="font-size:12px;color:#04874A;font-weight:600;margin-bottom:4px;">申请提现金额</div>
|
||||
<div style="font-size:28px;font-weight:700;color:#F5A623;line-height:1.2;">
|
||||
<span style="font-size:18px;">¥</span> {$row.amount|htmlentities}
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align:right;">
|
||||
<div style="font-size:12px;color:#64748B;">提现渠道</div>
|
||||
<div style="font-size:14px;font-weight:600;color:#04301E;margin-top:2px;">
|
||||
<i class="fa fa-wechat" style="color:#09BB07;"></i> 微信零钱 / 商家转账
|
||||
</div>
|
||||
</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">提现单号:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-withdraw_no" class="form-control" name="row[withdraw_no]" type="text" value="{$row.withdraw_no|htmlentities}" readonly>
|
||||
<div class="form-group" style="margin-bottom:8px;">
|
||||
<label class="control-label col-xs-4" style="color:#64748B;">提现单号:</label>
|
||||
<div class="col-xs-8" style="padding-top:7px;">
|
||||
<span class="font-bold text-navy" style="font-family:monospace;font-size:13px;">{$row.withdraw_no|htmlentities}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-4">申请用户:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-user_id" data-rule="required" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
|
||||
<div class="form-group" style="margin-bottom:8px;">
|
||||
<label class="control-label col-xs-4" style="color:#64748B;">申请时间:</label>
|
||||
<div class="col-xs-8" style="padding-top:7px;">
|
||||
<span>{if $row.createtime}{:date('Y-m-d H:i:s', $row.createtime)}{else/}-{/if}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if condition="!empty($row.paytime)"}
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="form-group" style="margin-bottom:8px;">
|
||||
<label class="control-label col-xs-4" style="color:#64748B;">打款到账时间:</label>
|
||||
<div class="col-xs-8" style="padding-top:7px;">
|
||||
<span class="text-success font-bold">{:date('Y-m-d H:i:s', $row.paytime)}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 2. 申请人与资金对账核验详情 -->
|
||||
<div class="fc-form-section">
|
||||
<div class="fc-form-section__header">
|
||||
<span class="fc-form-section__badge" style="background:#04874A;">2</span>
|
||||
<span class="fc-form-section__title">申请人与资金风控核验</span>
|
||||
</div>
|
||||
<div class="fc-form-section__body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="form-group" style="margin-bottom:8px;">
|
||||
<label class="control-label col-xs-4" style="color:#64748B;">用户昵称:</label>
|
||||
<div class="col-xs-8" style="padding-top:7px;">
|
||||
<span class="text-primary font-bold">{$userInfo.nickname|default='-'}</span>
|
||||
<span class="text-muted" style="font-size:12px;">(ID: {$row.user_id})</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="form-group" style="margin-bottom:8px;">
|
||||
<label class="control-label col-xs-4" style="color:#64748B;">绑定手机号:</label>
|
||||
<div class="col-xs-8" style="padding-top:7px;">
|
||||
<span>{$userInfo.mobile|default='未绑定手机'}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,73 +97,127 @@
|
||||
|
||||
<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">申请提现金额:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">¥</span>
|
||||
<input id="c-amount" data-rule="required" class="form-control font-bold" step="0.01" name="row[amount]" type="number" value="{$row.amount|htmlentities}" style="color:#EA580C;font-size:15px;">
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom:8px;">
|
||||
<label class="control-label col-xs-4" style="color:#64748B;">微信OpenID:</label>
|
||||
<div class="col-xs-8" style="padding-top:7px;">
|
||||
{if condition="!empty($userExt.openid) && strpos($userExt.openid, 'h5_') !== 0"}
|
||||
<span class="label label-success" title="{$userExt.openid}"><i class="fa fa-check-circle"></i> 已绑定微信小程序</span>
|
||||
{else/}
|
||||
<span class="label label-danger"><i class="fa fa-warning"></i> 未获取有效微信OpenID(打款将失败)</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-4">提现渠道:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<select id="c-channel" class="form-control" name="row[channel]">
|
||||
<option value="wechat" {eq name="$row.channel" value="wechat"}selected{/eq}>微信零钱 / 商户转账</option>
|
||||
<option value="bank" {eq name="$row.channel" value="bank"}selected{/eq}>银行卡转账</option>
|
||||
<option value="alipay" {eq name="$row.channel" value="alipay"}selected{/eq}>支付宝转账</option>
|
||||
<option value="balance" {eq name="$row.channel" value="balance"}selected{/eq}>站内账户余额</option>
|
||||
</select>
|
||||
<div class="form-group" style="margin-bottom:8px;">
|
||||
<label class="control-label col-xs-4" style="color:#64748B;">实名姓名:</label>
|
||||
<div class="col-xs-8" style="padding-top:7px;">
|
||||
{if condition="!empty($userExt.realname)"}
|
||||
<span class="font-bold text-success"><i class="fa fa-shield"></i> {$userExt.realname}</span>
|
||||
{else/}
|
||||
<span class="text-muted">未实名</span>
|
||||
{if condition="$row.amount >= 2000"}
|
||||
<span class="text-danger font-bold" style="font-size:12px;">(微信限制:≥2000元必须实名)</span>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 审核与打款处理 -->
|
||||
<div class="fc-form-section">
|
||||
<div class="fc-form-section__header">
|
||||
<span class="fc-form-section__badge">2</span>
|
||||
<span class="fc-form-section__title">审核状态与打款记录</span>
|
||||
</div>
|
||||
<div class="fc-form-section__body">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">审核状态:</label>
|
||||
<div class="col-xs-12 col-sm-10">
|
||||
<div class="radio-group" style="padding-top:7px;">
|
||||
{foreach name="statusList" item="vo"}
|
||||
<label class="radio-inline"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
|
||||
{/foreach}
|
||||
<!-- 分销资产与可提现对账微卡片 -->
|
||||
<div style="background:#F8FAFC;border:1px solid #E2E8F0;border-radius:6px;padding:12px 14px;margin-top:8px;">
|
||||
<div style="font-size:12px;font-weight:700;color:#334155;margin-bottom:8px;display:flex;justify-content:space-between;align-items:center;">
|
||||
<span><i class="fa fa-database text-info"></i> 用户分销账户对账核算</span>
|
||||
{if condition="$row.amount > $withdrawable && $row.status eq 'auditing'"}
|
||||
<span class="text-danger font-bold" style="font-size:11px;"><i class="fa fa-warning"></i> 提示:申请金额超出当前可提余额</span>
|
||||
{else/}
|
||||
<span class="text-success" style="font-size:11px;"><i class="fa fa-check"></i> 佣金账户对账正常</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="row text-center" style="margin-left:0;margin-right:0;">
|
||||
<div class="col-xs-3" style="padding:4px;border-right:1px solid #E2E8F0;">
|
||||
<div style="font-size:11px;color:#64748B;">累计分销佣金</div>
|
||||
<div style="font-size:14px;font-weight:700;color:#0F172A;margin-top:2px;">¥{$totalCommission}</div>
|
||||
</div>
|
||||
<div class="col-xs-3" style="padding:4px;border-right:1px solid #E2E8F0;">
|
||||
<div style="font-size:11px;color:#64748B;">已结算佣金</div>
|
||||
<div style="font-size:14px;font-weight:700;color:#0F172A;margin-top:2px;">¥{$settledCommission}</div>
|
||||
</div>
|
||||
<div class="col-xs-3" style="padding:4px;border-right:1px solid #E2E8F0;">
|
||||
<div style="font-size:11px;color:#64748B;">历史已提现总额</div>
|
||||
<div style="font-size:14px;font-weight:700;color:#0F172A;margin-top:2px;">¥{$totalWithdrawn}</div>
|
||||
</div>
|
||||
<div class="col-xs-3" style="padding:4px;">
|
||||
<div style="font-size:11px;color:#64748B;">当前可提余额</div>
|
||||
<div style="font-size:14px;font-weight:700;color:#04874A;margin-top:2px;">¥{$withdrawable}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">审核/驳回备注:</label>
|
||||
<div class="col-xs-12 col-sm-10">
|
||||
<input id="c-reason" class="form-control" name="row[reason]" type="text" value="{$row.reason|htmlentities}" placeholder="若驳回提现,请注明原因(如账户信息不符等)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">实际打款到账时间:</label>
|
||||
<div class="col-xs-12 col-sm-10">
|
||||
<input id="c-paytime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" name="row[paytime]" type="text" value="{if $row.paytime}{:date('Y-m-d H:i:s', $row.paytime)}{/if}" placeholder="打款完成时间">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 弹窗底部操作按钮 -->
|
||||
<div class="form-group layer-footer fc-modal-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-10">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">保存</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">重置</button>
|
||||
<!-- 3. 转账凭证与处理记录详情 -->
|
||||
{if condition="!empty($row.out_bill_no) || !empty($row.transfer_id) || !empty($row.reason) || !empty($row.fail_reason)"}
|
||||
<div class="fc-form-section">
|
||||
<div class="fc-form-section__header">
|
||||
<span class="fc-form-section__badge" style="background:#04874A;">3</span>
|
||||
<span class="fc-form-section__title">转账单据与处理记录</span>
|
||||
</div>
|
||||
<div class="fc-form-section__body">
|
||||
{if condition="!empty($row.out_bill_no) || !empty($row.transfer_id)"}
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="form-group" style="margin-bottom:8px;">
|
||||
<label class="control-label col-xs-4" style="color:#64748B;">微信商户单号:</label>
|
||||
<div class="col-xs-8" style="padding-top:7px;">
|
||||
<span style="font-family:monospace;font-size:12px;">{$row.out_bill_no|htmlentities}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="form-group" style="margin-bottom:8px;">
|
||||
<label class="control-label col-xs-4" style="color:#64748B;">微信转账单号:</label>
|
||||
<div class="col-xs-8" style="padding-top:7px;">
|
||||
<span style="font-family:monospace;font-size:12px;">{$row.transfer_id|htmlentities}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if condition="!empty($row.fail_reason)"}
|
||||
<div class="alert alert-danger" style="margin-top:6px;margin-bottom:8px;padding:10px 14px;">
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>打款失败说明:</strong>{$row.fail_reason|htmlentities}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if condition="!empty($row.reason)"}
|
||||
<div class="alert alert-warning" style="margin-top:6px;margin-bottom:8px;padding:10px 14px;">
|
||||
<i class="fa fa-info-circle"></i> <strong>拒绝/驳回原因:</strong>{$row.reason|htmlentities}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{/if}
|
||||
|
||||
<!-- 4. 底部审核决策操作栏(吸底) -->
|
||||
<div class="fc-modal-footer" style="position:fixed;bottom:0;left:0;right:0;background:#FFFFFF;border-top:1px solid #E2E8F0;padding:12px 20px;z-index:99;display:flex;justify-content:flex-end;align-items:center;gap:12px;">
|
||||
{if condition="$row.status eq 'auditing'"}
|
||||
<button type="button" class="btn btn-success btn-action-approve" data-id="{$row.id}" data-amount="{$row.amount}" data-user="{$userInfo.nickname|default='用户#' . $row.user_id}" style="background:#00E070;border-color:#00E070;color:#04301E;font-weight:700;padding:6px 18px;">
|
||||
<i class="fa fa-check"></i> 审核通过并打款
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger btn-action-reject" data-id="{$row.id}" style="padding:6px 18px;">
|
||||
<i class="fa fa-times"></i> 拒绝申请
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{if condition="$row.status eq 'paying'"}
|
||||
<button type="button" class="btn btn-info btn-action-sync" data-id="{$row.id}" style="padding:6px 16px;">
|
||||
<i class="fa fa-refresh"></i> 查询微信转账最新状态
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<button type="button" class="btn btn-default" onclick="parent.Layer.close(parent.Layer.getFrameIndex(window.name));" style="padding:6px 16px;">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}">刷新</a>
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}"><i class="fa fa-refresh"></i> {:__('Refresh')}</a>
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('fc/withdraw/edit')}"
|
||||
data-operate-del="{:$auth->check('fc/withdraw/del')}"
|
||||
data-operate-edit="false"
|
||||
data-operate-del="false"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1417,6 +1417,7 @@ class Post extends V1
|
||||
}
|
||||
|
||||
$publisher = ['id' => 0, 'name' => '', 'avatar' => '', 'isMerchant' => false, 'verified' => false];
|
||||
$merchant = null;
|
||||
if (!empty($row['user_id'])) {
|
||||
$pub = Db::name('user')->where('id', $row['user_id'])->find();
|
||||
if ($pub) {
|
||||
@@ -1430,6 +1431,24 @@ class Post extends V1
|
||||
'verified' => (bool)$isMerchant,
|
||||
];
|
||||
}
|
||||
// 若为商家用户或以商家身份发布,查询关联门店信息
|
||||
$m = Db::name('fc_merchant')->where('user_id', $row['user_id'])->find();
|
||||
if ($m) {
|
||||
$merchant = [
|
||||
'id' => (int)$m['id'],
|
||||
'name' => (string)$m['name'],
|
||||
'logo' => (string)(isset($m['logo']) ? $m['logo'] : ''),
|
||||
'banner' => (string)(isset($m['banner']) ? $m['banner'] : ''),
|
||||
'address' => (string)(isset($m['address']) ? $m['address'] : ''),
|
||||
'lat' => (isset($m['lat']) && $m['lat'] !== null && $m['lat'] !== '') ? (float)$m['lat'] : null,
|
||||
'lng' => (isset($m['lng']) && $m['lng'] !== null && $m['lng'] !== '') ? (float)$m['lng'] : null,
|
||||
'contact' => (string)(isset($m['contact']) ? $m['contact'] : ''),
|
||||
'category' => (string)(isset($m['category']) ? $m['category'] : ''),
|
||||
'notice' => (string)(isset($m['notice']) ? $m['notice'] : ''),
|
||||
'auditStatus' => (int)$m['audit_status'],
|
||||
'verified' => (int)$m['audit_status'] === 1,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$tags = [];
|
||||
@@ -1476,6 +1495,7 @@ class Post extends V1
|
||||
|
||||
return [
|
||||
'id' => $postId,
|
||||
'userId' => (int)$row['user_id'],
|
||||
'categoryId' => (int)$row['category_id'],
|
||||
'categoryName' => $categoryName,
|
||||
'identityType' => (isset($row['identity_type']) && (int)$row['identity_type'] === 2) ? 'merchant' : 'person',
|
||||
@@ -1499,6 +1519,7 @@ class Post extends V1
|
||||
'createdAt' => $this->iso($row['createtime']),
|
||||
'tags' => $tags,
|
||||
'publisher' => $publisher,
|
||||
'merchant' => $merchant,
|
||||
'commentCount' => (int)$row['comment_count'],
|
||||
'lat' => $lat,
|
||||
'lng' => $lng,
|
||||
|
||||
@@ -1,6 +1,42 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
/**
|
||||
* 常用拒绝原因快捷模板列表
|
||||
*/
|
||||
var REJECT_REASONS = [
|
||||
'微信未实名或实名与提现账户不一致',
|
||||
'提现用户未绑定微信或OpenID失效',
|
||||
'关联分销订单存在售后退款,佣金核验中',
|
||||
'账号涉嫌虚假刷单/违规套现,暂缓打款',
|
||||
'用户联系客服主动申请撤回提现',
|
||||
'微信商家转账账户余额不足,请稍后重试'
|
||||
];
|
||||
|
||||
/**
|
||||
* 构建拒绝申请弹窗HTML(包含快捷原因标签)
|
||||
*
|
||||
* @param {string} defaultText 默认原因
|
||||
* @return {string}
|
||||
*/
|
||||
function buildRejectDialogHtml(defaultText) {
|
||||
var tagsHtml = '';
|
||||
$.each(REJECT_REASONS, function (i, text) {
|
||||
tagsHtml += '<button type="button" class="btn btn-xs btn-default btn-reject-tag" style="margin:2px 3px;" data-text="' + text + '">' + text + '</button>';
|
||||
});
|
||||
return '<div style="padding:15px 20px;">' +
|
||||
'<div style="margin-bottom:8px;font-weight:600;color:#334155;">请填写拒绝原因(将通过系统消息通知用户):</div>' +
|
||||
'<textarea id="layer-reject-reason" class="form-control" rows="3" placeholder="请选择下方快捷模板或手动输入拒绝原因...">' + (defaultText || '') + '</textarea>' +
|
||||
'<div style="margin-top:10px;">' +
|
||||
'<div style="font-size:12px;color:#64748B;margin-bottom:4px;">常用原因快捷模板(点击直接填入):</div>' +
|
||||
'<div>' + tagsHtml + '</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
var Controller = {
|
||||
/**
|
||||
* 提现列表页初始化
|
||||
*/
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
@@ -22,52 +58,68 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
sortOrder: 'desc',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'withdraw_no', title: __('Withdraw_no'), operate: 'LIKE'},
|
||||
{field: 'user_id', title: '用户', addClass: 'selectpage', extend: "data-source='user/user/index' data-field='nickname'", formatter: function (value, row) {
|
||||
return row.user_name || '-';
|
||||
}},
|
||||
{field: 'withdraw_no', title: __('Withdraw_no'), operate: 'LIKE', formatter: function (value) {
|
||||
return '<span class="font-bold text-navy" style="font-family:monospace;">' + (value || '-') + '</span>';
|
||||
}},
|
||||
{field: 'user_id', title: '申请用户', addClass: 'selectpage', extend: "data-source='user/user/index' data-field='nickname'", formatter: function (value, row) {
|
||||
var name = row.user_name || '用户#' + value;
|
||||
return '<span class="text-primary font-bold">' + name + '</span> <span class="text-muted" style="font-size:11px;">(ID:' + value + ')</span>';
|
||||
}},
|
||||
{
|
||||
field: 'amount', title: __('Amount'), operate: 'BETWEEN',
|
||||
field: 'amount', title: __('Amount'), operate: 'BETWEEN', align: 'right',
|
||||
formatter: function (value) {
|
||||
return value === '' || value === null ? '-' : '¥' + parseFloat(value).toFixed(2);
|
||||
if (value === '' || value === null) return '-';
|
||||
return '<span style="color:#F5A623;font-weight:700;font-size:14px;">¥' + parseFloat(value).toFixed(2) + '</span>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'channel', title: __('Channel'),
|
||||
searchList: {wxpay: __('微信支付')},
|
||||
searchList: {wxpay: __('微信支付'), wechat: __('微信支付')},
|
||||
formatter: function (value) {
|
||||
var m = {wxpay: __('微信支付')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
return '<span class="text-success"><i class="fa fa-wechat"></i> 微信转账</span>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status', title: __('Status'),
|
||||
searchList: {auditing: __('待审核'), paying: __('转账中'), paid: __('已到账'), failed: __('转账失败'), rejected: __('已驳回')},
|
||||
formatter: Format.statusFormatter({auditing: __('待审核'), paying: __('转账中'), paid: __('已到账'), failed: __('转账失败'), rejected: __('已驳回')}, {auditing: 'warning', paying: 'info', paid: 'success', failed: 'danger', rejected: 'danger'})
|
||||
searchList: {auditing: __('待审核'), paying: __('转账中'), paid: __('已到账'), failed: __('转账失败'), rejected: __('已拒绝')},
|
||||
formatter: function (value, row) {
|
||||
var map = {
|
||||
auditing: '<span class="label label-warning"><i class="fa fa-clock-o"></i> 待审核</span>',
|
||||
paying: '<span class="label label-info"><i class="fa fa-spinner fa-spin"></i> 转账中</span>',
|
||||
paid: '<span class="label label-success" style="background:#04874A;"><i class="fa fa-check"></i> 已到账</span>',
|
||||
failed: '<span class="label label-danger"><i class="fa fa-exclamation-triangle"></i> 转账失败</span>',
|
||||
rejected: '<span class="label label-default"><i class="fa fa-ban"></i> 已拒绝</span>'
|
||||
};
|
||||
return map[value] || value;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'transfer_status', title: '转账状态', operate: false,
|
||||
field: 'transfer_status', title: '微信转账状态', operate: false,
|
||||
formatter: function (value) {
|
||||
var m = {
|
||||
WAIT_USER_CONFIRM: '待用户确认',
|
||||
ACCEPTED: '已受理',
|
||||
PROCESSING: '转账中',
|
||||
SUCCESS: '成功',
|
||||
FAIL: '失败',
|
||||
CANCELLED: '已撤销',
|
||||
AMOUNT_MISMATCH: '金额异常'
|
||||
WAIT_USER_CONFIRM: '<span class="text-warning font-bold" title="需用户在微信内确认收款"><i class="fa fa-hourglass-half"></i> 待用户确认</span>',
|
||||
ACCEPTED: '<span class="text-info">已受理</span>',
|
||||
PROCESSING: '<span class="text-info"><i class="fa fa-refresh fa-spin"></i> 处理中</span>',
|
||||
SUCCESS: '<span class="text-success font-bold"><i class="fa fa-check"></i> 成功</span>',
|
||||
FAIL: '<span class="text-danger font-bold"><i class="fa fa-close"></i> 失败</span>',
|
||||
CANCELLED: '<span class="text-muted">已撤销</span>',
|
||||
AMOUNT_MISMATCH: '<span class="text-danger">金额异常</span>'
|
||||
};
|
||||
return value && m[value] ? m[value] : (value || '-');
|
||||
}
|
||||
},
|
||||
{field: 'fail_reason', title: '失败原因', operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'reason', title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'reason', title: '拒绝原因', operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'fail_reason', title: '转账失败原因', operate: 'LIKE', table: table, class: 'autocontent', formatter: function (value) {
|
||||
if (!value) return '-';
|
||||
return '<span class="text-danger" title="' + value + '">' + value + '</span>';
|
||||
}},
|
||||
{field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime, visible: false},
|
||||
@@ -76,42 +128,50 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
formatter: Table.api.formatter.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'pay',
|
||||
text: '打款',
|
||||
title: __('PayWithdraw'),
|
||||
classname: 'btn btn-xs btn-success btn-click',
|
||||
name: 'audit',
|
||||
text: '审核',
|
||||
title: '提现申请审核',
|
||||
classname: 'btn btn-xs btn-success btn-dialog',
|
||||
icon: 'fa fa-gavel',
|
||||
extend: 'data-area=\'["820px", "680px"]\'',
|
||||
visible: function (row) {
|
||||
return row.status === 'auditing';
|
||||
},
|
||||
confirm: __('确认对该提现申请打款?'),
|
||||
click: function (options, row) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/withdraw/pay',
|
||||
data: {ids: row.id, op: 'pay'}
|
||||
}, function () {
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
url: 'fc/withdraw/edit'
|
||||
},
|
||||
{
|
||||
name: 'reject',
|
||||
text: '驳回',
|
||||
title: __('RejectWithdraw'),
|
||||
classname: 'btn btn-xs btn-danger btn-click',
|
||||
name: 'detail',
|
||||
text: '详情',
|
||||
title: '提现申请详情',
|
||||
classname: 'btn btn-xs btn-info btn-dialog',
|
||||
icon: 'fa fa-eye',
|
||||
extend: 'data-area=\'["820px", "680px"]\'',
|
||||
visible: function (row) {
|
||||
return row.status === 'auditing';
|
||||
return row.status !== 'auditing';
|
||||
},
|
||||
url: 'fc/withdraw/edit'
|
||||
},
|
||||
{
|
||||
name: 'sync',
|
||||
text: '同步',
|
||||
title: '同步微信最新转账状态',
|
||||
classname: 'btn btn-xs btn-default btn-click',
|
||||
icon: 'fa fa-refresh',
|
||||
visible: function (row) {
|
||||
return row.status === 'paying';
|
||||
},
|
||||
click: function (options, row) {
|
||||
Layer.prompt({title: __('请输入驳回原因'), formType: 2}, function (value, index) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/withdraw/pay',
|
||||
data: {ids: row.id, op: 'reject', reason: value}
|
||||
}, function () {
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
Layer.close(index);
|
||||
var loadIdx = Layer.load(1);
|
||||
Fast.api.ajax({
|
||||
url: 'fc/withdraw/sync',
|
||||
data: {ids: row.id}
|
||||
}, function () {
|
||||
Layer.close(loadIdx);
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
}, function () {
|
||||
Layer.close(loadIdx);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -124,13 +184,120 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加提现记录页面
|
||||
*/
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
|
||||
/**
|
||||
* 提现审核与详情页面
|
||||
*/
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
|
||||
// 1. 审核通过并打款
|
||||
$(document).on('click', '.btn-action-approve', function () {
|
||||
var id = $(this).data('id');
|
||||
var amount = $(this).data('amount');
|
||||
var user = $(this).data('user');
|
||||
|
||||
Layer.confirm('确认审核通过并向用户「' + user + '」发起微信转账打款?<br>转账金额:<b style="color:#F5A623;font-size:16px;">¥' + parseFloat(amount).toFixed(2) + '</b>', {
|
||||
title: '审核通过打款确认',
|
||||
icon: 3,
|
||||
btn: ['确认打款', '取消']
|
||||
}, function (index) {
|
||||
Layer.close(index);
|
||||
var loadIdx = Layer.load(1, {shade: [0.1, '#fff']});
|
||||
Fast.api.ajax({
|
||||
url: 'fc/withdraw/pay',
|
||||
data: {ids: id, op: 'pay'}
|
||||
}, function (data, ret) {
|
||||
Layer.close(loadIdx);
|
||||
Toastr.success(ret.msg || '转账发起成功');
|
||||
setTimeout(function () {
|
||||
Fast.api.close();
|
||||
parent.$("#table").bootstrapTable('refresh');
|
||||
}, 1200);
|
||||
return false;
|
||||
}, function () {
|
||||
Layer.close(loadIdx);
|
||||
return true;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 2. 拒绝申请(弹窗输入拒绝原因)
|
||||
$(document).on('click', '.btn-action-reject', function () {
|
||||
var id = $(this).data('id');
|
||||
|
||||
Layer.open({
|
||||
type: 1,
|
||||
title: '拒绝提现申请',
|
||||
area: ['520px', '320px'],
|
||||
content: buildRejectDialogHtml(''),
|
||||
btn: ['确认拒绝', '取消'],
|
||||
success: function (layero) {
|
||||
layero.find('.btn-reject-tag').on('click', function () {
|
||||
var text = $(this).data('text');
|
||||
layero.find('#layer-reject-reason').val(text).focus();
|
||||
});
|
||||
},
|
||||
yes: function (index, layero) {
|
||||
var reason = $.trim(layero.find('#layer-reject-reason').val());
|
||||
if (!reason) {
|
||||
Layer.msg('请填写或点击快捷模板选择拒绝原因', {icon: 2});
|
||||
layero.find('#layer-reject-reason').focus();
|
||||
return false;
|
||||
}
|
||||
var loadIdx = Layer.load(1);
|
||||
Fast.api.ajax({
|
||||
url: 'fc/withdraw/pay',
|
||||
data: {ids: id, op: 'reject', reason: reason}
|
||||
}, function (data, ret) {
|
||||
Layer.close(loadIdx);
|
||||
Layer.close(index);
|
||||
Toastr.success(ret.msg || '已拒绝申请');
|
||||
setTimeout(function () {
|
||||
Fast.api.close();
|
||||
parent.$("#table").bootstrapTable('refresh');
|
||||
}, 1200);
|
||||
return false;
|
||||
}, function () {
|
||||
Layer.close(loadIdx);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 3. 查询微信转账最新状态
|
||||
$(document).on('click', '.btn-action-sync', function () {
|
||||
var id = $(this).data('id');
|
||||
var loadIdx = Layer.load(1);
|
||||
Fast.api.ajax({
|
||||
url: 'fc/withdraw/sync',
|
||||
data: {ids: id}
|
||||
}, function (data, ret) {
|
||||
Layer.close(loadIdx);
|
||||
Toastr.success(ret.msg || '微信转账状态同步完成');
|
||||
setTimeout(function () {
|
||||
location.reload();
|
||||
}, 1000);
|
||||
return false;
|
||||
}, function () {
|
||||
Layer.close(loadIdx);
|
||||
return true;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
api: {
|
||||
/**
|
||||
* 表单事件绑定
|
||||
*/
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
|
||||
@@ -61,6 +61,19 @@ export const datasets = {
|
||||
cover: '', price: 1800, priceUnit: '元/月', area: '南明区', address: '未来方舟 B 区',
|
||||
contact: '135****6666', contactFull: '13566666666', views: 3204, likes: 88,
|
||||
isPaid: true, auditStatus: 1, createdAt: iso(0.5), tags: ['精装', '近地铁'],
|
||||
identityType: 'merchant',
|
||||
merchant: {
|
||||
id: 2002,
|
||||
name: '安家房产中介服务部',
|
||||
logo: '',
|
||||
category: '房产租售',
|
||||
address: '贵阳市南明区未来方舟 B 区 102 门面',
|
||||
lat: 26.5716,
|
||||
lng: 106.7314,
|
||||
contact: '13566666666',
|
||||
notice: '十年本地信誉老店,房源真实无套路,欢迎随时到店喝茶看房~',
|
||||
verified: true,
|
||||
},
|
||||
publisher: { id: 2002, name: '安家房产', avatar: '', isMerchant: true, verified: true },
|
||||
commentCount: 26, lat: 26.5716, lng: 106.7314, distance: 13.1,
|
||||
},
|
||||
|
||||
@@ -24,6 +24,7 @@ export const useUserStore = () => {
|
||||
return state.userType === config.constants.USER_TYPE.BUSINESS
|
||||
})
|
||||
const isMember = computed(() => !!(state.userInfo && state.userInfo.isMember))
|
||||
const userInfo = computed(() => state.userInfo)
|
||||
|
||||
/** 微信登录 */
|
||||
async function login(payload = {}) {
|
||||
@@ -69,6 +70,7 @@ export const useUserStore = () => {
|
||||
|
||||
return {
|
||||
state,
|
||||
userInfo,
|
||||
isLogin,
|
||||
isBusiness,
|
||||
isMember,
|
||||
|
||||
@@ -143,6 +143,58 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商家门店专区(仅商家发布或关联认证商户时展示) -->
|
||||
<view v-if="isMerchantPost" class="fc-card detail__merchant">
|
||||
<view class="detail__merchant-badge-bar">
|
||||
<view class="detail__merchant-flag">
|
||||
<image class="fc-icon fc-icon--xs" :src="iconUrl('shield')" mode="aspectFit" />
|
||||
<text class="detail__merchant-flag-txt">认证商家官方门店</text>
|
||||
</view>
|
||||
<text class="detail__merchant-security">工商资质已核验</text>
|
||||
</view>
|
||||
|
||||
<view class="detail__merchant-main">
|
||||
<image
|
||||
v-if="merchantInfo && merchantInfo.logo"
|
||||
class="detail__merchant-logo"
|
||||
:src="assetUrl(merchantInfo.logo)"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<view v-else class="detail__merchant-logo-placeholder">
|
||||
<image class="fc-icon fc-icon--md" :src="iconUrl('login-shop') || iconUrl('home-nearby')" mode="aspectFit" />
|
||||
</view>
|
||||
|
||||
<view class="detail__merchant-meta">
|
||||
<view class="detail__merchant-name-row">
|
||||
<text class="detail__merchant-name">{{ (merchantInfo && merchantInfo.name) || (post.publisher && post.publisher.name) || '同城认证门店' }}</text>
|
||||
</view>
|
||||
<view class="detail__merchant-tags">
|
||||
<text v-if="merchantInfo && merchantInfo.category" class="detail__merchant-tag-item">{{ merchantInfo.category }}</text>
|
||||
<text class="detail__merchant-tag-item detail__merchant-tag-item--credit">实体保障</text>
|
||||
<text class="detail__merchant-tag-item detail__merchant-tag-item--credit">真实经营</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 店铺公告(若有) -->
|
||||
<view v-if="merchantInfo && merchantInfo.notice" class="detail__merchant-notice">
|
||||
<image class="fc-icon fc-icon--xs" :src="iconUrl('notice')" mode="aspectFit" />
|
||||
<text class="detail__merchant-notice-txt">{{ merchantInfo.notice }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 实体门店地址与一键导航 -->
|
||||
<view v-if="merchantAddress" class="detail__merchant-address-box" @click="openMerchantLocation">
|
||||
<view class="detail__merchant-address-left">
|
||||
<image class="fc-icon fc-icon--sm" :src="iconUrl('home-location')" mode="aspectFit" />
|
||||
<text class="detail__merchant-address-txt">{{ merchantAddress }}</text>
|
||||
</view>
|
||||
<view class="detail__merchant-nav-btn">
|
||||
<text>{{ hasMerchantCoord ? '导航到店' : '复制地址' }}</text>
|
||||
<text class="detail__merchant-nav-arrow">›</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 详细内容与服务标签 -->
|
||||
<view class="fc-card">
|
||||
<text class="detail__section-title">详细描述</text>
|
||||
@@ -481,6 +533,55 @@ export default {
|
||||
/**
|
||||
* 相对发布时间
|
||||
*/
|
||||
/**
|
||||
* 是否为商家发布的信息
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isMerchantPost() {
|
||||
return !!(
|
||||
this.post.identityType === 'merchant' ||
|
||||
(this.post.merchant && this.post.merchant.name) ||
|
||||
(this.post.publisher && this.post.publisher.isMerchant)
|
||||
)
|
||||
},
|
||||
/**
|
||||
* 商家门店详细信息
|
||||
* @returns {Object|null}
|
||||
*/
|
||||
merchantInfo() {
|
||||
if (this.post.merchant && typeof this.post.merchant === 'object') {
|
||||
return this.post.merchant
|
||||
}
|
||||
if (this.post.publisher && this.post.publisher.isMerchant) {
|
||||
return {
|
||||
name: this.post.publisher.name || '同城认证商户',
|
||||
logo: this.post.publisher.avatar || '',
|
||||
address: this.post.address || '',
|
||||
lat: this.post.lat,
|
||||
lng: this.post.lng,
|
||||
verified: true,
|
||||
}
|
||||
}
|
||||
return null
|
||||
},
|
||||
/**
|
||||
* 门店实体地址
|
||||
* @returns {string}
|
||||
*/
|
||||
merchantAddress() {
|
||||
return (this.merchantInfo && this.merchantInfo.address) || this.post.address || ''
|
||||
},
|
||||
/**
|
||||
* 门店是否具备坐标
|
||||
* @returns {boolean}
|
||||
*/
|
||||
hasMerchantCoord() {
|
||||
const m = this.merchantInfo
|
||||
if (m && m.lat != null && m.lng != null && Number(m.lat) !== 0 && Number(m.lng) !== 0) {
|
||||
return true
|
||||
}
|
||||
return this.hasLocation
|
||||
},
|
||||
timeText() {
|
||||
return fromNow(this.post.createdAt)
|
||||
},
|
||||
@@ -507,15 +608,26 @@ export default {
|
||||
hasLocation() {
|
||||
return this.post.lat != null && this.post.lng != null
|
||||
},
|
||||
/**
|
||||
* 当前登录用户
|
||||
*/
|
||||
currentUser() {
|
||||
try {
|
||||
const store = useUserStore()
|
||||
const user = (store.userInfo && store.userInfo.value) || store.userInfo || (store.state && store.state.userInfo)
|
||||
return user || null
|
||||
} catch (e) {
|
||||
return null
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 是否为本人发布
|
||||
*/
|
||||
isSelf() {
|
||||
try {
|
||||
const store = useUserStore()
|
||||
const user = (store.userInfo && store.userInfo.value) || store.userInfo
|
||||
const curId = user && user.id
|
||||
const pubId = this.post.publisher && this.post.publisher.id
|
||||
const user = this.currentUser
|
||||
const curId = user && (user.id || user.userId)
|
||||
const pubId = (this.post && this.post.publisher && this.post.publisher.id) || (this.post && (this.post.userId || this.post.user_id))
|
||||
return !!(curId && pubId && Number(curId) === Number(pubId))
|
||||
} catch (e) {
|
||||
return false
|
||||
@@ -536,8 +648,7 @@ export default {
|
||||
onShareAppMessage() {
|
||||
let inviterId = 0
|
||||
try {
|
||||
const store = useUserStore()
|
||||
const user = (store.userInfo && store.userInfo.value) || store.userInfo
|
||||
const user = this.currentUser
|
||||
if (user && user.id) inviterId = user.id
|
||||
} catch (e) {}
|
||||
|
||||
@@ -559,8 +670,7 @@ export default {
|
||||
onShareTimeline() {
|
||||
let inviterId = 0
|
||||
try {
|
||||
const store = useUserStore()
|
||||
const user = (store.userInfo && store.userInfo.value) || store.userInfo
|
||||
const user = this.currentUser
|
||||
if (user && user.id) inviterId = user.id
|
||||
} catch (e) {}
|
||||
|
||||
@@ -891,6 +1001,38 @@ export default {
|
||||
/**
|
||||
* 导航或复制地址
|
||||
*/
|
||||
/**
|
||||
* 导航前往商家门店或复制实体地址
|
||||
*/
|
||||
openMerchantLocation() {
|
||||
const m = this.merchantInfo
|
||||
const addr = this.merchantAddress
|
||||
const lat = m && m.lat != null ? Number(m.lat) : (this.post.lat != null ? Number(this.post.lat) : null)
|
||||
const lng = m && m.lng != null ? Number(m.lng) : (this.post.lng != null ? Number(this.post.lng) : null)
|
||||
const name = (m && m.name) || this.post.title || '商家门店'
|
||||
|
||||
if (lat != null && lng != null && lat !== 0 && lng !== 0) {
|
||||
uni.openLocation({
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
name: name,
|
||||
address: addr || '商家实体门店',
|
||||
fail: () => {
|
||||
if (addr) {
|
||||
uni.setClipboardData({
|
||||
data: `${addr}`.trim(),
|
||||
success: () => uni.showToast({ title: '门店地址已复制', icon: 'none' })
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (addr) {
|
||||
uni.setClipboardData({
|
||||
data: `${addr}`.trim(),
|
||||
success: () => uni.showToast({ title: '门店地址已复制', icon: 'none' })
|
||||
})
|
||||
}
|
||||
},
|
||||
openMap() {
|
||||
if (!this.hasLocation) {
|
||||
uni.setClipboardData({
|
||||
@@ -1215,8 +1357,7 @@ export default {
|
||||
// 9. 底部扫码交互区(真实高密度二维码 + 醒目指引)
|
||||
let inviterId = 0
|
||||
try {
|
||||
const store = useUserStore()
|
||||
const user = (store.userInfo && store.userInfo.value) || store.userInfo
|
||||
const user = this.currentUser
|
||||
if (user && user.id) inviterId = user.id
|
||||
} catch (e) {}
|
||||
const qrUrl = `https://fenleixinxi.gzyakj.com.cn/pages/detail/detail?id=${this.id}${inviterId ? '&inviterId=' + inviterId : ''}`
|
||||
@@ -1491,6 +1632,151 @@ export default {
|
||||
color: $fc-text-secondary;
|
||||
}
|
||||
|
||||
/* 商家门店卡片 */
|
||||
.detail__merchant {
|
||||
margin-top: 20rpx;
|
||||
background: #ffffff;
|
||||
border-radius: $fc-radius-lg;
|
||||
padding: 24rpx;
|
||||
border: 1rpx solid #e2f4ea;
|
||||
}
|
||||
.detail__merchant-badge-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: linear-gradient(90deg, #edfbf3 0%, #f6fdf9 100%);
|
||||
border-radius: 12rpx;
|
||||
padding: 10rpx 16rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border: 1rpx solid #d4f5e2;
|
||||
}
|
||||
.detail__merchant-flag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
}
|
||||
.detail__merchant-flag-txt {
|
||||
font-size: 22rpx;
|
||||
font-weight: 700;
|
||||
color: #04874a;
|
||||
}
|
||||
.detail__merchant-security {
|
||||
font-size: 20rpx;
|
||||
color: #04874a;
|
||||
}
|
||||
.detail__merchant-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.detail__merchant-logo {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 16rpx;
|
||||
border: 1rpx solid #eef2f0;
|
||||
flex-shrink: 0;
|
||||
background: #f8faf8;
|
||||
}
|
||||
.detail__merchant-logo-placeholder {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 16rpx;
|
||||
border: 1rpx solid #dcf3e5;
|
||||
background: #f0fbf5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.detail__merchant-meta {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.detail__merchant-name-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.detail__merchant-name {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #0f172a;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.detail__merchant-tags {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 10rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.detail__merchant-tag-item {
|
||||
font-size: 20rpx;
|
||||
padding: 2rpx 12rpx;
|
||||
border-radius: 6rpx;
|
||||
background: #e6f9ef;
|
||||
color: #04874a;
|
||||
font-weight: 600;
|
||||
|
||||
&--credit {
|
||||
background: #fef7ec;
|
||||
color: #d97706;
|
||||
}
|
||||
}
|
||||
.detail__merchant-notice {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10rpx;
|
||||
background: #fbfdfc;
|
||||
border: 1rpx dashed #d1eedc;
|
||||
border-radius: 12rpx;
|
||||
padding: 14rpx 18rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.detail__merchant-notice-txt {
|
||||
flex: 1;
|
||||
font-size: 24rpx;
|
||||
color: #334155;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.detail__merchant-address-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #f8faf8;
|
||||
border-radius: 14rpx;
|
||||
padding: 16rpx 20rpx;
|
||||
margin-top: 20rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
.detail__merchant-address-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
flex: 1;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
.detail__merchant-address-txt {
|
||||
font-size: 26rpx;
|
||||
color: #1e293b;
|
||||
font-weight: 500;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.detail__merchant-nav-btn {
|
||||
background: #00e070;
|
||||
color: #04301e;
|
||||
font-size: 22rpx;
|
||||
font-weight: 700;
|
||||
padding: 8rpx 18rpx;
|
||||
border-radius: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.detail__merchant-nav-arrow {
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* 发布者 */
|
||||
.detail__publisher {
|
||||
display: flex;
|
||||
|
||||
在新工单中引用
屏蔽一个用户