mine_setting.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class="dt-page">
  3. <DtMenuList :menuStyle="menuStyle" :itemData="moduleList" @tapitem="onTapItem" />
  4. <template v-if="$isNotEmpty(vuex_member)">
  5. <button @tap="exitAction" class="btn-submit" hover-class="button-hover-scale">退出系统</button>
  6. </template>
  7. <clearUser ref="clearUser"></clearUser>
  8. </view>
  9. </template>
  10. <script>
  11. import DtMenuList from '../comps/dt_menu_list.vue'
  12. import clearUser from "@/comps/clear-user.vue"
  13. export default {
  14. components: {
  15. DtMenuList,
  16. clearUser
  17. },
  18. data() {
  19. return {
  20. menuStyle: {
  21. spaceColor: '#f2f2f2',
  22. spaceHeight: 20
  23. },
  24. moduleList: [],
  25. isLogin: true
  26. }
  27. },
  28. methods: {
  29. onTapItem(item) {
  30. switch (item.id) {
  31. case 0:
  32. let url = 'https://community.58fo.com/appfile/protocal.htm'
  33. uni.navigateTo({
  34. url: "/pages/webview/webview?url=" + url + "&title=隐私协议"
  35. })
  36. break;
  37. case 1:
  38. break;
  39. default:
  40. break;
  41. }
  42. },
  43. //退出登录
  44. logout() {
  45. this.$auth.logout()
  46. this.touristLogin()
  47. uni.switchTab({
  48. url: "/pages/wode/wode"
  49. })
  50. },
  51. //退出操作
  52. //退出操作
  53. exitAction() {
  54. this.$refs.clearUser.showModal()
  55. },
  56. /**
  57. * 游客登陆
  58. */
  59. async touristLogin() {
  60. // 检查是否登录
  61. if (!this.$auth.isAuth) { // 就算是游客,也重新登录
  62. let resp = await this.$api.touristLogin()
  63. console.log("Resp", resp);
  64. let userType = this.$global.userType.tourist
  65. this.$auth.login(userType, resp.sessionId, resp.userId, resp)
  66. console.log('游客登录成功!', resp)
  67. }
  68. },
  69. onLoadPage() {
  70. wx.hideShareMenu();
  71. // this.memberInfo = this.$auth.getMemberInfo()
  72. this.isLogin = this.$auth.isAuth
  73. this.moduleList = [{
  74. id: 0,
  75. title: '隐私协议',
  76. value: '',
  77. hideArrow: false,
  78. isMarginTop: true
  79. },
  80. {
  81. id: 1,
  82. title: '技术支持',
  83. value: '宁夏新邻科技有限公司',
  84. hideArrow: true,
  85. isMarginTop: true
  86. }
  87. ]
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .dt-page {
  94. background-color: #f2f2f2;
  95. min-height: 100vh;
  96. .btn-submit {
  97. margin: 60upx auto;
  98. width: 690upx;
  99. height: 90upx;
  100. line-height: 90upx;
  101. border-radius: 10upx;
  102. background-color: #e54d42;
  103. }
  104. }
  105. </style>