const app = getApp();
|
Page({
|
data: {
|
img1: app.globalData.imgUrl + '/image/img1.png',
|
img2: app.globalData.imgUrl + '/image/pic_a.png',
|
img3: app.globalData.imgUrl + '/image/pic_b.png',
|
img4: app.globalData.imgUrl + '/image/pic_c.png',
|
img5: app.globalData.imgUrl + '/image/pic_d.png',
|
img6: app.globalData.imgUrl + '/image/pic_e.png',
|
img7: app.globalData.imgUrl + '/image/pic_f.png',
|
srcollMsg: '暂无办理信息'
|
},
|
onLoad: function(options) {
|
var that = this;
|
wx.request({
|
url: app.globalData.url + '/api/v1/pictures/finds?businessType=25&status=2',
|
success: function(res) {
|
var srcollMsg = '';
|
if (res.data.code == 0) {
|
for (var i = 0; i < res.data.data.length; i++) {
|
var name = '';
|
if (res.data.data[i].userName.length == 2){
|
name = plusXing(res.data.data[i].userName, 1, 0, '*');
|
} else if(res.data.data[i].userName.length == 3){
|
name = plusXing(res.data.data[i].userName, 1, 1, '*');
|
}else{
|
name = plusXing(res.data.data[i].userName, 1, 2, '*');
|
}
|
|
srcollMsg +=name + "成功办理" + picType(res.data.data[i].picType) + "上报;"
|
}
|
}
|
console.log(srcollMsg)
|
that.setData({
|
srcollMsg
|
})
|
}
|
})
|
},
|
publicSnapshot: function(e) {
|
var picType = e.currentTarget.dataset.type;
|
wx.navigateTo({
|
url: '../publicSnapshot/publicSnapshot?id=new&type=' + picType,
|
})
|
},
|
})
|
|
function picType(type) {
|
switch (type) {
|
case "1":
|
return "生态环境与资源保护领域";
|
case "2":
|
return "食品药品安全领域";
|
case "3":
|
return "文物保护领域";
|
case "4":
|
return "英雄烈士保护领域";
|
case "5":
|
return "国有财产保护领域";
|
case "6":
|
return "国有土地出让领域";
|
}
|
}
|
|
function plusXing(str, frontLen, endLen, cha) {
|
var len = str.length - frontLen - endLen;
|
var xing = '';
|
for (var i = 0; i < len; i++) {
|
xing += cha;
|
|
}
|
return str.substring(0, frontLen) + xing + str.substring(str.length - endLen);
|
|
};
|