Blame view

src/pages/mylecture/index.vue 3.79 KB
ce4c83ff   wxy   初始提交
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
  <template>
  <div class='myrelease'>
  <navigator class='lecture-item' v-for='(v, i) in lectures' :key='i' :url="'../lectureDetail/main?lrid='+v.lrid" hover-class='hover'>
    <div class='title'>{{v.lecture_title}}</div>
    <div class='abstract'>{{v.lecture_content}}</div>
    <div class='foot'>
      <div class='left'><img src='/static/imgs/time.png'>{{v.lecture_date}}</div>
      <div class='left'><img src='/static/imgs/locate.png'>{{v.comm_Name}}</div>
      <div class='status' v-if='v.is_auditing==0'>审核中</div>
      <div class='status' v-else style='background: tan'>已通过</div>
    </div>
  </navigator>
  <NoData v-if='loaded && lectures.length==0' paddingTop=0 />
  </div>
  </template>
  
  <script>
  import NoData from '@/components/NoData'
  export default {
    components:{NoData},
    data () {
      return {
        lectures:[],
        loaded: false
      }
    },
    methods: {
      loadLectures(){
        this.loaded = false
        wx.showLoading({ title: '正在加载' })
        wx.request({
          url: this.rootUrl + '/lecture/allLecture',
          data: {sessionID: wx.getStorageSync('sessionID')},
          success: res => {
            if(res.statusCode=='500'){
              this.service.getUnionId(this.rootAvatar,this.rootUrl).then(res=>{
                console.log(res)
                this.loadLectures()
              })
            }else{
              this.lectures = []
              this.lectures = res.data
              this.lectures.forEach(v=>{
                v.lecture_date = this.service.correctTime(v.lecture_date)
                v.lecture_content = v.lecture_content.replace(/(<[^>]+>)|(&[a-z]+sp;)/g,'').replace(/\s+/g,' ')
              })
              this.loaded = true
              wx.hideLoading()
            }
          },
          fail: res => {
            wx.hideLoading()
            wx.showToast({ title: '加载失败', icon: 'none' })
          }
        })
      }
    },
    onLoad(){
      this.loadLectures()
    }
  }
  </script>
  <style lang="stylus" scoped>
  .myrelease
    position absolute
    min-height 100%
    width 100%
    Background()
  .select-box
    position relative
    Flex(flex, center, center)
    Font(30rpx, 56rpx)
    height 100rpx
    .select
      BorderBox()
      border 1px solid #EFEFEF
      border-radius 8rpx
      Flex(flex, space-between, center)
      padding 0 20rpx
      width 70%
      background white
      img
        Height_Width(20rpx)
        transition transform 0.3s
  /* .select_img_rotate{
    transform:rotate(180deg); 
  } */
  .option-box
    position absolute
    top 78rpx
    Height_Width(0, 70%)
    BorderBox()
    overflow-y auto
    border-top 1px solid #EFEFEF
    background white
    transition height 0.2s
    div
      display block
      Border(0, 1px, 1px, 1px)
      padding 5rpx
  .list-item
    margin-bottom 20rpx
    padding 0 30rpx
    BorderBox()
    background white
    Border(1px, 0, 1px, 0)
    .title
      Font(30rpx)
      color themeColor
      margin-top 35rpx
    .intro
      Font(26rpx, 35rpx)
      margin 15rpx 0
    .foot
      Flex(flex, , center)
      Font(24rpx)
      color grey
      margin-bottom 30rpx
      .view
        margin-left 30rpx
      .status
        margin 0 0 0 auto
        line-height 35rpx
        border-radius 6rpx
        padding 0 10rpx
        color white
        background themeColor
  
  
  
  .lecture-item
    padding-top 20rpx
    background white
    .title
      Font(32rpx, 50rpx, bold)
      margin 0 20rpx 10rpx 20rpx
    .abstract
      margin 0 20rpx
      overflow hidden
      text-overflow ellipsis
      display -webkit-box
      -webkit-line-clamp 3
      -webkit-box-orient vertical
      Font(28rpx, 38rpx)
    .foot
      display flex
      margin 20rpx 20rpx 0 20rpx
      padding-bottom 20rpx
      Border(0,0,1rpx,0)
      .left
        margin-right 20rpx
        Flex(flex,,center)
        Font(28rpx)
        color grey
        img
          Height_Width(34rpx)
          margin-right 10rpx
      .status
        background themeColor
        color white
        Font(26rpx, 38rpx)
        padding 0 10rpx
        margin 0 0 0 auto
        border-radius 5rpx
  </style>