Compare commits
6 Commits
4910ed04cb
...
3db1115ee2
Author | SHA1 | Date |
---|---|---|
![]() |
3db1115ee2 | |
![]() |
093a3619cb | |
![]() |
a7234d6030 | |
![]() |
6fddf740a5 | |
![]() |
390ca4a892 | |
![]() |
efb6d77ed0 |
16
index.html
16
index.html
|
@ -3,18 +3,26 @@
|
|||
<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)'))
|
||||
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' : '') + '" />')
|
||||
(coverSupport ? ", viewport-fit=cover" : "") +
|
||||
'" />'
|
||||
);
|
||||
</script>
|
||||
|
||||
<title></title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<div id="app"><!--app-html-->
|
||||
</div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
}
|
||||
},
|
||||
"ignoreDevUnusedFiles": false,
|
||||
"ignoreUploadUnusedFiles": false
|
||||
},
|
||||
"condition": {},
|
||||
"editorSetting": {
|
||||
|
|
|
@ -17,7 +17,7 @@ onLaunch(() => {
|
|||
});
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-ALIPAY
|
||||
// #ifdef MP-WEIXN || MP-TOUTIAO || H5
|
||||
uni.hideTabBar();
|
||||
// #endif
|
||||
});
|
||||
|
|
|
@ -40,14 +40,17 @@ const props = withDefaults(
|
|||
{
|
||||
list: [
|
||||
{
|
||||
imgUrl: "b-a1.png",
|
||||
},
|
||||
{
|
||||
imgUrl: "b-a2.png",
|
||||
},
|
||||
{
|
||||
imgUrl: "b-a3.png",
|
||||
},
|
||||
imgUrl: 'b-a1-1.1.1.png'
|
||||
}
|
||||
// {
|
||||
// imgUrl: "b-a1.png",
|
||||
// },
|
||||
// {
|
||||
// imgUrl: "b-a2.png",
|
||||
// },
|
||||
// {
|
||||
// imgUrl: "b-a3.png",
|
||||
// },
|
||||
],
|
||||
}
|
||||
);
|
||||
|
@ -75,6 +78,7 @@ const change = (e: any) => {
|
|||
cursor: pointer;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
.title {
|
||||
|
|
|
@ -0,0 +1,162 @@
|
|||
<template>
|
||||
<u-popup
|
||||
:show="show"
|
||||
mode="bottom"
|
||||
:round="10"
|
||||
:closeable="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<view class="c-dialog">
|
||||
<view class="confrim-box">
|
||||
<text @click="cancel()">取消</text>
|
||||
<text class="btn" @click="confirm()">完成</text>
|
||||
</view>
|
||||
|
||||
<!-- :class="{ active: state.currentStates === item.id }" -->
|
||||
|
||||
<view class="box-btn">
|
||||
<text
|
||||
v-for="(item, index) in state.statusList"
|
||||
:key="index"
|
||||
@click="handleSelect(item)"
|
||||
>{{ item.name }}</text
|
||||
></view
|
||||
>
|
||||
|
||||
<view class="timeBox">
|
||||
<uni-datetime-picker
|
||||
class="my-datetime-picker"
|
||||
v-model="state.datetimerange"
|
||||
type="datetimerange"
|
||||
rangeSeparator="-"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { formatDate, timeRange } from "@/utils";
|
||||
|
||||
const props = defineProps<{
|
||||
show: boolean;
|
||||
}>();
|
||||
const state = reactive<any>({
|
||||
datetimerange: [],
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
currentStates: -1,
|
||||
statusList: [
|
||||
{
|
||||
id: 1,
|
||||
name: "今日",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "昨日",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "本月",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "本年",
|
||||
},
|
||||
],
|
||||
});
|
||||
const emit = defineEmits(["handleDialog", "changeTime"]);
|
||||
const handleClose = () => {
|
||||
emit("handleDialog", false);
|
||||
};
|
||||
|
||||
const handleSelect = (item: any) => {
|
||||
state.currentStates = item.id;
|
||||
const range = timeRange(item.id);
|
||||
state.startTime = range.startTime + ' 00:00:00';
|
||||
state.endTime = range.endTime + ' 23:59:59';
|
||||
state.datetimerange = [state.startTime, state.endTime]
|
||||
};
|
||||
|
||||
const cancel = () => {
|
||||
emit("handleDialog", false)
|
||||
}
|
||||
|
||||
const confirm = () => {
|
||||
emit("changeTime", {
|
||||
startTime: state.datetimerange[0],
|
||||
endTime: state.datetimerange[1],
|
||||
name: "自定义",
|
||||
});
|
||||
emit("handleDialog", false);
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .u-popup__content {
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 32rpx 32rpx 0rpx 0rpx;
|
||||
}
|
||||
.c-dialog {
|
||||
margin: 22rpx;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
.box-btn,
|
||||
.box {
|
||||
line-height: 80rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.btn {
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: $u-primary;
|
||||
}
|
||||
}
|
||||
.box-btn {
|
||||
line-height: 40rpx;
|
||||
margin-bottom: 30rpx;
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
width: 140rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 6rpx;
|
||||
border: 1px solid rgba(153, 153, 153, 0.64);
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.active {
|
||||
border-color: $u-primary;
|
||||
color: $u-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.box-border {
|
||||
border-top: 1px solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
.line {
|
||||
height: 18rpx;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
}
|
||||
|
||||
.confrim-box {
|
||||
line-height: 80rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.btn {
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: $u-primary;
|
||||
}
|
||||
}
|
||||
.timeBox {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text {
|
||||
margin: 0rpx 22rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,114 @@
|
|||
<template>
|
||||
<u-popup :show="show" mode="bottom" :round="10" :closeable="false" @close="handleClose">
|
||||
<view class="c-dialog">
|
||||
<view>
|
||||
<view class="box">
|
||||
<text @click="handleClose">取消</text>
|
||||
<text class="btn" @click="handleOk">完成</text>
|
||||
</view>
|
||||
<uni-calendar
|
||||
:insert="true"
|
||||
:lunar="true"
|
||||
:start-date="'2014-1-1'"
|
||||
:end-date="'2099-1-1'"
|
||||
:range="true"
|
||||
@change="handleChangeDate"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { formatDate } from '@/utils';
|
||||
|
||||
const props = defineProps<{
|
||||
show: boolean,
|
||||
}>()
|
||||
|
||||
const beforeTime = ref(null)
|
||||
const emit = defineEmits(['handleDialog', 'handleOk']);
|
||||
const handleClose = () => {
|
||||
emit('handleDialog', false)
|
||||
}
|
||||
|
||||
const handleOk = () => {
|
||||
emit('handleOk', {startTime: state.startTime || beforeTime.value, endTime: state.endTime || beforeTime.value})
|
||||
emit('handleDialog', false)
|
||||
}
|
||||
|
||||
const showCalendar = ref(false)
|
||||
const state = reactive({
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
})
|
||||
const handleChangeDate = (v: any) => {
|
||||
const time1 = v.range.before;
|
||||
const time2 = v.range.after;
|
||||
beforeTime.value = time1
|
||||
if (time1 && time2) {
|
||||
const date1 = new Date(time1);
|
||||
const date2 = new Date(time2);
|
||||
if (date1 < date2) {
|
||||
state.startTime = formatDate(time1, "{y}-{m}-{d}");
|
||||
state.endTime = formatDate(time2, "{y}-{m}-{d}");
|
||||
} else if (date1 > date2) {
|
||||
state.startTime = formatDate(time2, "{y}-{m}-{d}");
|
||||
state.endTime = formatDate(time1, "{y}-{m}-{d}");
|
||||
} else {
|
||||
state.startTime = formatDate(time1, "{y}-{m}-{d}");
|
||||
state.endTime = formatDate(time2, "{y}-{m}-{d}");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
::v-deep .u-popup__content {
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 32rpx 32rpx 0rpx 0rpx;
|
||||
}
|
||||
.c-dialog {
|
||||
margin: 30rpx;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #000000;
|
||||
.box-btn,
|
||||
.box {
|
||||
line-height: 80rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.box-btn {
|
||||
line-height: 40rpx;
|
||||
margin-bottom: 30rpx;
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
width: 117rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 6rpx;
|
||||
border: 1px solid rgba(153, 153, 153, 0.64);
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.active {
|
||||
border-color: $u-primary;
|
||||
color: $u-primary;
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: $u-primary;
|
||||
}
|
||||
.box-border {
|
||||
border-top: 1px solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
.line {
|
||||
height: 18rpx;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,76 @@
|
|||
<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", "handleCancel"]);
|
||||
const handleClose = (v: string) => {
|
||||
emit("handleModal", false);
|
||||
if (v === 'ok') {
|
||||
// 走确认操作
|
||||
emit("handleOk");
|
||||
} else {
|
||||
emit("handleCancel")
|
||||
}
|
||||
};
|
||||
</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: $u-primary;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,126 @@
|
|||
<template>
|
||||
<view
|
||||
@click="handleOnline"
|
||||
style="position: fixed; bottom: 100px; z-index: 999; right: 20px"
|
||||
>
|
||||
<image
|
||||
:src="`${url}/static/img/service.png`"
|
||||
style="width: 100rpx; height: 100rpx"
|
||||
/>
|
||||
<!-- <up-icon name="chat" color="#fff" size="28">
|
||||
|
||||
</up-icon
|
||||
> -->
|
||||
</view>
|
||||
<!-- <view class="content">
|
||||
<movable-area class="movableArea">
|
||||
<movable-view
|
||||
class="movableView"
|
||||
:position="4"
|
||||
:x="x"
|
||||
:y="y"
|
||||
:direction="'none'"
|
||||
:damping="10"
|
||||
@change="onChange"
|
||||
@tap="onTap"
|
||||
@touchend="onTouchend"
|
||||
>
|
||||
<up-icon name="chat" color="#fff" size="28"></up-icon>
|
||||
</movable-view>
|
||||
</movable-area>
|
||||
</view> -->
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { url } from "@/utils/data";
|
||||
import { useMemberStore } from "@/store/index";
|
||||
import pinia from "@/store";
|
||||
const store = useMemberStore(pinia);
|
||||
const x = ref(300);
|
||||
const y = ref(500);
|
||||
const x1 = ref(0);
|
||||
const x2 = ref(0);
|
||||
const y1 = ref(0);
|
||||
const y2 = ref(0);
|
||||
const move = reactive({
|
||||
x: 0,
|
||||
y: 0,
|
||||
});
|
||||
|
||||
const handleOnline = () => {
|
||||
console.log(store)
|
||||
if (!store.profile.token) {
|
||||
uni.navigateTo({
|
||||
url: "/pagesLogin/index", // 要跳转到的页面路径
|
||||
});
|
||||
return;
|
||||
}
|
||||
//跳转到对应的webview页面并传入url和其他参数
|
||||
uni.navigateTo({
|
||||
url: "/pagesOnline/index",
|
||||
});
|
||||
};
|
||||
|
||||
function onChange(e: any) {
|
||||
if (e.detail.source === "touch") {
|
||||
move.x = e.detail.x;
|
||||
move.y = e.detail.y;
|
||||
}
|
||||
}
|
||||
function onTap(e: any) {
|
||||
console.log("Tap event");
|
||||
// 在这里处理单击事件的逻辑
|
||||
// 例如打开链接、执行动作等
|
||||
}
|
||||
function onTouchend() {
|
||||
x.value = move.x;
|
||||
y.value = move.y;
|
||||
setTimeout(() => {
|
||||
if (move.x < x2.value / 2) x.value = x1.value;
|
||||
else x.value = x2.value;
|
||||
console.log("yuan" + x.value, "y", y.value);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
uni.getSystemInfo({
|
||||
success: (res: any) => {
|
||||
x1.value = 0;
|
||||
x2.value = parseInt(res.windowWidth) - 50;
|
||||
y1.value = 0;
|
||||
y2.value = parseInt(res.windowHeight) - 20;
|
||||
setTimeout(() => {
|
||||
x.value = x2.value;
|
||||
y.value = parseInt((y2.value * 0.8).toString());
|
||||
move.x = x.value;
|
||||
move.y = y.value;
|
||||
}, 0);
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.movableArea {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.movableView {
|
||||
pointer-events: auto;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
padding: 10rpx;
|
||||
border-radius: 100%;
|
||||
border: 2px solid #608CF1;
|
||||
background-color: #608CF1;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,99 @@
|
|||
<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(800);
|
||||
|
||||
const loadMore = () => {
|
||||
console.log("**** 加载更多");
|
||||
if (props.noMoreData) return; // 如果没有更多数据,直接返回
|
||||
emit("loadList", true);
|
||||
};
|
||||
|
||||
const getBarHeight = () => {
|
||||
const res = uni.getSystemInfoSync();
|
||||
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) => {
|
||||
console.log(res, getBarHeight())
|
||||
clientHeight.value =
|
||||
res.windowHeight - uni.upx2px(props.height);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.height,
|
||||
(newValue, oldValue) => {
|
||||
getClineHeight();
|
||||
}
|
||||
);
|
||||
// ,{ deep: true, immediate:true}
|
||||
|
||||
// onLoad(() => {
|
||||
|
||||
// });
|
||||
// #ifdef MP-TOUTIAO || MP-WEIXIN || H5
|
||||
getClineHeight();
|
||||
// #endif
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.no-more-data-text {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,339 @@
|
|||
<template>
|
||||
<view>
|
||||
<!--自定义地址选择器-->
|
||||
<view class="cc_area_mask" v-show="show == true"></view>
|
||||
<view :class="'cc_area_view ' + (show ? 'show':'hide')">
|
||||
<view class="cc_area_view_btns">
|
||||
<text class="cc_area_view_btn_cancle" @tap="handleNYZAreaCancle">取消</text>
|
||||
<text class="cc_area_view_btn_sure" @tap="handleNYZAreaSelect" :data-province="province"
|
||||
:data-city="city" :data-area="area">确定</text>
|
||||
</view>
|
||||
<picker-view class="cc_area_pick_view" indicator-style="height: 35px;" @change="handleNYZAreaChange"
|
||||
:value="value">
|
||||
<picker-view-column>
|
||||
<view v-for="(item, index) in provinces" :key="index" class="cc_area_colum_view">{{item}}</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view v-for="(item, index) in citys" :key="index" class="cc_area_colum_view">{{item}}</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view v-for="(item, index) in areas" :key="index" class="cc_area_colum_view">{{item}}</view>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getProvinces,getMyCity,getAreas,getAreasCode} from "./area.js"
|
||||
|
||||
let index = [0, 0, 0];
|
||||
let provinces = getProvinces();
|
||||
let citys = getMyCity(index[0]);
|
||||
let areas = getMyCity(index[0], index[1]);
|
||||
|
||||
export default {
|
||||
mixins: [{
|
||||
methods: {
|
||||
setData: function(obj, callback) {
|
||||
let that = this;
|
||||
const handleData = (tepData, tepKey, afterKey) => {
|
||||
tepKey = tepKey.split('.');
|
||||
tepKey.forEach(item => {
|
||||
if (tepData[item] === null || tepData[item] === undefined) {
|
||||
let reg = /^[0-9]+$/;
|
||||
tepData[item] = reg.test(afterKey) ? [] : {};
|
||||
tepData = tepData[item];
|
||||
} else {
|
||||
tepData = tepData[item];
|
||||
}
|
||||
});
|
||||
return tepData;
|
||||
};
|
||||
const isFn = function(value) {
|
||||
return typeof value == 'function' || false;
|
||||
};
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
let val = obj[key];
|
||||
key = key.replace(/\]/g, '').replace(/\[/g, '.');
|
||||
let front, after;
|
||||
let index_after = key.lastIndexOf('.');
|
||||
if (index_after != -1) {
|
||||
after = key.slice(index_after + 1);
|
||||
front = handleData(that, key.slice(0, index_after), after);
|
||||
} else {
|
||||
after = key;
|
||||
front = that;
|
||||
}
|
||||
if (front.$data && front.$data[after] === undefined) {
|
||||
Object.defineProperty(front, after, {
|
||||
get() {
|
||||
return front.$data[after];
|
||||
},
|
||||
set(newValue) {
|
||||
front.$data[after] = newValue;
|
||||
that.$forceUpdate();
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
// #ifndef VUE3
|
||||
that.$set(front, after, val);
|
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
Reflect.set(front, after, val);
|
||||
// #endif
|
||||
|
||||
} else {
|
||||
|
||||
// #ifndef VUE3
|
||||
that.$set(front, after, val);
|
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
Reflect.set(front, after, val);
|
||||
// #endif
|
||||
}
|
||||
});
|
||||
isFn(callback) && this.$nextTick(callback);
|
||||
}
|
||||
}
|
||||
}],
|
||||
data() {
|
||||
return {
|
||||
provinces: getProvinces(),
|
||||
citys: getMyCity(index[0]),
|
||||
areas: getAreas(index[0], index[1]),
|
||||
value: [0, 0, 0]
|
||||
};
|
||||
},
|
||||
|
||||
components: {},
|
||||
props: {
|
||||
// 省
|
||||
province: {
|
||||
//控制area_select显示隐藏
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 市
|
||||
city: {
|
||||
//控制area_select显示隐藏
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 区
|
||||
area: {
|
||||
//控制area_select显示隐藏
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
|
||||
show: {
|
||||
//控制area_select显示隐藏
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
maskShow: {
|
||||
//是否显示蒙层
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
province() {
|
||||
this.init();
|
||||
},
|
||||
city() {
|
||||
this.init();
|
||||
},
|
||||
area() {
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// let provinceIndex = this.provinces.indexOf(this.province);
|
||||
// this.citys = getMyCity(provinceIndex);
|
||||
// let cityIndex = this.citys.indexOf(this.city);
|
||||
// this.areas = getAreas(provinceIndex, cityIndex);
|
||||
// let areaIndex = this.areas.indexOf(this.area);
|
||||
|
||||
// // 设置选择序列
|
||||
// this.value = [provinceIndex, cityIndex, areaIndex];
|
||||
// let areaCode = getAreasCode(provinceIndex, cityIndex, areaIndex);
|
||||
|
||||
this.init();
|
||||
|
||||
//console.log(areaCode)
|
||||
//console.log("this.value = " + JSON.stringify(this.value));
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
//console.log(this.area)
|
||||
let provinceIndex = this.provinces.indexOf(this.province);
|
||||
this.citys = getMyCity(provinceIndex);
|
||||
let cityIndex = this.citys.indexOf(this.city);
|
||||
this.areas = getAreas(provinceIndex, cityIndex);
|
||||
let areaIndex = this.areas.indexOf(this.area);
|
||||
|
||||
// 设置选择序列
|
||||
this.value = [provinceIndex, cityIndex, areaIndex];
|
||||
let areaCode = getAreasCode(provinceIndex, cityIndex, areaIndex);
|
||||
},
|
||||
handleNYZAreaChange: function(e) {
|
||||
var that = this;
|
||||
//console.log("e:" + JSON.stringify(e));
|
||||
var value = e.detail.value;
|
||||
/**
|
||||
* 滚动的是省
|
||||
* 省改变 市、区都不变
|
||||
*/
|
||||
|
||||
if (index[0] != value[0]) {
|
||||
index = [value[0], 0, 0];
|
||||
let selectCitys = getMyCity(index[0]);
|
||||
let selectAreas = getAreas(index[0], 0);
|
||||
that.setData({
|
||||
citys: selectCitys,
|
||||
areas: selectAreas,
|
||||
value: [index[0], 0, 0],
|
||||
|
||||
});
|
||||
|
||||
let areaCode = getAreasCode(index[0], index[1], index[2]);
|
||||
that.$emit("changeClick", provinces[index[0]], selectCitys[index[1]], selectAreas[index[2]],areaCode);
|
||||
|
||||
} else if (index[1] != value[1]) {
|
||||
/**
|
||||
* 市改变了 省不变 区变
|
||||
*/
|
||||
index = [value[0], value[1], 0];
|
||||
let selectCitys = getMyCity(index[0]);
|
||||
let selectAreas = getAreas(index[0], value[1]);
|
||||
that.setData({
|
||||
citys: selectCitys,
|
||||
areas: selectAreas,
|
||||
value: [index[0], index[1], 0],
|
||||
|
||||
});
|
||||
|
||||
let areaCode = getAreasCode(index[0], index[1], index[2]);
|
||||
that.$emit("changeClick", provinces[index[0]], selectCitys[index[1]], selectAreas[index[2]],areaCode);
|
||||
|
||||
} else if (index[2] != value[2]) {
|
||||
/**
|
||||
* 区改变了
|
||||
*/
|
||||
index = [value[0], value[1], value[2]];
|
||||
let selectCitys = getMyCity(index[0]);
|
||||
let selectAreas = getAreas(index[0], value[1]);
|
||||
that.setData({
|
||||
citys: selectCitys,
|
||||
areas: selectAreas,
|
||||
value: [index[0], index[1], index[2]],
|
||||
|
||||
});
|
||||
|
||||
let areaCode = getAreasCode(index[0], index[1], index[2]);
|
||||
that.$emit("changeClick", provinces[index[0]], selectCitys[index[1]], selectAreas[index[2]],areaCode);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 确定按钮的点击事件
|
||||
*/
|
||||
handleNYZAreaSelect: function(e) {
|
||||
var myEventDetail = e; // detail对象,提供给事件监听函数
|
||||
var myEventOption = {}; // 触发事件的选项
|
||||
this.$emit('sureSelectArea', {
|
||||
detail: myEventDetail
|
||||
}, myEventOption);
|
||||
|
||||
index = [0, 0, 0];
|
||||
},
|
||||
|
||||
/**
|
||||
* 取消按钮的点击事件
|
||||
*/
|
||||
handleNYZAreaCancle: function(e) {
|
||||
var that = this;
|
||||
//console.log("e:" + JSON.stringify(e));
|
||||
this.$emit('hideShow', {
|
||||
detail: false
|
||||
});
|
||||
// 复原初始状态
|
||||
index = [0, 0, 0];
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.cc_area_view {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: -1000px;
|
||||
left: 0px;
|
||||
background-color: #fff;
|
||||
z-index: 21;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.cc_area_pick_view {
|
||||
height: 400px;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.cc_area_colum_view {
|
||||
line-height: 35px;
|
||||
text-align: center;
|
||||
font-size: 28upx;
|
||||
}
|
||||
|
||||
.hide {
|
||||
bottom: -1000upx;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.show {
|
||||
bottom: 0upx;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.cc_area_view_btns {
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #eeeeee;
|
||||
font-size: 30upx;
|
||||
padding: 18upx 0upx;
|
||||
}
|
||||
|
||||
.cc_area_view_btns>text {
|
||||
display: inline-block;
|
||||
word-spacing: 4upx;
|
||||
letter-spacing: 4upx;
|
||||
}
|
||||
|
||||
.cc_area_view_btn_cancle {
|
||||
color: #939393;
|
||||
padding-right: 20upx;
|
||||
padding-left: 25upx;
|
||||
}
|
||||
|
||||
.cc_area_view_btn_sure {
|
||||
float: right;
|
||||
padding-left: 20upx;
|
||||
padding-right: 25upx;
|
||||
}
|
||||
|
||||
.cc_area_mask {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: rgba(28, 28, 28, 0.6);
|
||||
position: absolute;
|
||||
top: 0upx;
|
||||
left: 0upx;
|
||||
z-index: 20;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,332 @@
|
|||
<template>
|
||||
<view>
|
||||
<!--自定义地址选择器-->
|
||||
<view class="cc_area_mask" v-show="show == true"></view>
|
||||
<view :class="'cc_area_view ' + (show ? 'show':'hide')">
|
||||
<view class="cc_area_view_btns">
|
||||
<text class="cc_area_view_btn_cancle" @tap="handleNYZAreaCancle">取消</text>
|
||||
<text class="cc_area_view_btn_title" style="color: #393939;font-size: 32upx;">地区选择</text>
|
||||
<text class="cc_area_view_btn_sure" @tap="handleNYZAreaSelect" :data-province="province"
|
||||
:data-city="city" :data-area="area" style="color: #4284e5;">确定</text>
|
||||
</view>
|
||||
<picker-view class="cc_area_pick_view" indicator-style="height: 35px;" @change="handleNYZAreaChange"
|
||||
:value="value">
|
||||
<picker-view-column>
|
||||
<view v-for="(item, index) in provinces" :key="index" class="cc_area_colum_view">{{item}}</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view v-for="(item, index) in citys" :key="index" class="cc_area_colum_view">{{item}}</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view v-for="(item, index) in areas" :key="index" class="cc_area_colum_view">{{item}}</view>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getProvinces,
|
||||
getMyCity,
|
||||
getAreas,
|
||||
getAreasCode
|
||||
} from "./area.js"
|
||||
|
||||
let index = [0, 0, 0];
|
||||
let provinces = getProvinces();
|
||||
let citys = getMyCity(index[0]);
|
||||
let areas = getMyCity(index[0], index[1]);
|
||||
|
||||
export default {
|
||||
mixins: [{
|
||||
methods: {
|
||||
setData: function(obj, callback) {
|
||||
let that = this;
|
||||
const handleData = (tepData, tepKey, afterKey) => {
|
||||
tepKey = tepKey.split('.');
|
||||
tepKey.forEach(item => {
|
||||
if (tepData[item] === null || tepData[item] === undefined) {
|
||||
let reg = /^[0-9]+$/;
|
||||
tepData[item] = reg.test(afterKey) ? [] : {};
|
||||
tepData = tepData[item];
|
||||
} else {
|
||||
tepData = tepData[item];
|
||||
}
|
||||
});
|
||||
return tepData;
|
||||
};
|
||||
const isFn = function(value) {
|
||||
return typeof value == 'function' || false;
|
||||
};
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
let val = obj[key];
|
||||
key = key.replace(/\]/g, '').replace(/\[/g, '.');
|
||||
let front, after;
|
||||
let index_after = key.lastIndexOf('.');
|
||||
if (index_after != -1) {
|
||||
after = key.slice(index_after + 1);
|
||||
front = handleData(that, key.slice(0, index_after), after);
|
||||
} else {
|
||||
after = key;
|
||||
front = that;
|
||||
}
|
||||
if (front.$data && front.$data[after] === undefined) {
|
||||
Object.defineProperty(front, after, {
|
||||
get() {
|
||||
return front.$data[after];
|
||||
},
|
||||
set(newValue) {
|
||||
front.$data[after] = newValue;
|
||||
that.$forceUpdate();
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
// #ifndef VUE3
|
||||
that.$set(front, after, val);
|
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
Reflect.set(front, after, val);
|
||||
// #endif
|
||||
|
||||
} else {
|
||||
|
||||
// #ifndef VUE3
|
||||
that.$set(front, after, val);
|
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
Reflect.set(front, after, val);
|
||||
// #endif
|
||||
}
|
||||
});
|
||||
isFn(callback) && this.$nextTick(callback);
|
||||
}
|
||||
}
|
||||
}],
|
||||
data() {
|
||||
return {
|
||||
provinces: getProvinces(),
|
||||
citys: getMyCity(index[0]),
|
||||
areas: getAreas(index[0], index[1]),
|
||||
value: [0, 0, 0]
|
||||
};
|
||||
},
|
||||
|
||||
components: {},
|
||||
props: {
|
||||
// 省
|
||||
province: {
|
||||
//控制area_select显示隐藏
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 市
|
||||
city: {
|
||||
//控制area_select显示隐藏
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 区
|
||||
area: {
|
||||
//控制area_select显示隐藏
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
|
||||
show: {
|
||||
//控制area_select显示隐藏
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
maskShow: {
|
||||
//是否显示蒙层
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
province() {
|
||||
this.init();
|
||||
},
|
||||
city() {
|
||||
this.init();
|
||||
},
|
||||
area() {
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let provinceIndex = this.provinces.indexOf(this.province);
|
||||
this.citys = getMyCity(provinceIndex);
|
||||
let cityIndex = this.citys.indexOf(this.city);
|
||||
this.areas = getAreas(provinceIndex, cityIndex);
|
||||
let areaIndex = this.areas.indexOf(this.area);
|
||||
|
||||
// 设置选择序列
|
||||
this.value = [provinceIndex, cityIndex, areaIndex];
|
||||
let areaCode = getAreasCode(provinceIndex, cityIndex, areaIndex);
|
||||
//console.log(areaCode)
|
||||
//console.log("this.value = " + JSON.stringify(this.value));
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
//console.log(this.area)
|
||||
let provinceIndex = this.provinces.indexOf(this.province);
|
||||
this.citys = getMyCity(provinceIndex);
|
||||
let cityIndex = this.citys.indexOf(this.city);
|
||||
this.areas = getAreas(provinceIndex, cityIndex);
|
||||
let areaIndex = this.areas.indexOf(this.area);
|
||||
|
||||
//获取地区编码
|
||||
let areaCode = getAreasCode(provinceIndex, cityIndex, areaIndex);
|
||||
// 设置选择序列
|
||||
this.value = [provinceIndex, cityIndex, areaIndex];
|
||||
|
||||
},
|
||||
handleNYZAreaChange: function(e) {
|
||||
var that = this;
|
||||
var value = e.detail.value;
|
||||
|
||||
// 更新 index
|
||||
index = value;
|
||||
|
||||
// 获取对应的城市和区域数据
|
||||
let selectCitys = getMyCity(index[0]);
|
||||
let selectAreas = getAreas(index[0], index[1]);
|
||||
|
||||
// 触发 setData 更新数据
|
||||
that.setData({
|
||||
citys: selectCitys,
|
||||
areas: selectAreas,
|
||||
value: index
|
||||
});
|
||||
|
||||
let areaCode = getAreasCode(index[0], index[1], index[2]);
|
||||
|
||||
// 触发事件
|
||||
that.$emit("changeClick", provinces[index[0]], selectCitys[index[1]], selectAreas[index[2]], areaCode);
|
||||
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 确定按钮的点击事件
|
||||
*/
|
||||
handleNYZAreaSelect: function(e) {
|
||||
var myEventDetail = e;
|
||||
var myEventOption = {};
|
||||
this.$emit('sureSelectArea', {
|
||||
detail: myEventDetail
|
||||
}, myEventOption);
|
||||
|
||||
// 复原初始状态
|
||||
index = [0, 0, 0];
|
||||
},
|
||||
|
||||
handleNYZAreaCancle: function(e) {
|
||||
var that = this;
|
||||
|
||||
this.$emit('hideShow', {
|
||||
detail: false
|
||||
});
|
||||
|
||||
// 复原初始状态
|
||||
index = [0, 0, 0];
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 取消按钮的点击事件
|
||||
*/
|
||||
handleNYZAreaCancle: function(e) {
|
||||
var that = this;
|
||||
//console.log("e:" + JSON.stringify(e));
|
||||
this.$emit('hideShow', {
|
||||
detail: false
|
||||
});
|
||||
// 复原初始状态
|
||||
index = [0, 0, 0];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.cc_area_view {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: -1000px;
|
||||
left: 0px;
|
||||
background-color: #fff;
|
||||
z-index: 21;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.cc_area_pick_view {
|
||||
height: 400px;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.cc_area_colum_view {
|
||||
line-height: 35px;
|
||||
text-align: center;
|
||||
font-size: 28upx;
|
||||
}
|
||||
|
||||
.hide {
|
||||
bottom: -1000upx;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.show {
|
||||
bottom: 0upx;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.cc_area_view_btns {
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #eeeeee;
|
||||
font-size: 30upx;
|
||||
padding: 18upx 0upx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.cc_area_view_btns>text {
|
||||
display: inline-block;
|
||||
word-spacing: 4upx;
|
||||
letter-spacing: 4upx;
|
||||
}
|
||||
|
||||
.cc_area_view_btn_cancle {
|
||||
color: #939393;
|
||||
padding-right: 20upx;
|
||||
padding-left: 25upx;
|
||||
}
|
||||
|
||||
.cc_area_view_btn_sure {
|
||||
float: right;
|
||||
padding-left: 20upx;
|
||||
padding-right: 25upx;
|
||||
}
|
||||
|
||||
.cc_area_mask {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: rgba(28, 28, 28, 0.6);
|
||||
position: absolute;
|
||||
top: 0upx;
|
||||
left: 0upx;
|
||||
z-index: 20;
|
||||
}
|
||||
</style>
|
|
@ -134,7 +134,7 @@
|
|||
}
|
||||
&--submit {
|
||||
// background: #5773f9;
|
||||
background-color: $u-primary;;
|
||||
background-color: $u-primary;
|
||||
color: #fff;
|
||||
}
|
||||
&--delete {
|
||||
|
|
|
@ -5,9 +5,11 @@ import App from "./App.vue";
|
|||
import './static/style/common.scss'
|
||||
|
||||
import TabBar from "@/components/TabBar/index.vue"//路径根据你的文件修改
|
||||
import myMixin from "@/pages/minix/index.js";
|
||||
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App);
|
||||
app.mixin(myMixin);
|
||||
app.use(uviewPlus);
|
||||
app.use(pinia);
|
||||
app.component('TabBar', TabBar)
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx9251d74fe0e87028",
|
||||
"appid" : "wx3c231250b822fbf5",
|
||||
"logoPath" : "https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/logo-simple.png",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
|
|
|
@ -25,6 +25,13 @@
|
|||
// "navigationStyle": "custom", // 控制头部是否显示
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pagesLogin/index",
|
||||
"style": {
|
||||
// "navigationStyle": "custom", // 控制头部是否显示
|
||||
"navigationBarTitleText": "登陆"
|
||||
}
|
||||
}
|
||||
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
],
|
||||
|
@ -85,11 +92,17 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"path": "registration",
|
||||
"path": "regisList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我要登记"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "registration",
|
||||
"style": {
|
||||
"navigationBarTitleText": "登记信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "recycleFlow",
|
||||
"style": {
|
||||
|
@ -101,9 +114,73 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "所需材料"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "recovery",
|
||||
"style": {
|
||||
"navigationBarTitleText": "登记信息"
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pagesOnline",
|
||||
"pages": [
|
||||
{
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "在线咨询"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pagesOrder",
|
||||
"pages": [
|
||||
{
|
||||
"path": "vehicle/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "报废车辆回收"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "vehicle/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "battery/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "报废电池回收"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "joinus/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "加入我们"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "collection",
|
||||
"style": {
|
||||
"navigationBarTitleText": "收款信息"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
// {
|
||||
// "root": "pagesLogin",
|
||||
// "pages": [
|
||||
// {
|
||||
// "path": "index",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "登陆"
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#7A7E83",
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
title1: "",
|
||||
path1: "",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
//#ifdef MP-WEIXIN
|
||||
wx.showShareMenu({
|
||||
withShareTicket: true,
|
||||
menus: ["shareAppMessage", "shareTimeline"],
|
||||
});
|
||||
// 尝试通过 uni.getCurrentPages 获取当前页面栈,然后获取栈顶页面的路由信息
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length > 0) {
|
||||
const currentPage = pages[pages.length - 1];
|
||||
this.path1 = currentPage.route;
|
||||
}
|
||||
|
||||
//#endif
|
||||
},
|
||||
//2.配置分享好友
|
||||
onShareAppMessage(res) {
|
||||
return {
|
||||
title: this.title1,
|
||||
path: this.path1,
|
||||
};
|
||||
},
|
||||
//2.配置分享到朋友圈
|
||||
onShareTimeline(res) {
|
||||
return {
|
||||
title: this.title1,
|
||||
path: this.path1,
|
||||
};
|
||||
},
|
||||
};
|
|
@ -87,12 +87,17 @@
|
|||
>
|
||||
</view>
|
||||
</uni-card>
|
||||
<OpOnline />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import CustomSwiper from "@/components/CustomSwiper/index.vue";
|
||||
import OpOnline from "@/components/OpOnline/index.vue";
|
||||
import { url } from "@/utils/data";
|
||||
import { useMemberStore } from "@/store/index";
|
||||
import pinia from "@/store";
|
||||
const store = useMemberStore(pinia);
|
||||
|
||||
const bannerList = [
|
||||
{
|
||||
|
@ -181,12 +186,18 @@ const questionList = ref([
|
|||
]);
|
||||
|
||||
const handleClick = (item: any) => {
|
||||
if (!store.profile.token) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesLogin/index', // 要跳转到的页面路径
|
||||
});
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: item.url, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
||||
const callNumber = (number:any) => {
|
||||
const callNumber = (number: any) => {
|
||||
// 判断是否为移动端
|
||||
if (
|
||||
uni.getSystemInfoSync().platform === "android" ||
|
||||
|
@ -231,7 +242,7 @@ const callNumber = (number:any) => {
|
|||
.text {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #294ac7;
|
||||
color: #608CF1;
|
||||
line-height: 42rpx;
|
||||
}
|
||||
.desc {
|
||||
|
|
|
@ -1,16 +1,5 @@
|
|||
<template>
|
||||
<Layout>
|
||||
<!-- 轮播图 -->
|
||||
<!-- <button
|
||||
open-type="im"
|
||||
:data-im-id="'13918346152'"
|
||||
@im="imCallback"
|
||||
@error="onimError"
|
||||
class="animate-button"
|
||||
>
|
||||
点击咨询
|
||||
</button> -->
|
||||
|
||||
<CustomSwiper> </CustomSwiper>
|
||||
<!-- 入口 -->
|
||||
<view class="entry-card">
|
||||
|
@ -39,64 +28,66 @@
|
|||
<!-- 介绍 -->
|
||||
<view class="avatar-card">
|
||||
<uni-card
|
||||
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
|
||||
:padding="'10px 10px'"
|
||||
:shadow="'0rpx 0rpx 0rpx 0rpx rgba(5,68,37,0.12)'"
|
||||
:padding="'0px 0px'"
|
||||
:border="false"
|
||||
>
|
||||
<view class="title">爱梵达</view>
|
||||
<image
|
||||
:src="`/static/avatar/1.jpg`"
|
||||
<!-- <view class="title">爱梵达</view> -->
|
||||
<!-- <image
|
||||
:src="`${url}/static/avatar/1.jpg`"
|
||||
:mode="'widthFix'"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<image
|
||||
:src="`/static/avatar/2.jpg`"
|
||||
:src="`${url}/static/avatar/2.jpg`"
|
||||
:mode="'widthFix'"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<image
|
||||
:src="`/static/avatar/3.jpg`"
|
||||
:src="`${url}/static/avatar/3.jpg`"
|
||||
:mode="'widthFix'"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<image
|
||||
:src="`/static/avatar/4.jpg`"
|
||||
:src="`${url}/static/avatar/4.jpg`"
|
||||
:mode="'widthFix'"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<image
|
||||
:src="`/static/avatar/5.jpg`"
|
||||
:src="`${url}/static/avatar/5.jpg`"
|
||||
:mode="'widthFix'"
|
||||
style="width: 100%"
|
||||
/> -->
|
||||
<image
|
||||
:src="`${url}/static/img/6.png`"
|
||||
:mode="'widthFix'"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</uni-card>
|
||||
</view>
|
||||
<OpOnline />
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import CustomSwiper from "@/components/CustomSwiper/index.vue";
|
||||
import OpOnline from "@/components/OpOnline/index.vue";
|
||||
import Layout from "@/components/Layout/index.vue";
|
||||
import { url } from "@/utils/data";
|
||||
const bannerList = [
|
||||
{
|
||||
imgUrl: "v-a1.png",
|
||||
},
|
||||
];
|
||||
|
||||
const entryItemList = ref([
|
||||
{
|
||||
path: "1.png",
|
||||
path: "01.png",
|
||||
name: "报废车辆回收",
|
||||
url: "/pagesVehicle/index",
|
||||
},
|
||||
{
|
||||
path: "2.png",
|
||||
path: "02.png",
|
||||
name: "电池回收",
|
||||
url: "/pagesBattery/index",
|
||||
},
|
||||
{
|
||||
path: "3.png",
|
||||
path: "03.png",
|
||||
name: "废钢回收",
|
||||
url: "/pagesScrapSteel/index",
|
||||
},
|
||||
|
@ -107,14 +98,6 @@ const handleClick = (item: any) => {
|
|||
url: item.url, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
||||
const imCallback = (e: any) => {
|
||||
console.log("跳转IM客服成功", e.detail);
|
||||
};
|
||||
|
||||
const onimError = (e: any) => {
|
||||
console.log("拉起IM客服失败", e.detail);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -3,19 +3,52 @@
|
|||
<view class="profile">
|
||||
<view class="baseinfo">
|
||||
<view class="head">
|
||||
<image :src="`${url}/static/img/profile/user.png`" class="user"></image>
|
||||
<image
|
||||
:src="`${url}/static/img/profile/user.png`"
|
||||
class="user"
|
||||
></image>
|
||||
<view>
|
||||
<view>
|
||||
<text class="name">{{ '用户' || "-" }}</text>
|
||||
<text class="name">{{ profile.name || "-" }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="company">{{ '-' || "-" }}</text>
|
||||
<text class="company">{{ profile.phone || "-" }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="entry-card">
|
||||
<uni-card
|
||||
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
|
||||
:padding="'10px'"
|
||||
:margin="'10px 0px'"
|
||||
:border="false"
|
||||
>
|
||||
<view class="title">我的订单</view>
|
||||
<uni-grid :column="3" :showBorder="false" :square="false">
|
||||
<uni-grid-item
|
||||
v-for="(item, index) in entryItemList"
|
||||
:key="index"
|
||||
>
|
||||
<view class="item">
|
||||
<view @click="handleClickEntry(item)">
|
||||
<view>
|
||||
<image :src="`${url}/static/img/${item.path}`"></image>
|
||||
</view>
|
||||
<view>
|
||||
<text class="text">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
</uni-card>
|
||||
</view>
|
||||
<view class="content">
|
||||
<u-list :height="'200px'">
|
||||
<u-list-item v-for="(item, index) in list" :key="index">
|
||||
<u-list-item
|
||||
v-for="(item, index) in isHasToken() ? list : list1"
|
||||
:key="index"
|
||||
>
|
||||
<u-cell
|
||||
:title="item.name"
|
||||
arrow-direction="right"
|
||||
|
@ -38,13 +71,35 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<SmallModal
|
||||
:title="'确认退出吗?'"
|
||||
:content="'退出后将返回至登陆页'"
|
||||
:okText="'确认退出'"
|
||||
:isMain="true"
|
||||
:show="isShowCancelModal"
|
||||
@handleModal="(v:boolean) => {handleModal(v)}"
|
||||
@handleOk="handleOk()"
|
||||
/>
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Layout from "@/components/Layout/index.vue";
|
||||
import { useMemberStore } from "@/store/index";
|
||||
import pinia from "@/store";
|
||||
import { url } from "@/utils/data";
|
||||
const list = reactive([
|
||||
import { UserApi } from "@/services";
|
||||
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||
const store = useMemberStore(pinia);
|
||||
const profile = store.profile.userInfo;
|
||||
function isHasToken () {
|
||||
return store.profile.token !== ""
|
||||
}
|
||||
const list = reactive<any>([
|
||||
{
|
||||
name: "收款信息",
|
||||
icon: "pay.png",
|
||||
},
|
||||
{
|
||||
name: "用户协议",
|
||||
icon: "4.png",
|
||||
|
@ -53,22 +108,92 @@ const list = reactive([
|
|||
name: "隐私政策",
|
||||
icon: "5.png",
|
||||
},
|
||||
{
|
||||
name: "退出登录",
|
||||
icon: "3.png",
|
||||
path: "",
|
||||
},
|
||||
]);
|
||||
const list1 = reactive<any>([
|
||||
{
|
||||
name: "收款信息",
|
||||
icon: "pay.png",
|
||||
},
|
||||
{
|
||||
name: "用户协议",
|
||||
icon: "4.png",
|
||||
},
|
||||
{
|
||||
name: "隐私政策",
|
||||
icon: "5.png",
|
||||
}
|
||||
]);
|
||||
|
||||
const entryItemList = ref([
|
||||
{
|
||||
path: "p1.png",
|
||||
name: "报废车辆回收",
|
||||
url: "/pagesOrder/vehicle/index",
|
||||
},
|
||||
{
|
||||
path: "p2.png",
|
||||
name: "电池回收",
|
||||
url: "/pagesOrder/battery/index",
|
||||
},
|
||||
{
|
||||
path: "p3.png",
|
||||
name: "加入我们",
|
||||
url: "/pagesOrder/joinus/index",
|
||||
},
|
||||
]);
|
||||
|
||||
const handleClickEntry = (item: any) => {
|
||||
uni.navigateTo({
|
||||
url: item.url, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
||||
const hanldeClick = (item: any) => {
|
||||
if (item.name === "用户协议") {
|
||||
openDoc("在生万有用户协议");
|
||||
} else if (item.name === "隐私政策") {
|
||||
openDoc("在生万有隐私政策");
|
||||
} else if (item.name === "收款信息") {
|
||||
uni.navigateTo({
|
||||
url: "/pagesOrder/collection", // 要跳转到的页面路径
|
||||
});
|
||||
} else if (item.name === "退出登录") {
|
||||
handleModal(true);
|
||||
}
|
||||
};
|
||||
|
||||
const isShowCancelModal = ref(false);
|
||||
const handleModal = (v: boolean) => {
|
||||
isShowCancelModal.value = v;
|
||||
};
|
||||
|
||||
const handleOk = () => {
|
||||
UserApi.logOut({}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
store.clearProfile();
|
||||
uni.reLaunch({
|
||||
url: "/pagesLogin/index", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
const openDoc = (item: string) => {
|
||||
//文件预览
|
||||
const isWX = uni.getSystemInfoSync().uniPlatform === 'mp-weixin'
|
||||
console.log(`${url}/static/${isWX && (item === '在生万有隐私政策') ? 'weixin/' : ''}${item}.docx`)
|
||||
const isWX = uni.getSystemInfoSync().uniPlatform === "mp-weixin";
|
||||
console.log(
|
||||
`${url}/static/${
|
||||
isWX && item === "在生万有隐私政策" ? "weixin/" : ""
|
||||
}${item}.docx`
|
||||
);
|
||||
uni.downloadFile({
|
||||
url: `${url}/static/${isWX && (item === '在生万有隐私政策') ? 'weixin/' : ''}${item}.docx`,
|
||||
url: `${url}/static/${
|
||||
isWX && item === "在生万有隐私政策" ? "weixin/" : ""
|
||||
}${item}.docx`,
|
||||
success: function (res) {
|
||||
setTimeout(
|
||||
() =>
|
||||
|
@ -95,24 +220,24 @@ const openDoc = (item: string) => {
|
|||
});
|
||||
};
|
||||
|
||||
//隐藏官方的tabBar
|
||||
// #ifdef MP-ALIPAY
|
||||
my.hideTabBar({
|
||||
animation: false, // 是否需要动画效果,alipay 1.95.0支持此参数
|
||||
success: (res) => {
|
||||
// 隐藏成功的回调
|
||||
console.log("TabBar has been hidden", res);
|
||||
},
|
||||
fail: (err) => {
|
||||
// 隐藏失败的回调
|
||||
console.error("Failed to hide TabBar", err);
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
//隐藏官方的tabBar
|
||||
// #ifdef MP-ALIPAY
|
||||
my.hideTabBar({
|
||||
animation: false, // 是否需要动画效果,alipay 1.95.0支持此参数
|
||||
success: (res) => {
|
||||
// 隐藏成功的回调
|
||||
console.log("TabBar has been hidden", res);
|
||||
},
|
||||
fail: (err) => {
|
||||
// 隐藏失败的回调
|
||||
console.error("Failed to hide TabBar", err);
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-ALIPAY
|
||||
uni.hideTabBar();
|
||||
// #endif
|
||||
// #ifdef MP-WEIXN || MP-TOUTIAO || H5
|
||||
uni.hideTabBar();
|
||||
// #endif
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -157,6 +282,27 @@ const openDoc = (item: string) => {
|
|||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.entry-card {
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.item {
|
||||
text-align: center;
|
||||
image {
|
||||
width: 74rpx;
|
||||
height: 76rpx;
|
||||
}
|
||||
.text {
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
line-height: 42rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,285 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="title">欢迎使用在生万有回收平台</view>
|
||||
<view class="logo">
|
||||
<image :src="`${url}/static/img/logo.png`"></image>
|
||||
</view>
|
||||
<view class="login-form">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="loginForm"
|
||||
:labelWidth="0"
|
||||
>
|
||||
<u-form-item prop="userInfo.phone">
|
||||
<u-input
|
||||
v-model="model1.userInfo.phone"
|
||||
placeholder="请输入手机号"
|
||||
:shape="'circle'"
|
||||
clearable
|
||||
:customStyle="{
|
||||
'border-color':
|
||||
currentFocus === 'phone' ? '#00dcee !important' : '',
|
||||
}"
|
||||
border="none"
|
||||
type="number"
|
||||
@focus="handleFocus('phone')"
|
||||
@change="(e:any) => {handleInput(e, 'phone')}"
|
||||
@clear="handleClear({ key: 'phone' })"
|
||||
>
|
||||
</u-input>
|
||||
</u-form-item>
|
||||
<u-form-item prop="userInfo.code">
|
||||
<u-input
|
||||
v-model="model1.userInfo.code"
|
||||
placeholder="请输入验证码"
|
||||
:shape="'circle'"
|
||||
type="text"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="seconds === 0" class="code_text" @click="getCode"
|
||||
>获取验证码</text
|
||||
>
|
||||
<text v-else class="code_text">{{ seconds }}s后重新发送</text>
|
||||
</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 class="agree">
|
||||
<u-checkbox
|
||||
:key="1"
|
||||
:size="'28rpx'"
|
||||
:activeColor="'#608CF1'"
|
||||
:name="1"
|
||||
:usedAlone="true"
|
||||
:checked="checkGroup.agreeCheck"
|
||||
@change="
|
||||
(v:any) => {
|
||||
checkGroup.agreeCheck = v;
|
||||
}
|
||||
"
|
||||
></u-checkbox>
|
||||
<view>
|
||||
我已阅读并同意在生万有
|
||||
<text class="agree-item" @click="openDoc('在生万有用户协议')"
|
||||
>《 用户协议 》</text
|
||||
>
|
||||
和
|
||||
<text class="agree-item" @click="openDoc('在生万有隐私政策')"
|
||||
>《 隐私政策 》</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Layout from "@/components/Layout/index.vue";
|
||||
import { useMemberStore } from "@/store/index";
|
||||
import valid from "@/utils/validate";
|
||||
import pinia from "@/store";
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
import { url } from "@/utils/data";
|
||||
import { UserApi } from "@/services";
|
||||
|
||||
const handleClear = (item: any) => {
|
||||
setTimeout(() => {
|
||||
(model1.userInfo as any)[item.key] = "";
|
||||
}, 100);
|
||||
};
|
||||
const store = useMemberStore(pinia);
|
||||
const loginForm = ref(null);
|
||||
const model1 = reactive({
|
||||
userInfo: {
|
||||
phone: "",
|
||||
code: "",
|
||||
},
|
||||
});
|
||||
const seconds = ref(0);
|
||||
// 控制focus 边框样式
|
||||
const currentFocus = ref("");
|
||||
// 记住密码 // 同意协议
|
||||
const checkGroup = reactive({
|
||||
agreeCheck: false,
|
||||
});
|
||||
|
||||
const rules = ref({
|
||||
"userInfo.phone": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.code": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入验证码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
|
||||
const getCode = () => {
|
||||
if (!valid.mobile.pattern.test(model1.userInfo.phone)) {
|
||||
uni.showToast({ icon: "none", title: "请输入正确的手机号" });
|
||||
return;
|
||||
}
|
||||
sendMsg();
|
||||
};
|
||||
const sendMsg = () => {
|
||||
UserApi.sendMsg({ phone: model1.userInfo.phone }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.$u.toast("验证码已发送");
|
||||
seconds.value = 60;
|
||||
let countDownTimer = setInterval(() => {
|
||||
if (seconds.value > 0) {
|
||||
--seconds.value;
|
||||
} else {
|
||||
clearInterval(countDownTimer);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleInput = (e: any, key: string) => {
|
||||
if (key === "phone") {
|
||||
const temp = e?.replace(valid.valid_number, "");
|
||||
setTimeout(() => {
|
||||
(model1.userInfo as any)[key] = temp;
|
||||
}, 10);
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
(loginForm.value as any).validate().then((res: any) => {
|
||||
if (res) {
|
||||
if (!checkGroup.agreeCheck) {
|
||||
uni.showToast({
|
||||
title: "请同意协议",
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
UserApi.loginPhone(model1.userInfo).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
store.setProfile(res.data);
|
||||
uni.reLaunch({
|
||||
url: "/pagesHome/index", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const openDoc = (item: string) => {
|
||||
//文件预览
|
||||
const isWX = uni.getSystemInfoSync().uniPlatform === "mp-weixin";
|
||||
console.log(
|
||||
`${url}/static/${
|
||||
isWX && item === "在生万有隐私政策" ? "weixin/" : ""
|
||||
}${item}.docx`
|
||||
);
|
||||
uni.downloadFile({
|
||||
url: `${url}/static/${
|
||||
isWX && item === "在生万有隐私政策" ? "weixin/" : ""
|
||||
}${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); //失败
|
||||
},
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
padding: 100rpx 0rpx;
|
||||
}
|
||||
.logo {
|
||||
text-align: center;
|
||||
image {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.login-form {
|
||||
margin-top: 50rpx;
|
||||
padding: 0rpx 50rpx;
|
||||
}
|
||||
::v-deep .u-form-item__body__right__content {
|
||||
border-radius: 100px;
|
||||
border: 1px solid #dadbde;
|
||||
}
|
||||
.custom-icon {
|
||||
width: 37.18rpx;
|
||||
height: 18.59rpx;
|
||||
}
|
||||
.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;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
.code_text {
|
||||
color: $u-primary;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,13 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 在这里使用 web-view 组件来嵌入 H5 页面 -->
|
||||
<web-view :src="url"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useMemberStore } from "@/store/index";
|
||||
import pinia from "@/store";
|
||||
const store = useMemberStore(pinia);
|
||||
let url = `https://ykf-weixin01.7moor.com/wapchat.html?accessId=2c6004e0-7631-11ef-90d7-f1a5ae18c977&fromUrl=http://&urlTitle=001&language=ZHCN&wechatOrAppImplant=true&otherParams={"nickName":"${store.profile.userName}"}&clientId=${store.profile.userId}`
|
||||
</script>
|
|
@ -0,0 +1,343 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="custom-tab">
|
||||
<up-tabs
|
||||
:list="[{ name: '询价列表' }, { name: '登记列表' }]"
|
||||
@click="handleTab"
|
||||
></up-tabs>
|
||||
</view>
|
||||
<view class="filter">
|
||||
<view @click="handleSort"
|
||||
>创建时间<u-icon :name="state.isUp ? 'arrow-up' : 'arrow-down'"></u-icon
|
||||
></view>
|
||||
<view @click="state.isShowStatus = true"
|
||||
>状态<u-icon name="arrow-down"></u-icon
|
||||
></view>
|
||||
<view style="width: 65%" @click="state.showTime = true">
|
||||
<u-input
|
||||
v-model="state.startTime"
|
||||
disabled
|
||||
disabledColor=""
|
||||
placeholder="开始时间"
|
||||
></u-input>
|
||||
<text>-</text>
|
||||
<u-input
|
||||
v-model="state.endTime"
|
||||
disabled
|
||||
disabledColor=""
|
||||
placeholder="结束时间"
|
||||
></u-input>
|
||||
<u-icon name="arrow-down"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="294"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="box">
|
||||
<scroll-view :enable-flex="true" scroll-x class="scroll-view">
|
||||
<uni-table stripe emptyText="">
|
||||
<!-- 表头行 -->
|
||||
<uni-tr>
|
||||
<block
|
||||
v-for="(item, index) in state.tab === 1
|
||||
? tableTitleList1
|
||||
: tableTitleList"
|
||||
:key="index"
|
||||
>
|
||||
<uni-th>{{ item.name }} </uni-th>
|
||||
</block>
|
||||
</uni-tr>
|
||||
<!-- 表格数据行 -->
|
||||
<uni-tr v-for="(item, index) in pageList.list" :key="index">
|
||||
<uni-td
|
||||
v-for="(tItem, index) in state.tab === 1
|
||||
? tableTitleList1
|
||||
: tableTitleList"
|
||||
:key="index"
|
||||
>
|
||||
<view>
|
||||
<text v-if="tItem.key === 'status'">
|
||||
{{ item[tItem.key] ? "已处理" : "待处理" }}
|
||||
</text>
|
||||
<text
|
||||
v-else-if="tItem.key === 'photoUrl' && item[tItem.key]"
|
||||
class="btn"
|
||||
@click="showImage(item)"
|
||||
>
|
||||
照片
|
||||
</text>
|
||||
<text v-else>
|
||||
{{ item[tItem.key] }}
|
||||
</text>
|
||||
</view></uni-td
|
||||
>
|
||||
</uni-tr>
|
||||
</uni-table>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</page-view>
|
||||
|
||||
<view class="btn-box-fix-btn">
|
||||
<view
|
||||
><u-button type="primary" shape="circle" @click="goInquiry()"
|
||||
>去询价</u-button
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 状态 -->
|
||||
<u-action-sheet
|
||||
:closeOnClickOverlay="true"
|
||||
:closeOnClickAction="true"
|
||||
:actions="actionSheet.statusList"
|
||||
:title="'单据状态'"
|
||||
:show="state.isShowStatus"
|
||||
@select="handleSelectStatus"
|
||||
@close="state.isShowStatus = false"
|
||||
></u-action-sheet>
|
||||
|
||||
<TimeRangeFilter
|
||||
:show="state.showTime"
|
||||
@handleDialog="(v:boolean) => {state.showTime = v}"
|
||||
@handleOk="changeTime"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
import TimeRangeFilter from "@/components/Dialog/TimeRangeFilter.vue";
|
||||
import { BatteryApi } from "@/services";
|
||||
import pinia from "@/store";
|
||||
import { useMemberStore } from "@/store/index";
|
||||
const state = reactive({
|
||||
tab: 0,
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
showTime: false,
|
||||
status: -1,
|
||||
isShowStatus: false,
|
||||
isUp: false,
|
||||
});
|
||||
const pageList: PageResult<any> = reactive({
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
});
|
||||
const resetPageList = () => {
|
||||
pageList.noMoreData = false;
|
||||
pageList.total = 0;
|
||||
pageList.list = [];
|
||||
pageList.pageNum = 1;
|
||||
pageList.pageSize = 100;
|
||||
};
|
||||
const tableTitleList = reactive([
|
||||
{
|
||||
name: "时间",
|
||||
key: "createdTime",
|
||||
},
|
||||
{
|
||||
name: "状态",
|
||||
key: "status",
|
||||
},
|
||||
{
|
||||
name: "回收种类",
|
||||
key: "recyclingType",
|
||||
},
|
||||
{
|
||||
name: "回收重量",
|
||||
key: "recyclingWeight",
|
||||
},
|
||||
{
|
||||
name: "照片",
|
||||
key: "photoUrl",
|
||||
},
|
||||
]);
|
||||
const tableTitleList1 = reactive([
|
||||
{
|
||||
name: "时间",
|
||||
key: "createdTime",
|
||||
},
|
||||
{
|
||||
name: "状态",
|
||||
key: "status",
|
||||
},
|
||||
{
|
||||
name: "回收种类",
|
||||
key: "recyclingType",
|
||||
},
|
||||
{
|
||||
name: "回收重量",
|
||||
key: "recyclingWeight",
|
||||
},
|
||||
{
|
||||
name: "上门时间",
|
||||
key: "preferredVisitTime",
|
||||
},
|
||||
{
|
||||
name: "照片",
|
||||
key: "photoUrl",
|
||||
},
|
||||
]);
|
||||
const actionSheet = reactive({
|
||||
statusList: [
|
||||
{
|
||||
name: "全部",
|
||||
key: -1,
|
||||
},
|
||||
{
|
||||
name: "待处理",
|
||||
key: 0,
|
||||
},
|
||||
{
|
||||
name: "已处理",
|
||||
key: 1,
|
||||
},
|
||||
],
|
||||
});
|
||||
const showImage = (item: any) => {
|
||||
uni.previewImage({
|
||||
urls: [item.photoUrl], // 图片列表
|
||||
current: 0, // 当前显示图片的索引
|
||||
indicator: "default", // 图片指示器样式,默认为圆点
|
||||
loop: true,
|
||||
});
|
||||
};
|
||||
|
||||
function handleTab(item: any) {
|
||||
state.tab = item.index;
|
||||
resetPageList();
|
||||
getList();
|
||||
}
|
||||
const changeTime = (obj: any) => {
|
||||
state.startTime = obj.startTime;
|
||||
state.endTime = obj.endTime;
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
|
||||
const handleSelectStatus = (v: any) => {
|
||||
state.isShowStatus = false;
|
||||
state.status = v.key;
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
|
||||
const handleSort = () => {
|
||||
state.isUp = !state.isUp;
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
|
||||
const goInquiry = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesBattery/inquiry", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
||||
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,
|
||||
};
|
||||
if (state.status > -1) {
|
||||
params.status = state.status;
|
||||
}
|
||||
if (state.startTime && state.endTime) {
|
||||
params.startTime = state.startTime;
|
||||
params.endTime = state.endTime;
|
||||
}
|
||||
params.isUp = state.isUp;
|
||||
pageList.isLoading = true;
|
||||
if (state.tab === 1) {
|
||||
BatteryApi.queryRegis(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
pageList.list = pageList.list = pageList.list.concat(res.data.list);
|
||||
pageList.total = res.data.total;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
BatteryApi.queryInquiry(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
pageList.list = pageList.list = pageList.list.concat(res.data.list);
|
||||
pageList.total = res.data.total;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// function goDetail(item: any) {
|
||||
// uni.navigateTo({
|
||||
// url: "/pagesOrder/vehicle/detail?id=" + item.id + `&status=${item.status}`,
|
||||
// });
|
||||
// }
|
||||
|
||||
getList();
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.custom-tab {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.filter {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
font-size: 28rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
> view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
::v-deep.u-input__content__field-wrapper__field {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
padding: 28rpx 20rpx;
|
||||
.btn {
|
||||
color: $u-primary;
|
||||
}
|
||||
.scroll-view {
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
::v-deep.uni-table {
|
||||
min-width: 700px !important;
|
||||
}
|
||||
}
|
||||
.btn-box-fix-btn {
|
||||
justify-content: center;
|
||||
view {
|
||||
width: 70%;
|
||||
}
|
||||
}
|
||||
.regis {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
padding-top: 15px;
|
||||
width: 100% !important;
|
||||
color: $u-primary;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,218 @@
|
|||
<template>
|
||||
<uni-card
|
||||
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
|
||||
:margin="'20px'"
|
||||
:border="false"
|
||||
>
|
||||
<view class="title">收款信息</view>
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="80"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-input
|
||||
v-if="item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
:disabled="item.disabled"
|
||||
:type="['contactPhone'].indexOf(item.key) > -1 ? 'number' : 'text'"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</uni-card>
|
||||
|
||||
<view class="btn-box-fix-btn">
|
||||
<view
|
||||
><u-button type="primary" shape="circle" @click="save"
|
||||
>保存</u-button
|
||||
></view
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { UserApi } from "@/services";
|
||||
import pinia from "@/store";
|
||||
import { useMemberStore } from "@/store/index";
|
||||
import { onMounted } from "vue";
|
||||
const store = useMemberStore(pinia);
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "收款账号",
|
||||
key: "paymentAccount",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "收款名称",
|
||||
key: "paymentName",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "开户行",
|
||||
key: "bankName",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
]);
|
||||
const rules = reactive({
|
||||
"formData.paymentAccount": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入收款账号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.paymentName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入收款名称",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.bankName": {
|
||||
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 save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
// if (store.profile?.token) {
|
||||
// check().then((res) => {
|
||||
// if (res) {
|
||||
// startSave();
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// uni.login({
|
||||
// provider: "toutiao",
|
||||
// success: function (loginRes) {
|
||||
// UserApi.login({ code: loginRes.code }).then((res) => {
|
||||
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
};
|
||||
|
||||
const startSave = () => {
|
||||
UserApi.updatePay(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: "提交成功",
|
||||
});
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
UserApi.getPayInfo({}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.data) {
|
||||
model1.formData = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .uni-card__content {
|
||||
padding: 20rpx !important;
|
||||
height: calc(100vh - 200px);
|
||||
overflow: auto;
|
||||
}
|
||||
::v-deep .uni-card--shadow {
|
||||
padding: 0px !important;
|
||||
}
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
border-bottom: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
margin: 0px 20rpx;
|
||||
padding: 0px 20rpx;
|
||||
}
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
}
|
||||
.btn-box-fix-btn {
|
||||
justify-content: center;
|
||||
view {
|
||||
width: 70%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,224 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- <view class="filter">
|
||||
<view @click="handleSort"
|
||||
>创建时间<u-icon :name="state.isUp ? 'arrow-up' : 'arrow-down'"></u-icon
|
||||
></view>
|
||||
<view @click="state.isShowStatus = true"
|
||||
>状态<u-icon name="arrow-down"></u-icon
|
||||
></view>
|
||||
<view style="width: 65%" @click="state.showTime = true">
|
||||
<u-input
|
||||
v-model="state.startTime"
|
||||
disabled
|
||||
disabledColor=""
|
||||
placeholder="开始时间"
|
||||
></u-input>
|
||||
<text>-</text>
|
||||
<u-input
|
||||
v-model="state.endTime"
|
||||
disabled
|
||||
disabledColor=""
|
||||
placeholder="结束时间"
|
||||
></u-input>
|
||||
<u-icon name="arrow-down"></u-icon>
|
||||
</view>
|
||||
</view> -->
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="150"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="box">
|
||||
<scroll-view :enable-flex="true" scroll-x class="scroll-view">
|
||||
<uni-table stripe emptyText="">
|
||||
<!-- 表头行 -->
|
||||
<uni-tr>
|
||||
<uni-th v-for="(item, index) in tableTitleList" :key="index"
|
||||
>{{ item.name }}
|
||||
</uni-th>
|
||||
</uni-tr>
|
||||
<!-- 表格数据行 -->
|
||||
<uni-tr v-for="(item, index) in pageList.list" :key="index">
|
||||
<uni-td v-for="(tItem, index) in tableTitleList" :key="index">
|
||||
<view>
|
||||
<text v-if="tItem.key === 'status'">
|
||||
{{ item[tItem.key] ? "已处理" : "未处理" }}
|
||||
</text>
|
||||
<text v-else>
|
||||
{{ item[tItem.key] }}
|
||||
</text>
|
||||
</view></uni-td
|
||||
>
|
||||
<!-- <uni-td>
|
||||
<text class="btn" @click="handleCancel(item)"> 撤销 </text>
|
||||
</uni-td> -->
|
||||
</uni-tr>
|
||||
</uni-table>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</page-view>
|
||||
|
||||
<view class="btn-box-fix-btn">
|
||||
<view
|
||||
><u-button type="primary" shape="circle" @click="goInquiry()"
|
||||
>加入我们</u-button
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 状态 -->
|
||||
<!-- <u-action-sheet
|
||||
:closeOnClickOverlay="true"
|
||||
:closeOnClickAction="true"
|
||||
:actions="actionSheet.statusList"
|
||||
:title="'单据状态'"
|
||||
:show="state.isShowStatus"
|
||||
@select="handleSelectStatus"
|
||||
@close="state.isShowStatus = false"
|
||||
></u-action-sheet>
|
||||
|
||||
<TimeRangeFilter
|
||||
:show="state.showTime"
|
||||
@handleDialog="(v:boolean) => {state.showTime = v}"
|
||||
@handleOk="changeTime"
|
||||
/> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
import TimeRangeFilter from "@/components/Dialog/TimeRangeFilter.vue";
|
||||
import { SteelApi } from "@/services";
|
||||
import pinia from "@/store";
|
||||
import { useMemberStore } from "@/store/index";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
const state = reactive({
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
showTime: false,
|
||||
status: -1,
|
||||
isShowStatus: false,
|
||||
isUp: false,
|
||||
});
|
||||
const pageList: PageResult<any> = reactive({
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
});
|
||||
const resetPageList = () => {
|
||||
pageList.noMoreData = false;
|
||||
pageList.total = 0;
|
||||
pageList.list = [];
|
||||
pageList.pageNum = 1;
|
||||
pageList.pageSize = 100;
|
||||
};
|
||||
const tableTitleList = reactive([
|
||||
{
|
||||
name: "时间",
|
||||
key: "createdTime",
|
||||
},
|
||||
{
|
||||
name: "状态",
|
||||
key: "status",
|
||||
},
|
||||
{
|
||||
name: "公司名称",
|
||||
key: "companyName",
|
||||
},
|
||||
]);
|
||||
|
||||
const goInquiry = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesScrapSteel/registration", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
||||
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;
|
||||
SteelApi.getApplyList(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
pageList.list = pageList.list = pageList.list.concat(res.data.list);
|
||||
pageList.total = res.data.total;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// function goDetail(item: any) {
|
||||
// uni.navigateTo({
|
||||
// url: "/pagesOrder/vehicle/detail?id=" + item.id + `&status=${item.status}`,
|
||||
// });
|
||||
// }
|
||||
|
||||
onShow(() => {
|
||||
resetPageList()
|
||||
getList();
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.filter {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
font-size: 28rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
> view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
::v-deep.u-input__content__field-wrapper__field {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
padding: 28rpx 20rpx;
|
||||
.btn {
|
||||
color: $u-primary;
|
||||
}
|
||||
.scroll-view {
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
::v-deep.uni-table {
|
||||
min-width: 300px !important;
|
||||
}
|
||||
}
|
||||
.btn-box-fix-btn {
|
||||
justify-content: center;
|
||||
view {
|
||||
width: 70%;
|
||||
}
|
||||
}
|
||||
.regis {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
padding-top: 15px;
|
||||
width: 100% !important;
|
||||
color: $u-primary;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,309 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="detail">
|
||||
<!-- 订单状态:0已取消,1待登记,2待处理,3,待上门,4待打款,5已完结 -->
|
||||
<block v-for="(item, value) in listMap" :key="value">
|
||||
<view v-if="statusInfo[model1.status].indexOf(value) > -1">
|
||||
<view>
|
||||
<view class="title">{{ item.name }}</view>
|
||||
<view class="content">
|
||||
<view v-for="(iitem, index) in item.attrList" :key="index">
|
||||
{{ iitem.name }}:
|
||||
|
||||
<view v-if="iitem.name === '行驶证'" class="license">
|
||||
<up-row customStyle="flex-wrap: wrap" :gutter="8">
|
||||
<up-col span="6">
|
||||
<view class="grid-item">
|
||||
<image
|
||||
v-if="model1.formData[iitem.key]"
|
||||
:src="model1.formData[iitem.key]"
|
||||
:mode="'widthFix'"
|
||||
:width="'100%'"
|
||||
></image>
|
||||
</view>
|
||||
</up-col>
|
||||
|
||||
<up-col span="6">
|
||||
<view class="grid-item">
|
||||
<image
|
||||
v-if="model1.formData['licenseBackUrl']"
|
||||
:src="model1.formData['licenseBackUrl']"
|
||||
:mode="'widthFix'"
|
||||
:width="'100%'"
|
||||
></image>
|
||||
</view>
|
||||
</up-col>
|
||||
</up-row>
|
||||
<view> </view>
|
||||
</view>
|
||||
<text v-else
|
||||
>{{ model1.formData[iitem.key] || "-" }}
|
||||
{{ iitem.unit }}</text
|
||||
>
|
||||
</view></view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn-box-fix-btn" v-if="model1.formData.status === 2 || model1.formData.status === 1">
|
||||
<view
|
||||
>
|
||||
<u-button
|
||||
v-if="model1.formData.status === 1"
|
||||
type="primary"
|
||||
shape="circle"
|
||||
@click="goRegis(model1.formData.id);"
|
||||
>去登记</u-button
|
||||
>
|
||||
<u-button
|
||||
v-if="model1.formData.status === 2"
|
||||
type="primary"
|
||||
shape="circle"
|
||||
@click="handleModal(true);"
|
||||
>取消订单</u-button
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<SmallModal
|
||||
:title="'确认取消订单吗?'"
|
||||
:content="'退出后将返回至上一页'"
|
||||
:okText="'确认'"
|
||||
:isMain="true"
|
||||
:show="isShowCancelModal"
|
||||
@handleModal="(v:boolean) => {handleModal(v)}"
|
||||
@handleOk="handleOk()"
|
||||
/>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { VehicleApi } from "@/services";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||
import { reactive } from "vue";
|
||||
const isShowCancelModal = ref(false);
|
||||
const handleModal = (v: boolean) => {
|
||||
isShowCancelModal.value = v;
|
||||
};
|
||||
const handleOk = () => {
|
||||
handelOrder(0)
|
||||
};
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
status: 0,
|
||||
});
|
||||
const statusInfo = reactive<any>({
|
||||
0: ["regis", "car", "vehicle"],
|
||||
1: ["vehicle"],
|
||||
2: ["regis", "car", "vehicle"],
|
||||
3: ["room", "regis", "car", "vehicle"],
|
||||
4: ["settle", "room", "regis", "car", "vehicle"],
|
||||
5: ["payment", "settle", "room", "regis", "car", "vehicle"],
|
||||
});
|
||||
const listMap = reactive<any>({
|
||||
payment: {
|
||||
name: "打款信息",
|
||||
attrList: [
|
||||
{
|
||||
name: "打款时间",
|
||||
value: "",
|
||||
key: "paymentTime",
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "打款金额",
|
||||
value: "",
|
||||
key: "paymentPrice",
|
||||
unit: "元",
|
||||
},
|
||||
],
|
||||
},
|
||||
settle: {
|
||||
name: "结算信息",
|
||||
attrList: [
|
||||
{
|
||||
name: "过磅重量",
|
||||
value: "",
|
||||
key: "netWeight",
|
||||
unit: "KG",
|
||||
},
|
||||
{
|
||||
name: "结算金额",
|
||||
value: "",
|
||||
key: "paymentPrice",
|
||||
unit: "元",
|
||||
},
|
||||
],
|
||||
},
|
||||
room: {
|
||||
name: "上门服务",
|
||||
attrList: [
|
||||
{
|
||||
name: "上门时间",
|
||||
value: "",
|
||||
key: "upDoorTime",
|
||||
},
|
||||
],
|
||||
},
|
||||
regis: {
|
||||
name: "登记信息",
|
||||
attrList: [
|
||||
{
|
||||
name: "车辆所属",
|
||||
value: "",
|
||||
key: "ownerType",
|
||||
},
|
||||
{
|
||||
name: "联系人",
|
||||
value: "",
|
||||
key: "ownerName",
|
||||
},
|
||||
{
|
||||
name: "联系方式",
|
||||
value: "",
|
||||
key: "ownerPhone",
|
||||
},
|
||||
{
|
||||
name: "上门地址",
|
||||
value: "",
|
||||
key: "location",
|
||||
},
|
||||
],
|
||||
},
|
||||
car: {
|
||||
name: "我要选新车",
|
||||
attrList: [
|
||||
{
|
||||
name: "选择品牌",
|
||||
value: "",
|
||||
key: "brandName",
|
||||
},
|
||||
{
|
||||
name: "预算范围",
|
||||
value: "",
|
||||
key: "budgetRange",
|
||||
},
|
||||
],
|
||||
},
|
||||
vehicle: {
|
||||
name: "车辆信息",
|
||||
attrList: [
|
||||
{
|
||||
name: "行驶证",
|
||||
value: "",
|
||||
key: "licensePhotoUrl",
|
||||
},
|
||||
{
|
||||
name: "车辆类型",
|
||||
value: "",
|
||||
key: "vehicleType",
|
||||
},
|
||||
{
|
||||
name: "燃油类别",
|
||||
value: "",
|
||||
key: "fuelType",
|
||||
},
|
||||
{
|
||||
name: "钢圈材质",
|
||||
value: "",
|
||||
key: "wheelMaterial",
|
||||
},
|
||||
{
|
||||
name: "整车质量",
|
||||
value: "",
|
||||
key: "curbWeight",
|
||||
unit: "KG",
|
||||
},
|
||||
{
|
||||
name: "车架号",
|
||||
value: "",
|
||||
key: "vin",
|
||||
},
|
||||
{
|
||||
name: "品牌型号",
|
||||
value: "",
|
||||
key: "brandModel",
|
||||
},
|
||||
{
|
||||
name: "系列",
|
||||
value: "",
|
||||
key: "series",
|
||||
},
|
||||
{
|
||||
name: "总重量",
|
||||
value: "",
|
||||
key: "totalWeight",
|
||||
unit: "KG",
|
||||
},
|
||||
{
|
||||
name: "车牌号",
|
||||
value: "",
|
||||
key: "licensePlate",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
function handelOrder(type: number) {
|
||||
VehicleApi.updateRegis({
|
||||
...model1.formData,
|
||||
ownerType: model1.formData.ownerType === "单位",
|
||||
status: 0,
|
||||
}).then((res) => {
|
||||
uni.navigateBack();
|
||||
});
|
||||
}
|
||||
|
||||
function goRegis(id: number) {
|
||||
uni.navigateTo({
|
||||
url: "/pagesVehicle/registration?id=" + id, // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
onLoad((option: any) => {
|
||||
// 接收传递的标题参数
|
||||
if (option.id) {
|
||||
model1.formData.id = option.id;
|
||||
model1.status = option.status;
|
||||
VehicleApi.getDetail({ id: option.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
model1.formData = {
|
||||
...res.data,
|
||||
ownerType: res.data.ownerType ? "单位" : "个人",
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.detail {
|
||||
padding: 40rpx;
|
||||
font-size: 32rpx;
|
||||
.title {
|
||||
font-weight: bold;
|
||||
font-size: 34rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.content {
|
||||
> view {
|
||||
line-height: 60rpx;
|
||||
}
|
||||
.license {
|
||||
.grid-item {
|
||||
position: relative;
|
||||
padding: 10rpx;
|
||||
image {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn-box-fix-btn {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,299 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="filter">
|
||||
<view @click="handleSort"
|
||||
>创建时间<u-icon :name="state.isUp ? 'arrow-up' : 'arrow-down'"></u-icon
|
||||
></view>
|
||||
<view @click="state.isShowStatus = true"
|
||||
>状态<u-icon name="arrow-down"></u-icon
|
||||
></view>
|
||||
<view style="width: 65%" @click="state.showTime = true">
|
||||
<u-input
|
||||
v-model="state.startTime"
|
||||
disabled
|
||||
disabledColor=""
|
||||
placeholder="开始时间"
|
||||
></u-input>
|
||||
<text>-</text>
|
||||
<u-input
|
||||
v-model="state.endTime"
|
||||
disabled
|
||||
disabledColor=""
|
||||
placeholder="结束时间"
|
||||
></u-input>
|
||||
<u-icon name="arrow-down"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="204"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="box">
|
||||
<scroll-view :enable-flex="true" scroll-x class="scroll-view">
|
||||
<uni-table stripe emptyText="">
|
||||
<!-- 表头行 -->
|
||||
<uni-tr>
|
||||
<uni-th v-for="(item, index) in tableTitleList" :key="index"
|
||||
>{{ item.name }}
|
||||
</uni-th>
|
||||
</uni-tr>
|
||||
<!-- 表格数据行 -->
|
||||
<uni-tr v-for="(item, index) in pageList.list" :key="index">
|
||||
<uni-td v-for="(tItem, index) in tableTitleList" :key="index">
|
||||
<view @click="goDetail(item)">
|
||||
<text v-if="tItem.key === 'status'">
|
||||
{{
|
||||
[
|
||||
"已取消",
|
||||
"待登记",
|
||||
"待处理",
|
||||
"待上门",
|
||||
"待打款",
|
||||
"已完结",
|
||||
][item[tItem.key]]
|
||||
}}
|
||||
</text>
|
||||
<text v-else>
|
||||
{{ item[tItem.key] }}
|
||||
</text>
|
||||
</view></uni-td
|
||||
>
|
||||
</uni-tr>
|
||||
</uni-table>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</page-view>
|
||||
|
||||
<view class="btn-box-fix-btn">
|
||||
<view
|
||||
><u-button type="primary" shape="circle" @click="goInquiry()"
|
||||
>去询价</u-button
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 状态 -->
|
||||
<u-action-sheet
|
||||
:closeOnClickOverlay="true"
|
||||
:closeOnClickAction="true"
|
||||
:actions="actionSheet.statusList"
|
||||
:title="'单据状态'"
|
||||
:show="state.isShowStatus"
|
||||
@select="handleSelectStatus"
|
||||
@close="state.isShowStatus = false"
|
||||
></u-action-sheet>
|
||||
|
||||
<TimeRangeFilter
|
||||
:show="state.showTime"
|
||||
@handleDialog="(v:boolean) => {state.showTime = v}"
|
||||
@handleOk="changeTime"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
import TimeRangeFilter from "@/components/Dialog/TimeRangeFilter.vue";
|
||||
import { VehicleApi } from "@/services";
|
||||
import pinia from "@/store";
|
||||
import { useMemberStore } from "@/store/index";
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
const state = reactive({
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
showTime: false,
|
||||
status: -1,
|
||||
isShowStatus: false,
|
||||
isUp: false,
|
||||
});
|
||||
const pageList: PageResult<any> = reactive({
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
});
|
||||
const resetPageList = () => {
|
||||
pageList.noMoreData = false;
|
||||
pageList.total = 0;
|
||||
pageList.list = [];
|
||||
pageList.pageNum = 1;
|
||||
pageList.pageSize = 100;
|
||||
};
|
||||
const tableTitleList = reactive([
|
||||
{
|
||||
name: "时间",
|
||||
key: "createdTime",
|
||||
},
|
||||
{
|
||||
name: "状态",
|
||||
key: "status",
|
||||
},
|
||||
{
|
||||
name: "品牌型号",
|
||||
key: "brandModel",
|
||||
},
|
||||
{
|
||||
name: "总重量",
|
||||
key: "totalWeight",
|
||||
},
|
||||
{
|
||||
name: "预估价格",
|
||||
key: "totalPrice",
|
||||
},
|
||||
{
|
||||
name: "过磅重量",
|
||||
key: "netWeight",
|
||||
},
|
||||
{
|
||||
name: "实际价格",
|
||||
key: "paymentPrice",
|
||||
},
|
||||
]);
|
||||
const actionSheet = reactive({
|
||||
statusList: [
|
||||
{
|
||||
name: "全部",
|
||||
key: -1,
|
||||
},
|
||||
{
|
||||
name: "已取消",
|
||||
key: 0,
|
||||
},
|
||||
{
|
||||
name: "待登记",
|
||||
key: 1,
|
||||
},
|
||||
{
|
||||
name: "待处理",
|
||||
key: 2,
|
||||
},
|
||||
{
|
||||
name: "待上门",
|
||||
key: 3,
|
||||
},
|
||||
{
|
||||
name: "待打款",
|
||||
key: 4,
|
||||
},
|
||||
{
|
||||
name: "已完结",
|
||||
key: 5,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const changeTime = (obj: any) => {
|
||||
state.startTime = obj.startTime;
|
||||
state.endTime = obj.endTime;
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
|
||||
const handleSelectStatus = (v: any) => {
|
||||
state.isShowStatus = false;
|
||||
state.status = v.key;
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
|
||||
const handleSort = () => {
|
||||
state.isUp = !state.isUp;
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
|
||||
const goInquiry = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesVehicle/inquiry", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
||||
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,
|
||||
};
|
||||
if (state.status > -1) {
|
||||
params.status = state.status;
|
||||
}
|
||||
if (state.startTime && state.endTime) {
|
||||
params.startTime = state.startTime;
|
||||
params.endTime = state.endTime;
|
||||
}
|
||||
params.isUp = state.isUp;
|
||||
pageList.isLoading = true;
|
||||
VehicleApi.getRegisList(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
pageList.list = pageList.list = pageList.list.concat(res.data.list);
|
||||
pageList.total = res.data.total;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function goDetail(item: any) {
|
||||
uni.navigateTo({
|
||||
url: "/pagesOrder/vehicle/detail?id=" + item.id + `&status=${item.status}`,
|
||||
});
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
resetPageList()
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.filter {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
font-size: 28rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
> view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
::v-deep.u-input__content__field-wrapper__field {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
padding: 28rpx 20rpx;
|
||||
.scroll-view {
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
::v-deep.uni-table {
|
||||
min-width: 700px !important;
|
||||
}
|
||||
}
|
||||
.btn-box-fix-btn {
|
||||
justify-content: center;
|
||||
view {
|
||||
width: 70%;
|
||||
}
|
||||
}
|
||||
.regis {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
padding-top: 15px;
|
||||
width: 100% !important;
|
||||
color: $u-primary;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
|
@ -77,12 +77,17 @@
|
|||
>
|
||||
</view>
|
||||
</uni-card>
|
||||
<OpOnline />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import CustomSwiper from "@/components/CustomSwiper/index.vue";
|
||||
import OpOnline from "@/components/OpOnline/index.vue";
|
||||
import { url } from "@/utils/data";
|
||||
import { useMemberStore } from "@/store/index";
|
||||
import pinia from "@/store";
|
||||
const store = useMemberStore(pinia);
|
||||
const bannerList = [
|
||||
{
|
||||
imgUrl: "v-a1.png",
|
||||
|
@ -108,7 +113,7 @@ const entryItemList = ref([
|
|||
{
|
||||
path: "4.png",
|
||||
name: "我要登记",
|
||||
url: "/pagesVehicle/registration",
|
||||
url: "/pagesVehicle/regisList",
|
||||
},
|
||||
]);
|
||||
const serviceItemList = ref([
|
||||
|
@ -178,6 +183,14 @@ const questionList = ref([
|
|||
]);
|
||||
|
||||
const handleClick = (item: any) => {
|
||||
if (item.name === "我要询价" || item.name === "我要登记") {
|
||||
if (!store.profile.token) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesLogin/index', // 要跳转到的页面路径
|
||||
});
|
||||
return
|
||||
}
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: item.url, // 要跳转到的页面路径
|
||||
});
|
||||
|
|
|
@ -4,97 +4,206 @@
|
|||
:margin="'20px'"
|
||||
:border="false"
|
||||
>
|
||||
<view class="uni-card__content">
|
||||
<view class="title">车辆信息</view>
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="80"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
<view class="uni-card__content">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="80"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-input
|
||||
v-if="item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
:disabled="item.disabled"
|
||||
:type="
|
||||
['contactInfo', 'curbWeight'].indexOf(item.key) > -1
|
||||
? 'number'
|
||||
: 'text'
|
||||
"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
|
||||
<!-- 上传 -->
|
||||
<view v-if="item.type === 'upload'">
|
||||
<view>(拍照上传后自动识别车辆信息)</view>
|
||||
<view style="padding-left: 20rpx; margin-top: 20rpx">
|
||||
<image
|
||||
@click="handleUpload"
|
||||
:src="
|
||||
model1.formData.licensePhotoUrl ||
|
||||
`${url}/static/img/vehicle/upload.png`
|
||||
"
|
||||
style="width: 203rpx; height: 133rpx"
|
||||
/>
|
||||
</view>
|
||||
<view style="padding-left: 20rpx; margin-top: 10rpx"
|
||||
>点击上传行驶证主页</view
|
||||
<view class="title">车辆信息</view>
|
||||
<view v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-form-item
|
||||
v-if="item.name !== '行驶证'"
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
@click="item.fn"
|
||||
>
|
||||
</view>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</view>
|
||||
<u-input
|
||||
v-if="item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
:disabled="item.disabled"
|
||||
:type="
|
||||
['contactInfo', 'curbWeight'].indexOf(item.key) > -1
|
||||
? 'number'
|
||||
: 'text'
|
||||
"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
<view v-else-if="item.name === '行驶证'">
|
||||
<view style="padding: 22rpx">
|
||||
<text
|
||||
style="color: #f56c6c; font-size: 20px; margin-right: 5px"
|
||||
></text>
|
||||
<text style="color: #303133; font-size: 15px; line-height: 22px"
|
||||
>行驶证</text
|
||||
>(拍照上传后自动识别车辆信息)</view
|
||||
>
|
||||
<view style="display: flex; justify-content: space-around">
|
||||
<view>
|
||||
<view style="padding-left: 20rpx; margin-top: 20rpx">
|
||||
<image
|
||||
@click="handleUpload(1)"
|
||||
:src="
|
||||
model1.formData.licensePhotoUrl ||
|
||||
`${url}/static/img/vehicle/upload.png`
|
||||
"
|
||||
style="width: 203rpx; height: 133rpx"
|
||||
/>
|
||||
</view>
|
||||
<view style="padding-left: 20rpx; margin-top: 10rpx"
|
||||
>点击上传行驶证主页</view
|
||||
>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view style="padding-left: 20rpx; margin-top: 20rpx">
|
||||
<image
|
||||
@click="handleUpload(2)"
|
||||
:src="
|
||||
model1.formData.licenseBackUrl ||
|
||||
`${url}/static/img/vehicle/upload.png`
|
||||
"
|
||||
style="width: 203rpx; height: 133rpx"
|
||||
/>
|
||||
</view>
|
||||
<view style="padding-left: 20rpx; margin-top: 10rpx"
|
||||
>点击上传行驶证副页</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="title">登记信息</view>
|
||||
|
||||
<u-form-item
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList1"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-input
|
||||
v-if="item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
:disabled="item.disabled"
|
||||
:disabledColor="'#ffffff'"
|
||||
:type="['contactInfo'].indexOf(item.key) > -1 ? 'number' : 'text'"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
|
||||
<view class="title mt-30">我要选新车</view>
|
||||
|
||||
<u-form-item
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList2"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-form-item> -->
|
||||
</u-form>
|
||||
</view>
|
||||
</uni-card>
|
||||
|
||||
<view class="btn-box-fix-btn">
|
||||
<view
|
||||
><u-button type="primary" shape="circle" @click="save"
|
||||
><u-button type="primary" shape="circle" @click="beforeSave"
|
||||
>提交询价</u-button
|
||||
></view
|
||||
>
|
||||
</view>
|
||||
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<block
|
||||
v-for="(item, index) in formAttrList
|
||||
.concat(formAttrList1)
|
||||
.concat(formAttrList2)"
|
||||
:key="index"
|
||||
>
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select' && item.childKey"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
|
@ -105,6 +214,73 @@
|
|||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
|
||||
<!-- 车牌号 -->
|
||||
<CarNoDialog
|
||||
:show="showDialog.showCarNo"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showCarNo', v)}"
|
||||
@changeCarNo="changeCarNo"
|
||||
ref="carNoRef"
|
||||
></CarNoDialog>
|
||||
|
||||
<!-- 供应商选择弹框 -->
|
||||
<BrandDialog
|
||||
ref="BrandDialog"
|
||||
:show="showDialog.showBrand"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showBrand', v)}"
|
||||
@handleChange="handleChange"
|
||||
></BrandDialog>
|
||||
|
||||
<!-- <u-picker
|
||||
:show="contrlModalParams['location'].isShow"
|
||||
:title="contrlModalParams['location'].title"
|
||||
ref="uPicker"
|
||||
:columns="contrlModalParams['location'].list"
|
||||
@cancel="contrlModalParams['location'].isShow = false"
|
||||
keyName="cityName"
|
||||
@confirm="confirm"
|
||||
></u-picker> -->
|
||||
<ccSelectDity
|
||||
:province="contrlModalParams['location'].province"
|
||||
:city="contrlModalParams['location'].city"
|
||||
:area="contrlModalParams['location'].area"
|
||||
:show="contrlModalParams['location'].isShow"
|
||||
@changeClick="changeClick"
|
||||
@sureSelectArea="onsetCity"
|
||||
@hideShow="onhideShow"
|
||||
></ccSelectDity>
|
||||
|
||||
<up-modal
|
||||
title="你的爱车回收参考价为"
|
||||
:show="isShowPrice"
|
||||
closeOnClickOverlay
|
||||
showCancelButton
|
||||
contentTextAlign="center"
|
||||
>
|
||||
<view>
|
||||
<view class="price"> {{ totalPrice }}元</view>
|
||||
<view class="tip">
|
||||
注:该价格为参考价格,实际价格根据过磅重量进行结算</view
|
||||
>
|
||||
</view>
|
||||
<template #confirmButton>
|
||||
<up-button
|
||||
text="我已知悉 去登记"
|
||||
shape="circle"
|
||||
type="primary"
|
||||
@click="goRegis"
|
||||
></up-button>
|
||||
<view class="mt-30">
|
||||
<up-button
|
||||
text="暂不登记"
|
||||
shape="circle"
|
||||
@click="handleBack"
|
||||
></up-button>
|
||||
</view>
|
||||
|
||||
<!-- @click="show8 = false" -->
|
||||
</template>
|
||||
</up-modal>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
@ -114,24 +290,16 @@ import pinia from "@/store";
|
|||
import { useMemberStore } from "@/store/index";
|
||||
import valid from "@/utils/validate";
|
||||
const store = useMemberStore(pinia);
|
||||
import CarNoDialog from "@/components/Dialog/CarNoDialog.vue";
|
||||
import BrandDialog from "@/components/Dialog/BrandDialog.vue";
|
||||
import ccSelectDity from "@/components/cc-selectDity/cc-selectDity.vue";
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const isShowPrice = ref(false);
|
||||
const totalPrice = ref(9999);
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "姓名",
|
||||
key: "name",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "联系方式",
|
||||
key: "contactInfo",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "行驶证",
|
||||
key: "",
|
||||
|
@ -184,37 +352,115 @@ const formAttrList = reactive<any>([
|
|||
name: "车架号",
|
||||
key: "vin",
|
||||
type: "input",
|
||||
required: false,
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "品牌型号",
|
||||
key: "brandModel",
|
||||
type: "input",
|
||||
required: false,
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "系列",
|
||||
key: "series",
|
||||
type: "input",
|
||||
required: false,
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "总重量",
|
||||
key: "totalWeight",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "KG",
|
||||
},
|
||||
{
|
||||
name: "车牌号",
|
||||
key: "licensePlate",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
disabled: true,
|
||||
fn: () => {
|
||||
uni.hideKeyboard();
|
||||
showDialog.showCarNo = true;
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const formAttrList1 = reactive<any>([
|
||||
{
|
||||
name: "车辆所属",
|
||||
key: "ownerType",
|
||||
type: "select",
|
||||
childKey: "ownerType",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams["ownerType"].isShow = true;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "联系人",
|
||||
key: "ownerName",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "联系方式",
|
||||
key: "ownerPhone",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "所在地",
|
||||
key: "location",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams.location.isShow = true;
|
||||
contrlModalParams.location.title = "所在地";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "详细地址",
|
||||
key: "address",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
]);
|
||||
|
||||
const formAttrList2 = reactive<any>([
|
||||
{
|
||||
name: "选择品牌",
|
||||
key: "brandName",
|
||||
type: "select",
|
||||
required: false,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
uni.hideKeyboard();
|
||||
showDialog.showBrand = true;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "预算范围",
|
||||
key: "budgetRange",
|
||||
type: "select",
|
||||
childKey: "budgetRange",
|
||||
required: false,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams["budgetRange"].isShow = true;
|
||||
},
|
||||
},
|
||||
]);
|
||||
const rules = reactive({
|
||||
"formData.name": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入姓名",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.contactInfo": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入联系方式",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.licensePhotoUrl": {
|
||||
type: "string",
|
||||
required: true,
|
||||
|
@ -245,6 +491,66 @@ const rules = reactive({
|
|||
message: "请输入整备质量",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.vin": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入车架号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.brandModel": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入品牌型号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.series": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入系列",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.totalWeight": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入总重量",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.licensePlate": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入车牌号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
// "formData.ownerType": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请选择车辆所属",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.location": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请选择省市区",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.address": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请输入详细地址",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.ownerName": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请输入姓名",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.ownerPhone": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请输入联系方式",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
});
|
||||
|
||||
const contrlModalParams = reactive<any>({
|
||||
|
@ -275,8 +581,8 @@ const contrlModalParams = reactive<any>({
|
|||
{ name: "汽油" },
|
||||
{ name: "柴油" },
|
||||
{ name: "油气" },
|
||||
{ name: "纯电" },
|
||||
{ name: "油电" },
|
||||
// { name: "纯电" },
|
||||
// { name: "油电" },
|
||||
{ name: "无动力" },
|
||||
{ name: "天然气" },
|
||||
],
|
||||
|
@ -286,8 +592,65 @@ const contrlModalParams = reactive<any>({
|
|||
title: "钢圈材质",
|
||||
list: [{ name: "铝质" }, { name: "铁质" }],
|
||||
},
|
||||
ownerType: {
|
||||
isShow: false,
|
||||
title: "车辆所属",
|
||||
list: [{ name: "个人" }, { name: "单位" }],
|
||||
},
|
||||
budgetRange: {
|
||||
isShow: false,
|
||||
title: "预算范围",
|
||||
list: [
|
||||
{ name: "10万以下" },
|
||||
{ name: "10-15万" },
|
||||
{ name: "15-20万" },
|
||||
{ name: "20-25万" },
|
||||
{ name: "25-30万" },
|
||||
{ name: "30-40万" },
|
||||
{ name: "40-50万" },
|
||||
{ name: "50万以上" },
|
||||
],
|
||||
},
|
||||
location: {
|
||||
isShow: false,
|
||||
title: "所在地",
|
||||
list: [],
|
||||
province: "广东省",
|
||||
city: "广州市",
|
||||
area: "天河区",
|
||||
areaCode: "440106",
|
||||
address: "",
|
||||
},
|
||||
});
|
||||
|
||||
// 供应商选择
|
||||
const showDialog = <any>reactive({
|
||||
showCarNo: false,
|
||||
showBrand: false,
|
||||
});
|
||||
|
||||
const handleDialog = (key: string, v: boolean) => {
|
||||
showDialog[key] = v;
|
||||
};
|
||||
|
||||
const changeCarNo = (plate: string) => {
|
||||
if (plate.length >= 7) model1.formData.licensePlate = plate;
|
||||
showDialog.showCarNo = false;
|
||||
};
|
||||
|
||||
const handleChange = (arr: any) => {
|
||||
model1.formData.brandName = arr
|
||||
.map((item: any) => {
|
||||
return item.brandName;
|
||||
})
|
||||
.toString();
|
||||
model1.formData.brandId = arr
|
||||
.map((item: any) => {
|
||||
return item.id;
|
||||
})
|
||||
.toString();
|
||||
};
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "vehicleType") {
|
||||
|
@ -296,11 +659,28 @@ const handleSelect = (key: string, v: any) => {
|
|||
model1.formData.fuelType = v.name;
|
||||
} else if (key === "material") {
|
||||
model1.formData.wheelMaterial = v.name;
|
||||
} else if (key === "ownerType") {
|
||||
model1.formData.ownerType = v.name;
|
||||
} else if (key === "budgetRange") {
|
||||
model1.formData.budgetRange = v.name;
|
||||
}
|
||||
};
|
||||
|
||||
// const confirm = (e: any) => {
|
||||
// if (e.value[1]) {
|
||||
// // model1.formData.shmCategoryId = e.value[1].id;
|
||||
// // model1.formData.location = e.value[1].shmCategoryName;
|
||||
// contrlModalParams["location"].isShow = false;
|
||||
// }
|
||||
// };
|
||||
// 授权
|
||||
const handleUpload = () => {
|
||||
upload()
|
||||
const handleUpload = (type: number) => {
|
||||
if (type === 1) {
|
||||
uploadFront();
|
||||
} else if (type === 2) {
|
||||
uploadBack();
|
||||
}
|
||||
|
||||
// uni.authorize({
|
||||
// // #ifdef MP-TOUTIAO
|
||||
// scope: "scope.album, scope.writePhotosAlbum,scope.camera",
|
||||
|
@ -337,13 +717,14 @@ const handleUpload = () => {
|
|||
// });
|
||||
};
|
||||
// 上传
|
||||
const upload = () => {
|
||||
const uploadFront = () => {
|
||||
uni.chooseImage({
|
||||
success: (chooseImageRes) => {
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
PictureApi.upload({
|
||||
files: tempFilePaths[0],
|
||||
path: tempFilePaths[0],
|
||||
front: true,
|
||||
}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
model1.formData.licensePhotoUrl = res.data.url;
|
||||
|
@ -355,12 +736,12 @@ const upload = () => {
|
|||
});
|
||||
model1.formData.licensePhotoUrl = "";
|
||||
model1.formData.ascription = "";
|
||||
model1.formData.licenseNumber = "";
|
||||
model1.formData.licensePlate = "";
|
||||
model1.formData.vin = "";
|
||||
model1.formData.brandModel = "";
|
||||
} else {
|
||||
model1.formData.ascription = ocr.words_result["所有人"].words;
|
||||
model1.formData.licenseNumber = ocr.words_result["号牌号码"].words;
|
||||
model1.formData.licensePlate = ocr.words_result["号牌号码"].words;
|
||||
model1.formData.vin = ocr.words_result["车辆识别代号"].words;
|
||||
model1.formData.brandModel = ocr.words_result["品牌型号"].words;
|
||||
}
|
||||
|
@ -373,6 +754,47 @@ const upload = () => {
|
|||
});
|
||||
};
|
||||
|
||||
const uploadBack = () => {
|
||||
uni.chooseImage({
|
||||
success: (chooseImageRes) => {
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
PictureApi.upload({
|
||||
files: tempFilePaths[0],
|
||||
path: tempFilePaths[0],
|
||||
front: false,
|
||||
}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
// console.log(res);
|
||||
model1.formData.licenseBackUrl = res.data.url;
|
||||
const ocr = JSON.parse(res.data.ocr);
|
||||
if (ocr.error_code) {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "未识别出相关信息",
|
||||
});
|
||||
} else {
|
||||
const curbWeight = ocr.words_result["整备质量"].words;
|
||||
const totalWeight = ocr.words_result["总质量"].words;
|
||||
model1.formData.curbWeight = curbWeight.slice(
|
||||
0,
|
||||
curbWeight.length - 2
|
||||
);
|
||||
model1.formData.totalWeight = totalWeight.slice(
|
||||
0,
|
||||
totalWeight.length - 2
|
||||
);
|
||||
model1.formData.fuelType = ocr.words_result["燃油类型"].words;
|
||||
model1.formData.licensePlate = ocr.words_result["号牌号码"].words;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log(error);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 校验
|
||||
*/
|
||||
|
@ -394,10 +816,36 @@ const check = () => {
|
|||
});
|
||||
};
|
||||
|
||||
const beforeSave = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
// startSave();
|
||||
//
|
||||
VehicleApi.queryPrice({ name: model1.formData.wheelMaterial }).then(
|
||||
(res: any) => {
|
||||
if (res.code === 200) {
|
||||
if (res.data) {
|
||||
isShowPrice.value = true;
|
||||
totalPrice.value = parseInt(
|
||||
(res.data.price * model1.formData.totalWeight).toFixed(0)
|
||||
);
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "当前材质未定价,联系人工客服处理",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
// startSave();
|
||||
}
|
||||
});
|
||||
// if (store.profile?.token) {
|
||||
|
@ -427,16 +875,77 @@ const save = () => {
|
|||
// }
|
||||
};
|
||||
|
||||
const startSave = () => {
|
||||
VehicleApi.add(model1.formData).then((res) => {
|
||||
const startSave = (type: number) => {
|
||||
VehicleApi.addRegis({
|
||||
...model1.formData,
|
||||
ownerType: model1.formData.ownerType === "个人",
|
||||
status: 1, // 待登记
|
||||
totalPrice: totalPrice.value,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: "提交成功",
|
||||
});
|
||||
uni.navigateBack();
|
||||
if (type === 1) {
|
||||
uni.navigateTo({
|
||||
url: "/pagesVehicle/registration?id=" + res.data, // 要跳转到的页面路径
|
||||
});
|
||||
} else if (type === 2) {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const goRegis = () => {
|
||||
startSave(1);
|
||||
};
|
||||
|
||||
const handleBack = () => {
|
||||
startSave(2);
|
||||
};
|
||||
|
||||
const getLocationList = () => {
|
||||
VehicleApi.getLocation({}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.location.list = res.data[0].children;
|
||||
// console.log(contrlModalParams.location.list);
|
||||
// contrlModalParams.reCategory.list = [
|
||||
// (res.data as any).map((item: any) => {
|
||||
// return { ...item, name: item.reCategoryName };
|
||||
// }),
|
||||
// ];
|
||||
// contrlModalParams.reCategory.list.push(
|
||||
// contrlModalParams.reCategory.list[0][0].childrenList
|
||||
// );
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function changeClick(value, value2, value3, value4) {
|
||||
// console.log("地址选择器 = " + value + value2 + value3 + value4);
|
||||
|
||||
contrlModalParams["location"].province = value;
|
||||
contrlModalParams["location"].city = value2;
|
||||
contrlModalParams["location"].area = value3;
|
||||
contrlModalParams["location"].areaCode = value4;
|
||||
}
|
||||
function onhideShow() {
|
||||
contrlModalParams["location"].isShow = false;
|
||||
// console.log("执行了关闭地址选择器");
|
||||
}
|
||||
//选中省市区
|
||||
function onsetCity(e) {
|
||||
let data = e.detail.target.dataset;
|
||||
let address = data.province + data.city + data.area;
|
||||
contrlModalParams["location"].isShow = false;
|
||||
contrlModalParams["location"].address = address;
|
||||
model1.formData.location = address;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getLocationList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.uni-card__content {
|
||||
|
@ -444,11 +953,6 @@ const startSave = () => {
|
|||
height: calc(100vh - 100px);
|
||||
overflow: auto;
|
||||
}
|
||||
// ::v-deep .uni-card__content {
|
||||
// padding: 10px !important;
|
||||
// height: calc(100vh - 100px);
|
||||
// overflow: auto;
|
||||
// }
|
||||
::v-deep .uni-card--shadow {
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
@ -469,4 +973,17 @@ const startSave = () => {
|
|||
width: 70%;
|
||||
}
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 38rpx;
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
text-align: center;
|
||||
}
|
||||
.tip {
|
||||
font-size: 22rpx;
|
||||
color: rgba(0, 0, 0, 0.35);
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,908 @@
|
|||
<template>
|
||||
<uni-card
|
||||
:shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
|
||||
:margin="'20px'"
|
||||
:border="false"
|
||||
>
|
||||
<view class="uni-card__content">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="80"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<view class="title">车辆信息</view>
|
||||
<view v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-form-item
|
||||
v-if="item.name !== '行驶证'"
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-input
|
||||
v-if="item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
:disabled="item.disabled"
|
||||
:type="
|
||||
['contactInfo', 'curbWeight'].indexOf(item.key) > -1
|
||||
? 'number'
|
||||
: 'text'
|
||||
"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
<view v-else-if="item.name === '行驶证'">
|
||||
<view style="padding: 22rpx">
|
||||
<text
|
||||
style="color: #f56c6c; font-size: 20px; margin-right: 5px"
|
||||
></text>
|
||||
<text style="color: #303133; font-size: 15px; line-height: 22px"
|
||||
>行驶证</text
|
||||
>(拍照上传后自动识别车辆信息)</view
|
||||
>
|
||||
<view style="display: flex; justify-content: space-around">
|
||||
<view>
|
||||
<view style="padding-left: 20rpx; margin-top: 20rpx">
|
||||
<image
|
||||
@click="handleUpload(1)"
|
||||
:src="
|
||||
model1.formData.licensePhotoUrl ||
|
||||
`${url}/static/img/vehicle/upload.png`
|
||||
"
|
||||
style="width: 203rpx; height: 133rpx"
|
||||
/>
|
||||
</view>
|
||||
<view style="padding-left: 20rpx; margin-top: 10rpx"
|
||||
>点击上传行驶证主页</view
|
||||
>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view style="padding-left: 20rpx; margin-top: 20rpx">
|
||||
<image
|
||||
@click="handleUpload(2)"
|
||||
:src="
|
||||
model1.formData.licenseBackUrl ||
|
||||
`${url}/static/img/vehicle/upload.png`
|
||||
"
|
||||
style="width: 203rpx; height: 133rpx"
|
||||
/>
|
||||
</view>
|
||||
<view style="padding-left: 20rpx; margin-top: 10rpx"
|
||||
>点击上传行驶证副页</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="title">登记信息</view>
|
||||
|
||||
<u-form-item
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList1"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-input
|
||||
v-if="item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
:disabled="item.disabled"
|
||||
:disabledColor="'#ffffff'"
|
||||
:type="['contactInfo'].indexOf(item.key) > -1 ? 'number' : 'text'"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
|
||||
<view class="title mt-30">我要选新车</view>
|
||||
|
||||
<u-form-item
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList2"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</view>
|
||||
</uni-card>
|
||||
|
||||
<view class="btn-box-fix-btn">
|
||||
<view
|
||||
><u-button type="primary" shape="circle" @click="save"
|
||||
>提交登记</u-button
|
||||
></view
|
||||
>
|
||||
</view>
|
||||
|
||||
<block
|
||||
v-for="(item, index) in formAttrList
|
||||
.concat(formAttrList1)
|
||||
.concat(formAttrList2)"
|
||||
:key="index"
|
||||
>
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select' && item.childKey"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
|
||||
<!-- 车牌号 -->
|
||||
<CarNoDialog
|
||||
:show="showDialog.showCarNo"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showCarNo', v)}"
|
||||
@changeCarNo="changeCarNo"
|
||||
ref="carNoRef"
|
||||
></CarNoDialog>
|
||||
|
||||
<!-- 供应商选择弹框 -->
|
||||
<BrandDialog
|
||||
ref="BrandDialog"
|
||||
:show="showDialog.showBrand"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showBrand', v)}"
|
||||
@handleChange="handleChange"
|
||||
></BrandDialog>
|
||||
|
||||
<!-- <u-picker
|
||||
:show="contrlModalParams['location'].isShow"
|
||||
:title="contrlModalParams['location'].title"
|
||||
ref="uPicker"
|
||||
:columns="contrlModalParams['location'].list"
|
||||
@cancel="contrlModalParams['location'].isShow = false"
|
||||
keyName="cityName"
|
||||
@confirm="confirm"
|
||||
></u-picker> -->
|
||||
<ccSelectDity
|
||||
:province="contrlModalParams['location'].province"
|
||||
:city="contrlModalParams['location'].city"
|
||||
:area="contrlModalParams['location'].area"
|
||||
:show="contrlModalParams['location'].isShow"
|
||||
@changeClick="changeClick"
|
||||
@sureSelectArea="onsetCity"
|
||||
@hideShow="onhideShow"
|
||||
></ccSelectDity>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { url } from "@/utils/data";
|
||||
import { PictureApi, VehicleApi, UserApi } from "@/services";
|
||||
import pinia from "@/store";
|
||||
import { useMemberStore } from "@/store/index";
|
||||
import valid from "@/utils/validate";
|
||||
const store = useMemberStore(pinia);
|
||||
import CarNoDialog from "@/components/Dialog/CarNoDialog.vue";
|
||||
import BrandDialog from "@/components/Dialog/BrandDialog.vue";
|
||||
import ccSelectDity from "@/components/cc-selectDity/cc-selectDity.vue";
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "行驶证",
|
||||
key: "",
|
||||
type: "upload",
|
||||
required: false,
|
||||
unit: "",
|
||||
},
|
||||
|
||||
{
|
||||
name: "车辆类型",
|
||||
key: "vehicleType",
|
||||
type: "select",
|
||||
childKey: "vehicleType",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams["vehicleType"].isShow = true;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "燃油类别",
|
||||
key: "fuelType",
|
||||
type: "select",
|
||||
childKey: "fuelType",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams["fuelType"].isShow = true;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "钢圈材质",
|
||||
key: "wheelMaterial",
|
||||
type: "select",
|
||||
childKey: "material",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams["material"].isShow = true;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "整备质量",
|
||||
key: "curbWeight",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "KG",
|
||||
},
|
||||
{
|
||||
name: "车架号",
|
||||
key: "vin",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "品牌型号",
|
||||
key: "brandModel",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "系列",
|
||||
key: "series",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "总重量",
|
||||
key: "totalWeight",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "KG",
|
||||
},
|
||||
{
|
||||
name: "车牌号",
|
||||
key: "licensePlate",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
disabled: true,
|
||||
fn: () => {
|
||||
uni.hideKeyboard();
|
||||
showDialog.showCarNo = true;
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const formAttrList1 = reactive<any>([
|
||||
{
|
||||
name: "车辆所属",
|
||||
key: "ownerType",
|
||||
type: "select",
|
||||
childKey: "ownerType",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams["ownerType"].isShow = true;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "联系人",
|
||||
key: "ownerName",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "联系方式",
|
||||
key: "ownerPhone",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "所在地",
|
||||
key: "location",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams.location.isShow = true;
|
||||
contrlModalParams.location.title = "所在地";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "详细地址",
|
||||
key: "address",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
]);
|
||||
|
||||
const formAttrList2 = reactive<any>([
|
||||
{
|
||||
name: "选择品牌",
|
||||
key: "brandName",
|
||||
type: "select",
|
||||
required: false,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
uni.hideKeyboard();
|
||||
showDialog.showBrand = true;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "预算范围",
|
||||
key: "budgetRange",
|
||||
type: "select",
|
||||
childKey: "budgetRange",
|
||||
required: false,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams["budgetRange"].isShow = true;
|
||||
},
|
||||
},
|
||||
]);
|
||||
const rules = reactive({
|
||||
"formData.ownerName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入姓名",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.ownerPhone": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入联系方式",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.licensePhotoUrl": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请上传行驶证照片",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.vehicleType": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请选择车辆类型",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.fuelType": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请选择燃油类型",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.wheelMaterial": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请选择钢圈材质",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.curbWeight": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入整备质量",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.vin": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入车架号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.brandModel": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入品牌型号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.series": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入系列",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.totalWeight": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入总重量",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.licensePlate": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入车牌号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
|
||||
"formData.ownerType": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请选择车辆所属",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.location": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请选择省市区",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.address": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入详细地址",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
|
||||
const contrlModalParams = reactive<any>({
|
||||
vehicleType: {
|
||||
isShow: false,
|
||||
title: "车辆类型",
|
||||
list: [
|
||||
{ name: "轿车(含MPV)" },
|
||||
{ name: "面包车" },
|
||||
{ name: "中型客车" },
|
||||
{ name: "大型客车" },
|
||||
{ name: "轻型载货汽车" },
|
||||
{ name: "中型载货汽车" },
|
||||
{ name: "重型载货汽车" },
|
||||
{ name: "越野汽车(SUV)" },
|
||||
{ name: "农用运输车" },
|
||||
{ name: "牵引汽车" },
|
||||
{ name: "挂车" },
|
||||
{ name: "农用机械" },
|
||||
{ name: "摩托车" },
|
||||
{ name: "电瓶摩托车" },
|
||||
],
|
||||
},
|
||||
fuelType: {
|
||||
isShow: false,
|
||||
title: "燃油类别",
|
||||
list: [
|
||||
{ name: "汽油" },
|
||||
{ name: "柴油" },
|
||||
{ name: "油气" },
|
||||
// { name: "纯电" },
|
||||
// { name: "油电" },
|
||||
{ name: "无动力" },
|
||||
{ name: "天然气" },
|
||||
],
|
||||
},
|
||||
material: {
|
||||
isShow: false,
|
||||
title: "钢圈材质",
|
||||
list: [{ name: "铝质" }, { name: "铁质" }],
|
||||
},
|
||||
ownerType: {
|
||||
isShow: false,
|
||||
title: "车辆所属",
|
||||
list: [{ name: "个人" }, { name: "单位" }],
|
||||
},
|
||||
budgetRange: {
|
||||
isShow: false,
|
||||
title: "预算范围",
|
||||
list: [
|
||||
{ name: "10万以下" },
|
||||
{ name: "10-15万" },
|
||||
{ name: "15-20万" },
|
||||
{ name: "20-25万" },
|
||||
{ name: "25-30万" },
|
||||
{ name: "30-40万" },
|
||||
{ name: "40-50万" },
|
||||
{ name: "50万以上" },
|
||||
],
|
||||
},
|
||||
location: {
|
||||
isShow: false,
|
||||
title: "所在地",
|
||||
list: [],
|
||||
province: "广东省",
|
||||
city: "广州市",
|
||||
area: "天河区",
|
||||
areaCode: "440106",
|
||||
address: ''
|
||||
},
|
||||
});
|
||||
|
||||
// 供应商选择
|
||||
const showDialog = <any>reactive({
|
||||
showCarNo: false,
|
||||
showBrand: false,
|
||||
});
|
||||
|
||||
const handleDialog = (key: string, v: boolean) => {
|
||||
showDialog[key] = v;
|
||||
};
|
||||
|
||||
const changeCarNo = (plate: string) => {
|
||||
if (plate.length >= 7) model1.formData.licensePlate = plate;
|
||||
showDialog.showCarNo = false;
|
||||
};
|
||||
|
||||
const handleChange = (arr: any) => {
|
||||
model1.formData.brandName = arr
|
||||
.map((item: any) => {
|
||||
return item.brandName;
|
||||
})
|
||||
.toString();
|
||||
model1.formData.brandId = arr
|
||||
.map((item: any) => {
|
||||
return item.id;
|
||||
})
|
||||
.toString();
|
||||
};
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "vehicleType") {
|
||||
model1.formData.vehicleType = v.name;
|
||||
} else if (key === "fuelType") {
|
||||
model1.formData.fuelType = v.name;
|
||||
} else if (key === "material") {
|
||||
model1.formData.wheelMaterial = v.name;
|
||||
} else if (key === "ownerType") {
|
||||
model1.formData.ownerType = v.name;
|
||||
} else if (key === "budgetRange") {
|
||||
model1.formData.budgetRange = v.name;
|
||||
}
|
||||
};
|
||||
|
||||
// const confirm = (e: any) => {
|
||||
// if (e.value[1]) {
|
||||
// // model1.formData.shmCategoryId = e.value[1].id;
|
||||
// // model1.formData.location = e.value[1].shmCategoryName;
|
||||
// contrlModalParams["location"].isShow = false;
|
||||
// }
|
||||
// };
|
||||
// 授权
|
||||
const handleUpload = (type: number) => {
|
||||
if (type === 1) {
|
||||
uploadFront();
|
||||
} else if (type === 2) {
|
||||
uploadBack();
|
||||
}
|
||||
|
||||
// uni.authorize({
|
||||
// // #ifdef MP-TOUTIAO
|
||||
// scope: "scope.album, scope.writePhotosAlbum,scope.camera",
|
||||
// // #endif
|
||||
// success(res) {
|
||||
// console.log("检测权限通过", res);
|
||||
// },
|
||||
// fail(err) {
|
||||
// console.log("检测权限不通过", err);
|
||||
// uni.hideLoading();
|
||||
// },
|
||||
// });
|
||||
// uni.authorize({
|
||||
// scope: "scope.writePhotosAlbum",
|
||||
// success() {
|
||||
// console.log("授权成功");
|
||||
// // 用户同意授权后,可以执行相关上传文件的操作
|
||||
// },
|
||||
// fail() {
|
||||
// console.log("用户拒绝授权");
|
||||
// // 引导用户到设置中开启权限
|
||||
// if (uni.getSystemInfoSync().platform === "android") {
|
||||
// uni.showModal({
|
||||
// title: "提示",
|
||||
// content: "此功能需要访问您的相册,请在设置中允许访问相册",
|
||||
// success: function (modalRes) {
|
||||
// if (modalRes.confirm) {
|
||||
// uni.openSetting();
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
};
|
||||
// 上传
|
||||
const uploadFront = () => {
|
||||
uni.chooseImage({
|
||||
success: (chooseImageRes) => {
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
PictureApi.upload({
|
||||
files: tempFilePaths[0],
|
||||
path: tempFilePaths[0],
|
||||
front: true
|
||||
}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
model1.formData.licensePhotoUrl = res.data.url;
|
||||
const ocr = JSON.parse(res.data.ocr);
|
||||
if (ocr.error_code) {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "未识别出相关信息",
|
||||
});
|
||||
model1.formData.licensePhotoUrl = "";
|
||||
model1.formData.ascription = "";
|
||||
model1.formData.licensePlate = "";
|
||||
model1.formData.vin = "";
|
||||
model1.formData.brandModel = "";
|
||||
} else {
|
||||
model1.formData.ascription = ocr.words_result["所有人"].words;
|
||||
model1.formData.licensePlate = ocr.words_result["号牌号码"].words;
|
||||
model1.formData.vin = ocr.words_result["车辆识别代号"].words;
|
||||
model1.formData.brandModel = ocr.words_result["品牌型号"].words;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log(error);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const uploadBack = () => {
|
||||
uni.chooseImage({
|
||||
success: (chooseImageRes) => {
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
PictureApi.upload({
|
||||
files: tempFilePaths[0],
|
||||
path: tempFilePaths[0],
|
||||
front: false
|
||||
}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
// console.log(res);
|
||||
model1.formData.licenseBackUrl = res.data.url;
|
||||
const ocr = JSON.parse(res.data.ocr);
|
||||
if (ocr.error_code) {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "未识别出相关信息",
|
||||
});
|
||||
} else {
|
||||
const curbWeight = ocr.words_result["整备质量"].words
|
||||
const totalWeight = ocr.words_result["总质量"].words
|
||||
model1.formData.curbWeight = curbWeight.slice(0, curbWeight.length - 2);
|
||||
model1.formData.totalWeight = totalWeight.slice(0, totalWeight.length - 2);
|
||||
model1.formData.fuelType = ocr.words_result["燃油类型"].words;
|
||||
model1.formData.licensePlate = ocr.words_result["号牌号码"].words;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log(error);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 校验
|
||||
*/
|
||||
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 save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
// if (store.profile?.token) {
|
||||
// check().then((res) => {
|
||||
// if (res) {
|
||||
// startSave();
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// uni.login({
|
||||
// provider: "toutiao",
|
||||
// success: function (loginRes) {
|
||||
// UserApi.login({ code: loginRes.code }).then((res: any) => {
|
||||
// if (res.data) {
|
||||
// store.setProfile({ token: res.data.token });
|
||||
// check().then((res) => {
|
||||
// if (res) {
|
||||
// startSave();
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// uni.showToast({ title: "授权失败", icon: "none" });
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
};
|
||||
|
||||
const startSave = () => {
|
||||
VehicleApi.addRegis({...model1.formData, ownerType: model1.formData.ownerType === '个人', status: 2}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: "提交成功",
|
||||
});
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleBack = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
|
||||
const getLocationList = () => {
|
||||
VehicleApi.getLocation({}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.location.list = res.data[0].children;
|
||||
// console.log(contrlModalParams.location.list);
|
||||
// contrlModalParams.reCategory.list = [
|
||||
// (res.data as any).map((item: any) => {
|
||||
// return { ...item, name: item.reCategoryName };
|
||||
// }),
|
||||
// ];
|
||||
// contrlModalParams.reCategory.list.push(
|
||||
// contrlModalParams.reCategory.list[0][0].childrenList
|
||||
// );
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function changeClick(value, value2, value3, value4) {
|
||||
// console.log("地址选择器 = " + value + value2 + value3 + value4);
|
||||
|
||||
contrlModalParams['location'].province = value;
|
||||
contrlModalParams['location'].city = value2;
|
||||
contrlModalParams['location'].area = value3;
|
||||
contrlModalParams['location'].areaCode = value4;
|
||||
}
|
||||
function onhideShow() {
|
||||
contrlModalParams['location'].isShow = false;
|
||||
// console.log("执行了关闭地址选择器");
|
||||
}
|
||||
//选中省市区
|
||||
function onsetCity(e) {
|
||||
let data = e.detail.target.dataset;
|
||||
let address = data.province + data.city + data.area;
|
||||
contrlModalParams['location'].isShow = false;
|
||||
contrlModalParams['location'].address = address;
|
||||
model1.formData.location = address
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getLocationList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.uni-card__content {
|
||||
padding: 10px !important;
|
||||
height: calc(100vh - 100px);
|
||||
overflow: auto;
|
||||
}
|
||||
::v-deep .uni-card--shadow {
|
||||
padding: 0px !important;
|
||||
}
|
||||
::v-deep .u-form-item {
|
||||
height: auto !important;
|
||||
border-bottom: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
margin: 0px 20rpx;
|
||||
padding: 0px 20rpx;
|
||||
}
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
}
|
||||
.btn-box-fix-btn {
|
||||
justify-content: center;
|
||||
view {
|
||||
width: 70%;
|
||||
}
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 38rpx;
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
text-align: center;
|
||||
}
|
||||
.tip {
|
||||
font-size: 22rpx;
|
||||
color: rgba(0, 0, 0, 0.35);
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,164 @@
|
|||
<template>
|
||||
<view
|
||||
><page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="204"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="box">
|
||||
<scroll-view :enable-flex="true" scroll-x class="scroll-view">
|
||||
<uni-table stripe emptyText="">
|
||||
<!-- 表头行 -->
|
||||
<uni-tr>
|
||||
<uni-th v-for="(item, index) in tableTitleList" :key="index"
|
||||
>{{ item.name }}
|
||||
</uni-th>
|
||||
</uni-tr>
|
||||
<!-- 表格数据行 -->
|
||||
<uni-tr v-for="(item, index) in pageList.list" :key="index">
|
||||
<uni-td v-for="(tItem, index) in tableTitleList" :key="index">{{
|
||||
item[tItem.key]
|
||||
}}</uni-td>
|
||||
<uni-td>
|
||||
<u-button type="primary" shape="circle" @click="goRegis(item.id)"
|
||||
>去登记</u-button
|
||||
>
|
||||
</uni-td>
|
||||
</uni-tr>
|
||||
</uni-table>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</page-view>
|
||||
|
||||
<view class="btn-box-fix-btn">
|
||||
<view
|
||||
><u-button type="primary" shape="circle" @click="goInquiry()"
|
||||
>去询价</u-button
|
||||
>
|
||||
<view @click="goRecovery" class="regis">不需询价, 直接登记回收</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
import { VehicleApi } from "@/services";
|
||||
import pinia from "@/store";
|
||||
import { useMemberStore } from "@/store/index";
|
||||
const pageList: PageResult<any> = reactive({
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
});
|
||||
const resetPageList = () => {
|
||||
pageList.noMoreData = false;
|
||||
pageList.total = 0;
|
||||
pageList.list = [];
|
||||
pageList.pageNum = 1;
|
||||
pageList.pageSize = 100;
|
||||
};
|
||||
const tableTitleList = reactive([
|
||||
{
|
||||
name: "时间",
|
||||
key: "createdTime",
|
||||
},
|
||||
{
|
||||
name: "品牌型号",
|
||||
key: "brandModel",
|
||||
},
|
||||
{
|
||||
name: "总重量",
|
||||
key: "totalWeight",
|
||||
},
|
||||
{
|
||||
name: "预估价格",
|
||||
key: "totalPrice",
|
||||
}
|
||||
]);
|
||||
// VehicleApi.queryRegis({
|
||||
// startTime: "2024-09-01 00:00:00",
|
||||
// endTime: "2024-09-30 23:59:59",
|
||||
// }).then((res:any) => {
|
||||
// if(res.code === 200) {
|
||||
// res.data.list
|
||||
// }
|
||||
// });
|
||||
const goRegis = (id:number) => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesVehicle/registration?id=" + id, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
||||
const goInquiry = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesVehicle/inquiry", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
||||
const goRecovery = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesVehicle/recovery", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
||||
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,
|
||||
status: 1, // 待登记
|
||||
};
|
||||
pageList.isLoading = true;
|
||||
VehicleApi.getRegisList(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
pageList.list = pageList.list = pageList.list.concat(res.data.list);
|
||||
pageList.total = res.data.total;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
getList();
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.box {
|
||||
padding: 28rpx 20rpx;
|
||||
.scroll-view {
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
::v-deep.uni-table{
|
||||
min-width: 700px !important;
|
||||
}
|
||||
}
|
||||
.btn-box-fix-btn {
|
||||
justify-content: center;
|
||||
view {
|
||||
width: 70%;
|
||||
}
|
||||
}
|
||||
.regis {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
padding-top: 15px;
|
||||
width: 100% !important;
|
||||
color: $u-primary;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
|
@ -4,93 +4,190 @@
|
|||
:margin="'20px'"
|
||||
:border="false"
|
||||
>
|
||||
<view class="title">车辆信息</view>
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="80"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
<view class="uni-card__content">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="80"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-input
|
||||
v-if="item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
:disabled="item.disabled"
|
||||
:disabledColor="'#ffffff'"
|
||||
:type="['contactInfo'].indexOf(item.key) > -1 ? 'number' : 'text'"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
<!-- <view class="title">车辆信息</view>
|
||||
<view v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-form-item
|
||||
v-if="item.name !== '行驶证'"
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-input
|
||||
v-if="item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
:disabled="item.disabled"
|
||||
:type="
|
||||
['contactInfo', 'curbWeight'].indexOf(item.key) > -1
|
||||
? 'number'
|
||||
: 'text'
|
||||
"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
<view v-else-if="item.name === '行驶证'">
|
||||
<view style="padding: 22rpx">
|
||||
<text
|
||||
style="color: #f56c6c; font-size: 20px; margin-right: 5px"
|
||||
></text>
|
||||
<text style="color: #303133; font-size: 15px; line-height: 22px"
|
||||
>行驶证</text
|
||||
>(拍照上传后自动识别车辆信息)</view
|
||||
>
|
||||
<view style="display: flex; justify-content: space-around">
|
||||
<view>
|
||||
<view style="padding-left: 20rpx; margin-top: 20rpx">
|
||||
<image
|
||||
@click="handleUpload(1)"
|
||||
:src="
|
||||
model1.formData.licensePhotoUrl ||
|
||||
`${url}/static/img/vehicle/upload.png`
|
||||
"
|
||||
style="width: 203rpx; height: 133rpx"
|
||||
/>
|
||||
</view>
|
||||
<view style="padding-left: 20rpx; margin-top: 10rpx"
|
||||
>点击上传行驶证主页</view
|
||||
>
|
||||
</view>
|
||||
|
||||
<view class="title mt-30">我要选新车</view>
|
||||
<view>
|
||||
<view style="padding-left: 20rpx; margin-top: 20rpx">
|
||||
<image
|
||||
@click="handleUpload(2)"
|
||||
:src="
|
||||
model1.formData.licenseBackUrl ||
|
||||
`${url}/static/img/vehicle/upload.png`
|
||||
"
|
||||
style="width: 203rpx; height: 133rpx"
|
||||
/>
|
||||
</view>
|
||||
<view style="padding-left: 20rpx; margin-top: 10rpx"
|
||||
>点击上传行驶证副页</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<u-form-item
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList1"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
<view class="title">登记信息</view>
|
||||
|
||||
<u-form-item
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList1"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
<u-input
|
||||
v-if="item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
:disabled="item.disabled"
|
||||
:disabledColor="'#ffffff'"
|
||||
:type="['contactInfo'].indexOf(item.key) > -1 ? 'number' : 'text'"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</u-form-item>
|
||||
|
||||
<view class="title mt-30">我要选新车</view>
|
||||
|
||||
<u-form-item
|
||||
:prop="`formData.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList2"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-input
|
||||
v-if="item.type === 'select'"
|
||||
:disabled="true"
|
||||
:disabledColor="'#ffffff'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
clearable
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.unit">
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right" @click="item.fn"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</view>
|
||||
</uni-card>
|
||||
|
||||
<view class="btn-box-fix-btn">
|
||||
|
@ -101,7 +198,12 @@
|
|||
>
|
||||
</view>
|
||||
|
||||
<block v-for="(item, index) in formAttrList.concat(formAttrList1)" :key="index">
|
||||
<block
|
||||
v-for="(item, index) in formAttrList
|
||||
.concat(formAttrList1)
|
||||
.concat(formAttrList2)"
|
||||
:key="index"
|
||||
>
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select' && item.childKey"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
|
@ -128,42 +230,118 @@
|
|||
@handleDialog="(v:boolean) => {handleDialog('showBrand', v)}"
|
||||
@handleChange="handleChange"
|
||||
></BrandDialog>
|
||||
|
||||
<!-- <u-picker
|
||||
:show="contrlModalParams['location'].isShow"
|
||||
:title="contrlModalParams['location'].title"
|
||||
ref="uPicker"
|
||||
:columns="contrlModalParams['location'].list"
|
||||
@cancel="contrlModalParams['location'].isShow = false"
|
||||
keyName="cityName"
|
||||
@confirm="confirm"
|
||||
></u-picker> -->
|
||||
<ccSelectDity
|
||||
:province="contrlModalParams['location'].province"
|
||||
:city="contrlModalParams['location'].city"
|
||||
:area="contrlModalParams['location'].area"
|
||||
:show="contrlModalParams['location'].isShow"
|
||||
@changeClick="changeClick"
|
||||
@sureSelectArea="onsetCity"
|
||||
@hideShow="onhideShow"
|
||||
></ccSelectDity>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import CarNoDialog from "@/components/Dialog/CarNoDialog.vue";
|
||||
import BrandDialog from "@/components/Dialog/BrandDialog.vue";
|
||||
import { VehicleApi, UserApi } from "@/services";
|
||||
import { url } from "@/utils/data";
|
||||
import { PictureApi, VehicleApi, UserApi } from "@/services";
|
||||
import pinia from "@/store";
|
||||
import { useMemberStore } from "@/store/index";
|
||||
import valid from "@/utils/validate";
|
||||
const store = useMemberStore(pinia);
|
||||
// 供应商选择
|
||||
const showDialog = <any>reactive({
|
||||
showCarNo: false,
|
||||
showBrand: false
|
||||
});
|
||||
import CarNoDialog from "@/components/Dialog/CarNoDialog.vue";
|
||||
import BrandDialog from "@/components/Dialog/BrandDialog.vue";
|
||||
import ccSelectDity from "@/components/cc-selectDity/cc-selectDity.vue";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "车辆所属",
|
||||
key: "ownerType",
|
||||
name: "行驶证",
|
||||
key: "",
|
||||
type: "upload",
|
||||
required: false,
|
||||
unit: "",
|
||||
},
|
||||
|
||||
{
|
||||
name: "车辆类型",
|
||||
key: "vehicleType",
|
||||
type: "select",
|
||||
childKey: "ownerType",
|
||||
childKey: "vehicleType",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams["ownerType"].isShow = true;
|
||||
contrlModalParams["vehicleType"].isShow = true;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "联系方式",
|
||||
key: "contactInfo",
|
||||
name: "燃油类别",
|
||||
key: "fuelType",
|
||||
type: "select",
|
||||
childKey: "fuelType",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams["fuelType"].isShow = true;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "钢圈材质",
|
||||
key: "wheelMaterial",
|
||||
type: "select",
|
||||
childKey: "material",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams["material"].isShow = true;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "整备质量",
|
||||
key: "curbWeight",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "KG",
|
||||
},
|
||||
{
|
||||
name: "车架号",
|
||||
key: "vin",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "品牌型号",
|
||||
key: "brandModel",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "系列",
|
||||
key: "series",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "总重量",
|
||||
key: "totalWeight",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "KG",
|
||||
},
|
||||
{
|
||||
name: "车牌号",
|
||||
key: "licensePlate",
|
||||
|
@ -176,16 +354,55 @@ const formAttrList = reactive<any>([
|
|||
showDialog.showCarNo = true;
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const formAttrList1 = reactive<any>([
|
||||
{
|
||||
name: "车辆所属",
|
||||
key: "ownerType",
|
||||
type: "select",
|
||||
childKey: "ownerType",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams["ownerType"].isShow = true;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "联系人",
|
||||
key: "ownerName",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "联系方式",
|
||||
key: "ownerPhone",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "所在地",
|
||||
key: "location",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams.location.isShow = true;
|
||||
contrlModalParams.location.title = "所在地";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "详细地址",
|
||||
key: "address",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
]);
|
||||
|
||||
const formAttrList1 = reactive<any>([
|
||||
const formAttrList2 = reactive<any>([
|
||||
{
|
||||
name: "选择品牌",
|
||||
key: "brandName",
|
||||
|
@ -210,33 +427,138 @@ const formAttrList1 = reactive<any>([
|
|||
},
|
||||
]);
|
||||
const rules = reactive({
|
||||
"formData.ownerName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入姓名",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.ownerPhone": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入联系方式",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
// "formData.licensePhotoUrl": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请上传行驶证照片",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.vehicleType": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请选择车辆类型",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.fuelType": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请选择燃油类型",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.wheelMaterial": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请选择钢圈材质",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.curbWeight": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请输入整备质量",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.vin": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请输入车架号",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.brandModel": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请输入品牌型号",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.series": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请输入系列",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.totalWeight": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请输入总重量",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
// "formData.licensePlate": {
|
||||
// type: "string",
|
||||
// required: true,
|
||||
// message: "请输入车牌号",
|
||||
// trigger: ["blur", "change"],
|
||||
// },
|
||||
|
||||
"formData.ownerType": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请选择车辆所属",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.contactInfo": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入联系方式",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.licensePlate": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入车牌号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.location": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入所在地",
|
||||
message: "请选择省市区",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"formData.address": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入详细地址",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
|
||||
const contrlModalParams = reactive<any>({
|
||||
vehicleType: {
|
||||
isShow: false,
|
||||
title: "车辆类型",
|
||||
list: [
|
||||
{ name: "轿车(含MPV)" },
|
||||
{ name: "面包车" },
|
||||
{ name: "中型客车" },
|
||||
{ name: "大型客车" },
|
||||
{ name: "轻型载货汽车" },
|
||||
{ name: "中型载货汽车" },
|
||||
{ name: "重型载货汽车" },
|
||||
{ name: "越野汽车(SUV)" },
|
||||
{ name: "农用运输车" },
|
||||
{ name: "牵引汽车" },
|
||||
{ name: "挂车" },
|
||||
{ name: "农用机械" },
|
||||
{ name: "摩托车" },
|
||||
{ name: "电瓶摩托车" },
|
||||
],
|
||||
},
|
||||
fuelType: {
|
||||
isShow: false,
|
||||
title: "燃油类别",
|
||||
list: [
|
||||
{ name: "汽油" },
|
||||
{ name: "柴油" },
|
||||
{ name: "油气" },
|
||||
// { name: "纯电" },
|
||||
// { name: "油电" },
|
||||
{ name: "无动力" },
|
||||
{ name: "天然气" },
|
||||
],
|
||||
},
|
||||
material: {
|
||||
isShow: false,
|
||||
title: "钢圈材质",
|
||||
list: [{ name: "铝质" }, { name: "铁质" }],
|
||||
},
|
||||
ownerType: {
|
||||
isShow: false,
|
||||
title: "车辆所属",
|
||||
|
@ -256,17 +578,190 @@ const contrlModalParams = reactive<any>({
|
|||
{ name: "50万以上" },
|
||||
],
|
||||
},
|
||||
location: {
|
||||
isShow: false,
|
||||
title: "所在地",
|
||||
list: [],
|
||||
province: "广东省",
|
||||
city: "广州市",
|
||||
area: "天河区",
|
||||
areaCode: "440106",
|
||||
address: "",
|
||||
},
|
||||
});
|
||||
|
||||
// 供应商选择
|
||||
const showDialog = <any>reactive({
|
||||
showCarNo: false,
|
||||
showBrand: false,
|
||||
});
|
||||
|
||||
const handleDialog = (key: string, v: boolean) => {
|
||||
showDialog[key] = v;
|
||||
};
|
||||
|
||||
const changeCarNo = (plate: string) => {
|
||||
if (plate.length >= 7) model1.formData.licensePlate = plate;
|
||||
showDialog.showCarNo = false;
|
||||
};
|
||||
|
||||
const handleChange = (arr: any) => {
|
||||
model1.formData.brandName = arr
|
||||
.map((item: any) => {
|
||||
return item.brandName;
|
||||
})
|
||||
.toString();
|
||||
model1.formData.brandId = arr
|
||||
.map((item: any) => {
|
||||
return item.id;
|
||||
})
|
||||
.toString();
|
||||
};
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "ownerType") {
|
||||
if (key === "vehicleType") {
|
||||
model1.formData.vehicleType = v.name;
|
||||
} else if (key === "fuelType") {
|
||||
model1.formData.fuelType = v.name;
|
||||
} else if (key === "material") {
|
||||
model1.formData.wheelMaterial = v.name;
|
||||
} else if (key === "ownerType") {
|
||||
model1.formData.ownerType = v.name;
|
||||
} else if(key === 'budgetRange') {
|
||||
} else if (key === "budgetRange") {
|
||||
model1.formData.budgetRange = v.name;
|
||||
}
|
||||
};
|
||||
|
||||
// const confirm = (e: any) => {
|
||||
// if (e.value[1]) {
|
||||
// // model1.formData.shmCategoryId = e.value[1].id;
|
||||
// // model1.formData.location = e.value[1].shmCategoryName;
|
||||
// contrlModalParams["location"].isShow = false;
|
||||
// }
|
||||
// };
|
||||
// 授权
|
||||
const handleUpload = (type: number) => {
|
||||
if (type === 1) {
|
||||
uploadFront();
|
||||
} else if (type === 2) {
|
||||
uploadBack();
|
||||
}
|
||||
|
||||
// uni.authorize({
|
||||
// // #ifdef MP-TOUTIAO
|
||||
// scope: "scope.album, scope.writePhotosAlbum,scope.camera",
|
||||
// // #endif
|
||||
// success(res) {
|
||||
// console.log("检测权限通过", res);
|
||||
// },
|
||||
// fail(err) {
|
||||
// console.log("检测权限不通过", err);
|
||||
// uni.hideLoading();
|
||||
// },
|
||||
// });
|
||||
// uni.authorize({
|
||||
// scope: "scope.writePhotosAlbum",
|
||||
// success() {
|
||||
// console.log("授权成功");
|
||||
// // 用户同意授权后,可以执行相关上传文件的操作
|
||||
// },
|
||||
// fail() {
|
||||
// console.log("用户拒绝授权");
|
||||
// // 引导用户到设置中开启权限
|
||||
// if (uni.getSystemInfoSync().platform === "android") {
|
||||
// uni.showModal({
|
||||
// title: "提示",
|
||||
// content: "此功能需要访问您的相册,请在设置中允许访问相册",
|
||||
// success: function (modalRes) {
|
||||
// if (modalRes.confirm) {
|
||||
// uni.openSetting();
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
};
|
||||
// 上传
|
||||
const uploadFront = () => {
|
||||
uni.chooseImage({
|
||||
success: (chooseImageRes) => {
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
PictureApi.upload({
|
||||
files: tempFilePaths[0],
|
||||
path: tempFilePaths[0],
|
||||
front: true,
|
||||
}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
model1.formData.licensePhotoUrl = res.data.url;
|
||||
const ocr = JSON.parse(res.data.ocr);
|
||||
if (ocr.error_code) {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "未识别出相关信息",
|
||||
});
|
||||
model1.formData.licensePhotoUrl = "";
|
||||
model1.formData.ascription = "";
|
||||
model1.formData.licensePlate = "";
|
||||
model1.formData.vin = "";
|
||||
model1.formData.brandModel = "";
|
||||
} else {
|
||||
model1.formData.ascription = ocr.words_result["所有人"].words;
|
||||
model1.formData.licensePlate = ocr.words_result["号牌号码"].words;
|
||||
model1.formData.vin = ocr.words_result["车辆识别代号"].words;
|
||||
model1.formData.brandModel = ocr.words_result["品牌型号"].words;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log(error);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const uploadBack = () => {
|
||||
uni.chooseImage({
|
||||
success: (chooseImageRes) => {
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
PictureApi.upload({
|
||||
files: tempFilePaths[0],
|
||||
path: tempFilePaths[0],
|
||||
front: false,
|
||||
}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
// console.log(res);
|
||||
model1.formData.licenseBackUrl = res.data.url;
|
||||
const ocr = JSON.parse(res.data.ocr);
|
||||
if (ocr.error_code) {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "未识别出相关信息",
|
||||
});
|
||||
} else {
|
||||
const curbWeight = ocr.words_result["整备质量"].words;
|
||||
const totalWeight = ocr.words_result["总质量"].words;
|
||||
model1.formData.curbWeight = curbWeight.slice(
|
||||
0,
|
||||
curbWeight.length - 2
|
||||
);
|
||||
model1.formData.totalWeight = totalWeight.slice(
|
||||
0,
|
||||
totalWeight.length - 2
|
||||
);
|
||||
model1.formData.fuelType = ocr.words_result["燃油类型"].words;
|
||||
model1.formData.licensePlate = ocr.words_result["号牌号码"].words;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log(error);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 校验
|
||||
*/
|
||||
|
@ -302,55 +797,112 @@ const save = () => {
|
|||
// });
|
||||
// } else {
|
||||
// uni.login({
|
||||
// provider: "toutiao",
|
||||
// success: function (loginRes) {
|
||||
// UserApi.login({ code: loginRes.code }).then((res) => {
|
||||
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
// provider: "toutiao",
|
||||
// success: function (loginRes) {
|
||||
// UserApi.login({ code: loginRes.code }).then((res: any) => {
|
||||
// if (res.data) {
|
||||
// store.setProfile({ token: res.data.token });
|
||||
// check().then((res) => {
|
||||
// if (res) {
|
||||
// startSave();
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// uni.showToast({ title: "授权失败", icon: "none" });
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
};
|
||||
|
||||
const startSave = () => {
|
||||
VehicleApi.addRegis({
|
||||
VehicleApi.updateRegis({
|
||||
...model1.formData,
|
||||
ownerType: model1.formData.ownerType === "个人" ? 0 : 1,
|
||||
ownerType: model1.formData.ownerType === "个人",
|
||||
status: 2,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: "提交成功",
|
||||
});
|
||||
uni.navigateBack();
|
||||
uni.redirectTo({ url: '/pagesVehicle/index' });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleDialog = (key: string, v: boolean) => {
|
||||
showDialog[key] = v;
|
||||
const handleBack = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
|
||||
const changeCarNo = (plate: string) => {
|
||||
if (plate.length >= 7) model1.formData.licensePlate = plate;
|
||||
showDialog.showCarNo = false;
|
||||
const getLocationList = () => {
|
||||
VehicleApi.getLocation({}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.location.list = res.data[0].children;
|
||||
// console.log(contrlModalParams.location.list);
|
||||
// contrlModalParams.reCategory.list = [
|
||||
// (res.data as any).map((item: any) => {
|
||||
// return { ...item, name: item.reCategoryName };
|
||||
// }),
|
||||
// ];
|
||||
// contrlModalParams.reCategory.list.push(
|
||||
// contrlModalParams.reCategory.list[0][0].childrenList
|
||||
// );
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleChange = (arr: any) => {
|
||||
model1.formData.brandName = arr.map((item:any) => {return item.brandName}).toString()
|
||||
model1.formData.brandId = arr.map((item:any) => {return item.id}).toString()
|
||||
};
|
||||
function changeClick(value, value2, value3, value4) {
|
||||
// console.log("地址选择器 = " + value + value2 + value3 + value4);
|
||||
|
||||
contrlModalParams["location"].province = value;
|
||||
contrlModalParams["location"].city = value2;
|
||||
contrlModalParams["location"].area = value3;
|
||||
contrlModalParams["location"].areaCode = value4;
|
||||
}
|
||||
function onhideShow() {
|
||||
contrlModalParams["location"].isShow = false;
|
||||
// console.log("执行了关闭地址选择器");
|
||||
}
|
||||
//选中省市区
|
||||
function onsetCity(e) {
|
||||
let data = e.detail.target.dataset;
|
||||
let address = data.province + data.city + data.area;
|
||||
contrlModalParams["location"].isShow = false;
|
||||
contrlModalParams["location"].address = address;
|
||||
model1.formData.location = address;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getLocationList();
|
||||
});
|
||||
|
||||
onLoad((option: any) => {
|
||||
// 接收传递的标题参数
|
||||
if (option.id) {
|
||||
model1.formData.id = option.id;
|
||||
VehicleApi.getDetail({ id: option.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
model1.formData = {
|
||||
...res.data,
|
||||
ownerType: res.data.ownerType ? "单位" : "个人",
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .uni-card__content {
|
||||
padding: 20rpx !important;
|
||||
height: calc(100vh - 200px);
|
||||
.uni-card__content {
|
||||
padding: 10px !important;
|
||||
height: calc(100vh - 100px);
|
||||
overflow: auto;
|
||||
}
|
||||
::v-deep .uni-card--shadow {
|
||||
padding: 0px !important;
|
||||
}
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
height: auto !important;
|
||||
border-bottom: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
margin: 0px 20rpx;
|
||||
padding: 0px 20rpx;
|
||||
|
@ -366,4 +918,17 @@ const handleChange = (arr: any) => {
|
|||
width: 70%;
|
||||
}
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 38rpx;
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
text-align: center;
|
||||
}
|
||||
.tip {
|
||||
font-size: 22rpx;
|
||||
color: rgba(0, 0, 0, 0.35);
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -20,6 +20,24 @@ export const addRegis = (data: any) => {
|
|||
});
|
||||
};
|
||||
|
||||
export const queryInquiry = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/v1/batteryInquiry/findPage",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
export const queryRegis = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/v1/batteryRegistration/findPage",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,10 +4,11 @@ import { http } from "@/utils/http";
|
|||
|
||||
// 新增咨询
|
||||
export const upload = (data: any) => {
|
||||
|
||||
return http({
|
||||
method: "POST",
|
||||
header: {type: 'UPLOAD'},
|
||||
url: "/api/v1/upload/file/upload",
|
||||
url: "/api/v1/upload/file/upload" + `${data.front !== undefined ? `?front=${data.front}` : ''}`,
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
|
|
@ -12,6 +12,15 @@ export const add = (data: any) => {
|
|||
};
|
||||
|
||||
|
||||
export const getApplyList = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/v1/trialApplication/findPage",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -11,6 +11,62 @@ export const login = (data: any) => {
|
|||
});
|
||||
};
|
||||
|
||||
export const addPay = (data: any) => {
|
||||
return http({
|
||||
method: "POST",
|
||||
url: "/api/paymentInfo/insert",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
export const sendMsg = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/admin/sendMsg",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
export const loginPhone = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/admin/loginPhone",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
export const getPayInfo = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/paymentInfo/findById",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
export const updatePay = (data: any) => {
|
||||
return http({
|
||||
method: "PUT",
|
||||
url: "/api/paymentInfo",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
export const logOut = (data: any) => {
|
||||
return http({
|
||||
method: "POST",
|
||||
url: "/api/admin/logOut",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,13 +3,13 @@ import { http } from "@/utils/http";
|
|||
|
||||
|
||||
// 新增咨询
|
||||
export const add = (data: any) => {
|
||||
return http({
|
||||
method: "POST",
|
||||
url: "/api/v1/vehicleInfo/add",
|
||||
data,
|
||||
});
|
||||
};
|
||||
// export const add = (data: any) => {
|
||||
// return http({
|
||||
// method: "POST",
|
||||
// url: "/api/v1/vehicleInfo/add",
|
||||
// data,
|
||||
// });
|
||||
// };
|
||||
|
||||
// 新增登记
|
||||
export const addRegis = (data: any) => {
|
||||
|
@ -20,6 +20,14 @@ export const addRegis = (data: any) => {
|
|||
});
|
||||
};
|
||||
|
||||
export const updateRegis = (data: any) => {
|
||||
return http({
|
||||
method: "POST",
|
||||
url: "/api/v1/vehicleRegistration/updateById",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export const getBrand = (data: any) => {
|
||||
return http({
|
||||
|
@ -29,6 +37,56 @@ export const getBrand = (data: any) => {
|
|||
});
|
||||
};
|
||||
|
||||
export const queryRegis = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/v1/vehicleRegistration/findPage",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
export const getLocation = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/v1/city/findPage",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
export const getRegisList = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/v1/vehicleRegistration/findPage",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export const getDetail = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/v1/vehicleRegistration/selectOne",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
export const queryPrice = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/quote/findByName",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 722 KiB |
Binary file not shown.
Before Width: | Height: | Size: 954 KiB |
Binary file not shown.
Before Width: | Height: | Size: 550 KiB |
Binary file not shown.
Before Width: | Height: | Size: 548 KiB |
Binary file not shown.
Before Width: | Height: | Size: 153 KiB |
|
@ -53,17 +53,17 @@ body {
|
|||
position: fixed;
|
||||
width: calc(100vw - 100rpx);
|
||||
bottom: 0rpx;
|
||||
z-index: 999;
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
.uni-calendar-item--multiple .uni-calendar-item--before-checked,
|
||||
.uni-calendar-item--multiple .uni-calendar-item--after-checked,
|
||||
.uni-calendar-item__weeks-box .uni-calendar-item--checked,
|
||||
.uni-datetime-picker--btn {
|
||||
background-color: #00d2e3 !important;
|
||||
background-color: #608CF1 !important;
|
||||
}
|
||||
.uni-datetime-picker-btn-text {
|
||||
color: #00d2e3 !important;
|
||||
color: #608CF1 !important;
|
||||
}
|
||||
.uni-date__x-input {
|
||||
font-size: 12px;
|
||||
|
@ -99,3 +99,18 @@ body {
|
|||
color: $u-primary;
|
||||
}
|
||||
}
|
||||
::v-deep .uni-table {
|
||||
.uni-table-th {
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #000000;
|
||||
padding: 5px 5px;
|
||||
}
|
||||
.uni-table-td {
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
/* uni.scss */
|
||||
@import 'uview-plus/theme.scss';
|
||||
|
||||
$u-primary: #294AC7 !important;
|
||||
$u-primary: #608CF1 !important;
|
||||
/* 行为相关颜色 */
|
||||
$uni-color-primary: #294AC7; // #007aff
|
||||
$uni-color-primary: #608CF1; // #007aff
|
||||
$uni-color-success: #4cd964;
|
||||
$uni-color-warning: #f0ad4e;
|
||||
$uni-color-error: #302423;
|
||||
|
|
|
@ -96,8 +96,10 @@ export const http = <T>(options: UniApp.RequestOptions) => {
|
|||
|
||||
|
||||
} else {
|
||||
console.log(options)
|
||||
uni.request({
|
||||
...options,
|
||||
data: Object.assign({...(options as any).data}, {isUser: true}),
|
||||
dataType: "string", //1.先将dataType设置为string
|
||||
success(res) {
|
||||
var json = (res.data as any).replace(
|
||||
|
@ -117,7 +119,7 @@ export const http = <T>(options: UniApp.RequestOptions) => {
|
|||
});
|
||||
store.clearProfile();
|
||||
uni.reLaunch({
|
||||
url: "/pagesLogin/login/index",
|
||||
url: "/pagesLogin/index",
|
||||
});
|
||||
return;
|
||||
} else if ([500, 5001, 10001].indexOf(res1.code) > -1) {
|
||||
|
|
Loading…
Reference in New Issue