Blame view

src/pages/lawinfo/index.vue 4.41 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
166
167
168
169
170
171
  <template>
    <div class="content">
      <div  v-for='(v,i) in lists' :key='i'>
        <p class="title">{{v.itemtitle}}</p>
        <p class="date">公布日期:{{v.fdatetime}}</p>
        <div class="info">
          <rich-text :nodes="v.itemcontent"></rich-text>
        </div>
      </div>
    </div>
  </template>
  
  <script>
    export default {
      data() {
        return {
          typeChild: '',
          title: '',
          lists: [],
          loaded: false
        }
      },
      methods: {
        loadArticles () {
          wx.showLoading({ title: '正在加载' })
          wx.request({
            url: this.rootUrl + '/reg/getLawsRegulationsContent',
            method: 'get',
            header: {'content-type': 'application/x-www-form-urlencoded'},
            data:{
              gid: this.gid,
              lib:this.lib,
              sessionID: wx.getStorageSync('sessionID')
            },
            success: res=> {
              if(res.statusCode=='500'){
                this.service.getUnionId(this.rootAvatar,this.rootUrl).then(res=>{
                  console.log(res)
                  this.loadArticles()
                })
              }else{
                console.log(res)
                this.lists = []
                this.lists = res.data.value
                console.log(res.data.value)
                this.loaded = true
                wx.hideLoading()
              }
            },
            fail: res=> {
              console.log(res)
            }
          })
        },
        getList () {
          var path = ''
          if (this.typeChild == 'gjfl'){
            this.lib = 'zyfl'
          } else if (this.typeChild=='gjfg'){
            this.lib = 'dffl'
          }else if(this.typeChild=='lfzl'){
            this.lib = 'lf'
          }else if(this.typeChild=='sfzl'){
            this.lib = 'sf'
          }
          var TypesOf = this.type
          if (TypesOf == 'flfg') {
            this.typeChild = 'gjfg'
            path = 'reg/getLawsRegulationsList'
          }else if(TypesOf == 'cpws'){
            path = 'reg/getLawReferee'
            this.typeChild = 'ms'
            this.lib = 'cpws_cp'
          }else if(TypesOf == 'cpal'){
            path = 'reg/getLawCase'
            this.typeChild = 'ms'
            this.lib = 'cpws_al'
          }
          console.log(this.lib)
          wx.showLoading({ title: '正在加载' })
          wx.request({
            url: this.rootUrl + path,
            method: 'get',
            header: {'content-type': 'application/x-www-form-urlencoded'},
            data:{
              pagenum: this.pagenum,
              pagesize: this.pagesize,
              keyTitle: this.keyTitle,
              keyContent: this.keyContent,
              anyou: this.anyou,
              type: this.typeChild,
              Fdate_b: this.Fdate_b,
              Fdate_e: this.Fdate_e,
              sessionID: wx.getStorageSync('sessionID')
            },
            success: res=> {
              if(res.statusCode=='500'){
                this.service.getUnionId(this.rootAvatar,this.rootUrl).then(res=>{
                  console.log(res)
                  this.loadArticles()
                })
              }else{
                console.log(1,res)
                this.lists = []
                this.lists = res.data.value
                this.loaded = true
                wx.hideLoading()
              }
            },
            fail: res=> {
              console.log(res)
            }
          })
        },
        checkedBox: function (index,typeChild) {
          this.changeOne = index
          this.typeChild = typeChild
          this.getList()
        },
        search () {
          this.keyContent = this.keywords
          this.keyTitle = this.keywords
          this.anyou = this.keywords
          this.getList()
        }
      },
      onLoad(){
        this.gid = this.$root.$mp.query.gid
        this.lib = this.$root.$mp.query.lib
        this.title = this.$root.$mp.query.title
        wx.setNavigationBarTitle({title: this.title})
      },
      onShow() {
        this.loadArticles()
      },
      onUnload(){
        this.lists = []
        this.loaded = false
      }
    }
  </script>
  <style lang="stylus" scoped>
    .clear
      clear both
    .content
      margin 0 3%
      width 94%
      font-size 30rpx
    .title
      margin 30rpx 0
      font-size 34rpx
      color #000
      line-height 60rpx
      overflow hidden
      text-overflow ellipsis
      display -webkit-box
      -webkit-line-clamp 2
      -webkit-box-orient vertical
    .date
      color #999
      font-size 28rpx
      text-align right
      line-height 40rpx
    .info
      margin-top 30rpx
      color #333
      font-size 30rpx
      line-height 60rpx
    .info p
      text-indent 60rpx
  </style>