a-payback.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. var businessT = require('../../../../tool/business-tool.js')
  2. var sysT = require('../../../../tool/sys-tool.js')
  3. var url = require('../../../../constant/url.js')
  4. import Net from '../../../../tool/net.js'
  5. var net = new Net()
  6. var app = getApp()
  7. var wxyj = require('../../../../public/wxyj.js')
  8. Page({
  9. // 页面的初始数据
  10. data: {
  11. ui: [
  12. { p1: "299", p2: "¥299.00" },
  13. ['本地城镇', '本地农村', '外地城镇', '外地农村'],
  14. [
  15. { c: '重要说明(必读)', d: ['补缴必须与正常月份一起操作,所以下补缴单前请先下一个月正常单(点击首页-缴公积金)', '补缴不能跨月操作。例如,现在可以下10月份订单,那么补缴必须从9月开始往前连续购买,不可从8月份或者其他月份开始(若9月份已缴费就不能操作补缴了)'] }
  16. ],
  17. ['购买流程', '平台优势', '常见问题', '温馨提示'],
  18. ['覆盖城市最广,且每个城市提供专职客服服务', '百万用户点赞过,再也不担心收钱不买'],
  19. [{ c: '专业团队操作', p: 'advantage_professional' }, { c: '百万用户点赞', p: 'advantage_like' }, { c: '品质有保证', p: 'advantage_quality' }],
  20. ['本平台仅支持代缴服务,不支持证明出具,如有疑问请咨询客服。若申请退费,请于该月份截止购买前联系客服。', '避免因错过了截止时间忘记下单,造成公积金断缴的,建议一次性购买多个月份。若有新的工作单位,未缴费的月份可申请退款。', '每年政府会调整公积金缴费基数,我们会在第一时间通知您。若因政府调整通知滞后导致划扣金额不准确的,我们承诺多退少补,童叟无欺。', '每年政府会调整社保缴费基数,我们会在第一时间通知您。若因政府调整通知滞后导致划扣金额不准确的,我们承诺多退少补,童叟无欺。', '本套餐适合于18岁至法定退休年龄之间的用户购买。']
  21. ],
  22. index: 0,
  23. dataset: ['city', 'type', 'hukou'],
  24. currtentData: [{ t: '缴存城市', c: '广州' }, { t: '缴存范围' }],//当前选择的数据
  25. typeStatus: '',//参保方案是否可选
  26. city: [],
  27. lineX: 0,//蓝线的位置
  28. currentCity: { name: '广州', id: '1001' },
  29. currentType: 0,
  30. detailIndex: 0,
  31. time: '',
  32. haveYearPay: false,
  33. maxIndex: '',
  34. totalPrice: [{ c: '', p: '' }],
  35. scrollInto: '',
  36. scrollTop: '',
  37. scrollHeight: 0,
  38. anchor: 'anchor',
  39. anchorIndex: 0,
  40. n: 0
  41. },
  42. goNext() {
  43. console.log(this.data.data)
  44. if (app.loginStatus.isLogin) {
  45. if (this.data.data.addedf_num == 0) {
  46. swan.showToast({
  47. title: '该城市不支持补缴',
  48. icon: 'none',
  49. mask: true
  50. });
  51. return
  52. }else if (!this.data.data.fund_buy2 ) {
  53. swan.showToast({
  54. title: '该城市暂不支持购买公积金',
  55. icon: 'none',
  56. mask: true
  57. });
  58. return
  59. } else if (!this.data.data.fund_buy) {
  60. swan.showModal({
  61. title: '',
  62. content: '该城市不支持单独购买公积金,请确保已补缴同月份社保,有任何疑问咨询400-881-9211',
  63. confirmColor: '#3296FB',
  64. cancelColor: '#3296FB',
  65. confirmText: '我要补缴',
  66. cancelText: '暂不补缴',
  67. success: function (res) {
  68. if (res.cancel) {
  69. return
  70. } else {
  71. swan.navigateTo({
  72. url: '../../../../public/pages/choose-person/choose-person?type=3'
  73. });
  74. }
  75. }
  76. })
  77. return
  78. }
  79. swan.navigateTo({
  80. url: '../../../../public/pages/choose-person/choose-person?type=3'
  81. });
  82. }
  83. else {
  84. swan.navigateTo({
  85. url: '../../../login/pages/shebaoLogin/shebaoLogin',
  86. })
  87. }
  88. },
  89. openModal(e) {
  90. var pickerData
  91. if (e.currentTarget.dataset.type == 'city') {
  92. pickerData = this.data.city
  93. console.log(this.data.city)
  94. }
  95. this.chooseCityModal = this.selectComponent("#chooseCityModal");
  96. this.chooseCityModal.openModal(pickerData, e.currentTarget.dataset.type)
  97. },
  98. initData() {
  99. swan.showLoading({
  100. title: '请稍后...',
  101. mask: true,
  102. });
  103. this.setData({
  104. currentCity: wxyj.wxyjData.currentCity
  105. })
  106. this.data.currtentData[0].c = this.data.currentCity.name
  107. this.setData({
  108. currtentData: this.data.currtentData
  109. })
  110. net.connect({
  111. url: url.app_host + url.getSupplementaryPurchaseData,
  112. data: { city_code: this.data.currentCity.id, type: 2 },
  113. method: "POST",
  114. success: (err, res) => {
  115. swan.hideLoading()
  116. if (res.data.wxyj[0].fund_note) {
  117. res.data.wxyj[0].fund_note = res.data.wxyj[0].fund_note.split('\n')
  118. }
  119. wxyj.wxyjData.data = res.data
  120. this.data.data = wxyj.wxyjData.data.wxyj[0]
  121. var fundMin = this.data.data.funds[0].min, fundMax = this.data.data.funds[0].max
  122. if (String(fundMin).indexOf('.') != -1) {
  123. fundMin = parseInt(fundMin) + 1
  124. } else {
  125. fundMin = parseInt(fundMin)
  126. }
  127. fundMax = parseInt(fundMax)
  128. this.setData({ fundMin, fundMax, servicePrice: wxyj.wxyjData.data.wxyj[0].added_charge.toFixed(2), sale: wxyj.wxyjData.data.fund_vol })
  129. this.refreshData(true)
  130. },
  131. fail: (err, res) => {
  132. swan.hideLoading()
  133. swan.showToast({
  134. title: '加载数据失败!请检查网络设置!',
  135. icon: 'none'
  136. })
  137. }
  138. }, true)
  139. },
  140. initCity() {
  141. net.connect({
  142. url: url.app_host + url.getPurchaseCity,
  143. data: '',
  144. method: "POST",
  145. success: (err, res) => {
  146. var arr1 = [], arr2 = []
  147. res.data.forEach(function (item) {
  148. if (item.isCity) {
  149. arr1.push(item)
  150. } else {
  151. arr2.push(item)
  152. }
  153. })
  154. wxyj.wxyjData.city = [...arr1]
  155. wxyj.wxyjData.province = [...arr2]
  156. },
  157. fail: (err, res) => {
  158. swan.showToast({
  159. title: '加载数据失败!请检查网络设置!',
  160. icon: 'none'
  161. })
  162. }
  163. }, true)
  164. },
  165. refreshData(isFirst) {
  166. this.countTime()
  167. this.setData({
  168. data: this.data.data,
  169. city: [wxyj.wxyjData.province, wxyj.wxyjData.city]
  170. })
  171. },
  172. changeCurrent(e) {
  173. if (e.detail.type == "city") {
  174. wxyj.wxyjData.currentCity = e.detail.data
  175. wxyj.wxyjData.lastValue = e.detail.lastValue
  176. this.setData({ currentCity: e.detail.data })
  177. this.initData()
  178. this.refreshHeight()
  179. } else if (e.detail.type == "type") {
  180. this.data.currtentData[1].c = e.detail.data
  181. if (e.detail.index == 0) {
  182. this.data.data = wxyj.wxyjData.data.wxyj[1]
  183. this.setData({
  184. currentType: 1
  185. })
  186. } else if (e.detail.index == 1) {
  187. this.data.data = wxyj.wxyjData.data.wxyj[0]
  188. this.setData({
  189. currentType: 0
  190. })
  191. }
  192. this.refreshData(true)
  193. } else if (e.detail.type == "hukou") {
  194. this.data.currtentData[2].c = e.detail.data
  195. this.moveLine(null, e.detail.index)
  196. this.setData({
  197. detailIndex: e.detail.index
  198. })
  199. }
  200. swan.hideLoading();
  201. this.setData({ currtentData: this.data.currtentData })
  202. },
  203. countTime() {
  204. var sYear, sMonth
  205. var day = new Date().getDate()
  206. var eMonth = new Date().getMonth() + 1
  207. if (day > this.data.data.inc_date) {
  208. eMonth += 1
  209. }
  210. if (eMonth > 12) {
  211. eMonth = 1
  212. }
  213. sYear = String(this.data.data.month).slice(0, 4)
  214. sMonth = String(this.data.data.month).slice(4)
  215. this.setData({
  216. time: { 'sYear': sYear, 'sMonth': sMonth, 'eMonth': eMonth, 'eDay': this.data.data.inc_date }
  217. })
  218. },
  219. anchorAction(e) {
  220. var moveX = Math.ceil((this.data.anchorWidth - this.data.anchorItemWidth * 4) / 3 + this.data.anchorItemWidth)
  221. var n = e.currentTarget.dataset.index
  222. this.setData({ anchorIndex: n })
  223. var animation = swan.createAnimation({
  224. duration: 300
  225. });
  226. if (n == 0) {
  227. animation.translateX(0).step();
  228. this.setData({
  229. scrollTop: this.data.anchorY + Math.random(),
  230. animationData: animation.export()
  231. })
  232. } else if (n == 1) {
  233. animation.translateX(moveX).step();
  234. this.setData({
  235. scrollTop: this.data.advantageY + Math.random(),
  236. animationData: animation.export()
  237. })
  238. } else if (n == 2) {
  239. animation.translateX(moveX * 2).step();
  240. this.setData({
  241. scrollTop: this.data.askY + Math.random(),
  242. animationData: animation.export()
  243. })
  244. } else if (n == 3) {
  245. animation.translateX(moveX * 3).step();
  246. this.setData({
  247. scrollTop: this.data.tipsY + Math.random(),
  248. animationData: animation.export()
  249. })
  250. }
  251. },
  252. countHeight() {
  253. swan.getSystemInfo({
  254. success: res => {
  255. this.setData({
  256. scrollHeight: res.screenHeight - res.statusBarHeight - res.navigationBarHeight
  257. })
  258. }
  259. })
  260. },
  261. refreshHeight() {
  262. //页面高度变化后,重新获取每个锚点的位置
  263. setTimeout(() => {
  264. swan.createSelectorQuery().select('#wrapBox').boundingClientRect((rect) => {
  265. if (!rect) {
  266. return
  267. }
  268. var newHeight = parseInt(rect.height)
  269. var disHeight = newHeight - this.data.oldHeight
  270. var anchorY = this.data.anchorY + disHeight
  271. var progressY = this.data.progressY + disHeight
  272. var advantageY = this.data.advantageY + disHeight
  273. var askY = this.data.askY + disHeight
  274. var tipsY = this.data.tipsY + disHeight
  275. this.setData({
  276. oldHeight: newHeight,
  277. anchorY,
  278. progressY,
  279. advantageY,
  280. askY,
  281. tipsY
  282. })
  283. }).exec()
  284. }, 400)
  285. },
  286. scrollAction(e) {
  287. var moveX = Math.ceil((this.data.anchorWidth - this.data.anchorItemWidth * 4) / 3 + this.data.anchorItemWidth)
  288. var scrollTop = e.detail.scrollTop
  289. if (scrollTop > this.data.anchorY) {
  290. this.setData({
  291. anchor: 'anchorPosition'
  292. })
  293. } else if (scrollTop < this.data.anchorY) {
  294. this.setData({
  295. anchor: 'anchor'
  296. })
  297. }
  298. var animation = swan.createAnimation({
  299. duration: 300
  300. });
  301. if (scrollTop < this.data.advantageY) {
  302. animation.translateX(0).step();
  303. this.setData({
  304. anchorIndex: 0,
  305. animationData: animation.export()
  306. })
  307. } else if (scrollTop > this.data.advantageY && scrollTop < this.data.askY) {
  308. animation.translateX(moveX).step();
  309. this.setData({
  310. anchorIndex: 1,
  311. animationData: animation.export()
  312. })
  313. } else if (scrollTop > this.data.askY && scrollTop < this.data.tipsY) {
  314. animation.translateX(moveX * 2).step();
  315. this.setData({
  316. anchorIndex: 2,
  317. animationData: animation.export(),
  318. })
  319. } else if (scrollTop > this.data.tipsY) {
  320. animation.translateX(moveX * 3).step();
  321. this.setData({
  322. anchorIndex: 3,
  323. animationData: animation.export()
  324. })
  325. }
  326. this.setData({ n: scrollTop })
  327. },
  328. countAnchorPosition() {
  329. swan.createSelectorQuery().select('#wrapBox').boundingClientRect((rect) => {
  330. this.setData({
  331. oldHeight: parseInt(rect.height)
  332. })
  333. }).exec()
  334. swan.createSelectorQuery().select('#anchor').boundingClientRect((rect) => {
  335. var top = parseInt(rect.top)
  336. this.setData({
  337. anchorY: top
  338. })
  339. }).exec()
  340. swan.createSelectorQuery().select('#advantage').boundingClientRect((rect) => {
  341. var top = parseInt(rect.top)
  342. this.setData({
  343. advantageY: top
  344. })
  345. }).exec()
  346. swan.createSelectorQuery().select('#ask').boundingClientRect((rect) => {
  347. var top = parseInt(rect.top)
  348. this.setData({
  349. askY: top
  350. })
  351. }).exec()
  352. var tips='#tips'+this.data.suffix
  353. swan.createSelectorQuery().select(tips).boundingClientRect((rect) => {
  354. var top = parseInt(rect.top)
  355. this.setData({
  356. tipsY: top
  357. })
  358. }).exec()
  359. swan.createSelectorQuery().select('#anchorWrap').boundingClientRect((rect) => {
  360. this.setData({
  361. anchorWidth: rect.width
  362. })
  363. }).exec()
  364. swan.createSelectorQuery().select('.anchorItem').boundingClientRect((rect) => {
  365. this.setData({
  366. anchorItemWidth: rect.width
  367. })
  368. }).exec()
  369. },
  370. hotline(e) {
  371. this.hot = this.selectComponent("#hotline")
  372. this.hot.openModal(true);
  373. },
  374. // goKefu(e) {
  375. // swan.navigateTo({
  376. // url: '../../../../public/pages/html/html?host=https://www.sobot.com/chat/h5/index.html&sysNum=a73ea222d7284f7c8801e60e6054e985&partnerId=2180427&tel=' + app.globalData.userInfo.phone + '&uname=' + app.globalData.userInfo.phone + '&remark=BDXCX_SHEBAO&titleFlag=3&powered=false&telShowFlag=true&telFlag=true'
  377. // })
  378. // },
  379. // 页面的生命周期函数 – 监听页面加载
  380. onLoad(res) {
  381. this.countHeight()
  382. this.initCity()
  383. this.setData({ suffix: sysT.suffixOfClass() })
  384. },
  385. // 页面的生命周期函数 – 监听页面初次渲染完成
  386. onReady(res) {
  387. setTimeout(() => {
  388. this.countAnchorPosition()
  389. }, 400)
  390. },
  391. // 页面的生命周期函数 – 监听页面显示
  392. onShow(res) {
  393. this.initData()
  394. swan.setPageInfo && swan.setPageInfo({
  395. title: '【我的社保】官方APP-社保挂靠公积金代理全国自助缴纳查询社保公积金_主页',
  396. keywords: '我的社保,我的社保网,我的社保APP,社会保障,社保,社保代缴,公积金代缴,社会保险,五险一金,医保,医疗保险,公积金,养老,生育,工伤,失业,住房公积金,社保代理,代缴社保,公积金代理,查悦社保,大社保,亲亲小保,社保掌上通,招聘求职,创业,买房,贷款,计算器,人社局,摇号',
  397. description: '我的社保APP是为个人、企业提供社保代缴代扣、公积金代扣代缴、社保查询、公积金查询服务的名牌产品。解决个体工商户、自由职业者、待业人员、全职妈妈、创业者等的个人社保公积金断缴难题,同时解决贷款, 买房, 买车, 养老, 医疗, 生育, 医疗报销等难题。同时为企业提供全国专业社保代理和公积金代理。',
  398. articleTitle: '【我的社保】官方APP-社保挂靠公积金代理全国自助缴纳查询社保公积金_主页',
  399. release_date: '2019-02-23 20:00:00',
  400. success: function () {
  401. console.log('页面基础信息设置完成');
  402. },
  403. fail: function (res) {
  404. console.log('设置失败');
  405. },
  406. })
  407. },
  408. // 页面的生命周期函数 – 监听页面隐藏
  409. onHide(res) {
  410. },
  411. // 页面的生命周期函数 – 监听页面卸载
  412. onUnload(res) {
  413. },
  414. // 页面的生命周期函数 – 监听页面重启,单击重启按钮时触发
  415. onForceReLaunch(res) {
  416. },
  417. // 页面的事件处理函数 – 监听用户下拉动作
  418. onPullDownRefresh(res) {
  419. },
  420. // 页面的事件处理函数 – 上拉触底事件的处理函数
  421. onReachBottom(res) {
  422. },
  423. // 页面的事件处理函数 – 用户点击右上角转发
  424. onShareAppMessage(res) {
  425. },
  426. // 页面的事件处理函数 – 页面滚动触发事件的处理函数
  427. onPageScroll(res) {
  428. },
  429. // 页面的事件处理函数 – 当前是 tab 页时,点击 tab 时触发
  430. onTabItemTap(res) {
  431. }
  432. });