news.wxml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <gracePage headerBG="#FFFFFF" >
  2. <view slot="gHeader" style="padding:0 25rpx;">
  3. <graceNavBar items="{{tabs}}" currentIndex="{{currentIndex}}" bindchange="navChange"></graceNavBar>
  4. </view>
  5. <view slot="gBody" class="grace-flex-v1" id="gBody">
  6. <swiper style="height:{{mainHeight+'px'}}" current="{{currentIndex}}" bindchange="swiperChange">
  7. <swiper-item wx:for="{{newsAll}}" wx:for-item="news" wx:for-index="newsIndex" wx:key="newsIndex">
  8. <scroll-view scroll-y="true" style="height:{{mainHeight+'px'}}; position:relative;"
  9. bindscrolltolower="scrollend" bindscroll="scroll" scroll-anchoring="{{true}}"
  10. bindtouchstart="touchstart" bindtouchmove="touchmove" bindtouchend="touchend">
  11. <view>
  12. <graceReload id="{{'graceReload'+newsIndex}}" bind:reload="reload" width="700rpx" marginLeft="25rpx"></graceReload>
  13. </view>
  14. <graceEmpty wx:if="{{news == 'empty'}}">
  15. <view slot="img" class="empty-view">
  16. <!-- 请根据您的项目要求制作并更换为空图片 -->
  17. <image class="empty-img" mode="widthFix" src="https://staticimgs.oss-cn-beijing.aliyuncs.com/empty.png"></image>
  18. </view>
  19. <text slot="text" class="grace-text-small grace-gray">本栏目暂无新闻</text>
  20. </graceEmpty>
  21. <view style="padding:0 25rpx;">
  22. <block wx:for="{{news}}" wx:key="index" wx:if="{{news != 'empty'}}">
  23. <view class="grace-news-list grace-border-b" wx:if="{{item.imgs.length < 3}}" bindtap="newsinfo">
  24. <view class="grace-news-item">
  25. <view class="grace-news-img grace-news-img-l">
  26. <image src="{{item.imgs[0]}}" mode="widthFix" class="grace-news-img-in"></image>
  27. </view>
  28. <view class="grace-news-body">
  29. <text class="grace-news-title">{{item.title}}</text>
  30. <text class="grace-news-desc">{{item.desc}}</text>
  31. </view>
  32. </view>
  33. <view class="grace-news-info">
  34. <view style="width:500rpx;" class="grace-nowrap">
  35. <text class="grace-icons icon-eye grace-news-info-text"> {{item.viewnum}}</text>
  36. <text class="grace-icons icon-write grace-news-info-text" style="margin-left:30rpx;"> {{item.author}} · {{item.catename}}</text>
  37. </view>
  38. <text class="grace-icons icon-zan grace-news-info-text"> 208</text>
  39. </view>
  40. </view>
  41. <view class="grace-news-list grace-border-b" wx:if="{{item.imgs.length >= 3}}" bindtap="newsinfo">
  42. <text class="grace-news-title">{{item.title}}</text>
  43. <view class="grace-news-img-list">
  44. <view class="grace-news-imgs" wx:for="{{item.imgs}}" wx:for-item="img" wx:for-index="imgIndex" wx:key="imgIndex">
  45. <image src="{{img}}" mode="widthFix" class="grace-news-imgs-img"></image>
  46. </view>
  47. </view>
  48. <view class="grace-news-info">
  49. <view style="width:500rpx;" class="grace-nowrap">
  50. <text class="grace-icons icon-eye grace-news-info-text"> {{item.viewnum}}</text>
  51. <text class="grace-icons icon-write grace-news-info-text" style="margin-left:30rpx;"> {{item.author}} · {{item.catename}}</text>
  52. </view>
  53. <text class="grace-icons icon-zan grace-news-info-text"> 208</text>
  54. </view>
  55. </view>
  56. </block>
  57. </view>
  58. <graceLoading loadingType="{{loadingTypes[newsIndex]}}"></graceLoading>
  59. </scroll-view>
  60. </swiper-item>
  61. </swiper>
  62. </view>
  63. </gracePage>