update: 增加启动页优化

This commit is contained in:
admin 2024-04-28 15:01:11 +08:00
parent 8eaf921cf4
commit 5743217148
13 changed files with 1362 additions and 1207 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,18 @@
<script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
const isFirstLaunch = ref(true);
onLaunch(() => {
console.log("App Launch");
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");

View File

@ -1,19 +1,19 @@
<template>
<view class="layout-box">
<view class="filter">
<up-input
<u-input
v-model="state.startTime"
disabled
disabledColor=""
placeholder="请选择开始时间"
></up-input>
></u-input>
<text>-</text>
<up-input
<u-input
v-model="state.endTime"
disabled
disabledColor=""
placeholder="请选择结束时间"
></up-input>
></u-input>
<u-icon
name="arrow-down"
@click="handleDialog('showTime', true)"
@ -63,7 +63,7 @@
<view class="num highlight">{{
formatMoney(state.summary.totalPayment)
}}</view>
<view>结算金额/</view>
<view>付款金额/</view>
</view>
</up-col>
<up-col span="4">
@ -71,7 +71,7 @@
<view class="num">{{
formatMoney(state.summary.totalPaidPrice)
}}</view>
<view>金额</view>
<view>金额</view>
</view>
</up-col>
<up-col span="4">
@ -269,7 +269,7 @@ onMounted(() => {
font-family: Source Han Sans CN;
font-size: 28rpx;
color: #000000;
::v-deep .up-input {
::v-deep .u-input {
padding: 0rpx 16.03rpx !important;
input {
font-family: Source Han Sans CN;

View File

@ -1,19 +1,19 @@
<template>
<view class="layout-box">
<view class="filter">
<up-input
<u-input
v-model="state.startTime"
disabled
disabledColor=""
placeholder="请选择开始时间"
></up-input>
></u-input>
<text>-</text>
<up-input
<u-input
v-model="state.endTime"
disabled
disabledColor=""
placeholder="请选择结束时间"
></up-input>
></u-input>
<u-icon
name="arrow-down"
@click="handleDialog('showTime', true)"
@ -266,7 +266,7 @@ onMounted(() => {
font-family: Source Han Sans CN;
font-size: 28rpx;
color: #000000;
::v-deep .up-input {
::v-deep .u-input {
padding: 0rpx 16.03rpx !important;
input {
font-family: Source Han Sans CN;

View File

@ -1,7 +1,7 @@
{
"name": "",
"name": "在生万有",
// DCloud ios
"appid": "",
"appid": "__UNI__898003A",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",

View File

@ -20,10 +20,24 @@
><u-icon name="arrow-down"></u-icon
></view>
<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 @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 class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view>
@ -201,6 +215,10 @@ const state = reactive({
],
isShowSort: false,
sortList: [
{
name: "全部",
key: undefined,
},
{
name: "按创建时间降序",
key: "create_time",

View File

@ -32,7 +32,12 @@
:customStyle="{}"
border="none"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="['补单时间','站点磅秤','供应商','收货产品'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
:disabledColor="
['补单时间', '站点磅秤', '供应商', '收货产品'].indexOf(item.name) >
-1
? '#ffffff'
: '#f5f7fa'
"
@change="(e:any) => {handleInput(e, item)}"
@clear="handleClear(item)"
>
@ -47,6 +52,16 @@
</up-input>
<!-- @afterRead="afterRead"
@delete="deletePic" -->
<!-- <up-upload
v-if="item.type === 'upload'"
:fileList="model1.order.fileLists"
@delete="handleDelete"
name="1"
multiple
:maxCount="10"
></up-upload> -->
<uni-file-picker
v-if="item.type === 'upload'"
v-model="model1.order.fileLists"
@ -132,8 +147,8 @@ import ProductDialog from "./components/ProductDialog.vue";
import valid from "@/utils/validate";
const handleClear = (item: any) => {
(model1.order as any)[item.key] = '';
}
(model1.order as any)[item.key] = "";
};
//
const showDialog = <
{
@ -226,7 +241,7 @@ const model1 = reactive<any>({
splTime: "",
subtractType: 1,
netWeight: 0,
totalPrice: 0
totalPrice: 0,
},
});
const rules = reactive({
@ -436,7 +451,9 @@ watch(
预估总价 结算单价*结算重量
实际收入实际结算金额-运费-杂费
*/
model1.order.netWeight = ((parseFloat(grossWeightNew) || 0) - (parseFloat(tareNew) || 0)).toFixed(2);
model1.order.netWeight = (
(parseFloat(grossWeightNew) || 0) - (parseFloat(tareNew) || 0)
).toFixed(2);
if (model1.order.buttonType === 0) {
if (model1.order.subtractNum) {
model1.order.netWeight =
@ -599,7 +616,7 @@ const startSave = () => {
if (res.code === 200) {
model1.order.id = res.data;
upload();
uni.navigateBack()
uni.navigateBack();
}
});
};

View File

@ -20,10 +20,24 @@
><u-icon name="arrow-down"></u-icon
></view>
<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 @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 class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view>
@ -92,8 +106,14 @@
<text v-if="cItem.name">{{ cItem.name }}</text
><text
>{{ cItem.isBefore ? cItem.unit : "" }}
<text v-if="item[cItem.enName as string] === DeliveryMethod.Deliver">送货</text>
<text v-if="item[cItem.enName as string] === DeliveryMethod.SelfPickup">自提</text>
<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 }}
</text>
</block>
@ -210,6 +230,10 @@ const state = reactive({
],
isShowSort: false,
sortList: [
{
name: "全部",
key: undefined,
},
{
name: "按创建时间降序",
key: "create_time",

View File

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

View File

@ -13,8 +13,8 @@
:key="index"
:prop="`userInfo.${item.modelName}`"
>
<view v-if="item.type === 'text'">
<up-input
<u-input
v-if="item.type === 'text'"
v-model="model1.userInfo[`${item.modelName}`]"
:placeholder="item.placeholder"
:shape="'circle'"
@ -41,10 +41,10 @@
>
</text>
</template>
</up-input>
</view>
<view v-if="item.type === 'password'">
<up-input
</u-input>
<u-input
v-if="item.type === 'password'"
v-model="model1.userInfo[`${item.modelName}`]"
:placeholder="item.placeholder"
:shape="'circle'"
@ -73,8 +73,7 @@
@click="item.isShowPwd = false"
></image>
</template>
</up-input>
</view>
</u-input>
</u-form-item>
</u-form>
@ -85,7 +84,7 @@
:customStyle="{
'border-radius': '43rpx',
}"
>保存并登录</u-button
>保存</u-button
>
</view>
</template>
@ -97,8 +96,8 @@ 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] = '';
}
(model1.userInfo as any)[item.modelName] = "";
};
const loginForm = ref(null);
const model1 = <any>reactive({
userInfo: {

View File

@ -14,6 +14,23 @@
<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>
@ -24,10 +41,12 @@
<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>
@ -108,11 +127,17 @@ const handleItem = (item: any) => {
});
return;
} else {
if (res.data.list[0].scaleStatus === ScaleStatus.ToBePriced && MsgType.ToBePriced === item.msgType) {
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) {
} else if (
res.data.list[0].scaleStatus === ScaleStatus.ToBeReview &&
MsgType.ToBeReview === item.msgType
) {
uni.navigateTo({
url: "/pagesReceive/payReview?scaleStatus=2", //
});
@ -142,12 +167,16 @@ const handleItem = (item: any) => {
});
return;
} else {
if (res.data.list[0].scaleStatus === ScaleStatus.ToBeShipment && MsgType.ToBeShipment === item.msgType) {
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
res.data.list[0].scaleStatus === ScaleStatus.ToBeShipmentReview &&
MsgType.ToBeShipmentReview === item.msgType
) {
uni.navigateTo({
url: "/pagesShipment/shipmentSettlement?scaleStatus=2", //
@ -202,5 +231,11 @@ onMounted(() => {
font-weight: 400;
color: #999999;
}
// h5
.msg-content {
padding: 30rpx;
border-bottom: 1px solid rgba(0,0,0, 0.2);
}
}
</style>

View File

@ -61,7 +61,9 @@
</view>
<view class="more">
<view v-if="getIsShow()"> 收货单号{{ state.order.receiptNumber }} </view>
<view v-if="getIsShow()">
收货单号{{ state.order.receiptNumber }}
</view>
<view v-if="getIsShow()"></view>
<view v-for="(item, index) in gridList1" :key="index">
<text v-if="item.name">{{ item.name }}</text
@ -70,7 +72,10 @@
{{ item.num }}
{{ item.isBefore ? "" : item.unit }}
<text
v-if="item.name === '货款金额' && ScaleStatus.ToBeReview === state.order.scaleStatus"
v-if="
item.name === '货款金额' &&
ScaleStatus.ToBeReview === state.order.scaleStatus
"
@click="handleEdit()"
:style="{
color: 'rgba(0, 220, 238, 1)',
@ -78,7 +83,7 @@
'border-radius': '20rpx',
fontSize: '12px',
padding: '1px 10px',
marginLeft: '10rpx'
marginLeft: '10rpx',
}"
>
编辑
@ -215,7 +220,7 @@ const state = reactive<{
[attrName: string]: any;
}>({
order: {
carNumber: ''
carNumber: "",
},
sheetList: [
{
@ -289,7 +294,9 @@ const handleScenePhoto = (id: any) => {
};
// // 3
const handleReviewNoPay = () => {
ReceiveApi.updateOne({ ...state.order, scaleStatus: 3 }).then((res) => {
ReceiveApi.updateOrderIn({
orderInPos: [{ ...state.order, scaleStatus: 3 }],
}).then((res) => {
if (res.code === 200) {
uni.redirectTo({
url: "/pagesReceive/payReview?scaleStatus=3", //
@ -327,10 +334,15 @@ const handleSelect = (key: string, v: any) => {
contrlModalParams[key].isShow = false;
if (key === "paySelect") {
//
ReceiveApi.updateOne({
ReceiveApi.updateOrderIn({
orderInPos: [
{
...state.order,
scaleStatus: 4,
paymentMethod: v.key,
},
],
}).then((res) => {
if (res.code === 200) {
uni.showToast({
@ -369,7 +381,11 @@ const handleUpdateOrder = () => {
};
//
const handleReWeight = () => {
ReceiveApi.reTare({ id: state.order.id, userId: state.order.userId, deviceId: state.order.deviceId }).then((res) => {
ReceiveApi.reTare({
id: state.order.id,
userId: state.order.userId,
deviceId: state.order.deviceId,
}).then((res) => {
if (res.code === 200) {
uni.redirectTo({
url: "/pagesReceive/pricing?scaleStatus=1", //
@ -403,12 +419,11 @@ onLoad((option) => {
if (state.order[item.enName as string]) {
item.num = state.order[item.enName as string];
} else {
item.num = state.order['totalPrice'];
item.num = state.order["totalPrice"];
}
} else {
item.num = state.order[item.enName as string];
}
});
}
});

View File

@ -2,7 +2,7 @@
"extends": "@vue/tsconfig/tsconfig.json",
"compilerOptions": {
"ignoreDeprecations": "5.0",
"sourceMap": true,
"sourceMap": false,
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]