forked from nsjcy/frontEnd/nsjcy

liuwh
2020-05-09 4edccb5c4268698889887edcee9228db2c9f0a61
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
// pages/excess/excess.js
var app = getApp()
Page({
 
  /**
   * 页面的初始数据
   */
  data: {
    name: '',
    name1: '',
    url: ''
  },
 
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(option) {
    this.setData({
      name: option.name,
      name1: option.name1,
      url: option.url
    })
  },
 
  user: function(e) {
    var name = e.currentTarget.dataset.name;
    //接口
    var openId = wx.getStorageSync("openId");
    var that = this;
    wx.request({
      url: app.globalData.url + '/api/ma/user/findByOpenId?openId=' + openId,
      success: function(res) {
        if (res.data.code == '0') {
          //未认证就跳转认证
          var url = that.data.url + '?name=' + name + '&id=new' + '&disabled=flase'
 
          if (res.data.data.isFaceVerify == 0 ) {
            wx.showModal({
              title: '人脸识别确认',
              content: '为了保证您信息的真实性,请前往人脸认证',
              cancelText: '回到首页',
              confirmText: '前往认证',
              success: function(res) {
                if (res.confirm) {
                  wx.navigateTo({
                    url: '../face/face?url=' + encodeURIComponent(url),
                  })
                } else if (res.cancel) {
                  wx.redirectTo({
                    url: '../index/index',
                  })
                }
              }
            })
          } else {
            wx.navigateTo({
              url: url,
            })
          }
        } else {
          wx.showToast({
            title: '网络连接失败',
          })
        }
      }
    })
  }
})