- Introduced a new page for managing user-specific articles, allowing users to view and edit their submissions. - Implemented article audit status handling, including visual indicators for pending, approved, and rejected articles. - Enhanced the article detail view with audit feedback and editing capabilities for articles in pending or rejected states. - Updated the UI to dynamically reflect ownership and article status, improving user experience and clarity. This update aims to streamline article management for users and provide better feedback on article submission statuses.
75 lines
3.9 KiB
Plaintext
75 lines
3.9 KiB
Plaintext
<view class="page">
|
||
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
|
||
<view class="nav-back" bindtap="goBack">
|
||
<icon name="chevron-left" size="44" color="rgba(255,255,255,0.85)"></icon>
|
||
</view>
|
||
<text class="nav-title">{{editArticleId ? '编辑动态' : '发文章'}}</text>
|
||
<view class="nav-placeholder"></view>
|
||
</view>
|
||
<view style="height: {{statusBarHeight + 44}}px;"></view>
|
||
|
||
<!-- AI:参考图片 + 提示词(开关:showAiWriteSection) -->
|
||
<view wx:if="{{showAiWriteSection}}" class="card">
|
||
<text class="section-title">AI 写文章</text>
|
||
<text class="label">参考图片(可多选)</text>
|
||
<view class="file-actions">
|
||
<view class="add-file-btn" bindtap="chooseReferenceImages">+ 添加图片</view>
|
||
</view>
|
||
<view wx:for="{{attachedFiles}}" wx:key="id" class="file-row">
|
||
<view class="file-main">
|
||
<text class="file-name">{{item.name}}</text>
|
||
<text wx:if="{{item.uploading}}" class="file-meta">上传中…</text>
|
||
<text wx:elif="{{item.kind === 'text'}}" class="file-meta ok">文本已载入</text>
|
||
<text wx:elif="{{item.kind === 'image'}}" class="file-meta ok">图片</text>
|
||
<text wx:else class="file-meta ok">附件</text>
|
||
</view>
|
||
<text class="file-remove" data-id="{{item.id}}" bindtap="removeAttachedFile">移除</text>
|
||
</view>
|
||
<text class="hint">从相册或相机添加参考图,可多选(单次最多 9 张),上传后参与 AI 生成。单张建议不超 30MB。</text>
|
||
|
||
<text class="label">提示词</text>
|
||
<view class="textarea-wrap">
|
||
<textarea class="textarea prompt-textarea" maxlength="2000" placeholder="描述主题、受众、语气、必须提到的要点…(可与文件二选一或组合)" value="{{aiPrompt}}" bindinput="onAiPromptInput" disabled="{{auditMode}}"></textarea>
|
||
</view>
|
||
|
||
<view class="generate-btn {{generating ? 'generate-btn-loading' : ''}}" bindtap="generateArticle">{{generating ? '生成中…' : '生成文章'}}</view>
|
||
</view>
|
||
|
||
<view class="card">
|
||
<text class="section-title">编辑与发布</text>
|
||
<text class="label">标题</text>
|
||
<view class="input-wrap">
|
||
<input class="input" maxlength="40" placeholder="写个标题(最多40字)" value="{{title}}" bindinput="onTitleInput" disabled="{{auditMode}}" />
|
||
</view>
|
||
|
||
<text class="label">配图(可选,最多 9 张)</text>
|
||
<view class="file-actions">
|
||
<view class="add-file-btn" bindtap="chooseArticleImages">+ 添加配图</view>
|
||
</view>
|
||
<view class="body-img-grid" wx:if="{{bodyImages.length}}">
|
||
<view wx:for="{{bodyImages}}" wx:key="id" class="body-img-cell">
|
||
<image wx:if="{{item.url}}" class="body-img-thumb" mode="aspectFill" src="{{item.url}}" />
|
||
<view wx:if="{{item.uploading}}" class="body-img-mask">上传中…</view>
|
||
<text class="body-img-remove" data-id="{{item.id}}" bindtap="removeArticleImage">×</text>
|
||
</view>
|
||
</view>
|
||
<text class="hint">配图会展示在正文上方(与书籍正文分离存储);单张建议不超 30MB。</text>
|
||
|
||
<text class="label">正文</text>
|
||
<view class="toolbar">
|
||
<view class="tool-btn" bindtap="insertMentionSelf">@自己</view>
|
||
<view class="tool-btn" bindtap="insertHashLink">#超链接</view>
|
||
</view>
|
||
<view class="textarea-wrap">
|
||
<textarea class="textarea" maxlength="5000" placeholder="输入正文内容…" value="{{content}}" bindinput="onContentInput" disabled="{{auditMode}}"></textarea>
|
||
</view>
|
||
<text class="hint">提示:可直接输入 @昵称 或 #链接(https://xxx)</text>
|
||
|
||
<view class="submit-btn {{saving ? 'submit-btn-loading' : ''}}" bindtap="submitArticle">{{saving ? (editArticleId ? '提交中…' : '发布中…') : (editArticleId ? '提交审核' : '发布文章')}}</view>
|
||
</view>
|
||
|
||
<view wx:if="{{auditMode}}" class="audit-mode-mask" catchtouchmove="preventMove">
|
||
<text class="audit-mode-text">开发中...</text>
|
||
</view>
|
||
</view>
|