微信小程序
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

284 satır
7.7 KiB

  1. // pages/handle/liist.js
  2. import * as UTIL from '../../../utils/util.js';
  3. import * as API from '../../../utils/API.js';
  4. const app = getApp();
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. isIPX: app.globalData.isIPX,
  11. pageNums:1,
  12. scrollHeight:"",
  13. financeList:[],
  14. index:0,
  15. array:["收支明细公开"],
  16. userInfoObj:[],
  17. date: UTIL.formatDates(new Date),
  18. data:{},
  19. list:[],
  20. msgTime:0,
  21. msgText:"",
  22. showPopup:false
  23. },
  24. onConfirmReviewTime(e){
  25. let data = e.detail.value;
  26. this.setData({
  27. 'date':data,
  28. 'pageNums':1});
  29. this.getList();
  30. },
  31. paging(){
  32. this.setData({
  33. pageNums:this.data.pageNums+1,
  34. })
  35. this.getList();
  36. },
  37. getList(id){
  38. UTIL.httpRequest(API.URL_GET_TRANSFERINFO+id, {method:'GET'},{
  39. success: (res) => {
  40. if(res.code == 200){
  41. res.data.expenditureAmount = Number(res.data.expenditureAmount ).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
  42. return $1 + ","; }).replace(/\.$/, "")
  43. this.setData({'data':res.data})
  44. }else{
  45. UTIL.showToastNoneIcon(res.msg);
  46. }
  47. }
  48. })
  49. UTIL.httpRequest(API.URL_GET_TRANSFERINFOS+id, {method:'GET'},{
  50. success: (res) => {
  51. if(res.code == 200){
  52. res.rows.map(rr => {
  53. rr.incomeAmount = Number(rr.incomeAmount ).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
  54. return $1 + ","; }).replace(/\.$/, "")
  55. })
  56. this.setData({'list':res.rows})
  57. }else{
  58. UTIL.showToastNoneIcon(res.msg);
  59. }
  60. }
  61. })
  62. },
  63. /**
  64. * 生命周期函数--监听页面加载
  65. */
  66. onLoad: function (options) {
  67. this.getList(options.id)
  68. },
  69. goSubmit(){
  70. let _this = this
  71. if(this.data.data.bankType!=4){
  72. if(this.data.data.expenditureAmount > 50000&&this.data.data.bankType == '3'){
  73. wx.showModal({
  74. title: "",
  75. showCancel: false,
  76. showComfirm: false,
  77. content: "银行仅在工作日的9:00~17:00之间接收金额大于5万元的交易申请,不在此服务时间段内提交申请将导致交易失败!",
  78. confirmText: '确定',
  79. success: function (e) {
  80. //非建行
  81. if(_this.data.data.accountPassword==null||_this.data.data.accountPassword.length<1){
  82. UTIL.showToastNoneIcon("请输入支付口令!");
  83. }else{
  84. _this.setData({'showPopup':true})
  85. }
  86. }
  87. })
  88. }else if(this.data.data.bankType == '2'&&this.data.list.length>1&&this.data.data.isPeers == 'Y'){
  89. wx.showModal({
  90. title: "",
  91. showCancel: false,
  92. content: "同行批量转账业务银行仅支持在每日9:00-17:00之间办理,交易请求接受成功后银行会在次日3:30统一进行处理,正常1小时内处理完成,请在此时间后查询处理结果!",
  93. confirmText: '确定',
  94. success: function (e) {
  95. //非建行
  96. if(_this.data.data.accountPassword==null||_this.data.data.accountPassword.length<1){
  97. UTIL.showToastNoneIcon("请输入支付口令!");
  98. }else{
  99. _this.setData({'showPopup':true})
  100. }
  101. }
  102. })
  103. }else{
  104. wx.showModal({
  105. title: "",
  106. showCancel: false,
  107. content: "跨行批量转账业务银行仅支持在每日9:00-16:00之间办理,交易请求接受成功后银行会在当日17点-23点统一进行处理,请在此时间后查询处理结果!",
  108. confirmText: '确定',
  109. success: function (e) {
  110. //非建行
  111. if(_this.data.data.accountPassword==null||_this.data.data.accountPassword.length<1){
  112. UTIL.showToastNoneIcon("请输入支付口令!");
  113. }else{
  114. _this.setData({'showPopup':true})
  115. }
  116. }
  117. })
  118. }
  119. }else{
  120. //建行
  121. wx.showModal({
  122. title: "",
  123. showCancel: false,
  124. content: "跨行批量转账业务银行仅支持在每日9:00-16:00之间办理,交易请求接受成功后银行会在当日17点-23点统一进行处理,请在此时间后查询处理结果!",
  125. confirmText: '确定',
  126. success: function (e) {
  127. if(_this.data.data.alternateField1==null||_this.data.data.alternateField1.length<1){
  128. UTIL.showToastNoneIcon("请输入验证码!");
  129. }else{
  130. _this.setData({'showPopup':true})
  131. }
  132. }
  133. })
  134. }
  135. },
  136. bindNewInput: function (e) {
  137. this.setData({
  138. [e.currentTarget.dataset.name]: e.detail.value
  139. })
  140. },
  141. confirmPay(){
  142. let _this = this
  143. this.setData({'showPopup':false})
  144. if(this.data.data.bankType!=4){
  145. let params = {
  146. id : this.data.data.id,
  147. accountPassword:this.data.data.accountPassword
  148. }
  149. UTIL.httpRequest(API.URL_GET_PAY,params,{
  150. success: (res) => {
  151. wx.showModal({
  152. title: "",
  153. showCancel: false,
  154. content: "支付成功,请等待银行进行处理,稍后可通过查询结果按钮查询银行处理结果。",
  155. confirmText: '确定',
  156. success: function (e) {
  157. _this.back()
  158. }
  159. })
  160. },
  161. fail:(res) => {
  162. UTIL.showToastNoneIcon(res)
  163. }
  164. })
  165. }else{
  166. let params = {
  167. id : this.data.data.id,
  168. accountPassword:this.data.data.accountPassword
  169. }
  170. UTIL.httpRequest(API.URL_GET_PAY,params,{
  171. success: (res) => {
  172. wx.showModal({
  173. title: "",
  174. showCancel: false,
  175. content: "支付成功,请等待银行进行处理,稍后可通过查询结果按钮查询银行处理结果。",
  176. confirmText: '确定',
  177. success: function (e) {
  178. _this.back()
  179. }
  180. })
  181. },
  182. fail:(res) => {
  183. UTIL.showToastNoneIcon(res)
  184. }
  185. })
  186. }
  187. },
  188. cancelPay(){
  189. this.setData({'showPopup':false})
  190. },
  191. sendMsg(){
  192. let _this = this
  193. let params = {
  194. id : this.data.data.id
  195. }
  196. if(this.data.msgTime>0){
  197. return false
  198. }
  199. UTIL.httpRequest(API.URL_GET_SENDMSG,params,{
  200. success: (res) => {
  201. if (res.toString().indexOf('短信发送失败') == -1){
  202. _this.setData({'msgText':180+'s后可重新发送','msgTime':180})
  203. _this.msgTimer = setInterval(()=>{
  204. let tt = _this.data.msgTime
  205. _this.setData({'msgText':tt--+'s后可重新发送','msgTime':tt})
  206. if (_this.data.msgTime == 0){
  207. clearInterval(_this.msgTimer);
  208. _this.msgTime = 0 ;
  209. _this.smsText = '';
  210. }
  211. },1000)
  212. }else{
  213. UTIL.showToastNoneIcon("短信发送失败,请联系管理员!");
  214. }
  215. }
  216. })
  217. },
  218. bindPickerChange:function(e){
  219. this.setData({index:e.detail.value});
  220. },
  221. switchTab:function(e){
  222. this.setData({
  223. active:e.currentTarget.dataset.gid
  224. })
  225. },
  226. back:function(){
  227. wx.navigateBack({
  228. delta: 1
  229. })
  230. },
  231. /**
  232. * 生命周期函数--监听页面初次渲染完成
  233. */
  234. onReady: function () {
  235. },
  236. /**
  237. * 生命周期函数--监听页面显示
  238. */
  239. onShow: function () {
  240. },
  241. /**
  242. * 生命周期函数--监听页面隐藏
  243. */
  244. onHide: function () {
  245. },
  246. /**
  247. * 生命周期函数--监听页面卸载
  248. */
  249. onUnload: function () {
  250. },
  251. /**
  252. * 页面相关事件处理函数--监听用户下拉动作
  253. */
  254. onPullDownRefresh: function () {
  255. },
  256. /**
  257. * 页面上拉触底事件的处理函数
  258. */
  259. onReachBottom: function () {
  260. },
  261. /**
  262. * 用户点击右上角分享
  263. */
  264. onShareAppMessage: function () {
  265. }
  266. })