yj
2024-12-05 ac3234c308e86f20cc63465573f321561ee00690
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
<template>
  <view class="container">
    <view class="list-cell b-b m-t" hover-class="cell-hover" :hover-stay-time="50" @click="navTo('个人资料')">
      <text class="cell-tit">
        个人资料
      </text>
      <text class="cell-more yticon icon-you" />
    </view>
    <view class="list-cell b-b" hover-class="cell-hover" :hover-stay-time="50" @click="navTo('收货地址')">
      <text class="cell-tit">
        收货地址
      </text>
      <text class="cell-more yticon icon-you" />
    </view>
    <view class="list-cell" hover-class="cell-hover" :hover-stay-time="50" @click="navTo('实名认证')">
      <text class="cell-tit">
        实名认证
      </text>
      <text class="cell-more yticon icon-you" />
    </view>
 
    <view class="list-cell m-t">
      <text class="cell-tit">
        消息推送
      </text>
      <switch checked color="#fa436a" @change="switchChange" />
    </view>
    <view class="list-cell m-t b-b" hover-class="cell-hover" :hover-stay-time="50" @click="navTo('清除缓存')">
      <text class="cell-tit">
        清除缓存
      </text>
      <text class="cell-more yticon icon-you" />
    </view>
    <view class="list-cell b-b" hover-class="cell-hover" :hover-stay-time="50" @click="navTo('关于Dcloud')">
      <text class="cell-tit">
        关于Dcloud
      </text>
      <text class="cell-more yticon icon-you" />
    </view>
    <view class="list-cell">
      <text class="cell-tit">
        检查更新
      </text>
      <text class="cell-tip">
        当前版本 1.0.3
      </text>
      <text class="cell-more yticon icon-you" />
    </view>
    <view class="list-cell log-out-btn" @click="toLogout">
      <text class="cell-tit">
        退出登录
      </text>
    </view>
  </view>
</template>
 
<script>
import {
  mapMutations
} from 'vuex'
export default {
  data() {
    return {
 
    }
  },
  methods: {
    ...mapMutations(['logout']),
 
    navTo(url) {
      this.$api.msg(`跳转到${url}`)
    },
    // 退出登录
    toLogout() {
      uni.showModal({
        content: '确定要退出登录么',
        success: (e) => {
          if (e.confirm) {
            this.logout()
            setTimeout(() => {
              uni.navigateBack()
            }, 200)
          }
        }
      })
    },
    // switch
    switchChange(e) {
      const statusTip = e.detail.value ? '打开' : '关闭'
      this.$api.msg(`${statusTip}消息推送`)
    }
 
  }
}
</script>
 
<style lang='scss'>
    page{
        background: $page-color-base;
    }
    .list-cell{
        display:flex;
        align-items:baseline;
        padding: 20upx $page-row-spacing;
        line-height:60upx;
        position:relative;
        background: #fff;
        justify-content: center;
        &.log-out-btn{
            margin-top: 40upx;
            .cell-tit{
                color: $uni-color-primary;
                text-align: center;
                margin-right: 0;
            }
        }
        &.cell-hover{
            background:#fafafa;
        }
        &.b-b:after{
            left: 30upx;
        }
        &.m-t{
            margin-top: 16upx;
        }
        .cell-more{
            align-self: baseline;
            font-size:$font-lg;
            color:$font-color-light;
            margin-left:10upx;
        }
        .cell-tit{
            flex: 1;
            font-size: $font-base + 2upx;
            color: $font-color-dark;
            margin-right:10upx;
        }
        .cell-tip{
            font-size: $font-base;
            color: $font-color-light;
        }
        switch{
            transform: translateX(16upx) scale(.84);
        }
    }
</style>