teamHonor.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view>
  3. <u-navbar :title="title"></u-navbar>
  4. <view class="tabs">
  5. <u-tabs bar-width="60" inactive-color="#777777" active-color="#018bb9" height="88" :list="tabList" :is-scroll="false" :current="current" @change="change"></u-tabs>
  6. </view>
  7. <view class="commend-box" v-for="(item,i) in list" :key="i" @click="ckItem(item)">
  8. <view class="commend-content">
  9. <view class="title">
  10. {{item.orgName?item.orgName:item.typeName}}
  11. </view>
  12. <view class="commendation">
  13. {{item.content}}
  14. </view>
  15. <view class="integral">
  16. <view class="icon">
  17. <img src="../../../assets/img/riFill-copper-diamond-fill@2x.png" alt="">
  18. </view>
  19. <view class="text">
  20. {{item.scoreInfo}}积分
  21. </view>
  22. </view>
  23. </view>
  24. <view class="gainer">
  25. <img v-if="item.badge" :src="item.badge.imgUrl" alt="">
  26. <img v-if="item.regUser" :src="item.regUser.headImg" alt="">
  27. <!-- <u-avatar v-else size="120" ></u-avatar> -->
  28. <view class="name">
  29. {{item.userName?item.userName:item.badgeName}}
  30. </view>
  31. </view>
  32. </view>
  33. <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
  34. </view>
  35. </template>
  36. <script>
  37. import * as API from '@/apis/pagejs/cite.js'
  38. export default {
  39. data() {
  40. return {
  41. title:'',
  42. type:'',
  43. listForm:{
  44. pageIndex:1,
  45. pageSize:20,
  46. },
  47. list:[],
  48. recordsTotal:0,
  49. tabList: [{
  50. name: '全部'
  51. }, {
  52. name: '荣誉类型'
  53. }, {
  54. name: '荣誉类型',
  55. }],
  56. current: 0
  57. }
  58. },
  59. onLoad(op){
  60. if(op.type){
  61. this.type=op.type
  62. if(this.type=='my'){
  63. this.listForm.isTeam=false
  64. this.title="公司表彰"
  65. }else if(this.type=='team'){
  66. this.listForm.isTeam=true
  67. this.title="团队荣誉"
  68. }
  69. }
  70. this.getByType()
  71. this.getList()
  72. },
  73. onReachBottom() {
  74. if (this.list.length < this.recordsTotal) {
  75. this.myLoadmore();
  76. }
  77. },
  78. methods: {
  79. ckItem(item){
  80. if(item.badgeId){
  81. var url="/pages/staffHome/teamHonor/badgeDetails?type="+item.badgeId+"&id="+item.type;
  82. uni.navigateTo({
  83. url:url
  84. })
  85. }
  86. },
  87. myLoadmore(){
  88. this.listForm.pageIndex += 1;
  89. this.getList();
  90. },
  91. getList(){
  92. uni.showLoading({
  93. title: "加载中",
  94. mask: true,
  95. })
  96. API.pageList(this.listForm).then((res) => {
  97. uni.hideLoading();
  98. //this.list=response.data.data
  99. if(this.listForm.pageIndex==1){
  100. this.list = res.data.data;
  101. }else{
  102. this.list = [
  103. ...this.list,
  104. ...res.data.data
  105. ];
  106. }
  107. this.recordsTotal = res.data.recordsTotal;
  108. }).catch(error => {
  109. uni.showToast({
  110. title: error,
  111. icon: "none"
  112. })
  113. })
  114. },
  115. getByType(){
  116. uni.showLoading({
  117. title: "加载中",
  118. mask: true,
  119. })
  120. API.getByType(this.type).then((response) => {
  121. uni.hideLoading();
  122. this.tabList=[
  123. {
  124. id:'',
  125. name:'全部'
  126. },
  127. ...response.data
  128. ]
  129. }).catch(error => {
  130. uni.showToast({
  131. title: error,
  132. icon: "none"
  133. })
  134. })
  135. },
  136. change(index) {
  137. this.current = index;
  138. this.listForm.pageIndex = 1;
  139. this.listForm.type=this.tabList[index].id
  140. this.getList()
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang="scss" scoped>
  146. .tabs{
  147. background-color: rgba(255, 255, 255, 1);
  148. /deep/.u-tabs{
  149. width: 408rpx;
  150. }
  151. margin-bottom: 24rpx;
  152. }
  153. .commend-box{
  154. background-color: #fff;
  155. border-radius: 8px;
  156. margin: 0 32rpx 24rpx 32rpx;
  157. padding: 24rpx;
  158. display: flex;
  159. justify-content: space-between;
  160. .commend-content{
  161. .title{
  162. color: rgba(51, 51, 51, 1);
  163. font-size: 16px;
  164. line-height: 23px;
  165. }
  166. .commendation{
  167. color: rgba(119, 119, 119, 1);
  168. font-size: 12px;
  169. line-height: 17px;
  170. margin-top: 4rpx;
  171. width: 430rpx;
  172. }
  173. .integral{
  174. margin-top: 14rpx;
  175. display: flex;
  176. align-items: center;
  177. justify-content: center;
  178. background-color: rgba(230, 239, 255, 1);
  179. width: 260rpx;
  180. border-radius: 50px;
  181. height: 28px;
  182. font-size: 24rpx;
  183. .icon{
  184. width: 32rpx;
  185. height: 32rpx;
  186. img{
  187. width: 100%;
  188. }
  189. }
  190. .text{
  191. font-size: 24rpx;
  192. color: rgba(119, 119, 119, 1);
  193. }
  194. }
  195. }
  196. .gainer{
  197. img{
  198. width: 136rpx;
  199. height: 140rpx;
  200. border-radius: 50px;
  201. }
  202. .name{
  203. text-align: center;
  204. color: rgba(51, 51, 51, 1);
  205. }
  206. }
  207. }
  208. </style>