index.wxml 1.6 KB

123456789101112131415161718192021222324252627282930
  1. <!--components/emoji/emoji.wxml-->
  2. <view class="weui-emoji_area" style="height: {{height}}px; background-color: {{backgroundColor}}">
  3. <view
  4. class="weui-emotion_list {{hasSafeBottom ? 'weui-emoji_area__has-safe-bottom' : ''}}"
  5. style="padding-left: {{padding}}px; padding-right: {{padding}}px;"
  6. >
  7. <view hidden="{{!showHistory || history.length === 0}}">
  8. <view class="weui-emotion_head">最近使用</view>
  9. <block wx:for="{{history}}" wx:key="*this">
  10. <view class="weui-emotion_item" data-idx="{{item}}" bindtap="insertEmoji" style="margin-right: {{(index + 1) % perLine ? extraPadding : 0}}px">
  11. <view class="weui-icon_emotion {{emotions[item].style}}" style="background-image: url({{source}});"></view>
  12. </view>
  13. </block>
  14. </view>
  15. <!-- 图片32px,每个宽度40px -->
  16. <view class="weui-emotion_head" style="margin-top: 8px;">所有表情</view>
  17. <block wx:for="{{emotions}}" wx:key="*this">
  18. <view class="weui-emotion_item" data-idx="{{index}}" bindtap="insertEmoji" style="padding-right: {{(index + 1) % perLine ? extraPadding : 0}}px">
  19. <view class="weui-icon_emotion {{item.style}}" style="background-image: url({{source}});"></view>
  20. </view>
  21. </block>
  22. </view>
  23. <!--操作-->
  24. <view class="weui-emoji__operation">
  25. <view class="weui-emoji__operation__delete" bindtap="deleteEmoji" wx:if="{{showDel}}">
  26. <image src="./icon_emotion_del.png" class="weui-emotion_del_btn"></image>
  27. </view>
  28. <view class="weui-emoji__operation__send" bindtap="send" wx:if="{{showSend}}">发送</view>
  29. </view>
  30. </view>