123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- <template>
- <view class="news_detail">
- <!-- <view class="top">
- <u-navbar title="活动详情" :background="background" :border-bottom='false' title-color='#fff'></u-navbar>
- </view> -->
- <view class="title">
- {{notice.title}}
- </view>
- <view class="person">
- 发布人:{{notice.admin_name}}
- </view>
- <view class="time">
- {{notice.created_at}}
- </view>
- <view class="top">
- <u-parse :html="notice.body"></u-parse>
- </view>
- <!-- 如果有管理员要做权限的话 (this.role_id == 1 || this.role_id == 2) -->
- <view class="active_someone" v-show="(this.studentList.length > 0 && this.ids == this.admin_id)">
- <view class="headers">
- 他们刚刚报名了活动:
- </view>
- <view class="bodys" >
- <view class="sames" v-for="(item,index) in studentList" :key="index">
- <image class="avator" :src="item.student.headimg" mode=""></image>
- <view class="names">
- {{item.student.truename}}
- </view>
- </view>
- </view>
- <!-- <view class="empty">
- <view class="enptyStatus">
- <image src="../../static/empty.png" mode=""></image>
- <view class="words">
- 暂无报名信息
- </view>
- </view>
- </view> -->
- </view>
- <!-- 如果有超级管理员要做权限的话 (this.role_id == 1 || this.role_id == 2) -->
- <view v-show="(this.studentList.length > 0 && this.ids == this.admin_id)" class="active_btn" @click="changeActive">
- 查看报名信息
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- background: {
- backgroundColor: '#fff',
- },
- notice: '',
- list_id:'',
- studentList:[],
- ids:'',
- admin_id:'',
- role_id:'',
- }
- },
- async onLoad(options) {
- if (this.is_weixin()) {
- this.navTitle()
- }
- this.list_id = options.id
- console.log(options)
- await this.$u.get('/inform/information/' + options.id).then(res => {
- this.notice = res.data
- })
- console.log(this.notice.admin_id, 'admin_id')
- this.admin_id = this.notice.admin_id
- this.ids = this.vuex_user.id
- this.role_id = this.vuex_user.role_id
- console.log(this.vuex_user, '拿到所有信息000')
- console.log(this.ids, '拿到所有信息1111')
- console.log(this.role_id, '拿到所有信息222')
- this.getList()
- },
- // onShow(){
- // this.getList()
- // },
- methods: {
- //判断是否是微信
- is_weixin() {
- let ua = navigator.userAgent.toLowerCase();
- return ua.indexOf('micromessenger') != -1;
- },
- navTitle() {
- let navTitle = document.getElementsByTagName('uni-page-head');
- navTitle[0].style.display = 'none'
- },
- // getInformation(){
- // uni.getStorage({
- // ids =
- // })
- // },
- async getList() {
- // let vuex_user
- // uni.getStorage({
- // vuex_user : 'vuex_user'
- // })
- // this.ids = this.$u.vuex_user
- // 报名列表信息接口
- await this.$u
- .get('/inform/information-activity', {
- information_id: this.list_id
- })
- .then(res => {
- uni.hideLoading();
- console.log(res.data, '报名列表数据');
- this.studentList = res.data.list;
- });
-
- },
-
- // 查看报名信息
- changeActive(){
- console.log(this.list_id, '学生信息id')
- uni.navigateTo({
- url:'./details_list?student_id=' + this.list_id
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .news_detail{
- padding: 16px;
- .title{
- font-size: 18px;
- font-weight: 600;
- line-height: 24px;
- color: #1A1A1A;
- line-height: 24px;
- opacity: 1;
- text-align: center;
- }
- .person{
- text-align: center;
- margin-top: 8px;
- font-weight: 400;
- line-height: 14px;
- font-size: 12px;
- color: #858585;
- opacity: 0.8;
- }
- .time{
- text-align: center;
- margin-top: 4px;
- font-weight: 400;
- line-height: 14px;
- font-size: 12px;
- color: #858585;
- opacity: 0.8;
- }
-
- .top{
- margin-top: 15px;
- line-height: 24px;
- font-size: 15px;
- // text-indent: 2em;
- }
- .active_someone{
- margin-bottom: 80px;
- // height: 110px;
- .enptyStatus{
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- padding: 30px 10px;
- image{
- width: 80px;
- height: 110px;
- }
- .words{
- color: #ffae21;
- font-size: 14px;
- padding-top: 10px;
- }
- }
- border-radius: 8px;
- background: rgba($color: #DBECE4, $alpha: 0.3);
- .headers{
- height: 18px;
- font-size: 13px;
- color: #138E57;
- font-weight: 500;
- // : 11px 0 13px 15px;
- margin-left: 15px;
- padding-top: 11px;
- margin-bottom: 11px;
- }
- .bodys{
- margin: 10px;
- // margin-bottom: 50px;
- max-height: 170px;
- overflow-y: hidden;
- display: flex;
- // justify-content: space-around;
- flex-wrap: wrap;
- .sames{
- height: 50px;
- margin: 15px 8px;
- // width: 38px;
- text-align: center;
- .avator{
- width: 32px;
- height: 32px;
- border-radius: 50%;
- }
- .names{
- font-size: 12px;
- line-height: 17px;
- color: #858585
- }
- }
- }
-
- }
- .active_btn{
- position: fixed;
- bottom: 30px;
- padding: 0 80px;
- left: 16%;
- height: 40px;
- margin-top: 50px;
- background: #138E57;
- border-radius: 25px;
- font-size: 16px;
- text-align: center;
- line-height: 40px;
- color: #FFFFFF;
- }
- }
- </style>
|