<template>
    <view class="container" hover-class="none" :hover-stop-propagation="false">
        <i v-if="success" style="color: #20b759" class="iconfont icon-tijiaochenggong2"></i>
        <i v-if="fail" style="color: #ff0000" class="iconfont icon-tishi"></i>
        <view class="f22 fw500" hover-class="none" :hover-stop-propagation="false">{{ messageInfo }}</view>
        <view class="f14 c9 mt16" v-if="status" hover-class="none" :hover-stop-propagation="false">
            {{ '错误代码：' + status }}
        </view>
        <view class="loginOut normalBtn" @tap="finish">完成</view>
        <view class="f14 mt24" @tap="toMine" hover-class="none" style="color: #576b95" :hover-stop-propagation="false">{{ from == 'bill' ? '返回职位列表' : '返回我的' }}</view>
    </view>
</template>

<script>
// pages/returnMessage/index.js
export default {
    data() {
        return {
            success: false,
            fail: false,
            from: '',
            messageInfo: '',
            status: null,
            type: false
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad(options) {
        console.log(options);
        let type = options.type;
        this.setData({
            [type]: true,
            messageInfo: options.msg,
            from: options.from
        });
        if (options.status) {
            this.setData({
                status: options.status
            });
        }
        console.log(this);
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {},
    methods: {
        /**
         * 用户点击右上角分享
         */
        onShareAppMessage1() {},

        finish() {
            // if (wx.getStorageSync("comeFromPage")) {
            // 	let from = wx.getStorageSync("comeFromPage");
            // 	wx.navigateTo({
            // 		url: `/pages/${from}/index`,
            // 	});
            // 	console.log(wx.getStorageSync("comeFromPage"));
            // }
            uni.switchTab({
                url: '/pages/mine/index'
            });
            // wx.navigateBack({
            // 	delta: 2,
            // });
        },

        /**
         * 点击返回我的
         *
         *
         */
        toMine(e) {
            console.log(e);
            if (this.from == 'bill') {
                uni.reLaunch({
                    url: '/pages/firstBill/index'
                });
            } else if (this.from == 'real') {
                uni.reLaunch({
                    url: '/pages/mine/index'
                });
            }
        }
    }
};
</script>
<style>
@import './index.css';
</style>
