mine.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view>
  3. <view class="contain">
  4. <!-- 第一部分 -->
  5. <view class="view">
  6. <view class="view-image-text" @tap="personal">
  7. <image
  8. class="image-radius"
  9. :src="config.avatar ? config.avatar : 'https://sdk-web-1252463788.cos.ap-hongkong.myqcloud.com/component/TUIKit/assets/avatar_21.png'"
  10. ></image>
  11. <view class="text-container">
  12. <view class="name">
  13. {{ config.nick ? config.nick : '提莫' }}
  14. <text class="hasname" v-if="hasname">(暂无昵称)</text>
  15. </view>
  16. <view class="ID">userID:{{ config.userID }}</view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="box">
  22. <block v-for="(item, index) in userListInfo" :key="index">
  23. <view class="list" :data-item="item" @tap="handleRouter">
  24. <image class="list-URL" :src="item.iconUrl"></image>
  25. <view class="list-name">
  26. <view>{{ item.name }}</view>
  27. </view>
  28. <image class="listimage" src="/static/static/assets/detail.svg"></image>
  29. </view>
  30. </block>
  31. </view>
  32. <view class="quit-main"><view class="quit-main-text" @tap="quit">退出登录</view></view>
  33. <view class="pop-mask" v-if="popupToggle">
  34. <view class="pop-box">
  35. <text class="text-title">《IM-免责声明》</text>
  36. <text class="pop-box-text">
  37. IM(“本产品”)是由腾讯云提供的一款测试产品,腾讯云享有本产品的著作权和所有权。本产品仅用于功能体验,不得用于任何商业用途。为配合相关部门监管要求,本产品音视频互动全程均有录音录像存档,严禁在使用中有任何色情、辱骂、暴恐、涉政等违法内容传播。
  38. </text>
  39. <view class="agree"><button class="pop-agree" @tap="Agree">我已知晓</button></view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import logger from '../../../utils/logger';
  46. const app = getApp();
  47. export default {
  48. data() {
  49. return {
  50. // 页面初始信息
  51. userListInfo: [
  52. {
  53. extra: 1,
  54. name: '隐私条例',
  55. path: 'https://web.sdk.qcloud.com/document/Tencent-IM-Privacy-Protection-Guidelines.html',
  56. nav: 'Privacy-Protection',
  57. iconUrl: '/static/static/assets/Privacyregulations.svg'
  58. },
  59. {
  60. extra: 1,
  61. name: '用户协议',
  62. path: 'https://web.sdk.qcloud.com/document/Tencent-IM-User-Agreement.html',
  63. nav: 'User-Agreement',
  64. iconUrl: '/static/static/assets/Useragreement.svg'
  65. },
  66. {
  67. extra: 3,
  68. name: '免责声明',
  69. iconUrl: '/static/static/assets/Disclaimers.svg'
  70. },
  71. {
  72. extra: 2,
  73. name: '关于',
  74. url: '../about/about',
  75. iconUrl: '/static/static/assets/about.svg'
  76. },
  77. {
  78. extra: 1,
  79. name: '联系我们',
  80. path: 'https://cloud.tencent.com/document/product/269/20043',
  81. iconUrl: '/static/static/assets/contact.svg'
  82. }
  83. ],
  84. config: {
  85. nick: '',
  86. userID: ''
  87. },
  88. hasname: true,
  89. popupToggle: false
  90. };
  91. },
  92. components: {},
  93. props: {},
  94. onShow() {
  95. uni.$TUIKit
  96. .getMyProfile()
  97. .then(imResponse => {
  98. this.setData({
  99. config: imResponse.data
  100. });
  101. app.globalData.userProfile = imResponse.data;
  102. if (imResponse.data.nick) {
  103. this.setData({
  104. hasname: false
  105. });
  106. }
  107. })
  108. .catch(imError => {
  109. console.warn('getMyProfile error:', imError); // 获取个人资料失败的相关信息
  110. });
  111. },
  112. methods: {
  113. onload() {},
  114. personal() {
  115. // TUIKit xxxx | mine | personal | xxxx
  116. uni.navigateTo({
  117. url: '../personal/personal'
  118. });
  119. },
  120. quit() {
  121. // TUIKit xxxx | mine | quit | xxxx
  122. logger.log('| TUI-User-Center | mine | quit-logout ');
  123. uni.$TUIKit.logout().then(() => {
  124. uni.clearStorage();
  125. uni.redirectTo({
  126. url: '../../TUI-Login/login',
  127. success: () => {
  128. uni.showToast({
  129. title: '退出成功',
  130. icon: 'none'
  131. });
  132. }
  133. });
  134. });
  135. },
  136. handleRouter(event) {
  137. const data = event.currentTarget.dataset.item;
  138. if (data.url) {
  139. uni.navigateTo({
  140. url: `${data.url}`
  141. });
  142. } else if (data.name === '免责声明') {
  143. this.setData({
  144. popupToggle: true
  145. });
  146. } else {
  147. uni.navigateTo({
  148. url: `../webview/webview?url=${data.path}&nav=${data.nav}`
  149. });
  150. }
  151. },
  152. Agree() {
  153. this.setData({
  154. popupToggle: false
  155. });
  156. }
  157. }
  158. };
  159. </script>
  160. <style>
  161. @import './mine.css';
  162. </style>