set.vue 3.8 KB

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