badgeDetails.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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. page{
  130. font-family: 'Regular';
  131. }
  132. // 荣誉名称
  133. .honor-name {
  134. background-color: #fff;
  135. padding: 32rpx 0;
  136. text-align: center;
  137. .icon {
  138. img {
  139. max-width: 536rpx;
  140. height: 140rpx;
  141. }
  142. }
  143. .name {
  144. color: rgba(51, 51, 51, 1);
  145. font-size: 18px;
  146. }
  147. .explain {
  148. color: rgba(119, 119, 119, 1);
  149. margin-top: 24rpx;
  150. }
  151. }
  152. // 荣誉记录
  153. .record {
  154. margin-top: 26px;
  155. padding: 0 32rpx;
  156. .record-title {
  157. display: flex;
  158. align-items: center;
  159. margin-bottom: 19px;
  160. color: rgba(51, 51, 51, 1);
  161. font-size: 18px;
  162. line-height: 18px;
  163. font-family: 'Regular';
  164. .rec {
  165. width: 4px;
  166. height: 16px;
  167. background-color: rgba(31, 74, 153, 1);
  168. margin-right: 4px;
  169. }
  170. }
  171. .commend-box {
  172. background-color: #fff;
  173. border-radius: 8px;
  174. padding: 24rpx;
  175. display: flex;
  176. justify-content: space-between;
  177. margin-bottom: 12px;
  178. .commend-content {
  179. width: 100%;
  180. .title {
  181. color: rgba(51, 51, 51, 1);
  182. font-size: 16px;
  183. line-height: 23px;
  184. font-family: 'Medium';
  185. }
  186. .commendation {
  187. color: rgba(119, 119, 119, 1);
  188. font-size: 12px;
  189. line-height: 17px;
  190. margin-top: 4rpx;
  191. }
  192. .integral {
  193. margin-top: 14rpx;
  194. display: flex;
  195. align-items: center;
  196. justify-content: space-between;
  197. .flex{
  198. display: flex;
  199. border-radius: 50px;
  200. height: 28px;
  201. font-size: 24rpx;
  202. background-color: rgba(230, 239, 255, 1);
  203. justify-content: center;
  204. align-items: center;
  205. padding: 0 16rpx;
  206. .icon {
  207. width: 32rpx;
  208. height: 32rpx;
  209. img {
  210. width: 100%;
  211. }
  212. }
  213. .text {
  214. font-size: 24rpx;
  215. color: rgba(119, 119, 119, 1);
  216. }
  217. }
  218. }
  219. .date{
  220. color: rgba(153, 153, 153, 1);
  221. font-size: 12px;
  222. }
  223. }
  224. }
  225. }
  226. </style>