activityCenter.vue 4.3 KB

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