微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
4.5 KiB

  1. // pages/apply/index.js
  2. const app = getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. isIPX: app.globalData.isIPX,
  9. show:false,
  10. time:"2022-1-22",
  11. srje:0,
  12. crzh:123132,
  13. srlx:"发包收入",
  14. djbm:3423497895934633,
  15. bzsm:"收合同2022年第一季度款",
  16. fkr:"列示合同乙方或填写",
  17. htbm:"DZ000001",
  18. sjPics:[],
  19. fpPics:[],
  20. qtPics:[],
  21. count:9
  22. },
  23. /**
  24. * 生命周期函数--监听页面加载
  25. */
  26. onLoad: function (options) {
  27. },
  28. back:function(){
  29. wx.navigateBack({
  30. delta: 1
  31. })
  32. },
  33. uploadSjPics: function (e) { //这里是选取图片的方法
  34. var that = this;
  35. var pics = [];
  36. var detailPics = that.data.sjPics;
  37. if (detailPics.length >= that.data.count) {
  38. wx.showToast({
  39. title: '最多选择' + that.data.count + '张!',
  40. })
  41. return;
  42. }
  43. wx.chooseImage({
  44. count: that.data.count, // 最多可以选择的图片张数,默认9
  45. sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有
  46. sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有
  47. success: function (res) {
  48. var imgs = res.tempFilePaths;
  49. for (var i = 0; i < imgs.length; i++) {
  50. pics.push(imgs[i])
  51. }
  52. that.uploadimg({
  53. url: "http://www.test.com//test-api/wechat/applet/api/uploadUserAvatar", //这里是你图片上传的接口
  54. path: pics, //这里是选取的图片的地址数组
  55. });
  56. },
  57. })
  58. },
  59. uploadFpPics: function (e) { //这里是选取图片的方法
  60. var that = this;
  61. var pics = [];
  62. var detailPics = that.data.fpPics;
  63. if (detailPics.length >= that.data.count) {
  64. wx.showToast({
  65. title: '最多选择' + that.data.count + '张!',
  66. })
  67. return;
  68. }
  69. wx.chooseImage({
  70. count: that.data.count, // 最多可以选择的图片张数,默认9
  71. sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有
  72. sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有
  73. success: function (res) {
  74. var imgs = res.tempFilePaths;
  75. for (var i = 0; i < imgs.length; i++) {
  76. pics.push(imgs[i])
  77. }
  78. that.uploadimg({
  79. url: "http://www.test.com//test-api/wechat/applet/api/uploadUserAvatar", //这里是你图片上传的接口
  80. path: pics, //这里是选取的图片的地址数组
  81. });
  82. },
  83. })
  84. },
  85. uploadQtPics: function (e) { //这里是选取图片的方法
  86. var that = this;
  87. var pics = [];
  88. var detailPics = that.data.qtPics;
  89. if (detailPics.length >= that.data.count) {
  90. wx.showToast({
  91. title: '最多选择' + that.data.count + '张!',
  92. })
  93. return;
  94. }
  95. wx.chooseImage({
  96. count: that.data.count, // 最多可以选择的图片张数,默认9
  97. sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有
  98. sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有
  99. success: function (res) {
  100. var imgs = res.tempFilePaths;
  101. for (var i = 0; i < imgs.length; i++) {
  102. pics.push(imgs[i])
  103. }
  104. that.uploadimg({
  105. url: "http://www.test.com//test-api/wechat/applet/api/uploadUserAvatar", //这里是你图片上传的接口
  106. path: pics, //这里是选取的图片的地址数组
  107. });
  108. },
  109. })
  110. },
  111. swichAccounting:function(e){
  112. console.log(e.currentTarget.dataset.current);
  113. // let cur = e.currentTarget.dataset.current;
  114. // if (this.data.currentTaB == cur) {
  115. // return false;
  116. // }else{
  117. // wx.navigateTo({
  118. // url: '../inCome/index?id=' + id,
  119. // })
  120. // }
  121. wx.navigateTo({
  122. url: '../inCome/accounting/index?',
  123. })
  124. },
  125. /**
  126. * 生命周期函数--监听页面初次渲染完成
  127. */
  128. onReady: function () {
  129. },
  130. /**
  131. * 生命周期函数--监听页面显示
  132. */
  133. onShow: function () {
  134. },
  135. /**
  136. * 生命周期函数--监听页面隐藏
  137. */
  138. onHide: function () {
  139. },
  140. /**
  141. * 生命周期函数--监听页面卸载
  142. */
  143. onUnload: function () {
  144. },
  145. /**
  146. * 页面相关事件处理函数--监听用户下拉动作
  147. */
  148. onPullDownRefresh: function () {
  149. },
  150. /**
  151. * 页面上拉触底事件的处理函数
  152. */
  153. onReachBottom: function () {
  154. },
  155. /**
  156. * 用户点击右上角分享
  157. */
  158. onShareAppMessage: function () {
  159. }
  160. })