strategy-a.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. var businessT = require('../../../../tool/business-tool.js')
  2. var sysT = require('../../../../tool/sys-tool.js')
  3. var businessType = require('../../../../public/business-type.js')
  4. var p = require('../../public/model/public.js')
  5. import PurchaseOrder from '../../public/model/purchaseOrder.js'
  6. Page({
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. citys: {
  12. t: ['北京', '上海', '广州', '深圳', '杭州'],
  13. s: '0',
  14. a: {},
  15. c: [['贷款买房前,必须已连续足额缴存', '12个月', '住房公积金,申请公积金贷款时须正常缴存。'],
  16. ['贷款买房前,已连续', '6个月', '正常缴存住房公积金,即可申请公积金贷款。'],
  17. ['本市户籍职工', '必须连续足额缴存', '1年', '(含)以上,', '非本市户籍职工', '必须连续足额缴存', '2年', '(含)以上,即可申请公积金贷款。'],
  18. ['贷款买房前,已连续足额缴存', '6个月', '(含)以上住房公积金,即可申请公积金贷款。'],
  19. ['贷款买房前,按规定正常足额缴存住房公积金,且在申请公积金贷款时,已连续缴存', '6个月', '(含)以上']]
  20. },
  21. bgScrollView: {
  22. scroll: false,
  23. left: 0
  24. },
  25. tab: {
  26. t: 'a',//s社保a公积金
  27. s: '0',
  28. i: ['公积金权益', '公积金缴存', '公积金查询']
  29. }
  30. },
  31. goToPurchase: businessT.action(function (sender) {
  32. wx.navigateTo({
  33. url: '../purchase-a-details/purchase-a-details?isSupplementaryPay=0',
  34. })
  35. }),
  36. changeCity: businessT.action(function (sender) {
  37. businessT.debugLog(sender.currentTarget.id)
  38. if (sender.currentTarget.id == this.data.citys.s) {
  39. return
  40. }
  41. this.data.citys.s = sender.currentTarget.id
  42. var x = sender.currentTarget.id * 120 * sysT.rpxToPx()
  43. businessT.debugLog(x)
  44. var animation = wx.createAnimation({
  45. duration: 300,
  46. timingFunction: 'ease',
  47. })
  48. animation.translateX(x).step()
  49. this.data.citys.a = animation.export()
  50. this.setData({
  51. citys: this.data.citys
  52. })
  53. }),
  54. tabAction: businessT.action(function (sender) {
  55. if (sender.currentTarget.id == this.data.tab.s) {
  56. return
  57. }
  58. this.chageTabAction(sender.currentTarget.id)
  59. }),
  60. chageTabAction: function (index) {
  61. this.data.bgScrollView.scroll = true;
  62. this.setData({
  63. bgScrollView: this.data.bgScrollView
  64. })
  65. var animation = wx.createAnimation({
  66. duration: 300,
  67. timingFunction: 'ease',
  68. })
  69. var w = sysT.sysInfo().windowWidth
  70. var s = index
  71. animation.translateX(s * w / 3).step()
  72. this.data.bgScrollView.left = s * sysT.sysInfo().windowWidth
  73. this.data.tab.s = index
  74. this.data.bgScrollView.scroll = false;
  75. this.setData({
  76. tab: this.data.tab,
  77. bgScrollView: this.data.bgScrollView
  78. })
  79. },
  80. /**
  81. * 生命周期函数--监听页面加载
  82. */
  83. onLoad: function (options) {
  84. if (options.page) {
  85. this.chageTabAction(options.page)
  86. }
  87. },
  88. /**
  89. * 生命周期函数--监听页面初次渲染完成
  90. */
  91. onReady: function () {
  92. },
  93. /**
  94. * 生命周期函数--监听页面显示
  95. */
  96. onShow: function () {
  97. var order = new PurchaseOrder()
  98. order.setCity()
  99. p.setOrder(order)
  100. },
  101. /**
  102. * 生命周期函数--监听页面隐藏
  103. */
  104. onHide: function () {
  105. },
  106. /**
  107. * 生命周期函数--监听页面卸载
  108. */
  109. onUnload: function () {
  110. },
  111. /**
  112. * 页面相关事件处理函数--监听用户下拉动作
  113. */
  114. onPullDownRefresh: function () {
  115. },
  116. /**
  117. * 页面上拉触底事件的处理函数
  118. */
  119. onReachBottom: function () {
  120. },
  121. /**
  122. * 用户点击右上角分享
  123. */
  124. onShareAppMessage: function () {
  125. return {
  126. path: '/page/home/index',
  127. imageUrl: '../../../../icon/public/share_img.png',
  128. title: '自助缴社保公积金,覆盖200多个城市,专业团队操作'
  129. }
  130. }
  131. })