set.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view class="container">
  3. <view class="listBox">
  4. <view class="list">
  5. <view class="flex listItem" @click="navTo('/pages/set/userinfo')">
  6. <view class="flex titleBox">
  7. <text class="title">昵称</text>
  8. </view>
  9. <view class="right flex">
  10. <text>{{userInfo.nickname}}</text>
  11. <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
  12. </view>
  13. </view>
  14. <view class="flex listItem" v-if="userInfo.mobile" >
  15. <view class="flex titleBox">
  16. <text class="title">手机号</text>
  17. </view>
  18. <view class="right flex">
  19. <text>{{userInfo.mobile}}</text>
  20. <!-- <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image> -->
  21. </view>
  22. </view>
  23. <view class="flex listItem" @click="navTo('/pages/set/lng')" v-if="userInfo.work_type_title">
  24. <view class="flex titleBox">
  25. <text class="title">补充定位</text>
  26. </view>
  27. <view class="right flex">
  28. <text></text>
  29. <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
  30. </view>
  31. </view>
  32. <!-- <view class="flex listItem" @click="navTo('/pages/user/realName/realNameAuthentication')">
  33. <view class="flex titleBox">
  34. <text class="title">实名认证</text>
  35. </view>
  36. <view class="right flex">
  37. <text></text>
  38. <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
  39. </view>
  40. </view> -->
  41. <!-- <view class="flex listItem" @click="navTo('/pages/set/password')">
  42. <view class="flex titleBox">
  43. <text class="title">修改密码</text>
  44. </view>
  45. <view class="right flex">
  46. <text></text>
  47. <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
  48. </view>
  49. </view> -->
  50. <!-- #ifdef APP -->
  51. <view class="flex listItem" @click="$refs.inputDialog.open()">
  52. <view class="flex titleBox">
  53. <text class="title">注销账号</text>
  54. </view>
  55. <view class="right flex">
  56. <text></text>
  57. <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
  58. </view>
  59. </view>
  60. <!-- #endif -->
  61. </view>
  62. </view>
  63. <view class="base-buttom" @click="toLogout">
  64. 退出账号
  65. </view>
  66. <!-- #ifdef APP -->
  67. <uni-popup ref="inputDialog" type="dialog">
  68. <uni-popup-dialog ref="inputClose" mode="input" title="注销账号" value="" placeholder="请输入账号密码"
  69. @confirm="outAccount"></uni-popup-dialog>
  70. </uni-popup>
  71. <!-- #endif -->
  72. </view>
  73. </template>
  74. <script>
  75. import {
  76. mapMutations,
  77. mapState
  78. } from 'vuex';
  79. export default {
  80. data() {
  81. return {
  82. };
  83. },
  84. computed: {
  85. ...mapState('user', ['userInfo'])
  86. },
  87. methods: {
  88. ...mapMutations('user', ['logout']),
  89. // #ifdef APP
  90. outAccount() {
  91. uni.showModal({
  92. title: '警告',
  93. content: '注销后账号不可恢复是否注销?',
  94. cancelText: '取消',
  95. confirmText: '立即注销',
  96. success: res => {
  97. if (res.confirm) {
  98. uni.showModal({
  99. title: '提示',
  100. content: '已提交注销申请!请等待处理结果',
  101. showCancel: false,
  102. });
  103. }
  104. },
  105. });
  106. },
  107. // #endif
  108. navTo(url) {
  109. uni.navigateTo({
  110. url: url
  111. })
  112. },
  113. //退出登录
  114. toLogout() {
  115. let obj = this;
  116. uni.showModal({
  117. content: '确定要退出登录么',
  118. success: (e) => {
  119. if (e.confirm) {
  120. obj.logout();
  121. uni.setStorageSync('token', '');
  122. uni.navigateBack();
  123. }
  124. }
  125. });
  126. }
  127. }
  128. }
  129. </script>
  130. <style lang='scss'>
  131. .container {
  132. padding-top: 30rpx;
  133. }
  134. .listBox {
  135. margin: 0 $page-row-spacing;
  136. background-color: #FFFFFF;
  137. border-radius: 20rpx;
  138. overflow: hidden;
  139. }
  140. .list {
  141. .listItem {
  142. padding: 35rpx 40rpx;
  143. border-bottom: 1px solid $page-color-light;
  144. }
  145. .listIconImg {
  146. width: 36rpx;
  147. }
  148. .right {
  149. color: $font-color-light;
  150. font-size: $font-base;
  151. flex-grow: 1;
  152. justify-content: flex-end;
  153. .img {
  154. width: 26rpx;
  155. }
  156. }
  157. .titleBox {
  158. .title {
  159. color: $font-color-base;
  160. font-size: $font-base;
  161. }
  162. }
  163. }
  164. .row {
  165. display: flex;
  166. align-items: center;
  167. padding: 35rpx 40rpx;
  168. background: #fff;
  169. border-bottom: 1px solid $page-color-light;
  170. .background-img {
  171. width: 80rpx;
  172. height: 80rpx;
  173. border-radius: 50%;
  174. background: #f2f2f2;
  175. }
  176. .tit {
  177. flex-shrink: 0;
  178. width: 120upx;
  179. font-size: $font-base;
  180. color: $font-color-base;
  181. }
  182. .input {
  183. flex: 1;
  184. text-align: right;
  185. font-size: $font-base;
  186. color: $color-gray;
  187. }
  188. }
  189. </style>