Нет описания

setting.vue 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="content">
  3. <view class="userInfo">
  4. <view class="userInfoLeft">
  5. <image src="../../static/person.png" mode=""></image>
  6. </view>
  7. <view class="userInfoRight">
  8. <view>{{ userName }}</view>
  9. <view>{{ userCode }}</view>
  10. </view>
  11. </view>
  12. <view class="userList">
  13. <view class="listCell" v-for="(item,index) in listCell" :key="index">
  14. <image :src="item.imgPath"></image>
  15. <text>{{item.itemText}}</text>
  16. <uni-icons class="fontIcon" type="arrowright" color="#d6d6d4" size="18"></uni-icons>
  17. </view>
  18. <view class="listCell">
  19. <image src="../../static/Wd.png"></image>
  20. <text>版本</text>
  21. <text class="versionNum">1.0.0</text>
  22. </view>
  23. </view>
  24. <view class="btnExit">
  25. <button type="primary" @click="btnExit">退出登录</button>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import { mapGetters } from 'vuex';
  31. import store from '@/store';
  32. export default{
  33. data(){
  34. return{
  35. listCell:[
  36. {
  37. imgPath:'../../static/Wa.png',
  38. itemText:'服务守则'
  39. },
  40. {
  41. imgPath:'../../static/Wc.png',
  42. itemText:'服务协议'
  43. }
  44. ]
  45. }
  46. },
  47. onLoad() {
  48. // #ifdef APP-PLUS
  49. console.log(plus.runtime)
  50. // #endif
  51. },
  52. methods: {
  53. btnExit(){
  54. uni.showModal({
  55. title: '确定退出吗?',
  56. content: '退出到登录页面',
  57. success: function (res) {
  58. if (res.confirm) {
  59. uni.setStorageSync('Username', '');
  60. uni.setStorageSync('Password', '');
  61. uni.setStorageSync('token', '');
  62. uni.reLaunch({
  63. url: '/pages/login/login'
  64. });
  65. } else if (res.cancel) {
  66. console.log('用户点击取消');
  67. }
  68. }
  69. });
  70. }
  71. },
  72. computed: {
  73. ...mapGetters([
  74. "userCode", // 用户工号
  75. "userName", // 用户名称
  76. ])
  77. }
  78. }
  79. </script>
  80. <style lang="scss">
  81. .userInfo{
  82. background: url(../../static/setting_banner.png) no-repeat;
  83. background-size: 100% 100%;
  84. width: 100%;
  85. height: 260rpx;
  86. display: flex;
  87. .userInfoLeft{
  88. width: 150rpx;
  89. height: 150rpx;
  90. border-radius: 75rpx;
  91. margin: 30rpx 30rpx 0rpx 30rpx;
  92. background: #FFFFFF;
  93. image{
  94. width: 100%;
  95. height: 100%;
  96. padding: 30rpx 20rpx 30rpx 35rpx;
  97. box-sizing: border-box ;
  98. }
  99. }
  100. .userInfoRight{
  101. margin-top: 50rpx;
  102. view{
  103. color: #FFFFFF;
  104. font-size: 30rpx;
  105. }
  106. }
  107. }
  108. .userList{
  109. width: 100%;
  110. border-top: 1rpx solid #d6d6d4;
  111. border-bottom: 1rpx solid #d6d6d4;
  112. background: #FFFFFF;
  113. margin-top: 40rpx;
  114. overflow: hidden;
  115. .listCell{
  116. width: 720rpx;
  117. margin-left: 30rpx;
  118. height: 84rpx;
  119. line-height: 84rpx;
  120. border-bottom: 1rpx solid #d6d6d4;
  121. position: relative;
  122. display: flex;
  123. image{
  124. width: 40rpx;
  125. height: 40rpx;
  126. margin: 22rpx 22rpx 0 22rpx;
  127. box-sizing: border-box;
  128. }
  129. .fontIcon{
  130. position: absolute;
  131. right: 40rpx;
  132. }
  133. .versionNum{
  134. position: absolute;
  135. right: 80rpx;
  136. color: #999998;
  137. }
  138. }
  139. .listCell:last-child{
  140. border: none;
  141. }
  142. }
  143. .btnExit{
  144. width: 80%;
  145. margin: 30rpx auto;
  146. button{
  147. background: #f1ae53;
  148. }
  149. }
  150. </style>