Files
past-go/weapp/pages/diary_edit/diary_edit.wxml
T

47 lines
2.2 KiB
Plaintext

<view class="app-shell app-shell--secondary" style="{{layoutStyle}}">
<launch-transition />
<app-nav title="编辑日记" back="{{true}}" />
<scroll-view class="page-bg" scroll-y show-scrollbar="{{false}}" style="height:100vh;">
<view class="container"><page-state wx:if="{{loading}}" kind="loading" title="正在加载日记" /><page-state wx:elif="{{loadError}}" kind="error" title="日记加载失败" action="重试" bind:action="loadDiary" /><block wx:else>
<!-- 标题 -->
<view class="input-group">
<label>标题(选填)</label>
<input placeholder-class="handwritten-placeholder" class="input diary-title-input" placeholder="给日记起个标题..." value="{{form.title}}" bindinput="onTitleInput" maxlength="100" />
</view>
<!-- 内容编辑器(支持换行) -->
<view class="input-group editor-group">
<view class="editor-header">
<label>内容</label>
<text class="char-count {{contentLength > 5000 ? 'char-warn' : ''}}">{{contentLength}}/5000</text>
</view>
<textarea placeholder-class="handwritten-placeholder" class="input textarea diary-editor" placeholder="想写些什么..." value="{{editorContent}}" bindinput="onContentInput" maxlength="5000" auto-height="{{true}}" cursor-spacing="24" />
</view>
<!-- 图片(可删除) -->
<view class="input-group">
<view class="editor-header">
<label>图片</label>
<text class="img-count">{{tempImages.length}}/9</text>
</view>
<view class="img-picker-row">
<view wx:for="{{tempImages}}" wx:key="*this" class="img-picker-wrap">
<image class="img-picker-thumb" src="{{item}}" mode="aspectFill" />
<view class="img-picker-del" bindtap="removeImage" data-index="{{index}}" hover-class="del-hover">
<text>✕</text>
</view>
</view>
<view class="img-picker-add" bindtap="chooseImages" wx:if="{{tempImages.length < 9}}">
<text class="add-icon">+</text>
<text class="add-text">添加图片</text>
</view>
</view>
</view>
<button class="btn btn-primary submit-btn" bindtap="submit" hover-class="none" loading="{{submitting}}">保存修改</button>
</block>
</view>
</scroll-view>
</view>