activityCenter.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <view>
  3. <u-navbar title="活动中心"></u-navbar>
  4. <view class="tabs" >
  5. <u-tabs bar-width="60" :bold="false" inactive-color="#B3B3B3" active-color="#333333" height="88"
  6. :list="tabList" :is-scroll="false" :current="current" @change="change"></u-tabs>
  7. </view>
  8. <view class="main">
  9. <view class="activity-item" v-for="(item,i) in list" :key="i" @click="ckItem(item)" >
  10. <view class="title">
  11. {{item.title}}
  12. <view class="have-used" v-if="item.status=='77d93870-e1e1-4369-b2b6-629e8645e8d9'" >
  13. <img src="../../../assets/img/overdue.png" alt="">
  14. </view>
  15. <view class="have-used" v-if="item.status=='eaab19ae-893f-40e7-b730-85a13af00137'" >
  16. <img src="../../../assets/img/overend.png" alt="">
  17. </view>
  18. </view>
  19. <view class="pictures">
  20. <img v-if="item.pic1" @click="previewImage(item.pic1)" :src="item.pic1" alt="">
  21. <img v-if="item.pic2" @click="previewImage(item.pic2)" :src="item.pic2" alt="">
  22. <img v-if="item.pic3" @click="previewImage(item.pic3)" :src="item.pic3" alt="">
  23. </view>
  24. <view class="introduce">
  25. {{item.synopsis}}
  26. </view>
  27. <view class="to-detail" >
  28. <view class="tag" >
  29. {{item.typeName}}
  30. </view>
  31. <view class="click">
  32. <text>点击查看活动详情</text>
  33. <text><u-icon name="arrow-right" color="#777777"></u-icon></text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
  39. <view class="bottom" v-if="false">
  40. <img src="../../../assets/img/riFill-camera-fill@2x.png">
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import * as API from '@/apis/pagejs/activity.js'
  46. import * as API_share from '@/apis/pagejs/share.js'
  47. export default {
  48. data() {
  49. return {
  50. listForm:{
  51. pageIndex:1,
  52. pageSize:20,
  53. },
  54. current: 0,
  55. list:[],
  56. recordsTotal:0,
  57. tabList: [],
  58. year:null,
  59. }
  60. },
  61. onLoad(op){
  62. if(op.year){
  63. this.year=op.year
  64. this.listForm.year=op.year
  65. }
  66. this.getList()
  67. this.dataList()
  68. },
  69. onReachBottom() {
  70. if (this.list.length < this.recordsTotal) {
  71. this.myLoadmore();
  72. }
  73. },
  74. methods: {
  75. dataList(){
  76. API_share.dataList("活动类型").then((res) => {
  77. this.tabList=[
  78. {
  79. id:'',
  80. name:'全部'
  81. },
  82. ...res.data
  83. ]
  84. }).catch(error => {
  85. })
  86. },
  87. previewImage(pic) {
  88. let imgs = [pic];
  89. uni.previewImage({
  90. indicator:"default",
  91. loop:true,
  92. urls: imgs,
  93. current: 0
  94. })
  95. },
  96. ckItem(item){
  97. var url="/pages/staffHome/activityCenter/activityDetail?id="+item.id;
  98. uni.navigateTo({
  99. url:url
  100. })
  101. },
  102. myLoadmore(){
  103. this.listForm.pageIndex += 1;
  104. this.getList();
  105. },
  106. change(index) {
  107. this.current = index;
  108. this.listForm.pageIndex = 1;
  109. this.listForm.typeId=this.tabList[index].id
  110. this.getList()
  111. },
  112. getList(){
  113. uni.showLoading({
  114. title: "加载中",
  115. mask: true,
  116. })
  117. API.pageList(this.listForm).then((res) => {
  118. uni.hideLoading();
  119. //this.list=response.data.data
  120. if(this.listForm.pageIndex==1){
  121. this.list = res.data.data;
  122. }else{
  123. this.list = [
  124. ...this.list,
  125. ...res.data.data
  126. ];
  127. }
  128. this.recordsTotal = res.data.recordsTotal;
  129. }).catch(error => {
  130. uni.showToast({
  131. title: error,
  132. icon: "none"
  133. })
  134. })
  135. },
  136. }
  137. }
  138. </script>
  139. <style lang="scss" scoped>
  140. .have-used{
  141. width: 64px;
  142. height: 0;
  143. position: relative;
  144. top: -30px;
  145. top: -36px;
  146. left: 520rpx;
  147. right: 0;
  148. img{
  149. width: 100%;
  150. //height: 100%;
  151. }
  152. }
  153. .main{
  154. margin:24rpx 32rpx;
  155. .activity-item{
  156. background-color: #fff;
  157. padding: 24rpx;
  158. border-radius: 8px;
  159. margin-bottom: 24rpx;
  160. .title{
  161. color: rgba(51, 51, 51, 1);
  162. font-size: 18px;
  163. font-family: 'Medium';
  164. }
  165. .pictures {
  166. display: flex;
  167. justify-content: space-between;
  168. margin-top: 16rpx;
  169. img {
  170. width: 31.4%;
  171. height: 150rpx;
  172. border-radius: 16rpx;
  173. }
  174. }
  175. .introduce{
  176. color: rgba(119, 119, 119, 1);
  177. line-height: 20px;
  178. margin-top: 16rpx;
  179. font-family: 'Regular';
  180. }
  181. }
  182. .to-detail{
  183. display: flex;
  184. justify-content: space-between;
  185. align-items: center;
  186. margin-top: 16rpx;
  187. padding-top: 36rpx;
  188. border-top: 1px solid #F4F6F6;
  189. .tag{
  190. border-radius: 4px;
  191. color: rgba(31, 74, 153, 1);
  192. font-size: 12px;
  193. text-align: center;
  194. border: 1px solid rgba(31, 74, 153, 1);
  195. line-height: 18px;
  196. padding: 0 17rpx;
  197. font-family: 'Medium';
  198. }
  199. .tag2{
  200. color: rgba(238, 49, 56, 1);
  201. border: 1px solid rgba(238, 49, 56, 1);
  202. }
  203. .click{
  204. color: rgba(119, 119, 119, 1);
  205. font-family: 'Regular';
  206. }
  207. }
  208. }
  209. .bottom{
  210. background: linear-gradient(223.81deg, rgba(0,90,217,1) 14.24%,rgba(0,52,148,1) 86.67%);
  211. width: 104rpx;
  212. height: 104rpx;
  213. border-radius: 50px;
  214. display: flex;
  215. justify-content: center;
  216. align-items: center;
  217. position: fixed;
  218. right: 72rpx;
  219. bottom: 72rpx;
  220. img{
  221. width: 56rpx;
  222. height: 56rpx;
  223. }
  224. }
  225. </style>