index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <view>
  3. <view class="top-nav">
  4. <view class="l">
  5. <block v-if="isLogin">
  6. <image class="user-img" src="../../static/user.png"></image>
  7. <view class="l-r">
  8. <text class="u-name">{{userName}}</text>
  9. <text class="c-name">{{companyName}}</text>
  10. </view>
  11. </block>
  12. <block v-else>
  13. <view class="login-btn">请先登录</view>
  14. </block>
  15. </view>
  16. <view class="r" v-if="isLogin">
  17. <view class="l-out">
  18. 退出登录
  19. </view>
  20. </view>
  21. </view>
  22. <view class="top-bg"></view>
  23. <view class="top">
  24. <text class="title">集散区临时消杀场</text>
  25. </view>
  26. <view class="item-box">
  27. <view class="item" hover-class="hover-class" v-for="(indexItem,index) in indexItemList" :key="index"
  28. @click="navTo(indexItem)">
  29. <image class="icon" :src="indexItem.icon"></image>
  30. <view class="text">{{indexItem.text}}</view>
  31. </view>
  32. </view>
  33. <view class="qrcode">
  34. <image class="qrcode" :src="qrcoderlc"></image>
  35. <text class="text">长按二维码保存分享</text>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. data() {
  42. return {
  43. isLogin: false, //是否登录状态
  44. userName: '张三',
  45. companyName: '爱你一万年有限公司',
  46. qrcoderlc: 'https://shiyupeng.com/data/img/ewm.png',
  47. indexItemList: [{
  48. auth: false,
  49. icon: '../../static/home-icon-01.png',
  50. text: '企业注册',
  51. url: '/pages/enterprise-reg/enterprise-reg'
  52. },
  53. {
  54. auth: true,
  55. icon: '../../static/home-icon-02.png',
  56. text: '业务录入',
  57. url: '/pages/business-entering/business-entering'
  58. },
  59. {
  60. auth: true,
  61. icon: '../../static/home-icon-03.png',
  62. text: '业务订单',
  63. url: '/pages/business-order/business-order'
  64. },
  65. {
  66. auth: true,
  67. icon: '../../static/home-icon-04.png',
  68. text: '企业管理',
  69. url: '/pages/customer-management/customer-management'
  70. },
  71. {
  72. auth: true,
  73. icon: '../../static/home-icon-05.png',
  74. text: '出入记录',
  75. url: '/pages/inout-record/inout-record'
  76. }
  77. ]
  78. }
  79. },
  80. onLoad() {
  81. this.getStoreInfo();
  82. },
  83. methods: {
  84. getStoreInfo() {
  85. let token = uni.getStorageSync('info');
  86. },
  87. navTo(item) {
  88. let auth = item.auth;
  89. let token = uni.getStorageSync('token');
  90. if (!auth||token) {
  91. this.$common.to(item.url)
  92. } else {
  93. this.$common.to('/pages/login/login')
  94. }
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="scss">
  100. page {
  101. background-color: #fff;
  102. }
  103. .top-nav {
  104. position: fixed;
  105. top: 0;
  106. left: 0;
  107. right: 0;
  108. z-index: 999;
  109. display: flex;
  110. align-items: center;
  111. justify-content: space-between;
  112. padding: 20rpx 0;
  113. background-color: #0080ff;
  114. .l {
  115. display: flex;
  116. align-items: center;
  117. .login-btn {
  118. border: 1rpx solid #359aff;
  119. border-radius: 8rpx;
  120. color: #fff;
  121. padding: 10rpx 20rpx;
  122. font-size: 28rpx;
  123. margin-left: 30rpx;
  124. }
  125. .user-img {
  126. width: 80rpx;
  127. height: 80rpx;
  128. border-radius: 50%;
  129. margin-left: 30rpx;
  130. margin: 20rpx;
  131. }
  132. .l-r {
  133. display: flex;
  134. flex-direction: column;
  135. .u-name {
  136. font-size: 30rpx;
  137. color: #fff;
  138. font-weight: bold;
  139. }
  140. .c-name {
  141. font-size: 24rpx;
  142. color: #fff;
  143. }
  144. }
  145. }
  146. .r {
  147. display: flex;
  148. align-items: center;
  149. .l-out {
  150. border: 1rpx solid #359aff;
  151. border-radius: 8rpx;
  152. color: #c8e4ff;
  153. padding: 10rpx 20rpx;
  154. font-size: 28rpx;
  155. margin-right: 30rpx;
  156. }
  157. }
  158. }
  159. .top-bg {
  160. position: relative;
  161. top: 0;
  162. left: 0;
  163. right: 0;
  164. height: 500rpx;
  165. background-color: #0080ff;
  166. border-radius: 0 0 20rpx 20rpx;
  167. }
  168. .top {
  169. display: flex;
  170. width: 100%;
  171. align-items: center;
  172. justify-content: center;
  173. margin: 60rpx 0;
  174. margin-top: -300rpx;
  175. position: relative;
  176. z-index: 2;
  177. .title {
  178. font-size: 50rpx;
  179. font-weight: bold;
  180. color: #fff;
  181. }
  182. }
  183. .item-box {
  184. display: flex;
  185. flex-wrap: wrap;
  186. align-content: flex-start;
  187. padding: 40rpx;
  188. box-sizing: border-box;
  189. background-color: #fff;
  190. margin: 0 30rpx;
  191. border-radius: 20rpx;
  192. position: relative;
  193. z-index: 2;
  194. //height: calc(100vh - 170rpx - 500rpx);
  195. box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.03);
  196. .item {
  197. width: 33.333%;
  198. display: flex;
  199. flex-direction: column;
  200. align-items: center;
  201. justify-content: center;
  202. padding: 40rpx 0;
  203. .icon {
  204. width: 90rpx;
  205. height: 90rpx;
  206. }
  207. .text {
  208. font-size: 28rpx;
  209. color: #191919;
  210. margin-top: 20rpx;
  211. }
  212. }
  213. }
  214. .qrcode {
  215. display: flex;
  216. width: 100%;
  217. flex-direction: column;
  218. align-items: center;
  219. justify-content: center;
  220. margin: 50rpx 0;
  221. .qrcode {
  222. width: 350rpx;
  223. height: 350rpx;
  224. border: 1px solid #191919;
  225. }
  226. .text {
  227. color: #191919;
  228. font-size: 28rpx;
  229. margin-top: 5rpx;
  230. }
  231. }
  232. </style>