my_center.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <uv-toast ref="toast"></uv-toast>
  3. <view class="">
  4. <navbar :title="$t('my_center')" size="48" :backtext="$t('back')" color="#fff" :backShow="false"></navbar>
  5. </view>
  6. <view class="app_content">
  7. <uv-cell-group :title="$t('policy')">
  8. <uv-cell :title="$t('privacy_policy')" :isLink="true" @click="showPrivacyPolicy"></uv-cell>
  9. </uv-cell-group>
  10. <br />
  11. <uv-cell-group title="">
  12. <uv-cell :title="$t('quit')" :isLink="true" @click="quit"></uv-cell>
  13. </uv-cell-group>
  14. <br />
  15. <!-- <uv-cell-group title="">
  16. <uv-cell :title="$t('cancel_account')" :isLink="true" @click="cancel_account"></uv-cell>
  17. </uv-cell-group> -->
  18. <uv-cell-group title="">
  19. <uv-cell>
  20. <template v-slot:title>
  21. <text class="cancel_account" @click="cancel_account">{{$t('cancel_account')}}</text>
  22. </template>
  23. </uv-cell>
  24. </uv-cell-group>
  25. </view>
  26. </template>
  27. <script>
  28. import {cancelaccount} from "@/common/api/user.js"
  29. export default {
  30. data() {
  31. return {
  32. userinfo:{},
  33. }
  34. },
  35. methods: {
  36. init_reload(){
  37. this.userinfo = uni.getStorageSync("userinfo")
  38. },
  39. quit(){
  40. uni.removeStorage({
  41. key: 'userinfo',
  42. });
  43. uni.redirectTo({
  44. url: '/pages/login/login'
  45. });
  46. },
  47. showPrivacyPolicy(){
  48. let weburl = 'https://app.chienxutech.com:30443/Uploads/ssjprivate_en.html';
  49. uni.navigateTo({
  50. url: '/pages/webview/webview?weburl='+weburl+'&title='+this.$t('privacy_policy')
  51. });
  52. },
  53. cancel_account(){
  54. let uid = this.userinfo.id
  55. let data={uid:uid}
  56. cancelaccount(data)
  57. }
  58. },
  59. mounted(){
  60. uni.setNavigationBarTitle({
  61. title: this.$t('my_center')
  62. });
  63. },
  64. onShow(option){
  65. this.init_reload()
  66. },
  67. }
  68. </script>
  69. <style scoped>
  70. .app_content{
  71. padding: 0 1em;
  72. }
  73. </style>
  74. <style lang="scss" scoped>
  75. .cancel_account{
  76. color: $uni-color-error;
  77. }
  78. </style>