ann0707
2018-08-16 c9bc8ec61cff4076132f6396d99d383a2cdf5a03
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<template>
    <div class="setting">
        <x-header
            :left-options.showBack="{backText: ''}"
            :title="'设置'"
        ></x-header>
        <Group>
            <cell title="修改密码" v-if="showBtn" :is-link="true" link="/f-update-password"></cell>
            <!--<cell title="给予评价" :is-link="true"></cell>-->
            <!--<cell title="关于我们" :is-link="true"></cell>-->
            <cell title="当前版本" v-if="showVer"  @click.native="alertUpdata">{{appVer}}</cell>
 
        </Group>
        <FButton v-if="showBtn" text="退出登录" class="btn" @click.native="logoutFn"></FButton>
     </div>
</template>
<script>
    /**
     * Created by 吴彦祖 on 2018/4/2.
     * 我的--设置
     */
    import FButton from '../../components/common/FButton.vue'
    import { Group , Cell , XHeader, Alert,XButton} from 'vux';
    import sysApi from '../../api/api';
    import statusCodeManage from '../../api/statusCodeManage';
    export default {
        name: 'f-setting',
        components:{
            XHeader,
            Group,
            Cell,
            FButton,
            Alert,
            XButton
        },
        data(){
            return {
                toChangePwd:'',
                appVer:'V 1.0.0',
                showBtn:false,
                showVer:true
            }
        },
        methods:{
            logoutFn(){
                sysApi.logout().then(
                    res=>{
                        window.sessionStorage.removeItem('newClientState');
                        window.sessionStorage.removeItem('newPhoneNum');
                        window.sessionStorage.removeItem('newSid');
                        this.$router.push({name:'/f-main'});
                    },
                    err=>{
                        statusCodeManage.showTipOfStatusCode(err,this);
                    }
                )
            }
        },
        activated(){
            this.$store.commit('UPDATE_DIRECTION', {direction: 'in'});
            let sid=window.sessionStorage.getItem('newSid');
            let clientInfo=JSON.parse(window.localStorage.getItem('newClientInfo'));
            if(clientInfo.cn){
                this.showVer=false;
            }else{
                this.showVer=true;
            }
            if(sid){
                this.showBtn=true;
            }else{
                this.showBtn=false;
            }
        },
        deactivated () {
            this.$store.commit('UPDATE_DIRECTION', {direction: 'none'});
        }
    }
</script>
<style lang="less">
    @import '../../style/mixin.less';
    .setting{
        background-color: @color-background-default;
        .vux-header {
            .color-linear-gradient(@color-primary-light, @color-primary, 90deg);
            .vux-header-title {
                font-size: 18px;
            }
            .vux-header-left {
                .left-arrow:before {
                    border: solid 1px @color-white;
                    border-width: 2px 0 0 2px;
                }
            }
        }
        .weui-cells{
            margin-top:10px;
        }
        .vux-label{
            font-size:@font-size-base;
            color: @color-text-primary;
        }
        .weui-btn:after{
            display: none;
        }
 
 
        /*.weui-dialog{*/
            /*width:240px;*/
            /*height:346px;*/
            /*background-image: url("../../assets/img/wechat.png");*/
            /*background-size:240px 346px;*/
            /*border-radius:7.5PX;*/
            /*overflow: visible;*/
        /*}*/
        /*.weui-dialog__hd{*/
            /*display: none;*/
        /*}*/
        /*.weui-dialog__bd{*/
            /*width:100%;*/
            /*height:100%;*/
            /*position: relative;*/
            /*box-sizing: border-box;*/
            /*img{*/
                /*width:83px;*/
                /*height:83px;*/
                /*position: absolute;*/
                /*left:50%;*/
                /*bottom:10px;*/
                /*margin-left: -42px;*/
            /*}*/
            /*.close-icon{*/
                /*width:83px;*/
                /*height:83px;*/
                /*position: absolute;*/
                /*left:50%;*/
                /*bottom:-82px;*/
                /*margin-left: -42px;*/
                /*span:after{*/
                    /*content:"";*/
                    /*border-right: 1PX solid #ffffff;*/
                    /*font-size:20PX;*/
               /*}*/
                /*i{*/
                    /*display: block;*/
                    /*font-size:25PX;*/
                    /*color: #ffffff;*/
                /*}*/
            /*}*/
        /*}*/
        /*.weui-dialog__ft{*/
            /*display: none;*/
        /*}*/
        /*.f-button-alert{*/
            /*width:110px;*/
            /*height: 33px;*/
            /*font-size: 14PX;*/
            /*background-color: #fff000 !important;*/
            /*color: #0092f1;*/
            /*position: absolute;*/
            /*left:50%;*/
            /*top:189px;*/
            /*margin-left: -55px;*/
        /*}*/
    }
</style>