accountCancellation.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view class="page">
  3. <view style="margin-bottom: 40rpx;">{{name}}</view>
  4. <u-parse :content="content"></u-parse>
  5. <button @click="show = true" class="btn">注销账号</button>
  6. <!-- <view class="cancellation">
  7. 注销后账户不可恢复,请谨慎操作
  8. </view> -->
  9. <u-modal :buttonReverse='true' :showCancelButton='true' @cancel='show = false' @confirm='logout'
  10. :confirmText='i18n.enter' :cancelText='i18n.Cancel' :show="show" :title="i18n.accountCancellation" :content='i18n.closeaccount'
  11. confirmColor='#606266' cancelColor='#2979ff'></u-modal>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. show: false,
  19. // title: '注销账号',
  20. // content: '确定要注销账号吗?',
  21. // confirmText: '确定',
  22. // cancelText: '取消'
  23. name:'',
  24. content:'',
  25. language :'zh-CN'
  26. }
  27. },
  28. onLoad() {
  29. uni.setNavigationBarTitle({
  30. title: this.i18n.accountCancellation
  31. })
  32. this.reminder()
  33. },
  34. onshow(){
  35. if (uni.getStorageSync('language') != '') {
  36. this.language = uni.getStorageSync('language')
  37. }
  38. },
  39. computed: {
  40. i18n() {
  41. return this.$t('index')
  42. }
  43. },
  44. methods: {
  45. //协议
  46. reminder(){
  47. uni.$u.http.get(`/api/agreement?code=cancellation_reminder`).then((res) => {
  48. console.log(res);
  49. if(this.language =='zh-CN'){
  50. this.name = res.name_cn
  51. this.content = res.content_cn
  52. }else if(this.language =='en-US'){
  53. this.name = res.name_en
  54. this.content = res.content_en
  55. }else if(this.language =='es-ES'){
  56. this.name = res.name_es
  57. this.content = res.content_es
  58. }else if(this.language =='it-IT'){
  59. this.name = res.name_ita
  60. this.content = res.content_ita
  61. }
  62. });
  63. },
  64. logout() {
  65. uni.$u.http.get(`/api/member/freeze`).then((res) => {
  66. // console.log(res);
  67. this.$u.toast('注销成功')
  68. this.show = false
  69. });
  70. }
  71. }
  72. }
  73. </script>
  74. <style scoped lang="scss">
  75. .page {
  76. background-color: #fff;
  77. height: 92.5vh;
  78. padding: 54rpx 44rpx;
  79. font-size: 30rpx;
  80. color: rgba(34, 34, 34, .7);
  81. .btn {
  82. background-color: #f83224;
  83. border-radius: 44rpx;
  84. color: #fff;
  85. margin-top: 108rpx
  86. }
  87. .cancellation {
  88. font-size: 24rpx;
  89. text-align: center;
  90. margin-top: 32rpx;
  91. }
  92. }
  93. </style>