set.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="body">
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <block v-for="(item,index) in list" :key="index">
  6. <my-list-item :item="item" :index="index"></my-list-item>
  7. </block>
  8. <button class="my-3 mt-4 mx-3 d-flex a-center j-center main-bg-color" type="primary" @tap="logout">退出登录</button>
  9. </view>
  10. </template>
  11. <script>
  12. import {
  13. mapMutations
  14. } from "vuex"
  15. import myListItem from "@/components/modules/my/my-list-item.vue";
  16. export default {
  17. components: {
  18. myListItem
  19. },
  20. data() {
  21. return {
  22. list: [{
  23. icon: "",
  24. name: "账号管理",
  25. clicktype: "navigateTo",
  26. url: "/pages/set/safe",
  27. auth: true
  28. },
  29. {
  30. icon: "",
  31. name: "清除缓存",
  32. clicktype: "clear",
  33. url: ""
  34. },
  35. {
  36. icon: "",
  37. name: "常见问题",
  38. clicktype: "navigateTo",
  39. url: "/pages/set/question",
  40. auth: true
  41. },
  42. // { icon:"",name:"意见反馈",clicktype:"navigateTo",url:"/pages/set/suggest",auth:true },
  43. {
  44. icon: "",
  45. name: "关于掌柜",
  46. clicktype: "navigateTo",
  47. url: "/pages/set/about",
  48. text: "",
  49. auth: false
  50. },
  51. ]
  52. }
  53. },
  54. onLoad() {
  55. // #ifdef APP-PLUS
  56. plus.runtime.getProperty(plus.runtime.appid, (widgetInfo) => {
  57. this.list[4].text = widgetInfo.version;
  58. })
  59. // #endif
  60. },
  61. methods: {
  62. ...mapMutations(['emptyUserInfo']),
  63. logout() {
  64. this.emptyUserInfo();
  65. setTimeout(() => {
  66. uni.reLaunch({
  67. url: "/pages/login/login"
  68. })
  69. return true;
  70. }, 500);
  71. }
  72. }
  73. }
  74. </script>
  75. <style>
  76. </style>