forked from nsjcy/frontEnd/nsjcy

liyj
2020-02-11 e60e253cb3ce0597ded89b56a414c731e28c4ff1
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
//index.js
//获取应用实例
const app = getApp();
var WxParse = require('../wxParse/wxParse.js');
Page({
  data: {
    data: {},
    name: '',
    buName:''
  },
  onLoad: function(options) {
    var that = this;
    this.setData({
      name: options.name
    })
    if (options.name == '公益随手拍'){
      this.setData({
        buName: '我要上报'
      })
    }else{
      this.setData({
        buName: '我要举报'
      })
    }
    wx.request({
      url: app.globalData.url + '/api/article/findByName?typeName=' + options.name,
      success: function(res) {
        console.log(res)
        if (res.data.code == 0) {
          var article = res.data.data.content;
          WxParse.wxParse('article', 'html', article, that, 5);
        }
      }
    })
  },
 
  scanEvildoing: function (e) {
    var name = this.data.name;
    if (name == '公益随手拍') {
      wx.navigateTo({
        url: '../video/video',
      })
    } else {
      wx.navigateTo({
        url: '../scanEvildoing/scanEvildoing?id=new',
      })
    }
 
  }
})