details.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view class="news_detail">
  3. <!-- <view class="top">
  4. <u-navbar title="活动详情" :background="background" :border-bottom='false' title-color='#fff'></u-navbar>
  5. </view> -->
  6. <view class="title">
  7. {{notice.title}}
  8. </view>
  9. <view class="person">
  10. 发布人:{{notice.admin_name}}
  11. </view>
  12. <view class="time">
  13. {{notice.created_at}}
  14. </view>
  15. <view class="top">
  16. <u-parse :html="notice.body"></u-parse>
  17. </view>
  18. <!-- 如果有管理员要做权限的话 (this.role_id == 1 || this.role_id == 2) -->
  19. <view class="active_someone" v-show="(this.studentList.length > 0 && this.ids == this.admin_id)">
  20. <view class="headers">
  21. 他们刚刚报名了活动:
  22. </view>
  23. <view class="bodys" >
  24. <view class="sames" v-for="(item,index) in studentList" :key="index">
  25. <image class="avator" :src="item.student.headimg" mode=""></image>
  26. <view class="names">
  27. {{item.student.truename}}
  28. </view>
  29. </view>
  30. </view>
  31. <!-- <view class="empty">
  32. <view class="enptyStatus">
  33. <image src="../../static/empty.png" mode=""></image>
  34. <view class="words">
  35. 暂无报名信息
  36. </view>
  37. </view>
  38. </view> -->
  39. </view>
  40. <!-- 如果有超级管理员要做权限的话 (this.role_id == 1 || this.role_id == 2) -->
  41. <view v-show="(this.studentList.length > 0 && this.ids == this.admin_id)" class="active_btn" @click="changeActive">
  42. 查看报名信息
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. background: {
  51. backgroundColor: '#fff',
  52. },
  53. notice: '',
  54. list_id:'',
  55. studentList:[],
  56. ids:'',
  57. admin_id:'',
  58. role_id:'',
  59. }
  60. },
  61. async onLoad(options) {
  62. if (this.is_weixin()) {
  63. this.navTitle()
  64. }
  65. this.list_id = options.id
  66. console.log(options)
  67. await this.$u.get('/inform/information/' + options.id).then(res => {
  68. this.notice = res.data
  69. })
  70. console.log(this.notice.admin_id, 'admin_id')
  71. this.admin_id = this.notice.admin_id
  72. this.ids = this.vuex_user.id
  73. this.role_id = this.vuex_user.role_id
  74. console.log(this.vuex_user, '拿到所有信息000')
  75. console.log(this.ids, '拿到所有信息1111')
  76. console.log(this.role_id, '拿到所有信息222')
  77. this.getList()
  78. },
  79. // onShow(){
  80. // this.getList()
  81. // },
  82. methods: {
  83. //判断是否是微信
  84. is_weixin() {
  85. let ua = navigator.userAgent.toLowerCase();
  86. return ua.indexOf('micromessenger') != -1;
  87. },
  88. navTitle() {
  89. let navTitle = document.getElementsByTagName('uni-page-head');
  90. navTitle[0].style.display = 'none'
  91. },
  92. // getInformation(){
  93. // uni.getStorage({
  94. // ids =
  95. // })
  96. // },
  97. async getList() {
  98. // let vuex_user
  99. // uni.getStorage({
  100. // vuex_user : 'vuex_user'
  101. // })
  102. // this.ids = this.$u.vuex_user
  103. // 报名列表信息接口
  104. await this.$u
  105. .get('/inform/information-activity', {
  106. information_id: this.list_id
  107. })
  108. .then(res => {
  109. uni.hideLoading();
  110. console.log(res.data, '报名列表数据');
  111. this.studentList = res.data.list;
  112. });
  113. },
  114. // 查看报名信息
  115. changeActive(){
  116. console.log(this.list_id, '学生信息id')
  117. uni.navigateTo({
  118. url:'./details_list?student_id=' + this.list_id
  119. })
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. .news_detail{
  126. padding: 16px;
  127. .title{
  128. font-size: 18px;
  129. font-weight: 600;
  130. line-height: 24px;
  131. color: #1A1A1A;
  132. line-height: 24px;
  133. opacity: 1;
  134. text-align: center;
  135. }
  136. .person{
  137. text-align: center;
  138. margin-top: 8px;
  139. font-weight: 400;
  140. line-height: 14px;
  141. font-size: 12px;
  142. color: #858585;
  143. opacity: 0.8;
  144. }
  145. .time{
  146. text-align: center;
  147. margin-top: 4px;
  148. font-weight: 400;
  149. line-height: 14px;
  150. font-size: 12px;
  151. color: #858585;
  152. opacity: 0.8;
  153. }
  154. .top{
  155. margin-top: 15px;
  156. line-height: 24px;
  157. font-size: 15px;
  158. // text-indent: 2em;
  159. }
  160. .active_someone{
  161. margin-bottom: 80px;
  162. // height: 110px;
  163. .enptyStatus{
  164. display: flex;
  165. justify-content: center;
  166. align-items: center;
  167. flex-direction: column;
  168. padding: 30px 10px;
  169. image{
  170. width: 80px;
  171. height: 110px;
  172. }
  173. .words{
  174. color: #ffae21;
  175. font-size: 14px;
  176. padding-top: 10px;
  177. }
  178. }
  179. border-radius: 8px;
  180. background: rgba($color: #DBECE4, $alpha: 0.3);
  181. .headers{
  182. height: 18px;
  183. font-size: 13px;
  184. color: #138E57;
  185. font-weight: 500;
  186. // : 11px 0 13px 15px;
  187. margin-left: 15px;
  188. padding-top: 11px;
  189. margin-bottom: 11px;
  190. }
  191. .bodys{
  192. margin: 10px;
  193. // margin-bottom: 50px;
  194. max-height: 170px;
  195. overflow-y: hidden;
  196. display: flex;
  197. // justify-content: space-around;
  198. flex-wrap: wrap;
  199. .sames{
  200. height: 50px;
  201. margin: 15px 8px;
  202. // width: 38px;
  203. text-align: center;
  204. .avator{
  205. width: 32px;
  206. height: 32px;
  207. border-radius: 50%;
  208. }
  209. .names{
  210. font-size: 12px;
  211. line-height: 17px;
  212. color: #858585
  213. }
  214. }
  215. }
  216. }
  217. .active_btn{
  218. position: fixed;
  219. bottom: 30px;
  220. padding: 0 80px;
  221. left: 16%;
  222. height: 40px;
  223. margin-top: 50px;
  224. background: #138E57;
  225. border-radius: 25px;
  226. font-size: 16px;
  227. text-align: center;
  228. line-height: 40px;
  229. color: #FFFFFF;
  230. }
  231. }
  232. </style>