Commit 65d61e3c by yancanhua

fix: 前端进度条问题修复

1 parent e5d41bc5
......@@ -6,7 +6,7 @@
<link rel="icon" href="/admin/main/favicon/favicon.ico" type="image/x-icon">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>专电优拍</title>
<script type="module" crossorigin src="https://aus.test.glsx.com.cn/assets/index-BdpZoDaF.js"></script>
<script type="module" crossorigin src="https://aus.test.glsx.com.cn/assets/index-NgRIQJD6.js"></script>
<link rel="stylesheet" crossorigin href="https://aus.test.glsx.com.cn/assets/index-CAAxcolk.css">
</head>
<body>
......
<template>
<view class="progressBox">
<view class="titleBox">
<view v-if="stepActive == 'ONE'" class="conductDot">
<view class="conductDot-line"></view>
</view>
<view v-if="stepActive == 'TWO' || stepActive == 'THREE'" class="successDot">
<uni-icons type="checkbox-filled" size="20" color="#347BFF"
style="float: left; margin: 3px;"></uni-icons>
</view>
<view class="title color-292d33" :class="{ 'm-t-8': stepActive == 'TWO' || stepActive == 'THREE' }">经营信息
</view>
</view>
<view class="lineBox">
<view :class="stepActive == 'TWO' || stepActive == 'THREE' ? 'line2' : 'line1'"></view>
</view>
<view class="titleBox">
<view v-if="stepActive == 'ONE'" class="defaultDot">2</view>
<view v-if="stepActive == 'TWO'" class="conductDot">
<view class="conductDot-line"></view>
</view>
<view v-if="stepActive == 'THREE'" class="successDot">
<uni-icons type="checkbox-filled" size="20" color="#347BFF"
style="float: left; margin: 3px;"></uni-icons>
</view>
<view class="title"
:class="{ 'm-t-8': stepActive == 'THREE', 'color-292d33': stepActive == 'TWO' || stepActive == 'THREE', 'color-999ea8': stepActive == 'ONE' }">
收车偏好
</view>
</view>
<view class="lineBox">
<view :class="stepActive == 'THREE' ? 'line2' : 'line1'"></view>
</view>
<view class="titleBox">
<view v-if="stepActive == 'ONE' || stepActive == 'TWO'" class="defaultDot">3</view>
<view v-if="stepActive == 'THREE'" class="conductDot">
<view class="conductDot-line"></view>
</view>
<view class="title" :class="stepActive == 'THREE' ? 'color-292d33' : 'color-999ea8'">品牌偏好</view>
</view>
</view>
</template>
<script lang="ts">
import { Vue, Component } from 'vue-facing-decorator';
@Component({})
export default class progressBox extends Vue {
stepActive = 'ONE';//ONE,TWO,THREE
initData(data: any) {
this.stepActive = data.stepActive || 'ONE';
}
}
</script>
<style scoped lang="scss">
.progressBox {
background: #f7f9fc;
display: table;
margin: 0 auto;
}
.titleBox {
width: 48px;
margin-top: 8px;
float: left;
}
.defaultDot {
width: 20px;
height: 20px;
float: left;
margin: 0 14px;
line-height: 20px;
border-radius: 10px;
background: #dee0e3;
color: #ffffff;
font-size: 12px;
font-weight: 中黑体;
font-family: "苹方-简";
text-align: center;
}
.conductDot {
width: 20px;
height: 20px;
float: left;
background: rgba(52, 123, 255, 0.1);
border-radius: 20px;
margin: 0 14px;
}
.conductDot-line {
width: 8px;
height: 8px;
border-radius: 10px;
border: 3px solid #347bff;
background: #ffffff;
float: left;
margin: 3px;
}
.successDot {
width: 26px;
height: 26px;
float: left;
border-radius: 20px;
background: rgba(52, 123, 255, 0.1);
margin: 0 8px;
margin-top: -1px;
}
.title {
width: 48px;
height: 18px;
float: left;
line-height: 18px;
font-size: 12px;
font-weight: 中黑体;
font-family: "苹方-简";
text-align: center;
margin-top: 12px;
}
.lineBox {
width: 90px;
height: 57px;
float: left;
}
.line1 {
width: 80px;
height: 3px;
float: left;
border-radius: 2px;
background: #dee0e3;
margin-left: 5px;
margin-right: 5px;
margin-top: 17px;
}
.line2 {
width: 80px;
height: 3px;
float: left;
border-radius: 2px;
background: #dde9fb;
margin-left: 5px;
margin-right: 5px;
margin-top: 17px;
}
.color-292d33 {
color: #292d33;
}
.color-999ea8 {
color: #999ea8;
}
.m-t-8 {
margin-top: 8px;
}
</style>
......@@ -3,12 +3,7 @@
<view class="page">
<!-- 进度条 -->
<view class="stepBox" :style="{ paddingTop: statusBarHeight + 56 + 'px' }">
<image v-if="stepActive == 'ONE'" src="https://img02.glsx.com.cn/aus/images/preference/stepOne.png" mode="aspectFill"
class="step-image" />
<image v-else-if="stepActive == 'TWO'" src="https://img02.glsx.com.cn/aus/images/preference/stepTwo.png" mode="aspectFill"
class="step-image" />
<image v-else-if="stepActive == 'THREE'" src="https://img02.glsx.com.cn/aus/images/preference/stepThree.png" mode="aspectFill"
class="step-image" />
<progressBox ref="progressBoxRef" />
</view>
<!-- 内容区域 -->
<view class="contentBox">
......@@ -44,8 +39,10 @@ import stepTwo from "@/module/preference/components/step-two.vue";
import stepThree from "@/module/preference/components/step-three.vue";
import { PreferenceController } from "@/api/PreferenceController";
import customNav from "@/module/preference/components/customNav.vue";
import progressBox from "@/module/preference/components/progressBox.vue";
@Component({ components: { stepOne, stepTwo, stepThree, customNav } })
@Component({ components: { stepOne, stepTwo, stepThree, customNav, progressBox } })
export default class indexPage extends Vue {
statusBarHeight = 0;// 用于接收头部总高度,设置内容区 padding
......@@ -63,7 +60,7 @@ export default class indexPage extends Vue {
vehicleType: '1',
brandList: [] as string[],
}
oldPageData = {}
created(): void {
onLoad((option) => {
this.statusBarHeight = uni.getWindowInfo().statusBarHeight;
......@@ -77,6 +74,7 @@ export default class indexPage extends Vue {
const data = response.data || {};
if (data.success) {
const itemData = data.data || {};
this.oldPageData = itemData;
this.pageData.businessModel = itemData.businessModel || '1';
this.pageData.cityCode = itemData.cityCode || '';
this.pageData.cityName = itemData.cityName || '';
......@@ -106,11 +104,13 @@ export default class indexPage extends Vue {
}
this.handleSubmit(0)
this.stepActive = value;
this.$refs.progressBoxRef.initData({ stepActive: value });
}
//上一步
upStep(value: string) {
this.stepActive = value;
this.$refs.progressBoxRef.initData({ stepActive: value });
}
//保存 status 0 提交 1 完成
......@@ -119,17 +119,17 @@ export default class indexPage extends Vue {
if (this.stepActive == 'ONE') {
postData = {
...this.pageData,
vehicleCondition: '',
vehicleAge: '',
vehicleFuelType: '',
vehicleType: '',
brandList: JSON.stringify([]),
vehicleCondition: this.oldPageData.vehicleCondition || '',
vehicleAge: this.oldPageData.vehicleAge || '',
vehicleFuelType: this.oldPageData.vehicleFuelType || '',
vehicleType: this.oldPageData.vehicleType || '',
brandList: JSON.stringify(this.oldPageData.brandList || []),
status: status,
}
} else if (this.stepActive == 'TWO') {
postData = {
...this.pageData,
brandList: JSON.stringify([]),
brandList: JSON.stringify(this.oldPageData.brandList || []),
status: status,
}
} else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!