//index.js
|
//获取应用实例
|
const app = getApp()
|
Page({
|
data: {
|
page: app.globalData.imgUrl + '/image/page.png',
|
ywbl2: app.globalData.imgUrl + '/image/ywbl2.svg',
|
ywbl3: app.globalData.imgUrl + '/image/ywbl3.svg',
|
ywbl1: app.globalData.imgUrl + '/image/ywbl1.svg',
|
shouldAuth: false,
|
period: '',
|
userType: ''
|
},
|
|
//业务申请进度
|
businessSchedule: function() {
|
wx.navigateTo({
|
url: '../businessSchedule/businessSchedule',
|
})
|
},
|
//在线申诉
|
complain: function() {
|
wx.navigateTo({
|
url: '../excess/excess?name=申诉人&name1=代理人&url=' + ['../complain/complain'],
|
})
|
},
|
// 国家赔偿
|
compensation: function() {
|
wx.navigateTo({
|
url: '../excess/excess?name=请求人&name1=代理人&url=' + ['../compensation/compensation'],
|
})
|
},
|
// 群众意见箱
|
massesSuggest: function() {
|
wx.navigateTo({
|
url: '../massesSuggest/massesSuggest',
|
})
|
},
|
|
//信访预约
|
petitionLetters: function() {
|
wx.navigateTo({
|
url: '../excess/excess?name=信访人&name1=代理人&url=' + ['../petitionLetters/petitionLetters'],
|
})
|
},
|
|
//司法救助
|
judicial: function() {
|
var url = '../judicial/judicial?id=new';
|
if (this.data.shouldAuth) {
|
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,
|
})
|
}
|
|
},
|
|
//案件进度查询
|
progressQuery: function() {
|
var url = '../progressQuery/progressQuery?id=new';
|
|
if (this.data.shouldAuth) {
|
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,
|
})
|
}
|
|
},
|
|
onLoad: function() {
|
//调用接口
|
var that = this;
|
that.showPeriod();
|
var openId = wx.getStorageSync("openId");
|
wx.request({
|
url: app.globalData.url + '/api/ma/user/findByOpenId?openId=' + openId,
|
success: function(res) {
|
if (res.data.code == '0') {
|
if (res.data.data.isFaceVerify == 0) {
|
that.setData({
|
shouldAuth: true,
|
userType: res.data.data.userType
|
})
|
} else {
|
that.setData({
|
shouldAuth: false,
|
userType: res.data.data.userType
|
})
|
}
|
} else {
|
wx.showModal({
|
title: '提示',
|
content: "请求失败!"
|
})
|
}
|
}
|
})
|
},
|
|
login: function(e) {
|
var url = e.currentTarget.dataset.url;
|
console.log(url)
|
wx.navigateTo({
|
url: '../lawServiceLogin/lawServiceLogin?url=' + url,
|
})
|
},
|
//在线咨询
|
artificial: function() {
|
wx.navigateTo({
|
url: '../artificial/artificial',
|
})
|
},
|
goToMini: function() {
|
wx.navigateToMiniProgram({
|
appId: 'wxb49b1bd912ba9c08'
|
})
|
|
},
|
developIng: function() {
|
app.developIng()
|
},
|
// 投诉建议
|
complaintAdvice: function() {
|
wx.navigateTo({
|
url: '../complaintAdvice/complaintAdvice?id=new',
|
})
|
},
|
|
//联络站(4个)
|
junctionStation: function(e) {
|
var str = e.currentTarget.dataset.str;
|
var userType = this.changeTypeToName(this.data.userType);
|
console.log(this.data.userType);
|
if (str != userType) {
|
wx.showModal({
|
title: '提示',
|
content: "您暂无使用权限,请您前往个人中心补充相关信息,待审核通过之后在进行使用。"
|
})
|
return;
|
}
|
wx.navigateTo({
|
url: '../junctionStation/junctionStation?id=new' + '&flag=' + str,
|
})
|
},
|
|
// 确认时间段
|
showPeriod: function() {
|
this.setData({
|
period: app.period()
|
})
|
},
|
|
changeTypeToName: function(userType) {
|
switch (userType) {
|
case '2':
|
return 'renda';
|
case '3':
|
return 'zhengxie';
|
case '4':
|
return 'renmin';
|
case '5':
|
return 'teyue';
|
}
|
}
|
})
|