export default {
    /**
     * 微信app是否安装
     */
    iSExistWeixinApp: (state) => {
        return state.iSExistWeixinApp
    },

    /**
     * 登录状态
     */
    isLogin: (state) => {
        return state.isLogin
    },

    /**
     * 临时数据
     */
    tmpData: (state) => {
        return state.tmpData
    },

    /**
     * 临时token
     */
    tmpToken: (state) => {
        return state.tmpToken
    },

    /**
     * 用户信息
     */
    selfInfo: (state) => {
        let selfInfo = state.selfInfo

        let obj = {
            ...state.selfInfo,
            avatar: selfInfo.avatar ? selfInfo.avatar : 'https://image.jxc4.com/image/9dc7d11b8e64049273dd1bc6ad938166.png',
            waybillArrears: 0, // 物流欠款
        }

        // #ifndef MP-WEIXIN
        let userInfo = uni.getStorageSync('aldstat_user_info')
        obj.name = userInfo.nickName ? userInfo.nickName : selfInfo.name
        obj.avatar = userInfo.avatarUrl ? userInfo.avatarUrl : (selfInfo.avatar ? selfInfo.avatar : 'https://image.jxc4.com/image/9dc7d11b8e64049273dd1bc6ad938166.png')
        // #endif

        return obj
    },

    /**
     * 是否绑定手机号
     */
    isBindMobile: (state) => {
        return state.selfInfo.mobile ? true : false
    },

    /**
     * 服务信息
     */
    cms: (state) => {
        return state.cms
    }
}