activityReward.vue 3.7 KB

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