- Integrated AI writing capabilities in the super article editor, allowing users to upload multiple reference files and generate drafts using prompts. - Updated the reading page to unify the display of book chapters and super articles, improving user navigation and experience. - Enhanced the "My" page with new UI elements, including gradient icons and improved layout for better visual appeal. - Added backend support for new article management endpoints, ensuring seamless integration with the front end. This update aims to streamline the article creation process and enhance the overall user interface across the application.
81 lines
3.9 KiB
Plaintext
81 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 moment-card">
|
||
<view class="toolbar">
|
||
<view class="tool-btn" bindtap="insertMentionSelf">@自己</view>
|
||
<view class="tool-btn" bindtap="insertHashLink">#链接</view>
|
||
</view>
|
||
<view class="textarea-wrap moment-textarea-wrap">
|
||
<textarea
|
||
class="textarea moment-textarea"
|
||
maxlength="5000"
|
||
placeholder="这一刻的想法…"
|
||
value="{{content}}"
|
||
bindinput="onContentInput"
|
||
disabled="{{auditMode}}"
|
||
auto-height
|
||
show-confirm-bar="{{false}}"
|
||
></textarea>
|
||
</view>
|
||
|
||
<view class="moment-photo-grid">
|
||
<view wx:for="{{bodyImages}}" wx:key="id" class="moment-photo-cell">
|
||
<image wx:if="{{item.url}}" class="moment-photo-img" mode="aspectFill" src="{{item.url}}" />
|
||
<view wx:if="{{item.uploading}}" class="moment-photo-mask">上传中…</view>
|
||
<text class="moment-photo-remove" data-id="{{item.id}}" catchtap="removeArticleImage">×</text>
|
||
</view>
|
||
<view wx:if="{{bodyImages.length < 9}}" class="moment-photo-cell moment-photo-add" bindtap="chooseArticleImages">
|
||
<text class="moment-photo-add-plus">+</text>
|
||
</view>
|
||
</view>
|
||
<text class="hint moment-hint">配图 {{bodyImages.length}}/9 · 展示在文字下方 · 单张建议不超 30MB · 可直接输入 @昵称 或 #链接(https://xxx)</text>
|
||
</view>
|
||
|
||
<!-- 底部发布(避让微信胶囊) -->
|
||
<view wx:if="{{!auditMode}}" class="bottom-publish-bar">
|
||
<view class="bottom-publish-btn {{saving ? 'bottom-publish-btn-disabled' : ''}}" bindtap="submitArticle">
|
||
<text>{{saving ? (editArticleId ? '提交中…' : '发布中…') : (editArticleId ? '提交审核' : '发布')}}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view wx:if="{{auditMode}}" class="audit-mode-mask" catchtouchmove="preventMove">
|
||
<text class="audit-mode-text">开发中...</text>
|
||
</view>
|
||
</view>
|