Compare commits

..

No commits in common. "3db1115ee2d45d3f554ba7fcd8e46c81ed8fd2f1" and "4910ed04cbf4742b78d179c5587ee2441a2f879a" have entirely different histories.

46 changed files with 355 additions and 28555 deletions

View File

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

View File

@ -18,9 +18,7 @@
"ignore": [], "ignore": [],
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, }
"ignoreDevUnusedFiles": false,
"ignoreUploadUnusedFiles": false
}, },
"condition": {}, "condition": {},
"editorSetting": { "editorSetting": {

View File

@ -17,7 +17,7 @@ onLaunch(() => {
}); });
// #endif // #endif
// #ifdef MP-WEIXN || MP-TOUTIAO || H5 // #ifndef MP-ALIPAY
uni.hideTabBar(); uni.hideTabBar();
// #endif // #endif
}); });

View File

@ -40,17 +40,14 @@ const props = withDefaults(
{ {
list: [ list: [
{ {
imgUrl: 'b-a1-1.1.1.png' imgUrl: "b-a1.png",
} },
// { {
// imgUrl: "b-a1.png", imgUrl: "b-a2.png",
// }, },
// { {
// imgUrl: "b-a2.png", imgUrl: "b-a3.png",
// }, },
// {
// imgUrl: "b-a3.png",
// },
], ],
} }
); );
@ -78,7 +75,6 @@ const change = (e: any) => {
cursor: pointer; cursor: pointer;
image { image {
width: 100%; width: 100%;
height: 200px;
} }
} }
.title { .title {

View File

@ -1,162 +0,0 @@
<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>

View File

@ -1,114 +0,0 @@
<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>

View File

@ -1,76 +0,0 @@
<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>

View File

@ -1,126 +0,0 @@
<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;
}
//webviewurl
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>

View File

@ -1,99 +0,0 @@
<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

View File

@ -1,339 +0,0 @@
<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>

View File

@ -1,332 +0,0 @@
<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>

View File

@ -134,7 +134,7 @@
} }
&--submit { &--submit {
// background: #5773f9; // background: #5773f9;
background-color: $u-primary; background-color: $u-primary;;
color: #fff; color: #fff;
} }
&--delete { &--delete {

View File

@ -5,11 +5,9 @@ import App from "./App.vue";
import './static/style/common.scss' import './static/style/common.scss'
import TabBar from "@/components/TabBar/index.vue"//路径根据你的文件修改 import TabBar from "@/components/TabBar/index.vue"//路径根据你的文件修改
import myMixin from "@/pages/minix/index.js";
export function createApp() { export function createApp() {
const app = createSSRApp(App); const app = createSSRApp(App);
app.mixin(myMixin);
app.use(uviewPlus); app.use(uviewPlus);
app.use(pinia); app.use(pinia);
app.component('TabBar', TabBar) app.component('TabBar', TabBar)

View File

@ -74,7 +74,7 @@
}, },
/* */ /* */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wx3c231250b822fbf5", "appid" : "wx9251d74fe0e87028",
"logoPath" : "https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/logo-simple.png", "logoPath" : "https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/logo-simple.png",
"setting" : { "setting" : {
"urlCheck" : false "urlCheck" : false

View File

@ -25,13 +25,6 @@
// "navigationStyle": "custom", // // "navigationStyle": "custom", //
"navigationBarTitleText": "我的" "navigationBarTitleText": "我的"
} }
},
{
"path": "pagesLogin/index",
"style": {
// "navigationStyle": "custom", //
"navigationBarTitleText": "登陆"
}
} }
//pageshttps://uniapp.dcloud.io/collocation/pages //pageshttps://uniapp.dcloud.io/collocation/pages
], ],
@ -91,16 +84,10 @@
"navigationBarTitleText": "我要询价" "navigationBarTitleText": "我要询价"
} }
}, },
{
"path": "regisList",
"style": {
"navigationBarTitleText": "我要登记"
}
},
{ {
"path": "registration", "path": "registration",
"style": { "style": {
"navigationBarTitleText": "登记信息" "navigationBarTitleText": "我要登记"
} }
}, },
{ {
@ -114,73 +101,9 @@
"style": { "style": {
"navigationBarTitleText": "所需材料" "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": { "tabBar": {
"color": "#7A7E83", "color": "#7A7E83",

View File

@ -1,37 +0,0 @@
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,
};
},
};

View File

@ -87,17 +87,12 @@
> >
</view> </view>
</uni-card> </uni-card>
<OpOnline />
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import CustomSwiper from "@/components/CustomSwiper/index.vue"; import CustomSwiper from "@/components/CustomSwiper/index.vue";
import OpOnline from "@/components/OpOnline/index.vue";
import { url } from "@/utils/data"; import { url } from "@/utils/data";
import { useMemberStore } from "@/store/index";
import pinia from "@/store";
const store = useMemberStore(pinia);
const bannerList = [ const bannerList = [
{ {
@ -186,12 +181,6 @@ const questionList = ref([
]); ]);
const handleClick = (item: any) => { const handleClick = (item: any) => {
if (!store.profile.token) {
uni.navigateTo({
url: '/pagesLogin/index', //
});
return
}
uni.navigateTo({ uni.navigateTo({
url: item.url, // url: item.url, //
}); });
@ -242,7 +231,7 @@ const callNumber = (number: any) => {
.text { .text {
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #608CF1; color: #294ac7;
line-height: 42rpx; line-height: 42rpx;
} }
.desc { .desc {

View File

@ -1,5 +1,16 @@
<template> <template>
<Layout> <Layout>
<!-- 轮播图 -->
<!-- <button
open-type="im"
:data-im-id="'13918346152'"
@im="imCallback"
@error="onimError"
class="animate-button"
>
点击咨询
</button> -->
<CustomSwiper> </CustomSwiper> <CustomSwiper> </CustomSwiper>
<!-- 入口 --> <!-- 入口 -->
<view class="entry-card"> <view class="entry-card">
@ -28,66 +39,64 @@
<!-- 介绍 --> <!-- 介绍 -->
<view class="avatar-card"> <view class="avatar-card">
<uni-card <uni-card
:shadow="'0rpx 0rpx 0rpx 0rpx rgba(5,68,37,0.12)'" :shadow="'0rpx 0rpx 10rpx 0rpx rgba(5,68,37,0.12)'"
:padding="'0px 0px'" :padding="'10px 10px'"
:border="false" :border="false"
> >
<!-- <view class="title">爱梵达</view> --> <view class="title">爱梵达</view>
<!-- <image <image
:src="`${url}/static/avatar/1.jpg`" :src="`/static/avatar/1.jpg`"
:mode="'widthFix'" :mode="'widthFix'"
style="width: 100%" style="width: 100%"
/> />
<image <image
:src="`${url}/static/avatar/2.jpg`" :src="`/static/avatar/2.jpg`"
:mode="'widthFix'" :mode="'widthFix'"
style="width: 100%" style="width: 100%"
/> />
<image <image
:src="`${url}/static/avatar/3.jpg`" :src="`/static/avatar/3.jpg`"
:mode="'widthFix'" :mode="'widthFix'"
style="width: 100%" style="width: 100%"
/> />
<image <image
:src="`${url}/static/avatar/4.jpg`" :src="`/static/avatar/4.jpg`"
:mode="'widthFix'" :mode="'widthFix'"
style="width: 100%" style="width: 100%"
/> />
<image <image
:src="`${url}/static/avatar/5.jpg`" :src="`/static/avatar/5.jpg`"
:mode="'widthFix'"
style="width: 100%"
/> -->
<image
:src="`${url}/static/img/6.png`"
:mode="'widthFix'" :mode="'widthFix'"
style="width: 100%" style="width: 100%"
/> />
</uni-card> </uni-card>
</view> </view>
<OpOnline />
</Layout> </Layout>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import CustomSwiper from "@/components/CustomSwiper/index.vue"; import CustomSwiper from "@/components/CustomSwiper/index.vue";
import OpOnline from "@/components/OpOnline/index.vue";
import Layout from "@/components/Layout/index.vue"; import Layout from "@/components/Layout/index.vue";
import { url } from "@/utils/data"; import { url } from "@/utils/data";
const bannerList = [
{
imgUrl: "v-a1.png",
},
];
const entryItemList = ref([ const entryItemList = ref([
{ {
path: "01.png", path: "1.png",
name: "报废车辆回收", name: "报废车辆回收",
url: "/pagesVehicle/index", url: "/pagesVehicle/index",
}, },
{ {
path: "02.png", path: "2.png",
name: "电池回收", name: "电池回收",
url: "/pagesBattery/index", url: "/pagesBattery/index",
}, },
{ {
path: "03.png", path: "3.png",
name: "废钢回收", name: "废钢回收",
url: "/pagesScrapSteel/index", url: "/pagesScrapSteel/index",
}, },
@ -98,6 +107,14 @@ const handleClick = (item: any) => {
url: item.url, // url: item.url, //
}); });
}; };
const imCallback = (e: any) => {
console.log("跳转IM客服成功", e.detail);
};
const onimError = (e: any) => {
console.log("拉起IM客服失败", e.detail);
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -3,52 +3,19 @@
<view class="profile"> <view class="profile">
<view class="baseinfo"> <view class="baseinfo">
<view class="head"> <view class="head">
<image <image :src="`${url}/static/img/profile/user.png`" class="user"></image>
:src="`${url}/static/img/profile/user.png`"
class="user"
></image>
<view> <view>
<view> <view>
<text class="name">{{ profile.name || "-" }}</text> <text class="name">{{ '用户' || "-" }}</text>
</view> </view>
<view> <view>
<text class="company">{{ profile.phone || "-" }}</text> <text class="company">{{ '-' || "-" }}</text>
</view> </view>
</view> </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"> <view class="content">
<u-list :height="'200px'"> <u-list :height="'200px'">
<u-list-item <u-list-item v-for="(item, index) in list" :key="index">
v-for="(item, index) in isHasToken() ? list : list1"
:key="index"
>
<u-cell <u-cell
:title="item.name" :title="item.name"
arrow-direction="right" arrow-direction="right"
@ -71,35 +38,13 @@
</view> </view>
</view> </view>
</view> </view>
<SmallModal
:title="'确认退出吗?'"
:content="'退出后将返回至登陆页'"
:okText="'确认退出'"
:isMain="true"
:show="isShowCancelModal"
@handleModal="(v:boolean) => {handleModal(v)}"
@handleOk="handleOk()"
/>
</Layout> </Layout>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Layout from "@/components/Layout/index.vue"; import Layout from "@/components/Layout/index.vue";
import { useMemberStore } from "@/store/index";
import pinia from "@/store";
import { url } from "@/utils/data"; import { url } from "@/utils/data";
import { UserApi } from "@/services"; const list = reactive([
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: "用户协议", name: "用户协议",
icon: "4.png", icon: "4.png",
@ -108,92 +53,22 @@ const list = reactive<any>([
name: "隐私政策", name: "隐私政策",
icon: "5.png", 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) => { const hanldeClick = (item: any) => {
if (item.name === "用户协议") { if (item.name === "用户协议") {
openDoc("在生万有用户协议"); openDoc("在生万有用户协议");
} else if (item.name === "隐私政策") { } else if (item.name === "隐私政策") {
openDoc("在生万有隐私政策"); 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 openDoc = (item: string) => {
// //
const isWX = uni.getSystemInfoSync().uniPlatform === "mp-weixin"; const isWX = uni.getSystemInfoSync().uniPlatform === 'mp-weixin'
console.log( console.log(`${url}/static/${isWX && (item === '在生万有隐私政策') ? 'weixin/' : ''}${item}.docx`)
`${url}/static/${
isWX && item === "在生万有隐私政策" ? "weixin/" : ""
}${item}.docx`
);
uni.downloadFile({ uni.downloadFile({
url: `${url}/static/${ url: `${url}/static/${isWX && (item === '在生万有隐私政策') ? 'weixin/' : ''}${item}.docx`,
isWX && item === "在生万有隐私政策" ? "weixin/" : ""
}${item}.docx`,
success: function (res) { success: function (res) {
setTimeout( setTimeout(
() => () =>
@ -235,7 +110,7 @@ my.hideTabBar({
}); });
// #endif // #endif
// #ifdef MP-WEIXN || MP-TOUTIAO || H5 // #ifndef MP-ALIPAY
uni.hideTabBar(); uni.hideTabBar();
// #endif // #endif
</script> </script>
@ -282,27 +157,6 @@ uni.hideTabBar();
width: 100%; 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> </style>

View File

@ -1,285 +0,0 @@
<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>

View File

@ -1,13 +0,0 @@
<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>

View File

@ -1,343 +0,0 @@
<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>

View File

@ -1,218 +0,0 @@
<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>

View File

@ -1,224 +0,0 @@
<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>

View File

@ -1,309 +0,0 @@
<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>

View File

@ -1,299 +0,0 @@
<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>

View File

@ -77,17 +77,12 @@
> >
</view> </view>
</uni-card> </uni-card>
<OpOnline />
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import CustomSwiper from "@/components/CustomSwiper/index.vue"; import CustomSwiper from "@/components/CustomSwiper/index.vue";
import OpOnline from "@/components/OpOnline/index.vue";
import { url } from "@/utils/data"; import { url } from "@/utils/data";
import { useMemberStore } from "@/store/index";
import pinia from "@/store";
const store = useMemberStore(pinia);
const bannerList = [ const bannerList = [
{ {
imgUrl: "v-a1.png", imgUrl: "v-a1.png",
@ -113,7 +108,7 @@ const entryItemList = ref([
{ {
path: "4.png", path: "4.png",
name: "我要登记", name: "我要登记",
url: "/pagesVehicle/regisList", url: "/pagesVehicle/registration",
}, },
]); ]);
const serviceItemList = ref([ const serviceItemList = ref([
@ -183,14 +178,6 @@ const questionList = ref([
]); ]);
const handleClick = (item: any) => { const handleClick = (item: any) => {
if (item.name === "我要询价" || item.name === "我要登记") {
if (!store.profile.token) {
uni.navigateTo({
url: '/pagesLogin/index', //
});
return
}
}
uni.navigateTo({ uni.navigateTo({
url: item.url, // url: item.url, //
}); });

View File

@ -5,6 +5,7 @@
:border="false" :border="false"
> >
<view class="uni-card__content"> <view class="uni-card__content">
<view class="title">车辆信息</view>
<u-form <u-form
labelPosition="left" labelPosition="left"
:model="model1" :model="model1"
@ -14,13 +15,12 @@
:labelStyle="{ padding: '0rpx 10rpx' }" :labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'" :errorType="'border-bottom'"
> >
<view class="title">车辆信息</view>
<view v-for="(item, index) in formAttrList" :key="index">
<u-form-item <u-form-item
v-if="item.name !== '行驶证'"
:prop="`formData.${item.key}`" :prop="`formData.${item.key}`"
:label="item.name" :label="item.name"
:required="item.required" :required="item.required"
v-for="(item, index) in formAttrList"
:key="index"
@click="item.fn" @click="item.fn"
> >
<u-input <u-input
@ -59,24 +59,13 @@
</text> </text>
</template> </template>
</u-input> </u-input>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right" @click="item.fn"></u-icon> <!-- 上传 -->
</template> <view v-if="item.type === 'upload'">
</u-form-item> <view>拍照上传后自动识别车辆信息</view>
<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"> <view style="padding-left: 20rpx; margin-top: 20rpx">
<image <image
@click="handleUpload(1)" @click="handleUpload"
:src=" :src="
model1.formData.licensePhotoUrl || model1.formData.licensePhotoUrl ||
`${url}/static/img/vehicle/upload.png` `${url}/static/img/vehicle/upload.png`
@ -88,122 +77,24 @@
>点击上传行驶证主页</view >点击上传行驶证主页</view
> >
</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'"> <template #right v-if="item.type === 'select'">
<u-icon name="arrow-right" @click="item.fn"></u-icon> <u-icon name="arrow-right" @click="item.fn"></u-icon>
</template> </template>
</u-form-item> </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> </u-form>
</view> </view>
</uni-card> </uni-card>
<view class="btn-box-fix-btn"> <view class="btn-box-fix-btn">
<view <view
><u-button type="primary" shape="circle" @click="beforeSave" ><u-button type="primary" shape="circle" @click="save"
>提交询价</u-button >提交询价</u-button
></view ></view
> >
</view> </view>
<block <block v-for="(item, index) in formAttrList" :key="index">
v-for="(item, index) in formAttrList
.concat(formAttrList1)
.concat(formAttrList2)"
:key="index"
>
<u-action-sheet <u-action-sheet
v-if="item.type === 'select' && item.childKey" v-if="item.type === 'select' && item.childKey"
:actions="contrlModalParams[item.childKey].list" :actions="contrlModalParams[item.childKey].list"
@ -214,73 +105,6 @@
:closeOnClickAction="true" :closeOnClickAction="true"
></u-action-sheet> ></u-action-sheet>
</block> </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> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -290,16 +114,24 @@ import pinia from "@/store";
import { useMemberStore } from "@/store/index"; import { useMemberStore } from "@/store/index";
import valid from "@/utils/validate"; import valid from "@/utils/validate";
const store = useMemberStore(pinia); 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>({ const model1 = reactive<any>({
formData: {}, formData: {},
}); });
const isShowPrice = ref(false);
const totalPrice = ref(9999);
const formAttrList = reactive<any>([ const formAttrList = reactive<any>([
{
name: "姓名",
key: "name",
type: "input",
required: true,
unit: "",
},
{
name: "联系方式",
key: "contactInfo",
type: "input",
required: true,
unit: "",
},
{ {
name: "行驶证", name: "行驶证",
key: "", key: "",
@ -352,115 +184,37 @@ const formAttrList = reactive<any>([
name: "车架号", name: "车架号",
key: "vin", key: "vin",
type: "input", type: "input",
required: true, required: false,
unit: "", unit: "",
}, },
{ {
name: "品牌型号", name: "品牌型号",
key: "brandModel", key: "brandModel",
type: "input", type: "input",
required: true, required: false,
unit: "", unit: "",
}, },
{ {
name: "系列", name: "系列",
key: "series", key: "series",
type: "input", 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, required: false,
unit: "", 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({ 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": { "formData.licensePhotoUrl": {
type: "string", type: "string",
required: true, required: true,
@ -491,66 +245,6 @@ const rules = reactive({
message: "请输入整备质量", message: "请输入整备质量",
trigger: ["blur", "change"], 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>({ const contrlModalParams = reactive<any>({
@ -581,8 +275,8 @@ const contrlModalParams = reactive<any>({
{ name: "汽油" }, { name: "汽油" },
{ name: "柴油" }, { name: "柴油" },
{ name: "油气" }, { name: "油气" },
// { name: "" }, { name: "纯电" },
// { name: "" }, { name: "油电" },
{ name: "无动力" }, { name: "无动力" },
{ name: "天然气" }, { name: "天然气" },
], ],
@ -592,65 +286,8 @@ const contrlModalParams = reactive<any>({
title: "钢圈材质", title: "钢圈材质",
list: [{ name: "铝质" }, { name: "铁质" }], 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) => { const handleSelect = (key: string, v: any) => {
contrlModalParams[key].isShow = false; contrlModalParams[key].isShow = false;
if (key === "vehicleType") { if (key === "vehicleType") {
@ -659,28 +296,11 @@ const handleSelect = (key: string, v: any) => {
model1.formData.fuelType = v.name; model1.formData.fuelType = v.name;
} else if (key === "material") { } else if (key === "material") {
model1.formData.wheelMaterial = v.name; 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) => { const handleUpload = () => {
if (type === 1) { upload()
uploadFront();
} else if (type === 2) {
uploadBack();
}
// uni.authorize({ // uni.authorize({
// // #ifdef MP-TOUTIAO // // #ifdef MP-TOUTIAO
// scope: "scope.album, scope.writePhotosAlbum,scope.camera", // scope: "scope.album, scope.writePhotosAlbum,scope.camera",
@ -717,14 +337,13 @@ const handleUpload = (type: number) => {
// }); // });
}; };
// //
const uploadFront = () => { const upload = () => {
uni.chooseImage({ uni.chooseImage({
success: (chooseImageRes) => { success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths; const tempFilePaths = chooseImageRes.tempFilePaths;
PictureApi.upload({ PictureApi.upload({
files: tempFilePaths[0], files: tempFilePaths[0],
path: tempFilePaths[0], path: tempFilePaths[0],
front: true,
}).then((res: any) => { }).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
model1.formData.licensePhotoUrl = res.data.url; model1.formData.licensePhotoUrl = res.data.url;
@ -736,12 +355,12 @@ const uploadFront = () => {
}); });
model1.formData.licensePhotoUrl = ""; model1.formData.licensePhotoUrl = "";
model1.formData.ascription = ""; model1.formData.ascription = "";
model1.formData.licensePlate = ""; model1.formData.licenseNumber = "";
model1.formData.vin = ""; model1.formData.vin = "";
model1.formData.brandModel = ""; model1.formData.brandModel = "";
} else { } else {
model1.formData.ascription = ocr.words_result["所有人"].words; model1.formData.ascription = ocr.words_result["所有人"].words;
model1.formData.licensePlate = ocr.words_result["号牌号码"].words; model1.formData.licenseNumber = ocr.words_result["号牌号码"].words;
model1.formData.vin = ocr.words_result["车辆识别代号"].words; model1.formData.vin = ocr.words_result["车辆识别代号"].words;
model1.formData.brandModel = ocr.words_result["品牌型号"].words; model1.formData.brandModel = ocr.words_result["品牌型号"].words;
} }
@ -754,47 +373,6 @@ const uploadFront = () => {
}); });
}; };
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);
},
});
};
/** /**
* 校验 * 校验
*/ */
@ -816,36 +394,10 @@ 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 = () => { const save = () => {
check().then((res) => { check().then((res) => {
if (res) { if (res) {
// startSave(); startSave();
} }
}); });
// if (store.profile?.token) { // if (store.profile?.token) {
@ -875,77 +427,16 @@ const save = () => {
// } // }
}; };
const startSave = (type: number) => { const startSave = () => {
VehicleApi.addRegis({ VehicleApi.add(model1.formData).then((res) => {
...model1.formData,
ownerType: model1.formData.ownerType === "个人",
status: 1, //
totalPrice: totalPrice.value,
}).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.showToast({ uni.showToast({
title: "提交成功", title: "提交成功",
}); });
if (type === 1) {
uni.navigateTo({
url: "/pagesVehicle/registration?id=" + res.data, //
});
} else if (type === 2) {
uni.navigateBack(); 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.uni-card__content { .uni-card__content {
@ -953,6 +444,11 @@ onMounted(() => {
height: calc(100vh - 100px); height: calc(100vh - 100px);
overflow: auto; overflow: auto;
} }
// ::v-deep .uni-card__content {
// padding: 10px !important;
// height: calc(100vh - 100px);
// overflow: auto;
// }
::v-deep .uni-card--shadow { ::v-deep .uni-card--shadow {
padding: 0px !important; padding: 0px !important;
} }
@ -973,17 +469,4 @@ onMounted(() => {
width: 70%; 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> </style>

View File

@ -1,908 +0,0 @@
<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>

View File

@ -1,164 +0,0 @@
<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>

View File

@ -4,7 +4,7 @@
:margin="'20px'" :margin="'20px'"
:border="false" :border="false"
> >
<view class="uni-card__content"> <view class="title">车辆信息</view>
<u-form <u-form
labelPosition="left" labelPosition="left"
:model="model1" :model="model1"
@ -14,107 +14,11 @@
:labelStyle="{ padding: '0rpx 10rpx' }" :labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'" :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 <u-form-item
:prop="`formData.${item.key}`" :prop="`formData.${item.key}`"
:label="item.name" :label="item.name"
:required="item.required" :required="item.required"
v-for="(item, index) in formAttrList1" v-for="(item, index) in formAttrList"
:key="index" :key="index"
@click="item.fn" @click="item.fn"
> >
@ -162,7 +66,7 @@
:prop="`formData.${item.key}`" :prop="`formData.${item.key}`"
:label="item.name" :label="item.name"
:required="item.required" :required="item.required"
v-for="(item, index) in formAttrList2" v-for="(item, index) in formAttrList1"
:key="index" :key="index"
@click="item.fn" @click="item.fn"
> >
@ -187,7 +91,6 @@
</template> </template>
</u-form-item> </u-form-item>
</u-form> </u-form>
</view>
</uni-card> </uni-card>
<view class="btn-box-fix-btn"> <view class="btn-box-fix-btn">
@ -198,12 +101,7 @@
> >
</view> </view>
<block <block v-for="(item, index) in formAttrList.concat(formAttrList1)" :key="index">
v-for="(item, index) in formAttrList
.concat(formAttrList1)
.concat(formAttrList2)"
:key="index"
>
<u-action-sheet <u-action-sheet
v-if="item.type === 'select' && item.childKey" v-if="item.type === 'select' && item.childKey"
:actions="contrlModalParams[item.childKey].list" :actions="contrlModalParams[item.childKey].list"
@ -230,118 +128,42 @@
@handleDialog="(v:boolean) => {handleDialog('showBrand', v)}" @handleDialog="(v:boolean) => {handleDialog('showBrand', v)}"
@handleChange="handleChange" @handleChange="handleChange"
></BrandDialog> ></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> </template>
<script setup lang="ts"> <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 CarNoDialog from "@/components/Dialog/CarNoDialog.vue";
import BrandDialog from "@/components/Dialog/BrandDialog.vue"; import BrandDialog from "@/components/Dialog/BrandDialog.vue";
import ccSelectDity from "@/components/cc-selectDity/cc-selectDity.vue"; import { VehicleApi, UserApi } from "@/services";
import { onLoad } from "@dcloudio/uni-app"; import pinia from "@/store";
import { useMemberStore } from "@/store/index";
const store = useMemberStore(pinia);
//
const showDialog = <any>reactive({
showCarNo: false,
showBrand: false
});
const model1 = reactive<any>({ const model1 = reactive<any>({
formData: {}, formData: {},
}); });
const formAttrList = reactive<any>([ const formAttrList = reactive<any>([
{ {
name: "行驶证", name: "车辆所属",
key: "", key: "ownerType",
type: "upload",
required: false,
unit: "",
},
{
name: "车辆类型",
key: "vehicleType",
type: "select", type: "select",
childKey: "vehicleType", childKey: "ownerType",
required: true, required: true,
unit: "", unit: "",
fn: () => { fn: () => {
contrlModalParams["vehicleType"].isShow = true; contrlModalParams["ownerType"].isShow = true;
}, },
}, },
{ {
name: "燃油类别", name: "联系方式",
key: "fuelType", key: "contactInfo",
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", type: "input",
required: true, required: true,
unit: "", 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: "车牌号", name: "车牌号",
key: "licensePlate", key: "licensePlate",
@ -354,55 +176,16 @@ const formAttrList = reactive<any>([
showDialog.showCarNo = true; 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: "所在地", name: "所在地",
key: "location", key: "location",
type: "input", type: "input",
required: true, required: true,
unit: "", unit: "",
fn: () => {
contrlModalParams.location.isShow = true;
contrlModalParams.location.title = "所在地";
},
},
{
name: "详细地址",
key: "address",
type: "input",
required: true,
unit: "",
}, },
]); ]);
const formAttrList2 = reactive<any>([ const formAttrList1 = reactive<any>([
{ {
name: "选择品牌", name: "选择品牌",
key: "brandName", key: "brandName",
@ -427,138 +210,33 @@ const formAttrList2 = reactive<any>([
}, },
]); ]);
const rules = reactive({ 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": { "formData.ownerType": {
type: "string", type: "string",
required: true, required: true,
message: "请选择车辆所属", message: "请选择车辆所属",
trigger: ["blur", "change"], 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": { "formData.location": {
type: "string", type: "string",
required: true, required: true,
message: "请选择省市区", message: "请输入所在地",
trigger: ["blur", "change"],
},
"formData.address": {
type: "string",
required: true,
message: "请输入详细地址",
trigger: ["blur", "change"], trigger: ["blur", "change"],
}, },
}); });
const contrlModalParams = reactive<any>({ 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: { ownerType: {
isShow: false, isShow: false,
title: "车辆所属", title: "车辆所属",
@ -578,190 +256,17 @@ const contrlModalParams = reactive<any>({
{ name: "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) => { const handleSelect = (key: string, v: any) => {
contrlModalParams[key].isShow = false; contrlModalParams[key].isShow = false;
if (key === "vehicleType") { if (key === "ownerType") {
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; model1.formData.ownerType = v.name;
} else if (key === "budgetRange") { } else if(key === 'budgetRange') {
model1.formData.budgetRange = v.name; 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);
},
});
};
/** /**
* 校验 * 校验
*/ */
@ -799,17 +304,8 @@ const save = () => {
// uni.login({ // uni.login({
// provider: "toutiao", // provider: "toutiao",
// success: function (loginRes) { // success: function (loginRes) {
// UserApi.login({ code: loginRes.code }).then((res: any) => { // UserApi.login({ code: loginRes.code }).then((res) => {
// if (res.data) {
// store.setProfile({ token: res.data.token });
// check().then((res) => {
// if (res) {
// startSave();
// }
// });
// } else {
// uni.showToast({ title: "", icon: "none" });
// }
// }); // });
// }, // },
// }); // });
@ -817,92 +313,44 @@ const save = () => {
}; };
const startSave = () => { const startSave = () => {
VehicleApi.updateRegis({ VehicleApi.addRegis({
...model1.formData, ...model1.formData,
ownerType: model1.formData.ownerType === "个人", ownerType: model1.formData.ownerType === "个人" ? 0 : 1,
status: 2,
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.showToast({ uni.showToast({
title: "提交成功", title: "提交成功",
}); });
uni.redirectTo({ url: '/pagesVehicle/index' });
}
});
};
const handleBack = () => {
uni.navigateBack(); 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) { const handleDialog = (key: string, v: boolean) => {
// console.log(" = " + value + value2 + value3 + value4); showDialog[key] = v;
};
contrlModalParams["location"].province = value;
contrlModalParams["location"].city = value2; const changeCarNo = (plate: string) => {
contrlModalParams["location"].area = value3; if (plate.length >= 7) model1.formData.licensePlate = plate;
contrlModalParams["location"].areaCode = value4; showDialog.showCarNo = false;
} };
function onhideShow() {
contrlModalParams["location"].isShow = false; const handleChange = (arr: any) => {
// console.log(""); model1.formData.brandName = arr.map((item:any) => {return item.brandName}).toString()
} model1.formData.brandId = arr.map((item:any) => {return item.id}).toString()
//
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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.uni-card__content { ::v-deep .uni-card__content {
padding: 10px !important; padding: 20rpx !important;
height: calc(100vh - 100px); height: calc(100vh - 200px);
overflow: auto; overflow: auto;
} }
::v-deep .uni-card--shadow { ::v-deep .uni-card--shadow {
padding: 0px !important; padding: 0px !important;
} }
::v-deep .u-form-item { ::v-deep .u-form-item {
height: auto !important; height: auto;
border-bottom: 1rpx solid rgba(233, 233, 233, 0.76); border-bottom: 1rpx solid rgba(233, 233, 233, 0.76);
margin: 0px 20rpx; margin: 0px 20rpx;
padding: 0px 20rpx; padding: 0px 20rpx;
@ -918,17 +366,4 @@ onLoad((option: any) => {
width: 70%; 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> </style>

View File

@ -20,24 +20,6 @@ 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,
});
};

View File

@ -4,11 +4,10 @@ import { http } from "@/utils/http";
// 新增咨询 // 新增咨询
export const upload = (data: any) => { export const upload = (data: any) => {
return http({ return http({
method: "POST", method: "POST",
header: {type: 'UPLOAD'}, header: {type: 'UPLOAD'},
url: "/api/v1/upload/file/upload" + `${data.front !== undefined ? `?front=${data.front}` : ''}`, url: "/api/v1/upload/file/upload",
data, data,
}); });
}; };

View File

@ -12,15 +12,6 @@ export const add = (data: any) => {
}; };
export const getApplyList = (data: any) => {
return http({
method: "GET",
url: "/api/v1/trialApplication/findPage",
data,
});
};

View File

@ -11,62 +11,6 @@ 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,
});
};

View File

@ -3,13 +3,13 @@ import { http } from "@/utils/http";
// 新增咨询 // 新增咨询
// export const add = (data: any) => { export const add = (data: any) => {
// return http({ return http({
// method: "POST", method: "POST",
// url: "/api/v1/vehicleInfo/add", url: "/api/v1/vehicleInfo/add",
// data, data,
// }); });
// }; };
// 新增登记 // 新增登记
export const addRegis = (data: any) => { export const addRegis = (data: any) => {
@ -20,14 +20,6 @@ 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) => { export const getBrand = (data: any) => {
return http({ return http({
@ -37,56 +29,6 @@ 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,
});
};

BIN
src/static/avatar/1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 KiB

BIN
src/static/avatar/2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 KiB

BIN
src/static/avatar/3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 KiB

BIN
src/static/avatar/4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 KiB

BIN
src/static/avatar/5.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

View File

@ -53,17 +53,17 @@ body {
position: fixed; position: fixed;
width: calc(100vw - 100rpx); width: calc(100vw - 100rpx);
bottom: 0rpx; bottom: 0rpx;
z-index: 20; z-index: 999;
} }
.uni-calendar-item--multiple .uni-calendar-item--before-checked, .uni-calendar-item--multiple .uni-calendar-item--before-checked,
.uni-calendar-item--multiple .uni-calendar-item--after-checked, .uni-calendar-item--multiple .uni-calendar-item--after-checked,
.uni-calendar-item__weeks-box .uni-calendar-item--checked, .uni-calendar-item__weeks-box .uni-calendar-item--checked,
.uni-datetime-picker--btn { .uni-datetime-picker--btn {
background-color: #608CF1 !important; background-color: #00d2e3 !important;
} }
.uni-datetime-picker-btn-text { .uni-datetime-picker-btn-text {
color: #608CF1 !important; color: #00d2e3 !important;
} }
.uni-date__x-input { .uni-date__x-input {
font-size: 12px; font-size: 12px;
@ -99,18 +99,3 @@ body {
color: $u-primary; 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;
}
}

View File

@ -17,9 +17,9 @@
/* uni.scss */ /* uni.scss */
@import 'uview-plus/theme.scss'; @import 'uview-plus/theme.scss';
$u-primary: #608CF1 !important; $u-primary: #294AC7 !important;
/* 行为相关颜色 */ /* 行为相关颜色 */
$uni-color-primary: #608CF1; // #007aff $uni-color-primary: #294AC7; // #007aff
$uni-color-success: #4cd964; $uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e; $uni-color-warning: #f0ad4e;
$uni-color-error: #302423; $uni-color-error: #302423;

View File

@ -96,10 +96,8 @@ export const http = <T>(options: UniApp.RequestOptions) => {
} else { } else {
console.log(options)
uni.request({ uni.request({
...options, ...options,
data: Object.assign({...(options as any).data}, {isUser: true}),
dataType: "string", //1.先将dataType设置为string dataType: "string", //1.先将dataType设置为string
success(res) { success(res) {
var json = (res.data as any).replace( var json = (res.data as any).replace(
@ -119,7 +117,7 @@ export const http = <T>(options: UniApp.RequestOptions) => {
}); });
store.clearProfile(); store.clearProfile();
uni.reLaunch({ uni.reLaunch({
url: "/pagesLogin/index", url: "/pagesLogin/login/index",
}); });
return; return;
} else if ([500, 5001, 10001].indexOf(res1.code) > -1) { } else if ([500, 5001, 10001].indexOf(res1.code) > -1) {