微信小程序
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.

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