setting.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <view class="setting">
  3. <!-- 占位元素 -->
  4. <view style="height: 24rpx;"></view>
  5. <!-- 列表 -->
  6. <view class="cell">
  7. <view class="cell_item" @click="goPrivacy">
  8. <text>隐私政策</text>
  9. <image src="/static/icon/right.png"></image>
  10. </view>
  11. <view class="cell_item" @click="goUser">
  12. <text>用户协议</text>
  13. <image src="/static/icon/right.png"></image>
  14. </view>
  15. <view class="cell_item" @click="goVerfication" v-if="staff !=null">
  16. <text>核销中心</text>
  17. <image src="/static/icon/right.png"></image>
  18. </view>
  19. </view>
  20. <!-- 按钮 -->
  21. <view class="btn" @click="loginOut">
  22. <text>退出登录</text>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. staff:'',
  31. }
  32. },
  33. onLoad() {
  34. this.staff = this.$store.getters.staff
  35. },
  36. methods: {
  37. // 跳转隐私政策
  38. goPrivacy() {
  39. uni.navigateTo({
  40. url: '/pages/my/protocol/PrivacyPolicy'
  41. })
  42. },
  43. // 跳转用户协议
  44. goUser() {
  45. uni.navigateTo({
  46. url: '/pages/my/protocol/UserAgreement'
  47. })
  48. },
  49. // 跳转核销中心
  50. goVerfication() {
  51. uni.navigateTo({
  52. url: '/pages/my/verification/verification'
  53. })
  54. },
  55. // 退出登录
  56. loginOut() {
  57. if (this.$store.getters.token) {
  58. //记录用户曾经登录过
  59. this.$store.getters.userInfo.isLoginOff = true
  60. this.$store.dispatch("user/info", this.$store.getters.userInfo)
  61. // this.$store.dispatch("user/token", null)
  62. // uni.removeStorageSync('auth_token')
  63. // uni.removeStorageSync('userInfo')
  64. uni.reLaunch({
  65. url:'/pages/login/login'
  66. })
  67. } else {
  68. uni.showToast({
  69. title: '请先登录!',
  70. icon: 'error'
  71. })
  72. }
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. $pageColor:#F9F9F9;
  79. $bgColor:#FFFFFF;
  80. @mixin flexlayout {
  81. display: flex;
  82. align-items: center;
  83. justify-content: center;
  84. }
  85. .setting {
  86. height: 100%;
  87. background: $pageColor;
  88. }
  89. .cell {
  90. width: 100%;
  91. border-radius: 16rpx;
  92. padding: 0 30rpx;
  93. background: $bgColor;
  94. margin-bottom: 48rpx;
  95. .cell_item {
  96. box-sizing: border-box;
  97. height: 110rpx;
  98. width: 690rpx;
  99. border-bottom: solid 2rpx #F0F0F0;
  100. display: flex;
  101. align-items: center;
  102. position: relative;
  103. text {
  104. font-size: 30rpx;
  105. font-family: PingFang-SC-Medium, PingFang-SC;
  106. font-weight: 500;
  107. color: #000000;
  108. }
  109. image {
  110. width: 12rpx;
  111. height: 20rpx;
  112. position: absolute;
  113. right: 0rpx;
  114. top: 46rpx;
  115. }
  116. }
  117. .cell_item:nth-last-child(1) {
  118. box-sizing: border-box;
  119. height: 110rpx;
  120. width: 690rpx;
  121. border-bottom: solid 0rpx #F0F0F0;
  122. display: flex;
  123. align-items: center;
  124. position: relative;
  125. text {
  126. font-size: 30rpx;
  127. font-family: PingFang-SC-Medium, PingFang-SC;
  128. font-weight: 500;
  129. color: #000000;
  130. }
  131. image {
  132. width: 12rpx;
  133. height: 20rpx;
  134. position: absolute;
  135. right: 0rpx;
  136. top: 46rpx;
  137. }
  138. }
  139. }
  140. .btn {
  141. width: 690rpx;
  142. height: 92rpx;
  143. background: $bgColor;
  144. border-radius: 16rpx;
  145. margin-left: 30rpx;
  146. @include flexlayout() text {
  147. font-size: 28rpx;
  148. font-family: PingFang-SC-Medium, PingFang-SC;
  149. font-weight: 500;
  150. color: #333333;
  151. }
  152. }
  153. </style>