From 2b3715f1610b4176d7abe33e34542389cef61853 Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei@zhuguifeideiMac.local>
Date: 星期六, 12 四月 2025 17:12:22 +0800
Subject: [PATCH] Merge branch 'main' of http://lanpucloud.cn:1111/r/eims-master

---
 eims-ui-mobile/src/components/fg-tabbar/fg-tabbar.vue |  110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 110 insertions(+), 0 deletions(-)

diff --git a/eims-ui-mobile/src/components/fg-tabbar/fg-tabbar.vue b/eims-ui-mobile/src/components/fg-tabbar/fg-tabbar.vue
new file mode 100644
index 0000000..e8d12de
--- /dev/null
+++ b/eims-ui-mobile/src/components/fg-tabbar/fg-tabbar.vue
@@ -0,0 +1,110 @@
+<template>
+  <wd-tabbar
+    fixed
+    v-model="tabbarStore.curIdx"
+    bordered
+    safeAreaInsetBottom
+    placeholder
+    @change="selectTabBar"
+    active-color="#007aff"
+    inactive-color="#7d7e80"
+  >
+    <block v-for="(item, idx) in tabbarList" :key="item.path">
+      <wd-tabbar-item
+        v-if="idx !== 2 && item.iconType === 'wot'"
+        :title="item.text"
+        :icon="item.icon"
+      ></wd-tabbar-item>
+      <!--TODO 鎵爜鍥炬爣鐗规畩澶勭悊-->
+      <wd-tabbar-item
+        v-if="idx === 2 && item.iconType === 'wot'"
+        :title="item.text"
+        :icon="item.icon"
+      >
+        <template #icon>
+          <view class="scan-box">
+            <wd-icon round name="scan" color="white" size="42rpx"></wd-icon>
+          </view>
+        </template>
+      </wd-tabbar-item>
+      <wd-tabbar-item
+        v-else-if="item.iconType === 'unocss' || item.iconType === 'iconfont'"
+        :title="item.text"
+      >
+        <template #icon>
+          <view
+            h-40rpx
+            w-40rpx
+            :class="[item.icon, idx === tabbarStore.curIdx ? 'is-active' : 'is-inactive']"
+          ></view>
+        </template>
+      </wd-tabbar-item>
+      <wd-tabbar-item v-else-if="item.iconType === 'local'" :title="item.text">
+        <template #icon>
+          <image :src="item.icon" h-40rpx w-40rpx />
+        </template>
+      </wd-tabbar-item>
+    </block>
+  </wd-tabbar>
+</template>
+
+<script setup lang="ts">
+// unocss icon 榛樿涓嶇敓鏁堬紝闇�瑕佸湪杩欓噷鍐欎竴閬嶆墠鑳界敓鏁堬紒娉ㄩ噴鎺変篃鏄敓鏁堢殑锛屼絾鏄繀椤昏鏈夛紒
+// i-carbon-code
+import { tabBar } from '@/pages.json'
+import { tabbarStore } from './tabbar'
+
+/** tabbarList 閲岄潰鐨� path 浠� pages.config.ts 寰楀埌 */
+const tabbarList = tabBar.list.map((item) => ({ ...item, path: `/${item.pagePath}` }))
+
+function selectTabBar({ value: index }: { value: number }) {
+  const url = tabbarList[index].path
+  // scan鐗规畩澶勭悊
+  if (index === 2) {
+    tabbarStore.setCurIdx(tabbarStore.lastIdx)
+    // 鍙厑璁搁�氳繃鐩告満鎵爜
+    uni.scanCode({
+      onlyFromCamera: true,
+      success: function (res) {
+        console.log('鏉$爜绫诲瀷锛�' + res.scanType)
+        console.log('鏉$爜鍐呭锛�' + res.result)
+      },
+    })
+  } else {
+    tabbarStore.setCurIdx(index)
+    tabbarStore.setLastIdx(index)
+    uni.switchTab({ url })
+  }
+}
+
+onLoad(() => {
+  // 瑙e喅鍘熺敓 tabBar 鏈殣钘忓鑷存湁2涓� tabBar 鐨勯棶棰�
+  // #ifdef APP-PLUS | H5
+  uni.hideTabBar({
+    fail(err) {
+      console.log('hideTabBar fail: ', err)
+    },
+    success(res) {
+      console.log('hideTabBar success: ', res)
+    },
+  })
+  // #endif
+})
+</script>
+
+<style lang="scss" scoped>
+.main-color {
+  color: $uni-color-primary;
+}
+.scan-box {
+  width: 100rpx;
+  height: 100rpx;
+  background-color: $uni-color-primary;
+  border-radius: 50%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  z-index: 9999;
+  margin-bottom: 30rpx;
+}
+</style>

--
Gitblit v1.9.3