123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405 |
- // page/home/index.js
- var businessT = require('../../tool/business-tool.js')
- var login = require('../../public/login.js')
- var url = require('../../constant/url.js')
- import Net from '../../tool/net.js'
- var net = new Net()
- var key = require('../../constant/key.js')
- var businessType = require('../../public/business-type.js')
- var p = require('public/model/public.js')
- import PurchaseOrder from 'public/model/purchaseOrder.js'
- var publicData = require('../../constant/data.js')
- var app = getApp()
- Page({
-
- strategyAction: businessT.action(function (sender) {
- businessT.debugLog(sender)
- switch (sender.currentTarget.id) {
- case '1': {
- wx.navigateTo({
- url: 'pages/strategy-s/strategy-s?page=0'
- });
- break
- }
- case '2': {
- wx.navigateTo({
- url: 'pages/strategy-s/strategy-s?page=1'
- });
- break
- }
- case '3': {
- wx.navigateTo({
- url: 'pages/strategy-s/strategy-s?page=2'
- });
- break
- }
- case '4': {
- wx.navigateTo({
- url: 'pages/strategy-a/strategy-a?page=0'
- });
- break
- }
- case '5': {
- wx.navigateTo({
- url: 'pages/strategy-a/strategy-a?page=1'
- });
- break
- }
- case '6': {
- wx.navigateTo({
- url: 'pages/strategy-a/strategy-a?page=2'
- });
- break
- }
- default: break
- }
- }),
- // 隔离
- /**
- * 页面的初始数据
- */
- data: {
- collegeTips: "点击'添加到我的小程序'",
- purchase: [
- ['purchase_s', '社保缴纳', '异地买房买车、子女就读必备', '1000'],
- // ['purchase_a', '公积金缴存', '买房贷款必备省钱神器', '3000'],
- ['s_pay_s', '社保补缴', '解决社保中断问题', '2000'],
- [],
- []
- // ['s_pay_a', '公积金补缴', '解决公积金中断问题', '4000']
- ],
- region:['新鲜服务','特色服务','新手指南'],
- Strategy: [
- { img:'shebao', t: '社保缴纳查询攻略', c: '社保缴纳、查询不求人' },
- // { img:'gjj', t: '公积金缴存查询攻略', c:'买房贷款必备神器'}
- ],
- WxAdvertisement:[
- { img: 'qujianbu', t: '趣健步', c: '微信步数领红包', id: '1' },
- { img: 'tuodan', t: '脱单请点我', c: '领取一个优质对象', id: '2' },
- { img: 'nearjob', t: '附近的工作', c: '走路上班回家吃饭', id: '3' },
- { img: 'banruo', t: '般若商城', c: '招财 姻缘 风水', id: '4' }
- ],
- flow_id: app.globalData.flow_id,
- flow_name: app.globalData.flow_name
- },
- //新鲜服务-跳转小程序
- goAdWx(e){
- let id = e.currentTarget.dataset.id
- switch(id){
- case "1": {
- wx.navigateToMiniProgram({
- appId: 'wxdb674acb1231c231',
- path:'pages/index/index?channel=shanpin&ald_media_id=24879&ald_link_key=5024e38cd497a4ed',
- extraData: {
- },
- success(res) {
- // 打开成功
- businessT.debugLog("跳转趣健步小程序成功")
- }
- });
- break
- }
- case "2": {
- wx.navigateToMiniProgram({
- appId: 'wx4882c703815c5602',
- path: '/pages/index/index?promotion=nZW2FKJWji&tl=&nc=',
- extraData: {
- },
- success(res) {
- // 打开成功
- businessT.debugLog("跳转比心单身小程序成功")
- }
- });
- break
- }
- case "3": {
- wx.navigateToMiniProgram({
- appId: 'wx0fdd65237732c014',
- extraData: {
- },
- success(res) {
- // 打开成功
- businessT.debugLog("跳转职友集小程序成功")
- }
- });
- break
- }
- case "4": {
- wx.navigateToMiniProgram({
- appId: 'wx7ab08191e61478c5',
- extraData: {
- },
- success(res) {
- // 打开成功
- businessT.debugLog("跳转般若商城小程序成功")
- }
- });
- break
- }
- }
- },
- //退休养老金
- goPensionWx(e) {
- wx.navigateToMiniProgram({
- appId: 'wxcb0ec6ae8c422c3b',
- extraData: {
- },
- success(res) {
- // 打开成功
- console.log("跳转养老金小程序成功")
- }
- })
- },
- //banner跳H5
- gobannerH5(e){
- let url = 'https://www.wodeshebao.com/flow2/why.html'
- wx.navigateTo({
- url: '../../public/pages/web-view-H5/web-view-H5?url=' + url,
- })
- },
- //社保公积金
- goInsuranceH5(e) {
- wx.navigateTo({
- url: '../../public/pages/web-view-H5/web-view-H5?par=' + 1001,
- })
- },
- //企业人事服务
- goPersonnelService(e){
- let url = 'https://www.wodeshebao.com/flow2/en.html'
- businessT.debugLog(url)
- wx.navigateTo({
- url: '../../public/pages/web-view-H5/web-view-H5?url=' + url,
- })
- },
- //显示收藏小程序提示
- showModal() {
- // 创建动画
- var animation = wx.createAnimation({
- duration: 1000,
- timingFunction: "ease-in-out",
- delay: 0
- })
- this.animation = animation
- animation.translateX(0).step()
- this.setData({
- animationData: animation.export(), // export 方法每次调用后会清掉之前的动画操作。
- showShopPopup: true
- })
- animation.translateX(-202).step()
- this.setData({
- animationData: animation.export(), // export 方法每次调用后会清掉之前的动画操作。
- showShopPopup: true
- })
- setTimeout(() => {
- animation.translateX(0).step()
- this.setData({
- animationData: animation.export(), // export 方法每次调用后会清掉之前的动画操作。
- showShopPopup: true
- })
- }, 2500)
- },
- tips: function (sender) {
- if (sender.currentTarget.id == '0') {
- wx.navigateTo({
- url: 'pages/strategy-s/strategy-s',
- })
- } else {
- wx.navigateTo({
- url: 'pages/strategy-a/strategy-a',
- })
- }
- },
-
- purchase: businessT.action(function (sender) {
- businessT.debugLog(sender.currentTarget.id)
- var order = p.getOrder()
- switch (sender.currentTarget.id) {
- case '1000':
- wx.navigateTo({
- url: 'pages/purchase-s-details/purchase-s-details?isSupplementaryPay=0',
- })
- break
- case '2000':
- wx.navigateTo({
- url: 'pages/purchase-s-details/purchase-s-details?isSupplementaryPay=1',
- })
- break
- case '3000':
- wx.navigateTo({
- url: 'pages/purchase-a-details/purchase-a-details?isSupplementaryPay=0',
- })
- break
- case '4000':
- wx.navigateTo({
- url:'pages/purchase-a-details/purchase-a-details?isSupplementaryPay=1',
- })
- break
- default:
- break
- }
- }),
- getVersion: function () {
- businessT.debugLog('getVersion')
- net.connect({
- url: url.www_host + url.getVersion,
- data: {},
- method: 'GET',
- success: (err, res) => {
- businessT.debugLog(res.data.tel)
- if (res.data.tel) {
- wx.setStorage({
- key: key.StorageKey.servicePhone,
- data: res.data.tel,
- })
- }
- if (res.data.city) {
- try {
- var cityTime = wx.getStorageSync(key.StorageKey.purchaseCityTime)
- if (!cityTime) {
- cityTime = 0
- }
- } catch (e) {
- var cityTime = 0
- }
- if (cityTime != res.data.city) {
- this.getPurchaseCity(res.data.city)
- }
- }
- },
- fail: (err, res) => {
- businessT.debugLog(err)
- }
- }, true)
- },
- getPurchaseCity: function (time) {
- net.connect({
- url: url.app_host + url.getPurchaseCity,
- data: {},
- method: 'GET',
- success: (err, res) => {
- var d = {}
- var p = []
- for (var i in res.data) {
- if (res.data[i].isCity == 0) {
- p.push({ name: res.data[i].name, id: res.data[i].id })
- } else if (res.data[i].isCity == 1) {
- if (!d[res.data[i].pid]) {
- d[res.data[i].pid] = []
- }
- d[res.data[i].pid].push({ name: res.data[i].name, id: res.data[i].id })
- }
- }
- d.p = p
- publicData.purchaseCity = d
- wx.setStorageSync(key.StorageKey.purchaseCityTime, time)
- wx.setStorageSync(key.StorageKey.purchaseCity, d)
- businessT.debugLog(d)
- }
- }, true)
- },
- route: function (path) {
- var pages = getCurrentPages()
- wx.navigateBack({
- delta: pages.length
- })
- setTimeout(function () {
- wx.navigateTo({
- url: path,
- })
- }.bind(this), 500)
-
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.getVersion()
- login.autoLogin(true)
- // app.getRedDot()
- this.showModal();
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function (options) {
- var order = new PurchaseOrder()
- p.setOrder(order)
- if (typeof this.getTabBar === 'function' &&
- this.getTabBar()) {
- this.getTabBar().setData({
- redDot: app.tabRedDot,
- selected: 0
- })
- }
- // this.showModal();
- net.connect({
- url: url.app_host + url.getCashCouponCount,
- data: {},
- method: 'POST',
- success: (err, res) => {
- businessT.debugLog(res)
- console.log("测试")
- console.log(res)
- },
- fail: (err, res) => {
- businessT.debugLog(err)
- }
- }, true)
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
-
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
-
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- return {
- imageUrl: '../../icon/public/share_img.png',
- title: '自助缴社保公积金,覆盖200多个城市,专业团队操作'
- }
- }
- })
|