微信小程序
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. // pages/bank/add/add.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. showBankType:false,
  12. form:{
  13. sheng: "", //省 必填
  14. shi: "", //市 必填
  15. bankType: "", //所属银行 必填
  16. bankDeposit: "", //开户行 必填
  17. payeePaymentLines: "", //联行号 //必填
  18. }
  19. },
  20. back:function(){
  21. wx.navigateBack({
  22. delta: 1
  23. })
  24. },
  25. /**
  26. * 生命周期函数--监听页面加载
  27. */
  28. onLoad(options) {
  29. },
  30. /**
  31. * 生命周期函数--监听页面初次渲染完成
  32. */
  33. onReady() {
  34. },
  35. /**
  36. * 生命周期函数--监听页面显示
  37. */
  38. onShow() {
  39. var that = this;
  40. //所属银行
  41. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
  42. success: (res) => {
  43. this.setData({
  44. bankTypeOptions:res.data
  45. });
  46. }
  47. })
  48. },
  49. openBox(even){
  50. console.log(even.currentTarget.dataset.name);
  51. this.setData({
  52. [even.currentTarget.dataset.name]:true
  53. })
  54. },
  55. closeBox(even){
  56. console.log(even.currentTarget.dataset.name);
  57. this.setData({
  58. [even.currentTarget.dataset.name]:false
  59. })
  60. },
  61. onConfirm(even){
  62. var that = this ;
  63. if(even.currentTarget.dataset.name == "showBankType"){
  64. // 付款方式类型字典查询
  65. UTIL.httpRequest(API.URL_GET_DEPOSITLIST, {method:'GET',bankType:even.detail.value.dictValue,status:'0'}, {
  66. success: (res) => {
  67. that.setData({
  68. depositOptions:res.rows,
  69. })
  70. }
  71. })
  72. }
  73. this.setData({
  74. [even.currentTarget.dataset.value]:even.detail.value.dictValue,
  75. [even.currentTarget.dataset.value+"Text"]:even.detail.value.dictLabel,
  76. [even.currentTarget.dataset.name]:false,
  77. })
  78. },
  79. onConfirmDeposit(even){
  80. this.setData({
  81. [even.currentTarget.dataset.value]:even.detail.value.bankDeposit,
  82. [even.currentTarget.dataset.value+"Text"]:even.detail.value.bankDeposit,
  83. [even.currentTarget.dataset.name]:false,
  84. ["form.payeePaymentLines"]:even.detail.value.payeePaymentLines
  85. })
  86. },
  87. onChange(even){
  88. console.log(even);
  89. this.setData({
  90. [even.currentTarget.dataset.formname]:even.detail
  91. })
  92. },
  93. goSubmit(){
  94. if(this.data.form.sheng===''||this.data.form.code==sheng){ //省
  95. UTIL.showToastNoneIcon('请填写省!');
  96. return false;
  97. }else if(this.data.form.shi===''||this.data.form.shi==null){ //市
  98. UTIL.showToastNoneIcon('请输入市!');
  99. return false;
  100. }else if(this.data.form.bankType===''||this.data.form.bankType==null){ //所属银行
  101. UTIL.showToastNoneIcon('请输入所属银行!');
  102. return false;
  103. }else if(this.data.form.bankDeposit===''||this.data.form.bankDeposit==null){ //开户行
  104. UTIL.showToastNoneIcon('请输入开户行!');
  105. return false;
  106. }else if(this.data.form.payeePaymentLines === ''||this.data.form.payeePaymentLines==null){//联行号
  107. UTIL.showToastNoneIcon('请输入联行号!');
  108. return false;
  109. }else{
  110. var that = this;
  111. that.data.form.method = 'POST';
  112. UTIL.httpRequest(API.URL_GET_DEPOSITADD, that.data.form, {
  113. success: (res) => {
  114. wx.showToast({
  115. title: "提交成功!",
  116. duration: 2000,
  117. icon:"success"
  118. })
  119. setTimeout(function(){
  120. wx.navigateBack({
  121. delta:1
  122. })
  123. },2000)
  124. }
  125. })
  126. }
  127. },
  128. /**
  129. * 生命周期函数--监听页面隐藏
  130. */
  131. onHide() {
  132. },
  133. /**
  134. * 生命周期函数--监听页面卸载
  135. */
  136. onUnload() {
  137. },
  138. /**
  139. * 页面相关事件处理函数--监听用户下拉动作
  140. */
  141. onPullDownRefresh() {
  142. },
  143. /**
  144. * 页面上拉触底事件的处理函数
  145. */
  146. onReachBottom() {
  147. },
  148. /**
  149. * 用户点击右上角分享
  150. */
  151. onShareAppMessage() {
  152. }
  153. })