activityCenter.vue 4.4 KB

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