index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="container">
  3. <view class="item-content">
  4. <view class="item-box" @click="handlerSkipAccountSafety">
  5. <view class="item-l"> 账号与安全 </view>
  6. <view class="item-r">
  7. <u-icon name="arrow-right" color="#C0C0C0" size="16"></u-icon>
  8. </view>
  9. </view>
  10. </view>
  11. <view class="item-content">
  12. <!-- <view class="item-box">
  13. <view class="item-l"> 新消息通知 </view>
  14. <view class="item-r">
  15. <u-switch v-model="value" activeColor="#5992BB"></u-switch>
  16. </view>
  17. </view> -->
  18. <view class="item-box">
  19. <view class="item-l"> 隐私政策 </view>
  20. <view class="item-r">
  21. <u-icon name="arrow-right" color="#C0C0C0" :size="icon_size"></u-icon>
  22. </view>
  23. </view>
  24. <!-- <view class="item-box">
  25. <view class="item-l"> 选择语言 </view>
  26. <view class="item-r">
  27. <p>简体中文</p><u-icon name="arrow-right" color="#C0C0C0" :size="icon_size"></u-icon>
  28. </view>
  29. </view> -->
  30. </view>
  31. <view class="item-content">
  32. <view
  33. class="item-box"
  34. v-for="(item, index) of privacy_list"
  35. :key="item.id"
  36. @click="handlerSkipPrivacy(item)"
  37. >
  38. <view class="item-l"> {{ item.name }} </view>
  39. <view class="item-r">
  40. <u-icon name="arrow-right" color="#C0C0C0" :size="icon_size"></u-icon>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="btn-box">
  45. <!-- <button class="btn1" @click="showSwitchDialog = true">切换身份</button>
  46. <button class="btn2" @click="loginout_show = true">退出登录</button> -->
  47. <u-button class="btn1" @click="showSwitchDialog = true" text="切换身份"></u-button>
  48. <u-button
  49. class="btn2"
  50. @click="loginout_show = true"
  51. type="primary"
  52. text="退出登录"
  53. ></u-button>
  54. </view>
  55. <u-modal
  56. :show="showSwitchDialog"
  57. :showCancelButton="true"
  58. :title="title"
  59. :content="content"
  60. @confirm="confirmSwitch"
  61. @cancel="showSwitchDialog = false"
  62. ></u-modal>
  63. <u-modal
  64. :show="loginout_show"
  65. :content="content1"
  66. :title="title"
  67. :showCancelButton="true"
  68. @confirm="handlerLoginOutConfirm"
  69. @cancel="loginout_show = false"
  70. ></u-modal>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. value: true,
  78. icon_size: 18,
  79. loginout_show: false,
  80. content: '您确定要从商家端切换到用户端吗',
  81. content1: '您确定要退出登录?确定将同时退出用户端哦',
  82. title: '温馨提示',
  83. privacy_list: [
  84. {
  85. name: '应用权限说明',
  86. id: 0,
  87. },
  88. {
  89. name: '个人信息收集清单',
  90. id: 1,
  91. },
  92. {
  93. name: '第三方共享个人信息清单',
  94. id: 2,
  95. },
  96. {
  97. name: '关于我们',
  98. id: 3,
  99. },
  100. ],
  101. showSwitchDialog: false,
  102. };
  103. },
  104. methods: {
  105. // 点击切换账号
  106. // handlerSwitchAccount(){
  107. // },
  108. confirmSwitch() {
  109. // 点击确认切换身份
  110. // 处理身份切换逻辑
  111. this.$store.dispatch('SwitchIdentity','CUSTOMER')
  112. uni.switchTab({
  113. url: '/pages/client/tabBar/mine/index',
  114. });
  115. // ... 其他操作
  116. },
  117. // 跳转到账号与安全
  118. handlerSkipAccountSafety() {
  119. uni.navigateTo({
  120. url: `/pages/tabBar/mine/setting/accountSafety`,
  121. });
  122. },
  123. // 点击跳转到隐私页面
  124. handlerSkipPrivacy(item) {
  125. uni.navigateTo({
  126. url: `/pages/tabBar/mine/setting/privacyPolicy?type=${item.id}`,
  127. });
  128. },
  129. //点击退出登录
  130. handlerLoginOutConfirm() {
  131. this.loginout_show = false;
  132. this.$store.dispatch('Logout').then(()=>{
  133. uni.navigateTo({
  134. url: `pages/login/index`,
  135. });
  136. })
  137. },
  138. },
  139. };
  140. </script>
  141. <style lang="scss" scoped>
  142. .container {
  143. background-color: #f5f5f5;
  144. min-height: calc(100vh - 40rpx);
  145. padding-top: 40rpx;
  146. .item-content {
  147. margin-bottom: 40rpx;
  148. .item-box {
  149. display: flex;
  150. justify-content: space-between;
  151. background-color: #fff;
  152. padding: 20rpx 40rpx;
  153. font-size: 30rpx;
  154. .item-r {
  155. display: flex;
  156. font-size: 26rpx;
  157. color: #b0b0b0;
  158. }
  159. }
  160. }
  161. }
  162. .btn-box {
  163. width: 70%;
  164. margin: 100rpx auto 0;
  165. .btn1,
  166. .btn2 {
  167. padding: 20rpx;
  168. height: 80rpx;
  169. font-size: 28rpx;
  170. line-height: 40rpx;
  171. border-radius: 35rpx;
  172. }
  173. .btn1 {
  174. // background-color: #5992bb;
  175. // color: #000;
  176. }
  177. .btn2 {
  178. margin-top: 50rpx;
  179. // background-color: #e2e2e2;
  180. }
  181. }
  182. ::v-deep .u-modal__content__text.data-v-713d0fd3 {
  183. text-align: center;
  184. }
  185. </style>