set.vue 4.2 KB

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