90 lines
4.8 KiB
Plaintext
90 lines
4.8 KiB
Plaintext
<navigation-bar title="系统消息" back="{{true}}" bindback="handleBack" color="#f6efe7" background="#081518"></navigation-bar>
|
|||
|
|
|
||
|
|
<view class="page-shell">
|
||
|
|
<view class="page-stack">
|
||
|
|
<view class="hero-panel">
|
||
|
|
<text class="hero-kicker">Message Center</text>
|
||
|
|
<text class="hero-title">消息发布与弹窗配置</text>
|
||
|
|
<text class="hero-desc">查看消息列表、弹窗开关、业务跳转和发布状态。</text>
|
||
|
|
</view>
|
||
|
|
|
||
|
|
<view wx:if="{{canCreate && !formVisible}}" class="primary-btn" bindtap="handleShowForm">发布消息</view>
|
||
|
|
|
||
|
|
<view wx:if="{{formVisible}}" class="surface-card form-card">
|
||
|
|
<text class="section-title">发布系统消息</text>
|
||
|
|
<input class="field-input" placeholder="标题" placeholder-class="placeholder" value="{{form.title}}" bindinput="handleTitleInput"></input>
|
||
|
|
<textarea class="field-textarea" placeholder="消息内容" placeholder-class="placeholder" value="{{form.content}}" maxlength="2000" bindinput="handleContentInput"></textarea>
|
||
|
|
|
||
|
|
<text class="field-label">接收范围</text>
|
||
|
|
<view class="chip-row">
|
||
|
|
<block wx:for="{{targetTypeOptions}}" wx:key="value">
|
||
|
|
<view class="chip-btn {{form.targetType === item.value ? 'active' : ''}}" data-value="{{item.value}}" bindtap="handleTargetTypeChange">{{item.label}}</view>
|
||
|
|
</block>
|
||
|
|
</view>
|
||
|
|
<input wx:if="{{form.targetType !== 'PLATFORM_ALL'}}" class="field-input" placeholder="{{form.targetType === 'SELECTED_SHOPS' ? '店铺 ID' : '用户 ID'}}" placeholder-class="placeholder" value="{{form.targetId}}" bindinput="handleTargetIdInput"></input>
|
||
|
|
<view wx:if="{{form.targetType === 'SELECTED_SHOPS' && targetOptions.shops.length}}" class="option-hint">可选店铺:{{targetOptions.shops.length}} 个,输入对应 ID 发布</view>
|
||
|
|
<view wx:if="{{form.targetType === 'SELECTED_USERS' && targetOptions.users.length}}" class="option-hint">可选用户:{{targetOptions.users.length}} 个,输入对应 ID 发布</view>
|
||
|
|
|
||
|
|
<view class="switch-row">
|
||
|
|
<text class="field-label">弹窗显示一次</text>
|
||
|
|
<switch checked="{{form.popupEnabled}}" color="#f07e57" bindchange="handlePopupToggle"></switch>
|
||
|
|
</view>
|
||
|
|
|
||
|
|
<text class="field-label">业务跳转</text>
|
||
|
|
<view class="chip-row">
|
||
|
|
<block wx:for="{{businessTypeOptions}}" wx:key="value">
|
||
|
|
<view class="chip-btn {{form.businessType === item.value ? 'active' : ''}}" data-value="{{item.value}}" bindtap="handleBusinessTypeChange">{{item.label}}</view>
|
||
|
|
</block>
|
||
|
|
</view>
|
||
|
|
<input class="field-input" placeholder="业务 ID,可选" placeholder-class="placeholder" value="{{form.businessId}}" bindinput="handleBusinessIdInput"></input>
|
||
|
|
<input class="field-input" placeholder="跳转路径,如 /orders?orderId=123" placeholder-class="placeholder" value="{{form.actionPath}}" bindinput="handleActionPathInput"></input>
|
||
|
|
|
||
|
|
<view class="actions-row">
|
||
|
|
<button class="secondary-btn" bindtap="handleHideForm">取消</button>
|
||
|
|
<button class="primary-btn" loading="{{submitting}}" bindtap="handlePublish">发布</button>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
|
||
|
|
<block wx:for="{{list}}" wx:key="id">
|
||
|
|
<view class="list-card">
|
||
|
|
<view class="list-head">
|
||
|
|
<view>
|
||
|
|
<text class="list-title">{{item.title}}</text>
|
||
|
|
<text class="list-subtitle">{{item.publisherName || '系统'}} · {{item.displayTime}}</text>
|
||
|
|
</view>
|
||
|
|
<text class="badge">{{item.popupText}}</text>
|
||
|
|
</view>
|
||
|
|
<text wx:if="{{item.content}}" class="message-content">{{item.content}}</text>
|
||
|
|
<view class="meta-grid">
|
||
|
|
<view class="meta-item">
|
||
|
|
<text class="meta-label">状态</text>
|
||
|
|
<text class="meta-value">{{item.statusText}}</text>
|
||
|
|
</view>
|
||
|
|
<view class="meta-item">
|
||
|
|
<text class="meta-label">目标</text>
|
||
|
|
<text class="meta-value">{{item.targetTypeName || item.targetType || '--'}}</text>
|
||
|
|
</view>
|
||
|
|
<view class="meta-item">
|
||
|
|
<text class="meta-label">业务类型</text>
|
||
|
|
<text class="meta-value">{{item.businessText}}</text>
|
||
|
|
</view>
|
||
|
|
<view class="meta-item">
|
||
|
|
<text class="meta-label">跳转</text>
|
||
|
|
<text class="meta-value">{{item.actionText}}</text>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
<view wx:if="{{canRevoke && item.status === 1}}" class="card-actions">
|
||
|
|
<view class="mini-btn" data-id="{{item.id}}" bindtap="handleRevoke">撤回</view>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
</block>
|
||
|
|
|
||
|
|
<view wx:if="{{!list.length && !loading}}" class="empty-state">
|
||
|
|
<text class="empty-title">暂无系统消息</text>
|
||
|
|
<text class="empty-desc">发布后的消息会显示弹窗配置和业务跳转信息。</text>
|
||
|
|
</view>
|
||
|
|
|
||
|
|
<view wx:if="{{loading}}" class="loading-line">加载中...</view>
|
||
|
|
</view>
|
||
|
|
</view>
|