notice-article.vue 7.2 KB

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