activityReward.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. 活动
  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. this.getList()
  45. },
  46. onReachBottom() {
  47. if (this.list.length < this.recordsTotal) {
  48. this.myLoadmore();
  49. }
  50. },
  51. methods: {
  52. previewImage(pic) {
  53. let imgs = [pic];
  54. uni.previewImage({
  55. indicator:"default",
  56. loop:true,
  57. urls: imgs,
  58. current: i
  59. })
  60. },
  61. ckItem(item){
  62. var url="/pages/staffHome/activityReward/rewardDetail?id="+item.id;
  63. uni.navigateTo({
  64. url:url
  65. })
  66. },
  67. myLoadmore(){
  68. this.listForm.pageIndex += 1;
  69. this.getList();
  70. },
  71. getList(){
  72. uni.showLoading({
  73. title: "加载中",
  74. mask: true,
  75. })
  76. API.pageList(this.listForm).then((res) => {
  77. uni.hideLoading();
  78. //this.list=response.data.data
  79. if(this.listForm.pageIndex==1){
  80. this.list = res.data.data;
  81. }else{
  82. this.list = [
  83. ...this.list,
  84. ...res.data.data
  85. ];
  86. }
  87. this.recordsTotal = res.data.recordsTotal;
  88. }).catch(error => {
  89. uni.showToast({
  90. title: error,
  91. icon: "none"
  92. })
  93. })
  94. },
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. .bottom{
  100. background: linear-gradient(223.81deg, rgba(0,90,217,1) 14.24%,rgba(0,52,148,1) 86.67%);
  101. width: 104rpx;
  102. height: 104rpx;
  103. border-radius: 50px;
  104. display: flex;
  105. justify-content: center;
  106. align-items: center;
  107. position: fixed;
  108. right: 72rpx;
  109. bottom: 72rpx;
  110. img{
  111. width: 56rpx;
  112. height: 56rpx;
  113. }
  114. }
  115. .main{
  116. padding: 24rpx 32rpx 0 32rpx;
  117. .reward-detail{
  118. background-color: #fff;
  119. padding: 24rpx;
  120. display: flex;
  121. justify-content: space-between;
  122. margin-bottom: 24rpx;
  123. .content{
  124. display: flex;
  125. justify-content: space-between;
  126. flex-direction: column;
  127. margin-right:24rpx;
  128. .title{
  129. color: rgba(51, 51, 51, 1);
  130. font-size: 16px;
  131. line-height: 23px;
  132. }
  133. .tag{
  134. display: flex;
  135. .item{
  136. margin-top: 32rpx;
  137. line-height: 48rpx;
  138. padding: 0 12rpx;
  139. border: 1px solid rgba(31, 74, 153, 1);
  140. color:rgba(31, 74, 153, 1) ;
  141. border-radius: 8rpx;
  142. font-size: 24rpx;
  143. text-align: center;
  144. }
  145. .item1{
  146. border: 1px solid rgba(238, 49, 56, 1);
  147. color:rgba(238, 49, 56, 1) ;
  148. }
  149. }
  150. }
  151. .picture{
  152. width: 224rpx;
  153. height: 86px;
  154. border-radius:5px ;
  155. img{
  156. width: 100%;
  157. height: 100%;
  158. }
  159. }
  160. }
  161. }
  162. </style>