index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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. },
  82. methods: {
  83. navTo(item) {
  84. let auth = item.auth;
  85. let token = uni.getStorageSync('token');
  86. this.$common.to(item.url)
  87. // if (!auth||token) {
  88. // this.$common.to(item.url)
  89. // } else {
  90. // this.$common.to('/pages/login/login')
  91. // }
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="scss">
  97. page {
  98. background-color: #fff;
  99. }
  100. .top-nav{
  101. position: fixed;
  102. top: 0;
  103. left: 0;
  104. right: 0;
  105. z-index: 999;
  106. display: flex;
  107. align-items: center;
  108. justify-content: space-between;
  109. padding: 20rpx 0;
  110. background-color: #0080ff;
  111. .l{
  112. display: flex;
  113. align-items: center;
  114. .login-btn{
  115. border: 1rpx solid #359aff;
  116. border-radius: 8rpx;
  117. color: #fff;
  118. padding: 10rpx 20rpx;
  119. font-size: 28rpx;
  120. margin-left: 30rpx;
  121. }
  122. .user-img{
  123. width: 80rpx;
  124. height: 80rpx;
  125. border-radius: 50%;
  126. margin-left: 30rpx;
  127. margin: 20rpx;
  128. }
  129. .l-r{
  130. display: flex;
  131. flex-direction: column;
  132. .u-name{
  133. font-size: 30rpx;
  134. color: #fff;
  135. font-weight: bold;
  136. }
  137. .c-name{
  138. font-size: 24rpx;
  139. color: #fff;
  140. }
  141. }
  142. }
  143. .r{
  144. display: flex;
  145. align-items: center;
  146. .l-out{
  147. border: 1rpx solid #359aff;
  148. border-radius: 8rpx;
  149. color: #c8e4ff;
  150. padding: 10rpx 20rpx;
  151. font-size: 28rpx;
  152. margin-right: 30rpx;
  153. }
  154. }
  155. }
  156. .top-bg {
  157. position: relative;
  158. top: 0;
  159. left: 0;
  160. right: 0;
  161. height: 500rpx;
  162. background-color: #0080ff;
  163. border-radius: 0 0 20rpx 20rpx;
  164. }
  165. .top {
  166. display: flex;
  167. width: 100%;
  168. align-items: center;
  169. justify-content: center;
  170. margin: 60rpx 0;
  171. margin-top: -300rpx;
  172. position: relative;
  173. z-index: 2;
  174. .title {
  175. font-size: 50rpx;
  176. font-weight: bold;
  177. color: #fff;
  178. }
  179. }
  180. .item-box {
  181. display: flex;
  182. flex-wrap: wrap;
  183. align-content: flex-start;
  184. padding: 40rpx;
  185. box-sizing: border-box;
  186. background-color: #fff;
  187. margin: 0 30rpx;
  188. border-radius: 20rpx;
  189. position: relative;
  190. z-index: 2;
  191. //height: calc(100vh - 170rpx - 500rpx);
  192. box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.03);
  193. .item {
  194. width: 33.333%;
  195. display: flex;
  196. flex-direction: column;
  197. align-items: center;
  198. justify-content: center;
  199. padding: 40rpx 0;
  200. .icon {
  201. width: 90rpx;
  202. height: 90rpx;
  203. }
  204. .text {
  205. font-size: 28rpx;
  206. color: #191919;
  207. margin-top: 20rpx;
  208. }
  209. }
  210. }
  211. .qrcode {
  212. display: flex;
  213. width: 100%;
  214. flex-direction: column;
  215. align-items: center;
  216. justify-content: center;
  217. margin: 50rpx 0;
  218. .qrcode {
  219. width: 350rpx;
  220. height: 350rpx;
  221. border: 1px solid #191919;
  222. }
  223. .text {
  224. color: #191919;
  225. font-size: 28rpx;
  226. margin-top: 5rpx;
  227. }
  228. }
  229. </style>