123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454 |
- var businessT = require('../../../../tool/business-tool.js')
- var sysT = require('../../../../tool/sys-tool.js')
- var url = require('../../../../constant/url.js')
- import Net from '../../../../tool/net.js'
- var net = new Net()
- var app = getApp()
- var wxyj = require('../../../../public/wxyj.js')
- Page({
- // 页面的初始数据
- data: {
- ui: [
- { p1: "299", p2: "¥299.00" },
- ['本地城镇', '本地农村', '外地城镇', '外地农村'],
- [
- { c: '重要说明(必读)', d: ['补缴必须与正常月份一起操作,所以下补缴单前请先下一个月正常单(点击首页-缴公积金)', '补缴不能跨月操作。例如,现在可以下10月份订单,那么补缴必须从9月开始往前连续购买,不可从8月份或者其他月份开始(若9月份已缴费就不能操作补缴了)'] }
- ],
- ['购买流程', '平台优势', '常见问题', '温馨提示'],
- ['覆盖城市最广,且每个城市提供专职客服服务', '百万用户点赞过,再也不担心收钱不买'],
- [{ c: '专业团队操作', p: 'advantage_professional' }, { c: '百万用户点赞', p: 'advantage_like' }, { c: '品质有保证', p: 'advantage_quality' }],
- ['本平台仅支持代缴服务,不支持证明出具,如有疑问请咨询客服。若申请退费,请于该月份截止购买前联系客服。', '避免因错过了截止时间忘记下单,造成公积金断缴的,建议一次性购买多个月份。若有新的工作单位,未缴费的月份可申请退款。', '每年政府会调整公积金缴费基数,我们会在第一时间通知您。若因政府调整通知滞后导致划扣金额不准确的,我们承诺多退少补,童叟无欺。', '每年政府会调整社保缴费基数,我们会在第一时间通知您。若因政府调整通知滞后导致划扣金额不准确的,我们承诺多退少补,童叟无欺。', '本套餐适合于18岁至法定退休年龄之间的用户购买。']
- ],
- index: 0,
- dataset: ['city', 'type', 'hukou'],
- currtentData: [{ t: '缴存城市', c: '广州' }, { t: '缴存范围' }],//当前选择的数据
- typeStatus: '',//参保方案是否可选
- city: [],
- lineX: 0,//蓝线的位置
- currentCity: { name: '广州', id: '1001' },
- currentType: 0,
- detailIndex: 0,
- time: '',
- haveYearPay: false,
- maxIndex: '',
- totalPrice: [{ c: '', p: '' }],
- scrollInto: '',
- scrollTop: '',
- scrollHeight: 0,
- anchor: 'anchor',
- anchorIndex: 0,
- n: 0
- },
- goNext() {
- console.log(this.data.data)
- if (app.loginStatus.isLogin) {
- if (this.data.data.addedf_num == 0) {
- swan.showToast({
- title: '该城市不支持补缴',
- icon: 'none',
- mask: true
- });
- return
- }else if (!this.data.data.fund_buy2 ) {
- swan.showToast({
- title: '该城市暂不支持购买公积金',
- icon: 'none',
- mask: true
- });
- return
- } else if (!this.data.data.fund_buy) {
- swan.showModal({
- title: '',
- content: '该城市不支持单独购买公积金,请确保已补缴同月份社保,有任何疑问咨询400-881-9211',
- confirmColor: '#3296FB',
- cancelColor: '#3296FB',
- confirmText: '我要补缴',
- cancelText: '暂不补缴',
- success: function (res) {
- if (res.cancel) {
- return
- } else {
- swan.navigateTo({
- url: '../../../../public/pages/choose-person/choose-person?type=3'
- });
- }
- }
- })
- return
- }
- swan.navigateTo({
- url: '../../../../public/pages/choose-person/choose-person?type=3'
- });
- }
- else {
- swan.navigateTo({
- url: '../../../login/pages/shebaoLogin/shebaoLogin',
- })
- }
- },
- openModal(e) {
- var pickerData
- if (e.currentTarget.dataset.type == 'city') {
- pickerData = this.data.city
- console.log(this.data.city)
- }
- this.chooseCityModal = this.selectComponent("#chooseCityModal");
- this.chooseCityModal.openModal(pickerData, e.currentTarget.dataset.type)
- },
- initData() {
- swan.showLoading({
- title: '请稍后...',
- mask: true,
- });
- this.setData({
- currentCity: wxyj.wxyjData.currentCity
- })
- this.data.currtentData[0].c = this.data.currentCity.name
- this.setData({
- currtentData: this.data.currtentData
- })
- net.connect({
- url: url.app_host + url.getSupplementaryPurchaseData,
- data: { city_code: this.data.currentCity.id, type: 2 },
- method: "POST",
- success: (err, res) => {
- swan.hideLoading()
- if (res.data.wxyj[0].fund_note) {
- res.data.wxyj[0].fund_note = res.data.wxyj[0].fund_note.split('\n')
- }
- wxyj.wxyjData.data = res.data
- this.data.data = wxyj.wxyjData.data.wxyj[0]
- var fundMin = this.data.data.funds[0].min, fundMax = this.data.data.funds[0].max
- if (String(fundMin).indexOf('.') != -1) {
- fundMin = parseInt(fundMin) + 1
- } else {
- fundMin = parseInt(fundMin)
- }
- fundMax = parseInt(fundMax)
- this.setData({ fundMin, fundMax, servicePrice: wxyj.wxyjData.data.wxyj[0].added_charge.toFixed(2), sale: wxyj.wxyjData.data.fund_vol })
- this.refreshData(true)
- },
- fail: (err, res) => {
- swan.hideLoading()
- swan.showToast({
- title: '加载数据失败!请检查网络设置!',
- icon: 'none'
- })
- }
- }, true)
- },
- initCity() {
- net.connect({
- url: url.app_host + url.getPurchaseCity,
- data: '',
- method: "POST",
- success: (err, res) => {
- var arr1 = [], arr2 = []
- res.data.forEach(function (item) {
- if (item.isCity) {
- arr1.push(item)
- } else {
- arr2.push(item)
- }
- })
- wxyj.wxyjData.city = [...arr1]
- wxyj.wxyjData.province = [...arr2]
- },
- fail: (err, res) => {
- swan.showToast({
- title: '加载数据失败!请检查网络设置!',
- icon: 'none'
- })
- }
- }, true)
- },
- refreshData(isFirst) {
- this.countTime()
- this.setData({
- data: this.data.data,
- city: [wxyj.wxyjData.province, wxyj.wxyjData.city]
- })
- },
- changeCurrent(e) {
- if (e.detail.type == "city") {
- wxyj.wxyjData.currentCity = e.detail.data
- wxyj.wxyjData.lastValue = e.detail.lastValue
- this.setData({ currentCity: e.detail.data })
- this.initData()
- this.refreshHeight()
- } else if (e.detail.type == "type") {
- this.data.currtentData[1].c = e.detail.data
- if (e.detail.index == 0) {
- this.data.data = wxyj.wxyjData.data.wxyj[1]
- this.setData({
- currentType: 1
- })
- } else if (e.detail.index == 1) {
- this.data.data = wxyj.wxyjData.data.wxyj[0]
- this.setData({
- currentType: 0
- })
- }
- this.refreshData(true)
- } else if (e.detail.type == "hukou") {
- this.data.currtentData[2].c = e.detail.data
- this.moveLine(null, e.detail.index)
- this.setData({
- detailIndex: e.detail.index
- })
- }
- swan.hideLoading();
- this.setData({ currtentData: this.data.currtentData })
- },
- countTime() {
- var sYear, sMonth
- var day = new Date().getDate()
- var eMonth = new Date().getMonth() + 1
- if (day > this.data.data.inc_date) {
- eMonth += 1
- }
- if (eMonth > 12) {
- eMonth = 1
- }
- sYear = String(this.data.data.month).slice(0, 4)
- sMonth = String(this.data.data.month).slice(4)
- this.setData({
- time: { 'sYear': sYear, 'sMonth': sMonth, 'eMonth': eMonth, 'eDay': this.data.data.inc_date }
- })
- },
- anchorAction(e) {
- var moveX = Math.ceil((this.data.anchorWidth - this.data.anchorItemWidth * 4) / 3 + this.data.anchorItemWidth)
- var n = e.currentTarget.dataset.index
- this.setData({ anchorIndex: n })
- var animation = swan.createAnimation({
- duration: 300
- });
- if (n == 0) {
- animation.translateX(0).step();
- this.setData({
- scrollTop: this.data.anchorY + Math.random(),
- animationData: animation.export()
- })
- } else if (n == 1) {
- animation.translateX(moveX).step();
- this.setData({
- scrollTop: this.data.advantageY + Math.random(),
- animationData: animation.export()
- })
- } else if (n == 2) {
- animation.translateX(moveX * 2).step();
- this.setData({
- scrollTop: this.data.askY + Math.random(),
- animationData: animation.export()
- })
- } else if (n == 3) {
- animation.translateX(moveX * 3).step();
- this.setData({
- scrollTop: this.data.tipsY + Math.random(),
- animationData: animation.export()
- })
- }
- },
- countHeight() {
- swan.getSystemInfo({
- success: res => {
- this.setData({
- scrollHeight: res.screenHeight - res.statusBarHeight - res.navigationBarHeight
- })
- }
- })
- },
- refreshHeight() {
- //页面高度变化后,重新获取每个锚点的位置
- setTimeout(() => {
- swan.createSelectorQuery().select('#wrapBox').boundingClientRect((rect) => {
- if (!rect) {
- return
- }
- var newHeight = parseInt(rect.height)
- var disHeight = newHeight - this.data.oldHeight
- var anchorY = this.data.anchorY + disHeight
- var progressY = this.data.progressY + disHeight
- var advantageY = this.data.advantageY + disHeight
- var askY = this.data.askY + disHeight
- var tipsY = this.data.tipsY + disHeight
- this.setData({
- oldHeight: newHeight,
- anchorY,
- progressY,
- advantageY,
- askY,
- tipsY
- })
- }).exec()
- }, 400)
- },
- scrollAction(e) {
- var moveX = Math.ceil((this.data.anchorWidth - this.data.anchorItemWidth * 4) / 3 + this.data.anchorItemWidth)
- var scrollTop = e.detail.scrollTop
- if (scrollTop > this.data.anchorY) {
- this.setData({
- anchor: 'anchorPosition'
- })
- } else if (scrollTop < this.data.anchorY) {
- this.setData({
- anchor: 'anchor'
- })
- }
- var animation = swan.createAnimation({
- duration: 300
- });
- if (scrollTop < this.data.advantageY) {
- animation.translateX(0).step();
- this.setData({
- anchorIndex: 0,
- animationData: animation.export()
- })
- } else if (scrollTop > this.data.advantageY && scrollTop < this.data.askY) {
- animation.translateX(moveX).step();
- this.setData({
- anchorIndex: 1,
- animationData: animation.export()
- })
- } else if (scrollTop > this.data.askY && scrollTop < this.data.tipsY) {
- animation.translateX(moveX * 2).step();
- this.setData({
- anchorIndex: 2,
- animationData: animation.export(),
- })
- } else if (scrollTop > this.data.tipsY) {
- animation.translateX(moveX * 3).step();
- this.setData({
- anchorIndex: 3,
- animationData: animation.export()
- })
- }
- this.setData({ n: scrollTop })
- },
- countAnchorPosition() {
- swan.createSelectorQuery().select('#wrapBox').boundingClientRect((rect) => {
- this.setData({
- oldHeight: parseInt(rect.height)
- })
- }).exec()
- swan.createSelectorQuery().select('#anchor').boundingClientRect((rect) => {
- var top = parseInt(rect.top)
- this.setData({
- anchorY: top
- })
- }).exec()
- swan.createSelectorQuery().select('#advantage').boundingClientRect((rect) => {
- var top = parseInt(rect.top)
- this.setData({
- advantageY: top
- })
- }).exec()
- swan.createSelectorQuery().select('#ask').boundingClientRect((rect) => {
- var top = parseInt(rect.top)
- this.setData({
- askY: top
- })
- }).exec()
- var tips='#tips'+this.data.suffix
- swan.createSelectorQuery().select(tips).boundingClientRect((rect) => {
- var top = parseInt(rect.top)
- this.setData({
- tipsY: top
- })
- }).exec()
- swan.createSelectorQuery().select('#anchorWrap').boundingClientRect((rect) => {
- this.setData({
- anchorWidth: rect.width
- })
- }).exec()
- swan.createSelectorQuery().select('.anchorItem').boundingClientRect((rect) => {
- this.setData({
- anchorItemWidth: rect.width
- })
- }).exec()
- },
- hotline(e) {
- this.hot = this.selectComponent("#hotline")
- this.hot.openModal(true);
- },
- // goKefu(e) {
- // swan.navigateTo({
- // 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'
- // })
- // },
- // 页面的生命周期函数 – 监听页面加载
- onLoad(res) {
- this.countHeight()
- this.initCity()
- this.setData({ suffix: sysT.suffixOfClass() })
- },
- // 页面的生命周期函数 – 监听页面初次渲染完成
- onReady(res) {
- setTimeout(() => {
- this.countAnchorPosition()
- }, 400)
- },
- // 页面的生命周期函数 – 监听页面显示
- onShow(res) {
- this.initData()
- swan.setPageInfo && swan.setPageInfo({
- title: '【我的社保】官方APP-社保挂靠公积金代理全国自助缴纳查询社保公积金_主页',
- keywords: '我的社保,我的社保网,我的社保APP,社会保障,社保,社保代缴,公积金代缴,社会保险,五险一金,医保,医疗保险,公积金,养老,生育,工伤,失业,住房公积金,社保代理,代缴社保,公积金代理,查悦社保,大社保,亲亲小保,社保掌上通,招聘求职,创业,买房,贷款,计算器,人社局,摇号',
- description: '我的社保APP是为个人、企业提供社保代缴代扣、公积金代扣代缴、社保查询、公积金查询服务的名牌产品。解决个体工商户、自由职业者、待业人员、全职妈妈、创业者等的个人社保公积金断缴难题,同时解决贷款, 买房, 买车, 养老, 医疗, 生育, 医疗报销等难题。同时为企业提供全国专业社保代理和公积金代理。',
- articleTitle: '【我的社保】官方APP-社保挂靠公积金代理全国自助缴纳查询社保公积金_主页',
- release_date: '2019-02-23 20:00:00',
- success: function () {
- console.log('页面基础信息设置完成');
- },
- fail: function (res) {
- console.log('设置失败');
- },
- })
- },
- // 页面的生命周期函数 – 监听页面隐藏
- onHide(res) {
- },
- // 页面的生命周期函数 – 监听页面卸载
- onUnload(res) {
- },
- // 页面的生命周期函数 – 监听页面重启,单击重启按钮时触发
- onForceReLaunch(res) {
- },
- // 页面的事件处理函数 – 监听用户下拉动作
- onPullDownRefresh(res) {
- },
- // 页面的事件处理函数 – 上拉触底事件的处理函数
- onReachBottom(res) {
- },
- // 页面的事件处理函数 – 用户点击右上角转发
- onShareAppMessage(res) {
- },
- // 页面的事件处理函数 – 页面滚动触发事件的处理函数
- onPageScroll(res) {
- },
- // 页面的事件处理函数 – 当前是 tab 页时,点击 tab 时触发
- onTabItemTap(res) {
- }
- });
|