strategy-s.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. rights: {
  12. t: ['养老', '医疗', '失业', '工伤', '生育'],
  13. s: '0',
  14. a: {},
  15. },
  16. citys: {
  17. t: ['北京', '上海', '广州', '深圳', '杭州'],
  18. s: '0',
  19. a: {},
  20. c: [
  21. { c1: ['购房必须在本市连续缴纳', '5年社保', '或个税,具体还需根据办理时的要求而定。若因工作变动等原因造成未缴或补缴税款且不超过3个月,视为连续缴纳。'], c2: ['买车摇号须在本市连续缴纳', '5年社保', '不能断月(如有断月,补缴后有效)'] },
  22. { c1: ['购房必须在本市63个月内连续缴纳', '60个月', '的社保或个税'], c2: ['买车摇号必须在本市连续缴纳满', '3年社保'] },
  23. { c1: ['购房必须在本市连续缴纳', '5年社保', '或个税'], c2: ['买车摇号必须在本市连续缴纳满', '2年社保', '(不含补缴)'] },
  24. { c1: ['购房须在本市连续缴纳', '5年社保', '或个税,中间无间断'], c2: ['买车摇号必须在本市连续缴纳满', '2年社保', '(不含补缴)'] },
  25. { c1: ['购房须在杭州市购房之日起,前3年内连续缴纳', '2年社保', ',断缴不能超过3个月'], c2: ['买车摇号必须在本市连续缴纳满', '2年社保', '(不含补缴)'] }
  26. ]
  27. },
  28. bgScrollView: {
  29. scroll: false,
  30. left: 0
  31. },
  32. tab: {
  33. t: 's',//s社保a公积金
  34. s: '0',
  35. i: ['社保权益', '社保缴纳', '社保查询']
  36. },
  37. },
  38. goToPurchase: businessT.action(function (sender) {
  39. wx.navigateTo({
  40. url: '../purchase-s-details/purchase-s-details?isSupplementaryPay=0',
  41. })
  42. }),
  43. goToCalculate: businessT.action(function (sender) {
  44. businessT.debugLog('goToCalculate')
  45. wx.navigateToMiniProgram({
  46. appId: 'wxcb0ec6ae8c422c3b',
  47. })
  48. }),
  49. changeRights: businessT.action(function (sender) {
  50. businessT.debugLog(sender.currentTarget.id)
  51. if (sender.currentTarget.id == this.data.rights.s) {
  52. return
  53. }
  54. this.data.rights.s = sender.currentTarget.id
  55. var x = sender.currentTarget.id * 120 * sysT.rpxToPx()
  56. businessT.debugLog(x)
  57. var animation = wx.createAnimation({
  58. duration: 300,
  59. timingFunction: 'ease',
  60. })
  61. animation.translateX(x).step()
  62. this.data.rights.a = animation.export()
  63. this.setData({
  64. rights: this.data.rights
  65. })
  66. }),
  67. changeCity: businessT.action(function (sender) {
  68. businessT.debugLog(sender.currentTarget.id)
  69. if (sender.currentTarget.id == this.data.citys.s) {
  70. return
  71. }
  72. this.data.citys.s = sender.currentTarget.id
  73. var x = sender.currentTarget.id * 120 * sysT.rpxToPx()
  74. businessT.debugLog(x)
  75. var animation = wx.createAnimation({
  76. duration: 300,
  77. timingFunction: 'ease',
  78. })
  79. animation.translateX(x).step()
  80. this.data.citys.a = animation.export()
  81. this.setData({
  82. citys: this.data.citys
  83. })
  84. }),
  85. tabAction: businessT.action(function (sender) {
  86. if (sender.currentTarget.id == this.data.tab.s) {
  87. return
  88. }
  89. this.chageTabAction(sender.currentTarget.id)
  90. }),
  91. chageTabAction: function (index) {
  92. this.data.bgScrollView.scroll = true;
  93. this.setData({
  94. bgScrollView: this.data.bgScrollView
  95. })
  96. var animation = wx.createAnimation({
  97. duration: 300,
  98. timingFunction: 'ease',
  99. })
  100. var w = sysT.sysInfo().windowWidth
  101. var s = index
  102. animation.translateX(s * w / 3).step()
  103. this.data.bgScrollView.left = s * sysT.sysInfo().windowWidth
  104. this.data.tab.s = index
  105. this.data.bgScrollView.scroll = false;
  106. this.setData({
  107. tab: this.data.tab,
  108. bgScrollView: this.data.bgScrollView
  109. })
  110. },
  111. /**
  112. * 生命周期函数--监听页面加载
  113. */
  114. onLoad: function (options) {
  115. if (options.page) {
  116. this.chageTabAction(options.page)
  117. }
  118. },
  119. /**
  120. * 生命周期函数--监听页面初次渲染完成
  121. */
  122. onReady: function () {
  123. },
  124. /**
  125. * 生命周期函数--监听页面显示
  126. */
  127. onShow: function () {
  128. var order = new PurchaseOrder()
  129. order.setCity()
  130. p.setOrder(order)
  131. },
  132. /**
  133. * 生命周期函数--监听页面隐藏
  134. */
  135. onHide: function () {
  136. },
  137. /**
  138. * 生命周期函数--监听页面卸载
  139. */
  140. onUnload: function () {
  141. },
  142. /**
  143. * 页面相关事件处理函数--监听用户下拉动作
  144. */
  145. onPullDownRefresh: function () {
  146. },
  147. /**
  148. * 页面上拉触底事件的处理函数
  149. */
  150. onReachBottom: function () {
  151. },
  152. /**
  153. * 用户点击右上角分享
  154. */
  155. onShareAppMessage: function () {
  156. return {
  157. path: '/page/home/index',
  158. imageUrl: '../../../../icon/public/share_img.png',
  159. title: '自助缴社保公积金,覆盖200多个城市,专业团队操作'
  160. }
  161. }
  162. })