notice-article.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <view class="container cart clearfix">
  3. <tui-skeleton
  4. v-if="skeletonShow"
  5. backgroundColor="#fafafa"
  6. borderRadius="10rpx"
  7. :isLoading="true"
  8. :loadingType="5"
  9. ></tui-skeleton>
  10. <view class="container-main" v-else>
  11. <view class="clearfix">
  12. <!-- 空白页 -->
  13. <view class="empty-container" v-if="isEmpty">
  14. <image class="empty-container-image" :src="StaticUrl + '/icon/icon-notice-empty@2x.png'"></image>
  15. <text class="error-text">暂无任何消息~</text>
  16. </view>
  17. <!-- 列表 -->
  18. <view
  19. class="tui-notice"
  20. v-else
  21. v-for="(cell, index) in list"
  22. :key="index"
  23. @click.stop="handleOrderClick(cell)"
  24. >
  25. <tui-swipe-action :operateWidth="80" :backgroundColor="'#F7F7F7'">
  26. <template v-slot:content>
  27. <notice-cell :cellType="5" :cell="cell"></notice-cell>
  28. </template>
  29. <template v-slot:button>
  30. <view class="tui-custom-btn_box">
  31. <view class="tui-custom-btn" @click.stop="deleteBtn(cell.id, index)">
  32. <text class="iconfont icon-shanchu3"></text>
  33. </view>
  34. </view>
  35. </template>
  36. </tui-swipe-action>
  37. </view>
  38. <!--加载loadding-->
  39. <tui-loadmore :visible="loadding" :index="3" type="black" />
  40. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText" />
  41. <!--加载loadding-->
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import { mapState, mapMutations } from 'vuex'
  48. import noticeMixins from './mixins/notice.mixins.js'
  49. import noticeCell from './components/notice-cell.vue'
  50. export default {
  51. mixins: [noticeMixins],
  52. components: {
  53. noticeCell
  54. },
  55. data() {
  56. return {
  57. skeletonShow: true,
  58. StaticUrl: this.$Static,
  59. listQuery: {
  60. source: 2,
  61. commonId: 0,
  62. messageType: 0,
  63. pageNum: 1,
  64. pageSize: 10
  65. },
  66. list: [
  67. {
  68. id: 1,
  69. time: '16546464',
  70. articleContent: 'abnwahdowadjhwadojw',
  71. link: 'https://www.caimei365.com/info/detail-7880-1.html'
  72. },
  73. {
  74. id: 1,
  75. time: '16546464',
  76. articleContent: 'abnwahdowadjhwadojw'
  77. }
  78. ],
  79. isEmpty: false,
  80. loadding: false,
  81. pullUpOn: true,
  82. pullFlag: true,
  83. hasNextPage: false,
  84. nomoreText: '上拉显示更多'
  85. }
  86. },
  87. onLoad(option) {
  88. this.initData(option)
  89. },
  90. methods: {
  91. async initData(option) {
  92. console.log(123324234)
  93. const userInfo = await this.$api.getStorage()
  94. this.listQuery.messageType = option.messageType
  95. this.listQuery.commonId = userInfo.clubId ? userInfo.clubId : 0
  96. this.getUserAuthClubMessageList()
  97. },
  98. handleOrderClick(cell) {
  99. this.$api.navigateTo(`/pages/h5/article/path?link=${cell.link}`)
  100. },
  101. },
  102. onReachBottom() {
  103. if (this.hasNextPage) {
  104. this.loadding = true
  105. this.pullUpOn = true
  106. this.getReachBottomData()
  107. }
  108. },
  109. onPullDownRefresh() {
  110. //下拉刷新
  111. this.listQuery.pageNum = 1
  112. this.getUserAuthClubMessageList()
  113. uni.stopPullDownRefresh()
  114. },
  115. onShow() {}
  116. }
  117. </script>
  118. <style lang="scss">
  119. page {
  120. background-color: #f7f7f7;
  121. }
  122. .container-main {
  123. width: 100%;
  124. box-sizing: border-box;
  125. padding: 24rpx 0;
  126. .empty-container-image {
  127. width: 260rpx;
  128. height: 260rpx;
  129. margin-top: -300rpx;
  130. }
  131. }
  132. .tui-notice {
  133. margin-bottom: 24rpx;
  134. }
  135. .tui-notice-cell {
  136. width: 702rpx;
  137. height: auto;
  138. background-color: #ffffff;
  139. border-radius: 16rpx;
  140. box-sizing: border-box;
  141. padding: 16rpx 24rpx;
  142. margin: 0 auto;
  143. .tui-cell-top {
  144. width: 100%;
  145. height: 88rpx;
  146. line-height: 88rpx;
  147. .cell-title {
  148. font-size: 32rpx;
  149. color: #333333;
  150. float: left;
  151. font-weight: bold;
  152. }
  153. .cell-time {
  154. font-size: 24rpx;
  155. color: #999999;
  156. float: right;
  157. }
  158. }
  159. .tui-cell-content {
  160. width: 100%;
  161. height: 160rpx;
  162. box-sizing: border-box;
  163. padding: 16rpx;
  164. border-radius: 8rpx;
  165. background-color: #f7f7f7;
  166. .cell-image {
  167. width: 128rpx;
  168. height: 128rpx;
  169. border-radius: 8rpx;
  170. float: left;
  171. image {
  172. width: 128rpx;
  173. height: 128rpx;
  174. display: block;
  175. border-radius: 8rpx;
  176. }
  177. }
  178. .cell-content {
  179. width: 490rpx;
  180. height: 100%;
  181. box-sizing: border-box;
  182. padding: 0 20rpx;
  183. line-height: 40rpx;
  184. font-size: 28rpx;
  185. color: #666666;
  186. text-align: justify;
  187. float: left;
  188. }
  189. }
  190. .tui-cell-bot {
  191. width: 100%;
  192. height: 80rpx;
  193. box-sizing: border-box;
  194. padding: 16rpx 0 0 0;
  195. .tui-cell-btn {
  196. width: 160rpx;
  197. height: 64rpx;
  198. border-radius: 35rpx;
  199. box-sizing: border-box;
  200. border: 1px solid #999999;
  201. text-align: center;
  202. line-height: 64rpx;
  203. font-size: 26rpx;
  204. color: #333333;
  205. float: right;
  206. margin-left: 24rpx;
  207. }
  208. }
  209. }
  210. .tui-custom-btn_box {
  211. width: 80px;
  212. height: 100%;
  213. padding: 0 20rpx;
  214. box-sizing: border-box;
  215. display: flex;
  216. align-items: center;
  217. justify-content: center;
  218. background-color: #f7f7f7;
  219. }
  220. .tui-custom-btn {
  221. width: 56rpx;
  222. height: 56rpx;
  223. border-radius: 50%;
  224. background-color: #f94b4b;
  225. color: #ffffff;
  226. display: flex;
  227. align-items: center;
  228. justify-content: center;
  229. flex-shrink: 0;
  230. .icon-shanchu3 {
  231. font-size: 32rpx;
  232. }
  233. }
  234. </style>