118 lines
3.1 KiB
Plaintext
118 lines
3.1 KiB
Plaintext
<!--pages/main/journal-creater/index.wxml-->
|
|
<t-navbar title="新纪录">
|
|
<text slot="left" bindtap="cancel">取消</text>
|
|
</t-navbar>
|
|
<scroll-view
|
|
class="container"
|
|
type="custom"
|
|
scroll-y
|
|
show-scrollbar="{{false}}"
|
|
scroll-into-view="{{intoView}}"
|
|
>
|
|
<view class="content">
|
|
<view class="section">
|
|
<textarea
|
|
class="idea"
|
|
placeholder="这一刻的想法..."
|
|
model:value="{{idea}}"
|
|
/>
|
|
</view>
|
|
<view class="section type">
|
|
<text class="label">类型:</text>
|
|
<t-radio-group bind:change="onChangeType" default-value="NORMAL" borderless t-class="box">
|
|
<t-radio class="radio" block="{{false}}" label="日常" value="NORMAL" />
|
|
<t-radio class="radio" block="{{false}}" label="专拍" value="PORTFOLIO" />
|
|
</t-radio-group>
|
|
</view>
|
|
<view class="section time">
|
|
<text class="label">时间:</text>
|
|
<picker class="picker" mode="date" model:value="{{date}}">
|
|
<view class="picker">
|
|
{{date}}
|
|
</view>
|
|
</picker>
|
|
<picker class="picker" mode="time" model:value="{{time}}">
|
|
<view class="picker">
|
|
{{time}}
|
|
</view>
|
|
</picker>
|
|
</view>
|
|
<view class="section location">
|
|
<text class="label">位置:</text>
|
|
<text wx:if="{{location}}" bind:tap="chooseLocation">{{location.text}}</text>
|
|
<text wx:else bind:tap="chooseLocation">选择位置..</text>
|
|
</view>
|
|
<view class="section media">
|
|
<view class="gallery">
|
|
<block wx:for="{{mediaList}}" wx:key="index">
|
|
<view class="item">
|
|
<!-- 图片 -->
|
|
<image
|
|
wx:if="{{item.type === mediaItemTypeEnum.IMAGE}}"
|
|
src="{{item.path}}"
|
|
class="thumbnail"
|
|
mode="aspectFill"
|
|
bindtap="preview"
|
|
data-index="{{index}}"
|
|
></image>
|
|
<!-- 视频 -->
|
|
<view wx:if="{{item.type === mediaItemTypeEnum.VIDEO}}" class="video-container">
|
|
<image
|
|
src="{{item.thumbPath}}"
|
|
class="thumbnail"
|
|
mode="aspectFill"
|
|
bindtap="preview"
|
|
data-index="{{index}}"
|
|
></image>
|
|
<t-icon class="play-icon" name="play" />
|
|
</view>
|
|
<!-- 删除 -->
|
|
<t-icon
|
|
class="delete"
|
|
name="close"
|
|
bindtap="deleteMedia"
|
|
data-index="{{index}}"
|
|
data-new-media="{{true}}"
|
|
/>
|
|
</view>
|
|
</block>
|
|
<t-button
|
|
class="item add"
|
|
theme="primary"
|
|
plain="true"
|
|
disabled="{{isSubmitting}}"
|
|
bind:tap="addMedia"
|
|
>
|
|
<t-icon class="icon" name="add" />
|
|
</t-button>
|
|
</view>
|
|
</view>
|
|
<view wx:if="{{isSubmitting}}" class="uploading">
|
|
<progress
|
|
class="progress"
|
|
percent="{{uploadProgress}}"
|
|
stroke-width="6"
|
|
/>
|
|
<view class="text">
|
|
<view>{{uploaded}} / {{uploadTotal}}</view>
|
|
<view>{{uploadSpeed}}</view>
|
|
</view>
|
|
</view>
|
|
<view class="ctrl">
|
|
<t-button
|
|
class="clear"
|
|
theme="danger"
|
|
variant="outline"
|
|
disabled="{{isSubmitting}}"
|
|
bind:tap="clearMedia"
|
|
disabled="{{mediaList.length === 0}}"
|
|
>清空已选</t-button>
|
|
<t-button
|
|
class="submit"
|
|
theme="primary"
|
|
bind:tap="submit"
|
|
disabled="{{(!idea && mediaList.length === 0) || isSubmitting}}"
|
|
>提交</t-button>
|
|
</view>
|
|
</view>
|
|
</scroll-view> |