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

3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. // pages/payee/index.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. list: {},
  12. result: "",
  13. bankTypeOptions:[]
  14. },
  15. /**
  16. * 生命周期函数--监听页面加载
  17. */
  18. onLoad(options) {
  19. console.log(options)
  20. var that = this;
  21. that.setData({
  22. isPeers:options.isPeers,//是否同行
  23. bankType:options.bankType,//所属银行
  24. accountType:options.accountType,//账户类型
  25. payeeType:options.transferType,//申请转帐类型
  26. index:options.index
  27. })
  28. // 获取收款账号列表
  29. let prames = {
  30. pageNum:1,
  31. pageSize:999,
  32. orderByColumn:'id',
  33. isAsc:'asc',
  34. isPeers:options.isPeers,//是否同行
  35. bankType:options.bankType,//所属银行
  36. accountType:options.accountType,//账户类型
  37. payeeType:options.transferType,//申请转帐类型
  38. status:'0',
  39. method:'GET'
  40. }
  41. console.log(prames);
  42. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
  43. success: (res) => {
  44. that.setData({
  45. bankTypeOptions:res.data,
  46. })
  47. }
  48. })
  49. UTIL.httpRequest(API.URL_GET_SELECTLIST , prames, {
  50. success: (res) => {
  51. let array = res.rows ;
  52. for (let i = 0; i < array.length; i++) {
  53. array[i].payeeAccountText = array[i].payeeAccount.replace(/^(.{6})(?:\d+)(.{4})$/,"\$1****\$2");
  54. array[i].bankTypeText = (that.data.bankTypeOptions.filter(function (e) { return e.dictValue == array[i].bankType; }))[0].dictLabel;
  55. }
  56. that.setData({
  57. list:array,
  58. })
  59. }
  60. })
  61. },
  62. goAdd(){
  63. wx.navigateTo({
  64. url: 'add/add',
  65. })
  66. },
  67. goSearch(e){
  68. var that = this;
  69. // 获取收款账号列表
  70. let prames = {
  71. pageNum:1,
  72. pageSize:999,
  73. orderByColumn:'id',
  74. isAsc:'asc',
  75. isPeers:that.data.isPeers,//是否同行
  76. bankType:that.data.bankType,//所属银行
  77. accountType:that.data.accountType,//账户类型
  78. payeeType:that.data.payeeType,//申请转帐类型
  79. status:'0',
  80. name:e.detail,
  81. method:'GET'
  82. }
  83. console.log(prames);
  84. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
  85. success: (res) => {
  86. that.setData({
  87. bankTypeOptions:res.data,
  88. })
  89. }
  90. })
  91. UTIL.httpRequest(API.URL_GET_PAYEESELECTLIST , prames, {
  92. success: (res) => {
  93. let array = res.rows ;
  94. for (let i = 0; i < array.length; i++) {
  95. array[i].payeeAccountText = array[i].payeeAccount.replace(/^(.{6})(?:\d+)(.{4})$/,"\$1****\$2");
  96. array[i].bankTypeText = (that.data.bankTypeOptions.filter(function (e) { return e.dictValue == array[i].bankType; }))[0].dictLabel;
  97. }
  98. that.setData({
  99. list:array,
  100. })
  101. }
  102. })
  103. },
  104. /**
  105. * 生命周期函数--监听页面初次渲染完成
  106. */
  107. onReady() {
  108. },
  109. /**
  110. * 生命周期函数--监听页面显示
  111. */
  112. onShow() {
  113. },
  114. onChange(event) {
  115. console.log(event);
  116. this.setData({
  117. result: event.detail,
  118. });
  119. },
  120. toggle(event) {
  121. const { index } = event.currentTarget.dataset;
  122. const checkbox = this.selectComponent(`.checkboxes-${index}`);
  123. checkbox.toggle();
  124. },
  125. back:function(){
  126. wx.navigateBack({
  127. delta: 1
  128. })
  129. },
  130. noop() {},
  131. goSubmit(){
  132. var that = this;
  133. if(that.data.result == ''){
  134. UTIL.showToastNoneIcon('请选择一个收款人!');
  135. return;
  136. }
  137. let array = that.data.list.filter(function (e) { return e.id == that.data.result; });
  138. console.log(array);
  139. let pages = getCurrentPages();
  140. let currentPage = null; //当前页面
  141. let prevPage = null; //上一个页面
  142. currentPage = pages[pages.length - 1]; //获取当前页面,将其赋值
  143. prevPage = pages[pages.length - 2]; //获取上一个页面,将其赋值
  144. if (prevPage) {
  145. prevPage.setData({
  146. ["form.transfers["+that.data.index+"].payeeList[0]"]: array[0]//将想要传的信息赋值给上一个页面data中的值
  147. })
  148. that.back()
  149. }
  150. },
  151. /**
  152. * 生命周期函数--监听页面隐藏
  153. */
  154. onHide() {
  155. },
  156. /**
  157. * 生命周期函数--监听页面卸载
  158. */
  159. onUnload() {
  160. },
  161. /**
  162. * 页面相关事件处理函数--监听用户下拉动作
  163. */
  164. onPullDownRefresh() {
  165. },
  166. /**
  167. * 页面上拉触底事件的处理函数
  168. */
  169. onReachBottom() {
  170. },
  171. /**
  172. * 用户点击右上角分享
  173. */
  174. onShareAppMessage() {
  175. }
  176. })