index.uvue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <uni-navbar-lite :showLeft=false :show-right=false title="工作台"></uni-navbar-lite>
  3. <view class="page-container">
  4. <!-- view>
  5. <text class="page-header"> 工作台 </text>
  6. </view> -->
  7. <!-- 头部背景图 -->
  8. <!-- <image class="header-bg" src="/static/images/workbench/1.png" mode="widthFix"></image> -->
  9. <scroll-view class="page-content">
  10. <!-- 库区管理 -->
  11. <view class="section">
  12. <view class="section-header">
  13. <view class="section-indicator"></view>
  14. <text class="section-title">库区管理</text>
  15. </view>
  16. <view class="management-grid">
  17. <view v-for="(item, index) in managementList" :key="index" class="management-item" @click="handleManagementClick(item)" :style="{ backgroundColor: item.bgColor }">
  18. <view class="management-icon-box">
  19. <image class="management-icon" :src="item.icon" mode="aspectFit"></image>
  20. </view>
  21. <text class="management-title">{{ item.title }}</text>
  22. <view v-if="item.badge" class="management-badge">
  23. <text class="badge-text">{{ item.badge }}</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </scroll-view>
  29. <!-- 底部 TabBar -->
  30. <custom-tabbar :current="1" />
  31. </view>
  32. </template>
  33. <script setup lang="uts">
  34. import { ref } from 'vue'
  35. // 库区管理功能类型
  36. type ManagementItem = {
  37. id: number
  38. title: string
  39. icon: string
  40. bgColor: string
  41. path: string
  42. badge: string
  43. }
  44. // 库区管理功能列表
  45. const managementList = ref<ManagementItem[]>([
  46. {
  47. id: 1,
  48. title: '物料申请',
  49. icon: '/static/images/workbench/8.png',
  50. bgColor: '#E3F2FD',
  51. path: '/pages/apply/index',
  52. badge: ''
  53. },
  54. {
  55. id: 2,
  56. title: '库存盘点',
  57. icon: '/static/images/workbench/9.png',
  58. bgColor: '#FFF3E0',
  59. path: '',
  60. badge: ''
  61. },
  62. {
  63. id: 3,
  64. title: '库存管理',
  65. icon: '/static/images/workbench/10.png',
  66. bgColor: '#FCE4EC',
  67. path: '',
  68. badge: ''
  69. },
  70. ])
  71. // 库区管理功能点击
  72. const handleManagementClick = (item: ManagementItem): void => {
  73. if (item.path.length > 0) {
  74. uni.navigateTo({
  75. url: item.path,
  76. fail: (err: any) => {
  77. console.log('导航失败', err)
  78. }
  79. })
  80. } else {
  81. uni.showToast({
  82. title: item.title,
  83. icon: 'none'
  84. })
  85. }
  86. }
  87. </script>
  88. <style lang="scss">
  89. .page-container {
  90. flex: 1;
  91. background-color: #f5f8fe;
  92. padding-top: env(safe-area-inset-top);
  93. background-color: #e8f0f9;
  94. padding: 20rpx;
  95. }
  96. .page-header{
  97. font-size: 32rpx;
  98. color: #333333;
  99. font-weight: bold;
  100. padding-top:20px;
  101. padding-bottom: 10px;
  102. }
  103. .page-content {
  104. flex: 1;
  105. padding: 10rpx;
  106. padding-bottom: 150rpx;
  107. box-sizing: border-box;
  108. // border-radius: 24rpx;
  109. // border: 1rpx solid rgba(255, 255, 255, 0.3);
  110. // background: #f5f8fe;
  111. // background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, #f5f8fe 100%);
  112. // backdrop-filter: blur(20rpx);
  113. }
  114. .header-bg {
  115. position: absolute;
  116. top: 0;
  117. left: 0;
  118. width: 100%;
  119. height: auto;
  120. z-index: 0;
  121. }
  122. .quick-cards {
  123. flex-direction: row;
  124. flex-wrap: wrap;
  125. justify-content: space-between;
  126. .quick-card {
  127. position: relative;
  128. width: 212rpx;
  129. height: 120rpx;
  130. margin-bottom: 20rpx;
  131. overflow: hidden;
  132. border-radius: 16rpx;
  133. &-bg {
  134. position: absolute;
  135. top: 0;
  136. left: 0;
  137. width: 226rpx;
  138. height: 140rpx;
  139. z-index: 0;
  140. }
  141. &-content {
  142. position: relative;
  143. z-index: 1;
  144. padding: 20rpx;
  145. height: 140rpx;
  146. justify-content: flex-start;
  147. }
  148. &-title {
  149. font-size: 28rpx;
  150. color: #333333;
  151. font-weight: bold;
  152. }
  153. .management-badge {
  154. position: absolute;
  155. top: 20rpx;
  156. right: 20rpx;
  157. width: 32rpx;
  158. height: 32rpx;
  159. background-color: #ff3b30;
  160. border-radius: 16rpx;
  161. justify-content: center;
  162. align-items: center;
  163. .badge-text {
  164. font-size: 20rpx;
  165. color: #ffffff;
  166. line-height: 20rpx;
  167. }
  168. }
  169. }
  170. }
  171. .section {
  172. padding: 0 20rpx 30rpx;
  173. background: #ffffff;
  174. border-radius: 16rpx;
  175. &-header {
  176. flex-direction: row;
  177. align-items: center;
  178. padding: 30rpx 10rpx 20rpx;
  179. }
  180. &-indicator {
  181. width: 6rpx;
  182. height: 32rpx;
  183. background-color: #007aff;
  184. border-radius: 3rpx;
  185. margin-right: 12rpx;
  186. }
  187. &-title {
  188. font-size: 36rpx;
  189. color: #333333;
  190. font-weight: bold;
  191. }
  192. }
  193. .management-grid {
  194. flex-direction: row;
  195. flex-wrap: wrap;
  196. justify-content: space-between;
  197. .management-item {
  198. position: relative;
  199. width: 192rpx;
  200. height: 156rpx;
  201. margin-bottom: 24rpx;
  202. background-color: #edf5ff;
  203. border-radius: 8rpx;
  204. align-items: flex-start;
  205. justify-content: center;
  206. padding: 24rpx;
  207. box-sizing: border-box;
  208. .management-icon-box {
  209. width: 64rpx;
  210. height: 64rpx;
  211. justify-content: center;
  212. align-items: center;
  213. margin-bottom: 16rpx;
  214. }
  215. .management-icon {
  216. width: 100%;
  217. height: 100%;
  218. }
  219. .management-title {
  220. font-weight: bold;
  221. font-size: 24rpx;
  222. color: #333333;
  223. text-align: center;
  224. }
  225. .management-badge {
  226. position: absolute;
  227. top: 20rpx;
  228. right: 20rpx;
  229. width: 32rpx;
  230. height: 32rpx;
  231. background-color: #ff3b30;
  232. border-radius: 16rpx;
  233. justify-content: center;
  234. align-items: center;
  235. .badge-text {
  236. font-size: 20rpx;
  237. color: #ffffff;
  238. line-height: 20rpx;
  239. }
  240. }
  241. }
  242. }
  243. </style>