accountinfo.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="content">
  3. <view class="cell-group">
  4. <view class="hflex acenter jbetween cell">
  5. <view class="left">手机号码</view>
  6. <view class="hflex acenter">
  7. <view class="right">{{user.phone}}</view>
  8. <!-- <u-icon name="arrow-right" color="#000" size="10"></u-icon> -->
  9. </view>
  10. </view>
  11. <view class="hflex acenter jbetween cell" @click="bindEmail">
  12. <view class="left">邮箱</view>
  13. <view class="hflex acenter">
  14. <view class="right">{{user.email?user.email:''}}</view>
  15. <u-icon name="arrow-right" color="#000" size="10"></u-icon>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="cell-group">
  20. <view class="hflex acenter jbetween cell" @click="editPwd">
  21. <view class="left">密码</view>
  22. <view class="hflex acenter">
  23. <view class="right">修改密码</view>
  24. <u-icon name="arrow-right" color="#000" size="10"></u-icon>
  25. </view>
  26. </view>
  27. <view class="hflex acenter jbetween cell" @click="cancellation">
  28. <view class="left">账号注销</view>
  29. <view class="hflex acenter">
  30. <u-icon name="arrow-right" color="#000" size="10"></u-icon>
  31. </view>
  32. </view>
  33. </view>
  34. <u-modal :show="show" title="账号注销" content='您确定要注销此账号吗?' :showCancelButton="true" @cancel="close" @confirm="sure"></u-modal>
  35. </view>
  36. </template>
  37. <script>
  38. import $api from '@/static/js/api.js'
  39. var that = ''
  40. export default {
  41. data() {
  42. return {
  43. user: {},
  44. show: false,
  45. }
  46. },
  47. onLoad() {
  48. that = this
  49. },
  50. onShow() {
  51. that.getUser()
  52. },
  53. methods: {
  54. // 获取账户信息
  55. getUser() {
  56. $api.req({
  57. url: '/data/api.auth.Center/get',
  58. method: 'POST'
  59. }, function(res) {
  60. if(res.code == 1) {
  61. that.user = res.data
  62. }
  63. })
  64. },
  65. // 绑定邮箱
  66. bindEmail() {
  67. $api.jump('/page_shop/pages/setting/bindeMail?type=email')
  68. },
  69. // 修改密码
  70. editPwd() {
  71. $api.jump('/page_shop/pages/setting/editpwd')
  72. },
  73. cancellation() {
  74. $api.jump('/page_shop/pages/setting/log_off')
  75. },
  76. close() {
  77. that.show = false
  78. },
  79. sure() {
  80. $api.req({
  81. url: '/data/api.auth.Center/cancellation',
  82. method: 'POST'
  83. }, function(res) {
  84. if(res.code == 1) {
  85. uni.removeStorageSync("token")
  86. uni.removeStorageSync("address_id")
  87. uni.removeStorageSync("HXtoken")
  88. uni.removeStorageSync("id")
  89. uni.WebIM.conn.close();
  90. $api.jump('/pages/tabbar/mine/mine', 3)
  91. }
  92. })
  93. }
  94. },
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .content {
  99. background-color: #f5f5f5;
  100. .cell-group {
  101. width: 100%;
  102. background-color: #fff;
  103. margin-top: 20rpx;
  104. padding: 0 30rpx;
  105. box-sizing: border-box;
  106. .cell {
  107. box-sizing: border-box;
  108. padding: 36rpx 0;
  109. border-bottom: 1rpx solid #f5f5f5;
  110. .left {
  111. font-size: 30rpx;
  112. color: #222;
  113. }
  114. .right {
  115. padding: 0 5rpx;
  116. font-size: 30rpx;
  117. color: #444;
  118. }
  119. .red {
  120. width: 12rpx;
  121. height: 12rpx;
  122. border-radius: 50%;
  123. background-color: #fb3e32;
  124. }
  125. .avatar {
  126. width: 88rpx;
  127. height: 88rpx;
  128. border-radius: 50%;
  129. }
  130. }
  131. .button {
  132. font-size: 36rpx;
  133. color: #506dff;
  134. padding: 20rpx 0;
  135. }
  136. }
  137. }
  138. </style>