微信小程序
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

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