set.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view class="container">
  3. <view class="box" @click="navTo('/pages/set/gongao')">
  4. <view class="box-left">
  5. <view class="img">
  6. <image src="../../static/user/set01.png" mode="" ></image>
  7. </view>
  8. <view class="title">
  9. 公告
  10. </view>
  11. </view>
  12. <view class="img-right">
  13. <image src="../../static/user/right01.png" mode=""></image>
  14. </view>
  15. </view>
  16. <view class="box" @click="navTo('/pages/user/about')">
  17. <view class="box-left">
  18. <view class="img">
  19. <image src="../../static/user/set02.png" mode=""></image>
  20. </view>
  21. <view class="title">
  22. 关于我们
  23. </view>
  24. </view>
  25. <view class="img-right">
  26. <image src="../../static/user/right01.png" mode=""></image>
  27. </view>
  28. </view>
  29. <view class="box" @click="navTo('/pages/set/password')">
  30. <view class="box-left">
  31. <view class="img">
  32. <image src="../../static/user/set03.png" mode=""></image>
  33. </view>
  34. <view class="title">
  35. 交易密码
  36. </view>
  37. </view>
  38. <view class="img-right">
  39. <image src="../../static/user/right01.png" mode=""></image>
  40. </view>
  41. </view>
  42. <view class="list-cell log-out-btn" @click="toLogout"><text class="cell-tit">退出登录</text></view>
  43. </view>
  44. </template>
  45. <script>
  46. import uniList from '@/components/uni-list/uni-list.vue';
  47. import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
  48. import {
  49. logout
  50. } from '@/api/set.js';
  51. import {
  52. mapMutations
  53. } from 'vuex';
  54. export default {
  55. components: {
  56. uniList,
  57. uniListItem
  58. },
  59. data() {
  60. return {};
  61. },
  62. methods: {
  63. ...mapMutations('user', ['logout']),
  64. navTo(url) {
  65. uni.navigateTo({
  66. url: url
  67. });
  68. },
  69. //退出登录
  70. toLogout() {
  71. let obj = this;
  72. uni.showModal({
  73. content: '确定要退出登录么',
  74. success: e => {
  75. if (e.confirm) {
  76. logout({})
  77. .then(e => {
  78. uni.navigateBack();
  79. })
  80. .catch(e => {
  81. console.log(e);
  82. });
  83. obj.logout();
  84. }
  85. }
  86. });
  87. },
  88. //switch切换触发方法
  89. switchChange(e) {
  90. console.log(e);
  91. let statusTip = e.value ? '打开' : '关闭';
  92. this.$api.msg(`${statusTip}消息推送`);
  93. }
  94. }
  95. };
  96. </script>
  97. <style lang="scss">
  98. page {
  99. background: #111111;
  100. width: 750rpx;
  101. height: 100%;
  102. }
  103. .box {
  104. border-radius: 25rpx;
  105. height: 85rpx;
  106. display: flex;
  107. justify-content: space-between;
  108. align-items: center;
  109. margin: 0 35rpx 30rpx 35rpx;
  110. padding: 0 35rpx;
  111. background: #222222;
  112. .box-left {
  113. display: flex;
  114. .img {
  115. width: 45rpx;
  116. height: 40rpx;
  117. image {
  118. width: 100%;
  119. height: 100%;
  120. }
  121. }
  122. .title {
  123. margin-left: 15rpx;
  124. font-size: 26rpx;
  125. font-weight: 500;
  126. color: #FFFFFF;
  127. line-height: 40rpx;
  128. }
  129. }
  130. .img-right {
  131. width: 14rpx;
  132. height: 24rpx;
  133. image {
  134. width: 100%;
  135. height: 100%;
  136. }
  137. }
  138. }
  139. .list-cell {
  140. display: flex;
  141. align-items: baseline;
  142. margin: 100rpx 30rpx 0 30rpx;
  143. line-height: 80rpx;
  144. height: 80rpx;
  145. position: relative;
  146. background: linear-gradient(270deg, #6E8DF7, #9977F6);
  147. border-radius: 10rpx;
  148. justify-content: center;
  149. &.log-out-btn {
  150. margin-top: 40rpx;
  151. .cell-tit {
  152. color: #fff;
  153. text-align: center;
  154. margin-right: 0;
  155. }
  156. }
  157. .cell-tit {
  158. flex: 1;
  159. font-size: $font-base + 2rpx;
  160. color: $font-color-dark;
  161. margin-right: 10rpx;
  162. }
  163. .cell-tip {
  164. font-size: $font-base;
  165. color: $font-color-light;
  166. }
  167. switch {
  168. transform: translateX(16rpx) scale(0.84);
  169. }
  170. }
  171. </style>