index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view class="accountSecurity-v">
  3. <u-cell-group style="padding: 0 20rpx;">
  4. <u-cell-item :title="$t('app.my.accountSecurity.changePassword')"
  5. @click="handelClick('/pages/my/modifyPsd/index','password')">
  6. </u-cell-item>
  7. <u-cell-item :title="$t('app.my.accountSecurity.mobilePhone')" :value="userInfo.mobilePhone"
  8. @click="handelClick('/pages/my/modifyPsd/index','mobilePhone',userInfo.mobilePhone)">
  9. </u-cell-item>
  10. <u-cell-item :title="$t('app.my.accountSecurity.email')" :value="userInfo.email"
  11. @click="handelClick('/pages/my/modifyPsd/index','email',userInfo.email)">
  12. </u-cell-item>
  13. <!-- #ifdef APP-PLUS -->
  14. <u-cell-item title="注销账号" @click="openPage('/pages/my/cancellation/index')"></u-cell-item>
  15. <!-- #endif -->
  16. </u-cell-group>
  17. </view>
  18. </template>
  19. <script>
  20. import {
  21. getUserSettingInfo
  22. } from "@/api/common.js"
  23. export default {
  24. data() {
  25. return {
  26. userInfo: {},
  27. needRefresh: false
  28. }
  29. },
  30. onShow() {
  31. if (this.needRefresh) {
  32. this.needRefresh = false;
  33. this.init();
  34. }
  35. },
  36. onLoad() {
  37. this.init()
  38. },
  39. methods: {
  40. init() {
  41. getUserSettingInfo().then(res => {
  42. this.userInfo = res.data || {}
  43. })
  44. },
  45. openPage(path, type) {
  46. uni.navigateTo({
  47. url: path
  48. })
  49. },
  50. handelClick(path, type, vuale) {
  51. if (!path) return
  52. this.needRefresh = true
  53. let config = {
  54. type,
  55. vuale
  56. }
  57. uni.navigateTo({
  58. url: path + '?config=' + encodeURIComponent(JSON.stringify(config))
  59. })
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss">
  65. page {
  66. background-color: #f0f2f6;
  67. }
  68. :deep(.u-cell) {
  69. height: 112rpx;
  70. padding: 20rpx 0;
  71. }
  72. .accountSecurity-v {
  73. background-color: #fff;
  74. /* #ifdef MP-WEIXIN */
  75. height: 360rpx;
  76. /* #endif */
  77. }
  78. </style>