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

313 lines
8.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. 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.alternateField1==null||_this.data.data.alternateField1.length<1){
  113. // UTIL.showToastNoneIcon("请输入验证码!");
  114. // }else{
  115. // _this.setData({'showPopup':true})
  116. // }
  117. if(_this.data.data.accountPassword==null||_this.data.data.accountPassword.length<1){
  118. UTIL.showToastNoneIcon("请输入支付口令!");
  119. }else{
  120. _this.setData({'showPopup':true})
  121. }
  122. }
  123. })
  124. }
  125. }else{
  126. //建行
  127. wx.showModal({
  128. title: "",
  129. showCancel: false,
  130. content: "跨行批量转账业务银行仅支持在每日9:00-16:00之间办理,交易请求接受成功后银行会在当日17点-23点统一进行处理,请在此时间后查询处理结果!",
  131. confirmText: '确定',
  132. success: function (e) {
  133. if(_this.data.data.alternateField1==null||_this.data.data.alternateField1.length<1){
  134. UTIL.showToastNoneIcon("请输入验证码!");
  135. }else{
  136. _this.setData({'showPopup':true})
  137. }
  138. }
  139. })
  140. }
  141. },
  142. bindNewInput: function (e) {
  143. this.setData({
  144. [e.currentTarget.dataset.name]: e.detail.value
  145. })
  146. },
  147. confirmPay(){
  148. let _this = this
  149. this.setData({'showPopup':false})
  150. console.log(this.data.data.bankType);
  151. if(this.data.data.bankType==4){
  152. let params = {
  153. id : this.data.data.id,
  154. alternateField1:this.data.data.alternateField1,
  155. bankType: this.data.data.bankType
  156. }
  157. UTIL.httpRequest(API.URL_GET_PAY,params,{
  158. success: (res) => {
  159. wx.showModal({
  160. title: "",
  161. showCancel: false,
  162. content: "支付成功,请等待银行进行处理,稍后可通过查询结果按钮查询银行处理结果。",
  163. confirmText: '确定',
  164. success: function (e) {
  165. _this.back()
  166. }
  167. })
  168. },
  169. fail:(res) => {
  170. UTIL.showToastNoneIcon(res)
  171. }
  172. })
  173. }else{
  174. let params = {
  175. id : this.data.data.id,
  176. accountPassword:this.data.data.accountPassword,
  177. bankType: this.data.data.bankType
  178. }
  179. UTIL.httpRequest(API.URL_GET_PAY,params,{
  180. success: (res) => {
  181. if (res.code == API.SUCCESS_CODE) {
  182. wx.showModal({
  183. title: "",
  184. showCancel: false,
  185. content: "支付成功,请等待银行进行处理,稍后可通过查询结果按钮查询银行处理结果。",
  186. confirmText: '确定',
  187. success: function (e) {
  188. _this.back()
  189. }
  190. })
  191. }else{
  192. wx.showModal({
  193. title: "",
  194. showCancel: false,
  195. content: res.msg,
  196. confirmText: '确定',
  197. success: function (e) {
  198. }
  199. })
  200. }
  201. },
  202. fail:(res) => {
  203. UTIL.showToastNoneIcon(res)
  204. }
  205. })
  206. }
  207. },
  208. cancelPay(){
  209. this.setData({'showPopup':false})
  210. },
  211. sendMsg(){
  212. let _this = this
  213. let params = {
  214. id : this.data.data.id,
  215. bankType: this.data.data.bankType
  216. }
  217. if(this.data.msgTime>0){
  218. return false
  219. }
  220. UTIL.httpRequest(API.URL_GET_SENDMSG,params,{
  221. success: (res) => {
  222. if (res.code == API.SUCCESS_CODE) {
  223. if (res.toString().indexOf('短信发送失败') == -1){
  224. _this.setData({'msgText':180+'s后可重新发送','msgTime':180})
  225. _this.msgTimer = setInterval(()=>{
  226. let tt = _this.data.msgTime
  227. _this.setData({'msgText':tt--+'s后可重新发送','msgTime':tt})
  228. if (_this.data.msgTime == 0){
  229. clearInterval(_this.msgTimer);
  230. _this.msgTime = 0 ;
  231. _this.smsText = '';
  232. }
  233. },1000)
  234. }else{
  235. UTIL.showToastNoneIcon("短信发送失败,请联系管理员!");
  236. }
  237. }else{
  238. UTIL.showToastNoneIcon(res.msg);
  239. }
  240. },
  241. fail:(res) => {
  242. UTIL.showToastNoneIcon(res)
  243. }
  244. })
  245. },
  246. bindPickerChange:function(e){
  247. this.setData({index:e.detail.value});
  248. },
  249. switchTab:function(e){
  250. this.setData({
  251. active:e.currentTarget.dataset.gid
  252. })
  253. },
  254. back:function(){
  255. wx.navigateBack({
  256. delta: 1
  257. })
  258. },
  259. /**
  260. * 生命周期函数--监听页面初次渲染完成
  261. */
  262. onReady: function () {
  263. },
  264. /**
  265. * 生命周期函数--监听页面显示
  266. */
  267. onShow: function () {
  268. },
  269. /**
  270. * 生命周期函数--监听页面隐藏
  271. */
  272. onHide: function () {
  273. },
  274. /**
  275. * 生命周期函数--监听页面卸载
  276. */
  277. onUnload: function () {
  278. },
  279. /**
  280. * 页面相关事件处理函数--监听用户下拉动作
  281. */
  282. onPullDownRefresh: function () {
  283. },
  284. /**
  285. * 页面上拉触底事件的处理函数
  286. */
  287. onReachBottom: function () {
  288. },
  289. /**
  290. * 用户点击右上角分享
  291. */
  292. onShareAppMessage: function () {
  293. }
  294. })