activityCenter.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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">
  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" @click="ckItem(item)" >
  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. }
  59. },
  60. onLoad(op){
  61. this.getList()
  62. this.dataList()
  63. },
  64. onReachBottom() {
  65. if (this.list.length < this.recordsTotal) {
  66. this.myLoadmore();
  67. }
  68. },
  69. methods: {
  70. dataList(){
  71. API_share.dataList("活动类型").then((res) => {
  72. this.tabList=[
  73. {
  74. id:'',
  75. name:'全部'
  76. },
  77. ...res.data
  78. ]
  79. }).catch(error => {
  80. })
  81. },
  82. previewImage(pic) {
  83. let imgs = [pic];
  84. uni.previewImage({
  85. indicator:"default",
  86. loop:true,
  87. urls: imgs,
  88. current: 0
  89. })
  90. },
  91. ckItem(item){
  92. var url="/pages/staffHome/activityCenter/activityDetail?id="+item.id;
  93. uni.navigateTo({
  94. url:url
  95. })
  96. },
  97. myLoadmore(){
  98. this.listForm.pageIndex += 1;
  99. this.getList();
  100. },
  101. change(index) {
  102. this.current = index;
  103. this.listForm.pageIndex = 1;
  104. this.listForm.typeId=this.tabList[index].id
  105. this.getList()
  106. },
  107. getList(){
  108. uni.showLoading({
  109. title: "加载中",
  110. mask: true,
  111. })
  112. API.pageList(this.listForm).then((res) => {
  113. uni.hideLoading();
  114. //this.list=response.data.data
  115. if(this.listForm.pageIndex==1){
  116. this.list = res.data.data;
  117. }else{
  118. this.list = [
  119. ...this.list,
  120. ...res.data.data
  121. ];
  122. }
  123. this.recordsTotal = res.data.recordsTotal;
  124. }).catch(error => {
  125. uni.showToast({
  126. title: error,
  127. icon: "none"
  128. })
  129. })
  130. },
  131. }
  132. }
  133. </script>
  134. <style lang="scss" scoped>
  135. .have-used{
  136. width: 64px;
  137. height: 0;
  138. position: relative;
  139. top: -30px;
  140. top: -36px;
  141. left: 520rpx;
  142. right: 0;
  143. img{
  144. width: 100%;
  145. //height: 100%;
  146. }
  147. }
  148. .main{
  149. margin:24rpx 32rpx;
  150. .activity-item{
  151. background-color: #fff;
  152. padding: 24rpx;
  153. border-radius: 8px;
  154. margin-bottom: 24rpx;
  155. .title{
  156. color: rgba(51, 51, 51, 1);
  157. font-size: 18px;
  158. font-family: 'Medium';
  159. }
  160. .pictures {
  161. display: flex;
  162. justify-content: space-between;
  163. margin-top: 16rpx;
  164. img {
  165. width: 31.4%;
  166. height: 150rpx;
  167. border-radius: 16rpx;
  168. }
  169. }
  170. .introduce{
  171. color: rgba(119, 119, 119, 1);
  172. line-height: 20px;
  173. margin-top: 16rpx;
  174. font-family: 'Regular';
  175. }
  176. }
  177. .to-detail{
  178. display: flex;
  179. justify-content: space-between;
  180. align-items: center;
  181. margin-top: 16rpx;
  182. padding-top: 36rpx;
  183. border-top: 1px solid #F4F6F6;
  184. .tag{
  185. border-radius: 4px;
  186. color: rgba(31, 74, 153, 1);
  187. font-size: 12px;
  188. text-align: center;
  189. border: 1px solid rgba(31, 74, 153, 1);
  190. line-height: 18px;
  191. padding: 0 17rpx;
  192. font-family: 'Medium';
  193. }
  194. .tag2{
  195. color: rgba(238, 49, 56, 1);
  196. border: 1px solid rgba(238, 49, 56, 1);
  197. }
  198. .click{
  199. color: rgba(119, 119, 119, 1);
  200. font-family: 'Regular';
  201. }
  202. }
  203. }
  204. .bottom{
  205. background: linear-gradient(223.81deg, rgba(0,90,217,1) 14.24%,rgba(0,52,148,1) 86.67%);
  206. width: 104rpx;
  207. height: 104rpx;
  208. border-radius: 50px;
  209. display: flex;
  210. justify-content: center;
  211. align-items: center;
  212. position: fixed;
  213. right: 72rpx;
  214. bottom: 72rpx;
  215. img{
  216. width: 56rpx;
  217. height: 56rpx;
  218. }
  219. }
  220. </style>