badgeDetails.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view>
  3. <u-navbar title="徽章详情"></u-navbar>
  4. <!-- 荣誉名称 -->
  5. <view class="honor-name">
  6. <view class="icon">
  7. <img :src="info.img" alt="">
  8. </view>
  9. <view class="name">
  10. {{info.name}}
  11. </view>
  12. <view class="explain">
  13. {{info.synopsis}}
  14. </view>
  15. </view>
  16. <!-- 荣誉记录 -->
  17. <view class="record">
  18. <view class="record-title">
  19. <view class="rec">
  20. </view>
  21. <view class="text">
  22. 荣誉记录
  23. </view>
  24. </view>
  25. <view class="commend-box" v-for="(item,i) in list" :key="i">
  26. <view class="commend-content">
  27. <view class="title">
  28. {{item.orgName?item.orgName:item.typeName}}
  29. </view>
  30. <view class="commendation">
  31. {{item.content}}
  32. </view>
  33. <view class="integral">
  34. <view class="flex">
  35. <view class="icon">
  36. <img src="../../../assets/img/riFill-copper-diamond-fill@2x.png" alt="">
  37. </view>
  38. <view class="text">
  39. {{item.scoreInfo}}积分
  40. </view>
  41. </view>
  42. <view class="date">
  43. {{item.createTime}}
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <u-divider bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
  50. </view>
  51. </template>
  52. <script>
  53. import * as API from '@/apis/pagejs/cite.js'
  54. export default {
  55. data() {
  56. return {
  57. type:'',
  58. listForm:{
  59. pageIndex:1,
  60. pageSize:20,
  61. },
  62. info:{},
  63. list:[],
  64. recordsTotal:0,
  65. }
  66. },
  67. onLoad(op){
  68. if(op.type){
  69. this.type=op.type
  70. this.getInfo()
  71. this.listForm.type=op.id
  72. this.getList()
  73. }
  74. },
  75. onReachBottom() {
  76. if (this.list.length < this.recordsTotal) {
  77. this.myLoadmore();
  78. }
  79. },
  80. methods: {
  81. myLoadmore(){
  82. this.listForm.pageIndex += 1;
  83. this.getList();
  84. },
  85. getInfo(){
  86. uni.showLoading({
  87. title: "加载中",
  88. mask: true,
  89. })
  90. API.editBadge(this.type).then((res) => {
  91. uni.hideLoading();
  92. //this.list=response.data.data
  93. this.info=res.data;
  94. }).catch(error => {
  95. uni.showToast({
  96. title: error,
  97. icon: "none"
  98. })
  99. })
  100. },
  101. getList(){
  102. uni.showLoading({
  103. title: "加载中",
  104. mask: true,
  105. })
  106. API.pageList(this.listForm).then((res) => {
  107. uni.hideLoading();
  108. //this.list=response.data.data
  109. if(this.listForm.pageIndex==1){
  110. this.list = res.data.data;
  111. }else{
  112. this.list = [
  113. ...this.list,
  114. ...res.data.data
  115. ];
  116. }
  117. this.recordsTotal = res.data.recordsTotal;
  118. }).catch(error => {
  119. uni.showToast({
  120. title: error,
  121. icon: "none"
  122. })
  123. })
  124. },
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. // 荣誉名称
  130. .honor-name {
  131. background-color: #fff;
  132. padding: 32rpx 0;
  133. text-align: center;
  134. .icon {
  135. img {
  136. width: 136rpx;
  137. height: 140rpx;
  138. }
  139. }
  140. .name {
  141. color: rgba(51, 51, 51, 1);
  142. font-size: 18px;
  143. }
  144. .explain {
  145. color: rgba(119, 119, 119, 1);
  146. margin-top: 24rpx;
  147. }
  148. }
  149. // 荣誉记录
  150. .record {
  151. margin-top: 26px;
  152. padding: 0 32rpx;
  153. .record-title {
  154. display: flex;
  155. align-items: center;
  156. margin-bottom: 19px;
  157. color: rgba(51, 51, 51, 1);
  158. font-size: 18px;
  159. line-height: 18px;
  160. .rec {
  161. width: 4px;
  162. height: 16px;
  163. background-color: rgba(31, 74, 153, 1);
  164. margin-right: 4px;
  165. }
  166. }
  167. .commend-box {
  168. background-color: #fff;
  169. border-radius: 8px;
  170. padding: 24rpx;
  171. display: flex;
  172. justify-content: space-between;
  173. margin-bottom: 12px;
  174. .commend-content {
  175. .title {
  176. color: rgba(51, 51, 51, 1);
  177. font-size: 16px;
  178. line-height: 23px;
  179. }
  180. .commendation {
  181. color: rgba(119, 119, 119, 1);
  182. font-size: 12px;
  183. line-height: 17px;
  184. margin-top: 4rpx;
  185. }
  186. .integral {
  187. margin-top: 14rpx;
  188. display: flex;
  189. align-items: center;
  190. justify-content: space-between;
  191. .flex{
  192. display: flex;
  193. border-radius: 50px;
  194. height: 28px;
  195. font-size: 24rpx;
  196. background-color: rgba(230, 239, 255, 1);
  197. justify-content: center;
  198. align-items: center;
  199. padding: 0 16rpx;
  200. .icon {
  201. width: 32rpx;
  202. height: 32rpx;
  203. img {
  204. width: 100%;
  205. }
  206. }
  207. .text {
  208. font-size: 24rpx;
  209. color: rgba(119, 119, 119, 1);
  210. }
  211. }
  212. }
  213. .date{
  214. color: rgba(153, 153, 153, 1);
  215. font-size: 12px;
  216. }
  217. }
  218. }
  219. }
  220. </style>