// 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: '网络连接失败', }) } } }) } })