book-min/miniprogram/pages/bookshelf/add.wxml

100 lines
2.9 KiB
Plaintext
Raw Normal View History

2024-12-18 16:15:08 +08:00
<view class="add-book">
<form>
<view class="form-item">
<text class="label">ISBN</text>
<input class="input"
placeholder="请输入ISBN"
value="{{form.isbn}}"
data-field="isbn"
bindinput="onInput"/>
</view>
<view class="form-item">
<text class="label">书名*</text>
<input class="input"
placeholder="请输入书名"
value="{{form.title}}"
data-field="title"
bindinput="onInput"/>
</view>
<view class="form-item">
<text class="label">作者*</text>
<input class="input"
placeholder="请输入作者"
value="{{form.author}}"
data-field="author"
bindinput="onInput"/>
</view>
<view class="form-item">
<text class="label">出版社</text>
<input class="input"
placeholder="请输入出版社"
value="{{form.publisher}}"
data-field="publisher"
bindinput="onInput"/>
</view>
<view class="form-item">
<text class="label">简介</text>
<textarea class="textarea"
placeholder="请输入简介"
value="{{form.description}}"
data-field="description"
bindinput="onInput"/>
</view>
<view class="form-item">
<text class="label">分类</text>
<picker mode="selector"
range="{{categories}}"
bindchange="onCategoryChange">
<view class="picker">
{{form.category || '请选择分类'}}
</view>
</picker>
</view>
<view class="form-item">
<text class="label">标签</text>
<input class="input"
placeholder="请输入标签,多个用逗号分隔"
value="{{form.tags}}"
data-field="tags"
bindinput="onInput"/>
</view>
<view class="form-item">
<text class="label">出版日期</text>
<picker mode="date"
bindchange="onDateChange">
<view class="picker">
{{form.publishDate || '请选择日期'}}
</view>
</picker>
</view>
<view class="form-item">
<text class="label">封面*</text>
<view class="upload-box" bindtap="uploadCover">
<image wx:if="{{form.coverUrl}}"
src="{{form.coverUrl}}"
mode="aspectFill"
class="preview"/>
<view wx:else class="upload-btn">上传封面</view>
</view>
</view>
<view class="form-item">
<text class="label">电子书*</text>
<view class="upload-box" bindtap="uploadBook">
<view class="{{form.bookUrl ? 'file-name' : 'upload-btn'}}">
{{form.bookUrl ? '已选择文件' : '上传TXT文件'}}
</view>
</view>
</view>
<button class="submit-btn" bindtap="submitForm">提交</button>
</form>
</view>