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

308 lines
8.5 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. }
  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. console.log(this.data.data.bankType);
  146. if(this.data.data.bankType==4){
  147. let params = {
  148. id : this.data.data.id,
  149. alternateField1:this.data.data.alternateField1,
  150. bankType: this.data.data.bankType
  151. }
  152. UTIL.httpRequest(API.URL_GET_PAY,params,{
  153. success: (res) => {
  154. wx.showModal({
  155. title: "",
  156. showCancel: false,
  157. content: "支付成功,请等待银行进行处理,稍后可通过查询结果按钮查询银行处理结果。",
  158. confirmText: '确定',
  159. success: function (e) {
  160. _this.back()
  161. }
  162. })
  163. },
  164. fail:(res) => {
  165. UTIL.showToastNoneIcon(res)
  166. }
  167. })
  168. }else{
  169. let params = {
  170. id : this.data.data.id,
  171. accountPassword:this.data.data.accountPassword,
  172. bankType: this.data.data.bankType
  173. }
  174. UTIL.httpRequest(API.URL_GET_PAY,params,{
  175. success: (res) => {
  176. if (res.code == API.SUCCESS_CODE) {
  177. wx.showModal({
  178. title: "",
  179. showCancel: false,
  180. content: "支付成功,请等待银行进行处理,稍后可通过查询结果按钮查询银行处理结果。",
  181. confirmText: '确定',
  182. success: function (e) {
  183. _this.back()
  184. }
  185. })
  186. }else{
  187. wx.showModal({
  188. title: "",
  189. showCancel: false,
  190. content: res.msg,
  191. confirmText: '确定',
  192. success: function (e) {
  193. }
  194. })
  195. }
  196. },
  197. fail:(res) => {
  198. UTIL.showToastNoneIcon(res)
  199. }
  200. })
  201. }
  202. },
  203. cancelPay(){
  204. this.setData({'showPopup':false})
  205. },
  206. sendMsg(){
  207. let _this = this
  208. let params = {
  209. id : this.data.data.id,
  210. bankType: this.data.data.bankType
  211. }
  212. if(this.data.msgTime>0){
  213. return false
  214. }
  215. UTIL.httpRequest(API.URL_GET_SENDMSG,params,{
  216. success: (res) => {
  217. if (res.code == API.SUCCESS_CODE) {
  218. if (res.toString().indexOf('短信发送失败') == -1){
  219. _this.setData({'msgText':180+'s后可重新发送','msgTime':180})
  220. _this.msgTimer = setInterval(()=>{
  221. let tt = _this.data.msgTime
  222. _this.setData({'msgText':tt--+'s后可重新发送','msgTime':tt})
  223. if (_this.data.msgTime == 0){
  224. clearInterval(_this.msgTimer);
  225. _this.msgTime = 0 ;
  226. _this.smsText = '';
  227. }
  228. },1000)
  229. }else{
  230. UTIL.showToastNoneIcon("短信发送失败,请联系管理员!");
  231. }
  232. }else{
  233. UTIL.showToastNoneIcon(res.msg);
  234. }
  235. },
  236. fail:(res) => {
  237. UTIL.showToastNoneIcon(res)
  238. }
  239. })
  240. },
  241. bindPickerChange:function(e){
  242. this.setData({index:e.detail.value});
  243. },
  244. switchTab:function(e){
  245. this.setData({
  246. active:e.currentTarget.dataset.gid
  247. })
  248. },
  249. back:function(){
  250. wx.navigateBack({
  251. delta: 1
  252. })
  253. },
  254. /**
  255. * 生命周期函数--监听页面初次渲染完成
  256. */
  257. onReady: function () {
  258. },
  259. /**
  260. * 生命周期函数--监听页面显示
  261. */
  262. onShow: function () {
  263. },
  264. /**
  265. * 生命周期函数--监听页面隐藏
  266. */
  267. onHide: function () {
  268. },
  269. /**
  270. * 生命周期函数--监听页面卸载
  271. */
  272. onUnload: function () {
  273. },
  274. /**
  275. * 页面相关事件处理函数--监听用户下拉动作
  276. */
  277. onPullDownRefresh: function () {
  278. },
  279. /**
  280. * 页面上拉触底事件的处理函数
  281. */
  282. onReachBottom: function () {
  283. },
  284. /**
  285. * 用户点击右上角分享
  286. */
  287. onShareAppMessage: function () {
  288. }
  289. })