crud.wxml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <import src="../../../common/head.wxml" />
  2. <import src="../../../common/foot.wxml" />
  3. <view class="container page" data-weui-theme="{{theme}}">
  4. <template is="head" data="{{title: 'CRUD'}}" />
  5. <view class="page-body">
  6. <view class="page-section">
  7. <view class="weui-cells weui-cells_after-title">
  8. <view class="weui-cell weui-cell_input">
  9. <view class="weui-cell__hd" style="margin-right: 5px">
  10. <icon type="search" size="20"></icon>
  11. </view>
  12. <view class="weui-cell__bd">
  13. <input class="weui-input" placeholder="精确搜索或使用正则表达式搜索" value="{{searchContent}}" bindinput="onInputSearchContent" bindconfirm="searchTodo"/>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="weui-cells__title">Todo List</view>
  18. <view class="weui-cells weui-cells_after-title" wx:if="{{openid}}">
  19. <view wx:for="{{todoList}}" wx:key="_id" class="weui-cell weui-cell_access" hover-class="weui-cell_active" data-id="{{item._id}}" bindtap="toDetail">
  20. <view class="weui-cell__hd" data-id="{{item._id}}" data-index="{{index}}" catchtap="toggleComplete" style="margin-right: 5px">
  21. <icon type="circle" wx:if="{{!item.done}}"></icon>
  22. <icon type="success" wx:else></icon>
  23. </view>
  24. <view class="weui-cell__bd">{{item.description}}</view>
  25. <view class="weui-cell__ft weui-cell__ft_in-access"></view>
  26. </view>
  27. <view class="weui-cell weui-cell_input" wx:if="{{todoList.length < 5 && !filtered}}">
  28. <view class="weui-cell__bd">
  29. <input class="weui-input" placeholder="添加新的 Todo" value="{{newContent}}" focus="{{todoListFetched && !todoList.length}}" bindinput="onInputNewContent" bindconfirm="createTodo" />
  30. </view>
  31. </view>
  32. </view>
  33. <view class="page-body-info" wx:if="{{!todoList.length && filtered}}">
  34. <text class="page-body-text">无数据</text>
  35. </view>
  36. </view>
  37. </view>
  38. <template is="foot" />
  39. </view>