文件
fenleixinxi/application/admin/view/fc/publish/index.html
linda d452be1d60 feat(api): v1.0.10 免费发布条数(周期 每日/每月/累计)+ 计费顺序(套餐额度 → 免费条数 → 单条付费)
需求:免费发布不能是「要么全免费、要么一开付费就是硬付费墙」,需要可配「前 N 条免费」,
超出的按付费发布标准计费。

- 后台「发布与费用配置」新增「免费发布条数 + 统计周期」:post.freeQuota / post.freeQuotaCycle
  (day 每日 / month 每月 / total 累计;0 = 不限制,免费发布模式下「免费到底」)
  Publish::save 校验周期枚举与条数非负;页面补说明(计费顺序:套餐额度 → 免费发布条数 → 单条付费)
- FcInstall::upgradePublish 与内置种子各补两枚配置(幂等,不覆盖运营已改的值;老库缺失时
  API 回落 fee.freePostPerDay 按日计,行为与升级前一致)
- POST /post/create 计费重构为三级顺序:
  ① 套餐额度(fc_user_ext.post_quota_left)→ ② 免费发布条数(按周期统计本人已发布条数,不含软删)
  → ③ 单条付费(post.singlePrice,即「付费发布」标准)
  免费发布模式下免费条数用完时明确提示「免费额度已用完,请按 X.XX 元/条付费发布」
  (服务端不主动扣款,需客户端切到 plan=single 并选支付方式后重新提交)
- GET /post/publish-config 字段调整:freePerDay/freeUsedToday/freeLeftToday
  → freeQuota / freeQuotaCycle / freeQuotaUsed / freeQuotaLeft / freeUnlimited(-1 = 不限制)
- tools/verify-api.mjs P9 同步断言新字段与「能否免费发布」判定;后台语言包补齐中文映射
- application/config.php:site.version 1.6.6.20261016 → 1.6.7.20261016(后台视图/JS 变更后强制刷新静态资源缓存)

自检:node tools/check-admin-i18n.mjs(错误 0/警告 0)、node tools/check-theme.mjs(错误 0/警告 0)、
5 个 PHP 文件 php -n -l 无语法错误。
2026-10-17 11:45:36 +08:00

139 行
8.5 KiB
HTML

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div class="alert alert-info" style="margin-bottom:16px;">
<strong>{:__('说明')}:</strong>
{:__('本页是「发布模式 + 发布价格/条数」的唯一入口;保存后会同步「会员套餐」的月/年卡价格与含发布条数,因此用户端发布页、会员中心与后端计费口径一致。')}
<br/>
{:__('「会员单条发布价格」= 未购买套餐时按条计费的价格;「按月/按年」= 会员套餐价格,并赠送对应条数的发布额度(额度随会员有效期,过期自动清零)。')}
<br/>
{:__('计费顺序:套餐额度 → 免费发布条数 → 单条付费;免费发布条数达到后即按「会员单条发布价格」计费,金额一律由服务端计算。')}
</div>
<div class="widget-body no-padding">
<form class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('fc/publish/index')}">
{:token()}
<table class="table table-striped">
<tbody>
<tr>
<th width="22%">{:__('发布模式')}</th>
<td>
<label class="radio-inline">
<input type="radio" name="row[mode]" value="free" {if $row.mode=='free'}checked{/if}/>
{:__('免费发布(所有用户均可免费发布)')}
</label>
<label class="radio-inline">
<input type="radio" name="row[mode]" value="paid" {if $row.mode!='free'}checked{/if}/>
{:__('付费发布(按下面价格计费,套餐额度内免费)')}
</label>
</td>
</tr>
<tr>
<th>{:__('免费发布条数')}</th>
<td>
<div class="input-group" style="max-width:220px;display:inline-table;">
<input type="number" step="1" min="0" name="row[freeQuota]" class="form-control"
value="{$row.freeQuota}" data-rule="required;number"/>
<span class="input-group-addon">{:__('条')}</span>
</div>
<div class="input-group" style="max-width:220px;display:inline-table;margin-left:12px;">
<select name="row[freeQuotaCycle]" class="form-control">
<option value="day" {if $row.freeQuotaCycle=='day'}selected{/if}>{:__('每日')}</option>
<option value="month" {if $row.freeQuotaCycle=='month'}selected{/if}>{:__('每月')}</option>
<option value="total" {if $row.freeQuotaCycle=='total'}selected{/if}>{:__('累计')}</option>
</select>
</div>
<span class="help-block">{:__('免费发布条数:免费发布模式下前 N 条免费,达到条数后按「会员单条发布价格」计费(计费标准与付费发布一致);付费发布模式下同样保留这 N 条免费额度(避免一开付费就是硬付费墙)。填 0 = 不限制(免费到底)。')}</span>
</td>
</tr>
<tr>
<th>{:__('会员单条发布价格')}</th>
<td>
<div class="input-group" style="max-width:220px;">
<span class="input-group-addon">¥</span>
<input type="number" step="0.01" min="0" name="row[singlePrice]" class="form-control"
value="{$row.singlePrice}" data-rule="required;number"/>
<span class="input-group-addon">{:__('元/条')}</span>
</div>
<span class="help-block">{:__('未开通套餐的用户按此价格付费发布(金额由服务端计算,前端不可传价)')}</span>
</td>
</tr>
<tr>
<th>{:__('会员按月发布')}</th>
<td>
<div class="input-group" style="max-width:220px;display:inline-table;">
<span class="input-group-addon">¥</span>
<input type="number" step="0.01" min="0" name="row[monthPrice]" class="form-control"
value="{$row.monthPrice}" data-rule="required;number"/>
<span class="input-group-addon">{:__('元/月')}</span>
</div>
<div class="input-group" style="max-width:220px;display:inline-table;margin-left:12px;">
<input type="number" step="1" min="0" name="row[monthQuota]" class="form-control"
value="{$row.monthQuota}" data-rule="required;number"/>
<span class="input-group-addon">{:__('条/月')}</span>
</div>
<span class="help-block">{:__('价格与条数会同步到「会员套餐 → 月卡(M1)」;购买后立即赠送该条数的发布额度')}</span>
</td>
</tr>
<tr>
<th>{:__('会员按年发布')}</th>
<td>
<div class="input-group" style="max-width:220px;display:inline-table;">
<span class="input-group-addon">¥</span>
<input type="number" step="0.01" min="0" name="row[yearPrice]" class="form-control"
value="{$row.yearPrice}" data-rule="required;number"/>
<span class="input-group-addon">{:__('元/年')}</span>
</div>
<div class="input-group" style="max-width:220px;display:inline-table;margin-left:12px;">
<input type="number" step="1" min="0" name="row[yearQuota]" class="form-control"
value="{$row.yearQuota}" data-rule="required;number"/>
<span class="input-group-addon">{:__('条/年')}</span>
</div>
<span class="help-block">{:__('价格与条数会同步到「会员套餐 → 年卡(M12)」;购买后立即赠送该条数的发布额度')}</span>
</td>
</tr>
</tbody>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success btn-embossed">{:__('保存')}</button>
</div>
</div>
</form>
</div>
<div class="widget-body no-padding">
<div class="alert alert-warning" style="margin:16px 0 8px;">
<strong>{:__('当前会员套餐')}</strong>
{:__('(月/年卡的价格与含发布条数由本页同步,其余字段在「交易管理 → 会员套餐」维护)')}
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{:__('套餐编码')}</th>
<th>{:__('套餐名称')}</th>
<th>{:__('售价')}</th>
<th>{:__('有效天数')}</th>
<th>{:__('含发布条数')}</th>
<th>{:__('是否启用')}</th>
</tr>
</thead>
<tbody>
{foreach $plans as $p}
<tr>
<td>{$p.plan_code}</td>
<td>{$p.name}</td>
<td>¥{$p.price}</td>
<td>{$p.days}</td>
<td>{$p.post_quota}</td>
<td>{if $p.enabled}{:__('是')}{else/}{:__('否')}{/if}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>