badgeDetails.vue 7.6 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. margin: 0;
  217. padding: 10px 0px;
  218. }
  219. .tb22{
  220. margin: 0 4px;
  221. }
  222. .tb1{
  223. text-align: center;
  224. font-weight: bold;
  225. font-size: 28rpx;
  226. width: 10%;
  227. max-width: 100rpx;
  228. min-width: 80rpx;
  229. }
  230. .tb2{
  231. font-size: 28rpx;
  232. }
  233. .tb32,.tb31{
  234. text-align: center;
  235. font-weight: bold;
  236. font-size: 14px;
  237. }
  238. .tb33{
  239. font-weight: normal;
  240. font-size: 12px;
  241. color: #565656;
  242. }
  243. }
  244. .reward-group{
  245. margin:24rpx 32rpx;
  246. background-color: #fff;
  247. .reward-item, .reward-item-title{
  248. border-bottom: solid 1px #e6e6e6;
  249. line-height: 44px;
  250. padding-left: 16rpx;
  251. }
  252. .reward-item-title{
  253. font-weight: bold;
  254. }
  255. .reward-item{
  256. min-height: 64px;
  257. }
  258. }
  259. page{
  260. font-family: 'Regular';
  261. }
  262. // 荣誉名称
  263. .honor-name {
  264. background-color: #fff;
  265. padding: 32rpx 0;
  266. text-align: center;
  267. .icon {
  268. img {
  269. max-width: 536rpx;
  270. height: 140rpx;
  271. }
  272. }
  273. .name {
  274. color: rgba(51, 51, 51, 1);
  275. font-size: 18px;
  276. }
  277. .explain {
  278. color: rgba(119, 119, 119, 1);
  279. margin-top: 24rpx;
  280. }
  281. }
  282. // 荣誉记录
  283. .record {
  284. margin-top: 26px;
  285. padding: 0 32rpx;
  286. .record-title {
  287. display: flex;
  288. align-items: center;
  289. margin-bottom: 19px;
  290. color: rgba(51, 51, 51, 1);
  291. font-size: 18px;
  292. line-height: 18px;
  293. font-family: 'Regular';
  294. .rec {
  295. width: 4px;
  296. height: 16px;
  297. background-color: rgba(31, 74, 153, 1);
  298. margin-right: 4px;
  299. }
  300. }
  301. .commend-box {
  302. background-color: #fff;
  303. border-radius: 8px;
  304. padding: 24rpx;
  305. display: flex;
  306. justify-content: space-between;
  307. margin-bottom: 12px;
  308. .commend-content {
  309. width: 100%;
  310. .title {
  311. color: rgba(51, 51, 51, 1);
  312. font-size: 16px;
  313. line-height: 23px;
  314. font-family: 'Medium';
  315. }
  316. .commendation {
  317. color: rgba(119, 119, 119, 1);
  318. font-size: 12px;
  319. line-height: 17px;
  320. margin-top: 4rpx;
  321. }
  322. .integral {
  323. margin-top: 14rpx;
  324. display: flex;
  325. align-items: center;
  326. justify-content: space-between;
  327. .flex{
  328. display: flex;
  329. border-radius: 50px;
  330. height: 28px;
  331. font-size: 24rpx;
  332. background-color: rgba(230, 239, 255, 1);
  333. justify-content: center;
  334. align-items: center;
  335. padding: 0 16rpx;
  336. .icon {
  337. width: 32rpx;
  338. height: 32rpx;
  339. img {
  340. width: 100%;
  341. }
  342. }
  343. .text {
  344. font-size: 24rpx;
  345. color: rgba(119, 119, 119, 1);
  346. }
  347. }
  348. }
  349. .date{
  350. color: rgba(153, 153, 153, 1);
  351. font-size: 12px;
  352. }
  353. }
  354. }
  355. }
  356. </style>