update: 优化细节

This commit is contained in:
admin 2024-05-20 16:30:44 +08:00
parent b0e31d9d9e
commit a761ecbeba
13 changed files with 296 additions and 145 deletions

View File

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

View File

@ -30,12 +30,14 @@ const props = withDefaults(
show: false show: false
} }
); );
const emit = defineEmits(["handleModal", "handleOk"]); const emit = defineEmits(["handleModal", "handleOk", "handleCancel"]);
const handleClose = (v: string) => { const handleClose = (v: string) => {
emit("handleModal", false); emit("handleModal", false);
if (v === 'ok') { if (v === 'ok') {
// //
emit("handleOk"); emit("handleOk");
} else {
emit("handleCancel")
} }
}; };
</script> </script>

View File

@ -1,85 +1,96 @@
{ {
"name": "", "name" : "在生万有",
// DCloud ios // DCloud ios
"appid": "", "appid" : "__UNI__898003A",
"description": "", "description" : "",
"versionName": "1.0.0", "versionName" : "1.0.0",
"versionCode": "100", "versionCode" : "100",
"transformPx": false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus": { "app-plus" : {
"usingComponents": true, "ignoreVersion": false,
"nvueStyleCompiler": "uni-app", "usingComponents" : true,
"compilerVersion": 3, "nvueStyleCompiler" : "uni-app",
"splashscreen": { "compilerVersion" : 3,
"alwaysShowBeforeRender": true, "splashscreen" : {
"waiting": true, "alwaysShowBeforeRender" : true,
"autoclose": true, "waiting" : true,
"delay": 0 "autoclose" : true,
"delay" : 0
},
/* */
"modules" : {},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {
"dSYMs" : false
},
/* SDK */
"sdkConfigs" : {
"ad" : {}
},
"icons" : {
"android" : {
"hdpi" : "/Users/admin/workspace/aifanda/project/在生万有/logo 72 x 72.png",
"xhdpi" : "/Users/admin/workspace/aifanda/project/在生万有/logo 96 x 96.png",
"xxhdpi" : "/Users/admin/workspace/aifanda/project/在生万有/logo 144 x144.png",
"xxxhdpi" : "/Users/admin/workspace/aifanda/project/在生万有/logo 192 x192.png"
}
}
}
}, },
/* */ /* */
"modules": {}, "quickapp" : {},
/* */ // h5
"distribute": { "h5" : {
/* android */ "router" : {
"android": { "base" : "./"
"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": { "mp-weixin" : {
"subPackages": true // "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"
}, },
"lazyCodeLoading": "requiredComponents" "mp-alipay" : {
}, "usingComponents" : true
"mp-alipay": { },
"usingComponents": true "mp-baidu" : {
}, "usingComponents" : true
"mp-baidu": { },
"usingComponents": true "mp-toutiao" : {
}, "usingComponents" : true
"mp-toutiao": { },
"usingComponents": true "uniStatistics" : {
}, "enable" : false
"uniStatistics": { },
"enable": false "vueVersion" : "3"
},
"vueVersion": "3"
} }

View File

@ -247,8 +247,8 @@ const state = reactive({
const currentSpl = ref<any>(null); const currentSpl = ref<any>(null);
const splBtnList = [ const splBtnList = [
{ key: null, name: "全部" }, { key: null, name: "全部" },
{ key: false, name: "手工补单" }, { key: true, name: "手工补单" },
{ key: true, name: "系统单" }, { key: false, name: "系统单" },
]; ];
const deliveryMethod = ref<any>(null); const deliveryMethod = ref<any>(null);
const deliveryMethodBtnList = [ const deliveryMethodBtnList = [

View File

@ -32,7 +32,9 @@
:customStyle="{}" :customStyle="{}"
border="none" border="none"
:disabled="item.type === 'select'" :disabled="item.type === 'select'"
:disabledColor="['卡号'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'" :disabledColor="
['卡号'].indexOf(item.name) > -1 ? '#ffffff' : '#f5f7fa'
"
@clear="handleClear(item)" @clear="handleClear(item)"
> >
<template #suffix> <template #suffix>
@ -61,6 +63,16 @@
<view class="btn-box"> <view class="btn-box">
<u-button type="primary" text="保存" @click="save()"></u-button> <u-button type="primary" text="保存" @click="save()"></u-button>
</view> </view>
<SmallModal
:title="'确认作废旧卡号吗?'"
:content="`确认作废${model1.formData.cardCode}后,不能恢复!`"
:okText="'确认作废'"
:isMain="true"
:show="isShowCancelModal"
@handleModal="(v:boolean) => {handleModal(v)}"
@handleOk="handleOk()"
@handleCancel="handleCancel()"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { CustomerApi, StockCardApi } from "@/services"; import { CustomerApi, StockCardApi } from "@/services";
@ -68,9 +80,22 @@ import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum"; import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore"; import _ from "underscore";
const handleClear = (item:any) => { import SmallModal from "@/components/Modal/smallModal.vue";
(model1.formData as any)[item.key] = ''; const isShowCancelModal = ref(false);
}
const handleModal = (v: boolean) => {
isShowCancelModal.value = v;
};
const handleOk = () => {
handleCheck(true);
};
const handleCancel = () => {
handleCheck(false);
};
const handleClear = (item: any) => {
(model1.formData as any)[item.key] = "";
};
const model1 = reactive<any>({ const model1 = reactive<any>({
formData: {}, formData: {},
}); });
@ -116,8 +141,8 @@ const formAttrList = reactive<any>([
required: true, required: true,
fn: () => { fn: () => {
if (contrlModalParams.stockCard.list.length === 0) { if (contrlModalParams.stockCard.list.length === 0) {
uni.showToast({icon: 'none', title: '当前无可用卡号,请添加出库卡'}) uni.showToast({ icon: "none", title: "当前无可用卡号,请添加出库卡" });
return return;
} }
contrlModalParams.stockCard.isShow = true; contrlModalParams.stockCard.isShow = true;
contrlModalParams.stockCard.title = "卡号"; contrlModalParams.stockCard.title = "卡号";
@ -165,36 +190,47 @@ const check = () => {
}; };
const save = () => { const save = () => {
if (
model1.formData.cardCode &&
model1.formData.stockCardName !== model1.formData.cardCode
) {
handleModal(true);
} else {
handleCheck(false);
}
};
const handleCheck = (v: boolean) => {
check().then((res) => { check().then((res) => {
if (res) { if (res) {
startSave(); startSave(v);
} }
}); });
}; };
const startSave = () => {
const startSave = (v: boolean) => {
if (model1.formData.id) { if (model1.formData.id) {
CustomerApi.updateCustomUser(model1.formData).then((res) => { CustomerApi.updateCustomUser({ ...model1.formData, delCard: v }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.navigateBack() uni.navigateBack();
} }
}); });
} else { } else {
CustomerApi.addCustomUser(model1.formData).then((res) => { CustomerApi.addCustomUser(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.navigateBack() uni.navigateBack();
} }
}); });
} }
}; };
const getStockCardList = () => { const getStockCardList = () => {
StockCardApi.getStockCardListInfo({ vincolante: StockCardType.Shipment }).then((res) => { StockCardApi.getStockCardListInfo({
vincolante: StockCardType.Shipment,
}).then((res) => {
if (res.code === 200) { if (res.code === 200) {
contrlModalParams.stockCard.list = (res.data as any).map( contrlModalParams.stockCard.list = (res.data as any).map((item: any) => {
(item: any) => { return { ...item, name: item.cardCode };
return { ...item, name: item.cardCode }; });
}
);
} }
}); });
}; };

View File

@ -64,8 +64,19 @@
</block> </block>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<u-button type="primary" text="保存" @click="save()"></u-button> <u-button type="primary" text="保存" @click="save"></u-button>
</view> </view>
<SmallModal
:title="'确认作废旧卡号吗?'"
:content="`确认作废${model1.formData.cardCode}后,不能恢复!`"
:okText="'确认作废'"
:isMain="true"
:show="isShowCancelModal"
@handleModal="(v:boolean) => {handleModal(v)}"
@handleOk="handleOk()"
@handleCancel="handleCancel()"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { StockCardApi, SupplierApi } from "@/services"; import { StockCardApi, SupplierApi } from "@/services";
@ -74,6 +85,18 @@ import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import valid from "@/utils/validate"; import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore"; import _ from "underscore";
import SmallModal from "@/components/Modal/smallModal.vue";
const isShowCancelModal = ref(false);
const handleModal = (v: boolean) => {
isShowCancelModal.value = v;
};
const handleOk = () => {
handleCheck(true);
};
const handleCancel = () => {
handleCheck(false);
};
const handleClear = (item: any) => { const handleClear = (item: any) => {
(model1.formData as any)[item.key] = ""; (model1.formData as any)[item.key] = "";
}; };
@ -270,19 +293,32 @@ const save = () => {
return; return;
} }
} }
if (
model1.formData.cardCode &&
model1.formData.stockCardName !== model1.formData.cardCode
) {
handleModal(true);
} else {
handleCheck(false);
}
};
const handleCheck = (v: boolean) => {
check().then((res) => { check().then((res) => {
if (res) { if (res) {
startSave(); startSave(v);
} }
}); });
}; };
const startSave = () => { const startSave = (v: boolean) => {
if (model1.formData.id) { if (model1.formData.id) {
SupplierApi.updateSupplierUser(model1.formData).then((res) => { SupplierApi.updateSupplierUser({ ...model1.formData, delCard: v }).then(
if (res.code === 200) { (res) => {
uni.navigateBack(); if (res.code === 200) {
uni.navigateBack();
}
} }
}); );
} else { } else {
SupplierApi.addSupplierUser(model1.formData).then((res) => { SupplierApi.addSupplierUser(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
@ -319,26 +355,24 @@ onMounted(() => {
getStockCardList(); getStockCardList();
}); });
onLoad((option:any) => { onLoad((option: any) => {
// //
const title = option.title; const title = option.title;
SupplierApi.getSupplierUserList({ id: option.item }).then( SupplierApi.getSupplierUserList({ id: option.item }).then((res: any) => {
(res: any) => { if (res.code === 200) {
if (res.code === 200) { if (res.data.length > 0) {
if (res.data.length > 0) { model1.formData = res.data[0];
model1.formData = res.data[0] if (model1.formData.cardCode) {
} else { model1.formData.stockCardName = model1.formData.cardCode;
uni.showToast({ title: "未查询到供应商" });
} }
} else {
uni.showToast({ title: "未查询到供应商" });
} }
} }
); });
// //
if (!option.item) { if (!option.item) {
formAttrList[1].required = true formAttrList[1].required = true;
}
if (model1.formData.cardCode) {
model1.formData.stockCardName = model1.formData.cardCode;
} }
// //
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({

View File

@ -20,10 +20,24 @@
><u-icon name="arrow-down"></u-icon ><u-icon name="arrow-down"></u-icon
></view> ></view>
<view @click="state.isShowStatus = true" <view @click="state.isShowStatus = true"
><text>单据状态</text><u-icon name="arrow-down"></u-icon ><text>{{
></view> state.currentScaleStatus === -1
? "单据状态"
: getScaleStatus(state.currentScaleStatus)
}}</text
><u-icon name="arrow-down"></u-icon>
</view>
<view @click="state.isShowSort = true" <view @click="state.isShowSort = true"
><text>排序</text><u-icon name="arrow-down"></u-icon ><text>{{
state.currentSortName === undefined
? "排序"
: `${
state.currentSortName === "create_time"
? "创建时间"
: "更新时间"
}降序`
}}</text
><u-icon name="arrow-down"></u-icon
></view> ></view>
<view class="btn" @click="handleDialog('showFilter', true)">筛选</view> <view class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view> </view>
@ -201,6 +215,10 @@ const state = reactive({
], ],
isShowSort: false, isShowSort: false,
sortList: [ sortList: [
{
name: "全部",
key: undefined,
},
{ {
name: "按创建时间降序", name: "按创建时间降序",
key: "create_time", key: "create_time",

View File

@ -94,7 +94,7 @@ const edit = (item: any) => {
}); });
}; };
const deleteType = (item: any) => { const deleteType = (item: any) => {
GoodsApi.editReceiveCategory({ isDeleted: true, id: item.id }).then((res) => { GoodsApi.deleteReceiveCategory({ id: item.id }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
resetPageList(); resetPageList();
getList(); getList();

View File

@ -20,10 +20,24 @@
><u-icon name="arrow-down"></u-icon ><u-icon name="arrow-down"></u-icon
></view> ></view>
<view @click="state.isShowStatus = true" <view @click="state.isShowStatus = true"
><text>单据状态</text><u-icon name="arrow-down"></u-icon ><text>{{
state.currentScaleStatus === -1
? "单据状态"
: getScaleStatus(state.currentScaleStatus)
}}</text
><u-icon name="arrow-down"></u-icon
></view> ></view>
<view @click="state.isShowSort = true" <view @click="state.isShowSort = true"
><text>排序</text><u-icon name="arrow-down"></u-icon ><text>{{
state.currentSortName === undefined
? "排序"
: `${
state.currentSortName === "create_time"
? "创建时间"
: "更新时间"
}降序`
}}</text
><u-icon name="arrow-down"></u-icon
></view> ></view>
<view class="btn" @click="handleDialog('showFilter', true)">筛选</view> <view class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view> </view>
@ -92,8 +106,14 @@
<text v-if="cItem.name">{{ cItem.name }}</text <text v-if="cItem.name">{{ cItem.name }}</text
><text ><text
>{{ cItem.isBefore ? cItem.unit : "" }} >{{ cItem.isBefore ? cItem.unit : "" }}
<text v-if="item[cItem.enName as string] === DeliveryMethod.Deliver">送货</text> <text
<text v-if="item[cItem.enName as string] === DeliveryMethod.SelfPickup">自提</text> v-if="item[cItem.enName as string] === DeliveryMethod.Deliver"
>送货</text
>
<text
v-if="item[cItem.enName as string] === DeliveryMethod.SelfPickup"
>自提</text
>
{{ cItem.isBefore ? "" : cItem.unit }} {{ cItem.isBefore ? "" : cItem.unit }}
</text> </text>
</block> </block>
@ -183,7 +203,7 @@ const state = reactive({
currentSortName: undefined, currentSortName: undefined,
isShowStatus: false, isShowStatus: false,
statusList: [ statusList: [
{ {
name: "全部", name: "全部",
key: -1, key: -1,
}, },
@ -210,6 +230,10 @@ const state = reactive({
], ],
isShowSort: false, isShowSort: false,
sortList: [ sortList: [
{
name: "全部",
key: undefined,
},
{ {
name: "按创建时间降序", name: "按创建时间降序",
key: "create_time", key: "create_time",

View File

@ -10,7 +10,9 @@
> >
<swiper-item v-for="(item, index) in list" :key="index"> <swiper-item v-for="(item, index) in list" :key="index">
<view class="image-box"> <view class="image-box">
<image :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLaunch/${item.imgUrl}`"></image> <image
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLaunch/${item.imgUrl}`"
></image>
<view class="title"> <view class="title">
{{ item.title }} {{ item.title }}
</view> </view>
@ -22,6 +24,10 @@
</swiper> </swiper>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useMemberStore } from "@/store/index";
const store = useMemberStore();
const profile = store.profile;
const list = [ const list = [
{ {
title: "智能回收 智慧未来!", title: "智能回收 智慧未来!",
@ -41,9 +47,16 @@ const list = [
}, },
]; ];
const start = () => { const start = () => {
uni.navigateTo({ // token
url: "/pagesLogin/login/index", // if (profile.token) {
}); uni.navigateTo({
url: "/pagesHome/index", //
});
} else {
uni.navigateTo({
url: "/pagesLogin/login/index", //
});
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -2,7 +2,7 @@
<view class="c-login-container"> <view class="c-login-container">
<!-- logo --> <!-- logo -->
<view class="logo"> <view class="logo">
<image :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/logo.png`" height="60rpx"></image> <image :src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/logo2.png`" ></image>
</view> </view>
<!-- form表单 --> <!-- form表单 -->
<view class="login-form"> <view class="login-form">
@ -16,13 +16,15 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.c-login-container { .c-login-container {
height: 80vh; height: 85vh;
margin-top: 20vh; margin-top: 15vh;
.logo { .logo {
text-align: center; text-align: center;
image { image {
width: 234.62rpx; // width: 234.62rpx;
height: 62.18rpx; // height: 62.18rpx;
width: 300rpx;
height: 100rpx;
} }
} }
.login-form { .login-form {

View File

@ -85,7 +85,7 @@
:customStyle="{ :customStyle="{
'border-radius': '43rpx', 'border-radius': '43rpx',
}" }"
>保存并登录</u-button >保存</u-button
> >
</view> </view>
</template> </template>

View File

@ -559,7 +559,6 @@ const save = () => {
} }
} }
} }
check().then((res) => { check().then((res) => {
if (res) { if (res) {
startSave(); startSave();