feat: 完善协议管理、师傅资质认证、分账配置并完成测试环境全量部署与同步
这个提交包含在:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\admin\command;
|
||||
|
||||
use app\common\library\CommissionService;
|
||||
use app\common\library\OrderStatus;
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
@@ -47,9 +48,10 @@ class OrderAutoverify extends Command
|
||||
|
||||
$masterId = (int)$lockedOrder['master_id'];
|
||||
$payAmount = (float)$lockedOrder['pay_amount'];
|
||||
$rate = 10.00;
|
||||
$commission = round($payAmount * $rate / 100, 2);
|
||||
$settleAmount = round($payAmount - $commission, 2);
|
||||
$settleCalc = CommissionService::calcByOrder($lockedOrder);
|
||||
$rate = $settleCalc['commission_rate'];
|
||||
$commission = $settleCalc['commission'];
|
||||
$settleAmount = $settleCalc['settle_amount'];
|
||||
|
||||
// 1. 更新订单为已完成
|
||||
Db::name('order')->where('id', $orderId)->update([
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use app\common\library\AgreementService;
|
||||
|
||||
/**
|
||||
* 协议与隐私管理
|
||||
*
|
||||
* 统一编辑管理平台《用户服务协议》《隐私保护指引》《师傅入驻协议》《商家协同协议》,
|
||||
* 保存后实时同步至小程序与 H5 独立协议展示页面。
|
||||
*
|
||||
* @icon fa fa-file-text-o
|
||||
*/
|
||||
class Agreement extends Backend
|
||||
{
|
||||
/**
|
||||
* @var \app\admin\model\Agreement
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\Agreement;
|
||||
}
|
||||
|
||||
/**
|
||||
* 协议与隐私编辑工作台
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$agreements = AgreementService::getAllForAdmin();
|
||||
$this->view->assign([
|
||||
'agreements' => $agreements,
|
||||
'agreementsJson' => json_encode($agreements, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP),
|
||||
'canSave' => $this->auth->check('agreement/save'),
|
||||
]);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存协议内容与元数据
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
if (false === $this->request->isPost()) {
|
||||
$this->error(__('Invalid parameters'));
|
||||
}
|
||||
$this->token();
|
||||
|
||||
$code = trim((string)$this->request->post('code', ''));
|
||||
// 读取未剥离标签的原始数组,由 AgreementService::sanitizeHtml 执行严格 XSS 白名单净化
|
||||
$row = $this->request->post('row/a', [], null);
|
||||
if ($code === '' || !is_array($row) || empty($row)) {
|
||||
$this->error('提交的协议数据不能为空', null, ['token' => $this->request->token()]);
|
||||
}
|
||||
|
||||
try {
|
||||
$saved = AgreementService::saveByCode($code, $row);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$this->error($e->getMessage(), null, ['token' => $this->request->token()]);
|
||||
} catch (\Throwable $e) {
|
||||
$this->error('保存协议失败:' . $e->getMessage(), null, ['token' => $this->request->token()]);
|
||||
}
|
||||
|
||||
$this->success('协议内容已保存并同步生效', null, [
|
||||
'token' => $this->request->token(),
|
||||
'agreement' => $saved,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use app\common\library\CommissionService;
|
||||
use app\common\library\FinanceConfigService;
|
||||
use think\Db;
|
||||
use think\exception\PDOException;
|
||||
|
||||
/**
|
||||
* 抽佣与提现配置中心
|
||||
*
|
||||
* 统一管理:
|
||||
* 1. 按订单多维度(计价模式/客群/服务类目/加急/金额阶梯)动态抽佣规则与订单快照兜底策略
|
||||
* 2. 师傅钱包提现规则与微信小程序商家转账(场景 1005 劳务报酬)合规参数
|
||||
*
|
||||
* @icon fa fa-sliders
|
||||
*/
|
||||
class FinanceConfig extends Backend
|
||||
{
|
||||
/**
|
||||
* @var \app\admin\model\CommissionRule
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
protected $searchFields = 'id,name,remark';
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\CommissionRule;
|
||||
|
||||
$catRows = Db::name('service_cat')
|
||||
->field('id,name,status')
|
||||
->order('weigh desc, id asc')
|
||||
->select();
|
||||
$catMap = [0 => '不限服务分类'];
|
||||
foreach ($catRows as $c) {
|
||||
$catMap[(int)$c['id']] = (string)$c['name'] . ($c['status'] === 'hidden' ? '(已隐藏)' : '');
|
||||
}
|
||||
|
||||
$this->view->assign([
|
||||
'orderModeList' => $this->model->getOrderModeList(),
|
||||
'customerTypeList' => $this->model->getCustomerTypeList(),
|
||||
'urgentModeList' => $this->model->getUrgentModeList(),
|
||||
'calcModeList' => $this->model->getCalcModeList(),
|
||||
'statusList' => $this->model->getStatusList(),
|
||||
'catMap' => $catMap,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置中心首页(GET 渲染独立双页签配置界面;Ajax 返回按订单维度抽佣规则列表)
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->request->filter(['strip_tags', 'trim']);
|
||||
if (false === $this->request->isAjax()) {
|
||||
$allCfg = FinanceConfigService::getAll(true);
|
||||
$withdrawCfg = FinanceConfigService::getWithdrawConfig();
|
||||
$commDefaults = FinanceConfigService::getCommissionDefaults();
|
||||
|
||||
$this->view->assign([
|
||||
'cfg' => $allCfg,
|
||||
'withdrawCfg' => $withdrawCfg,
|
||||
'commDefaults' => $commDefaults,
|
||||
]);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
|
||||
$orderExpr = $sort === 'weigh' ? "weigh {$order}, id desc" : "{$sort} {$order}";
|
||||
$list = $this->model
|
||||
->where($where)
|
||||
->order($orderExpr)
|
||||
->paginate($limit);
|
||||
|
||||
$rows = $list->items();
|
||||
if (!empty($rows)) {
|
||||
$cats = Db::name('service_cat')->column('name', 'id');
|
||||
foreach ($rows as &$r) {
|
||||
$cid = (int)$r['cat_id'];
|
||||
$r['cat_name'] = $cid > 0 ? ($cats[$cid] ?? ('分类#' . $cid)) : '';
|
||||
}
|
||||
unset($r);
|
||||
}
|
||||
|
||||
return json([
|
||||
'total' => $list->total(),
|
||||
'rows' => $rows,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存订单默认兜底抽佣设置 / 提现与微信转账规则配置
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
if (false === $this->request->isPost()) {
|
||||
$this->error(__('Invalid parameters'));
|
||||
}
|
||||
$this->token();
|
||||
|
||||
$section = (string)$this->request->post('section', '');
|
||||
$row = $this->request->post('row/a', []);
|
||||
if (!is_array($row) || empty($row)) {
|
||||
$this->error('提交的配置数据不能为空');
|
||||
}
|
||||
|
||||
// 处理多选框全部取消勾选时前端未上送对应键的情况
|
||||
if ($section === 'withdraw') {
|
||||
if (!array_key_exists('withdraw_channels', $row)) {
|
||||
$this->error('请至少勾选一种开放提现渠道', null, ['token' => $this->request->token()]);
|
||||
}
|
||||
if (!array_key_exists('withdraw_allow_weekdays', $row)) {
|
||||
$this->error('请至少选择一天允许提现的周期', null, ['token' => $this->request->token()]);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
FinanceConfigService::saveConfigs($row);
|
||||
CommissionService::clearCache();
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$this->error($e->getMessage(), null, ['token' => $this->request->token()]);
|
||||
} catch (\Throwable $e) {
|
||||
$this->error('保存配置失败:' . $e->getMessage(), null, ['token' => $this->request->token()]);
|
||||
}
|
||||
|
||||
$msg = $section === 'commission_default'
|
||||
? '抽佣默认设置已保存(仅影响新订单,已下单工单不受影响)'
|
||||
: '提现规则已保存生效';
|
||||
|
||||
$this->success($msg, null, ['token' => $this->request->token()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增按订单维度抽佣规则
|
||||
*/
|
||||
public function rule_add()
|
||||
{
|
||||
if (false === $this->request->isPost()) {
|
||||
$this->view->assign('row', [
|
||||
'name' => '',
|
||||
'order_mode' => 'all',
|
||||
'customer_type' => 'all',
|
||||
'cat_id' => 0,
|
||||
'urgent_mode' => 'all',
|
||||
'min_amount' => '0.00',
|
||||
'max_amount' => '0.00',
|
||||
'calc_mode' => 'percent',
|
||||
'commission_rate' => '10.00',
|
||||
'fixed_fee' => '0.00',
|
||||
'min_commission' => '0.00',
|
||||
'max_commission' => '0.00',
|
||||
'weigh' => 100,
|
||||
'status' => 'normal',
|
||||
'remark' => '',
|
||||
]);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
$this->token();
|
||||
$raw = $this->request->post('row/a', []);
|
||||
try {
|
||||
$clean = $this->validateAndCleanRuleInput($raw);
|
||||
$this->model->allowField(true)->save($clean);
|
||||
CommissionService::clearCache();
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$this->error($e->getMessage());
|
||||
} catch (PDOException|\Exception $e) {
|
||||
$this->error('新增规则失败:' . $e->getMessage());
|
||||
}
|
||||
|
||||
$this->success('抽佣规则已创建(仅对后续新订单生效)');
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑按订单维度抽佣规则
|
||||
*/
|
||||
public function rule_edit($ids = null)
|
||||
{
|
||||
$row = $this->model->get($ids);
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
if (false === $this->request->isPost()) {
|
||||
$this->view->assign('row', $row);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
$this->token();
|
||||
$raw = $this->request->post('row/a', []);
|
||||
try {
|
||||
$clean = $this->validateAndCleanRuleInput($raw);
|
||||
$row->allowField(true)->save($clean);
|
||||
CommissionService::clearCache();
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$this->error($e->getMessage());
|
||||
} catch (PDOException|\Exception $e) {
|
||||
$this->error('更新规则失败:' . $e->getMessage());
|
||||
}
|
||||
|
||||
$this->success('抽佣规则已更新(历史已创订单不受影响)');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除抽佣规则
|
||||
*/
|
||||
public function rule_del($ids = null)
|
||||
{
|
||||
if (false === $this->request->isPost()) {
|
||||
$this->error(__('Invalid parameters'));
|
||||
}
|
||||
$ids = $ids ?: $this->request->post('ids');
|
||||
$idArr = array_values(array_filter(array_map('intval', explode(',', (string)$ids))));
|
||||
if (empty($idArr)) {
|
||||
$this->error(__('Parameter %s can not be empty', 'ids'));
|
||||
}
|
||||
|
||||
$count = 0;
|
||||
Db::startTrans();
|
||||
try {
|
||||
$list = $this->model->where('id', 'in', $idArr)->select();
|
||||
foreach ($list as $item) {
|
||||
$count += $item->delete();
|
||||
}
|
||||
Db::commit();
|
||||
CommissionService::clearCache();
|
||||
} catch (PDOException|\Exception $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
|
||||
if ($count) {
|
||||
$this->success();
|
||||
}
|
||||
$this->error(__('No rows were deleted'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量启用/停用抽佣规则
|
||||
*/
|
||||
public function rule_multi($ids = null)
|
||||
{
|
||||
if (false === $this->request->isPost()) {
|
||||
$this->error(__('Invalid parameters'));
|
||||
}
|
||||
$ids = $ids ?: $this->request->post('ids');
|
||||
$params = (string)$this->request->post('params', '');
|
||||
parse_str($params, $values);
|
||||
if (empty($ids) || empty($values)) {
|
||||
$this->error(__('Parameter %s can not be empty', 'ids'));
|
||||
}
|
||||
|
||||
$allowed = [];
|
||||
if (isset($values['status']) && in_array($values['status'], ['normal', 'hidden'], true)) {
|
||||
$allowed['status'] = $values['status'];
|
||||
}
|
||||
if (isset($values['weigh']) && is_numeric($values['weigh'])) {
|
||||
$allowed['weigh'] = (int)$values['weigh'];
|
||||
}
|
||||
if (empty($allowed)) {
|
||||
$this->error('仅允许批量修改启用状态或优先级权重');
|
||||
}
|
||||
|
||||
$idArr = array_values(array_filter(array_map('intval', explode(',', (string)$ids))));
|
||||
$allowed['updatetime'] = time();
|
||||
Db::name('commission_rule')->where('id', 'in', $idArr)->update($allowed);
|
||||
CommissionService::clearCache();
|
||||
$this->success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽佣规则入参强白名单与业务区间合法性校验
|
||||
*
|
||||
* @param array $raw
|
||||
* @return array
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
protected function validateAndCleanRuleInput(array $raw): array
|
||||
{
|
||||
$name = trim((string)($raw['name'] ?? ''));
|
||||
if ($name === '' || mb_strlen($name) > 80) {
|
||||
throw new \InvalidArgumentException('请填写规则名称(1 ~ 80 个字符)');
|
||||
}
|
||||
|
||||
$orderMode = (string)($raw['order_mode'] ?? 'all');
|
||||
if (!array_key_exists($orderMode, $this->model->getOrderModeList())) {
|
||||
throw new \InvalidArgumentException('请选择有效的适用订单计价模式');
|
||||
}
|
||||
|
||||
$customerType = (string)($raw['customer_type'] ?? 'all');
|
||||
if (!array_key_exists($customerType, $this->model->getCustomerTypeList())) {
|
||||
throw new \InvalidArgumentException('请选择有效的适用发单客群');
|
||||
}
|
||||
|
||||
$catId = max(0, (int)($raw['cat_id'] ?? 0));
|
||||
if ($catId > 0 && !Db::name('service_cat')->where('id', $catId)->find()) {
|
||||
throw new \InvalidArgumentException('所选服务类目不存在');
|
||||
}
|
||||
|
||||
$urgentMode = (string)($raw['urgent_mode'] ?? 'all');
|
||||
if (!array_key_exists($urgentMode, $this->model->getUrgentModeList())) {
|
||||
throw new \InvalidArgumentException('请选择有效的加急属性条件');
|
||||
}
|
||||
|
||||
$minAmount = round((float)($raw['min_amount'] ?? 0), 2);
|
||||
$maxAmount = round((float)($raw['max_amount'] ?? 0), 2);
|
||||
if ($minAmount < 0 || $maxAmount < 0) {
|
||||
throw new \InvalidArgumentException('订单金额区间不能为负数');
|
||||
}
|
||||
if ($maxAmount > 0 && $minAmount > $maxAmount) {
|
||||
throw new \InvalidArgumentException('订单起始金额不能大于订单上限金额(0 表示不限上限)');
|
||||
}
|
||||
|
||||
$calcMode = (string)($raw['calc_mode'] ?? 'percent');
|
||||
if (!array_key_exists($calcMode, $this->model->getCalcModeList())) {
|
||||
throw new \InvalidArgumentException('请选择有效的计佣方式');
|
||||
}
|
||||
|
||||
$rate = 0.00;
|
||||
if (in_array($calcMode, ['percent', 'mixed'], true)) {
|
||||
$rate = CommissionService::validateRateInput($raw['commission_rate'] ?? '');
|
||||
}
|
||||
|
||||
$fixedFee = 0.00;
|
||||
if (in_array($calcMode, ['fixed', 'mixed'], true)) {
|
||||
if (!isset($raw['fixed_fee']) || !is_numeric($raw['fixed_fee']) || (float)$raw['fixed_fee'] < 0) {
|
||||
throw new \InvalidArgumentException('请填写有效的每单固定抽佣金额(≥ 0 元)');
|
||||
}
|
||||
$fixedFee = round((float)$raw['fixed_fee'], 2);
|
||||
}
|
||||
|
||||
$minComm = round(max(0.00, (float)($raw['min_commission'] ?? 0)), 2);
|
||||
$maxComm = round(max(0.00, (float)($raw['max_commission'] ?? 0)), 2);
|
||||
if ($minComm > 0 && $maxComm > 0 && $minComm > $maxComm) {
|
||||
throw new \InvalidArgumentException('单笔保底抽佣金额不能大于单笔封顶抽佣金额');
|
||||
}
|
||||
|
||||
$weigh = isset($raw['weigh']) && is_numeric($raw['weigh']) ? (int)$raw['weigh'] : 100;
|
||||
$status = in_array($raw['status'] ?? 'normal', ['normal', 'hidden'], true) ? $raw['status'] : 'normal';
|
||||
$remark = mb_substr(trim((string)($raw['remark'] ?? '')), 0, 255);
|
||||
|
||||
return [
|
||||
'name' => $name,
|
||||
'order_mode' => $orderMode,
|
||||
'customer_type' => $customerType,
|
||||
'cat_id' => $catId,
|
||||
'urgent_mode' => $urgentMode,
|
||||
'min_amount' => number_format($minAmount, 2, '.', ''),
|
||||
'max_amount' => number_format($maxAmount, 2, '.', ''),
|
||||
'calc_mode' => $calcMode,
|
||||
'commission_rate' => number_format($rate, 2, '.', ''),
|
||||
'fixed_fee' => number_format($fixedFee, 2, '.', ''),
|
||||
'min_commission' => number_format($minComm, 2, '.', ''),
|
||||
'max_commission' => number_format($maxComm, 2, '.', ''),
|
||||
'weigh' => $weigh,
|
||||
'status' => $status,
|
||||
'remark' => $remark,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -173,9 +173,9 @@ class Home extends Backend
|
||||
'waitingInvoice' => $waitingInvoice,
|
||||
'pendingDispatch' => $pendingDispatch,
|
||||
|
||||
'masterAvgScore' => $masterAvg['avg_score'] ?: '5.0',
|
||||
'masterAvgAccept' => $masterAvg['avg_accept'] ?: '100',
|
||||
'masterAvgOntime' => $masterAvg['avg_ontime'] ?: '100',
|
||||
'masterAvgScore' => ($masterAvg && $masterAvg['avg_score'] !== null) ? (string)$masterAvg['avg_score'] : '0.0',
|
||||
'masterAvgAccept' => ($masterAvg && $masterAvg['avg_accept'] !== null) ? (string)$masterAvg['avg_accept'] : '0',
|
||||
'masterAvgOntime' => ($masterAvg && $masterAvg['avg_ontime'] !== null) ? (string)$masterAvg['avg_ontime'] : '0',
|
||||
|
||||
'totalService' => $totalService,
|
||||
'totalCategory' => $totalCategory,
|
||||
|
||||
@@ -418,6 +418,13 @@ class Master extends Backend
|
||||
->field('s.*, c.name as cat_name')
|
||||
->select();
|
||||
|
||||
// 5.5 技能证书记录
|
||||
$certs = Db::name('master_cert')
|
||||
->field('id,cert_code,cert_name,is_custom,cert_image,expire_date,is_long_term,status,audit_msg,updatetime')
|
||||
->where('master_id', $row['id'])
|
||||
->order('id desc')
|
||||
->select();
|
||||
|
||||
// 6. 钱包资金变动流水
|
||||
$walletLogs = Db::name('wallet_log')
|
||||
->where('user_type', 'master')
|
||||
@@ -426,6 +433,14 @@ class Master extends Backend
|
||||
->limit(6)
|
||||
->select();
|
||||
|
||||
// 7. 证件防伪水印安全转换(方案1:腾讯云数据万象动态水印)
|
||||
if (!empty($row['idcard_front'])) {
|
||||
$row['idcard_front_watermark'] = \app\common\library\TencentVerifyService::getWatermarkUrl($row['idcard_front']);
|
||||
}
|
||||
if (!empty($row['idcard_back'])) {
|
||||
$row['idcard_back_watermark'] = \app\common\library\TencentVerifyService::getWatermarkUrl($row['idcard_back']);
|
||||
}
|
||||
|
||||
$this->view->assign([
|
||||
'row' => $row,
|
||||
'recentOrders' => $recentOrders,
|
||||
@@ -433,6 +448,7 @@ class Master extends Backend
|
||||
'recentSettles' => $recentSettles,
|
||||
'recentReviews' => $recentReviews,
|
||||
'skills' => $skills,
|
||||
'certs' => $certs,
|
||||
'walletLogs' => $walletLogs,
|
||||
]);
|
||||
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use Exception;
|
||||
use think\Db;
|
||||
|
||||
/**
|
||||
* 师傅技能证书审核管理
|
||||
*
|
||||
* @icon fa fa-id-badge
|
||||
*/
|
||||
class MasterCert extends Backend
|
||||
{
|
||||
/**
|
||||
* @var \app\admin\model\MasterCert
|
||||
*/
|
||||
protected $model = null;
|
||||
protected $relationSearch = true;
|
||||
protected $searchFields = 'id,cert_name,cert_code,master.realname,master.mobile';
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\MasterCert;
|
||||
$this->view->assign('statusList', $this->model->getStatusList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 技能证书列表
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->request->filter(['strip_tags', 'trim']);
|
||||
if (false === $this->request->isAjax()) {
|
||||
return $this->view->fetch();
|
||||
}
|
||||
if ($this->request->request('keyField')) {
|
||||
return $this->selectpage();
|
||||
}
|
||||
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
|
||||
$list = $this->model
|
||||
->with(['master'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
return json(['total' => $list->total(), 'rows' => $list->items()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看证书详情
|
||||
*/
|
||||
public function detail($ids = null)
|
||||
{
|
||||
$row = $this->model->with(['master'])->where('master_cert.id', (int)$ids)->find();
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
$this->view->assign('row', $row);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核技能证书
|
||||
*/
|
||||
public function audit($ids = null)
|
||||
{
|
||||
return $this->handleAudit((int)$ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 兼容 FastAdmin 默认编辑路由,复用审核逻辑
|
||||
*/
|
||||
public function edit($ids = null)
|
||||
{
|
||||
return $this->handleAudit((int)$ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一证书审核处理(保护证件原图只读,仅更新审核状态与意见并通知师傅)
|
||||
*/
|
||||
private function handleAudit($id)
|
||||
{
|
||||
$row = $this->model->with(['master'])->where('master_cert.id', (int)$id)->find();
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
|
||||
if (false === $this->request->isPost()) {
|
||||
$this->view->assign('row', $row);
|
||||
return $this->view->fetch('audit');
|
||||
}
|
||||
|
||||
$params = $this->request->post('row/a', []);
|
||||
if (empty($params)) {
|
||||
$this->error(__('Parameter %s can not be empty', ''));
|
||||
}
|
||||
|
||||
$status = trim((string)($params['status'] ?? $row['status']));
|
||||
$auditMsg = trim((string)($params['audit_msg'] ?? ''));
|
||||
|
||||
$statusList = $this->model->getStatusList();
|
||||
if (!isset($statusList[$status])) {
|
||||
$this->error('审核状态不合法');
|
||||
}
|
||||
if ($status === 'reject' && $auditMsg === '') {
|
||||
$this->error('驳回技能证书时,必须填写驳回原因说明');
|
||||
}
|
||||
|
||||
$oldStatus = (string)$row['status'];
|
||||
$now = time();
|
||||
$adminId = (int)$this->auth->id;
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
Db::name('master_cert')->where('id', (int)$row['id'])->update([
|
||||
'status' => $status,
|
||||
'audit_msg' => mb_substr($auditMsg, 0, 255),
|
||||
'audit_admin_id' => $adminId,
|
||||
'audittime' => in_array($status, ['pass', 'reject'], true) ? $now : null,
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
|
||||
$masterId = (int)$row['master_id'];
|
||||
if ($masterId > 0) {
|
||||
$images = Db::name('master_cert')
|
||||
->where('master_id', $masterId)
|
||||
->where('status', 'in', ['pass', 'pending'])
|
||||
->order('id desc')
|
||||
->column('cert_image');
|
||||
$cleanImages = array_values(array_unique(array_filter(array_map('strval', $images ?: []))));
|
||||
$json = !empty($cleanImages) ? json_encode($cleanImages, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) : '';
|
||||
Db::name('master')->where('id', $masterId)->update([
|
||||
'cert_images' => mb_substr($json, 0, 1000),
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($status !== $oldStatus && in_array($status, ['pass', 'reject'], true) && $masterId > 0) {
|
||||
$certName = (string)$row['cert_name'];
|
||||
$msgTitle = $status === 'pass'
|
||||
? "技能证书审核通过({$certName})"
|
||||
: "技能证书审核未通过({$certName})";
|
||||
$msgContent = $status === 'pass'
|
||||
? "您上传的「{$certName}」已通过平台审核,可正常承接对应资质要求的工单。"
|
||||
: ("您上传的「{$certName}」未通过审核,原因:" . ($auditMsg !== '' ? $auditMsg : '照片不清晰或证件不符合要求,请重新上传。'));
|
||||
|
||||
Db::name('message')->insert([
|
||||
'receive_type' => 'master',
|
||||
'receive_id' => $masterId,
|
||||
'type' => 'audit',
|
||||
'title' => $msgTitle,
|
||||
'content' => $msgContent,
|
||||
'order_id' => 0,
|
||||
'is_read' => 0,
|
||||
'createtime' => $now,
|
||||
]);
|
||||
|
||||
$userId = (int)Db::name('master')->where('id', $masterId)->value('user_id');
|
||||
if ($userId > 0) {
|
||||
Db::name('message')->insert([
|
||||
'receive_type' => 'user',
|
||||
'receive_id' => $userId,
|
||||
'type' => 'audit',
|
||||
'title' => $msgTitle,
|
||||
'content' => $msgContent,
|
||||
'order_id' => 0,
|
||||
'is_read' => 0,
|
||||
'createtime' => $now,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
} catch (Exception $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
|
||||
$this->success('审核操作成功');
|
||||
}
|
||||
}
|
||||
@@ -127,6 +127,8 @@ class Order extends Backend
|
||||
$params['discount_amount'],
|
||||
$params['total_amount'],
|
||||
$params['pay_amount'],
|
||||
$params['commission_rate'],
|
||||
$params['commission_snapshot'],
|
||||
$params['pay_status'],
|
||||
$params['pay_type'],
|
||||
$params['pay_time'],
|
||||
@@ -173,6 +175,23 @@ class Order extends Backend
|
||||
}
|
||||
}
|
||||
|
||||
// 后台取消工单前置防资损与原路退款(必须在开启数据库事务之前调用远程退款接口)
|
||||
if ($oldStatus !== 9 && $newStatus === 9) {
|
||||
if ((int)$row['settle_status'] === 1) {
|
||||
$this->error('该工单已完成向师傅结算分账,不允许直接取消退款');
|
||||
}
|
||||
if ((int)$row['pay_status'] === 1) {
|
||||
$cancelReasonPre = trim((string)($params['cancel_reason'] ?? $row['cancel_reason'] ?? '平台后台取消工单'));
|
||||
try {
|
||||
$refundedAmount = \app\common\library\PaymentService::refundOrder((int)$row['id'], $cancelReasonPre ?: '平台后台取消工单');
|
||||
} catch (\Throwable $re) {
|
||||
$this->error('微信原路退款失败:' . $re->getMessage());
|
||||
}
|
||||
$params['pay_status'] = 2;
|
||||
$params['refund_amount'] = $refundedAmount > 0 ? $refundedAmount : (float)$row['pay_amount'];
|
||||
}
|
||||
}
|
||||
|
||||
$result = false;
|
||||
Db::startTrans();
|
||||
try {
|
||||
@@ -523,8 +542,9 @@ class Order extends Backend
|
||||
$review['tags_arr'] = $tagsArr;
|
||||
}
|
||||
|
||||
// 6. 财务结算记录
|
||||
// 6. 财务结算记录与订单锁定快照预计结算核算
|
||||
$settle = Db::name('settle')->where('order_id', $row['id'])->find();
|
||||
$settlePreview = \app\common\library\CommissionService::calcByOrder($row->toArray());
|
||||
|
||||
// 7. 企业商家协同发包来源
|
||||
$merchantOrder = Db::name('merchant_order')
|
||||
@@ -552,6 +572,24 @@ class Order extends Backend
|
||||
->order('a.id desc')
|
||||
->select();
|
||||
|
||||
// 10. 微信支付与原路退款交易流水(含失败错误码及中文诊断原因)
|
||||
$sceneMap = [
|
||||
'order' => '主订单支付',
|
||||
'quote' => '选定师傅报价',
|
||||
'diff' => '增项补差价',
|
||||
'batch' => '批量下单',
|
||||
];
|
||||
$payOrders = Db::name('pay_order')
|
||||
->where('order_id', (int)$row['id'])
|
||||
->order('id desc')
|
||||
->select();
|
||||
foreach ($payOrders as &$poItem) {
|
||||
$poItem['scene_text'] = $sceneMap[$poItem['scene'] ?? ''] ?? ($poItem['scene'] ?? '-');
|
||||
$poItem['status_text'] = \app\common\library\PaymentService::payOrderStatusLabel($poItem['status'] ?? '');
|
||||
$poItem['refund_status_text'] = \app\common\library\PaymentService::refundStatusLabel($poItem['refund_status'] ?? 'none');
|
||||
}
|
||||
unset($poItem);
|
||||
|
||||
$this->view->assign([
|
||||
'row' => $row,
|
||||
'goodsList' => $goodsList,
|
||||
@@ -560,11 +598,126 @@ class Order extends Backend
|
||||
'quoteList' => $quoteList,
|
||||
'review' => $review,
|
||||
'settle' => $settle,
|
||||
'settlePreview' => $settlePreview,
|
||||
'merchantOrder' => $merchantOrder,
|
||||
'invoiceInfo' => $invoiceInfo,
|
||||
'appealList' => $appealList,
|
||||
'payOrders' => $payOrders,
|
||||
]);
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台主动同步单笔支付/退款流水在微信网关的真实状态
|
||||
*/
|
||||
public function syncpay($ids = null)
|
||||
{
|
||||
if (!$this->request->isPost()) {
|
||||
$this->error('非法请求方式');
|
||||
}
|
||||
$payOrderId = $this->request->post('pay_order_id/d', 0);
|
||||
if ($payOrderId <= 0) {
|
||||
$payOrderId = (int)$ids;
|
||||
}
|
||||
$po = Db::name('pay_order')->where('id', $payOrderId)->find();
|
||||
if (!$po) {
|
||||
$this->error('未找到指定的支付交易流水');
|
||||
}
|
||||
|
||||
$status = (string)($po['status'] ?? '');
|
||||
try {
|
||||
if (in_array($status, ['refunding', 'refund_failed'], true) || trim((string)($po['refund_no'] ?? '')) !== '') {
|
||||
$updated = \app\common\library\PaymentService::syncRefundPayOrder($payOrderId);
|
||||
$label = \app\common\library\PaymentService::refundStatusLabel($updated['refund_status'] ?? '');
|
||||
$this->success('退款状态已从微信同步:' . $label);
|
||||
}
|
||||
|
||||
if ($status === 'paid') {
|
||||
$this->success('该笔流水当前已完成微信入账,状态正常');
|
||||
}
|
||||
|
||||
$res = \app\common\library\PaymentService::confirmOrderPay((string)$po['out_trade_no']);
|
||||
if (!empty($res['paid'])) {
|
||||
$msg = '微信已确认支付成功,系统已完成入账核销';
|
||||
if (!empty($res['duplicate_refund_error'])) {
|
||||
$this->error($res['duplicate_refund_error']);
|
||||
}
|
||||
$this->success($msg);
|
||||
}
|
||||
$this->success('同步成功,当前微信状态:' . ($res['trade_state_text'] ?? '待确认'));
|
||||
} catch (\Throwable $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台手动对退款失败(或未退)的微信支付流水重发原路退款
|
||||
*/
|
||||
public function retryrefund($ids = null)
|
||||
{
|
||||
if (!$this->request->isPost()) {
|
||||
$this->error('非法请求方式');
|
||||
}
|
||||
$payOrderId = $this->request->post('pay_order_id/d', 0);
|
||||
if ($payOrderId <= 0) {
|
||||
$payOrderId = (int)$ids;
|
||||
}
|
||||
$po = Db::name('pay_order')->where('id', $payOrderId)->find();
|
||||
if (!$po) {
|
||||
$this->error('未找到指定的支付交易流水');
|
||||
}
|
||||
|
||||
$order = Db::name('order')->where('id', (int)$po['order_id'])->find();
|
||||
if (!$order) {
|
||||
$this->error('关联业务订单不存在');
|
||||
}
|
||||
if ((int)$order['settle_status'] === 1) {
|
||||
$this->error('该工单已完成向师傅结算分账,不允许再执行退款');
|
||||
}
|
||||
|
||||
$status = (string)($po['status'] ?? '');
|
||||
if ($status === 'refunding') {
|
||||
$this->error('该流水处于微信退款处理中,请先点击【同步微信状态】核实是否已到账,切勿盲目重退');
|
||||
}
|
||||
if (!in_array($status, ['refund_failed', 'paid'], true)) {
|
||||
$this->error('当前流水状态为「' . \app\common\library\PaymentService::payOrderStatusLabel($status) . '」,不可发起原路退款');
|
||||
}
|
||||
|
||||
$reason = trim($this->request->post('reason/s', ''));
|
||||
try {
|
||||
$after = \app\common\library\PaymentService::refundSinglePayOrder(
|
||||
$payOrderId,
|
||||
$reason !== '' ? $reason : '管理员后台手动发起/重试原路退款'
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
$this->error('发起原路退款失败:' . $e->getMessage());
|
||||
}
|
||||
|
||||
// 若主工单已处于取消状态且本笔退款受理/到账成功,同步汇总真实退款金额
|
||||
if ((int)$order['status'] === 9 && in_array($after['status'] ?? '', ['refunding', 'refunded'], true)) {
|
||||
$allPaid = Db::name('pay_order')
|
||||
->where('order_id', (int)$order['id'])
|
||||
->whereIn('status', ['paid', 'refunding', 'refunded', 'refund_failed'])
|
||||
->select();
|
||||
$hasUnsettledRefund = false;
|
||||
$sumRefund = 0.00;
|
||||
foreach ($allPaid as $item) {
|
||||
if (in_array($item['status'], ['refunding', 'refunded'], true)) {
|
||||
$sumRefund = round($sumRefund + (float)($item['refund_amount'] ?: $item['amount']), 2);
|
||||
} else {
|
||||
$hasUnsettledRefund = true;
|
||||
}
|
||||
}
|
||||
Db::name('order')->where('id', (int)$order['id'])->update([
|
||||
'pay_status' => $hasUnsettledRefund ? (int)$order['pay_status'] : 2,
|
||||
'refund_amount' => $sumRefund,
|
||||
'updatetime' => time(),
|
||||
]);
|
||||
}
|
||||
|
||||
$statusLabel = \app\common\library\PaymentService::payOrderStatusLabel($after['status'] ?? '');
|
||||
$refundLabel = \app\common\library\PaymentService::refundStatusLabel($after['refund_status'] ?? 'none');
|
||||
$this->success('微信原路退款请求已提交,当前状态:' . $statusLabel . '(' . $refundLabel . ')');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,12 +346,13 @@ class Service extends Backend
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步商品规格型号表(支持特殊规格单独设价覆盖,留空或0则沿用商品默认服务价)
|
||||
* 同步商品规格型号表(支持特殊规格单独设价覆盖与规格参考图,同步联动系统图库)
|
||||
*/
|
||||
protected function syncSpecs($serviceId, $specsInput)
|
||||
{
|
||||
if (empty($serviceId)) return;
|
||||
$now = time();
|
||||
$catId = (int)Db::name('service')->where('id', $serviceId)->value('cat_id');
|
||||
$keepIds = [];
|
||||
if (!empty($specsInput) && is_array($specsInput)) {
|
||||
$idx = 0;
|
||||
@@ -359,6 +360,7 @@ class Service extends Backend
|
||||
$name = trim(isset($item['name']) ? $item['name'] : '');
|
||||
if ($name === '') continue;
|
||||
$specDesc = isset($item['description']) ? trim($item['description']) : '';
|
||||
$specImage = isset($item['image']) ? trim((string)$item['image']) : '';
|
||||
$specPrice = (isset($item['base_price']) && is_numeric($item['base_price']) && (float)$item['base_price'] > 0)
|
||||
? round((float)$item['base_price'], 2)
|
||||
: 0.00;
|
||||
@@ -367,18 +369,23 @@ class Service extends Backend
|
||||
$idx++;
|
||||
|
||||
if ($specId > 0) {
|
||||
Db::name('service_spec')->where('id', $specId)->where('service_id', $serviceId)->update([
|
||||
$updateData = [
|
||||
'name' => $name,
|
||||
'base_price' => $specPrice,
|
||||
'description' => $specDesc,
|
||||
'weigh' => $weigh,
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
];
|
||||
if (array_key_exists('image', $item)) {
|
||||
$updateData['image'] = $specImage;
|
||||
}
|
||||
Db::name('service_spec')->where('id', $specId)->where('service_id', $serviceId)->update($updateData);
|
||||
$keepIds[] = $specId;
|
||||
} else {
|
||||
$newId = Db::name('service_spec')->insertGetId([
|
||||
$specId = (int)Db::name('service_spec')->insertGetId([
|
||||
'service_id' => $serviceId,
|
||||
'name' => $name,
|
||||
'image' => $specImage,
|
||||
'base_price' => $specPrice,
|
||||
'description' => $specDesc,
|
||||
'weigh' => $weigh,
|
||||
@@ -386,7 +393,35 @@ class Service extends Backend
|
||||
'createtime' => $now,
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
$keepIds[] = $newId;
|
||||
$keepIds[] = $specId;
|
||||
}
|
||||
|
||||
// 若管理员为细分规格上传了参考图,自动同步更新或补充至 fa_system_gallery
|
||||
if ($specImage !== '') {
|
||||
$existingGal = Db::name('system_gallery')
|
||||
->where('service_id', $serviceId)
|
||||
->where('spec_id', $specId)
|
||||
->find();
|
||||
if ($existingGal) {
|
||||
Db::name('system_gallery')->where('id', $existingGal['id'])->update([
|
||||
'cat_id' => $catId,
|
||||
'title' => $name,
|
||||
'image' => $specImage,
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
} else {
|
||||
Db::name('system_gallery')->insert([
|
||||
'cat_id' => $catId,
|
||||
'service_id' => $serviceId,
|
||||
'spec_id' => $specId,
|
||||
'title' => $name,
|
||||
'image' => $specImage,
|
||||
'weigh' => $weigh,
|
||||
'status' => 'normal',
|
||||
'createtime' => $now,
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,6 +452,7 @@ class Service extends Backend
|
||||
Db::startTrans();
|
||||
try {
|
||||
Db::name('service_spec')->where('service_id', 'in', $idArr)->delete();
|
||||
Db::name('system_gallery')->where('service_id', 'in', $idArr)->delete();
|
||||
$deleted = Db::name('service')->where('id', 'in', $idArr)->delete();
|
||||
Db::commit();
|
||||
} catch (Exception $e) {
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use app\common\library\FinanceConfigService;
|
||||
use app\common\library\PaymentService;
|
||||
use think\Db;
|
||||
use think\exception\PDOException;
|
||||
|
||||
@@ -24,7 +26,7 @@ class Withdraw extends Backend
|
||||
*/
|
||||
protected $model = null;
|
||||
protected $relationSearch = true;
|
||||
protected $searchFields = 'id,account,audit_msg,master.realname,master.mobile';
|
||||
protected $searchFields = 'id,account,audit_msg,fail_code,fail_reason,out_bill_no,transfer_bill_no,master.realname,master.mobile';
|
||||
|
||||
/**
|
||||
* 审核状态机:当前状态 => 允许流转到的目标状态
|
||||
@@ -105,10 +107,12 @@ class Withdraw extends Backend
|
||||
}
|
||||
|
||||
/**
|
||||
* 财务审核:申请信息只读,仅允许合法状态流转并做资金联动
|
||||
* - 驳回:退回师傅余额并解冻,写入钱包流水,通知师傅
|
||||
* - 通过:仅标记审核通过,等待财务打款
|
||||
* - 打款完成:划出冻结资金,写入钱包流水,通知师傅
|
||||
* 财务审核与微信商家转账打款处理:
|
||||
* - 微信渠道(channel=wechat):
|
||||
* 1) 审核通过(pass):调用微信支付 V3 新版「商家转账(场景 1005 佣金报酬)」接口生成转账单,等待师傅在小程序确认收款
|
||||
* 2) 同步状态(sync):主动查询微信商家转账单状态,若 SUCCESS 则划出冻结资金标记 done;若 FAIL/CANCELLED 则解冻退回师傅余额
|
||||
* 3) 驳回/撤销(reject):若尚未发微信转账则直接退回余额;若已发微信转账则先调微信查单并撤销确认后再退回余额(防双重资损)
|
||||
* - 银行卡渠道(channel=bank):保留审核通过 → 线下打款完成(done) / 驳回(reject)
|
||||
*/
|
||||
public function edit($ids = null)
|
||||
{
|
||||
@@ -116,40 +120,101 @@ class Withdraw extends Backend
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
|
||||
$wdCfg = FinanceConfigService::getWithdrawConfig();
|
||||
$isWechat = ($row['channel'] === 'wechat');
|
||||
$useWxApi = $isWechat && ($wdCfg['transfer_mode'] === 'wx_mch_transfer');
|
||||
$hasWxBill = !empty($row['out_bill_no']);
|
||||
$txState = strtoupper(trim((string)($row['transfer_state'] ?? '')));
|
||||
$flowOptions = [];
|
||||
if ($row['status'] === 'wait') {
|
||||
if ($hasWxBill) {
|
||||
if (in_array($txState, ['FAIL', 'NOT_FOUND'], true) && $useWxApi) {
|
||||
$flowOptions = ['pass', 'sync', 'reject'];
|
||||
} else {
|
||||
$flowOptions = ['sync', 'reject'];
|
||||
}
|
||||
} else {
|
||||
$flowOptions = ['pass', 'reject'];
|
||||
}
|
||||
} elseif ($row['status'] === 'pass') {
|
||||
if ($isWechat && $hasWxBill) {
|
||||
if (in_array($txState, ['FAIL', 'NOT_FOUND'], true) && $useWxApi) {
|
||||
$flowOptions = ['pass', 'sync', 'reject'];
|
||||
} else {
|
||||
$flowOptions = ['sync', 'reject'];
|
||||
}
|
||||
} elseif ($useWxApi && !$hasWxBill) {
|
||||
$flowOptions = ['pass', 'done', 'reject'];
|
||||
} else {
|
||||
$flowOptions = ['done', 'reject'];
|
||||
}
|
||||
}
|
||||
|
||||
if (false === $this->request->isPost()) {
|
||||
// 展示师傅当前钱包情况,辅助财务判断
|
||||
$master = Db::name('master')->where('id', (int)$row['master_id'])->field('id,realname,mobile,user_id,money,frozen_money')->find();
|
||||
$this->view->assign('row', $row);
|
||||
$this->view->assign('master', $master ?: []);
|
||||
$this->view->assign('flowOptions', $this->statusFlow[$row['status']] ?? []);
|
||||
$this->view->assign('flowOptions', $flowOptions);
|
||||
$this->view->assign('useWxApi', $useWxApi);
|
||||
$this->view->assign('transferStateLabel', PaymentService::transferStateLabel($row['transfer_state'] ?? ''));
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
$status = (string)$this->request->post('row.status');
|
||||
$auditMsg = trim((string)$this->request->post('row.audit_msg'));
|
||||
|
||||
// 状态机校验:终态禁止操作,流转目标必须合法
|
||||
if (!isset($this->statusFlow[$row['status']])) {
|
||||
$this->error('该提现单已处于终态(已驳回/已打款),不允许再次审核');
|
||||
if (empty($flowOptions)) {
|
||||
$this->error('该提现单已处于终态(已驳回/已打款),不允许再次操作');
|
||||
}
|
||||
if (!in_array($status, $this->statusFlow[$row['status']], true)) {
|
||||
if (!in_array($status, $flowOptions, true)) {
|
||||
$this->error('状态流转不合法,请刷新后重试');
|
||||
}
|
||||
if ($status === 'reject' && $auditMsg === '') {
|
||||
$this->error('驳回时必须填写驳回原因');
|
||||
$this->error('驳回或撤销转账时必须填写原因');
|
||||
}
|
||||
|
||||
// 1. 驳回或撤销转账(统一走防双重资损方法)
|
||||
if ($status === 'reject') {
|
||||
try {
|
||||
$res = PaymentService::cancelOrRejectWithdraw((int)$row['id'], $auditMsg);
|
||||
} catch (\Throwable $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success($res['message'] ?? '已驳回处理');
|
||||
}
|
||||
|
||||
// 2. 微信钱包渠道(启用微信商家转账模式时):发起微信商家转账(1005) 或 同步微信转账状态
|
||||
if ($useWxApi && $status === 'pass') {
|
||||
try {
|
||||
PaymentService::initiateWithdrawTransfer((int)$row['id'], $auditMsg);
|
||||
} catch (\Throwable $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('已审核通过并发起微信商家转账,等待师傅在小程序「我的钱包」确认收款');
|
||||
}
|
||||
|
||||
if ($isWechat && $status === 'sync') {
|
||||
try {
|
||||
$updated = PaymentService::syncWithdrawTransfer((int)$row['id']);
|
||||
} catch (\Throwable $e) {
|
||||
$this->error('同步微信状态失败:' . $e->getMessage());
|
||||
}
|
||||
$stateText = PaymentService::transferStateLabel($updated['transfer_state'] ?? '');
|
||||
$this->success('已同步最新微信转账状态:' . $stateText);
|
||||
}
|
||||
|
||||
// 3. 线下银行卡打款(或历史未发微信单的线下打款完成)
|
||||
$masterId = (int)$row['master_id'];
|
||||
$amount = round((float)$row['amount'], 2);
|
||||
Db::startTrans();
|
||||
try {
|
||||
// 乐观锁更新状态,防止并发重复审核
|
||||
$affected = Db::name('withdraw')
|
||||
->where('id', $row['id'])
|
||||
->where('status', $row['status'])
|
||||
->update([
|
||||
'status' => $status,
|
||||
'audit_msg' => $auditMsg,
|
||||
'audit_msg' => $auditMsg !== '' ? $auditMsg : $row['audit_msg'],
|
||||
'updatetime' => time(),
|
||||
]);
|
||||
if (!$affected) {
|
||||
@@ -161,32 +226,11 @@ class Withdraw extends Backend
|
||||
throw new \Exception('提现师傅不存在');
|
||||
}
|
||||
|
||||
if ($status === 'reject') {
|
||||
// 驳回:解冻并退回余额,写入钱包流水
|
||||
$newMoney = round((float)$master['money'] + $amount, 2);
|
||||
Db::name('master')->where('id', $masterId)->update([
|
||||
'money' => $newMoney,
|
||||
'frozen_money' => round((float)$master['frozen_money'] - $amount, 2),
|
||||
'updatetime' => time(),
|
||||
]);
|
||||
Db::name('wallet_log')->insert([
|
||||
'user_type' => 'master',
|
||||
'user_id' => $masterId,
|
||||
'type' => 'refund',
|
||||
'amount' => $amount,
|
||||
'balance' => $newMoney,
|
||||
'order_id' => 0,
|
||||
'remark' => '提现驳回,申请金额退回钱包余额' . ($auditMsg !== '' ? '(原因:' . $auditMsg . ')' : ''),
|
||||
'createtime' => time(),
|
||||
]);
|
||||
$this->sendMasterMessage($masterId, (int)$master['user_id'], '提现申请已驳回', '您的提现申请 ¥' . $amount . ' 未通过财务审核:' . ($auditMsg !== '' ? $auditMsg : '无') . ',申请金额已退回钱包余额');
|
||||
} elseif ($status === 'pass') {
|
||||
// 审核通过:仅标记,资金保持冻结,等待财务打款
|
||||
$this->sendMasterMessage($masterId, (int)$master['user_id'], '提现审核通过', '您的提现申请 ¥' . $amount . ' 已通过审核,财务将尽快安排打款到 ' . ($row['channel'] === 'bank' ? '银行卡' : '微信钱包'));
|
||||
if ($status === 'pass') {
|
||||
$this->sendMasterMessage($masterId, (int)$master['user_id'], '提现审核通过', '您的提现申请 ¥' . $amount . ' 已通过审核,财务将尽快安排打款到银行卡');
|
||||
} elseif ($status === 'done') {
|
||||
// 打款完成:冻结资金划出
|
||||
Db::name('master')->where('id', $masterId)->update([
|
||||
'frozen_money' => round((float)$master['frozen_money'] - $amount, 2),
|
||||
'frozen_money' => max(0, round((float)$master['frozen_money'] - $amount, 2)),
|
||||
'updatetime' => time(),
|
||||
]);
|
||||
Db::name('wallet_log')->insert([
|
||||
@@ -209,6 +253,27 @@ class Withdraw extends Backend
|
||||
$this->success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台列表一键同步微信商家转账单最新状态
|
||||
*/
|
||||
public function sync($ids = null)
|
||||
{
|
||||
$row = $this->model->get($ids);
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
if (empty($row['out_bill_no'])) {
|
||||
$this->error('该提现单尚未发起微信商家转账');
|
||||
}
|
||||
try {
|
||||
$updated = PaymentService::syncWithdrawTransfer((int)$row['id']);
|
||||
} catch (\Throwable $e) {
|
||||
$this->error('同步失败:' . $e->getMessage());
|
||||
}
|
||||
$stateText = PaymentService::transferStateLabel($updated['transfer_state'] ?? '');
|
||||
$this->success('同步成功,当前微信状态:' . $stateText);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现单仅由师傅端发起,禁止后台手工添加
|
||||
*/
|
||||
|
||||
@@ -181,7 +181,7 @@ class Config extends Backend
|
||||
if ($name && $config) {
|
||||
try {
|
||||
$config->delete();
|
||||
ConfigModel::refreshFile();
|
||||
ConfigModel::refreshFile($name);
|
||||
} catch (Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller\service;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use think\Db;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* 系统图库管理
|
||||
*
|
||||
* @icon fa fa-picture-o
|
||||
*/
|
||||
class Gallery extends Backend
|
||||
{
|
||||
/**
|
||||
* Gallery模型对象
|
||||
* @var \app\admin\model\service\Gallery
|
||||
*/
|
||||
protected $model = null;
|
||||
protected $relationSearch = true;
|
||||
protected $searchFields = 'id,title,service.name,cat.name';
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\service\Gallery;
|
||||
$this->view->assign('statusList', $this->model->getStatusList());
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->request->filter(['strip_tags', 'trim']);
|
||||
if (false === $this->request->isAjax()) {
|
||||
$cats = Db::name('service_cat')
|
||||
->where('status', 'normal')
|
||||
->where('id', '<>', 15)
|
||||
->order('weigh desc, id asc')
|
||||
->select();
|
||||
$initServiceId = (int)$this->request->get('service_id', 0);
|
||||
$initServiceName = $initServiceId > 0 ? (string)Db::name('service')->where('id', $initServiceId)->value('name') : '';
|
||||
$this->view->assign([
|
||||
'catList' => $cats,
|
||||
'initServiceId' => $initServiceId,
|
||||
'initServiceName' => $initServiceName,
|
||||
]);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
if ($this->request->request('keyField')) {
|
||||
return $this->selectpage();
|
||||
}
|
||||
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
|
||||
$list = $this->model
|
||||
->with(['cat', 'service'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
return json(['total' => $list->total(), 'rows' => $list->items()]);
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post('row/a');
|
||||
if (!$params) {
|
||||
$this->error(__('Parameter %s can not be empty', ''));
|
||||
}
|
||||
$params = $this->preExcludeFields($params);
|
||||
$serviceId = isset($params['service_id']) ? (int)$params['service_id'] : 0;
|
||||
if ($serviceId <= 0) {
|
||||
$this->error('请选择所属商品');
|
||||
}
|
||||
$svc = Db::name('service')->where('id', $serviceId)->find();
|
||||
if (!$svc) {
|
||||
$this->error('所选商品不存在');
|
||||
}
|
||||
$catId = (int)$svc['cat_id'];
|
||||
$rawImages = isset($params['image']) ? trim((string)$params['image']) : '';
|
||||
$imgArr = array_values(array_filter(array_map('trim', explode(',', $rawImages))));
|
||||
if (empty($imgArr)) {
|
||||
$this->error('请至少上传一张系统参考图');
|
||||
}
|
||||
|
||||
$baseTitle = isset($params['title']) ? trim((string)$params['title']) : '';
|
||||
$weigh = isset($params['weigh']) ? (int)$params['weigh'] : 100;
|
||||
$status = (!empty($params['status']) && in_array($params['status'], ['normal', 'hidden'], true)) ? $params['status'] : 'normal';
|
||||
$now = time();
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
foreach ($imgArr as $idx => $imgUrl) {
|
||||
$itemTitle = $baseTitle !== '' ? $baseTitle : (string)$svc['name'];
|
||||
if (count($imgArr) > 1 && $baseTitle !== '') {
|
||||
$itemTitle = $baseTitle . ' ' . ($idx + 1);
|
||||
}
|
||||
Db::name('system_gallery')->insert([
|
||||
'cat_id' => $catId,
|
||||
'service_id' => $serviceId,
|
||||
'spec_id' => 0,
|
||||
'title' => mb_substr($itemTitle, 0, 80),
|
||||
'image' => $imgUrl,
|
||||
'weigh' => max(0, $weigh - $idx),
|
||||
'status' => $status,
|
||||
'createtime' => $now,
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
}
|
||||
Db::commit();
|
||||
} catch (Exception $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success();
|
||||
}
|
||||
|
||||
$initServiceId = (int)$this->request->get('service_id', 0);
|
||||
$initCatId = (int)$this->request->get('cat_id', 0);
|
||||
if ($initServiceId > 0 && $initCatId <= 0) {
|
||||
$initCatId = (int)Db::name('service')->where('id', $initServiceId)->value('cat_id');
|
||||
}
|
||||
$this->view->assign([
|
||||
'initCatId' => $initCatId ?: '',
|
||||
'initServiceId' => $initServiceId ?: '',
|
||||
]);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
public function edit($ids = null)
|
||||
{
|
||||
$row = $this->model->get($ids);
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post('row/a');
|
||||
if (!$params) {
|
||||
$this->error(__('Parameter %s can not be empty', ''));
|
||||
}
|
||||
$params = $this->preExcludeFields($params);
|
||||
$serviceId = isset($params['service_id']) ? (int)$params['service_id'] : (int)$row['service_id'];
|
||||
if ($serviceId <= 0) {
|
||||
$this->error('请选择所属商品');
|
||||
}
|
||||
$svc = Db::name('service')->where('id', $serviceId)->find();
|
||||
if (!$svc) {
|
||||
$this->error('所选商品不存在');
|
||||
}
|
||||
$params['cat_id'] = (int)$svc['cat_id'];
|
||||
if (empty($params['title']) || trim((string)$params['title']) === '') {
|
||||
$params['title'] = (string)$svc['name'];
|
||||
}
|
||||
if (empty($params['image']) || trim((string)$params['image']) === '') {
|
||||
$this->error('系统参考图不能为空');
|
||||
}
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
$row->allowField(true)->save($params);
|
||||
if ((int)$row['spec_id'] > 0) {
|
||||
Db::name('service_spec')
|
||||
->where('id', (int)$row['spec_id'])
|
||||
->where('service_id', $serviceId)
|
||||
->update([
|
||||
'image' => trim((string)$params['image']),
|
||||
'updatetime' => time(),
|
||||
]);
|
||||
}
|
||||
Db::commit();
|
||||
} catch (Exception $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success();
|
||||
}
|
||||
$this->view->assign('row', $row);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'Id' => '编号',
|
||||
'Name' => '规则名称',
|
||||
'Order_mode' => '订单类型',
|
||||
'Customer_type' => '下单人',
|
||||
'Cat_id' => '服务分类',
|
||||
'Urgent_mode' => '是否加急',
|
||||
'Min_amount' => '最低订单金额(元)',
|
||||
'Max_amount' => '最高订单金额(元)',
|
||||
'Calc_mode' => '抽佣方式',
|
||||
'Commission_rate' => '抽佣比例(%)',
|
||||
'Fixed_fee' => '每单固定费(元)',
|
||||
'Min_commission' => '单笔最少抽佣(元)',
|
||||
'Max_commission' => '单笔最多抽佣(元)',
|
||||
'Weigh' => '优先级',
|
||||
'Status' => '状态',
|
||||
'Remark' => '备注',
|
||||
'Normal' => '启用',
|
||||
'Hidden' => '停用',
|
||||
'All' => '全部',
|
||||
'Fixed' => '一口价',
|
||||
'Quote' => '师傅报价',
|
||||
'Custom' => '业主自主出价',
|
||||
'Range' => '区间定价',
|
||||
'Personal' => '个人下单',
|
||||
'Merchant' => '企业商家',
|
||||
'Urgent' => '仅加急单',
|
||||
'Percent' => '按比例抽成',
|
||||
'Mixed' => '按比例加固定费',
|
||||
'Createtime' => '创建时间',
|
||||
'Updatetime' => '更新时间',
|
||||
];
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Master_id' => '师傅ID',
|
||||
'Cert_code' => '证书编码',
|
||||
'Cert_name' => '证书名称',
|
||||
'Is_custom' => '证书来源',
|
||||
'Cert_image' => '证书照片',
|
||||
'Expire_date' => '有效期至',
|
||||
'Is_long_term' => '长期有效',
|
||||
'Status' => '审核状态',
|
||||
'Audit_msg' => '审核意见',
|
||||
'Audittime' => '审核时间',
|
||||
'Createtime' => '提交时间',
|
||||
'Updatetime' => '更新时间',
|
||||
'Pending' => '待审核',
|
||||
'Pass' => '已通过',
|
||||
'Reject' => '已驳回',
|
||||
];
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Cat_id' => '所属类目',
|
||||
'Service_id' => '所属商品',
|
||||
'Spec_id' => '关联规格',
|
||||
'Title' => '款式/图片名称',
|
||||
'Image' => '系统参考图',
|
||||
'Weigh' => '排序权重',
|
||||
'Status' => '显示状态',
|
||||
'Createtime' => '创建时间',
|
||||
'Updatetime' => '更新时间',
|
||||
];
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 平台协议与隐私政策模型
|
||||
*/
|
||||
class Agreement extends Model
|
||||
{
|
||||
protected $name = 'agreement';
|
||||
|
||||
protected $autoWriteTimestamp = 'int';
|
||||
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return [
|
||||
'normal' => '正常展示',
|
||||
'hidden' => '暂不展示',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class CommissionRule extends Model
|
||||
{
|
||||
protected $name = 'commission_rule';
|
||||
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
public function getOrderModeList(): array
|
||||
{
|
||||
return [
|
||||
'all' => '不限订单类型',
|
||||
'fixed' => '一口价',
|
||||
'quote' => '师傅报价',
|
||||
'custom' => '业主自主出价',
|
||||
'range' => '区间定价',
|
||||
];
|
||||
}
|
||||
|
||||
public function getCustomerTypeList(): array
|
||||
{
|
||||
return [
|
||||
'all' => '不限下单人',
|
||||
'personal' => '个人下单',
|
||||
'merchant' => '企业商家',
|
||||
];
|
||||
}
|
||||
|
||||
public function getUrgentModeList(): array
|
||||
{
|
||||
return [
|
||||
'all' => '不限是否加急',
|
||||
'normal' => '仅普通单',
|
||||
'urgent' => '仅加急单',
|
||||
];
|
||||
}
|
||||
|
||||
public function getCalcModeList(): array
|
||||
{
|
||||
return [
|
||||
'percent' => '按比例抽成 (%)',
|
||||
'fixed' => '每单固定收费 (元)',
|
||||
'mixed' => '按比例 + 每单固定费',
|
||||
];
|
||||
}
|
||||
|
||||
public function getStatusList(): array
|
||||
{
|
||||
return [
|
||||
'normal' => '启用',
|
||||
'hidden' => '停用',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class MasterCert extends Model
|
||||
{
|
||||
protected $name = 'master_cert';
|
||||
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
protected $append = [
|
||||
'status_text',
|
||||
];
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return [
|
||||
'pending' => '待审核',
|
||||
'pass' => '已通过',
|
||||
'reject' => '已驳回',
|
||||
];
|
||||
}
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ?: ($data['status'] ?? '');
|
||||
$list = $this->getStatusList();
|
||||
return $list[$value] ?? '';
|
||||
}
|
||||
|
||||
public function master()
|
||||
{
|
||||
return $this->belongsTo('Master', 'master_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,8 @@ class Withdraw extends Model
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'channel_text',
|
||||
'status_text'
|
||||
'status_text',
|
||||
'transfer_state_text'
|
||||
];
|
||||
|
||||
|
||||
@@ -57,6 +58,15 @@ class Withdraw extends Model
|
||||
return $list[$value] ?? '';
|
||||
}
|
||||
|
||||
public function getTransferStateTextAttr($value, $data)
|
||||
{
|
||||
$state = $data['transfer_state'] ?? '';
|
||||
if ($state === '' && ($data['channel'] ?? '') === 'bank') {
|
||||
return '线下转账';
|
||||
}
|
||||
return \app\common\library\PaymentService::transferStateLabel($state);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\service;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Gallery extends Model
|
||||
{
|
||||
protected $name = 'system_gallery';
|
||||
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
protected $deleteTime = false;
|
||||
|
||||
protected $append = [
|
||||
'status_text'
|
||||
];
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
|
||||
}
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ?: ($data['status'] ?? '');
|
||||
$list = $this->getStatusList();
|
||||
return $list[$value] ?? '';
|
||||
}
|
||||
|
||||
public function cat()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\service\Cat', 'cat_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
public function service()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\Service', 'service_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,516 @@
|
||||
<style>
|
||||
.ag-tabs {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
}
|
||||
.ag-tabs > li > a {
|
||||
font-weight: 600;
|
||||
color: #4b5563;
|
||||
}
|
||||
.ag-tabs > li.active > a {
|
||||
color: #f0710d !important;
|
||||
}
|
||||
.ag-tab-badge {
|
||||
display: inline-block;
|
||||
margin-left: 6px;
|
||||
padding: 1px 6px;
|
||||
border-radius: 10px;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
background: #fff7ed;
|
||||
color: #ea580c;
|
||||
border: 1px solid #fed7aa;
|
||||
}
|
||||
.ag-tab-badge.is-hidden {
|
||||
background: #f3f4f6;
|
||||
color: #6b7280;
|
||||
border-color: #d1d5db;
|
||||
}
|
||||
|
||||
.ag-meta-banner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
padding: 10px 14px;
|
||||
margin-bottom: 16px;
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-left: 3px solid #f0710d;
|
||||
border-radius: 6px;
|
||||
font-size: 13px;
|
||||
color: #475569;
|
||||
}
|
||||
.ag-meta-time {
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
}
|
||||
.ag-dirty-pill {
|
||||
display: none;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
font-size: 11px;
|
||||
background: #fef3c7;
|
||||
color: #b45309;
|
||||
font-weight: 600;
|
||||
margin-left: 8px;
|
||||
}
|
||||
.ag-dirty-pill.is-visible {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.ag-editor-wrap {
|
||||
border: 1px solid #d2d6de;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
background: #ffffff;
|
||||
transition: border-color 0.15s ease;
|
||||
}
|
||||
.ag-editor-wrap:focus-within {
|
||||
border-color: #f0710d;
|
||||
}
|
||||
.ag-toolbar {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 6px;
|
||||
padding: 8px 10px;
|
||||
background: #f8fafc;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
}
|
||||
.ag-tool-groups {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
.ag-tool-sep {
|
||||
width: 1px;
|
||||
height: 18px;
|
||||
background: #cbd5e1;
|
||||
margin: 0 4px;
|
||||
}
|
||||
.ag-tool-btn {
|
||||
height: 28px;
|
||||
padding: 0 9px;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 4px;
|
||||
background: #ffffff;
|
||||
color: #334155;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
line-height: 26px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
.ag-tool-btn:hover {
|
||||
background: #fff7ed;
|
||||
border-color: #fdba74;
|
||||
color: #ea580c;
|
||||
}
|
||||
.ag-tool-btn.is-active {
|
||||
background: #f0710d;
|
||||
border-color: #f0710d;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.ag-editor-surface {
|
||||
min-height: 430px;
|
||||
max-height: 600px;
|
||||
overflow-y: auto;
|
||||
padding: 16px 18px;
|
||||
font-size: 14px;
|
||||
line-height: 1.75;
|
||||
color: #334155;
|
||||
outline: none;
|
||||
background: #ffffff;
|
||||
}
|
||||
.ag-editor-surface h2 {
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
color: #1f1f1f;
|
||||
margin: 18px 0 10px;
|
||||
}
|
||||
.ag-editor-surface h3 {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: #1f1f1f;
|
||||
margin: 14px 0 8px;
|
||||
}
|
||||
.ag-editor-surface p {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
.ag-editor-surface ul,
|
||||
.ag-editor-surface ol {
|
||||
padding-left: 22px;
|
||||
margin: 8px 0 12px;
|
||||
}
|
||||
.ag-editor-surface blockquote {
|
||||
margin: 10px 0;
|
||||
padding: 10px 14px;
|
||||
background: #fff7f0;
|
||||
border-left: 3px solid #f0710d;
|
||||
color: #444444;
|
||||
font-size: 13.5px;
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
.ag-source-textarea {
|
||||
min-height: 430px;
|
||||
max-height: 600px;
|
||||
border: none !important;
|
||||
border-radius: 0 !important;
|
||||
font-family: Consolas, Monaco, "Courier New", monospace;
|
||||
font-size: 13px;
|
||||
line-height: 1.6;
|
||||
resize: vertical;
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
.ag-submit-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-top: 18px;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid #eef0f3;
|
||||
}
|
||||
.ag-btn-primary {
|
||||
background: #f0710d;
|
||||
border-color: #f0710d;
|
||||
color: #ffffff;
|
||||
}
|
||||
.ag-btn-primary:hover,
|
||||
.ag-btn-primary:focus {
|
||||
background: #d96207;
|
||||
border-color: #d96207;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* 右侧小程序实时预览模拟框 */
|
||||
.ag-preview-card {
|
||||
background: #f5f6f8;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 12px;
|
||||
padding: 14px;
|
||||
}
|
||||
.ag-preview-caption {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 12.5px;
|
||||
font-weight: 600;
|
||||
color: #475569;
|
||||
}
|
||||
.ag-preview-mode-group {
|
||||
display: inline-flex;
|
||||
border: 1px solid #cbd5e1;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
background: #ffffff;
|
||||
}
|
||||
.ag-preview-mode-btn {
|
||||
border: none;
|
||||
background: transparent;
|
||||
padding: 3px 10px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: #64748b;
|
||||
cursor: pointer;
|
||||
}
|
||||
.ag-preview-mode-btn.is-active {
|
||||
background: #fff7ed;
|
||||
color: #f0710d;
|
||||
font-weight: 600;
|
||||
}
|
||||
.ag-phone-diff-tip {
|
||||
display: none;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 8px 10px;
|
||||
margin-bottom: 10px;
|
||||
background: #fff7f0;
|
||||
border: 1px solid #fed7aa;
|
||||
border-radius: 8px;
|
||||
font-size: 12px;
|
||||
color: #9a3412;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.ag-phone-diff-tip.is-visible {
|
||||
display: flex;
|
||||
}
|
||||
.ag-phone-diff-swatch {
|
||||
display: inline-block;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 3px;
|
||||
background: #ffe2b0;
|
||||
border: 1px solid #fdba74;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.ag-phone-frame {
|
||||
background: #f5f6f8;
|
||||
border: 1px solid #cbd5e1;
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
|
||||
}
|
||||
.ag-phone-topbar {
|
||||
height: 44px;
|
||||
background: #ffffff;
|
||||
border-bottom: 1px solid #f0f0f2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
padding: 0 44px;
|
||||
}
|
||||
.ag-phone-back {
|
||||
position: absolute;
|
||||
left: 14px;
|
||||
color: #1f1f1f;
|
||||
font-size: 15px;
|
||||
}
|
||||
.ag-phone-nav-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1f1f1f;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.ag-phone-body {
|
||||
height: 540px;
|
||||
overflow-y: auto;
|
||||
padding: 12px;
|
||||
}
|
||||
.ag-phone-doc-head {
|
||||
background: #ffffff;
|
||||
border-radius: 10px;
|
||||
padding: 14px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.ag-phone-doc-title {
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
color: #1f1f1f;
|
||||
line-height: 1.4;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.ag-phone-doc-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 12px;
|
||||
color: #888888;
|
||||
}
|
||||
.ag-phone-ver-pill {
|
||||
background: #fff7f0;
|
||||
color: #f0710d;
|
||||
border: 1px solid rgba(240, 113, 13, 0.24);
|
||||
padding: 1px 8px;
|
||||
border-radius: 999px;
|
||||
font-weight: 600;
|
||||
font-size: 11px;
|
||||
}
|
||||
.ag-phone-doc-content {
|
||||
background: #ffffff;
|
||||
border-radius: 10px;
|
||||
padding: 14px;
|
||||
font-size: 13.5px;
|
||||
line-height: 1.75;
|
||||
color: #444444;
|
||||
word-break: break-word;
|
||||
}
|
||||
.ag-phone-doc-content h2 {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #1f1f1f;
|
||||
margin: 14px 0 8px;
|
||||
}
|
||||
.ag-phone-doc-content h3 {
|
||||
font-size: 14.5px;
|
||||
font-weight: 700;
|
||||
color: #1f1f1f;
|
||||
margin: 12px 0 6px;
|
||||
}
|
||||
.ag-phone-doc-content h2:first-child,
|
||||
.ag-phone-doc-content h3:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.ag-phone-doc-content p {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
.ag-phone-doc-content ul,
|
||||
.ag-phone-doc-content ol {
|
||||
padding-left: 18px;
|
||||
margin: 6px 0 10px;
|
||||
}
|
||||
.ag-phone-doc-content blockquote {
|
||||
margin: 10px 0;
|
||||
padding: 8px 12px;
|
||||
background: #fff7f0;
|
||||
border-left: 3px solid #f0710d;
|
||||
color: #444444;
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="panel panel-default panel-intro">
|
||||
<div class="panel-heading">
|
||||
{:build_heading(null, FALSE)}
|
||||
<ul class="nav nav-tabs ag-tabs" id="ag-tabs">
|
||||
{foreach $agreements as $idx => $ag}
|
||||
<li class="{$idx === 0 ? 'active' : ''}" data-code="{$ag.code|htmlentities}">
|
||||
<a href="javascript:;" class="js-ag-tab" data-code="{$ag.code|htmlentities}">
|
||||
<i class="fa fa-file-text-o"></i> {$ag.tab_name|htmlentities}
|
||||
{if $ag.status === 'hidden'}
|
||||
<span class="ag-tab-badge is-hidden">已停用</span>
|
||||
{/if}
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<!-- 左侧编辑表单 -->
|
||||
<div class="col-xs-12 col-md-7">
|
||||
<div class="ag-meta-banner">
|
||||
<div>
|
||||
<i class="fa fa-info-circle text-warning"></i>
|
||||
<span id="ag-scene-desc"></span>
|
||||
<span id="ag-dirty-pill" class="ag-dirty-pill">有未保存修改</span>
|
||||
</div>
|
||||
<div class="ag-meta-time">
|
||||
编码:<code id="ag-code-label"></code> · 修订 #<span id="ag-revision-num">1</span> · 最近更新:<span id="ag-update-time"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form id="agreement-form" class="form-horizontal" role="form" method="POST" action="{:url('agreement/save')}">
|
||||
{:token()}
|
||||
<input type="hidden" id="ag-input-code" name="code" value="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">协议标题:</label>
|
||||
<div class="col-xs-12 col-sm-10">
|
||||
<input type="text" id="ag-input-title" name="row[title]" maxlength="100" class="form-control" placeholder="请输入协议展示标题,如:优匠优服用户服务协议" {if !$canSave}readonly{/if}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">版本与日期:</label>
|
||||
<div class="col-xs-6 col-sm-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">版本</span>
|
||||
<input type="text" id="ag-input-version" name="row[version]" maxlength="32" class="form-control" placeholder="如 v1.0" {if !$canSave}readonly{/if}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">生效日期</span>
|
||||
<input type="date" id="ag-input-effective" name="row[effective_date]" class="form-control" {if !$canSave}readonly{/if}>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="ag-status-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">展示状态:</label>
|
||||
<div class="col-xs-12 col-sm-10">
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="row[status]" value="normal" {if !$canSave}disabled{/if}> 正常展示</label>
|
||||
<label style="margin-left:16px;"><input type="radio" name="row[status]" value="hidden" id="ag-status-hidden" {if !$canSave}disabled{/if}> 暂不展示</label>
|
||||
</div>
|
||||
<span class="help-block" id="ag-core-tip" style="margin:4px 0 0;font-size:12px;color:#64748b;"></span>
|
||||
</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">
|
||||
<div class="ag-editor-wrap">
|
||||
<div class="ag-toolbar">
|
||||
<div class="ag-tool-groups" id="ag-toolbar-btns">
|
||||
<button type="button" class="ag-tool-btn js-cmd" data-cmd="formatBlock" data-val="H2" title="一级章节标题">章节 H2</button>
|
||||
<button type="button" class="ag-tool-btn js-cmd" data-cmd="formatBlock" data-val="H3" title="二级小节标题">小节 H3</button>
|
||||
<button type="button" class="ag-tool-btn js-cmd" data-cmd="formatBlock" data-val="P" title="正文段落">正文</button>
|
||||
<span class="ag-tool-sep"></span>
|
||||
<button type="button" class="ag-tool-btn js-cmd" data-cmd="bold" title="加粗"><i class="fa fa-bold"></i></button>
|
||||
<button type="button" class="ag-tool-btn js-cmd" data-cmd="italic" title="斜体"><i class="fa fa-italic"></i></button>
|
||||
<button type="button" class="ag-tool-btn js-cmd" data-cmd="underline" title="下划线"><i class="fa fa-underline"></i></button>
|
||||
<span class="ag-tool-sep"></span>
|
||||
<button type="button" class="ag-tool-btn js-cmd" data-cmd="insertUnorderedList" title="无序列表"><i class="fa fa-list-ul"></i></button>
|
||||
<button type="button" class="ag-tool-btn js-cmd" data-cmd="insertOrderedList" title="有序列表"><i class="fa fa-list-ol"></i></button>
|
||||
<button type="button" class="ag-tool-btn js-cmd" data-cmd="formatBlock" data-val="BLOCKQUOTE" title="重点提示框"><i class="fa fa-quote-left"></i> 提示框</button>
|
||||
<button type="button" class="ag-tool-btn js-cmd" data-cmd="insertHorizontalRule" title="分割线">—</button>
|
||||
<span class="ag-tool-sep"></span>
|
||||
<button type="button" class="ag-tool-btn js-cmd" data-cmd="removeFormat" title="清除格式"><i class="fa fa-eraser"></i></button>
|
||||
</div>
|
||||
<button type="button" class="ag-tool-btn" id="ag-toggle-source"><i class="fa fa-code"></i> HTML 源码</button>
|
||||
</div>
|
||||
|
||||
<div id="ag-visual-editor" class="ag-editor-surface" contenteditable="{if $canSave}true{else}false{/if}"></div>
|
||||
<textarea id="ag-source-editor" name="row[content]" class="form-control ag-source-textarea hidden" {if !$canSave}readonly{/if}></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if $canSave}
|
||||
<div class="ag-submit-bar">
|
||||
<div class="col-sm-offset-2 col-sm-10" style="padding-left:0;">
|
||||
<button type="submit" id="ag-submit-btn" class="btn ag-btn-primary">
|
||||
<i class="fa fa-save"></i> 保存并发布生效
|
||||
</button>
|
||||
<button type="button" id="ag-reset-btn" class="btn btn-default" style="margin-left:8px;">
|
||||
<i class="fa fa-undo"></i> 撤销当前修改
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- 右侧小程序独立页实时预览 -->
|
||||
<div class="col-xs-12 col-md-5">
|
||||
<div class="ag-preview-card">
|
||||
<div class="ag-preview-caption">
|
||||
<span><i class="fa fa-mobile fa-lg"></i> 小程序独立页面实时预览</span>
|
||||
<div class="ag-preview-mode-group hidden" id="ag-preview-mode-group">
|
||||
<button type="button" class="ag-preview-mode-btn is-active js-preview-mode" data-mode="normal">标准正文</button>
|
||||
<button type="button" class="ag-preview-mode-btn js-preview-mode" data-mode="diff">首看变更高亮</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ag-phone-frame">
|
||||
<div class="ag-phone-topbar">
|
||||
<span class="ag-phone-back"><i class="fa fa-angle-left"></i></span>
|
||||
<span class="ag-phone-nav-title" id="ag-preview-nav-title">协议详情</span>
|
||||
</div>
|
||||
<div class="ag-phone-body">
|
||||
<div class="ag-phone-doc-head">
|
||||
<div class="ag-phone-doc-title" id="ag-preview-title"></div>
|
||||
<div class="ag-phone-doc-meta">
|
||||
<span class="ag-phone-ver-pill" id="ag-preview-version"></span>
|
||||
<span id="ag-preview-effective"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ag-phone-diff-tip" id="ag-preview-diff-tip">
|
||||
<span class="ag-phone-diff-swatch"></span>
|
||||
<span id="ag-preview-diff-tip-text">条款已更新,浅橙色背景为本次调整内容(仅用户首次查看时标注)</span>
|
||||
</div>
|
||||
<div class="ag-phone-doc-content" id="ag-preview-content"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script id="agreements-initial-data" type="application/json">{$agreementsJson}</script>
|
||||
@@ -0,0 +1,503 @@
|
||||
<style>
|
||||
.fc-section-block {
|
||||
margin-top: 22px;
|
||||
padding-top: 18px;
|
||||
border-top: 1px solid #eef0f3;
|
||||
}
|
||||
.fc-section-block:first-child {
|
||||
margin-top: 4px;
|
||||
padding-top: 0;
|
||||
border-top: none;
|
||||
}
|
||||
.fc-section-head {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1f2937;
|
||||
margin: 0 0 14px 0;
|
||||
padding-left: 10px;
|
||||
border-left: 3px solid #18bc9c;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.fc-section-head small {
|
||||
font-weight: 400;
|
||||
color: #6b7280;
|
||||
margin-left: 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.fc-guide-bar {
|
||||
background: #f6f9fc;
|
||||
border: 1px solid #e3ebf3;
|
||||
border-radius: 4px;
|
||||
padding: 9px 12px;
|
||||
margin-bottom: 12px;
|
||||
font-size: 12.5px;
|
||||
color: #475569;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.fc-guide-bar strong {
|
||||
color: #1e293b;
|
||||
}
|
||||
.fc-field-note {
|
||||
display: block;
|
||||
margin-top: 5px;
|
||||
font-size: 12px;
|
||||
color: #888888;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.fc-inline-range {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.fc-inline-range .input-group {
|
||||
flex: 1;
|
||||
}
|
||||
.fc-calc-bar {
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 4px;
|
||||
padding: 8px 12px;
|
||||
font-size: 13px;
|
||||
color: #334155;
|
||||
}
|
||||
.fc-submit-bar {
|
||||
margin-top: 20px;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid #eef0f3;
|
||||
}
|
||||
.fc-rule-table-wrap .bootstrap-table .table {
|
||||
width: 100% !important;
|
||||
min-width: 100% !important;
|
||||
}
|
||||
.fc-rule-table-wrap .bootstrap-table .table > thead > tr > th,
|
||||
.fc-rule-table-wrap .bootstrap-table .table > tbody > tr > td {
|
||||
padding: 9px 8px !important;
|
||||
}
|
||||
.fc-rule-table-wrap .bootstrap-table .table > thead > tr > th[data-field="id"],
|
||||
.fc-rule-table-wrap .bootstrap-table .table > tbody > tr > td[data-field="id"] {
|
||||
min-width: 68px !important;
|
||||
}
|
||||
.fc-rule-table-wrap .bootstrap-table .table > thead > tr > th[data-field="weigh"],
|
||||
.fc-rule-table-wrap .bootstrap-table .table > tbody > tr > td[data-field="weigh"] {
|
||||
min-width: 84px !important;
|
||||
}
|
||||
.fc-rule-table-wrap .bootstrap-table .table > thead > tr > th[data-field="id"] .th-inner,
|
||||
.fc-rule-table-wrap .bootstrap-table .table > thead > tr > th[data-field="weigh"] .th-inner {
|
||||
text-overflow: clip !important;
|
||||
overflow: visible !important;
|
||||
}
|
||||
.fc-rule-table-wrap .bootstrap-table .table > tbody > tr > td {
|
||||
white-space: normal !important;
|
||||
word-break: break-word;
|
||||
}
|
||||
.fc-rule-table-wrap .bootstrap-table .table > tbody > tr > td:nth-child(1),
|
||||
.fc-rule-table-wrap .bootstrap-table .table > tbody > tr > td:nth-child(2),
|
||||
.fc-rule-table-wrap .bootstrap-table .table > tbody > tr > td:nth-child(7),
|
||||
.fc-rule-table-wrap .bootstrap-table .table > tbody > tr > td:nth-child(8),
|
||||
.fc-rule-table-wrap .bootstrap-table .table > tbody > tr > td:last-child {
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
.fc-rule-table-wrap .bootstrap-table .table > thead > tr > th:last-child,
|
||||
.fc-rule-table-wrap .bootstrap-table .table > tbody > tr > td:last-child {
|
||||
position: static !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
.fc-rule-table-wrap .bootstrap-table .table > tbody > tr > td:last-child .btn {
|
||||
padding: 4px 8px !important;
|
||||
font-size: 12px !important;
|
||||
line-height: 1.4 !important;
|
||||
}
|
||||
.fc-rule-table-wrap .fixed-table-body {
|
||||
min-height: 120px !important;
|
||||
padding-bottom: 12px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="panel panel-default panel-intro">
|
||||
<div class="panel-heading">
|
||||
{:build_heading(null, FALSE)}
|
||||
<ul class="nav nav-tabs" id="fc-main-tabs">
|
||||
<li class="active">
|
||||
<a href="#tab-commission" data-toggle="tab"><i class="fa fa-percent"></i> 订单抽佣</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#tab-withdraw" data-toggle="tab"><i class="fa fa-credit-card"></i> 提现规则</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="tab-content">
|
||||
<!-- 页签 1:订单抽佣规则与默认设置 -->
|
||||
<div class="tab-pane fade active in" id="tab-commission">
|
||||
<div class="fc-section-block">
|
||||
<div class="fc-section-head">按订单条件抽佣<small>按实际下单条件自动匹配不同抽佣方案</small></div>
|
||||
<div class="fc-guide-bar">
|
||||
<strong>匹配说明:</strong>新订单按 <strong>优先级从高到低</strong> 匹配(优先级相同时,限制条件越具体越先命中),命中第一条即生效;若都不符合,则按下方「兜底默认抽佣」执行。已下单工单永久保留下单时的方案。
|
||||
</div>
|
||||
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}"><i class="fa fa-refresh"></i></a>
|
||||
{if $auth->check('finance_config/rule_add')}
|
||||
<a href="javascript:;" class="btn btn-success btn-add" title="新增规则"><i class="fa fa-plus"></i> 新增规则</a>
|
||||
{/if}
|
||||
{if $auth->check('finance_config/rule_multi')}
|
||||
<a class="btn btn-info btn-disabled disabled btn-multi" href="javascript:;" data-params="status=normal"><i class="fa fa-check"></i> 启用</a>
|
||||
<a class="btn btn-warning btn-disabled disabled btn-multi" href="javascript:;" data-params="status=hidden"><i class="fa fa-ban"></i> 停用</a>
|
||||
{/if}
|
||||
{if $auth->check('finance_config/rule_del')}
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled" title="{:__('Delete')}"><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="fc-rule-table-wrap">
|
||||
<table id="table" class="table table-striped table-bordered table-hover"
|
||||
data-operate-edit="{:$auth->check('finance_config/rule_edit')}"
|
||||
data-operate-del="{:$auth->check('finance_config/rule_del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form id="commission-default-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('finance_config/save')}">
|
||||
{:token()}
|
||||
<input type="hidden" name="section" value="commission_default">
|
||||
|
||||
<div class="fc-section-block">
|
||||
<div class="fc-section-head">施工增项抽佣设置<small>对所有新创建订单通用</small></div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">增项补差价:</label>
|
||||
<div class="col-xs-12 col-sm-7">
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="row[include_diff_in_commission]" value="1" {if $cfg.include_diff_in_commission == '1'}checked{/if}> 算入抽佣(按主单 + 补差价总额抽佣)</label>
|
||||
<label style="margin-left:16px;"><input type="radio" name="row[include_diff_in_commission]" value="0" {if $cfg.include_diff_in_commission == '0'}checked{/if}> 增项免抽佣(补差价 100% 归师傅)</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fc-section-block">
|
||||
<div class="fc-section-head">兜底默认抽佣<small>仅当订单未命中上方任何启用规则时使用</small></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">默认抽佣方式:</label>
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<select id="c-default_calc_mode" class="form-control js-def-calc-mode js-def-field" name="row[default_calc_mode]">
|
||||
{foreach name="calcModeList" item="vo"}
|
||||
<option value="{$key}" {if $cfg.default_calc_mode == $key}selected{/if}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group js-def-rate-box">
|
||||
<label class="control-label col-xs-12 col-sm-2">默认抽佣比例:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="input-group">
|
||||
<input id="c-default_commission_rate" type="number" step="0.01" min="0" max="100" class="form-control js-def-field" name="row[default_commission_rate]" value="{$cfg.default_commission_rate|htmlentities}">
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group js-def-fixed-box">
|
||||
<label class="control-label col-xs-12 col-sm-2">默认每单固定费:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">¥</span>
|
||||
<input id="c-default_fixed_fee" type="number" step="0.01" min="0" class="form-control js-def-field" name="row[default_fixed_fee]" value="{$cfg.default_fixed_fee|htmlentities}">
|
||||
<span class="input-group-addon">元/单</span>
|
||||
</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-6">
|
||||
<div class="fc-inline-range">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">最少收 ¥</span>
|
||||
<input id="c-default_min_commission" type="number" step="0.01" min="0" class="form-control js-def-field" name="row[default_min_commission]" value="{$cfg.default_min_commission|htmlentities}">
|
||||
</div>
|
||||
<span>~</span>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">最多收 ¥</span>
|
||||
<input id="c-default_max_commission" type="number" step="0.01" min="0" class="form-control js-def-field" name="row[default_max_commission]" value="{$cfg.default_max_commission|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<span class="fc-field-note">填 0 表示不限制单笔最少或最多抽佣金额</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">试算参考:</label>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="fc-calc-bar js-def-preview">按 ¥200.00 订单试算中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if $auth->check('finance_config/save')}
|
||||
<div class="form-group fc-submit-bar">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> 保存抽佣默认设置</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- 页签 2:提现与微信小程序商家转账规则 -->
|
||||
<div class="tab-pane fade" id="tab-withdraw">
|
||||
<form id="withdraw-config-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('finance_config/save')}">
|
||||
{:token()}
|
||||
<input type="hidden" name="section" value="withdraw">
|
||||
|
||||
<div class="fc-section-block">
|
||||
<div class="fc-section-head">基础开关与实名要求</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">提现总开关:</label>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="row[withdraw_enabled]" value="1" {if $cfg.withdraw_enabled == '1'}checked{/if}> 正常开放</label>
|
||||
<label style="margin-left:16px;"><input type="radio" name="row[withdraw_enabled]" value="0" {if $cfg.withdraw_enabled == '0'}checked{/if}> 暂停提现</label>
|
||||
</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-6">
|
||||
<input type="text" maxlength="200" class="form-control" name="row[withdraw_close_tip]" value="{$cfg.withdraw_close_tip|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">提现渠道:</label>
|
||||
<div class="col-xs-12 col-sm-7">
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="row[withdraw_channels][]" value="wechat" {if in_array('wechat', $withdrawCfg.channels)}checked{/if}> 微信零钱(小程序标准通道)</label>
|
||||
<label style="margin-left:18px;"><input type="checkbox" name="row[withdraw_channels][]" value="bank" {if in_array('bank', $withdrawCfg.channels)}checked{/if}> 银行储蓄卡(人工财务打款)</label>
|
||||
</div>
|
||||
<span class="fc-field-note">微信小程序提审建议默认仅勾选「微信零钱」,避免收集银行卡隐私信息触发类目审核风险</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">实名要求:</label>
|
||||
<div class="col-xs-12 col-sm-7">
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="row[withdraw_require_realname]" value="1" {if $cfg.withdraw_require_realname == '1'}checked{/if}> 必须实名认证通过方可提现</label>
|
||||
<label style="margin-left:16px;"><input type="radio" name="row[withdraw_require_realname]" value="0" {if $cfg.withdraw_require_realname == '0'}checked{/if}> 小额免强制实名(满 ¥2,000 微信仍强制校验姓名)</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fc-section-block">
|
||||
<div class="fc-section-head">额度、次数与开放时间</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">单笔限额:</label>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="fc-inline-range">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">最低 ¥</span>
|
||||
<input type="number" step="0.01" min="0.10" max="20000" data-rule="required" class="form-control" name="row[withdraw_min_amount]" value="{$cfg.withdraw_min_amount|htmlentities}">
|
||||
</div>
|
||||
<span>~</span>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">最高 ¥</span>
|
||||
<input type="number" step="0.01" min="0.10" max="20000" data-rule="required" class="form-control" name="row[withdraw_max_amount]" value="{$cfg.withdraw_max_amount|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<span class="fc-field-note">微信商家转账硬性规定:实到净额最低 ¥0.10,单笔最高不超过 ¥20,000.00</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">每人每日上限:</label>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="fc-inline-range">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">日累计 ¥</span>
|
||||
<input type="number" step="0.01" min="0" class="form-control" name="row[withdraw_daily_amount]" value="{$cfg.withdraw_daily_amount|htmlentities}">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">日次数</span>
|
||||
<input type="number" step="1" min="0" class="form-control" name="row[withdraw_daily_count]" value="{$cfg.withdraw_daily_count|htmlentities}">
|
||||
<span class="input-group-addon">次</span>
|
||||
</div>
|
||||
</div>
|
||||
<span class="fc-field-note">填 0 表示不限制单日累计金额或次数</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">可提现日期:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="checkbox">
|
||||
{php}$dayLabels = [1=>'周一',2=>'周二',3=>'周三',4=>'周四',5=>'周五',6=>'周六',7=>'周日'];{/php}
|
||||
{foreach name="dayLabels" item="dName" key="dNum"}
|
||||
<label style="margin-right:14px;">
|
||||
<input type="checkbox" name="row[withdraw_allow_weekdays][]" value="{$dNum}" {if in_array($dNum, $withdrawCfg.allow_weekdays)}checked{/if}> {$dName}
|
||||
</label>
|
||||
{/foreach}
|
||||
</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-4">
|
||||
<div class="fc-inline-range">
|
||||
<input type="text" class="form-control" name="row[withdraw_time_start]" value="{$cfg.withdraw_time_start|htmlentities}" placeholder="00:00">
|
||||
<span>~</span>
|
||||
<input type="text" class="form-control" name="row[withdraw_time_end]" value="{$cfg.withdraw_time_end|htmlentities}" placeholder="23:59">
|
||||
</div>
|
||||
<span class="fc-field-note">24小时制 时:分(全天开放填 00:00 ~ 23:59)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fc-section-block">
|
||||
<div class="fc-section-head">提现手续费</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">收取方式:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<select id="c-wd-fee-mode" class="form-control js-wd-fee-mode js-wd-fee-field" name="row[withdraw_fee_mode]">
|
||||
<option value="percent" {if $cfg.withdraw_fee_mode == 'percent'}selected{/if}>按提现金额比例 (%)</option>
|
||||
<option value="fixed" {if $cfg.withdraw_fee_mode == 'fixed'}selected{/if}>每笔固定手续费 (元)</option>
|
||||
<option value="free" {if $cfg.withdraw_fee_mode == 'free'}selected{/if}>免收手续费(平台承担)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group js-wd-fee-percent">
|
||||
<label class="control-label col-xs-12 col-sm-2">费率与上下限:</label>
|
||||
<div class="col-xs-12 col-sm-7">
|
||||
<div class="fc-inline-range">
|
||||
<div class="input-group">
|
||||
<input id="c-wd-fee-rate" type="number" step="0.01" min="0" max="50" class="form-control js-wd-fee-field" name="row[withdraw_fee_rate]" value="{$cfg.withdraw_fee_rate|htmlentities}">
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">最少 ¥</span>
|
||||
<input id="c-wd-fee-min" type="number" step="0.01" min="0" class="form-control js-wd-fee-field" name="row[withdraw_fee_min]" value="{$cfg.withdraw_fee_min|htmlentities}">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">最多 ¥</span>
|
||||
<input id="c-wd-fee-max" type="number" step="0.01" min="0" class="form-control js-wd-fee-field" name="row[withdraw_fee_max]" value="{$cfg.withdraw_fee_max|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<span class="fc-field-note">最少与最多填 0 表示不限制</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group js-wd-fee-fixed">
|
||||
<label class="control-label col-xs-12 col-sm-2">每笔固定费:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">¥</span>
|
||||
<input id="c-wd-fee-fixed" type="number" step="0.01" min="0" class="form-control js-wd-fee-field" name="row[withdraw_fee_fixed]" value="{$cfg.withdraw_fee_fixed|htmlentities}">
|
||||
<span class="input-group-addon">元/笔</span>
|
||||
</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-6">
|
||||
<div class="fc-calc-bar js-wd-fee-preview">按提现 ¥100.00 试算中...</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fc-section-block">
|
||||
<div class="fc-section-head">打款审核与微信商家转账(场景 1005)</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">微信打款方式:</label>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<select class="form-control" name="row[withdraw_transfer_mode]">
|
||||
<option value="wx_mch_transfer" {if $cfg.withdraw_transfer_mode == 'wx_mch_transfer'}selected{/if}>微信自动打款(新版商家转账,师傅在小程序内确认收款)</option>
|
||||
<option value="offline_manual" {if $cfg.withdraw_transfer_mode == 'offline_manual'}selected{/if}>线下人工打款(财务转账后在后台点完成)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">提现审核方式:</label>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<select class="form-control js-wd-audit-mode" name="row[withdraw_audit_mode]">
|
||||
<option value="manual" {if $cfg.withdraw_audit_mode == 'manual'}selected{/if}>全部需要财务人工审核后再打款</option>
|
||||
<option value="auto_small" {if $cfg.withdraw_audit_mode == 'auto_small'}selected{/if}>小额免审自动打款(超过上限的再转人工审核)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group js-wd-auto-max">
|
||||
<label class="control-label col-xs-12 col-sm-2">免审单笔上限:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">≤ ¥</span>
|
||||
<input type="number" step="0.01" min="0" max="20000" class="form-control" name="row[withdraw_auto_max_amount]" value="{$cfg.withdraw_auto_max_amount|htmlentities}">
|
||||
<span class="input-group-addon">元自动发起</span>
|
||||
</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-6">
|
||||
<div class="fc-inline-range">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">场景编号</span>
|
||||
<input type="text" maxlength="16" data-rule="required" class="form-control" name="row[wx_transfer_scene_id]" value="{$cfg.wx_transfer_scene_id|htmlentities}">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">收款感知</span>
|
||||
<input type="text" maxlength="32" data-rule="required" class="form-control" name="row[wx_recv_perception]" value="{$cfg.wx_recv_perception|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<span class="fc-field-note">须与微信商户后台开通的转账场景一致(默认场景 1005 对应“劳务报酬”)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">报备岗位类型:</label>
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<input type="text" maxlength="32" data-rule="required" class="form-control" name="row[wx_job_type]" value="{$cfg.wx_job_type|htmlentities}" placeholder="限32字,如:上门安装维修师傅">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">报备报酬说明:</label>
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<input type="text" maxlength="32" data-rule="required" class="form-control" name="row[wx_reward_desc]" value="{$cfg.wx_reward_desc|htmlentities}" placeholder="限32字,如:平台工单安装维修劳务报酬">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">微信账单备注:</label>
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<input type="text" maxlength="32" data-rule="required" class="form-control" name="row[wx_transfer_remark]" value="{$cfg.wx_transfer_remark|htmlentities}" placeholder="限32字,师傅微信收款账单中显示">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if $auth->check('finance_config/save')}
|
||||
<div class="form-group fc-submit-bar">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> 保存提现规则</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
{include file="finance_config/rule_form" /}
|
||||
</form>
|
||||
@@ -0,0 +1,3 @@
|
||||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
{include file="finance_config/rule_form" /}
|
||||
</form>
|
||||
@@ -0,0 +1,210 @@
|
||||
<style>
|
||||
.fc-rule-group-title {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #1f2937;
|
||||
margin: 14px 0 10px 0;
|
||||
padding: 6px 10px;
|
||||
background: #f5f7fa;
|
||||
border-left: 3px solid #18bc9c;
|
||||
}
|
||||
.fc-rule-group-title small {
|
||||
font-weight: 400;
|
||||
color: #6b7280;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.fc-preview-box {
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 4px;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
.fc-preview-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
.fc-preview-input {
|
||||
width: 130px;
|
||||
display: inline-table;
|
||||
}
|
||||
.fc-preview-result {
|
||||
font-size: 13px;
|
||||
color: #1f2937;
|
||||
}
|
||||
</style>
|
||||
|
||||
{:token()}
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">规则名称:</label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<input id="c-name" data-rule="required" maxlength="80" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}" placeholder="如:商家大单 6% 封顶50 / 卫浴加急单固定15元">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fc-rule-group-title">一、哪些订单适用本规则<small>不需要限制的项保持“不限”即可</small></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">订单类型:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<select id="c-order_mode" class="form-control js-rule-field" name="row[order_mode]">
|
||||
{foreach name="orderModeList" item="vo"}
|
||||
<option value="{$key}" {if $row.order_mode == $key}selected{/if}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<label class="control-label col-xs-12 col-sm-2">下单人:</label>
|
||||
<div class="col-xs-12 col-sm-3">
|
||||
<select id="c-customer_type" class="form-control js-rule-field" name="row[customer_type]">
|
||||
{foreach name="customerTypeList" item="vo"}
|
||||
<option value="{$key}" {if $row.customer_type == $key}selected{/if}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">服务分类:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<select id="c-cat_id" class="form-control js-rule-field" name="row[cat_id]">
|
||||
{foreach name="catMap" item="vo"}
|
||||
<option value="{$key}" {if (int)$row.cat_id === (int)$key}selected{/if}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<label class="control-label col-xs-12 col-sm-2">是否加急:</label>
|
||||
<div class="col-xs-12 col-sm-3">
|
||||
<select id="c-urgent_mode" class="form-control js-rule-field" name="row[urgent_mode]">
|
||||
{foreach name="urgentModeList" item="vo"}
|
||||
<option value="{$key}" {if $row.urgent_mode == $key}selected{/if}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">订单金额:</label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">满 ¥</span>
|
||||
<input id="c-min_amount" type="number" step="0.01" min="0" class="form-control js-rule-field" name="row[min_amount]" value="{$row.min_amount|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">至 ¥</span>
|
||||
<input id="c-max_amount" type="number" step="0.01" min="0" class="form-control js-rule-field" name="row[max_amount]" value="{$row.max_amount|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="help-block" style="margin-bottom:0;font-size:12px;">两边填 0 表示不限金额;只填左边“满 ¥500”表示 500 元及以上适用。师傅报价单会在选定报价后按最终成交价自动匹配。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fc-rule-group-title">二、平台怎么抽佣<small>下单即锁定规则,后续修改不影响历史订单</small></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">抽佣方式:</label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<select id="c-calc_mode" class="form-control js-rule-calc-mode js-rule-field" name="row[calc_mode]">
|
||||
{foreach name="calcModeList" item="vo"}
|
||||
<option value="{$key}" {if $row.calc_mode == $key}selected{/if}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group js-rule-rate-box">
|
||||
<label class="control-label col-xs-12 col-sm-2">抽佣比例:</label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<div class="input-group">
|
||||
<input id="c-commission_rate" type="number" step="0.01" min="0" max="100" class="form-control js-rule-field" name="row[commission_rate]" value="{$row.commission_rate|htmlentities}">
|
||||
<span class="input-group-addon">%(如填 10 表示每 100 元订单平台抽 10 元)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group js-rule-fixed-box" style="display:none;">
|
||||
<label class="control-label col-xs-12 col-sm-2">每单固定费:</label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">¥</span>
|
||||
<input id="c-fixed_fee" type="number" step="0.01" min="0" class="form-control js-rule-field" name="row[fixed_fee]" value="{$row.fixed_fee|htmlentities}">
|
||||
<span class="input-group-addon">元 / 单(无论金额大小每单固定加收)</span>
|
||||
</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-9">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">最少收 ¥</span>
|
||||
<input id="c-min_commission" type="number" step="0.01" min="0" class="form-control js-rule-field" name="row[min_commission]" value="{$row.min_commission|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">最多收 ¥</span>
|
||||
<input id="c-max_commission" type="number" step="0.01" min="0" class="form-control js-rule-field" name="row[max_commission]" value="{$row.max_commission|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="help-block" style="margin-bottom:0;font-size:12px;">填 0 表示不限制;最多抽佣不会超过订单实付总额。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">试算看看:</label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<div class="fc-preview-box">
|
||||
<div class="fc-preview-row">
|
||||
<span>假设订单金额</span>
|
||||
<div class="input-group input-group-sm fc-preview-input">
|
||||
<span class="input-group-addon">¥</span>
|
||||
<input type="number" step="1" min="0" class="form-control js-rule-test-amount" value="200">
|
||||
</div>
|
||||
<span class="fc-preview-result js-rule-preview-text">-</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fc-rule-group-title">三、优先级与启用状态</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">优先级:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
|
||||
<span class="help-block" style="margin-bottom:0;font-size:12px;">数字越大越先匹配(常规填 100,基础默认填 10~30)</span>
|
||||
</div>
|
||||
<label class="control-label col-xs-12 col-sm-2">状态:</label>
|
||||
<div class="col-xs-12 col-sm-3">
|
||||
<div class="radio">
|
||||
{foreach name="statusList" item="vo"}
|
||||
<label style="margin-right:14px;"><input name="row[status]" type="radio" value="{$key}" {if $row.status == $key}checked{/if}> {$vo}</label>
|
||||
{/foreach}
|
||||
</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-9">
|
||||
<input type="text" maxlength="255" class="form-control" name="row[remark]" value="{$row.remark|htmlentities}" placeholder="选填,方便财务对账时识别该规则用途">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -117,16 +117,16 @@
|
||||
<div style="font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 8px;">身份证正反面照片:</div>
|
||||
<div class="idcard-preview-box">
|
||||
<div class="idcard-img-wrap">
|
||||
<a href="{$row.idcard_front|default='/assets/img/avatar.png'|htmlentities}" target="_blank">
|
||||
<img src="{$row.idcard_front|default='/assets/img/avatar.png'|htmlentities}" onerror="this.src='/assets/img/avatar.png'" />
|
||||
<a href="{$row.idcard_front_watermark|default=$row.idcard_front|default='/assets/img/avatar.png'|htmlentities}" target="_blank" title="点击查看安全防伪原图">
|
||||
<img src="{$row.idcard_front_watermark|default=$row.idcard_front|default='/assets/img/avatar.png'|htmlentities}" onerror="this.src='/assets/img/avatar.png'" />
|
||||
</a>
|
||||
<div class="tag">身份证人像面</div>
|
||||
<div class="tag">身份证人像面 (防伪水印)</div>
|
||||
</div>
|
||||
<div class="idcard-img-wrap">
|
||||
<a href="{$row.idcard_back|default='/assets/img/avatar.png'|htmlentities}" target="_blank">
|
||||
<img src="{$row.idcard_back|default='/assets/img/avatar.png'|htmlentities}" onerror="this.src='/assets/img/avatar.png'" />
|
||||
<a href="{$row.idcard_back_watermark|default=$row.idcard_back|default='/assets/img/avatar.png'|htmlentities}" target="_blank" title="点击查看安全防伪原图">
|
||||
<img src="{$row.idcard_back_watermark|default=$row.idcard_back|default='/assets/img/avatar.png'|htmlentities}" onerror="this.src='/assets/img/avatar.png'" />
|
||||
</a>
|
||||
<div class="tag">身份证国徽面</div>
|
||||
<div class="tag">身份证国徽面 (防伪水印)</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -155,6 +155,39 @@
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="md-card">
|
||||
<div class="md-card-header">
|
||||
<h4 class="md-card-title"><i class="fa fa-id-badge"></i> 技能资质证书 ({:count($certs)})</h4>
|
||||
</div>
|
||||
<div class="md-card-body">
|
||||
{if !empty($certs)}
|
||||
<table class="table table-bordered table-condensed" style="font-size: 12px; margin-bottom: 0;">
|
||||
<thead><tr class="active"><th>证书名称</th><th>证件照片</th><th>有效期至</th><th>状态</th></tr></thead>
|
||||
<tbody>
|
||||
{foreach name="certs" item="ct"}
|
||||
<tr>
|
||||
<td><strong>{$ct.cert_name|htmlentities}</strong>{if $ct.is_custom == 1} <span class="label label-info">自定义</span>{/if}</td>
|
||||
<td>
|
||||
{if !empty($ct.cert_image)}
|
||||
<a href="{$ct.cert_image|cdnurl|htmlentities}" target="_blank"><img src="{$ct.cert_image|cdnurl|htmlentities}" style="width:44px;height:30px;object-fit:cover;border-radius:4px;border:1px solid #cbd5e1;" /></a>
|
||||
{else /}<span class="text-muted">无</span>{/if}
|
||||
</td>
|
||||
<td>{if $ct.is_long_term == 1}长期有效{else/}{$ct.expire_date|default='-'|htmlentities}{/if}</td>
|
||||
<td>
|
||||
{if $ct.status == 'pass'}<span class="label label-success">已通过</span>
|
||||
{elseif $ct.status == 'reject'/}<span class="label label-danger" title="{$ct.audit_msg|htmlentities}">已驳回</span>
|
||||
{else/}<span class="label label-warning">待审核</span>{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{else /}
|
||||
<div style="text-align: center; color: #94a3b8; padding: 14px 0;">暂未上传技能资质证书</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
<form id="audit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
<div class="panel panel-default" style="margin-bottom: 15px;">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title"><i class="fa fa-id-badge"></i> 证书申报信息(只读核验)</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<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">
|
||||
<p class="form-control-static">
|
||||
<strong>{$row.master.realname|default='-'|htmlentities}</strong>
|
||||
{if !empty($row.master.mobile)}<span class="text-muted">({$row.master.mobile|htmlentities})</span>{/if}
|
||||
</p>
|
||||
</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">
|
||||
<p class="form-control-static">
|
||||
<strong>{$row.cert_name|htmlentities}</strong>
|
||||
{if $row.is_custom == 1}<span class="label label-info" style="margin-left:6px;">自定义</span>{/if}
|
||||
</p>
|
||||
</div>
|
||||
</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">
|
||||
<p class="form-control-static">
|
||||
{if $row.is_long_term == 1}
|
||||
<span class="label label-success">长期有效</span>
|
||||
{else/}
|
||||
<strong>{$row.expire_date|default='未填写'|htmlentities}</strong>
|
||||
{/if}
|
||||
</p>
|
||||
</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">
|
||||
<p class="form-control-static">{$row.updatetime|default=$row.createtime|datetime}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-bottom:0;">
|
||||
<label class="control-label col-xs-12 col-sm-2">证书照片:</label>
|
||||
<div class="col-xs-12 col-sm-10">
|
||||
{if !empty($row.cert_image)}
|
||||
<a href="{$row.cert_image|cdnurl|htmlentities}" target="_blank" title="点击在新窗口查看高清原图">
|
||||
<img src="{$row.cert_image|cdnurl|htmlentities}" style="max-width:420px;max-height:280px;border-radius:6px;border:1px solid #e2e8f0;background:#f8fafc;padding:4px;" />
|
||||
</a>
|
||||
<div class="help-block" style="margin-bottom:0;">点击图片可在新标签页放大核验证件编号与有效期</div>
|
||||
{else/}
|
||||
<span class="text-muted">未上传照片</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title"><i class="fa fa-gavel"></i> 平台审核结论</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">审核状态:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="radio">
|
||||
{foreach name="statusList" item="vo"}
|
||||
<label for="row[status]-{$key}" style="margin-right:16px;">
|
||||
<input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}
|
||||
</label>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2" for="c-audit_msg">审核意见:</label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<textarea id="c-audit_msg" class="form-control" rows="3" name="row[audit_msg]" placeholder="通过可留空或填备注;选择驳回时请务必写明驳回原因(例如:照片模糊、证书已过期、非本人证件)">{$row.audit_msg|htmlentities}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,54 @@
|
||||
<div style="padding: 8px;">
|
||||
<table class="table table-bordered table-striped" style="margin-bottom: 14px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="width:120px;">申报师傅</th>
|
||||
<td><strong>{$row.master.realname|default='-'|htmlentities}</strong>({$row.master.mobile|default='-'|htmlentities})</td>
|
||||
<th style="width:120px;">证书名称</th>
|
||||
<td>
|
||||
<strong>{$row.cert_name|htmlentities}</strong>
|
||||
{if $row.is_custom == 1}<span class="label label-info">自定义</span>{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>证件有效期</th>
|
||||
<td>
|
||||
{if $row.is_long_term == 1}
|
||||
<span class="label label-success">长期有效</span>
|
||||
{else/}
|
||||
{$row.expire_date|default='未填写'|htmlentities}
|
||||
{/if}
|
||||
</td>
|
||||
<th>当前审核状态</th>
|
||||
<td>
|
||||
{if $row.status == 'pass'}<span class="label label-success">已通过</span>
|
||||
{elseif $row.status == 'reject'/}<span class="label label-danger">已驳回</span>
|
||||
{else/}<span class="label label-warning">待审核</span>{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>审核意见</th>
|
||||
<td colspan="3">{$row.audit_msg|default='暂无审核意见'|htmlentities}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>提交时间</th>
|
||||
<td>{$row.createtime|datetime}</td>
|
||||
<th>最后更新时间</th>
|
||||
<td>{$row.updatetime|datetime}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="panel panel-default" style="margin-bottom: 0;">
|
||||
<div class="panel-heading"><strong>证书原图核验</strong></div>
|
||||
<div class="panel-body text-center">
|
||||
{if !empty($row.cert_image)}
|
||||
<a href="{$row.cert_image|cdnurl|htmlentities}" target="_blank">
|
||||
<img src="{$row.cert_image|cdnurl|htmlentities}" style="max-width:100%;max-height:420px;border-radius:6px;border:1px solid #e2e8f0;" />
|
||||
</a>
|
||||
{else/}
|
||||
<span class="text-muted">未上传照片</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,30 @@
|
||||
<div class="panel panel-default panel-intro">
|
||||
<div class="panel-heading">
|
||||
{:build_heading(null,FALSE)}
|
||||
<ul class="nav nav-tabs" data-field="status">
|
||||
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">全部证书</a></li>
|
||||
{foreach name="statusList" item="vo"}
|
||||
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<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')}"><i class="fa fa-refresh"></i></a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('master_cert/del')?'':'hide'}" title="{:__('Delete')}"><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-detail="{:$auth->check('master_cert/detail')}"
|
||||
data-operate-audit="{:$auth->check('master_cert/audit')}"
|
||||
data-operate-del="{:$auth->check('master_cert/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -363,8 +363,9 @@
|
||||
<div class="od-item"><span class="od-item-k">支付状态:</span><span class="od-item-v"><span class="label {if $row.pay_status==1}label-success{elseif $row.pay_status==2/}label-danger{else/}label-default{/if}">{$row.pay_status_text}</span></span></div>
|
||||
<div class="od-item"><span class="od-item-k">支付渠道:</span><span class="od-item-v">{$row.pay_type|default='微信支付'|htmlentities}</span></div>
|
||||
<div class="od-item" style="grid-column: span 2;"><span class="od-item-k">交易流水号:</span><span class="od-item-v"><code>{$row.transaction_id|default='-'|htmlentities}</code></span></div>
|
||||
<div class="od-item"><span class="od-item-k">师傅结算款:</span><span class="od-item-v" style="color:#10b981; font-weight:700;">¥{if !empty($settle)}{$settle.settle_amount} (抽成¥{$settle.commission}){else/}{$row.settle_amount}{/if}</span></div>
|
||||
<div class="od-item"><span class="od-item-k">抽佣规则快照:</span><span class="od-item-v"><span class="label label-info">{if !empty($settle)}{$settle.commission_rate|htmlentities}%{else/}{$settlePreview.commission_rate|default='10.00'|htmlentities}%{/if}</span> <small class="text-muted">{$settlePreview.rule_name|default=''|htmlentities}</small></span></div>
|
||||
<div class="od-item"><span class="od-item-k">结算状态:</span><span class="od-item-v">{$row.settle_status_text}</span></div>
|
||||
<div class="od-item" style="grid-column: span 2;"><span class="od-item-k">师傅结算款:</span><span class="od-item-v" style="color:#10b981; font-weight:700;">{if !empty($settle)}¥{$settle.settle_amount}(平台抽佣 ¥{$settle.commission}){elseif $row.settle_status == 1/}¥{$row.settle_amount}{else/}预计 ¥{:number_format($settlePreview.settle_amount, 2, '.', '')}(预计抽佣 ¥{:number_format($settlePreview.commission, 2, '.', '')}){/if}</span></div>
|
||||
<div class="od-item" style="grid-column: span 2;">
|
||||
<span class="od-item-k">发票状态:</span>
|
||||
<span class="od-item-v">
|
||||
@@ -439,6 +440,94 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 3.5 微信支付与原路退款交易流水诊断 -->
|
||||
<div class="od-card">
|
||||
<div class="od-card-header">
|
||||
<h4 class="od-card-title"><i class="fa fa-wechat"></i> 微信支付与原路退款交易流水 ({:count($payOrders)})</h4>
|
||||
<span class="text-muted" style="font-size:12px;">展示网关真实回执、异常中文诊断与人工同步/重退入口</span>
|
||||
</div>
|
||||
<div class="od-card-body">
|
||||
{if !empty($payOrders)}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-condensed" style="margin-bottom:0; font-size:12.5px;">
|
||||
<thead>
|
||||
<tr style="background:#f8fafc;">
|
||||
<th style="width:55px;">ID</th>
|
||||
<th style="width:105px;">支付场景</th>
|
||||
<th>商户单号 / 微信单号 / 退款单号</th>
|
||||
<th style="width:90px;">金额</th>
|
||||
<th style="width:130px;">流水 / 退款状态</th>
|
||||
<th>失败错误码与中文诊断</th>
|
||||
<th style="width:140px;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="payOrders" item="po"}
|
||||
<tr>
|
||||
<td>#{$po.id}</td>
|
||||
<td>{$po.scene_text|htmlentities}</td>
|
||||
<td>
|
||||
<div>商户:<code>{$po.out_trade_no|htmlentities}</code></div>
|
||||
{if !empty($po.transaction_id)}<div style="margin-top:2px;">微信:<code>{$po.transaction_id|htmlentities}</code></div>{/if}
|
||||
{if !empty($po.refund_no)}<div style="margin-top:2px;">退款单:<code>{$po.refund_no|htmlentities}</code>{if !empty($po.refund_id)}({$po.refund_id|htmlentities}){/if}</div>{/if}
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-weight:700; color:#ea580c;">¥{$po.amount|number_format=2}</div>
|
||||
{if $po.refund_amount > 0}<div style="font-size:11px; color:#64748b;">退 ¥{$po.refund_amount|number_format=2}</div>{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $po.status == 'paid'}<span class="label label-success">{$po.status_text}</span>
|
||||
{elseif $po.status == 'refunded'/}<span class="label label-info">{$po.status_text}</span>
|
||||
{elseif $po.status == 'refunding'/}<span class="label label-warning">{$po.status_text}</span>
|
||||
{elseif $po.status == 'pay_failed' || $po.status == 'refund_failed'/}<span class="label label-danger">{$po.status_text}</span>
|
||||
{else/}<span class="label label-default">{$po.status_text}</span>{/if}
|
||||
{if $po.refund_status && $po.refund_status != 'none'}
|
||||
<div style="margin-top:4px; font-size:11px; color:#475569;">{$po.refund_status_text}</div>
|
||||
{/if}
|
||||
{if !empty($po.last_sync_time)}
|
||||
<div style="margin-top:2px; font-size:11px; color:#94a3b8;">同步于 {:date('m-d H:i:s', $po.last_sync_time)}</div>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if !empty($po.fail_reason) || !empty($po.fail_code)}
|
||||
<div style="background:#fef2f2; border:1px solid #fecaca; color:#b91c1c; border-radius:6px; padding:6px 8px; line-height:1.5;">
|
||||
{if !empty($po.fail_code)}<div><strong>错误码:</strong><code>{$po.fail_code|htmlentities}</code></div>{/if}
|
||||
<div><strong>原因:</strong>{$po.fail_reason|default='未知异常'|htmlentities}</div>
|
||||
</div>
|
||||
{else /}
|
||||
<span class="text-muted">-</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $po.status == 'pending' || $po.status == 'pay_failed' || $po.status == 'refunding' || $po.status == 'refund_failed'}
|
||||
<button type="button" class="btn btn-xs btn-warning js-sync-pay-order" data-id="{$po.id}" style="margin-bottom:4px;">
|
||||
<i class="fa fa-refresh"></i> 同步微信状态
|
||||
</button>
|
||||
{/if}
|
||||
{if $po.status == 'refund_failed' || ($po.status == 'paid' && $row.status == 9 && $row.settle_status != 1)}
|
||||
<button type="button" class="btn btn-xs btn-danger js-retry-refund" data-id="{$po.id}" data-outno="{$po.out_trade_no|htmlentities}">
|
||||
<i class="fa fa-undo"></i> 重试原路退款
|
||||
</button>
|
||||
{/if}
|
||||
{if $po.status == 'refunded' || $po.status == 'closed' || ($po.status == 'paid' && ($row.status != 9 || $row.settle_status == 1))}
|
||||
<span class="text-muted" style="font-size:11px;">无需人工处置</span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{elseif $row.pay_status == 1 && ($row.pay_type == 'wechat' || $row.pay_type == '')/}
|
||||
<div style="background:#fef2f2; border:1px solid #fecaca; color:#b91c1c; border-radius:6px; padding:10px 12px;">
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>资金流水缺失告警:</strong>当前订单显示已支付(渠道:{$row.pay_type|default='未记录'|htmlentities}),但未关联任何 <code>fa_pay_order</code> 微信交易单,系统已禁止自动假退款,如需退款请先核查微信商户平台流水。
|
||||
</div>
|
||||
{else /}
|
||||
<div class="text-muted" style="padding:8px 0;">暂无微信支付交易流水记录</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 4. 现场施工取证照片画廊 -->
|
||||
<div class="od-card">
|
||||
<div class="od-card-header">
|
||||
|
||||
@@ -169,6 +169,7 @@
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-image"></span>
|
||||
</div>
|
||||
<p class="help-block" style="margin:6px 0 0;font-size:12px;color:#64748b;">上传后同时作为小程序「系统图库」该商品的默认参考图;如需配置多款参考图,可在下方细分规格上传或前往「系统图库」管理。</p>
|
||||
<ul class="row list-inline faupload-preview plupload-preview" id="p-image"></ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -208,11 +209,12 @@
|
||||
<table class="table table-bordered table-hover" id="specs-table" style="margin-bottom: 0;">
|
||||
<thead>
|
||||
<tr class="active">
|
||||
<th style="width: 55px; text-align: center;">序号</th>
|
||||
<th style="width: 260px;">细分规格/款式名称</th>
|
||||
<th style="width: 220px;">特殊规格一口价(选填)</th>
|
||||
<th style="width: 50px; text-align: center;">序号</th>
|
||||
<th style="width: 220px;">细分规格/款式名称</th>
|
||||
<th style="width: 155px; text-align: center;">规格参考图(选填)</th>
|
||||
<th style="width: 195px;">特殊规格一口价(选填)</th>
|
||||
<th>规格说明或施工提示(选填)</th>
|
||||
<th style="width: 75px; text-align: center;">操作</th>
|
||||
<th style="width: 65px; text-align: center;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="specs-tbody"></tbody>
|
||||
|
||||
@@ -397,6 +397,7 @@
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-image"></span>
|
||||
</div>
|
||||
<p class="help-block" style="margin:6px 0 0;font-size:12px;color:#64748b;">上传后同时作为小程序「系统图库」该商品的默认参考图;如需配置多款参考图,可在下方细分规格上传或前往「系统图库」管理。</p>
|
||||
<ul class="row list-inline faupload-preview plupload-preview" id="p-image"></ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -438,21 +439,32 @@
|
||||
<table class="table table-bordered table-hover" id="specs-table" style="margin-bottom: 0;">
|
||||
<thead>
|
||||
<tr class="active">
|
||||
<th style="width: 55px; text-align: center;">序号</th>
|
||||
<th style="width: 260px;">细分规格/款式名称</th>
|
||||
<th style="width: 220px;">特殊规格一口价(选填)</th>
|
||||
<th style="width: 50px; text-align: center;">序号</th>
|
||||
<th style="width: 220px;">细分规格/款式名称</th>
|
||||
<th style="width: 155px; text-align: center;">规格参考图(选填)</th>
|
||||
<th style="width: 195px;">特殊规格一口价(选填)</th>
|
||||
<th>规格说明或施工提示(选填)</th>
|
||||
<th style="width: 75px; text-align: center;">操作</th>
|
||||
<th style="width: 65px; text-align: center;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="specs-tbody">
|
||||
{foreach name="specs" item="sp" key="idx"}
|
||||
<?php $spImgRaw = isset($sp['image']) ? trim((string)$sp['image']) : ''; $spImgFull = $spImgRaw !== '' ? (strpos($spImgRaw, 'http') === 0 ? $spImgRaw : cdnurl($spImgRaw, true)) : ''; ?>
|
||||
<tr data-id="{$sp.id}">
|
||||
<td style="text-align: center; vertical-align: middle; color: #64748b; font-weight: 600;">{$idx+1}</td>
|
||||
<td>
|
||||
<input type="hidden" name="specs[{$idx}][id]" value="{$sp.id}">
|
||||
<input type="text" name="specs[{$idx}][name]" class="form-control input-sm" value="{$sp.name|htmlentities}" placeholder="如:普通坐便器(马桶) / 智能马桶">
|
||||
</td>
|
||||
<td style="text-align: center; vertical-align: middle;">
|
||||
<div class="spec-img-cell" style="display:inline-flex;align-items:center;gap:6px;">
|
||||
<input type="hidden" name="specs[{$idx}][image]" class="spec-img-input" value="{$spImgRaw|htmlentities}">
|
||||
<img class="spec-img-preview" src="{$spImgFull|htmlentities}" style="width:34px;height:34px;border-radius:4px;object-fit:cover;border:1px solid #cbd5e1;{if !$spImgFull}display:none;{/if}" onclick="window.open(this.src)" title="点击查看大图">
|
||||
<button type="button" class="btn btn-xs btn-default btn-upload-spec-img"><i class="fa fa-upload"></i> {if $spImgFull}更换{else/}上传{/if}</button>
|
||||
<button type="button" class="btn btn-xs btn-link text-danger btn-clear-spec-img" style="padding:0 2px;{if !$spImgFull}display:none;{/if}" title="移除图片"><i class="fa fa-times"></i></button>
|
||||
<input type="file" class="spec-img-file" accept="image/*" style="display:none;">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon">¥</span>
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">所属类目:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-cat_id" data-source="service/cat/index" data-params='{"custom[id]":["<>",15]}' class="form-control selectpage" name="row[cat_id]" type="text" value="{$initCatId|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-8">
|
||||
<input id="c-service_id" data-rule="required" data-source="service/index" class="form-control selectpage" name="row[service_id]" type="text" value="{$initServiceId|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-8">
|
||||
<input id="c-title" class="form-control" name="row[title]" type="text" value="" placeholder="如:软体床、25kg商用和面机(留空默认取商品名称)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">系统参考图:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-image" class="btn btn-danger faupload plupload" data-category="service" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-image"><i class="fa fa-upload"></i> 批量上传</button></span>
|
||||
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> 附件选择</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-image"></span>
|
||||
</div>
|
||||
<p class="help-block" style="margin:6px 0 0;font-size:12px;color:#64748b;">支持一次选择多张图片批量入库,小程序端在选择对应类目与商品时自动展示。</p>
|
||||
<ul class="row list-inline faupload-preview plupload-preview" id="p-image"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">排序权重:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="100">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">显示状态:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="radio">
|
||||
{foreach name="statusList" item="vo"}
|
||||
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,63 @@
|
||||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">所属类目:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-cat_id" data-source="service/cat/index" data-params='{"custom[id]":["<>",15]}' class="form-control selectpage" name="row[cat_id]" type="text" value="{$row.cat_id|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-8">
|
||||
<input id="c-service_id" data-rule="required" data-source="service/index" class="form-control selectpage" name="row[service_id]" type="text" value="{$row.service_id|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-8">
|
||||
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}" placeholder="如:软体床、25kg商用和面机">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">系统参考图:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-image" class="btn btn-danger faupload plupload" data-category="service" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> 上传图片</button></span>
|
||||
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> 附件选择</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline faupload-preview plupload-preview" id="p-image"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">排序权重:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">显示状态:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="radio">
|
||||
{foreach name="statusList" item="vo"}
|
||||
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,38 @@
|
||||
<div class="panel panel-default panel-intro">
|
||||
<div class="panel-heading">
|
||||
{:build_heading(null,FALSE)}
|
||||
{if !$initServiceId}
|
||||
<ul class="nav nav-tabs" data-field="cat_id">
|
||||
<li class="{:$Think.get.cat_id === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">全部图库</a></li>
|
||||
{foreach name="catList" item="vo"}
|
||||
<li class="{:$Think.get.cat_id === (string)$vo.id ? 'active' : ''}"><a href="#t-{$vo.id}" data-value="{$vo.id}" data-toggle="tab">{$vo.name}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{else/}
|
||||
<div style="padding: 6px 0 2px; font-size: 13px; color: #475569;">
|
||||
当前筛选商品:<strong style="color:#ea580c;">{$initServiceName|htmlentities}</strong>(小程序下单选择对应类目进入「系统图库」时展示以下参考图片)
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<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')}"><i class="fa fa-refresh"></i> </a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('service/gallery/add')?'':'hide'}" title="上传添加系统图库"><i class="fa fa-plus"></i> 添加图库图片</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('service/gallery/edit')?'':'hide'}" title="{:__('Edit')}"><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('service/gallery/del')?'':'hide'}" title="{:__('Delete')}"><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-detail="0"
|
||||
data-operate-edit="{:$auth->check('service/gallery/edit')}"
|
||||
data-operate-del="{:$auth->check('service/gallery/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -18,6 +18,7 @@
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('service/add')?'':'hide'}" title="{:__('Add')}"><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('service/edit')?'':'hide'}" title="{:__('Edit')}"><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('service/del')?'':'hide'}" title="{:__('Delete')}"><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
<a href="{:url('service/gallery/index')}" class="btn btn-info btn-addtabs {:$auth->check('service/gallery/index')?'':'hide'}" title="系统图库"><i class="fa fa-picture-o"></i> 系统图库</a>
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-detail="{:$auth->check('service/detail')}"
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}"><i class="fa fa-refresh"></i></a>
|
||||
{if $auth->check('finance_config/index')}
|
||||
<a href="{:url('finance_config/index')}" class="btn btn-info btn-addtabs" title="财务配置"><i class="fa fa-sliders"></i> 财务配置</a>
|
||||
{/if}
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-detail="{:$auth->check('settle/detail')}"
|
||||
|
||||
@@ -27,7 +27,25 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 wd-kv"><span class="k">提现渠道:</span><span class="label label-primary">{$channelList[$row.channel]|default=$row.channel|htmlentities}</span></div>
|
||||
<div class="col-sm-6 wd-kv"><span class="k">收款账号:</span><code>{$row.account|htmlentities}</code></div>
|
||||
<div class="col-sm-6 wd-kv"><span class="k">收款账号:</span><code>{$row.account|default='微信零钱'|htmlentities}</code></div>
|
||||
{if !empty($row.out_bill_no)}
|
||||
<div class="col-sm-6 wd-kv"><span class="k">商户转账单:</span><code>{$row.out_bill_no|htmlentities}</code></div>
|
||||
<div class="col-sm-6 wd-kv"><span class="k">微信转账单:</span><code>{$row.transfer_bill_no|default='-'|htmlentities}</code></div>
|
||||
<div class="col-sm-6 wd-kv"><span class="k">微信转账态:</span><span class="label label-info">{$row.transfer_state_text|default=$row.transfer_state|htmlentities}</span></div>
|
||||
<div class="col-sm-6 wd-kv"><span class="k">确认收款时:</span>{if $row.confirm_time}{:date('Y-m-d H:i:s', $row.confirm_time)}{else/}-{/if}</div>
|
||||
{/if}
|
||||
{if !empty($row.fail_reason) || !empty($row.fail_code)}
|
||||
<div class="col-sm-12" style="margin-top:8px; margin-bottom:10px;">
|
||||
<div class="alert alert-danger" style="margin-bottom:0; padding:10px 14px; border-radius:6px;">
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>微信转账异常 / 失败原因</strong>
|
||||
{if !empty($row.fail_code)} <span class="label label-danger">{$row.fail_code|htmlentities}</span>{/if}
|
||||
<div style="margin-top:5px;">{$row.fail_reason|default='未知异常,请同步微信状态或查看日志'|htmlentities}</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if !empty($row.last_sync_time)}
|
||||
<div class="col-sm-6 wd-kv"><span class="k">最近查单:</span>{:date('Y-m-d H:i:s', $row.last_sync_time)}</div>
|
||||
{/if}
|
||||
<div class="col-sm-6 wd-kv"><span class="k">申请时间:</span>{:date('Y-m-d H:i:s', $row.createtime)}</div>
|
||||
<div class="col-sm-6 wd-kv"><span class="k">更新时间:</span>{:date('Y-m-d H:i:s', $row.updatetime)}</div>
|
||||
<div class="col-sm-12 wd-kv" style="margin-bottom:0;"><span class="k">财务批注:</span>{$row.audit_msg|default='-'|htmlentities}</div>
|
||||
|
||||
@@ -37,11 +37,41 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-4">结算账户:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<p class="form-control-static">{$channelList[$row.channel]|default=$row.channel} · {$row.account|htmlentities}</p>
|
||||
<p class="form-control-static">{$channelList[$row.channel]|default=$row.channel} · {$row.account|default='微信零钱'|htmlentities}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{if !empty($row.out_bill_no)}
|
||||
<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">
|
||||
<p class="form-control-static"><code>{$row.out_bill_no|htmlentities}</code></p>
|
||||
</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">
|
||||
<p class="form-control-static"><span class="label label-info">{$transferStateLabel|htmlentities}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if !empty($row.fail_reason) || !empty($row.fail_code)}
|
||||
<div class="alert alert-danger" style="margin-bottom:12px; border-radius:6px;">
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>上次微信转账失败 / 异常诊断</strong>
|
||||
{if !empty($row.fail_code)} <span class="label label-danger">{$row.fail_code|htmlentities}</span>{/if}
|
||||
<div style="margin-top:4px; line-height:1.6;">{$row.fail_reason|htmlentities}</div>
|
||||
{if !empty($row.last_sync_time)}
|
||||
<div style="margin-top:4px; font-size:12px; opacity:0.85;">最近核验时间:{:date('Y-m-d H:i:s', $row.last_sync_time)}({if !empty($row.retry_count)}已重试 {$row.retry_count} 次{/if})</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{if $row.status != 'wait'}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">已填批注:</label>
|
||||
@@ -60,7 +90,15 @@
|
||||
<h4 class="panel-title"><i class="fa fa-check-square-o"></i> 财务审核操作</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{if $row.status == 'wait'}
|
||||
{if $row.transfer_state == 'UNKNOWN_TIMEOUT'}
|
||||
<p class="text-danger" style="margin-top:0"><i class="fa fa-warning"></i> 该笔提现上次请求微信网关超时,可能已被受理。为严防双倍出款,系统已锁定重发,请先选择「同步微信转账最新状态」核实后再决定后续操作。</p>
|
||||
{elseif ($row.transfer_state == 'FAIL' || $row.transfer_state == 'NOT_FOUND') && !empty($useWxApi) /}
|
||||
<p class="text-warning" style="margin-top:0"><i class="fa fa-info-circle"></i> 上次微信转账未成功出款。在排查修复上方失败原因(如商户余额不足、IP 白名单或配置错误)后,可选择「重新发起微信商家转账」使用递增单号安全重试,或选择驳回退回师傅余额。</p>
|
||||
{elseif !empty($useWxApi) && $row.status == 'wait' /}
|
||||
<p class="text-muted" style="margin-top:0">选择「审核通过并发起微信商家转账」将直接调用微信支付 V3(场景 1005 佣金报酬)向师傅发起转账,师傅在小程序「我的钱包」点击确认收款后即自动入账微信零钱。</p>
|
||||
{elseif $row.channel == 'wechat' && !empty($row.out_bill_no) /}
|
||||
<p class="text-muted" style="margin-top:0">该笔提现已发起微信商家转账,正在等待师傅在小程序「我的钱包」确认收款。可点击「同步微信最新状态」刷新结果,或在师傅收款前选择「撤销转账并退回余额」。</p>
|
||||
{elseif $row.status == 'wait' /}
|
||||
<p class="text-muted" style="margin-top:0">审核通过后资金保持冻结,待打款后标记「打款完成」划出冻结金额;驳回将自动退回师傅钱包余额。</p>
|
||||
{else /}
|
||||
<p class="text-muted" style="margin-top:0">该单已审核通过,请线下完成打款后标记「打款完成」,系统将自动划出冻结金额;如审核有误可驳回,将自动退回师傅余额。</p>
|
||||
@@ -70,13 +108,15 @@
|
||||
<label class="control-label col-xs-12 col-sm-2">审核操作:</label>
|
||||
<div class="col-xs-12 col-sm-10">
|
||||
<div class="radio" style="margin-top:5px">
|
||||
{foreach name="flowOptions" item="op"}
|
||||
{foreach name="flowOptions" item="op" key="idx"}
|
||||
{if $op == 'pass'}
|
||||
<label><input name="row[status]" type="radio" value="pass" checked /> 审核通过</label>
|
||||
<label><input name="row[status]" type="radio" value="pass" {if $idx==0}checked{/if} /> {if !empty($row.out_bill_no)}重新发起微信商家转账{elseif !empty($useWxApi)/}审核通过并发起微信商家转账{else/}审核通过{/if}</label>
|
||||
{elseif $op == 'sync' /}
|
||||
<label><input name="row[status]" type="radio" value="sync" {if $idx==0}checked{/if} /> 同步微信转账最新状态</label>
|
||||
{elseif $op == 'reject' /}
|
||||
<label><input name="row[status]" type="radio" value="reject" /> 驳回(退回余额)</label>
|
||||
<label><input name="row[status]" type="radio" value="reject" {if $idx==0}checked{/if} /> {if !empty($row.out_bill_no)}撤销/核查微信转账并驳回(退回余额){else/}驳回(退回余额){/if}</label>
|
||||
{elseif $op == 'done' /}
|
||||
<label><input name="row[status]" type="radio" value="done" checked /> 标记打款完成</label>
|
||||
<label><input name="row[status]" type="radio" value="done" {if $idx==0}checked{/if} /> 标记线下打款完成</label>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}"><i class="fa fa-refresh"></i></a>
|
||||
{if $auth->check('finance_config/index')}
|
||||
<a href="{:url('finance_config/index')}#tab-withdraw" class="btn btn-info btn-addtabs" title="提现配置"><i class="fa fa-sliders"></i> 提现配置</a>
|
||||
{/if}
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-detail="{:$auth->check('withdraw/detail')}"
|
||||
|
||||
在新工单中引用
屏蔽一个用户