my - 旧版个人中心.vue 893 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view>
  3. <!-- 基本信息 -->
  4. <view class="top_bg"></view>
  5. <t-m-info></t-m-info>
  6. <!-- t-m-icon -->
  7. <t-m-icon :mine_code="mine_code"></t-m-icon>
  8. <t-m-list></t-m-list>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. // 当前煤矿编码
  16. mine_code: "",
  17. };
  18. },
  19. onLoad() {
  20. // 初始化当前煤矿编码
  21. this.mine_code = uni.getStorageSync('mine_code')
  22. // 判断会否登录、没有则跳转至登录页
  23. const Authorization = uni.getStorageSync('Authorization')
  24. if (Authorization == '') {
  25. uni.showToast({
  26. icon: "none",
  27. title: "用户未登录"
  28. })
  29. setTimeout(function() {
  30. uni.redirectTo({
  31. url: "../../login/login"
  32. })
  33. }, 1000)
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="scss">
  39. page{
  40. margin-bottom: 80rpx;
  41. }
  42. .top_bg {
  43. height: 60px;
  44. background: #009FE8;
  45. }
  46. </style>