active.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <template>
  2. <view class="active">
  3. <view class="list" v-if="list.length>0">
  4. <view class="list-item" @click="detail(item.id)" v-for="(item,index) in list" :key="index">
  5. <view class="tips" v-if="item.type!=null">
  6. {{item.type}}
  7. </view>
  8. <image :src="item.cover!='path' ? item.cover: '../../static/images/active.png'" mode="">
  9. </image>
  10. <view class="right">
  11. <view class="title">
  12. {{item.title == null?'--':item.title}}
  13. </view>
  14. <view class="text">
  15. <text>主持人:{{item.compere == null?'--': item.compere}}</text>
  16. <!-- <text>参与者:{{item.participant}}</text> -->
  17. </view>
  18. <!-- <view class="address">
  19. 活动地址:{{item.address}}
  20. </view> -->
  21. <view class="time">
  22. 活动日期:{{item.day == null?'--': item.day}}
  23. </view>
  24. </view>
  25. <view class="files" @click.stop="tofile(item.id)">
  26. 附件
  27. </view>
  28. </view>
  29. </view>
  30. <view class="empty" v-else>
  31. <image src="../../static/images/pass.png" mode="widthFix"></image>
  32. <view class="empty-text">
  33. 暂无活动
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. var app = getApp()
  40. export default {
  41. data() {
  42. return {
  43. current_tab: 0,
  44. list: [],
  45. page: 1,
  46. last: false
  47. }
  48. },
  49. async onLoad() {
  50. // if (this.is_weixin()) {
  51. // this.navTitle()
  52. // }
  53. this.page = 1
  54. this.list = []
  55. this.last = false
  56. this.getList()
  57. },
  58. onReachBottom() {
  59. if (!this.last) {
  60. this.page++
  61. }
  62. console.log(this.page)
  63. this.getList()
  64. },
  65. methods: {
  66. getList() {
  67. let params = {
  68. category_id: this.current_tab ,
  69. page: this.page
  70. }
  71. app.request('/organization-activity', params, 'get').then(res => {
  72. console.log(res, 'ppp')
  73. let data = res.data.data.data
  74. console.log(res, 'course1')
  75. if (this.page > 1 && data.length == 0) {
  76. uni.showToast({
  77. title: '暂无更多',
  78. icon: 'none'
  79. })
  80. this.last = true
  81. } else {
  82. this.list = this.list.concat(data)
  83. }
  84. })
  85. },
  86. detail(id) {
  87. console.log('详情')
  88. uni.navigateTo({
  89. url: './details?id=' + id
  90. })
  91. },
  92. tofile(id){
  93. uni.navigateTo({
  94. url: './files?id=' + id
  95. })
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. page {
  102. position: relative;
  103. background-color: rgba(238, 238, 238, 1);
  104. }
  105. .add {
  106. position: fixed;
  107. bottom: 75px;
  108. right: 15px;
  109. text-align: center;
  110. z-index: 6;
  111. .add-buttom {
  112. width: 36px;
  113. height: 36px;
  114. background: #6A6A6A;
  115. display: inline-block;
  116. text-align: center;
  117. line-height: 36px;
  118. opacity: 1;
  119. border-radius: 50%;
  120. }
  121. .add-tips {
  122. font-size: 10px;
  123. font-family: PingFang SC;
  124. font-weight: bold;
  125. line-height: 14px;
  126. color: #292929;
  127. opacity: 1;
  128. margin-top: 3px;
  129. }
  130. }
  131. .active {
  132. position: relative;
  133. overflow: hidden;
  134. height: 100%;
  135. .tab {
  136. display: flex;
  137. align-items: center;
  138. width: 80%;
  139. margin: 0 auto;
  140. .item,
  141. .active-item {
  142. margin-top: 17px;
  143. view {
  144. display: block;
  145. }
  146. font-size: 18px;
  147. font-family: PingFang SC;
  148. font-weight: bold;
  149. line-height: 20px;
  150. color: rgba(113, 113, 113, .43);
  151. opacity: 0.43;
  152. opacity: 1;
  153. flex: 1;
  154. text-align: center;
  155. .week {
  156. padding-bottom: 12px;
  157. }
  158. .line {
  159. width: 48px;
  160. height: 4px;
  161. background: #3B7653;
  162. opacity: 1;
  163. border-radius: 1px;
  164. display: block;
  165. margin: 0 auto;
  166. }
  167. }
  168. .active-item {
  169. font-size: 18px;
  170. font-family: PingFang SC;
  171. font-weight: bold;
  172. line-height: 20px;
  173. color: #3B7653;
  174. .week {
  175. padding-bottom: 8px;
  176. }
  177. }
  178. }
  179. .list {
  180. padding: 15px;
  181. .list-item {
  182. background: #fff;
  183. opacity: 1;
  184. border-radius: 12px;
  185. padding: 15px 15px;
  186. position: relative;
  187. display: flex;
  188. align-items: center;
  189. margin-bottom: 10px;
  190. overflow: hidden;
  191. .tips {
  192. position: absolute;
  193. width: 62px;
  194. height: 21px;
  195. text-align: center;
  196. line-height: 21px;
  197. background: rgba($color: red, $alpha: 0.6);
  198. top: 0;
  199. right: 0;
  200. opacity: 1;
  201. border-radius: 0px 12px 0px 12px;
  202. font-size: 12px;
  203. font-family: PingFang SC;
  204. color: #fff;
  205. }
  206. image {
  207. flex: 0 0 65px;
  208. width: 65px;
  209. height: 60px;
  210. margin-right: 6px;
  211. }
  212. .right {
  213. flex: 1;
  214. padding-left: 5px;
  215. width: calc(100% - 150px);
  216. .title {
  217. font-size: 16px;
  218. font-family: PingFang SC;
  219. font-weight: bold;
  220. line-height: 20px;
  221. color: #282828;
  222. opacity: 1;
  223. white-space: nowrap;
  224. /*设置不换行*/
  225. overflow: hidden;
  226. /*设置隐藏*/
  227. text-overflow: ellipsis;
  228. /*设置隐藏部分为省略号*/
  229. }
  230. .text {
  231. font-size: 13px;
  232. font-family: PingFang SC;
  233. font-weight: 400;
  234. line-height: 20px;
  235. color: rgba(40, 40, 40, .47);
  236. margin-top: 3px;
  237. width: 230px;
  238. display: flex;
  239. text{
  240. display: block;
  241. width: 115px;
  242. white-space: nowrap;
  243. /*设置不换行*/
  244. overflow: hidden;
  245. /*设置隐藏*/
  246. text-overflow: ellipsis;
  247. /*设置隐藏部分为省略号*/
  248. }
  249. }
  250. .address{
  251. font-size: 13px;
  252. font-family: PingFang SC;
  253. font-weight: 400;
  254. line-height: 20px;
  255. color: rgba(40, 40, 40, .47);
  256. margin-top: 3px;
  257. width: 230px;
  258. }
  259. .time {
  260. font-size: 10px;
  261. font-family: PingFang SC;
  262. font-weight: 400;
  263. line-height: 20px;
  264. color: rgba(40, 40, 40, .47);
  265. width: 230px;
  266. white-space: nowrap;
  267. /*设置不换行*/
  268. overflow: hidden;
  269. /*设置隐藏*/
  270. text-overflow: ellipsis;
  271. /*设置隐藏部分为省略号*/
  272. }
  273. }
  274. .files{
  275. color: #E65538;
  276. }
  277. }
  278. }
  279. .empty{
  280. width: 100%;
  281. height: 100vh;
  282. display: flex;
  283. flex-direction: column;
  284. align-items: center;
  285. justify-content: center;
  286. image{
  287. width: 150px;
  288. }
  289. }
  290. }
  291. </style>