Compare commits

...

No commits in common. "main" and "master" have entirely different histories.
main ... master

69 changed files with 12669 additions and 3 deletions

View File

@ -0,0 +1,67 @@
{
"globals": {
"Component": true,
"ComponentPublicInstance": true,
"ComputedRef": true,
"EffectScope": true,
"ExtractDefaultPropTypes": true,
"ExtractPropTypes": true,
"ExtractPublicPropTypes": true,
"InjectionKey": true,
"PropType": true,
"Ref": true,
"VNode": true,
"WritableComputedRef": true,
"computed": true,
"createApp": true,
"customRef": true,
"defineAsyncComponent": true,
"defineComponent": true,
"effectScope": true,
"getCurrentInstance": true,
"getCurrentScope": true,
"h": true,
"inject": true,
"isProxy": true,
"isReactive": true,
"isReadonly": true,
"isRef": true,
"markRaw": true,
"nextTick": true,
"onActivated": true,
"onBeforeMount": true,
"onBeforeUnmount": true,
"onBeforeUpdate": true,
"onDeactivated": true,
"onErrorCaptured": true,
"onMounted": true,
"onRenderTracked": true,
"onRenderTriggered": true,
"onScopeDispose": true,
"onServerPrefetch": true,
"onUnmounted": true,
"onUpdated": true,
"provide": true,
"reactive": true,
"readonly": true,
"ref": true,
"resolveComponent": true,
"shallowReactive": true,
"shallowReadonly": true,
"shallowRef": true,
"toRaw": true,
"toRef": true,
"toRefs": true,
"toValue": true,
"triggerRef": true,
"unref": true,
"useAttrs": true,
"useCssModule": true,
"useCssVars": true,
"useSlots": true,
"watch": true,
"watchEffect": true,
"watchPostEffect": true,
"watchSyncEffect": true
}
}

11
.eslintrc.js Normal file
View File

@ -0,0 +1,11 @@
module.exports = {
"extends": [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier',
'plugin:prettier/recommended', // 添加 prettier 插件,
]
}

21
.gitignore vendored Normal file
View File

@ -0,0 +1,21 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
*.local
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@ -1,3 +0,0 @@
# freight-web
小货场 小程序

20
index.html Normal file
View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

90
package.json Normal file
View File

@ -0,0 +1,90 @@
{
"name": "uni-preset-vue",
"version": "0.0.0",
"scripts": {
"dev:app": "uni -p app",
"dev:app-android": "uni -p app-android",
"dev:app-ios": "uni -p app-ios",
"dev:custom": "uni -p",
"dev:h5": "uni",
"dev:h5:ssr": "uni --ssr",
"dev:mp-alipay": "uni -p mp-alipay",
"dev:mp-baidu": "uni -p mp-baidu",
"dev:mp-jd": "uni -p mp-jd",
"dev:mp-kuaishou": "uni -p mp-kuaishou",
"dev:mp-lark": "uni -p mp-lark",
"dev:mp-qq": "uni -p mp-qq",
"dev:mp-toutiao": "uni -p mp-toutiao",
"dev:mp-weixin": "uni -p mp-weixin",
"dev:quickapp-webview": "uni -p quickapp-webview",
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
"dev:quickapp-webview-union": "uni -p quickapp-webview-union",
"build:app": "uni build -p app",
"build:app-android": "uni build -p app-android",
"build:app-ios": "uni build -p app-ios",
"build:custom": "uni build -p",
"build:h5": "uni build",
"build:h5:ssr": "uni build --ssr",
"build:mp-alipay": "uni build -p mp-alipay",
"build:mp-baidu": "uni build -p mp-baidu",
"build:mp-jd": "uni build -p mp-jd",
"build:mp-kuaishou": "uni build -p mp-kuaishou",
"build:mp-lark": "uni build -p mp-lark",
"build:mp-qq": "uni build -p mp-qq",
"build:mp-toutiao": "uni build -p mp-toutiao",
"build:mp-weixin": "uni build -p mp-weixin",
"build:quickapp-webview": "uni build -p quickapp-webview",
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
"type-check": "vue-tsc --noEmit"
},
"dependencies": {
"@dcloudio/uni-app": "3.0.0-3081220230817001",
"@dcloudio/uni-app-plus": "3.0.0-3081220230817001",
"@dcloudio/uni-components": "3.0.0-3081220230817001",
"@dcloudio/uni-h5": "3.0.0-3081220230817001",
"@dcloudio/uni-mp-alipay": "3.0.0-3081220230817001",
"@dcloudio/uni-mp-baidu": "3.0.0-3081220230817001",
"@dcloudio/uni-mp-jd": "3.0.0-3081220230817001",
"@dcloudio/uni-mp-kuaishou": "3.0.0-3081220230817001",
"@dcloudio/uni-mp-lark": "3.0.0-3081220230817001",
"@dcloudio/uni-mp-qq": "3.0.0-3081220230817001",
"@dcloudio/uni-mp-toutiao": "3.0.0-3081220230817001",
"@dcloudio/uni-mp-weixin": "3.0.0-3081220230817001",
"@dcloudio/uni-quickapp-webview": "3.0.0-3081220230817001",
"@dcloudio/uni-ui": "^1.5.2",
"amfe-flexible": "^2.2.1",
"clipboard": "^2.0.11",
"dayjs": "^1.11.10",
"echarts": "^5.5.0",
"esbuild": "0.17.19",
"luch-request": "^3.1.1",
"pinia": "2.0.33",
"pinia-plugin-persistedstate": "^3.2.1",
"postcss-pxtorem": "^6.0.0",
"underscore": "^1.13.6",
"unplugin-auto-import": "^0.17.3",
"uview-plus": "^3.2.14",
"vue": "^3.2.45",
"vue-i18n": "^9.1.9"
},
"devDependencies": {
"@dcloudio/types": "^3.3.2",
"@dcloudio/uni-automator": "3.0.0-3081220230817001",
"@dcloudio/uni-cli-shared": "3.0.0-3081220230817001",
"@dcloudio/uni-stacktracey": "3.0.0-3081220230817001",
"@dcloudio/vite-plugin-uni": "3.0.0-3081220230817001",
"@types/node": "^20.11.22",
"@types/underscore": "^1.11.15",
"@types/wechat-miniprogram": "^3.4.7",
"@uni-helper/uni-app-types": "^0.5.12",
"@uni-helper/uni-ui-types": "^0.5.11",
"@vue/runtime-core": "^3.2.45",
"@vue/tsconfig": "^0.1.3",
"sass": "^1.69.7",
"sass-loader": "10",
"typescript": "^4.9.4",
"vite": "4.1.4",
"vue-tsc": "^1.0.24"
}
}

7331
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

7
readme.md Normal file
View File

@ -0,0 +1,7 @@
## 获取接口字段
```
let c = a.data[22].requestBody.jsonSchema.properties
for (let i = 0; i < Object.keys(c).length; i++) {
console.log(Object.keys(c)[i], + ':',c[Object.keys(c)[i]].type + '; //' + c[Object.keys(c)[i]].description )
}
```

10
shims-uni.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
/// <reference types='@dcloudio/types' />
import 'vue'
declare module '@vue/runtime-core' {
type Hooks = App.AppInstance & Page.PageInstance;
interface ComponentCustomOptions extends Hooks {
}
}

8
src/.postcssrc.js Normal file
View File

@ -0,0 +1,8 @@
module.exports = {
plugins: {
"postcss-pxtorem": {
rootValue: 37.5,
propList: ["*"],
},
},
};

31
src/App.vue Normal file
View File

@ -0,0 +1,31 @@
<script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
const isFirstLaunch = ref(true);
onLaunch(() => {
console.log(uni.getStorageSync("hasLaunched"))
//
if (Boolean(uni.getStorageSync("hasLaunched"))) {
//
isFirstLaunch.value = false;
console.log('不再显示启动页')
} else {
//
uni.setStorageSync("hasLaunched", true);
uni.redirectTo({url: 'pagesLaunch/index'})
}
});
onShow(() => {
console.log("App Show");
});
onHide(() => {
console.log("App Hide");
});
</script>
<style lang="scss">
/* 注意要写在第一行同时给style标签加入lang="scss"属性 */
@import "uview-plus/index.scss";
body {
font-size: 12px;
}
</style>

66
src/auto-import.d.ts vendored Normal file
View File

@ -0,0 +1,66 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const customRef: typeof import('vue')['customRef']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const effectScope: typeof import('vue')['effectScope']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const h: typeof import('vue')['h']
const inject: typeof import('vue')['inject']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const provide: typeof import('vue')['provide']
const reactive: typeof import('vue')['reactive']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const resolveComponent: typeof import('vue')['resolveComponent']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const toValue: typeof import('vue')['toValue']
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useSlots: typeof import('vue')['useSlots']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
}
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
import('vue')
}

View File

@ -0,0 +1,15 @@
<template>
<view class="box">
<slot></slot>
</view>
</template>
<script setup lang="ts"></script>
<style lang="scss">
.box {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 24.36rpx 25.64rpx;
padding: 25rpx 0rpx;
}
</style>

View File

@ -0,0 +1,74 @@
<template>
<u-modal :show="show" >
<view class="slot-content">
<view class="title"> {{ title }} </view>
<view class="content">
<text :class="{ isMain: isMain }">{{ content }}</text>
</view>
</view>
<template #confirmButton>
<view class="btn-box">
<text class="cancel" @click="handleClose('cancel')">取消</text>
<text class="ok" @click="handleClose('ok')">{{ okText }}</text>
</view>
</template>
</u-modal>
</template>
<script setup lang="ts">
const props = withDefaults(
defineProps<{
title: string;
content: string;
okText: string;
isMain: boolean;
show: boolean;
}>(),
{
okText: "确认",
isMain: false,
show: false
}
);
const emit = defineEmits(["handleModal", "handleOk"]);
const handleClose = (v: string) => {
emit("handleModal", false);
if (v === 'ok') {
//
emit("handleOk");
}
};
</script>
<style lang="scss" scoped>
.title {
text-align: center;
font-weight: 400;
font-size: 32rpx;
color: #000000;
margin-top: 25px;
}
.content {
padding-top: 25px;
font-weight: 400;
font-size: 27rpx;
color: #999999;
}
.isMain {
color: #ec0f3e;
}
.btn-box {
display: flex;
justify-content: space-between;
margin-bottom: 25px;
.cancel {
font-weight: 500;
font-size: 32rpx;
color: #999999;
}
.ok {
font-weight: 500;
font-size: 32rpx;
color: #00dcee;
}
}
</style>

View File

@ -0,0 +1,91 @@
<template>
<view
:style="{
paddingTop: navbarRect.top + 'px',
height: navbarRect.height + 'px',
}"
class="navbar"
>
<view class="left" @click="handleMsg()">
<view class="msg-badge">
<up-badge max="99" :value="count"></up-badge>
</view>
<up-image
src="https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/message.png"
width="42rpx"
height="36rpx"
></up-image>
</view>
<view class="title">工作台</view>
</view>
</template>
<script setup lang="ts">
import { ProfileApi,ReceiveApi,ShipmentApi,PictureApi,ReceiveProductApi,DeviceApi,StockCardApi,GoodsApi,SupplierApi,CustomerApi,FinanceApi,MessageApi } from '@/services';
import { formatDate } from "@/utils";
import { UsersType } from "@/utils/enum";
import valid from "@/utils/validate";
console.log(ProfileApi,ReceiveApi,ShipmentApi,PictureApi,ReceiveProductApi,DeviceApi,StockCardApi,GoodsApi,SupplierApi,CustomerApi,FinanceApi,formatDate,UsersType, valid)
const props = withDefaults(
defineProps<{
count: number
}>(),
{
count: 0
}
);
const navbarRect = reactive({
height: 32,
top: 28,
msgCount: 10,
});
onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
navbarRect.height = menuButtonInfo.height;
navbarRect.top = menuButtonInfo.top;
// #endif
});
const handleMsg = () => {
uni.navigateTo({
url: "/pagesLogin/message/index", //
});
};
</script>
<style lang="scss">
.navbar {
background: #f9f9f9;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.18);
padding: 15rpx;
position: fixed;
width: 100%;
top: 0;
left: 0;
right: 0;
z-index: 999;
.left {
position: absolute;
margin-top: 10px;
.msg-badge {
margin-left: 20rpx;
font-size: 16rpx;
padding: 2px 4px;
position: absolute;
z-index: 9;
margin-top: -10px;
}
}
.title {
font-size: 32rpx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #000000;
line-height: 41rpx;
text-align: center;
padding: 5px;
}
}
</style>

View File

@ -0,0 +1,69 @@
<template>
<view
:style="{
paddingTop: navbarRect.top + 'px',
height: navbarRect.height + 'px',
}"
class="navbar"
>
<view class="left" @click="handleMsg()">
</view>
<view class="title">个人中心</view>
</view>
</template>
<script setup lang="ts">
const navbarRect = reactive({
height: 32,
top: 28,
msgCount: 10,
});
onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
navbarRect.height = menuButtonInfo.height;
navbarRect.top = menuButtonInfo.top;
// #endif
});
const handleMsg = () => {
uni.navigateTo({
url: "/pagesLogin/message/index", //
});
};
</script>
<style lang="scss">
.navbar {
background: #f9f9f9;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.18);
padding: 15rpx;
position: fixed;
width: 100%;
top: 0;
left: 0;
right: 0;
z-index: 999;
.left {
position: absolute;
margin-top: 10px;
.msg-badge {
margin-left: 20rpx;
font-size: 16rpx;
padding: 2px 4px;
position: absolute;
z-index: 9;
margin-top: -10px;
}
}
.title {
font-size: 32rpx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #000000;
line-height: 41rpx;
text-align: center;
padding: 5px;
}
}
</style>

View File

@ -0,0 +1,98 @@
<template>
<scroll-view
:scroll-y="true"
class="scroll-view-custom"
@scrolltolower="loadMore"
:style="{ height: clientHeight + 'px' }"
>
<slot> </slot>
<!-- 加载更多提示 -->
<view
v-if="noMoreData || isLoading"
class="no-more-data-text"
style="padding: 20rpx"
>
<u-loadmore
:status="isLoading ? 'loading' : 'nomore'"
:line="true"
:fontSize="12"
:marginTop="30"
/>
</view>
<view
v-if="!isLoading && list.length === 0"
style="justify-content: center; padding: 20rpx"
>
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
</view>
</scroll-view>
</template>
<script setup lang="ts">
import { onLoad } from "@dcloudio/uni-app";
const props = withDefaults(
defineProps<{
noMoreData: boolean;
isLoading: boolean;
list: any;
height: number;
}>(),
{
noMoreData: false,
isLoading: false,
list: [],
height: 80,
}
);
const emit = defineEmits(["loadList"]);
const clientHeight = ref(500);
const loadMore = () => {
console.log("**** 加载更多");
if (props.noMoreData) return; //
emit("loadList", true);
};
const getBarHeight = () => {
const res = uni.getSystemInfoSync();
console.log(res);
if (res.platform === "ios" || res.osName === "ios") {
return 44;
} else if (res.platform === "android") {
return 48;
} else {
return 0;
}
};
//
const getClineHeight = () => {
uni.getSystemInfo({
success: (res) => {
clientHeight.value =
res.windowHeight - uni.upx2px(props.height) - getBarHeight();
},
});
};
watch(
() => props.height,
(newValue, oldValue) => {
getClineHeight();
}
);
// ,{ deep: true, immediate:true}
onLoad(() => {
// #ifdef APP-PLUS || MP-WEIXIN
getClineHeight();
// #endif
});
</script>
<style lang="scss">
.no-more-data-text {
font-size: 24rpx;
}
</style>

View File

@ -0,0 +1,59 @@
<template>
<view class="search">
<view v-if="!isShowSearch" @click="isShowSearch = true">
<u-icon color="#C1C1C1" name="search"></u-icon
><text>{{ name }}</text>
</view>
<u-search
v-else
:placeholder="`请输入${name}`"
v-model="keyword"
:focus="true"
bgColor="#fff"
clearable
:showAction="false"
placeholderColor="#C1C1C1"
@search="handleSearch()"
@clear="handleSearch()"
></u-search>
</view>
</template>
<script setup lang="ts">
const isShowSearch = ref(false);
const keyword = ref('');
const props = withDefaults(
defineProps<{
name: string;
}>(),
{
name: '搜索内容',
}
);
const emit = defineEmits(["handleSearch"]);
const handleSearch = () => {
emit("handleSearch", keyword.value)
}
</script>
<style lang="scss" scoped>
.search {
box-shadow: 0rpx 3rpx 16rpx 5rpx rgba(0, 0, 0, 0.2);
border-radius: 28rpx;
background: rgba(255, 255, 255, 0.86);
width: 80%;
margin: 0px auto;
margin-top: 30rpx;
font-weight: 400;
font-size: 27rpx;
color: #c1c1c1;
> view {
line-height: 60rpx;
text-align: center;
display: flex;
justify-content: center;
}
text {
margin-left: 15rpx;
}
}
</style>

View File

@ -0,0 +1,54 @@
<template>
<view class="box">
<up-row>
<up-col v-for="(item, index) in list" :span="12 / list.length">
<view class="inner-box" :style="{ border: index === 0 ? 'none' : '' }">
<view class="num">{{ formatMoney(item.num) }}</view>
<view>{{ item.name }}</view>
</view>
</up-col>
</up-row>
</view>
</template>
<script setup lang="ts">
import { formatMoney } from '@/utils';
const props = withDefaults(
defineProps<{
list: any;
}>(),
{
list: [],
}
);
</script>
<style lang="scss" scoped>
.box {
padding: 19.23rpx;
// display: flex;
// justify-content: space-between;
align-items: center;
font-family: Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #000000;
text-align: center;
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
}
.inner-box {
text-align: center;
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 26rpx;
color: #000000;
border-left: 1px solid #e9e9e9;
.num {
font-weight: bold;
font-size: 28rpx;
color: rgba(236, 15, 62, 1);
}
}
</style>

View File

@ -0,0 +1,153 @@
<template>
<!-- 工作台底部菜单 -->
<uni-transition mode-class="fade" :duration="100" :show="true">
<view>
<view class="tabBar">
<view class="tabMenuBox">
<view class="circle-box"></view>
<u-grid :border="false">
<u-grid-item
v-for="(item, listIndex) in tabMenuList"
:key="listIndex"
@click="item.fn"
>
<up-image
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/TabMenu/${
item.icon
}${
listIndex !== 1 && currentIndex === listIndex ? '1' : ''
}.png`"
width="33rpx"
height="40rpx"
mode="aspectFill"
class="grid-icon"
></up-image>
<text
class="grid-text"
:class="{ active: currentIndex === listIndex }"
:style="{ color: listIndex === 1 ? '#fff' : '' }"
>{{ item.title }}</text
>
</u-grid-item>
</u-grid>
</view>
</view>
</view>
</uni-transition>
</template>
<script setup lang="ts">
import { onLoad } from "@dcloudio/uni-app";
const tabMenuList = reactive([
{
icon: "statistics",
title: "统计",
fn: () => {
const pages: any = getCurrentPages();
if (
[
"pagesStatistics/index",
"pagesHome/index",
"pagesLogin/profile/index",
].indexOf(pages[pages.length - 1].route) === 0
) {
return;
}
uni.redirectTo({
url: "/pagesStatistics/index", //
});
},
},
{
icon: "home",
title: "工作台",
fn: () => {
const pages: any = getCurrentPages();
if (
[
"pagesStatistics/index",
"pagesHome/index",
"pagesLogin/profile/index",
].indexOf(pages[pages.length - 1].route) === 1
) {
return;
}
uni.redirectTo({
url: "/pagesHome/index", //
});
},
},
{
icon: "profile",
title: "我的",
fn: () => {
const pages: any = getCurrentPages();
if (
[
"pagesStatistics/index",
"pagesHome/index",
"pagesLogin/profile/index",
].indexOf(pages[pages.length - 1].route) === 2
) {
return;
}
uni.redirectTo({
url: "/pagesLogin/profile/index", //
});
},
},
]);
const currentIndex = ref(1);
onLoad(() => {
const pages: any = getCurrentPages();
currentIndex.value = [
"pagesStatistics/index",
"pagesHome/index",
"pagesLogin/profile/index",
].indexOf(pages[pages.length - 1].route);
});
</script>
<style lang="scss" scoped>
.tabBar {
background: url("https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/TabMenu/bg.png");
height: 140rpx;
background-size: cover;
position: fixed;
width: 100%;
bottom: 0px;
.tabMenuBox {
padding-top: 30rpx;
font-size: 26rpx;
font-weight: 400;
color: #999999;
.grid-text {
margin-top: 10rpx;
}
.circle-box {
width: 154rpx;
height: 154rpx;
background: linear-gradient(0deg, #1992ef, #00f6ff);
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 50, 100, 0.12);
border-radius: 50%;
font-weight: 500;
color: #ffffff;
position: absolute;
margin-top: -49rpx;
margin-left: calc(50% - 78rpx);
}
.normal-box {
width: 150rpx;
height: 150rpx;
text-align: center;
}
}
.active {
color: rgba(0, 220, 238, 1);
}
}
</style>

View File

@ -0,0 +1,18 @@
<template>
<view class="title">
{{ props.title }}
</view>
</template>
<script setup lang="ts">
const props = defineProps<{
title:string
}>()
</script>
<style lang="scss">
.title {
font-family: Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #000000;
}
</style>

24
src/config/env.ts Normal file
View File

@ -0,0 +1,24 @@
// 不同的环境变量配置
const development = {
// VITE_APP_BASE_URL: 'http://47.100.31.83:8081',
// VITE_APP_BASE_URL: 'https://47.100.31.83:8081',
// appid: '',
VITE_APP_BASE_URL: 'https://ifanda.52zaisheng.cn/prod',
appid: 'wx9251d74fe0e87028',
}
const test = {
VITE_APP_BASE_URL: 'https://47.100.31.83:8081',
appid: 'wxd5xxxxee0fce1c81',
}
const production = {
VITE_APP_BASE_URL: 'https://ifanda.52zaisheng.cn/prod',
appid: 'wx9251d74fe0e87028',
}
export default {
development,
test,
production
}

25
src/env.d.ts vendored Normal file
View File

@ -0,0 +1,25 @@
/// <reference types="vite/client" />
// declare module '*.vue' {
// import { DefineComponent } from 'vue'
// // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
// const component: DefineComponent<{}, {}, any>
// export default component
// }
declare module "*.vue" {
import { ComponentOptions } from "vue";
const componentOptions: ComponentOptions;
export default componentOptions;
}
interface ImportMetaEnv extends Readonly<Record<string, string>> {
readonly VITE_APP_TITLE: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}

33
src/main.ts Normal file
View File

@ -0,0 +1,33 @@
import { createSSRApp } from "vue";
import uviewPlus from "uview-plus";
import pinia from './store'
import App from "./App.vue";
import './static/style/common.scss'
export function createApp() {
const app = createSSRApp(App);
app.use(uviewPlus);
app.use(pinia);
uni.$u.setConfig({
// 修改$u.config对象的属性
config: {
// 修改默认单位为rpx相当于执行 uni.$u.config.unit = 'rpx'
unit: 'px'
},
// 修改$u.props对象的属性
props: {
// 修改radio组件的size参数的默认值相当于执行 uni.$u.props.radio.size = 30
// checkbox: {
// size: 15
// }
// 其他组件属性配置
// ......
}
})
return {
app,
pinia
};
}

85
src/manifest.json Normal file
View File

@ -0,0 +1,85 @@
{
"name": "在生万有",
// DCloud ios
"appid": "__UNI__898003A",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
/* 5+App */
"app-plus": {
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
/* */
"modules": {},
/* */
"distribute": {
/* android */
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios": {},
/* SDK */
"sdkConfigs": {}
}
},
/* */
"quickapp": {},
// h5
"h5": {
"router": {
"base": "./"
}
},
/* */
"mp-weixin": {
"appid": "wx9251d74fe0e87028",
"logoPath": "https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/logo-simple.png",
"setting": {
"urlCheck": false
},
"usingComponents": true,
"optimization": {
"subPackages": true //
},
"lazyCodeLoading": "requiredComponents"
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion": "3"
}

465
src/pages.json Normal file
View File

@ -0,0 +1,465 @@
{
"easycom": {
"autoscan": true,
// customhttps://ask.dcloud.net.cn/question/131175
"custom": {
"^u--(.*)": "uview-plus/components/u-$1/u-$1.vue",
"^up-(.*)": "uview-plus/components/u-$1/u-$1.vue",
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue",
// ava
"^Ava(.*)": "@/components/Ava$1/Ava$1.vue",
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
}
},
"pages": [
{
"path": "pagesHome/index",
"style": {
"navigationStyle": "custom", //
"navigationBarTitleText": "工作台"
}
}
//pageshttps://uniapp.dcloud.io/collocation/pages
],
"subPackages": [
{
"root": "pagesLaunch",
"pages": [
{
"path": "index",
"style": {
"navigationBarTitleText": ""
}
}
]
},
{
"root": "pagesLogin",
"pages": [
{
"path": "login/index",
"style": {
"navigationBarTitleText": "登陆"
}
},
{
"path": "login/forgetPwd",
"style": {
"navigationBarTitleText": "忘记密码"
}
},
{
"path": "message/index",
"style": {
"navigationBarTitleText": "消息中心"
}
},
{
"path": "profile/index",
"style": {
"navigationBarTitleText": "个人中心"
}
},
{
"path": "profile/baseinfo",
"style": {
"navigationBarTitleText": "基础信息",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "profile/modifyPwd",
"style": {
"navigationBarTitleText": "修改密码",
"navigationBarBackgroundColor": "#FFFFFF"
}
}
]
},
// {
// "root": "pagesHome",
// "pages": [
// {
// "path": "index",
// "style": {
// "navigationStyle": "custom", //
// "navigationBarTitleText": "工作台"
// }
// }
// ]
// },
{
"root": "pagesReceive",
"pages": [
{
"path": "pricing",
"style": {
"navigationBarTitleText": "待定价"
}
},
{
"path": "payReview",
"style": {
"navigationBarTitleText": "付款审核"
}
},
{
"path": "form/pricingForm",
"style": {
"navigationBarTitleText": "定价详情"
}
},
{
"path": "review/index",
"style": {
"navigationBarTitleText": "去审核"
}
}
]
},
{
"root": "pagesShipment",
"pages": [
{
"path": "shipmenting",
"style": {
"navigationBarTitleText": "待出货"
}
},
{
"path": "grossWeight",
"style": {
"navigationBarTitleText": "待过毛重"
}
},
{
"path": "shipmentSettlement",
"style": {
"navigationBarTitleText": "出货结算"
}
},
{
"path": "review/index",
"style": {
"navigationBarTitleText": "结算审核"
}
},
{
"path": "form/shipmentForm",
"style": {
"navigationBarTitleText": "待出货编辑"
}
},
{
"path": "form/settlementForm",
"style": {
"navigationBarTitleText": "结算信息"
}
}
]
},
{
"root": "pagesScenePhoto",
"pages": [
{
"path": "index",
"style": {
"navigationBarTitleText": "现场照片"
}
}
]
},
{
"root": "pagesStatistics",
"pages": [
{
"path": "index",
"style": {
"navigationBarTitleText": "数据统计"
}
},
{
"path": "receivePanel",
"style": {
"navigationBarTitleText": "收货汇总"
}
},
{
"path": "supplierRanking",
"style": {
"navigationBarTitleText": "供应商排行"
}
},
{
"path": "shipmentPanel",
"style": {
"navigationBarTitleText": "出货汇总"
}
},
{
"path": "customerRanking",
"style": {
"navigationBarTitleText": "客户排行"
}
},
{
"path": "businessOverview",
"style": {
"navigationBarTitleText": "经营概况"
}
},
{
"path": "supplierChecking",
"style": {
"navigationBarTitleText": "供应商对账"
}
},
{
"path": "customerChecking",
"style": {
"navigationBarTitleText": "客户对账"
}
},
{
"path": "billDetail",
"style": {
"navigationBarTitleText": "账单详情"
}
},
{
"path": "supplier/detail",
"style": {
"navigationBarTitleText": "供应商详情"
}
},
{
"path": "customer/detail",
"style": {
"navigationBarTitleText": "客户详情"
}
},
// {
// "path": "uni_modules/lime-echart",
// "style": {
// "navigationBarTitleText": "组件库"
// }
// }
]
},
{
"root": "pagesApp",
"pages": [
{
"path": "receiveSpl",
"style": {
"navigationBarTitleText": "收货补单"
}
},
{
"path": "shipmentSpl",
"style": {
"navigationBarTitleText": "出货补单"
}
},
{
"path": "receiveDetail",
"style": {
"navigationBarTitleText": "收货明细"
}
},
{
"path": "shipmentDetail",
"style": {
"navigationBarTitleText": "出货明细"
}
},
{
"path": "receiveCl",
"style": {
"navigationBarTitleText": "收货作废"
}
},
{
"path": "shipmentCl",
"style": {
"navigationBarTitleText": "出货作废"
}
},
{
"path": "supplierMgt",
"style": {
"navigationBarTitleText": "供应商管理"
}
},
{
"path": "customerMgt",
"style": {
"navigationBarTitleText": "客户管理"
}
},
{
"path": "receiveProduct",
"style": {
"navigationBarTitleText": "收货产品"
}
},
{
"path": "receiveType",
"style": {
"navigationBarTitleText": "收货分类"
}
},
{
"path": "shipmentProduct",
"style": {
"navigationBarTitleText": "出货产品"
}
},
{
"path": "stockCard",
"style": {
"navigationBarTitleText": "库存卡管理"
}
},
{
"path": "shipmentType",
"style": {
"navigationBarTitleText": "出货分类管理"
}
},
{
"path": "supplierType",
"style": {
"navigationBarTitleText": "供应商分类"
}
},
{
"path": "user",
"style": {
"navigationBarTitleText": "人员管理"
}
},
{
"path": "role",
"style": {
"navigationBarTitleText": "权限管理"
}
},
{
"path": "paymentDetail",
"style": {
"navigationBarTitleText": "支付明细"
}
},
{
"path": "incomeDetail",
"style": {
"navigationBarTitleText": "收入明细"
}
},
{
"path": "components/addSupplierType",
"style": {
"navigationBarTitleText": "新增供应商分类"
}
},
{
"path": "components/addSupplier",
"style": {
"navigationBarTitleText": "新增供应商"
}
},
{
"path": "components/addShipmentType",
"style": {
"navigationBarTitleText": "新增出货分类"
}
},
{
"path": "components/addCustomer",
"style": {
"navigationBarTitleText": "新增客户"
}
},
{
"path": "components/addReceiveProduct",
"style": {
"navigationBarTitleText": "新增收货产品"
}
},
{
"path": "components/addReceiveType",
"style": {
"navigationBarTitleText": "新增收货分类"
}
},
{
"path": "components/addShipmentProduct",
"style": {
"navigationBarTitleText": "新增出货产品"
}
},
{
"path": "components/addStockCard",
"style": {
"navigationBarTitleText": "新增库存卡"
}
},
{
"path": "components/addUser",
"style": {
"navigationBarTitleText": "新增人员"
}
},
{
"path": "components/addRole",
"style": {
"navigationBarTitleText": "新增权限"
}
},
{
"path": "components/addPayment",
"style": {
"navigationBarTitleText": "新增支付明细"
}
},
{
"path": "components/payContent",
"style": {
"navigationBarTitleText": "支付详情"
}
},
{
"path": "components/addIncomeDetail",
"style": {
"navigationBarTitleText": "新增收入明细"
}
},
{
"path": "components/incomeContent",
"style": {
"navigationBarTitleText": "收入详情"
}
}
]
}
// {
// "root": "uni_modules",
// "pages": [
// {
// "path": "lime-echart/components/l-echart/l-echart",
// "style": {
// "navigationBarTitleText": "echart"
// }
// }
// ]
// }
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "智能回收",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"lazyCodeLoading": "requiredComponents"
}

92
src/pagesLaunch/index.vue Normal file
View File

@ -0,0 +1,92 @@
<template>
<swiper
class="swiper"
circular
:indicator-dots="true"
:autoplay="false"
:interval="2000"
:duration="500"
indicator-active-color="#00DCEE"
>
<swiper-item v-for="(item, index) in list" :key="index">
<view class="image-box">
<image
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLaunch/${item.imgUrl}`"
></image>
<view class="title">
{{ item.title }}
</view>
<view v-if="index === 3" class="btn-start" @click="start()">
立即启用
</view>
</view>
</swiper-item>
</swiper>
</template>
<script setup lang="ts">
import { useMemberStore } from "@/store/index";
const store = useMemberStore();
const profile = store.profile;
const list = [
{
title: "智能回收 智慧未来!",
imgUrl: "1.png",
},
{
title: "高效管理 安全快捷!",
imgUrl: "2.png",
},
{
title: "全新系统 崭新界面!",
imgUrl: "3.png",
},
{
title: "全城握手 致富从这里开始!",
imgUrl: "4.png",
},
];
const start = () => {
// token
if (profile.token) {
uni.navigateTo({
url: "/pagesHome/index", //
});
} else {
uni.navigateTo({
url: "/pagesLogin/login/index", //
});
}
};
</script>
<style lang="scss" scoped>
.swiper {
width: 100%;
height: 80vh;
margin-top: 10vh;
.image-box {
text-align: center;
cursor: pointer;
}
.title {
font-size: 40rpx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #00d2e3;
margin-top: 90rpx;
}
.btn-start {
height: 88rpx;
background: #00dcee;
border-radius: 44rpx;
line-height: 88rpx;
font-size: 37rpx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #ffffff;
width: 80%;
margin: 0px auto;
margin-top: 50rpx;
cursor: pointer;
}
}
</style>

View File

@ -0,0 +1,33 @@
<template>
<view class="c-login-container">
<!-- logo -->
<view class="logo">
<image :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/logo.png`" height="60rpx"></image>
</view>
<!-- form表单 -->
<view class="login-form">
<slot name="form-box"></slot>
</view>
</view>
</template>
<script setup lang="ts">
</script>
<style lang="scss" scoped>
.c-login-container {
height: 80vh;
margin-top: 10vh;
.logo {
text-align: center;
image {
width: 234.62rpx;
height: 62.18rpx;
}
}
.login-form {
margin-top: 100rpx;
padding: 100rpx;
}
}
</style>

View File

@ -0,0 +1,285 @@
<template>
<LoginLayout>
<template #form-box>
<u-form
labelPosition="left"
:model="model1"
:rules="rules"
ref="loginForm"
:labelWidth="0"
>
<u-form-item
v-for="(item, index) in formAttrList"
:key="index"
:prop="`userInfo.${item.modelName}`"
>
<u-input
v-if="item.type === 'text'"
v-model="model1.userInfo[`${item.modelName}`]"
:placeholder="item.placeholder"
:shape="'circle'"
clearable
:customStyle="{
'border-color':
currentFocus === item.modelName ? '#00dcee !important' : '',
}"
@focus="handleFocus(item.modelName)"
@blur="handleFocus('')"
@change="(e:any) => {handleInput(e, item.modelName)}"
@clear="handleClear(item)"
>
<template #suffix>
<text v-if="item.modelName === 'code'" class="code-btn">
<text
v-if="seconds === 0"
@click="handleCode"
class="code-primary"
>获取验证码</text
>
<text v-else
>剩余<text class="code-primary">{{ seconds }}</text></text
>
</text>
</template>
</u-input>
<u-input
v-if="item.type === 'password'"
v-model="model1.userInfo[`${item.modelName}`]"
:placeholder="item.placeholder"
:shape="'circle'"
clearable
:password="!item.isShowPwd"
:customStyle="{
'border-color':
currentFocus === item.modelName ? '#00dcee !important' : '',
}"
@focus="handleFocus(item.modelName)"
@blur="handleFocus('')"
@change="(e:any) => {handleInput(e, item.modelName)}"
@clear="handleClear(item)"
>
<template #suffix>
<image
v-if="!item.isShowPwd"
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/login/hide.png`"
class="custom-icon"
@click="item.isShowPwd = true"
></image>
<image
v-else
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/login/show.png`"
class="custom-icon"
@click="item.isShowPwd = false"
></image>
</template>
</u-input>
</u-form-item>
</u-form>
<view class="login-btn">
<u-button
@click="submit"
type="primary"
:customStyle="{
'border-radius': '43rpx',
}"
>保存</u-button
>
</view>
</template>
</LoginLayout>
</template>
<script setup lang="ts">
import { ProfileApi } from "@/services/index";
import LoginLayout from "./components/loginLayout.vue";
import valid from "@/utils/validate";
const handleClear = (item: any) => {
(model1.userInfo as any)[item.modelName] = "";
};
const loginForm = ref(null);
const model1 = <any>reactive({
userInfo: {
phone: "",
code: "",
newPassword: "",
passwordConfirm: "",
},
});
// focus
const currentFocus = ref("");
//
const formAttrList = ref([
{
modelName: "phone",
type: "text",
placeholder: "请输入手机号",
},
{
modelName: "code",
type: "text",
placeholder: "请输入验证码",
},
{
modelName: "newPassword",
type: "password",
placeholder: "请输入新密码",
isShowPwd: false, //
},
{
modelName: "passwordConfirm",
type: "password",
placeholder: "请输入确认密码",
isShowPwd: false, //
},
]);
const handleInput = (e: any, key: string) => {
if (key === "phone") {
const temp = e?.replace(valid.valid_number, "");
setTimeout(() => {
(model1.userInfo as any)[key] = temp;
}, 10);
}
if (key === "code") {
const temp = e?.replace(valid.valid_number, "");
setTimeout(() => {
(model1.userInfo as any)[key] = temp;
}, 10);
}
if (key === "newPassword" || key === "passwordConfirm") {
const temp = e?.replace(valid.valid_no_cn, "");
setTimeout(() => {
(model1.userInfo as any)[key] = temp;
}, 10);
}
};
//
const seconds = ref(0);
const handleCode = () => {
if (model1.userInfo === undefined || !model1.userInfo.phone) {
uni.showToast({
title: "请输入手机号",
icon: "error",
});
return;
}
if (!valid.mobile.pattern.test(model1.userInfo.phone)) {
uni.showToast({
title: "请输入正确的手机号",
icon: "error",
});
return;
}
ProfileApi.sendCommonMsg({
phone: model1.userInfo.phone,
type: "forget",
}).then((res) => {
seconds.value = 120;
let countDownTimer = setInterval(() => {
if (seconds.value > 0) {
--seconds.value;
} else {
clearInterval(countDownTimer);
}
}, 1000);
});
};
const rules = ref({
"userInfo.phone": {
type: "string",
required: true,
message: "请输入手机号",
trigger: ["blur", "change"],
},
"userInfo.code": {
type: "string",
required: true,
message: "请输入验证码",
trigger: ["blur", "change"],
},
"userInfo.newPassword": {
type: "string",
required: true,
trigger: ["blur", "change"],
message: "请输入新密码",
},
"userInfo.passwordConfirm": {
type: "string",
required: true,
message: "请输入确认密码",
trigger: ["blur", "change"],
},
});
const handleFocus = (attr: string) => {
currentFocus.value = attr;
};
const submit = () => {
if (model1.userInfo.phone) {
if (!valid.mobile.pattern.test(model1.userInfo.phone)) {
uni.showToast({ icon: "none", title: "请输入正确的手机号" });
return;
}
}
if (model1.userInfo.newPassword || model1.userInfo.passwordConfirm) {
if (
!valid.valid_password.pattern.test(model1.userInfo.newPassword) ||
!valid.valid_password.pattern.test(model1.userInfo.passwordConfirm)
) {
uni.showToast({
icon: "none",
title: valid.valid_password.message,
});
return;
}
}
if (model1.userInfo.newPassword !== model1.userInfo.passwordConfirm) {
uni.showToast({ icon: "none", title: "新密码必须和确认密码相同" });
return;
}
(loginForm.value as any).validate().then((res: any) => {
if (res) {
//
ProfileApi.forgetPwd({ ...model1.userInfo, type: "forget" }).then(
(res: any) => {
if (res.code === 200) {
uni.showToast({ title: "密码更新成功" });
uni.navigateBack();
}
}
);
}
});
};
</script>
<style lang="scss" scoped>
.custom-icon {
width: 37.18rpx;
height: 18.59rpx;
}
.login-btn {
margin-top: 23.72rpx;
}
::v-deep .u-form-item__body__right__message {
margin-left: 10px !important;
}
.code-btn {
font-size: 27rpx;
font-family: Source Han Sans CN;
font-weight: 400;
cursor: pointer;
.code-primary {
color: $u-primary;
}
}
</style>

View File

@ -0,0 +1,293 @@
<template>
<LoginLayout>
<template #form-box>
<u-form
labelPosition="left"
:model="model1"
:rules="rules"
ref="loginForm"
:labelWidth="0"
>
<u-form-item prop="userInfo.userName">
<up-input
v-model="model1.userInfo.userName"
placeholder="请输入手机号"
:shape="'circle'"
clearable
:customStyle="{
'border-color':
currentFocus === 'userName' ? '#00dcee !important' : '',
}"
type="number"
@focus="handleFocus('userName')"
@change="(e:any) => {handleInput(e, 'userName')}"
@clear="handleClear({key: 'userName'})"
>
</up-input>
</u-form-item>
<u-form-item prop="userInfo.password">
<up-input
v-model="model1.userInfo.password"
placeholder="请输入密码"
:shape="'circle'"
type="text"
:password="!isShowPwd"
:customStyle="{
'border-color':
currentFocus === 'password' ? '#00dcee !important' : '',
}"
@focus="handleFocus('password')"
clearable
@change="(e:any) => {handleInput(e, 'password')}"
@clear="handleClear({key: 'password'})"
>
<template #suffix>
<image
v-if="!isShowPwd"
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/login/hide.png`"
class="custom-icon"
@click="isShowPwd = true"
></image>
<image
v-else
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/login/show.png`"
class="custom-icon"
@click="isShowPwd = false"
></image>
</template>
</up-input>
</u-form-item>
</u-form>
<view class="remember-box">
<view>
<u-checkbox-group v-model="checkGroup.rememberCheck">
<u-checkbox
:customStyle="{}"
:key="1"
:label="'记住密码?'"
:name="1"
:size="'25rpx'"
:activeColor="'#00dcee'"
:labelSize="'25rpx'"
:labelColor="'#000000'"
></u-checkbox>
</u-checkbox-group>
</view>
<text @click="handleForgetPwd">忘记密码</text>
</view>
<view class="login-btn">
<u-button
@click="submit"
type="primary"
:customStyle="{
'border-radius': '43rpx',
}"
>立即登录</u-button
>
</view>
<view class="agree">
<u-checkbox-group v-model="checkGroup.agreeCheck">
<u-checkbox
:key="1"
:size="'25rpx'"
:activeColor="'#00dcee'"
:name="1"
></u-checkbox>
</u-checkbox-group>
<view>
我已阅读并同意用户
<text class="agree-item" @click="openDoc('爱梵达用户服务协议')"
> 服务协议 </text
>
<text class="agree-item" @click="openDoc('隐私政策')"
> 隐私政策 </text
>
<view> 未开通服务站点无法登录 </view>
</view>
</view>
</template>
</LoginLayout>
</template>
<script setup lang="ts">
import { ProfileApi } from "@/services/index";
import LoginLayout from "./components/loginLayout.vue";
import { useMemberStore } from "@/store/index";
import valid from "@/utils/validate";
const handleClear = (item: any) => {
setTimeout(() => {
(model1.userInfo as any)[item.key] = "";
}, 100);
};
const store = useMemberStore();
const loginForm = ref(null);
const model1 = reactive({
userInfo: {
userName: "",
password: "",
},
});
// focus
const currentFocus = ref("");
//
const isShowPwd = ref(false);
// //
const checkGroup = reactive({
rememberCheck: [],
agreeCheck: [],
});
const rules = ref({
"userInfo.userName": {
type: "string",
required: true,
message: "请输入手机号",
trigger: ["blur", "change"],
},
"userInfo.password": {
type: "string",
required: true,
message: "请输入密码",
trigger: ["blur", "change"],
},
});
const handleInput = (e: any, key: string) => {
if (key === "userName") {
const temp = e?.replace(valid.valid_number, "");
setTimeout(() => {
(model1.userInfo as any)[key] = temp;
}, 10);
}
if (key === "password") {
const temp = e?.replace(valid.valid_no_cn, "");
setTimeout(() => {
(model1.userInfo as any)[key] = temp;
}, 10);
}
};
const handleFocus = (attr: string) => {
currentFocus.value = attr;
};
const submit = () => {
if (model1.userInfo.userName) {
if (!valid.mobile.pattern.test(model1.userInfo.userName)) {
uni.showToast({ icon: "none", title: "请输入正确的手机号" });
return;
}
}
if (model1.userInfo.password) {
if (!valid.valid_password.pattern.test(model1.userInfo.password)) {
uni.showToast({
icon: "none",
title: valid.valid_password.message,
});
return;
}
}
(loginForm.value as any).validate().then((res: any) => {
if (res) {
if (checkGroup.agreeCheck.length === 0) {
uni.showToast({
title: "请同意协议",
icon: "none",
});
return;
}
ProfileApi.loginByAccount(model1.userInfo).then((res: any) => {
if (res.code === 200) {
store.setProfile(res.data);
uni.navigateTo({
url: "/pagesHome/index", //
});
}
});
}
});
};
const handleForgetPwd = () => {
uni.navigateTo({
url: "/pagesLogin/login/forgetPwd", //
});
};
const openDoc = (item: string) => {
//
uni.downloadFile({
url: `https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/login/${item}.docx`,
success: function (res) {
setTimeout(
() =>
uni.openDocument({
filePath: res.tempFilePath,
showMenu: false,
success: function () {
console.log("打开文档成功");
},
fail: function () {
uni.showToast({
title: "暂不支持此类型",
duration: 2000,
icon: "none",
});
},
}),
100
);
},
fail: function (res) {
console.log(res); //
},
});
// uni.openDocument({
// filePath: `https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/login/${item}.docx`,
// showMenu: true,
// success: function (res) {
// uni.showToast({ title: "" });
// },
// });
};
</script>
<style lang="scss" scoped>
.custom-icon {
width: 37.18rpx;
height: 18.59rpx;
}
.remember-box {
display: flex;
font-size: 25rpx;
font-family: Source Han Sans CN;
font-weight: 400;
justify-content: space-between;
padding: 10rpx;
color: $u-primary;
align-items: center;
}
.login-btn {
margin-top: 23.72rpx;
}
.agree {
display: flex;
font-size: 21rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #000000;
margin-top: 10rpx;
align-items: flex-start;
text-align: center;
line-height: 41rpx;
margin-top: 26.28rpx;
.agree-item {
color: $u-primary;
}
}
</style>

View File

@ -0,0 +1,241 @@
<template>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="0"
:isLoading="pageList.isLoading"
>
<view class="msg-box" v-if="pageList.list.length > 0">
<view class="u-page">
<u-list :height="'auto'">
<u-list-item v-for="(item, index) in pageList.list" :key="index">
<!-- #ifdef H5 -->
<view class="msg-content">
<view class="u-slot-title" @click="handleItem(item)">
<view>
<view class="u-cell-text title"
>{{ item.title }}
<text class="title-badge" v-if="item.status === 0"> </text>
</view>
<view class="u-cell-text desc">{{ item.content }}</view>
</view>
</view>
<view>
<text class="u-slot-value time">{{ item.createTime }}</text>
</view>
</view>
<!-- #endif -->
<!-- #ifdef APP-PLUS || MP-WEIXIN -->
<u-cell @click="handleItem(item)">
<view slot="title" class="u-slot-title">
<view>
<view class="u-cell-text title"
>{{ item.title }}
<text class="title-badge" v-if="item.status === 0"> </text>
</view>
<view class="u-cell-text desc">{{ item.content }}</view>
</view>
</view>
<template #value>
<text class="u-slot-value time">{{ item.createTime }}</text>
</template>
</u-cell>
<!-- #endif -->
</u-list-item>
</u-list>
</view>
</view>
</page-view>
</template>
<script setup lang="ts">
import PageView from "@/components/PageView/index.vue";
import { MessageApi, ReceiveApi, ShipmentApi } from "@/services";
import { MsgType, ScaleStatus } from "@/utils/enum";
const pageList: PageResult<any> = reactive({
isLoading: false,
noMoreData: false,
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const getList = (v?: boolean) => {
if (v) {
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
pageList.pageNum++;
} else {
pageList.noMoreData = true;
return;
}
}
let params: any = {
pageSize: pageList.pageSize,
pageNum: pageList.pageNum,
};
pageList.isLoading = true;
MessageApi.getUserNoticeInfoVoPage({
...params,
}).then((res: any) => {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = (pageList as any).list = pageList.list.concat(
res.data.list
);
pageList.total = (res.data as any).total;
}
});
};
const handleItem = (item: any) => {
if (item.status === 0) {
MessageApi.readNotice({ ids: [item.id] }).then((res) => {
if (res.code === 200) {
resetPageList();
getList();
}
});
}
if (
MsgType.ToBePriced === item.msgType ||
MsgType.ToBeReview === item.msgType
) {
ReceiveApi.getOrderPage({
pageSize: 10,
pageNumber: 1,
receiptNumber: item.business,
}).then((res) => {
if (res.code === 200) {
if (res.data.list.length === 0) {
uni.showToast({
icon: "none",
title: "该订单已处理",
});
return;
} else {
if (
res.data.list[0].scaleStatus === ScaleStatus.ToBePriced &&
MsgType.ToBePriced === item.msgType
) {
uni.navigateTo({
url: "/pagesReceive/pricing?scaleStatus=0", //
});
} else if (
res.data.list[0].scaleStatus === ScaleStatus.ToBeReview &&
MsgType.ToBeReview === item.msgType
) {
uni.navigateTo({
url: "/pagesReceive/payReview?scaleStatus=2", //
});
} else {
uni.showToast({
icon: "none",
title: "该订单已处理",
});
return;
}
}
}
});
} else if (
MsgType.ToBeShipment === item.msgType ||
MsgType.ToBeShipmentReview === item.msgType
) {
ShipmentApi.getOrderPage({
pageSize: 10,
pageNumber: 1,
orderNumber: item.business,
}).then((res) => {
if (res.code === 200) {
if (res.data.list.length === 0) {
uni.showToast({
title: "该订单已处理",
});
return;
} else {
if (
res.data.list[0].scaleStatus === ScaleStatus.ToBeShipment &&
MsgType.ToBeShipment === item.msgType
) {
uni.navigateTo({
url: "/pagesShipment/shipmenting?scaleStatus=0", //
});
} else if (
res.data.list[0].scaleStatus === ScaleStatus.ToBeShipmentReview &&
MsgType.ToBeShipmentReview === item.msgType
) {
uni.navigateTo({
url: "/pagesShipment/shipmentSettlement?scaleStatus=2", //
});
} else {
uni.showToast({
title: "该订单已处理",
});
return;
}
}
}
});
}
};
onMounted(() => {
getList();
});
</script>
<style lang="scss">
.msg-box {
// background: #f8f8f8;
width: 100%;
.title {
font-size: 28rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #000000;
position: relative;
width: fit-content;
.title-badge {
position: absolute;
right: -6px;
top: 0px;
width: 17rpx;
height: 17rpx;
background: #ec0f3e;
border-radius: 50%;
display: inline-block;
}
}
.desc {
font-size: 24rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #999999;
margin-top: 12.18rpx;
}
.time {
font-size: 24rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #999999;
}
// h5
.msg-content {
padding: 30rpx;
border-bottom: 1px solid rgba(0,0,0, 0.2);
}
}
</style>

View File

@ -0,0 +1,36 @@
<template>
<view class="baseinfo">
<view class="box">
<view> 用户名 {{ profile.userName }} </view>
<view> 手机号码 {{ profile.phone }} </view>
</view>
</view>
</template>
<script setup lang="ts">
import { useMemberStore } from '@/store/index'
const store = useMemberStore()
const profile = store.profile.userInfo
</script>
<style lang="scss">
.baseinfo {
background: #f8f8f8;
height: 100vh;
padding: 26.28rpx 25.64rpx;
.box {
padding: 0rpx 18.59rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
font-size: 27rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #000000;
> view {
line-height: 80rpx;
}
view+view {
border-top: 1px solid #E9E9E9;
}
}
}
</style>

View File

@ -0,0 +1,150 @@
<template>
<view class="profile">
<view>
<image class="bg" :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/profile/bg.png`" />
</view>
<view class="baseinfo">
<view class="head">
<image :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/profile/user.png`" class="user"></image>
<view>
<view>
<text class="name">{{ profile.userName || "-" }}</text>
</view>
<view>
<text class="company">{{ profile.factory_name || "-" }}</text>
</view>
</view>
</view>
<view class="content">
<u-list :height="'130px'">
<u-list-item v-for="(item, index) in list" :key="index">
<u-cell
:title="item.name"
arrow-direction="right"
isLink
:url="item.path"
:border="false"
@click="hanldeClick(item)"
>
<template #icon>
<view style="width: 40rpx">
<image :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/profile/${item.icon}`" />
</view>
</template>
</u-cell>
</u-list-item>
</u-list>
</view>
</view>
</view>
<TabBar></TabBar>
<SmallModal
:title="'确认退出吗?'"
:content="'退出后将返回至登陆页'"
:okText="'确认退出'"
:isMain="true"
:show="isShowCancelModal"
@handleModal="(v:boolean) => {handleModal(v)}"
@handleOk="handleOk()"
/>
</template>
<script setup lang="ts">
import { ProfileApi } from "@/services/index";
import { reactive } from "vue";
import { useMemberStore } from "@/store/index";
import TabBar from '@/components/TabBar/index.vue'
import SmallModal from "@/components/Modal/smallModal.vue";
const isShowCancelModal = ref(false);
const handleModal = (v: boolean) => {
isShowCancelModal.value = v;
};
const handleOk = () => {
ProfileApi.logOut().then((res: any) => {
if (res.code === 200) {
uni.reLaunch({
url: "/pagesLogin/login/index", //
});
}
});
};
const store = useMemberStore();
const profile = store.profile.userInfo;
const list = reactive([
{
name: "基本信息",
icon: "baseinfo.png",
path: "/pagesLogin/profile/baseinfo",
},
{
name: "修改密码",
icon: "modifyPwd.png",
path: "/pagesLogin/profile/modifyPwd",
},
{
name: "退出登录",
icon: "logout.png",
path: "",
},
]);
const hanldeClick = (item: any) => {
if (item.name === "退出登录") {
handleModal(true)
}
};
</script>
<style lang="scss">
.profile {
.bg {
width: 100%;
position: absolute;
top: -60rpx;
z-index: -1;
}
.baseinfo {
padding: 25.64rpx;
.head {
display: flex;
align-items: center;
margin-left: 41rpx;
.user {
width: 110.9rpx;
height: 110.9rpx;
margin-right: 20.51rpx;
}
.name {
font-size: 27rpx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #000000;
}
.company {
font-size: 21rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #000000;
}
}
.content {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 28.21rpx 21.15rpx;
margin-top: 24.36rpx;
image:nth-child(1) {
width: 28.85rpx;
height: 24.36rpx;
}
image:nth-child(2) {
width: 25rpx;
height: 32.69rpx;
}
image:nth-child(3) {
width: 30.13rpx;
height: 30.13rpx;
}
}
}
}
</style>

View File

@ -0,0 +1,226 @@
<template>
<view class="baseinfo">
<view class="box">
<u-form
labelPosition="left"
:model="model1"
:rules="rules"
ref="form"
:labelWidth="0"
:errorType="'border-bottom'"
>
<u-form-item
v-for="(item, index) in formAttrList"
:key="index"
:prop="`userInfo.${item.key}`"
>
<up-input
v-model="(model1.userInfo as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
clearable
:customStyle="{}"
:border="index === 2 ? 'none' : 'bottom'"
:value="(model1.userInfo as any)[item.key]"
:password="!item.isShowPwd"
@change="(e:any) => {handleInput(e, item.key)}"
@clear="handleClear(item)"
>
<template #suffix>
<image
v-if="!item.isShowPwd"
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/login/hide.png`"
class="custom-icon"
@click="item.isShowPwd = true"
></image>
<image
v-else
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/login/show.png`"
class="custom-icon"
@click="item.isShowPwd = false"
></image>
</template>
</up-input>
</u-form-item>
</u-form>
</view>
<view class="save-btn">
<u-button
@click="submit"
type="primary"
:customStyle="{
'border-radius': '43rpx',
}"
>保存</u-button
>
</view>
</view>
</template>
<script setup lang="ts">
import { ProfileApi } from "@/services";
import valid from "@/utils/validate";
const handleInput = (e: any, key: string) => {
const temp = e?.replace(valid.valid_no_cn, "");
setTimeout(() => {
(model1.userInfo as any)[key] = temp;
}, 10);
};
const handleClear = (item:any) => {
(model1.userInfo as any)[item.key] = '';
}
//
const formAttrList = ref([
{
name: "当前密码",
key: "password",
type: "password",
required: true,
isShowPwd: false,
},
{
name: "新密码",
key: "newPassword",
type: "password",
required: true,
isShowPwd: false,
},
{
name: "确认密码",
key: "passwordConfirm",
type: "password",
required: true,
isShowPwd: false,
},
]);
const model1 = <any>reactive({
userInfo: {
password: "",
},
});
const rules = ref({
"userInfo.password": {
type: "string",
required: true,
message: "请输入当前密码",
trigger: ["blur", "change"],
},
"userInfo.newPassword": {
type: "string",
required: true,
message: "请输入新密码",
trigger: ["blur", "change"],
},
"userInfo.passwordConfirm": {
type: "string",
required: true,
message: "请输入确认密码",
trigger: ["blur", "change"],
},
});
const form = ref();
const check = () => {
return new Promise((resolve) => {
form.value
.validate()
.then((res: boolean) => {
resolve(res);
})
.catch((errors: any) => {
resolve(false);
uni.showToast({
icon: "none",
title: errors[0].message || "校验失败",
});
});
});
};
const startSave = () => {
console.log(model1.userInfo);
ProfileApi.updateUserPwd({ ...model1.userInfo }).then((res) => {
if (res.code === 200) {
uni.showToast({ icon: "none", title: "密码修改成功" });
model1.userInfo = {};
setTimeout(() => {
ProfileApi.logOut().then((res: any) => {
if (res.code === 200) {
uni.reLaunch({
url: "/pagesLogin/login/index", //
});
}
});
}, 10);
}
});
};
const submit = () => {
if (model1.userInfo.newPassword || model1.userInfo.passwordConfirm) {
if (
!valid.valid_password.pattern.test(model1.userInfo.newPassword) ||
!valid.valid_password.pattern.test(model1.userInfo.passwordConfirm)
) {
uni.showToast({
icon: "none",
title: valid.valid_password.message,
});
return;
}
}
if (model1.userInfo.password === model1.userInfo.newPassword) {
uni.showToast({ icon: "none", title: "新密码不能和旧密码相同" });
return;
}
if (model1.userInfo.newPassword !== model1.userInfo.passwordConfirm) {
uni.showToast({ icon: "none", title: "新密码必须和确认密码相同" });
return;
}
check().then((res) => {
if (res) {
startSave();
}
});
};
</script>
<style lang="scss">
.custom-icon {
width: 37.18rpx;
height: 18.59rpx;
}
.baseinfo {
background: #f8f8f8;
height: 100vh;
padding: 26.28rpx 25.64rpx;
.box {
padding: 18.59rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
font-size: 27rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #000000;
::v-deep .u-border-bottom {
border-color: rgb(233 233 233 / 0.76) !important;
}
::v-deep .u-form-item__body__right__message {
height: 0px;
display: none;
}
::v-deep .u-form-item {
height: 45px;
}
}
.save-btn {
margin-top: 150px;
button {
width: 80%;
}
}
}
</style>

49
src/services/customer.ts Normal file
View File

@ -0,0 +1,49 @@
import { http } from '@/utils/http'
// 添加客户
export const addCustomUser = (data: any) => {
return http({
method: 'POST',
url: '/api/custom/user/addCustomUser',
data,
})
}
// 修改客户
export const updateCustomUser = (data: any) => {
return http({
method: 'POST',
url: '/api/custom/user/updateCustomUser',
data,
})
}
// 查询客户分页
export const getCustomUserPage = (data: any) => {
return http({
method: 'GET',
url: '/api/custom/user/getCustomUserPage',
data,
})
}
// 查询客户列表
export const getCustomUserList = (data: any) => {
return http({
method: 'GET',
url: '/api/custom/user/getCustomUserList',
data,
})
}
// 客户字母分组
export const getCustomUserListLettera = (data: any) => {
return http({
method: 'GET',
url: '/api/custom/user/getCustomUserListLettera',
data,
})
}

46
src/services/device.ts Normal file
View File

@ -0,0 +1,46 @@
import { http } from '@/utils/http'
// 设备信息新增
export const addDevice = (data: any) => {
return http({
method: 'POST',
url: '/api/device/addDevice',
data,
})
}
// 设备信息修改
export const editDevice = (data: any) => {
return http({
method: 'POST',
url: '/api/device/edit',
data,
})
}
// 设备信息逻辑删除
export const deleteDevice = (data: any) => {
return http({
method: 'POST',
url: '/api/device/deleteDevice',
data,
})
}
// 设备信息根据id查询
export const selectDeviceId = (data: any) => {
return http({
method: 'POST',
url: '/api/device/selectDeviceId',
data,
})
}
// 设备信息根据id查询
export const getDeviceList = (data: any) => {
return http({
method: 'POST',
url: '/api/device/getDeviceList',
data,
})
}

88
src/services/finance.ts Normal file
View File

@ -0,0 +1,88 @@
import { http } from '@/utils/http'
// 经营概况-支付明细
export const getPaymentCount = (data: any) => {
return http({
method: 'GET',
url: '/api/paymentdtails/getPaymentCount',
data,
})
}
// 经营概况-收入明细
export const getRevenueCount = (data: any) => {
return http({
method: 'GET',
url: '/api/revenuedetails/getRevenueCount',
data,
})
}
// 支付明细新增
export const addPaymentDetails = (data: any) => {
return http({
method: 'POST',
url: '/api/paymentdtails/addPaymentDetails',
data,
})
}
// 删除
export const deletePaymentDs = (data: any) => {
return http({
method: 'POST',
url: '/api/paymentdtails/deletePaymentDs',
data,
})
}
// 分页查询支付明细
export const getPaymentDetailsPage = (data: any) => {
return http({
method: 'GET',
url: '/api/paymentdtails/getPaymentDetailsPage',
data,
})
}
// 支付明细-查看详情
export const getByPaymentId = (data: any) => {
return http({
method: 'GET',
url: '/api/paymentdtails/getByPaymentId',
data,
})
}
// 收货明细分页查询
export const getRevenueDetailsPage = (data: any) => {
return http({
method: 'GET',
url: '/api/revenuedetails/getRevenueDetailsPage',
data,
})
}
// 收入明细查看详情
export const getRevenueDetailsById = (data: any) => {
return http({
method: 'GET',
url: '/api/revenuedetails/getRevenueDetailsById',
data,
})
}
// 收入明细新增
export const addIncome = (data: any) => {
return http({
method: 'POST',
url: '/api/revenuedetails/addRevenueDes',
data,
})
}
// 收入明细逻辑删除
export const deleteRevenueDes = (data: any) => {
return http({
method: 'POST',
url: '/api/revenuedetails/deleteRevenueDes',
data,
})
}

222
src/services/goods.ts Normal file
View File

@ -0,0 +1,222 @@
import { http } from '@/utils/http'
// 收货分类新增
export const addReCategory = (data: any) => {
return http({
method: 'POST',
url: '/api/recategory/addReCategory',
data,
})
}
// 收货分类逻辑删除
export const deleteReceiveCategory = (data: any) => {
return http({
method: 'POST',
url: '/api/recategory/deleteCategory',
data,
})
}
// 收货根据分类id查询
export const selectReCyById = (data: any) => {
return http({
method: 'GET',
url: '/api/recategory/selectReCyById',
data,
})
}
//收货分类分页查询
export const getPage = (data: any) => {
return http({
method: 'GET',
url: '/api/recategory/getPage',
data,
})
}
// 收货分类查询所有
export const allReCategory = () => {
return http({
method: 'GET',
url: '/api/recategory/allReCategory',
})
}
// 收货分类修改信息
export const editReceiveCategory = (data: any) => {
return http({
method: 'POST',
url: '/api/recategory/edit',
data,
})
}
// 收货产品新增
export const addReProducts = (data: any) => {
return http({
method: 'POST',
url: '/api/reproducts/addReProducts',
data,
})
}
// 收货产品编辑
export const EditReceiveProduct = (data: any) => {
return http({
method: 'POST',
url: '/api/reproducts/edit',
data,
})
}
// 收货产品逻辑删除
export const deleteReceiveProduct = (data: any) => {
return http({
method: 'POST',
url: '/api/reproducts/deleteCategory',
data,
})
}
// 收货产品根据产品id查询
export const getReceiveProductById = (data: any) => {
return http({
method: 'POST',
url: '/api/reproducts/selectReCyById',
data,
})
}
// 收货产品分页查询
export const getReceiveProductListByPage = (data: any) => {
return http({
method: 'GET',
url: '/api/reproducts/getPage',
data,
})
}
// 收货产品查询所有
export const getReceiveProductList = () => {
return http({
method: 'GET',
url: '/api/reproducts/allReProducts',
})
}
// 出货分类新增
export const addShmCategory = (data: any) => {
return http({
method: 'POST',
url: '/api/shmcategory/addShmCategory',
data,
})
}
// 出货分类树显示
export const getShipmentCategory = () => {
return http({
method: 'GET',
url: '/api/shmcategory/getChinaList',
})
}
// 出货分类根据id查询
export const getShipmentCategoryById = (data: any) => {
return http({
method: 'GET',
url: '/api/shmcategory/selectShCyById',
data,
})
}
// 出货分类根据id逻辑删除
export const deleteById = (data: any) => {
return http({
method: 'POST',
url: '/api/shmcategory/deleteShmCategory',
data,
})
}
// 出货分类根据id编辑
export const editShipmentCategory = (data: any) => {
return http({
method: 'POST',
url: '/api/shmcategory/edit',
data,
})
}
// 出货产品根据id查询
export const getShipmentProductById = (data: any) => {
return http({
method: 'POST',
url: '/api/shmproducts/selectRePsById',
data,
})
}
// 出货产品新增
export const addShipmentProduct = (data: any) => {
return http({
method: 'POST',
url: '/api/shmproducts/addShmProducts',
data,
})
}
// 出货产品编辑
export const editShipmentProduct = (data: any) => {
return http({
method: 'POST',
url: '/api/shmproducts/edit',
data,
})
}
// 出货产品分页查询
export const getShipmentProductByPage = (data: any) => {
return http({
method: 'GET',
url: '/api/shmproducts/getPage',
data,
})
}
// 出货产品查询所有
export const getShipmentProductList = () => {
return http({
method: 'GET',
url: '/api/shmproducts/allShmProducts',
})
}
// 出货产品删除
export const deleteShmProducts = (data: any) => {
return http({
method: 'POST',
url: '/api/shmproducts/deleteShmProducts',
data,
})
}
// 出货产品分类树
export const getChildrenList = () => {
return http({
method: 'GET',
url: '/api/shmcategory/getChildrenList',
})
}
// 出货父类分类查询
export const allShmCategory = () => {
return http({
method: 'GET',
url: '/api/shmcategory/allShmCategory',
})
}

13
src/services/index.ts Normal file
View File

@ -0,0 +1,13 @@
export * as ProfileApi from './profile'
export * as ReceiveApi from './receive'
export * as ShipmentApi from './shipment'
export * as PictureApi from './picture'
export * as ReceiveProductApi from './receiveProduct'
export * as DeviceApi from './device'
export * as StockCardApi from './stockCard'
export * as GoodsApi from './goods'
export * as SupplierApi from './supplier'
export * as CustomerApi from './customer'
export * as FinanceApi from './finance'
export * as MessageApi from './message'

25
src/services/message.ts Normal file
View File

@ -0,0 +1,25 @@
import { http } from '@/utils/http'
// 消息列表
export const getUserNoticeInfoVoPage = (data: any) => {
return http({
method: 'GET',
url: '/api/notice/getUserNoticeInfoVoPage',
data,
})
}
// 批量已读消息
export const readNotice = (data: any) => {
return http({
method: 'POST',
url: '/api/notice/readNotice',
data,
})
}
// 查询消息数量
export const getUserNoticeInfoNumVo = () => {
return http({
method: 'GET',
url: '/api/notice/getUserNoticeInfoNumVo',
})
}

60
src/services/picture.ts Normal file
View File

@ -0,0 +1,60 @@
import type { ImagesType } from "@/utils/enum";
import { http } from "@/utils/http";
// 资源存储接口
export const addAnnex = (data: any) => {
return http({
method: "POST",
url: "/api/annex/addAnnex",
data,
});
};
// 获取图片资源
export const getAnnex = (data: {businessId: string, orderType: number, imagesType: ImagesType | any}) => {
return http<Resource>({
method: "GET",
url: "/api/annex/getAnnex",
data
});
};
// 批量存储资源
export const addListAnnex = (data: any) => {
return http({
method: "POST",
url: "/api/annex/addListAnnex",
data,
});
};
// 多个上传
export const uploadList = (data: any) => {
return http({
method: "POST",
header: {type: 'UPLOAD'},
url: "/api/file/uploadList",
data,
});
};
// 单个上传
export const upload = (data: any) => {
return http({
method: "POST",
header: {type: 'UPLOAD'},
url: "/api/file/upload",
data,
});
};
// 删除图片
export const deleteById = (data: any) => {
return http({
method: "POST",
url: "/api/annex/delete",
data,
});
};

252
src/services/profile.ts Normal file
View File

@ -0,0 +1,252 @@
// 存放路径: src/services/home.ts
import type { User } from "@/types/user";
import { http } from "@/utils/http";
// 登陆
export const loginByAccount = (data: {
userName: string;
password: string;
}) => {
return http({
method: "POST",
url: "/api/user/login",
data,
});
};
// 登陆
export const logOut = () => {
return http({
method: "POST",
url: "/api/user/logOut",
});
};
// 验证码登录
export const loginPhone = (data: { phone: string; code: string }) => {
return http({
method: "GET",
url: "/api/user/loginPhone",
data,
});
};
// 发送验证码
export const sendMsg = (data: { phone: string }) => {
return http({
method: "GET",
url: "/api/user/sendMsg",
data,
});
};
// 修改密码
export const updateUserPwd = (data: any) => {
return http({
method: "POST",
url: "/api/user/updateUserPwd",
data,
});
};
// 创建角色
export const addRole = (data: { roleCode: string; roleName: string }) => {
return http({
method: "POST",
url: "/api/role/addRole",
data,
});
};
// 修改角色
export const updateRole = (data: {
id?: string;
roleCode?: string;
roleName?: string;
isDeleted?: boolean;
}) => {
return http({
method: "POST",
url: "/api/role/updateRole",
data,
});
};
// 查询角色列表
export const getRoleList = (data: any) => {
return http({
method: "GET",
url: "/api/role/getRoleList",
data,
});
};
// 验证角色是否重复 1=code 2=名称 3=全部
export const verifyRole = (data: {
roleCode: string;
roleName: string;
type: string;
}) => {
return http({
method: "GET",
url: "/api/role/verifyRole",
data,
});
};
// 添加角色菜单权限
export const addMenusRole = (data: {
id: number;
list: {
menusId: number;
state: number; // 状态1=开启0=关闭
}[];
}) => {
return http({
method: "POST",
url: "/api/role/addMenusRole",
data,
});
};
// 查询角色菜单权限
export const getMenusRole = (data: any) => {
return http<[]>({
method: "GET",
url: "/api/role/getMenusRole",
data,
});
};
// 查询分页菜单
export const getMenuByPage = (data: any) => {
return http({
method: "GET",
url: "/api/menus/getPage",
data,
});
};
// 创建菜单
export const addMenus = (data: any) => {
return http({
method: "POST",
url: "/api/menus/addMenus",
data,
});
};
// 查询菜单List
export const getMenuList = (data: any) => {
return http({
method: "GET",
url: "/api/menus/getList",
data,
});
};
// 修改菜单
export const updateMenus = (data: any) => {
return http({
method: "POST",
url: "/api/menus/updateMenus",
data,
});
};
// 查询省市区
export const getProvinceList = (data: any) => {
return http({
method: "GET",
url: "/api/user/getChinaList",
data,
});
};
// 添加用户
export const addUser = (data: any) => {
return http({
method: "POST",
url: "/api/user/addUser",
data,
});
};
// 查询用户分页
export const getUserListByPage = (data: any) => {
return http<User>({
method: "GET",
url: "/api/user/getUserPage",
data,
});
};
// 获取用户信息
export const getUserInfo = () => {
return http({
method: "GET",
url: "/api/user/getUserInfo",
});
};
// 添加用户角色关系
export const addUserRole = (data: any) => {
return http({
method: "POST",
url: "/api/user/addUserRole",
data,
});
};
// 查询用户列表
export const getUserList = (data: {
name?: string;
userType?: number; // 1= 工作人员 2=采购商
}) => {
return http({
method: "GET",
url: "/api/user/getUserList",
data,
});
};
// 供应商 客户分页
export const getInventoryUserPage = (data: any) => {
return http<User>({
method: "GET",
url: "/api/user/getInventoryUserPage",
data,
});
};
// 用户下线
export const updateUserByIdOffline = (data: any) => {
return http<User>({
method: "POST",
url: "/api/user/updateUserByIdOffline",
data,
});
};
// 用户编辑
export const updateUserById = (data: any) => {
return http<User>({
method: "POST",
url: "/api/user/updateUserById",
data,
});
};
// 发送验证码(通用)
export const sendCommonMsg = (data: any) => {
return http<User>({
method: "GET",
url: "/api/user/sendCommonMsg",
data,
});
};
// 忘记密码
export const forgetPwd = (data: any) => {
return http<User>({
method: "POST",
url: "/api/user/forgetPwd",
data,
});
};

142
src/services/receive.ts Normal file
View File

@ -0,0 +1,142 @@
// 存放路径: src/services/home.ts
import type { Result } from '@/types/global'
import { http } from "@/utils/http";
// 收库单分页查询
export const getOrderPage = (data: PageParams) => {
return http<OrderPage<Order>>({
method: "GET",
url: "/api/orderIn/getOrderPage",
data,
});
};
// 获取收货单集合
export const getList = () => {
return http<Result>({
method: "GET",
url: "/api/orderIn/getList"
});
};
//根据id获取收货单详情
export const getDetailById = (data: {id: number}) => {
return http<Order>({
method: "GET",
url: "/api/orderIn/getOne",
data
});
};
// 新增收货单
export const addOrderIn = (data: Order) => {
return http({
method: "POST",
url: "/api/orderIn/addOrderIn",
data,
});
};
// 批量修改收货单
export const updateOrderIn = (data: any) => {
return http<Result>({
method: "POST",
url: "/api/orderIn/updateOrderIn",
data,
});
};
// 用于过皮和零皮重
export const getTare = (data: any) => {
return http<Result>({
method: "POST",
url: "/api/orderIn/getTare",
data,
});
};
// 用于单个或批量作废收货单
export const deleteOrder = (data: any) => {
return http<Result>({
method: "POST",
url: "/api/orderIn/delete",
data,
});
};
// 统计首页的本月总收获以及总支出
// 收货类型
export const countOrderByMonth = () => {
return http<ReceiveSummary>({
method: "GET",
url: "/api/orderIn/countOrderByMonth"
});
};
// 更新定价详情
export const updateOne = (data: any) => {
return http<Result>({
method: "POST",
url: "/api/orderIn/updateOne",
data,
});
};
// 收货汇总
export const OrderInReceipt = (data:any) => {
return http<ReceiveSummaryCount>({
method: "GET",
url: "/api/orderIn/OrderInReceipt",
data
});
};
// 收货单排行榜
export const OrderInRanking = (data: any) => {
return http({
method: "GET",
url: "/api/orderIn/OrderInRanking",
data
});
};
// 重新过皮
export const reTare = (data: any) => {
return http({
method: "POST",
url: "/api/orderIn/skinning",
data,
});
};
// 收货单概况
export const getOverview = (data: any) => {
return http({
method: "GET",
url: "/api/orderIn/getOverview",
data
});
};
// 供应商对账
export const getReconciliation = (data: any) => {
return http({
method: "GET",
url: "/api/orderIn/getReconciliation",
data
});
};
// 概况总应收应付
export const getTotal = () => {
return http({
method: "GET",
url: "/api/orderIn/getTotal"
});
};

View File

@ -0,0 +1,20 @@
import { http } from "@/utils/http";
// 收货产品分页列表
export const getReceiveProduct = () => {
return http({
method: "GET",
url: "/api/reproducts/getPage"
});
};
// 查询收货产品列表All
export const getAllReProducts = () => {
return http<ReceiveProduct>({
method: "GET",
url: "/api/reproducts/allReProducts"
});
};

128
src/services/shipment.ts Normal file
View File

@ -0,0 +1,128 @@
import { http } from '@/utils/http'
type ShipmentSummary = {
totalShipment: number, // 总出货
totalIncome: number, // 出货总收入
toBeShipped: number, // 待出货
roughWeight: number, // 待过毛重
shipmentReview: number, // 出货结算
toBeSettled: number, // 待结算
}
// 根据id查询出货单
export const getDetailById = (data: {id: string}) => {
return http<Shipment>({
method: "GET",
url: "/api/orderOut/getOne",
data
});
};
// 根据条件查询出库单下拉列表
export const getList = () => {
return http<Shipment>({
method: "GET",
url: "/api/orderOut/getList"
});
};
type PageParams = {
userId?: number; // 供应商id
productId?: string; // 产品id
cardId?: number;
deviceId?:number;
scaleStatus?: number; // 磅单状态0待出货1:待过毛2待审核3已审未付4已审已付
flag?: boolean; // true 皮重 false 毛重
pageNumber: number;
pageSize: number;
startTime?: string; // 开始时间
endTime?: string; // 结束时间
isDeleted?: boolean;
userName?: string;
orderNumber?: string;
};
// 根据条件获取出库单,并且进行分页
export const getOrderPage = (data: PageParams) => {
return http<OrderPage<Shipment>>({
method: "GET",
url: "/api/orderOut/getOrderPage",
data
});
};
// 统计首页的本月收入以及待出库
export const countOrderByMonth = () => {
return http<ShipmentSummary>({
method: "GET",
url: "/api/orderOut/countOrderByMonth"
});
};
// 出库分类统计
export const getOrderInReceipt = (data: any) => {
return http<ShipmentSummaryCount>({
method: "GET",
url: "/api/orderOut/OrderInReceipt",
data
});
};
// 出货单排行榜
export const getOrderInRanking = (data:any) => {
return http<Shipment>({
method: "GET",
url: "/api/orderOut/OrderInRanking",
data
});
};
// 单个或则批量作废
export const deleteOrder = (data: any) => {
return http<Shipment>({
method: "POST",
url: "/api/orderOut/delete",
data,
});
};
// 新增出货单
export const addOrderOut = (data: any) => {
return http<Shipment>({
method: "POST",
url: "/api/orderOut/addOrderOut",
data,
});
};
// 批量修改出货单
export const updateOrderIn = (data: any) => {
return http<Shipment>({
method: "POST",
url: "/api/orderOut/updateOrderIn",
data,
});
};
// 重新过毛
export const reGrossWeight = (data: any) => {
return http({
method: "POST",
url: "/api/orderOut/hairdressing",
data,
});
};
// 收货单概况
export const getOverview = (data: any) => {
return http({
method: "GET",
url: "/api/orderOut/getOverview",
data
});
};
// 供应商对账
export const getReconciliation = (data: any) => {
return http({
method: "GET",
url: "/api/orderOut/getReconciliation",
data
});
};

35
src/services/stockCard.ts Normal file
View File

@ -0,0 +1,35 @@
import { http } from '@/utils/http'
// 库存卡查询分页
export const getStockCardList = (data: any) => {
return http({
method: 'GET',
url: '/api/card/getStockCardList',
data,
})
}
// 添加库存卡
export const addStockCard = (data: any) => {
return http({
method: 'POST',
url: '/api/card/addStockCard',
data,
})
}
// 修改库存卡
export const updateStockCard = (data: any) => {
return http({
method: 'POST',
url: '/api/card/updateStockCard',
data,
})
}
// 查询供应商/客户库存卡列表
export const getStockCardListInfo = (data: any) => {
return http({
method: 'GET',
url: '/api/card/getStockCardListInfo',
data,
})
}

80
src/services/supplier.ts Normal file
View File

@ -0,0 +1,80 @@
import { http } from '@/utils/http'
// 供应商分类
export const addSupplierType = (data: any) => {
return http({
method: 'POST',
url: '/api/supplier/type/addSupplierType',
data,
})
}
// 供应商分类修改
export const updateSupplierType = (data: any) => {
return http({
method: 'POST',
url: '/api/supplier/type/updateSupplierType',
data,
})
}
// 查询供应商分类分页
export const getSupplierTypePage = (data: any) => {
return http({
method: 'GET',
url: '/api/supplier/type/getSupplierTypePage',
data,
})
}
// 查询供应商分类列表
export const getSupplierTypeList = () => {
return http({
method: 'GET',
url: '/api/supplier/type/getSupplierTypeList',
})
}
// 查询供应商分类列表
export const addSupplierUser = (data: any) => {
return http({
method: 'POST',
url: '/api/supplier/user/addSupplierUser',
data,
})
}
// 修改供应商
export const updateSupplierUser = (data: any) => {
return http({
method: 'POST',
url: '/api/supplier/user/updateSupplierUser',
data,
})
}
//查询供应商分页
export const getSupplierUserPage = (data: any) => {
return http({
method: 'GET',
url: '/api/supplier/user/getSupplierUserPage',
data,
})
}
//查询供应商列表
export const getSupplierUserList = (data: any) => {
return http({
method: 'GET',
url: '/api/supplier/user/getSupplierUserList',
data,
})
}
export const getSupplierUserListLettera = (data: any) => {
return http({
method: 'GET',
url: '/api/supplier/user/getSupplierUserListLettera',
data
})
}

6
src/shime-uni.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
export {}
declare module "vue" {
type Hooks = App.AppInstance & Page.PageInstance;
interface ComponentCustomOptions extends Hooks {}
}

View File

@ -0,0 +1,40 @@
body {
}
.c-layout {
padding: 30rpx 25rpx;
}
.uni-toast {
width: 200px;
}
.u-form-item {
height: 70px;
}
.u-input {
padding: 6px 12px !important;
}
.input-placeholder {
font-size: 14px;
}
.c-text-center {
text-align: center;
}
.f-s-12 {
font-size: 12px;
}
.f-s-15 {
font-size: 15px;
}
.l-h-28 {
line-height: 28px;
}
.ml-20 {
margin-left: 20rpx;
}
.mt-30 {
margin-top: 30rpx;
}
.u-action-sheet > view:nth-child(2) {
max-height: 600rpx;
overflow-y: auto;
}

View File

@ -0,0 +1,44 @@
// 此文件为uView的主题变量这些变量目前只能通过uni.scss引入才有效另外由于
// uni.scss中引入的样式会同时混入到全局样式文件和单独每一个页面的样式中造成微信程序包太大
// 故uni.scss只建议放scss变量名相关样式其他的样式可以通过main.js或者App.vue引入
$u-main-color: #303133;
$u-content-color: #606266;
$u-tips-color: #909193;
$u-light-color: #c0c4cc;
$u-border-color: #dadbde;
$u-bg-color: #f3f4f6;
$u-disabled-color: #c8c9cc;
$u-primary: #00D2E3;
$u-primary-dark: #398ade;
$u-primary-disabled: #9acafc;
$u-primary-light: #ecf5ff;
$u-warning: #f9ae3d;
$u-warning-dark: #f1a532;
$u-warning-disabled: #f9d39b;
$u-warning-light: #fdf6ec;
$u-success: #5ac725;
$u-success-dark: #53c21d;
$u-success-disabled: #a9e08f;
$u-success-light: #f5fff0;
$u-error: #f56c6c;
$u-error-dark: #e45656;
$u-error-disabled: #f7b2b2;
$u-error-light: #fef0f0;
$u-info: #909399;
$u-info-dark: #767a82;
$u-info-disabled: #c4c6c9;
$u-info-light: #f4f4f5;
// scss混入为了少写几行#ifndef
@mixin flex($direction: row) {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: $direction;
}

22
src/store/counter.ts Normal file
View File

@ -0,0 +1,22 @@
import { defineStore } from 'pinia'
export const useStore = defineStore('counter', {
state: () => {
return {
someState: '你好 pinia',
}
},
// persist: true,
// 配置持久化
persist: {
// 调整为兼容多端的API
storage: {
setItem(key, value) {
uni.setStorageSync(key, value)
},
getItem(key) {
return uni.getStorageSync(key)
},
},
}
})

9
src/store/index.ts Normal file
View File

@ -0,0 +1,9 @@
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
// 创建pinia实例imp
const pinia = createPinia()
// 导出pinia实例给main使用
pinia.use(piniaPluginPersistedstate)
export default pinia
export * from './modules/member'

View File

@ -0,0 +1,12 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useAddressStore = defineStore('address', () => {
const selectedAddress = ref()
const changeSelectedAddress = (val:any) => {
selectedAddress.value = val
}
return { selectedAddress, changeSelectedAddress }
})

View File

@ -0,0 +1,52 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import _ from "underscore";
import type { LoginResult } from "@/types/user";
// 定义 Store
export const useMemberStore = defineStore(
"member",
() => {
// 会员信息
const profile = ref<LoginResult>({
token: '',
userInfo: {
userName: "",
factoryName: "",
},
menusList:[],
menusNameList: []
});
// 保存会员信息,登录时使用
const setProfile = (val: any) => {
profile.value = val;
profile.value.menusNameList = _.pluck(val.menusList, "name");
};
// 清理会员信息,退出时使用
const clearProfile = () => {
// profile.value = undefined
};
// 记得 return
return {
profile,
setProfile,
clearProfile,
};
},
{
// 配置持久化
persist: {
// 调整为兼容多端的API
storage: {
setItem(key, value) {
uni.setStorageSync(key, value);
},
getItem(key) {
return uni.getStorageSync(key);
},
},
},
}
);

10
src/types/baseInfo.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
type SupplierType = {
id: number,
name: string
}
type Supplier = {
id: number,
name: string,
cardCode: string,
}

10
src/types/components.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
import NavBar from '@/components/NavBar/NavBar.vue'
import NavBarLayout from '@/components/NavBar/NavBarLayout.vue'
declare module '@vue/runtime-core' {
export interface GlobalComponents {
NavBar: typeof NavBar;
NavBarLayout: typeof NavBarLayout
}
}
// 定义组件实例类型 一般用于获取子节点的对象 (父调子

34
src/types/global.d.ts vendored Normal file
View File

@ -0,0 +1,34 @@
declare var wx: any;
declare var $_: any;
export type PageResult<T> = {
items: T[],
counts: number,
page: number,
pages: number,
pageSize: number
}
export type PageParams = {
page?: number,
pageSize?: number
}
export type Result = {
code: number,
data: T,
message: string,
time: string
}
export type ComType = {[attrName: string]: any }
export type BaseField = {
updateTime: string;
createTime: string;
createUserId: number;
createUserName: string;
updateUserId: number;
updateUserName: string;
isDeleted: boolean;
}

5
src/types/home.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
export type BannerItem = {
imgUrl: string,
id: number,
herfUrl: string
}

215
src/types/order.d.ts vendored Normal file
View File

@ -0,0 +1,215 @@
interface PageResult<T> {
isLoading?: boolean
noMoreData?: boolean,
total: number;
list: T[];
pageNum: number;
pageSize: number;
}
interface Order {
id?: number;
deviceId?: number; //设备id
deviceName?: string; // 设备名称
userId?: number | string; //供应商id
cardId?: number; //库存卡id
cardNumber?: string; //undefined
userName?: string; //undefined
productId?: number | string; //产品id
productName?: string; //undefined
imagesId?: number | undefined; //弃用
imageUrls?: string; //弃用
carNumber: string; //车牌号
receiptNumber?: string; //收货单号
grossWeight?: number; //毛重
tare?: string; //皮重
grossTime?: string; //过毛日期
tareTime?: string; //过皮日期
netWeight?: number; //净重
buttonType?: number; //扣杂状态0扣杂1扣点
points?: number; //扣点
buckleMiscellaneous?: number; //扣杂
price?: number; //单价
balanceTotalPrice?: number; //结算总价 货款金额
totalPrice?: number; //实际总价 预估价格
weighingMethod?: number; //称重方式0有皮重 1零皮重
multiCategory?: number; //多品类0单品类 1多品类
notes?: string; //备注
scaleStatus?: number; // 磅单状态:0待定价1待过皮2待审核3已审核待支付4已支付
paymentMethod?: string; //支付方式0:未支付,1:现金支付2银行卡支付3线上支付微信4支付宝
updateTime?: string; //修改时间
repairTime?: string; //补单时间
createTime?: string; //创建时间
updateUserId?: number; //修改人
createUserId?: number; //创建人
reviewerUserId?: string; //审核人
reviewerUserName?: string; // 审核人名称
pricingUserId?: string; //定价人
pricingUserName?: string; //定价人名称
fileList?: array;
subtractNum?: number; // input 扣杂扣点参数
isChecked?: boolean;
[attrName: string]: any;
}
interface ReceiveSummaryCount {
totalAmount?: number; // 审核过的收货订单
totalPaid?: number; // 已支付的收货总量
totalUnpaid?: number; // 未支付的收货总量
totalPayment?: number; // 总支付金额
totalPaidPrice?: number; // 已经支付的金额
totalUnpaidPrice?: number; // 未支付的金额
totalReceipt?: number; // 收货单数量已审核的
averagePrice?: number; // 平均单价
rankings?: Array;
}
interface ShipmentSummaryCount {
totalAmount?: number; // 收货汇总:审核过收货总量
totalPayShipment?: number; // 已支付的出货总
totalUnPayShipment?: number; // 未支付的出货总量
totalCollection?: number; // 总收款
totalPayCollection?: number; // 已经收到的收款
totalUnPayCollection?: number; // 未收到的收款
totalReceipt?: number; // 收货单数量已审核的
averagePrice?: number; // 平均单价
rankings?: Array;
}
// 分页结构
interface OrderPage<T> {
total: number;
list: T;
pageNum: number;
pageSize: number;
}
interface ReceiveSummary {
totalReceipt: number; // 本月总出货
totalExpenditure: number; // 本月总收入
toBePriced: number; // 待收货
toBeTare: number; // 待过皮重
audit: number; // 付款审核
toBePaid: number; // 待支付
}
type PageParams = {
pageNumber: number;
pageSize: number;
pricingUserId?: string; // 定价人
userId?: string; // 供应商id
productId?: string; // 产品id
repairFlag?: boolean; // 是否为补单,true 是未补单false是补单
scaleStatus?: number; // 磅单状态:0待定价1待过皮2待审核3已审核待支付4已支付
isDeleted?: boolean;
userName?: string; // 供应商名称
receiptNumber?: string;
};
interface Shipment {
id: string;
userId?: number; //供应商id
productId?: number; //产品id
cardId?: number; //库存卡id
imagesId?: number; //图片表id
deviceId?: number; //设备id
carNumber?: string; //车牌号
scaleStatus?: number; //出库单状态
orderNumber?: string; //订单编号
grossWeight?: number; //毛重
grossTime?: string; //过毛时间
tare?: number; //皮重
tareTime?: string; //过皮时间
netWeight?: number; //净重
number?: number; //数量
notes?: string; //备注
settlementNotes?: string; //结算备注
deliveryMethod?: number; //提货方式:0:送货1:自提
phone?: string; //手机号
box?: string; //箱号
title?: string; //封号
freight?: number; //运费
incidentals?: number; //杂费
pricingPerson?: string; //定价人
reviewerId?: string; //审核人
buttonType: number; //扣点状态默认0扣杂1扣点
points?: string; //扣点
buckleMiscellaneous?: string; //扣杂
unitPrice?: number; //结算单价
estimatePrice?: number; //预估金额 结算总价
totalPrice?: number; //结算金额 实际金额
realIncome?: number; //实际收入 实际收入 实收金额
errorPrice?: string; //误差金额
repairTime?: string; //补单时间
createTime?: string; //undefined
createUserId?: string; //undefined
updateUserId?: string; //undefined
updateTime?: string; //undefined
isDeleted?: string; //删除标识true删除false未删除
settlementWeight?: number; // 结算重量
settlementGross?: number; // 结算毛重
settlementTare?: number; // 结算皮重
settlementNet?: number; // 结算净重
signTime?: string; // 签收时间
paymentMethod?: string; //支付方式0:未支付,1:现金支付2银行卡支付3线上支付微信4支付宝
userType?: number; //用户类型0刷脸1刷卡
[attrName: string]: any;
}
// 出货单排行
interface ShipmentRank {
userId: number;
userName: string;
productId: number;
productName: string; // 产品名称
totalAmount: number; // 总收货量
totalPayment: number; //总应付总额
totalOrderNumber: number; // 收货单数量
averagePrice: number; // 均价
}
// 出库分类
interface ShipmentTypeCount {
totalAmount: number; // 收货汇总:审核过收货总量
totalPayShipment: number; // 已支付的出货总量
totalUnPayShipment: number; // 未支付的出货总量
totalCollection: number; // 总收款
totalPayCollection: number; // 已经收到的收款
totalUnPayCollection: number; // 未收到的收款
totalReceipt: number; // 收货单数量已审核的
averagePrice: number; // 平均单价
rankings: ShipmentRank[]; // 出货产品汇总
}
// 收货产品
interface ReceiveProduct {
id?: string; // 收货产品id
reProductsName?: string; //收货产品名称
reCategoryId?: string; //收货分类id
reCategoryName?: string;
//收货分类名称
substationName?: string;
//分站名称
minPrice?: string;
//产品的最低价格
maxPrice?: string;
//产品的最高价格
commonPrice?: string;
//产品的常用价格
isDeleted?: boolean; //逻辑删除 TRUE=是 FALSE=否
}
// 库存卡
interface StockCard {
id: number
cardCode?: string,
type?: number, // 库存卡类型1=出库2=入库
cardCode?: string,
name?: string
}

8
src/types/resouce.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
interface Resource {
businessId: number,
orderType: number, // 1入库单 2出库单
imagesType: number, // 0:普通资源1皮重 2毛重
url: string,
urlName: string,
urlSuffix: string, // 附件后缀
}

39
src/types/user.d.ts vendored Normal file
View File

@ -0,0 +1,39 @@
export type User = {
name: string;
gender: number; // 性别1=男2=女
phone: string;
factoryName: string; // 货场名称
factoryAddress: string; //货场详细地址
provinceId: number;
areaId: number;
citiyId: number;
userType: number;
userName: string;
password: string;
state: number; // 状态 1=有效 0=无效
cardCode?: string; // 卡号
roleVos?: array
} & BaseField;
interface Customer {
id: number,
name?: string,
stockCardId?: number,
contacts?:string,
cardCode?: string,
}
export type MenusItem = {
id: number,
name: string,
[attrName: string]: any;
}
export type LoginResult = {
menusList: array<MenusItem>
token: string,
userId?:string,
userInfo: User,
userName?: string,
[attrName: string]: any;
}

9
src/types/uview.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
declare module "uview-plus"
declare module "uview-plus" {
global {
interface Uni {
$u: any;
}
}
}

80
src/uni.scss Normal file
View File

@ -0,0 +1,80 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量同时无需 import 这个文件
*/
/* 颜色变量 */
/* uni.scss */
@import 'uview-plus/theme.scss';
$u-primary: #00D2E3 !important;
/* 行为相关颜色 */
$uni-color-primary: #00D2E3; // #007aff
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color: #333; // 基本色
$uni-text-color-inverse: #fff; // 反色
$uni-text-color-grey: #999; // 辅助灰色如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable: #c0c0c0;
/* 背景颜色 */
$uni-bg-color: #fff;
$uni-bg-color-grey: #f8f8f8;
$uni-bg-color-hover: #f1f1f1; // 点击状态颜色
$uni-bg-color-mask: rgba(0, 0, 0, 0.4); // 遮罩颜色
/* 边框颜色 */
$uni-border-color: #c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm: 12px;
$uni-font-size-base: 14px;
$uni-font-size-lg: 16;
/* 图片尺寸 */
$uni-img-size-sm: 20px;
$uni-img-size-base: 26px;
$uni-img-size-lg: 40px;
/* Border Radius */
$uni-border-radius-sm: 2px;
$uni-border-radius-base: 3px;
$uni-border-radius-lg: 6px;
$uni-border-radius-circle: 50%;
/* 水平间距 */
$uni-spacing-row-sm: 5px;
$uni-spacing-row-base: 10px;
$uni-spacing-row-lg: 15px;
/* 垂直间距 */
$uni-spacing-col-sm: 4px;
$uni-spacing-col-base: 8px;
$uni-spacing-col-lg: 12px;
/* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2c405a; // 文章标题颜色
$uni-font-size-title: 20px;
$uni-color-subtitle: #555; // 二级标题颜色
$uni-font-size-subtitle: 18px;
$uni-color-paragraph: #3f536e; // 文章段落颜色
$uni-font-size-paragraph: 15px;

105
src/utils/enum.ts Normal file
View File

@ -0,0 +1,105 @@
// 1收货2出货
export enum OrderType {
Receive = 1,
Shipment = 2,
Pay = 3,
Income = 4
}
// 扣杂状态0扣杂1扣点
export enum ButtonType {
BuckleMiscellaneous = 0,
Points = 1,
}
// 称重方式0有皮重 1零皮重
export enum WeighingMethod {
Yes = 0,
No = 1,
}
// 多品类0单品类 1多品类
export enum MultiCategory {
Single = 0,
Multiple = 1,
}
// 0:普通资源1皮重 2毛重
export enum ImagesType {
NORMARL = 0,
Tare = 1,
GROSSWEIGHT = 2,
// Settlement = 3,
// Payment = 4
}
//磅单状态:0待定价1待过皮2待审核3已审核待支付4已支付
// 磅单状态0待出货1:待过毛2待审核3已审未付4已审已付
export enum ScaleStatus {
ToBePriced = 0,
ToBeTare = 1,
ToBeReview = 2,
ToBePay = 3,
Paid = 4,
ToBeShipment = 0,
ToBeGrossWeight = 1,
ToBeShipmentReview = 2,
ToBeShipmentPay = 3,
ShipmentPaid = 4
}
// 1 出货结算 2 出货未结算 3 出货并结算
export enum ScaleStatusBtnType {
ShipmentSettlement = 1,
ShipmentNoPay = 2,
ShipmentPay = 3
}
// 支付方式0:未支付,1:现金支付2银行卡支付3线上支付微信4支付宝
export enum PaymentMethod {
NoPay = 0,
Cash = 1,
BankCard = 2,
WeChat = 2,
Alipay = 4
}
//用户类型0刷脸1刷卡
export enum UserType {
Face = 0,
Card = 1,
}
export enum UsersType {
Staff = 1,
Purchaser = 2,
Customer = 3,
}
// 提货方式:0:送货1:自提
export enum DeliveryMethod {
Deliver = 0,
SelfPickup = 1
}
export enum DeviceType {
Printer = 0,
Weighbridge = 1
}
// 1=出库客户2=入库(供应商)
export enum StockCardType {
Shipment = 1,
Receive = 2
}
// 今日 昨日 本月 本年 自定义
export enum TimeRange {
Today = 1,
Yesterday = 2,
Month = 3,
Year = 4,
Custom = 5
}
// 消息跳转类型 0=收货待定价1=收货待审核2=待出库3=出库审核
export enum MsgType {
ToBePriced = 0,
ToBeReview = 1,
ToBeShipment = 2,
ToBeShipmentReview = 3
}

140
src/utils/http.ts Normal file
View File

@ -0,0 +1,140 @@
import { useMemberStore } from "@/store/modules/member";
import ENV_CONFIG from "../config/env";
// 基础地址
let baseUrl = "";
// #ifdef H5
(process.env as any).config = ENV_CONFIG;
// #endif
baseUrl = (process.env as any).config[(process.env as any).NODE_ENV]
.VITE_APP_BASE_URL;
const store = useMemberStore();
const obj = {
// 拦截前触发
invoke(options: UniApp.RequestOptions) {
// 超时时间
options.timeout = 10000;
// 拼接完整路径
if (!options.url.startsWith("http")) {
options.url = baseUrl + options.url;
}
// 请求头标识
// 1.小程序唯一标识
// 'source-client' 'miniapp'
options.header = { ...options.header };
options.header["source-client"] = "miniapp";
// 2.注入token
// 2.1 获取token
const token = store.profile?.token;
if (token) {
options.header["x-userToken"] = token;
}
},
};
// 请求拦截器
uni.addInterceptor("request", obj);
uni.addInterceptor("uploadFile", obj);
interface Data<T> {
code: string | number;
data: T;
msg: string;
result: T;
message: string;
}
// 响应拦截器
/***
* 1001
* 1002
*/
export const http = <T>(options: UniApp.RequestOptions) => {
return new Promise<Data<T>>((resolve, reject) => {
console.log(options);
if ((options as any).header?.type === "UPLOAD") {
uni.uploadFile({
header: {
"x-userToken": store.profile?.token,
// #ifdef H5
"Content-Type": "multipart/form-data",
// #endif
},
url: baseUrl + options.url, //仅为示例,非真实的接口地址
fileType: "image",
// #ifdef H5
files: (options as any).data.files,
// #endif
// #ifdef MP-WEIXIN
filePath: (options as any).data.path,
// #endif
name: "file",
formData: {
file: (options as any).data.files,
}, // HTTP 请求中其他额外的 form data
success: (res) => {
resolve(JSON.parse(res.data) as Data<T>);
},
fail(err) {
console.log(err);
resolve(err as any)
},
});
} else {
uni.request({
...options,
dataType:'string', //1.先将dataType设置为string
success(res) {
var json=(res.data as any).replace(/:s*([0-9]{15,})s*(,?)/g, ': "$1" $2')
//2.根据后端返回的数据调用一次或者两次replace替换
var json1=json.replace(/:s*([0-9]{15,})s*(,?)/g, ': "$1" $2')
//3.手动转换回json数据即可
let res1 = JSON.parse(json1);
console.log(res1)
if (res.statusCode >= 200 && res.statusCode < 300) {
if (
(res1 as any).code === 1001 ||
(res1 as any).code === 1002
) {
uni.showToast({
icon: "none",
title: (res1 as Data<T>).message || "请求失败",
});
store.clearProfile();
uni.reLaunch({
url: "/pagesLogin/login/index",
});
return;
}else if ((res1 as any).code === 10001) {
uni.showToast({
icon: "none",
title: (res1 as Data<T>).message || "请求失败",
});
return
} else if ((res1 as any).code === 5001) {
uni.showToast({
icon: "none",
title: (res1 as Data<T>).message || "请求失败",
});
}
resolve(res1 as Data<T>);
} else {
uni.showToast({
icon: "none",
title: (res1 as any).msg || "请求失败",
});
reject(res1);
}
},
fail(err) {
uni.showToast({
icon: "none",
title: "网络错误,请检查网络",
});
reject(err);
},
});
}
});
};

261
src/utils/index.ts Normal file
View File

@ -0,0 +1,261 @@
import { OrderType, TimeRange } from "./enum";
export function formatDate(time: any, cFormat: string) {
const format = cFormat || "{y}-{m}-{d}";
const date = new Date(time);
const formatObj: any = {
//年
y: date.getFullYear(),
//月
m: date.getMonth() + 1,
//日
d: date.getDate(),
//小时
h: date.getHours(),
//分钟
i: date.getMinutes(),
//秒
s: date.getSeconds(),
//星期
a: date.getDay(),
};
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
const value = formatObj[key];
// Note: getDay() returns 0 on Sunday
if (key === "a") {
//如果key是a就是星期格式化成一~日
//例如formatDate(new Date(), '{y}-{m}-{d}-{h}-{i}-{s}-{a}');
//会输出2021-10-29-00-00-00-五
//星期的value会返回0-6['日', '一', '二', '三', '四', '五', '六'][2]代表周二
return ["日", "一", "二", "三", "四", "五", "六"][value];
}
//padStart用于字符串头部补全2个字符如果不够前面补0
return value.toString().padStart(2, "0");
});
return time_str;
}
export function getCurrentMonthStartAndEnd() {
let now = new Date();
let currentMonthStart = new Date(now.getFullYear(), now.getMonth(), 1);
let currentMonthEnd = new Date(now.getFullYear(), now.getMonth() + 1, 0);
return {
start: currentMonthStart,
end: currentMonthEnd,
};
}
export function getCurrentYearStartAndEnd() {
let now = new Date();
let currentYearStart = new Date(now.getFullYear(), 0, 1); // 0 代表一月
let currentYearEnd = (new Date(now.getFullYear() + 1, 0, 1) as any) - 1; // 下一年的一月一日减一毫秒
return {
start: currentYearStart,
end: currentYearEnd,
};
}
export function deleteBaseKey(obj: any) {
delete obj.createTime;
delete obj.createUserId;
delete obj.createUserName;
delete obj.updateTime;
delete obj.updateUserId;
delete obj.updateUserName;
return obj;
}
export function moneyFormat(num: number, decimal = 2, split = ",") {
/*
parameter
num
decimal2
split,
moneyFormat(123456789.87654321, 2, ',') // 123,456,789.88
*/
if (isFinite(num)) {
// num是数字
if (num === 0) {
// 为0
return num.toFixed(decimal);
} else {
// 非0
var res = "";
var dotIndex = String(num).indexOf(".");
if (dotIndex === -1) {
// 整数
if (decimal === 0) {
res = String(num).replace(/(\d)(?=(?:\d{3})+$)/g, `$1${split}`);
} else {
res =
String(num).replace(/(\d)(?=(?:\d{3})+$)/g, `$1${split}`) +
"." +
"0".repeat(decimal);
}
} else {
// 非整数
// js四舍五入 Math.round()正数时4舍5入负数时5舍6入
// Math.round(1.5) = 2
// Math.round(-1.5) = -1
// Math.round(-1.6) = -2
// 保留decimals位小数
const numStr = String(
(
Math.round(num * Math.pow(10, decimal)) / Math.pow(10, decimal)
).toFixed(decimal)
); // 四舍五入然后固定保留2位小数
const decimals = numStr.slice(dotIndex, dotIndex + decimal + 1); // 截取小数位
res =
String(numStr.slice(0, dotIndex)).replace(
/(\d)(?=(?:\d{3})+$)/g,
`$1${split}`
) + decimals;
}
return res;
}
} else {
return "--";
}
}
// 分页内容重置
export function pageListInit() {
return {
noMoreData: false,
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
};
}
// 过滤掉属性值为null的
export function filterNullUndefined(obj: Object) {
return Object.entries(obj).reduce((acc: any, [key, value]) => {
if (value !== null && value !== undefined && value !== "") {
acc[key] = value;
}
return acc;
}, {});
}
export function timeRange(id: number) {
const today = new Date();
const yesterday = new Date((today as any) - 24 * 60 * 60 * 1000);
let startTime = "";
let endTime = "";
if (id === TimeRange.Today) {
startTime = formatDate(today, "{y}-{m}-{d}");
endTime = formatDate(today, "{y}-{m}-{d}");
} else if (id === TimeRange.Yesterday) {
startTime = formatDate(yesterday, "{y}-{m}-{d}");
endTime = formatDate(yesterday, "{y}-{m}-{d}");
} else if (id === TimeRange.Month) {
startTime = formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}");
endTime = formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}");
} else if (id === TimeRange.Year) {
startTime = formatDate(getCurrentYearStartAndEnd().start, "{y}-{m}-{d}");
endTime = formatDate(getCurrentYearStartAndEnd().end, "{y}-{m}-{d}");
}
return { startTime: startTime, endTime: endTime };
}
// 格式化金额
export function formatMoney(
number: any,
decimals?: any,
dec_point?: any,
thousands_sep?: any,
roundtag?: any
) {
/*
*
* number
* decimals
* dec_point
* thousands_sep
* roundtag:舍入参数 "ceil" ,"floor","round"
* */
if (!number) {
number = 0;
}
if (!decimals) {
decimals = 0; //默认保留2位小数
}
if (!dec_point) {
dec_point = ".";
}
if (!thousands_sep) {
thousands_sep = ",";
}
if (!roundtag) {
roundtag = "round";
}
number = (number + "").replace(/[^0-9+-Ee.]/g, "");
roundtag = roundtag || "ceil"; //"ceil","floor","round"
var n = !isFinite(+number) ? 0 : +number,
prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
sep = typeof thousands_sep === "undefined" ? "," : thousands_sep,
dec = typeof dec_point === "undefined" ? "." : dec_point,
s: any = "",
toFixedFix = function (n: any, prec: any) {
var k = Math.pow(10, prec);
return (
"" +
parseFloat(
(Math as any)
[roundtag](parseFloat((n * k).toFixed(prec * 2)))
.toFixed(prec * 2)
) /
k
);
};
s = (prec ? toFixedFix(n, prec) : "" + Math.round(n)).split(".");
var re = /(-?\d+)(\d{3})/;
while (re.test(s[0])) {
s[0] = s[0].replace(re, "$1" + sep + "$2");
}
if ((s[1] || "").length < prec) {
s[1] = s[1] || "";
s[1] += new Array(prec - s[1].length + 1).join("0");
}
return s.join(dec);
}
// 判断字符串中有几个.
export function countDots(str: any) {
return (str.match(/\./g) || []).length;
}
export function validateRegex(regexValue: string, value: string) {
const regex = new RegExp(regexValue);
return regex.test(value);
}
/***
*
*/
export function getScaleStatus(type: number, value: number) {
if (type === OrderType.Receive) {
if (value === -1) {
return "全部";
} else if (value === 4) {
return "已支付";
} else if (value === 3) {
return "已审未付";
} else if (value === 2) {
return "未审核";
}
} else if (type === OrderType.Shipment) {
if (value === -1) {
return "全部";
} else if (value === 4) {
return "已结算";
} else if (value === 3) {
return "未结算";
}
}
}

59
src/utils/validate.ts Normal file
View File

@ -0,0 +1,59 @@
const valid = {
mobile: {
pattern: /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,
message: "请输入正确的手机号码",
},
password: {
pattern:
/^((?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!;:@#$%?^&*_-]))([a-zA-Z0-9!;:@#$%?^&*_-]){6,16}$/,
message: "密码必须包含大小写字母、数字、特殊字符",
},
username: /^[a-zA-Z]{4,12}$/, //长度4~12英文大小写字母
email: /^(\w+(_|-|.)*)+@(\w+(-)?)+(.\w{2,})+$/, //用户名 @ 域名域名后缀至少2个字符
valid_number: /[^\d]/g,
// valid_password: /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_]+$)(?![a-z0-9]+$)(?![a-z\\W_]+$)(?![0-9\\W_]+$)[A-Za-z\d`~!@#$%^&*()_+<>?:"{},.\/\\;'[\]]{6,20}$/, // 8位 大小写 数字 和下划线
valid_no_space: /\s+/g, //不可输入空格
valid_no_cn: /[\u4E00-\u9FA5]/g, // 不可输入中文
valid_number_en: /^[a-zA-Z0-9]+$/, // 只能输入数字和英文
carNo: {
// /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/
// /^[\x{4e00}-\x{9fa5}]{1}[A-Z]{1}[A-Z0-9]{5}$/u
pattern:
/^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[a-zA-Z](([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼ABCDEFGHJK]((?![IO])[a-zA-Z0-9](?![IO]))[0-9]{4})|([0-9]{5}[ABCDEFGHJK]))|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z0-9]{1}[A-Z0-9]{1}[A-Z0-9应]{4,5}[A-Z0-9挂学警港澳领使急]{1})$/,
message: "请输入正确的车牌号",
},
valid_decimal: {
pattern: /[^0-9.]/g,
message: "请输入正确的数字",
},
valid_id_card: {
pattern:
/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
message: "请输入正确的身份证号码",
},
/**
* 8
*/
valid_passwordTemp: {
pattern:
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[$@$!%*?&])[A-Za-z\\d$@$!%*?&]{8,}$/,
message: "密码由字母、数字组成,且至少8位",
},
valid_password: {
pattern: /^(?=.*[a-z])(?=.*\d)[a-zA-Z\d]{8,}$/,
message: "密码由字母、数字组成,且至少8位",
},
valid_password1: {
pattern: "^(?=.*[a-z])(?=.*\d)[a-zA-Z\d]{8,}$",
message: "密码必须由字母、数字组成, 且至少8位",
},
};
export default valid;

27
tsconfig.json Normal file
View File

@ -0,0 +1,27 @@
{
"extends": "@vue/tsconfig/tsconfig.json",
"compilerOptions": {
"ignoreDeprecations": "5.0",
"sourceMap": false,
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
},
"lib": ["esnext", "dom"],
"types": [
"@dcloudio/types", // uni-app API
// "miniprogram-api-typings", //
"@types/wechat-miniprogram",
"@uni-helper/uni-app-types", // uni-app
"@uni-helper/uni-ui-types",
"node" // process
]
},
// vue
"vueCompilerOptions": {
"nativeTags": ["block","component","template","slot"],
// "experimentalRuntimeMode": "runtime-uni-app"
},
"include": ["src/*.ts","src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "src/auto-import.d.ts"],
"moduleResolution":"node"
}

41
vite.config.ts Normal file
View File

@ -0,0 +1,41 @@
import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import AutoImport from "unplugin-auto-import/vite";
import path from "path"; // 引入pnpm install @types/node --save-dev
import ENV_CONFIG from "./src/config/env";
// https://vitejs.dev/config/
export default defineConfig({
build: {
sourcemap: process.env.NODE_ENV === "development",
},
define: {
"process.env.config": ENV_CONFIG,
'process.env': process.env, //配置二
},
plugins: [
uni(),
AutoImport({
// 目标文件
include: [
/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
/\.vue$/,
/\.vue\?vue/, // .vue
/\.md$/, // .md
],
// 使用
imports: ["vue"],
dts: "src/auto-import.d.ts",
// 如有用到eslint记得加上写段没有用到可以忽略
eslintrc: {
enabled: false,
filepath: "./.eslintrc-auto-import.json", // Default `./.eslintrc-auto-import.json`
globalsPropValue: true, // Default `true`, (true | false | 'readonly' | 'readable' | 'writable' | 'writeable')
},
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
});