123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- var businessT = require('../../../tools/business-tool.js')
- var sysT = require('../../../tools/sys-tool.js')
- const average = [7425, 7480, 7706, 7132]
- const result = [
- { status: '有点寒碜', introductions: '努力提高你的工资吧' },
- { status: '衣食无忧', introductions: '不缺吃不缺穿,偶尔下馆子' },
- { status: '小资', introductions: '不愁吃不愁穿,还能旅个游' },
- { status: '土豪君', introductions: '可随便吃喝玩乐,任性不差钱' }
- ]
- var app = getApp()
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- isRelay: false,
- result: {status: '', introductions: ''},
- ui: {
- nick: "",
- avatar: "",
- A: '',
- B: '',
- C: '',
- income: '',
- city: ''
- },
- interval: 0,
- medical: {
- s: false,
- d: ''
- },
- data: []
- },
- yearAction: businessT.action(function (sender) {
- wx.navigateTo({
- url: '../year/year',
- })
- }),
- getResult: function (income, city) {
- var a = average[3]
- businessT.debugLog(city);
- businessT.debugLog(a)
- if (income >= a * 1.5) {
- return result[3]
- } else if (income >= a) {
- return result[2]
- } else if (income >= a * 3 / 5) {
- return result[1]
- } else {
- return result[0]
- }
- },
- calculatorAction: businessT.action(function (sender) {
- wx.reLaunch({
- url: '../index',
- })
- }),
- //跳转社保小程序
- toPurchase: businessT.action(function (sender) {
- wx.navigateToMiniProgram({
- appId: 'wxbf3f03f8a7d0cdcf',
- })
- }),
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- businessT.debugLog(options)
- this.data.ui.avatar = options.url
- this.data.ui.nick = options.nick
- this.data.ui.A = options.A
- this.data.ui.B = options.B
- this.data.ui.C = options.C
- this.data.ui.income = options.income
- this.data.ui.city = options.city
- this.data.result = this.getResult(options.income, options.city)
- if (options.isRelay) {
- this.data.isRelay = options.isRelay
- }
- //年度个税
- this.data.data = app.result
- this.data.medical.s = app.medical.s
- this.data.medical.d = app.medical.rebate.toFixed(2)
- this.setData({
- ui: this.data.ui,
- isRelay: this.data.isRelay,
- result: this.data.result,
- data: this.data.data,
- medical: this.data.medical
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
-
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
-
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- return {
- title: this.data.ui.nick + ',邀请你PK税后工资',
- path: 'page/home/result/result?url=' + this.data.ui.avatar + '&nick=' + this.data.ui.nick + '&A=' + this.data.ui.A + '&B=' + this.data.ui.B + '&C=' + this.data.ui.C + '&income=' + this.data.ui.income + '&city=' + this.data.ui.city + '&isRelay=1'
- }
- }
- })
|