diff --git a/index.html b/index.html
index bcfc4c3..d9f1606 100644
--- a/index.html
+++ b/index.html
@@ -4,6 +4,8 @@
建材销售管家
+
+
diff --git a/src/components/Icon.vue b/src/components/Icon.vue
new file mode 100644
index 0000000..5f60500
--- /dev/null
+++ b/src/components/Icon.vue
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
index ffcc69d..07942e4 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,8 +1,10 @@
import { createSSRApp } from 'vue'
import App from './App.vue'
+import Icon from './components/Icon.vue'
export function createApp() {
const app = createSSRApp(App)
+ app.component('Icon', Icon)
return {
app
}
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 314b69a..928482a 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -7,7 +7,7 @@
{{ userInfo.username || '用户' }}
- 👤
+
{{ roleText }}
@@ -15,25 +15,31 @@
- 📋
+
+
+
{{ stats.orderCount || 0 }}
今日订单
- 💰
+
+
+
¥{{ stats.actualAmount || 0 }}
今日销售额
- ⚠️
+
+
+
{{ stats.stockAlerts || 0 }}
库存预警
@@ -49,22 +55,30 @@
@@ -72,17 +86,23 @@
@@ -90,12 +110,16 @@
@@ -103,7 +127,9 @@
- 🔑
+
+
+
点击登录
登录后使用完整功能
@@ -114,7 +140,7 @@
- 💡 温馨提示
+ 温馨提示
• 您可以浏览商品
• 您可以查看半年内的订单
@@ -125,7 +151,7 @@
- 🎉 欢迎使用
+ 欢迎使用
• 请登录后使用完整功能
• 登录后可浏览商品和查看订单
@@ -135,7 +161,10 @@
-
+
@@ -188,7 +217,6 @@ export default {
},
methods: {
async loadUserInfo() {
- // 假登录时从本地存储获取
const localRole = uni.getStorageSync('role')
if (localRole) {
this.userInfo = {
@@ -197,7 +225,6 @@ export default {
}
return
}
-
try {
const userInfo = await authApi.getCurrentUser()
this.userInfo = userInfo
@@ -211,7 +238,6 @@ export default {
const stats = await orderApi.getStatistics({ startDate: today })
this.stats.orderCount = stats.orderCount || 0
this.stats.actualAmount = stats.actualAmount || 0
-
const alerts = await productApi.getStockAlerts()
this.stats.stockAlerts = alerts ? alerts.length : 0
} catch (e) {
@@ -243,14 +269,12 @@ export default {