notice-article.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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. userId:0,
  60. listQuery: {
  61. source: 2,
  62. commonId: 0,
  63. messageType: 0,
  64. pageNum: 1,
  65. pageSize: 10
  66. },
  67. list: [
  68. {
  69. id: 1,
  70. time: '16546464',
  71. content: 'abnwahdowadjhwadojw',
  72. link: 'https://www.caimei365.com/info/detail-7880-1.html'
  73. },
  74. {
  75. id: 1,
  76. time: '16546464',
  77. content: 'abnwahdowadjhwadojw'
  78. }
  79. ],
  80. isEmpty: false,
  81. loadding: false,
  82. pullUpOn: true,
  83. pullFlag: true,
  84. hasNextPage: false,
  85. nomoreText: '上拉显示更多'
  86. }
  87. },
  88. onLoad(option) {
  89. this.initData(option)
  90. },
  91. methods: {
  92. async initData(option) {
  93. const userInfo = await this.$api.getStorage()
  94. this.listQuery.messageType = option.messageType
  95. this.userId = userInfo.userId ? userInfo.userId : 0
  96. this.listQuery.commonId = userInfo.clubId ? userInfo.clubId : 0
  97. this.getUserAuthClubMessageList()
  98. },
  99. handleOrderClick(cell) {
  100. const link = `${
  101. process.env.NODE_ENV === 'development' ? 'http://120.79.25.27:8009' : 'https://www.caimei365.com'
  102. }/info/detail-${cell.thisId}-1.html`
  103. console.log(link)
  104. uni.navigateTo({
  105. url: `/pages/h5/article/path?link=${link}`
  106. })
  107. }
  108. },
  109. onReachBottom() {
  110. if (this.hasNextPage) {
  111. this.loadding = true
  112. this.pullUpOn = true
  113. this.getReachBottomData()
  114. }
  115. },
  116. onPullDownRefresh() {
  117. //下拉刷新
  118. this.listQuery.pageNum = 1
  119. this.getUserAuthClubMessageList()
  120. uni.stopPullDownRefresh()
  121. },
  122. onShow() {}
  123. }
  124. </script>
  125. <style lang="scss">
  126. page {
  127. background-color: #f7f7f7;
  128. }
  129. .container-main {
  130. width: 100%;
  131. box-sizing: border-box;
  132. padding: 24rpx 0;
  133. .empty-container-image {
  134. width: 260rpx;
  135. height: 260rpx;
  136. margin-top: -300rpx;
  137. }
  138. }
  139. .tui-notice {
  140. margin-bottom: 24rpx;
  141. }
  142. .tui-notice-cell {
  143. width: 702rpx;
  144. height: auto;
  145. background-color: #ffffff;
  146. border-radius: 16rpx;
  147. box-sizing: border-box;
  148. padding: 16rpx 24rpx;
  149. margin: 0 auto;
  150. .tui-cell-top {
  151. width: 100%;
  152. height: 88rpx;
  153. line-height: 88rpx;
  154. .cell-title {
  155. font-size: 32rpx;
  156. color: #333333;
  157. float: left;
  158. font-weight: bold;
  159. }
  160. .cell-time {
  161. font-size: 24rpx;
  162. color: #999999;
  163. float: right;
  164. }
  165. }
  166. .tui-cell-content {
  167. width: 100%;
  168. height: 160rpx;
  169. box-sizing: border-box;
  170. padding: 16rpx;
  171. border-radius: 8rpx;
  172. background-color: #f7f7f7;
  173. .cell-image {
  174. width: 128rpx;
  175. height: 128rpx;
  176. border-radius: 8rpx;
  177. float: left;
  178. image {
  179. width: 128rpx;
  180. height: 128rpx;
  181. display: block;
  182. border-radius: 8rpx;
  183. }
  184. }
  185. .cell-content {
  186. width: 490rpx;
  187. height: 100%;
  188. box-sizing: border-box;
  189. padding: 0 20rpx;
  190. line-height: 42rpx;
  191. font-size: 28rpx;
  192. color: #666666;
  193. text-align: justify;
  194. float: left;
  195. text-overflow: ellipsis;
  196. display: -webkit-box;
  197. word-break: break-all;
  198. -webkit-box-orient: vertical;
  199. -webkit-line-clamp: 3;
  200. overflow: hidden;
  201. }
  202. }
  203. .tui-cell-bot {
  204. width: 100%;
  205. height: 80rpx;
  206. box-sizing: border-box;
  207. padding: 16rpx 0 0 0;
  208. .tui-cell-btn {
  209. width: 160rpx;
  210. height: 64rpx;
  211. border-radius: 35rpx;
  212. box-sizing: border-box;
  213. border: 1px solid #999999;
  214. text-align: center;
  215. line-height: 64rpx;
  216. font-size: 26rpx;
  217. color: #333333;
  218. float: right;
  219. margin-left: 24rpx;
  220. }
  221. }
  222. }
  223. .tui-custom-btn_box {
  224. width: 80px;
  225. height: 100%;
  226. padding: 0 20rpx;
  227. box-sizing: border-box;
  228. display: flex;
  229. align-items: center;
  230. justify-content: center;
  231. background-color: #f7f7f7;
  232. }
  233. .tui-custom-btn {
  234. width: 56rpx;
  235. height: 56rpx;
  236. border-radius: 50%;
  237. background-color: #f94b4b;
  238. color: #ffffff;
  239. display: flex;
  240. align-items: center;
  241. justify-content: center;
  242. flex-shrink: 0;
  243. .icon-shanchu3 {
  244. font-size: 32rpx;
  245. }
  246. }
  247. </style>