123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- var businessT = require('../../../tool/business-tool.js')
- var sysT = require('../../../tool/sys-tool.js')
- var url = require('../../../constant/url.js')
- var key = require('../../../constant/key.js')
- import Net from '../../../tool/net.js'
- var net = new Net()
- var app = getApp()
- var wxyj = require('../../../public/wxyj.js')
- Page({
- data: {
- ui: {
- t: '',
- icon: 's',
- item: [{ t: '真实姓名' }, { t: '身份证号' }, { t: '户籍性质' }, { t: '所在城市' }]
- },
- salarySwitch: false
- },
- initData() {
- var item = this.data.ui.item, hukou, year, month, needSalary, inputSalary, fundSwitch, sheBaoSwitch,buyFund,buySheBao
- if (this.data.type == 0) {
- this.data.ui.t = '社保一键续缴'
- this.data.ui.icon = 's'
- buySheBao=true
- if (this.data.data.fund_price) {
- fundSwitch = true
- buyFund=true
- } else {
- fundSwitch = false
- buyFund=false
- }
- } else {
- buyFund=true
- this.data.ui.t = '公积金一键续存'
- this.data.ui.icon = 'a'
- sheBaoSwitch = this.data.data.buyShebao
- buySheBao= this.data.data.buyShebao
- }
- if (this.data.data.hukou_type == 1) {
- hukou = '本地城镇'
- } else if (this.data.data.hukou_type == 2) {
- hukou = '本地农村'
- } else if (this.data.data.hukou_type == 3) {
- hukou = '外地城镇'
- } else {
- hukou = '外地农村'
- }
- item[0].v = this.data.name
- item[1].v = this.data.data.id_card
- item[2].v = hukou
- wxyj.wxyjData.city.forEach((i) => {
- if (i.id == this.data.data.city_code) {
- this.setData({ city: i.name })
- }
- return
- })
- item[3].v = this.data.city
- year = String(this.data.data.start_month).substring(0, 4)
- month = String(this.data.data.start_month).slice(-2)
- if (month.indexOf(0) == 0) {
- month = month.slice(-1)
- }
- if (this.data.data.wage_flow) {
- needSalary = true
- inputSalary = true
- } else {
- needSalary = false
- inputSalary = false
- }
- var salary = swan.getStorageSync(key.StorageKey.minSalary)
- this.setData({
- ui: this.data.ui,
- year,
- month,
- needSalary,
- inputSalary,
- salary,
- fundSwitch,
- sheBaoSwitch,
- buyFund,
- buySheBao
- })
- },
- switchAction(e) {
- // if (!wxyj.wxyjData.data.wxyj[0].fund_buy && this.data.type == 2) {
- // this.setData({ buySheBao: 1 })
- // swan.showModal({
- // title: '',
- // content: '该地区不支持单独购买公积金,请选择购买社保。',
- // confirmColor: '#3296FB',
- // confirmText: '确定',
- // showCancel: false,
- // })
- // this.setData({ buySheBao: true })
- // return
- // }
- if (e.currentTarget.id == "work") {
- this.data.salarySwitch = !this.data.salarySwitch
- if (this.data.salarySwitch) {
- this.data.inputSalary = false
- } else {
- this.data.inputSalary = true
- }
- if (this.data.salarySwitch) { this.data.wage = 0 }
- } else if (e.currentTarget.id == "fund") {
- this.data.buyFund = !this.data.buyFund
- } else if (e.currentTarget.id == "shebao") {
- this.data.buySheBao = !this.data.buySheBao
- }
- this.setData({
- salarySwitch: this.data.salarySwitch,
- inputSalary: this.data.inputSalary,
- buyFund: this.data.buyFund,
- buySheBao: this.data.buySheBao
- })
- },
- openJobModal() {
- const animation = swan.createAnimation()
- animation.translateY(-500).step();
- this.setData({
- modalStatus: true
- }, () => {
- this.setData({
- animationData: animation.export()
- })
- })
- },
- closeJobModal() {
- const animation = swan.createAnimation()
- animation.translateY(0).step();
- this.setData({
- animationData: animation.export()
- })
- setTimeout(() => {
- this.setData({
- modalStatus: false,
- })
- }, 400)
- },
- chooseDate() {
- swan.navigateTo({
- url: '../choose-date/choose-date?quickPay=true&date=' + this.data.data.start_month,
- });
- },
- inputAction(e) {
- this.setData({ wage: e.detail.value })
- },
- btnAction(e) {
- if (this.data.needSalary && this.data.inputSalary&&this.data.buySheBao) {
- if (!this.data.wage || this.data.wage < this.data.salary || this.data.wage > 5000) {
- swan.showToast({
- title: '请填写范围内的社保流水',
- icon: 'none',
- });
- return
- }
- }
- wxyj.wxyjData.order.buyShebao = this.data.data.buyShebao
- wxyj.wxyjData.order.cid = this.data.data.cid
- if(this.data.buyFund){
- wxyj.wxyjData.order.fund = this.data.data.fund_price
- }else{
- wxyj.wxyjData.order.fund = 0
- }
- wxyj.wxyjData.order.hukou_type = this.data.data.hukou_type
- wxyj.wxyjData.order.nums = e.currentTarget.id
- if (!this.data.salarySwitch) {
- wxyj.wxyjData.order.working = 0
- if (!this.data.wage) {
- wxyj.wxyjData.order.sb_wage = 0
- } else {
- wxyj.wxyjData.order.sb_wage = this.data.wage
- }
- } else {
- wxyj.wxyjData.order.working = 1
- wxyj.wxyjData.order.sb_wage = 0
- }
- if (this.data.month.length == 1 && this.data.month < 10) {
- this.data.month = '0' + this.data.month
- }
- wxyj.wxyjData.order.month = this.data.year + this.data.month
- if (this.data.buyFund && this.data.buySheBao) {
- wxyj.wxyjData.order.pack = true
- } else {
- wxyj.wxyjData.order.pack = false
- }
- if (this.data.type == 0) {
- wxyj.wxyjData.order.pay_for = 1
- if (this.data.buyFund) {
- wxyj.wxyjData.order.pay_for = 3
- }
- } else {
- wxyj.wxyjData.order.pay_for = 2
- if (this.data.buySheBao) {
- wxyj.wxyjData.order.pay_for = 4
- }
- }
- var order = wxyj.wxyjData.order
- net.connectNeedLogin({
- url: url.app_host + url.getTotalFee,
- data: {
- sbuId: order.sbuId,
- key: app.loginStatus.key,
- cid: order.cid,
- month: order.month,
- nums: order.nums,
- newCard: order.newCard,
- shebao_card: order.shebao_card ? order.shebao_card : 0,
- hukou_type: order.hukou_type,
- pay_for:order.pay_for,
- fund: order.fund
- },
- success: (err, res) => {
- swan.hideLoading();
- if(this.data.type==0){
- var orderStatus=0
- }else{
- var orderStatus=2
- }
- swan.navigateTo({
- url: '../pay/pay?nums=' + wxyj.wxyjData.order.nums + '&city=' + this.data.city + '&hukou=' + this.data.ui.item[2].v + '&type=0' + '&price=' + JSON.stringify(res.data)+'&orderStatus='+orderStatus
- })
- },
- fail: (err, res) => {
- swan.hideLoading();
- businessT.showFailTips(err)
- }
- }, true)
- },
- onLoad: function (e) {
- // 监听页面加载的生命周期函数
- 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('设置失败');
- },
- })
- this.setData({ type: Number(e.type), data: JSON.parse(e.data), name: e.name })
- this.initData()
- },
- onReady: function () {
- // 监听页面初次渲染完成的生命周期函数
- },
- onShow: function () {
- // 监听页面显示的生命周期函数
- },
- onHide: function () {
- // 监听页面隐藏的生命周期函数
- },
- onUnload: function () {
- // 监听页面卸载的生命周期函数
- },
- onPullDownRefresh: function () {
- // 监听用户下拉动作
- },
- onReachBottom: function () {
- // 页面上拉触底事件的处理函数
- },
- onShareAppMessage: function () {
- // 用户点击右上角转发
- }
- });
|