59 lines
2.9 KiB
Plaintext
59 lines
2.9 KiB
Plaintext
<view class="container">
|
|
<view class="page-header">
|
|
<view class="page-title">模板管理</view>
|
|
<view class="page-subtitle">组织与复用模板内容</view>
|
|
</view>
|
|
<view class="card">
|
|
<view class="card-title">模板</view>
|
|
<view class="section-title">模板ID/分类</view>
|
|
<view class="row">
|
|
<input class="input" data-key="id" value="{{id}}" bindinput="onInput" />
|
|
<input class="input" data-key="category" value="{{category}}" bindinput="onInput" />
|
|
</view>
|
|
<view class="section-title">名称</view>
|
|
<input class="input" data-key="name" value="{{name}}" bindinput="onInput" />
|
|
<view class="section-title">内容</view>
|
|
<textarea class="textarea" data-key="content" value="{{content}}" bindinput="onInput"></textarea>
|
|
<view class="section-title">自定义JSON(可选)</view>
|
|
<textarea class="textarea" data-key="body_json" value="{{body_json}}" bindinput="onInput"></textarea>
|
|
<view class="row action-row">
|
|
<button class="btn btn-secondary" bindtap="list">列表</button>
|
|
<button class="btn btn-secondary" bindtap="detail">详情</button>
|
|
<button class="btn" bindtap="create">创建</button>
|
|
<button class="btn btn-secondary" bindtap="update">更新</button>
|
|
<button class="btn btn-danger" bindtap="remove">删除</button>
|
|
</view>
|
|
</view>
|
|
<view class="card result-card" wx:if="{{result}}">
|
|
<view class="result-header">
|
|
<view class="result-title">结果</view>
|
|
<view class="result-actions">
|
|
<view class="badge">原始数据</view>
|
|
<view class="result-toggle" wx:if="{{resultHasMore}}" bindtap="toggleResult">{{resultExpanded ? '收起' : '展开'}}</view>
|
|
</view>
|
|
</view>
|
|
<view class="result-hint">已为你保留完整响应</view>
|
|
<view wx:if="{{templateCards.length}}" class="list">
|
|
<view wx:for="{{templateCards}}" wx:for-index="idx" wx:key="idx" class="card card--inner list-item result-entity">
|
|
<view class="row" style="justify-content: space-between;">
|
|
<view class="module-title">{{item.name}}</view>
|
|
<view class="badge" wx:if="{{item.id}}">#{{item.id}}</view>
|
|
</view>
|
|
<view class="row meta-row">
|
|
<view class="meta-item" wx:if="{{item.category}}">分类:{{item.category}}</view>
|
|
</view>
|
|
<view class="subtle" wx:if="{{item.contentPreview}}">{{item.contentPreview}}</view>
|
|
</view>
|
|
</view>
|
|
<view wx:if="{{resultCards.length}}" class="list">
|
|
<view wx:for="{{resultCards}}" wx:key="label" class="card card--inner list-item">
|
|
<view class="row" style="justify-content: space-between;">
|
|
<view class="module-title">{{item.label}}</view>
|
|
<view class="badge">{{item.value}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="result {{resultExpanded ? 'result--expanded' : 'result--collapsed'}}">{{result}}</view>
|
|
</view>
|
|
</view>
|