system.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view>
  3. <view class="cu-list menu margin-bottom">
  4. <view class="cu-item arrow" @click="goPage('/pages/tool/sinpage?field=aboutus')">
  5. <view class="content">
  6. <text>关于我们</text>
  7. </view>
  8. </view>
  9. <view class="cu-item arrow" @click="goPage('/pages/tool/sinpage?field=privacy')">
  10. <view class="content">
  11. <text>隐私政策</text>
  12. </view>
  13. </view>
  14. <view class="cu-item arrow" @click="goPage('/pages/tool/sinpage?field=service')">
  15. <view class="content">
  16. <text>用户协议</text>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="padding flex flex-direction" v-if="userinfo!=null">
  21. <button class="cu-btn bg-white lg" @click="loginOut">退出登录</button>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. var _this;
  27. export default {
  28. data() {
  29. return {
  30. userinfo: null
  31. };
  32. },
  33. onLoad: function() {
  34. _this = this;
  35. _this.userinfo = uni.getStorageSync('userinfo') || null;
  36. },
  37. methods: {
  38. goPage: function(pageurl) {
  39. uni.navigateTo({
  40. url: pageurl
  41. });
  42. },
  43. loginOut() {
  44. uni.clearStorageSync();
  45. uni.showModal({
  46. title: '温馨提示',
  47. content: '退出成功。',
  48. showCancel: false,
  49. success: function(res) {
  50. if (res.confirm) {
  51. uni.reLaunch({
  52. url: "/pages/index/home"
  53. });
  54. }
  55. }
  56. });
  57. }
  58. }
  59. }
  60. </script>
  61. <style>
  62. </style>