// pages/apply/index.js const app = getApp(); Page({ /** * 页面的初始数据 */ data: { isIPX: app.globalData.isIPX, show:false, time:"2022-1-22", srje:0, crzh:123132, srlx:"发包收入", djbm:3423497895934633, bzsm:"收合同2022年第一季度款", fkr:"列示合同乙方或填写", htbm:"DZ000001", sjPics:[], fpPics:[], qtPics:[], count:9 }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, back:function(){ wx.navigateBack({ delta: 1 }) }, uploadSjPics: function (e) { //这里是选取图片的方法 var that = this; var pics = []; var detailPics = that.data.sjPics; if (detailPics.length >= that.data.count) { wx.showToast({ title: '最多选择' + that.data.count + '张!', }) return; } wx.chooseImage({ count: that.data.count, // 最多可以选择的图片张数,默认9 sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 success: function (res) { var imgs = res.tempFilePaths; for (var i = 0; i < imgs.length; i++) { pics.push(imgs[i]) } that.uploadimg({ url: "http://www.test.com//test-api/wechat/applet/api/uploadUserAvatar", //这里是你图片上传的接口 path: pics, //这里是选取的图片的地址数组 }); }, }) }, uploadFpPics: function (e) { //这里是选取图片的方法 var that = this; var pics = []; var detailPics = that.data.fpPics; if (detailPics.length >= that.data.count) { wx.showToast({ title: '最多选择' + that.data.count + '张!', }) return; } wx.chooseImage({ count: that.data.count, // 最多可以选择的图片张数,默认9 sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 success: function (res) { var imgs = res.tempFilePaths; for (var i = 0; i < imgs.length; i++) { pics.push(imgs[i]) } that.uploadimg({ url: "http://www.test.com//test-api/wechat/applet/api/uploadUserAvatar", //这里是你图片上传的接口 path: pics, //这里是选取的图片的地址数组 }); }, }) }, uploadQtPics: function (e) { //这里是选取图片的方法 var that = this; var pics = []; var detailPics = that.data.qtPics; if (detailPics.length >= that.data.count) { wx.showToast({ title: '最多选择' + that.data.count + '张!', }) return; } wx.chooseImage({ count: that.data.count, // 最多可以选择的图片张数,默认9 sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 success: function (res) { var imgs = res.tempFilePaths; for (var i = 0; i < imgs.length; i++) { pics.push(imgs[i]) } that.uploadimg({ url: "http://www.test.com//test-api/wechat/applet/api/uploadUserAvatar", //这里是你图片上传的接口 path: pics, //这里是选取的图片的地址数组 }); }, }) }, swichAccounting:function(e){ console.log(e.currentTarget.dataset.current); // let cur = e.currentTarget.dataset.current; // if (this.data.currentTaB == cur) { // return false; // }else{ // wx.navigateTo({ // url: '../inCome/index?id=' + id, // }) // } wx.navigateTo({ url: '../inCome/accounting/index?', }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })