set.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 {mapMutations} from "vuex"
  13. import myListItem from "@/components/modules/my/my-list-item.vue";
  14. export default {
  15. components:{
  16. myListItem
  17. },
  18. data() {
  19. return {
  20. list:[
  21. { icon:"",name:"账号与安全",clicktype:"navigateTo",url:"/pages/set/safe",auth:true },
  22. { icon:"",name:"清除缓存",clicktype:"clear",url:"" },
  23. { icon:"",name:"常见问题",clicktype:"navigateTo",url:"/pages/set/question",auth:true },
  24. // { icon:"",name:"意见反馈",clicktype:"navigateTo",url:"/pages/set/suggest",auth:true },
  25. { icon:"",name:"关于掌柜",clicktype:"navigateTo",url:"/pages/set/about",text:"",auth:false },
  26. ]
  27. }
  28. },
  29. onLoad(){
  30. // #ifdef APP-PLUS
  31. plus.runtime.getProperty(plus.runtime.appid, (widgetInfo)=>{
  32. this.list[4].text = widgetInfo.version;
  33. })
  34. // #endif
  35. },
  36. methods: {
  37. ...mapMutations(['emptyUserInfo']),
  38. logout(){
  39. this.emptyUserInfo();
  40. setTimeout(() => {
  41. uni.reLaunch({
  42. url:"/pages/login/login"
  43. })
  44. return true;
  45. }, 500);
  46. }
  47. }
  48. }
  49. </script>
  50. <style>
  51. </style>