index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view>
  3. <uni-nav-bar title="门店" backgroundColor='#03803B' color="#fff" fixed statusBar
  4. @clickRight="inSetting">
  5. <block slot="right">
  6. <view>
  7. <image class="nav-right" src="@/static/images/home/setting.png" />
  8. </view>
  9. </block>
  10. </uni-nav-bar>
  11. <view class="home-card">
  12. <view class="home-card-title">
  13. 保险
  14. </view>
  15. <uni-grid :column="4" :showBorder="false">
  16. <uni-grid-item>
  17. <view class="grid-item-box" @click="allClick('轮胎保注册')">
  18. <view class="grid-item-box-img">
  19. <image style="width: 45rpx;height: 45rpx;" src="@/static/images/home/home (15).png" />
  20. </view>
  21. <view class="grid-item-box-text">
  22. 轮胎保
  23. </view>
  24. </view>
  25. </uni-grid-item>
  26. </uni-grid>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import {
  32. getAddress
  33. } from '@/api/home/index.js'
  34. export default {
  35. data() {
  36. return {
  37. }
  38. },
  39. onLoad() {
  40. if (uni.getStorageSync('accessToken')) {
  41. this.getAddressdata()
  42. }
  43. },
  44. methods: {
  45. inSetting() {
  46. uni.navigateTo({
  47. url: '/pages/home/setting'
  48. });
  49. },
  50. getAddressdata() {
  51. if (!uni.getStorageSync("addressData")) {
  52. getAddress().then(res => {
  53. uni.setStorageSync('addressData', JSON.stringify(res.data));
  54. })
  55. }
  56. },
  57. allClick(name) {
  58. if (name == '轮胎保注册') {
  59. uni.navigateTo({
  60. url: '/pages/home/insurance/index'
  61. });
  62. }
  63. if (name == '轮胎保理赔') {
  64. uni.navigateTo({
  65. url: '/pages/home/claim/index'
  66. });
  67. }
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .nav-right {
  74. width: 32rpx;
  75. height: 30rpx;
  76. }
  77. .home-card {
  78. margin-top: 30rpx;
  79. background: #FFFFFF;
  80. padding: 40rpx 40rpx 10rpx 40rpx;
  81. .home-card-title {
  82. font-weight: 500;
  83. font-size: 34rpx;
  84. color: #0F0D0D;
  85. margin-left: 20rpx;
  86. margin-bottom: 10rpx;
  87. }
  88. .grid-item-box {
  89. display: flex;
  90. flex-direction: column;
  91. align-items: center;
  92. .uni-grid-item__box{
  93. justify-content: center;
  94. }
  95. .grid-item-box-img {
  96. display: flex;
  97. justify-content: center;
  98. align-items: center;
  99. width: 100rpx;
  100. height: 100rpx;
  101. }
  102. .grid-item-box-text {
  103. width: 100rpx;
  104. text-align: center;
  105. font-weight: 500;
  106. font-size: 26rpx;
  107. color: #6A6A6A;
  108. }
  109. }
  110. }
  111. </style>