security.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="page">
  3. <!-- 基本资料组 -->
  4. <view class="group">
  5. <view class="item" @click="goPage('/pages/my/editInfo')">
  6. <text class="title">基本资料</text>
  7. <view class="right">
  8. <text class="value">去完善</text>
  9. <image class="arrow" src="../../static/me/arrow_right_gray.png" mode="widthFix"></image>
  10. </view>
  11. </view>
  12. </view>
  13. <!-- 账号安全组 -->
  14. <view class="group">
  15. <view class="item" @click="goPage('/pages/my/editMobile?originalPhoneNumber='+ phoneNumber)">
  16. <text class="title">手机号</text>
  17. <view class="right">
  18. <text class="value">{{ formatPhoneNumber( phoneNumber )|| '未绑定' }}</text>
  19. <image class="arrow" src="../../static/me/arrow_right_gray.png" mode="widthFix"></image>
  20. </view>
  21. </view>
  22. <view class="item" @click="goPage('/pages/my/editPass')" v-if="false">
  23. <text class="title">登录密码</text>
  24. <view class="right">
  25. <text class="value">未设置</text>
  26. <image class="arrow" src="../../static/me/arrow_right_gray.png" mode="widthFix"></image>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- 第三方账号组 -->
  31. <view class="group">
  32. <view class="item" @click="bindWechat">
  33. <text class="title">微信账号</text>
  34. <view class="right">
  35. <text class="value">{{ wechat || '未绑定' }}</text>
  36. <image class="arrow" src="../../static/me/arrow_right_gray.png" mode="widthFix"></image>
  37. </view>
  38. </view>
  39. <view class="item" @click="bindQQ" v-if="false">
  40. <text class="title">QQ账号</text>
  41. <view class="right">
  42. <text class="value">未授权</text>
  43. <image class="arrow" src="../../static/me/arrow_right_gray.png" mode="widthFix"></image>
  44. </view>
  45. </view>
  46. </view>
  47. <!-- 删除账号组 -->
  48. <view class="group">
  49. <view class="item" @click="goPage('/pages/my/DelMemConfirm')" >
  50. <text class="title red">删除用户</text>
  51. <view class="right">
  52. <text class="value red">注销账户</text>
  53. <image class="arrow" style="width: 30rpx; height: 30rpx;" src="../../static/me/wd_icon_jiantou_red.png" mode="widthFix"></image>
  54. </view>
  55. </view>
  56. </view>
  57. <DialogBox ref="DialogBox"></DialogBox>
  58. </view>
  59. </template>
  60. <script>
  61. export default {
  62. components: { }, // 注册组件
  63. data() {
  64. return {
  65. phoneNumber: '', // 用户手机号
  66. wechat: '',
  67. }
  68. },
  69. onLoad() {
  70. this.loadUserInfo()
  71. },
  72. methods: {
  73. loadUserInfo() {
  74. // 这里添加获取用户信息的逻辑
  75. // 获取手机号等信息
  76. uni.request({
  77. url: this.$apiHost + "/User/getinfo",
  78. data: {
  79. uuid: getApp().globalData.uuid,
  80. skey: getApp().globalData.skey,
  81. },
  82. header: {
  83. "content-type": "application/json",
  84. sign: getApp().globalData.headerSign,
  85. },
  86. success: (res) => {
  87. this.phoneNumber = res.data.mobile;
  88. this.wechat = res.data.wechat;
  89. },
  90. complete: (com) => {
  91. },
  92. fail: (e) => {
  93. console.log("----e:", e);
  94. },
  95. });
  96. },
  97. goPage(url) {
  98. uni.navigateTo({
  99. url: url
  100. })
  101. },
  102. bindWechat() {
  103. // 微信绑定逻辑
  104. // uni.showToast({
  105. // title: '暂未开放',
  106. // icon: 'none'
  107. // })
  108. this.$refs['DialogBox'].confirm({
  109. title: '确认解绑',
  110. content: '解绑微信账号后将无法继续使用它登录该App账号',
  111. DialogType: 'inquiry',
  112. btn1: '再考虑一下',
  113. btn2: '确认解绑',
  114. animation: 0
  115. }).then(() => {
  116. uni.showToast({
  117. title: '暂未开放',
  118. icon: 'none'
  119. })
  120. })
  121. },
  122. bindQQ() {
  123. // QQ绑定逻辑
  124. uni.showToast({
  125. title: '暂未开放',
  126. icon: 'none'
  127. })
  128. },
  129. formatPhoneNumber(phoneNumber) {
  130. if (phoneNumber && phoneNumber.length === 11) {
  131. return phoneNumber.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  132. }
  133. return phoneNumber;
  134. },
  135. }
  136. }
  137. </script>
  138. <style scoped lang="scss">
  139. @import 'security.scss';
  140. </style>