teamHonor.vue 5.5 KB

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