diff --git a/.env b/.env index d39fb44..8b13789 100644 --- a/.env +++ b/.env @@ -1,5 +1 @@ - -VITE_COMMON_API_PREFIX = /api-base - -VITE_COMMON_API_URL = http://store-manage.hmily.club diff --git a/.env.development b/.env.development index e69de29..b3b870e 100644 --- a/.env.development +++ b/.env.development @@ -0,0 +1,4 @@ + +VITE_COMMON_API_PREFIX = /api-base + +VITE_COMMON_API_URL = http://store-manage.hmily.club diff --git a/.env.production b/.env.production index a46d291..a6f9b23 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,3 @@ VITE_COMMON_API_PREFIX = /api -VITE_COMMON_API_URL = http://store-manage.hmily.club \ No newline at end of file +VITE_COMMON_API_URL = http://store-manage.hmily.club/api \ No newline at end of file diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..582561b --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,16 @@ +{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 + "version": "0.0", + "configurations": [{ + "app-plus" : + { + "launchtype" : "local" + }, + "default" : + { + "launchtype" : "local" + }, + "type" : "uniCloud" + } + ] +} diff --git a/package-lock.json b/package-lock.json index c270be6..b67fb54 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,8 @@ "@dcloudio/uni-mp-xhs": "3.0.0-3090920231225001", "@dcloudio/uni-quickapp-webview": "3.0.0-3090920231225001", "@qiun/ucharts": "^2.5.0-20230101", + "esbuild-darwin-arm64": "^0.15.18", + "luch-request": "^3.1.1", "pinia": "2.0.33", "pinia-plugin-persistedstate": "^3.2.1", "vue": "^3.2.45", @@ -6280,6 +6282,20 @@ "@esbuild/win32-x64": "0.16.17" } }, + "node_modules/esbuild-darwin-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.18.tgz", + "integrity": "sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==", + "cpu": [ + "arm64" + ], + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmmirror.com/escalade/-/escalade-3.1.2.tgz", @@ -9412,6 +9428,19 @@ "yallist": "^3.0.2" } }, + "node_modules/luch-request": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/luch-request/-/luch-request-3.1.1.tgz", + "integrity": "sha512-p7+mlcEtgRcd0OfXC4XZbyiwSr1XgCeqNT7LlVUjnk7InYl/8d5Rk7BUqAYNA2WRafI1wRIUQWRWZRpeUwWR0w==", + "dependencies": { + "@dcloudio/types": "^2.0.16" + } + }, + "node_modules/luch-request/node_modules/@dcloudio/types": { + "version": "2.6.12", + "resolved": "https://registry.npmmirror.com/@dcloudio/types/-/types-2.6.12.tgz", + "integrity": "sha512-mrCMwcINy1IFjU9VUqLeWBkj404yWs5paLDttBcA+eqUjanuUQbBcTVPqlrGgkyzLXDcV2oDDZRSNxNpXi4kMQ==" + }, "node_modules/magic-string": { "version": "0.30.8", "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.8.tgz", @@ -17044,6 +17073,11 @@ "@esbuild/win32-x64": "0.16.17" } }, + "esbuild-darwin-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmmirror.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.18.tgz", + "integrity": "sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==" + }, "escalade": { "version": "3.1.2", "resolved": "https://registry.npmmirror.com/escalade/-/escalade-3.1.2.tgz", @@ -19445,6 +19479,21 @@ "yallist": "^3.0.2" } }, + "luch-request": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/luch-request/-/luch-request-3.1.1.tgz", + "integrity": "sha512-p7+mlcEtgRcd0OfXC4XZbyiwSr1XgCeqNT7LlVUjnk7InYl/8d5Rk7BUqAYNA2WRafI1wRIUQWRWZRpeUwWR0w==", + "requires": { + "@dcloudio/types": "^2.0.16" + }, + "dependencies": { + "@dcloudio/types": { + "version": "2.6.12", + "resolved": "https://registry.npmmirror.com/@dcloudio/types/-/types-2.6.12.tgz", + "integrity": "sha512-mrCMwcINy1IFjU9VUqLeWBkj404yWs5paLDttBcA+eqUjanuUQbBcTVPqlrGgkyzLXDcV2oDDZRSNxNpXi4kMQ==" + } + } + }, "magic-string": { "version": "0.30.8", "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.8.tgz", diff --git a/package.json b/package.json index 0f869a3..65c38b0 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "@dcloudio/uni-mp-xhs": "3.0.0-3090920231225001", "@dcloudio/uni-quickapp-webview": "3.0.0-3090920231225001", "@qiun/ucharts": "^2.5.0-20230101", + "esbuild-darwin-arm64": "^0.15.18", "luch-request": "^3.1.1", "pinia": "2.0.33", "pinia-plugin-persistedstate": "^3.2.1", diff --git a/src/App.vue b/src/App.vue index f0312f7..9334c3f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,17 @@ diff --git a/src/pages/audits/data.data.js b/src/pages/audits/data.data.js new file mode 100644 index 0000000..e43cc46 --- /dev/null +++ b/src/pages/audits/data.data.js @@ -0,0 +1,32 @@ +import { timeFormat } from '@climblee/uv-ui/libs/function' +export default { + //清洁任务 + task_hygienes: [ + { + title: '申请人', + dataIndex: 'name', + }, + { + title: '所属门店', + dataIndex: 'taskable.store.address', + }, + { + title: '电话号码', + dataIndex: '', + }, + { + title: '申请时间', + dataIndex: 'created_at', + format: timeFormat, + }, + { + title: '清洁范围', + dataIndex: 'taskable.description', + labelPosition: 'top', + }, + { + title: '清洁结果', + dataIndex: 'taskable.photos', + }, + ] +} \ No newline at end of file diff --git a/src/pages/audits/detail.vue b/src/pages/audits/detail.vue new file mode 100644 index 0000000..4b1f59e --- /dev/null +++ b/src/pages/audits/detail.vue @@ -0,0 +1,35 @@ + + diff --git a/src/pages/home/components/chart.vue b/src/pages/home/components/chart.vue index 982d10a..67bc7c0 100644 --- a/src/pages/home/components/chart.vue +++ b/src/pages/home/components/chart.vue @@ -4,19 +4,27 @@ diff --git a/src/pages/home/index.vue b/src/pages/home/index.vue index 6373995..5480d6d 100644 --- a/src/pages/home/index.vue +++ b/src/pages/home/index.vue @@ -9,18 +9,18 @@ 昨日累计金额 - 截止2024-03-21 + 截止{{ yesterday }} 销售 - 20000 + {{ yesday_ledger.sales }} 支出 - 20000 + {{ yesday_ledger.expenditure }} @@ -32,10 +32,12 @@ :activeStyle="{ color: '#ee2c37' }" lineColor="#ee2c37" :list="list" + :current="tabIndex" @click="onTabClick" :scrollable="false" > - + + @@ -43,17 +45,63 @@ import { ref, reactive, computed } from 'vue' import ChartComp from './components/chart.vue' import StoreDropDown from '@/pages/home/components/store-drop-down/index.vue' - +import { http } from '@/utils/request' +import { onShow } from '@dcloudio/uni-app' +import { timeFormat } from '@climblee/uv-ui/libs/function' const list = ref([ { name: '销售金额', + key: 'sales', }, { name: '支出金额', + key: 'expenditure', }, ]) +const tabIndex = ref(0) +const detail = ref({ + yesday_ledger: { + sales: 0, + expenditure: 0, + }, +}) +const yesday_ledger = computed(() => detail.value.yesday_ledger) +const trends_of_30days = computed(() => detail.value.trends_of_30days) + +const yesterday = computed(() => { + return timeFormat(Number(new Date()) - 1000 * 60 * 60 * 24) +}) +const tabObj = computed(() => list.value[tabIndex.value]) +const countData = computed(() => { + const arr = + trends_of_30days?.value?.reduce((p, c) => { + p.push({ + key: timeFormat(c.date, 'mm月dd日'), + value: c[tabObj.value.key], + }) + return p + }, []) ?? [] + return arr +}) const onTabClick = (e) => { console.log(e) + tabIndex.value = e.index +} + +onShow(() => { + getData() +}) + +const getData = () => { + http + .get('/statistics/dashboard', { + params: { + date: yesterday.value, + }, + }) + .then((res) => { + detail.value = res + }) } diff --git a/src/pages/login/LoginForm.vue b/src/pages/login/LoginForm.vue index dd45b07..00c43e7 100644 --- a/src/pages/login/LoginForm.vue +++ b/src/pages/login/LoginForm.vue @@ -49,6 +49,7 @@ const form = ref({ }) const handleClick = async () => { + try { const { username, password } = form.value await userStore.login({ diff --git a/src/pages/revert/index.vue b/src/pages/revert/index.vue index c63fff2..1f1e647 100644 --- a/src/pages/revert/index.vue +++ b/src/pages/revert/index.vue @@ -1,6 +1,7 @@