badgeDetails.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <template>
  2. <view>
  3. <u-navbar title="荣誉详情" ></u-navbar>
  4. <view class="news">
  5. <table class="table" >
  6. <tr>
  7. <td class="tb31" colspan="2">
  8. <h3>{{info.remark?""+info.remark:''}}{{info.honorId}}名单</h3></td>
  9. </tr>
  10. <tr v-if="false">
  11. <td class="tb1" v-html='htmlShow("表彰词")'></td>
  12. <td class="tb2">
  13. <textarea style="width: 100%;" :auto-height="true"
  14. v-model="info.content"
  15. name="" id="" readonly ></textarea></td>
  16. </tr>
  17. <tr v-if="info.orgName">
  18. <td class="tb1" v-html='htmlShow(info.orgName)' ></td>
  19. <td class="tb2">{{info.orgUserNames}}</td>
  20. </tr>
  21. <template v-for="(item,j) in dept">
  22. <template>
  23. <tr :key="j">
  24. <td class="tb1" v-html="htmlShow(item.orgName)" ></td>
  25. <td class="tb2">
  26. <template v-for="(str,k) in item.list">
  27. <template v-if="k!=0">
  28. ,
  29. </template>
  30. <span class="tb22" :key="k">{{showName(str)}}</span>
  31. </template>
  32. </td>
  33. </tr>
  34. </template>
  35. </template>
  36. <tr>
  37. <td class="tb1">奖励<br/>
  38. 积分</td>
  39. <td class="tb2"> <span v-if="info.isTeam" >每人</span>+{{info.scoreInfo}}积分</td>
  40. </tr>
  41. </table>
  42. </view>
  43. <u-divider
  44. border-color="#CFD2D5">已经到底了</u-divider>
  45. <view class="reward-group" v-if="false" >
  46. <view >
  47. <view class="reward-item-title" style="text-align: center;font-size: 36rpx;">
  48. {{info.remark?""+info.remark:''}}{{info.honorId}}名单
  49. </view>
  50. </view>
  51. <view >
  52. <view class="reward-item">
  53. <textarea style="width: 100%;" :auto-height="true"
  54. v-model="info.content"
  55. name="" id="" readonly ></textarea>
  56. </view>
  57. </view>
  58. <template v-for="(item,i) in dept">
  59. <view :key="i" >
  60. <view class="reward-item-title">
  61. {{item.orgName}}
  62. </view>
  63. <view class="reward-item" >
  64. </view>
  65. </view>
  66. </template>
  67. <view >
  68. <view class="reward-item-title">
  69. {{info.orgName}} {{info.userName}}
  70. </view>
  71. <view class="reward-item" v-if="info.orgUserNames">
  72. {{info.orgUserNames}}
  73. </view>
  74. </view>
  75. <view >
  76. <view class="reward-item">
  77. 奖励积分 <span v-if="info.isTeam" >每人</span>+{{info.scoreInfo}}积分
  78. </view>
  79. <view class="reward-item">
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. import * as API from '@/apis/pagejs/cite.js'
  87. export default {
  88. data() {
  89. return {
  90. type:'',
  91. listForm:{
  92. pageIndex:1,
  93. pageSize:20,
  94. },
  95. info:{},
  96. list:[],
  97. dept:[],
  98. noticeList:[],
  99. recordsTotal:0,
  100. }
  101. },
  102. onLoad(op){
  103. this.type=op.id
  104. this.getInfo()
  105. },
  106. onReachBottom() {
  107. if (this.list.length < this.recordsTotal) {
  108. this.myLoadmore();
  109. }
  110. },
  111. methods: {
  112. showName(str){
  113. if(str.length!=2){
  114. return str
  115. }else if(str.length==2){
  116. return str[0]+" "+str[1]
  117. }
  118. return 'error'
  119. },
  120. htmlShow(str){
  121. var t="";
  122. for(var i in str){
  123. t+=str[i]+"<br/>"
  124. }
  125. return t
  126. },
  127. myLoadmore(){
  128. this.listForm.pageIndex += 1;
  129. this.getList();
  130. },
  131. getInfo(){
  132. uni.showLoading({
  133. title: "加载中",
  134. mask: true,
  135. })
  136. API.editBadge(this.type).then((res) => {
  137. uni.hideLoading();
  138. //this.list=response.data.data
  139. this.info=res.data.cite;
  140. if(this.info.regUserList&&this.info.regUserList.length){
  141. this.info.orgUserNames=this.info.regUserList.map(item=>{
  142. return this.showName(item.name)
  143. }).join()
  144. if(this.info.regUserList&&this.info.regUserList.length&&!this.info.orgName){
  145. this.dept=[];
  146. var sz=[];
  147. var list=this.info.regUserList;
  148. for(var i in list){
  149. var item=list[i];
  150. var index=sz.indexOf(item.orgName);
  151. if(index!=-1){
  152. this.dept[index].list.push(item.name)
  153. }else{
  154. sz.push(item.orgName);
  155. this.dept.push({
  156. orgName:item.orgName,
  157. list:[item.name]
  158. })
  159. }
  160. }
  161. console.log(this.dept)
  162. }
  163. }
  164. }).catch(error => {
  165. uni.showToast({
  166. title: error,
  167. icon: "none"
  168. })
  169. })
  170. },
  171. getList(){
  172. uni.showLoading({
  173. title: "加载中",
  174. mask: true,
  175. })
  176. API.pageList(this.listForm).then((res) => {
  177. uni.hideLoading();
  178. //this.list=response.data.data
  179. if(this.listForm.pageIndex==1){
  180. this.list = res.data.data;
  181. }else{
  182. this.list = [
  183. ...this.list,
  184. ...res.data.data
  185. ];
  186. }
  187. this.recordsTotal = res.data.recordsTotal;
  188. }).catch(error => {
  189. uni.showToast({
  190. title: error,
  191. icon: "none"
  192. })
  193. })
  194. },
  195. }
  196. }
  197. </script>
  198. <style lang="scss" scoped>
  199. page{
  200. background-color: #ffffff;
  201. font-family: 'Regular';
  202. }
  203. .news{
  204. margin: 10px;
  205. }
  206. .table{
  207. border-collapse:collapse;
  208. background-color: #fff;
  209. width: 100%;
  210. border: 1px solid;
  211. .trtop{
  212. border-top: 2px solid;
  213. }
  214. td{
  215. border: 1px solid;
  216. color: #000;
  217. margin: 0;
  218. padding: 10px 0px;
  219. }
  220. .tb22{
  221. margin: 0 4px;
  222. }
  223. .tb1{
  224. text-align: center;
  225. font-weight: bold;
  226. font-size: 28rpx;
  227. width: 10%;
  228. max-width: 100rpx;
  229. min-width: 80rpx;
  230. }
  231. .tb2{
  232. font-size: 28rpx;
  233. }
  234. .tb32,.tb31{
  235. text-align: center;
  236. font-weight: bold;
  237. font-size: 14px;
  238. }
  239. .tb33{
  240. font-weight: normal;
  241. font-size: 12px;
  242. color: #565656;
  243. }
  244. }
  245. .reward-group{
  246. margin:24rpx 32rpx;
  247. background-color: #fff;
  248. .reward-item, .reward-item-title{
  249. border-bottom: solid 1px #e6e6e6;
  250. line-height: 44px;
  251. padding-left: 16rpx;
  252. }
  253. .reward-item-title{
  254. font-weight: bold;
  255. }
  256. .reward-item{
  257. min-height: 64px;
  258. }
  259. }
  260. page{
  261. font-family: 'Regular';
  262. }
  263. // 荣誉名称
  264. .honor-name {
  265. background-color: #fff;
  266. padding: 32rpx 0;
  267. text-align: center;
  268. .icon {
  269. img {
  270. max-width: 536rpx;
  271. height: 140rpx;
  272. }
  273. }
  274. .name {
  275. color: rgba(51, 51, 51, 1);
  276. font-size: 18px;
  277. }
  278. .explain {
  279. color: rgba(119, 119, 119, 1);
  280. margin-top: 24rpx;
  281. }
  282. }
  283. // 荣誉记录
  284. .record {
  285. margin-top: 26px;
  286. padding: 0 32rpx;
  287. .record-title {
  288. display: flex;
  289. align-items: center;
  290. margin-bottom: 19px;
  291. color: rgba(51, 51, 51, 1);
  292. font-size: 18px;
  293. line-height: 18px;
  294. font-family: 'Regular';
  295. .rec {
  296. width: 4px;
  297. height: 16px;
  298. background-color: rgba(31, 74, 153, 1);
  299. margin-right: 4px;
  300. }
  301. }
  302. .commend-box {
  303. background-color: #fff;
  304. border-radius: 8px;
  305. padding: 24rpx;
  306. display: flex;
  307. justify-content: space-between;
  308. margin-bottom: 12px;
  309. .commend-content {
  310. width: 100%;
  311. .title {
  312. color: rgba(51, 51, 51, 1);
  313. font-size: 16px;
  314. line-height: 23px;
  315. font-family: 'Medium';
  316. }
  317. .commendation {
  318. color: rgba(119, 119, 119, 1);
  319. font-size: 12px;
  320. line-height: 17px;
  321. margin-top: 4rpx;
  322. }
  323. .integral {
  324. margin-top: 14rpx;
  325. display: flex;
  326. align-items: center;
  327. justify-content: space-between;
  328. .flex{
  329. display: flex;
  330. border-radius: 50px;
  331. height: 28px;
  332. font-size: 24rpx;
  333. background-color: rgba(230, 239, 255, 1);
  334. justify-content: center;
  335. align-items: center;
  336. padding: 0 16rpx;
  337. .icon {
  338. width: 32rpx;
  339. height: 32rpx;
  340. img {
  341. width: 100%;
  342. }
  343. }
  344. .text {
  345. font-size: 24rpx;
  346. color: rgba(119, 119, 119, 1);
  347. }
  348. }
  349. }
  350. .date{
  351. color: rgba(153, 153, 153, 1);
  352. font-size: 12px;
  353. }
  354. }
  355. }
  356. }
  357. </style>