Commit 6ae0b299 by chenwq

重构编辑订单页面,新增第一步组件,移除旧的编辑订单页面及相关样式,更新表单组件,优化代码结构

1 parent 28cf3400
......@@ -40,7 +40,7 @@
"root": "packageIndex",
"pages": [
"pages/goodsDetail/index",
"pages/editOrder/editOrder"
"pages/editOrder/index/index"
]
},
{
......
@import "assets/style/common.wxss";
@font-face {
font-family: "numberNor";
src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-500-Medium.ttf");
}
@font-face {
font-family: "numberBold";
src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-700-Bold.ttf");
}
page {
/* 兼容 IOS<11.2 先constant再env */
--constantSafeAreaInsetBottom: constant(safe-area-inset-bottom);
/* 兼容 IOS>11.2 */
--envSafeAreaInsetBottom: env(safe-area-inset-bottom);
background-color: #F7F8FA !important;
color: #282829;
font-size: 28rpx;
--themeColor: #FC5B32;
--btnColor: #FC8A32;
--fontColor: #7E4C15;
--themeColor: #185EFE;
--btnColor: #185EFE;
--fontColor: #0000000;
--borderRadius: 8rpx;
--margin: 32rpx;
/* 兼容 IOS<11.2 先constant再env */
--constantSafeAreaInsetBottom: constant(safe-area-inset-bottom);
/* 兼容 IOS>11.2 */
--envSafeAreaInsetBottom: env(safe-area-inset-bottom);
}
image {
width: 100%;
height: 100%;
vertical-align: top;
}
@for $i from 1 through 1300 {
--fontSize#{$i}: calc(#{$i}vmin / 7.5);
--fontSizeContent#{$i}: calc(#{$i}vmin / 7.176);
}
.flex_sc {
display: flex;
align-items: center;
}
@media screen and (min-device-width: 768px) and (-webkit-min-device-pixel-ratio: 1) {
@for $i from 1 through 1300 {
--fontSize#{$i}: calc(#{$i}vmin / 8.5);
--fontSizeContent#{$i}: calc(#{$i}vmin / 6.719);
}
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
image {
width: 100%;
height: 100%;
vertical-align: top;
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
.y-center {
top: 50%;
transform: translateY(-50%);
}
.suggest-box {
font-size: 28rpx;
color: #1B233D;
}
.x-center {
left: 50%;
transform: translateX(-50%);
}
.btn_primary {
color: #FC5B32;
font-weight: 500;
font-size: 28rpx;
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.btn_cancel {
font-weight: 400;
font-size: 28rpx;
color: #1B233D;
}
.express-wrap{
height:1200rpx;
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.two-text {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.isFullSucreen {
box-sizing: border-box;
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
// padding-bottom: 34px !important;
}
.isFullSucreen-bottom {
bottom: 34px !important;
}
.list-nothing {
padding: var(--fontSize30) 0;
text-align: center;
font-size: var(--fontSize28);
color: #666666;
}
.list-not {
display: flex;
align-items: center;
justify-content: center;
color: #999;
font-size: var(--fontSize24);
height: 100%;
}
.bgcw {
background-color: #fff;
}
.flex_sc {
display: flex;
align-items: center;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
.suggest-box {
font-size: 28rpx;
color: #1B233D;
}
.btn_primary {
color: #FC5B32;
font-weight: 500;
font-size: 28rpx;
}
.btn_cancel {
font-weight: 400;
font-size: 28rpx;
color: #1B233D;
}
.express-wrap{
height:1200rpx;
}
.express-wrap .weui-actionsheet__menu{
height:calc(100% - 100rpx);
overflow-y: auto;
}
}
.express-wrap .weui-actionsheet__menu{
height:calc(100% - 100rpx);
overflow-y: auto;
}
\ No newline at end of file
{
"component": true,
"usingComponents": {
"van-area": "@vant/weapp/area/index",
"van-popup": "@vant/weapp/popup/index"
}
"component": true,
"usingComponents": {
"van-area": "@vant/weapp/area/index",
"van-popup": "@vant/weapp/popup/index"
}
}
\ No newline at end of file
<!--components/GLCustForm/GLCustForm.wxml-->
<wxs src="./GLForm.wxs" module="filterUtils" />
<!-- <glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy> -->
<glsx-privacy appletName="优加发拍">
</glsx-privacy>
<view
wx:for="{{formDataList}}"
wx:key="index"
class="custom-class gl-cust-form"
>
<view wx:for="{{ formDataList }}" wx:key="index" class="custom-class gl-form">
<gl-cell
wx:if="{{filterUtils.isShowFn(formData, item) && item.type != 'otherSlot' && !item.isHide}}"
border="{{!item.noBorder}}"
class="{{item.name}}"
haveArrow="{{item.haveArrow || false}}"
wx:if="{{filterUtils.isShowFn(formData, item) && item.type != 'otherSlot'}}"
border="{{ !item.noBorder }}"
class="{{ item.name }}"
haveArrow="{{ item.haveArrow || false }}"
valueAlign="right"
label="{{item.label}}"
labelWidth="{{item.labelWidth || labelWidth}}"
placeholder="{{item.placeholder || ''}}"
label="{{ item.label }}"
labelWidth="{{ item.labelWidth || labelWidth }}"
placeholder="{{ item.placeholder || '' }}"
bindclick="handleCellClick"
data-target="{{item}}"
data-idx="{{index}}"
background="{{background}}"
required="{{item.required}}"
requiredBefore="false"
requiredAfter="true"
cellHeight="{{!item.noCellHeight}}"
cellStyle="{{item.cellStyle||''}}"
labelStyle="{{item.labelStyle}}"
cellValueStyle="{{item.cellValueStyle}}"
cellBoxStyle="{{item.cellBoxStyle||''}}"
show-word-limit
noPadding="{{item.noPadding}}"
data-target="{{ item }}"
data-idx="{{ index }}"
background="{{ background }}"
required="{{ item.required }}"
requiredAfter="{{ item.requiredAfter }}"
cellHeight="{{ !item.noCellHeight }}"
cellStyle="{{ item.cellStyle || '' }}"
labelStyle="{{ item.labelStyle }}"
cellBoxStyle="{{ item.cellBoxStyle || '' }}"
>
<!-- slot -->
<slot wx:if="{{item.type == 'slot'}}" name="{{item.slotName || item.name}}" />
<!-- radio -->
<view wx:if="{{item.type == 'radio'}}">
<van-radio-group
value="{{formData[item.name]}}"
disabled="{{item.disabled||disable}}"
class="radio-box"
data-attr="{{item.name}}"
bindchange="handleRadio"
>
<van-radio
wx:for="{{item.optionList}}"
class="radio-item"
wx:for-item="k"
wx:for-index="kIdx"
wx:key="kIdx"
name="{{k[item.optionLabel]}}"
>
{{k[item.optionLabel]}}
</van-radio>
</van-radio-group>
</view>
<!-- input -->
<view
wx:if="{{item.type == 'input'}}"
class="input-box"
style="{{item.customStyle}}"
>
<slot wx:if="{{ item.type == 'slot' }}" name="{{ item.name }}" />
<!-- input / textarea -->
<view wx:if="{{ item.type == 'input' }}" class="input-box">
<!-- rows="1" -->
<van-field
class="textarea"
custom-style="padding: var(--fontSize30) 0; font-size: var(--fontSize28); background: {{background}}{{item.inputCustomStyle}};"
border="{{false}}"
value="{{formData[item.name]}}"
input-align="{{item.inputAlign || 'right'}}"
custom-style="padding: var(--fontSize30) 0; font-size: var(--fontSize28); background: {{background}};"
border="{{ false }}"
value="{{ formData[item.name] }}"
input-align="{{ itme.inputAlign || 'right' }}"
autosize
hold-keyboard
type="{{item.fieldType || 'text'}}"
rows="{{item.rows || '1'}}"
placeholder="{{item.placeholder || '请输入'}}"
maxlength="{{item.maxlength || 140}}"
disabled="{{item.disabled||disable}}"
readonly="{{item.readonly}}"
data-attr="{{item.name}}"
data-item="{{item}}"
bindinput="handleInput" />
<text wx:if="{{item.suffix}}" class="input-suffix">{{item.suffix}}</text>
</view>
<!-- textarea -->
<view wx:if="{{item.type == 'textarea'}}" class="meeting-box">
<view class="meeting-textarea">
<van-field
value="{{formData[item.name]}}"
hold-keyboard
type="textarea"
rows="{{item.rows || '4'}}"
autosize="{ minHeight: 50 }"
show-word-limit
placeholder="{{item.placeholder || '请输入'}}"
maxlength="{{item.maxlength || 140}}"
disabled="{{item.disabled||disable}}"
data-attr="{{item.name}}"
data-item="{{item}}"
bindinput="handleInput" />
type="{{ item.fieldType || 'text' }}"
placeholder="{{ item.placeholder || '请输入' }}"
maxlength="{{ item.maxlength || 140 }}"
disabled="{{ item.disabled || disable }}"
readonly="{{ item.readonly }}"
data-attr="{{ item.name }}"
data-item="{{ item }}"
bindinput="handleInput"
bindblur="handleBlur"
/>
<view class="scan-box" wx:if="{{ item.scan }}" data-type="vin" bindtap="navOcr">
<image src="/images/scan.png" class="scan-icon" />
</view>
<text wx:if="{{ item.suffix }}" class="input-suffix">{{
item.suffix
}}</text>
</view>
<!-- picker -->
<picker
wx:if="{{item.type == 'select'}}"
wx:if="{{ item.type == 'select' }}"
bindchange="handlePickerChange"
data-target="{{item}}"
disabled="{{item.disabled||disable}}"
range="{{item.optionList}}"
range-key="{{item.optionLabel}}"
data-target="{{ item }}"
value="{{ pickerIndexMap[item.name] !== undefined ? pickerIndexMap[item.name] : filterUtils.getPickerIndex(formData, item) }}"
disabled="{{ item.disabled || disable }}"
range="{{ item.optionList }}"
range-key="{{ item.optionLabel }}"
>
<view class="picker">
<image class="arrow" src="/components/images/arrow-x.png" />
<view class="text-hide" wx:if="{{formData[item.labelName]}}">{{formData[item.labelName]}}</view>
<text class="placeholder" wx:else>点击选择</text>
<view class="text-hide" wx:if="{{ formData[item.labelName] }}">
{{ formData[item.labelName] }}
</view>
<text class="placeholder" wx:else>请选择</text>
</view>
</picker>
<!-- 省市区 -->
<block wx:if="{{item.type == 'region'}}">
<view class="picker" bindtap="showAreaFun">
<block wx:if="{{ item.type == 'region' }}">
<view class="picker" bindtap="showAreaFun" data-target="{{ item }}">
<image class="arrow" src="/components/images/arrow-x.png" />
<view class="text-hide" wx:if="{{formData[item.labelName]}}">{{formData[item.labelName]}}</view>
<text class="placeholder" wx:else>点击选择</text>
<view class="text-hide" wx:if="{{ formData[item.labelName] }}">
{{ formData[item.labelName] }}
</view>
<text class="placeholder" wx:else>请选择</text>
</view>
<van-popup
show="{{ showArea }}"
position="bottom"
z-index="99999"
root-portal="{{true}}"
bind:close="showAreaFun"
>
<van-area
root-portal="true"
area-list="{{ areaList }}"
columns-num="{{ item.columnsNum }}"
title="{{item.label}}"
title="{{ areaTitle || '' }}"
bind:confirm="bindRegionChange"
bind:cancel="showAreaFun" />
bind:cancel="showAreaFun"
data-target="{{ item }}"
/>
</van-popup>
</block>
<!-- <picker
mode="region"
bindchange="bindRegionChange"
data-target="{{item}}"
value="{{index}}"
level="{{item.level}}"
disabled="{{item.disabled||disable}}">
<view class="picker">
<image class="arrow" src="/components/images/arrow-x.png" />
<view class="text-hide" wx:if="{{formData[item.labelName]}}">
{{formData[item.labelName]}}
</view>
<text class="placeholder" wx:else>请选择</text>
</view>
</picker> -->
<!-- 时间选择器 -->
<picker
wx:if="{{item.type == 'pickerTime'}}"
wx:if="{{ item.type == 'pickerTime' }}"
mode="date"
value="{{formData[name] || formData[item.name]}}"
start="{{item.start || ''}}"
end="{{item.end || ''}}"
value="{{ formData[name] || formData[item.name] }}"
start="{{ item.start || '' }}"
end="{{ (item.name === 'registrationDate' || item.name === 'productionDate') ? currentDate : (item.end || '') }}"
bindchange="handleTimeChange"
data-target="{{item}}"
data-target="{{ item }}"
>
<view class="picker">
<view class="text-hide" wx:if="{{formData[item.name]}}">{{formData[item.name]}}</view>
<text class="placeholder" wx:else>点击选择</text>
<view class="text-hide" wx:if="{{ formData[item.name] }}">
{{ formData[item.name] }}
</view>
<text class="placeholder" wx:else>请选择</text>
</view>
</picker>
<!-- 品牌车型 -->
<view wx:if="{{item.type == 'brand'}}" class="brand">
<view wx:if="{{formData.vehicleBrandId}}">
{{formData.vehicleBrandName || ''}}/{{formData.vehicleSubBrandName || ''}}/{{formData.vehicleSeriesName || ''}}/{{formData.vehicleShapeName || ''}}
<view wx:if="{{ item.type == 'brand' }}" class="brand">
<view wx:if="{{ formData.carSeriesName }}">
{{ formData.carSeriesName || "" }} {{ formData.carTypeName || "" }}
</view>
<view wx:else class="placeholder-class">{{item.placeholder || '点击选择'}}</view>
<view wx:else class="placeholder-class">{{
item.placeholder || "请选择"
}}</view>
</view>
</gl-cell>
<slot wx:if="{{item.type == 'otherSlot'}}" name="{{item.name}}" />
<slot wx:if="{{ item.type == 'otherSlot' }}" name="{{ item.name }}" />
</view>
/* components/GLCustForm/GLCustForm.wxss */
.gl-cust-form {
.input-box {
display: flex;
align-items: center;
justify-content: space-between;
align-items: center;
--cell-line-height: 40rpx !important;
}
.radio-box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.radio-item {
display: inline-block;
width: 270rpx;
}
.input-box {
display: flex;
align-items: center;
justify-content: space-between;
align-items: center;
--cell-line-height: calc(28vmin / 7.5) !important;
min-width: 0; /* 防止 flex 子元素溢出 */
}
.textarea {
text-align: right;
font-size: var(--fontSize28) !important;
flex-grow: 1;
}
.textarea {
text-align: right;
font-size: var(--fontSize28) !important;
flex: 1;
min-width: 0; /* 允许 flex 子元素收缩 */
overflow: hidden; /* 防止内容溢出 */
}
.meeting-box {
.van-cell {
line-height: auto !important;
border: 2rpx solid #ececec;
border-radius: 16rpx;
margin-top: 16rpx;
padding: 16rpx 24rpx !important;
}
.van-field__control--textarea {
min-height: var(--field-text-area-min-height,144rpx) !important;
}
}
.input-suffix {
/* height: var(--fontSize88);
line-height: var(--fontSize88); */
/* height: var(--fontSize132);
line-height: var(--fontSize132); */
margin-left: var(--fontSize4);
}
.input-suffix {
/* height: var(--fontSize88);
line-height: var(--fontSize88); */
/* height: var(--fontSize132);
line-height: var(--fontSize132); */
margin-left: var(--fontSize12);
flex-shrink: 0; /* 防止被压缩 */
white-space: nowrap; /* 防止换行 */
}
.placeholder-class {
color: #C3C3C3;
}
.placeholder-class {
color: #c3c3c3;
}
.picker {
display: flex;
flex-direction: row-reverse;
height: var(--fontSize40) !important;
line-height: var(--fontSize40) !important;
text-align: right;
}
.picker {
display: flex;
flex-direction: row-reverse;
height: var(--fontSize80);
line-height: var(--fontSize80);
text-align: right;
}
.arrow {
// width: var(--fontSize28);
// height: var(--fontSize26);
// margin-top: var(--fontSize26);
// flex-shrink: 0;
width: var(--fontSize28);
height: var(--fontSize26);
margin-top: var(--fontSize6);
transform: 0;
flex-shrink: 0;
}
.placeholder {
font-weight: 400;
font-size: var(--fontSize28);
color: #b6b6b8;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.gl-form .arrow {
width: var(--fontSize28);
height: var(--fontSize26);
margin-top: var(--fontSize26);
flex-shrink: 0;
}
.brand {
text-align: right;
padding: var(--fontSize40) 0;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.textarea .van-field__control {
//padding: 16rpx 24rpx !important;
height: 38px;
line-height: 38px;
padding-left: 24rpx;
}
.brand {
text-align: right;
padding: var(--fontSize40) 0;
}
.placeholder {
font-weight: 400;
font-size: var(--fontSize28);
color: #B6B6B8;
}
.gl-form .van-field__control--disabled {
color: #666666;
-webkit-text-fill-color: #666666;
}
// .input-box .textarea input {
// height: var(--fontSize40);
// }
.input-box .textarea input {
height: var(--fontSize72);
}
// .gl-cust-form .van-cell--borderless {
// padding: var(--fontSize10) 0 !important;
// }
.gl-form .van-cell--borderless {
padding: var(--fontSize10) 0 !important;
}
// .between .van-cell--borderless {
// padding: var(--fontSize30) 0 !important;
// }
.between .van-cell--borderless {
padding: var(--fontSize30) 0 !important;
}
.gl-form .scan-box {
width: var(--fontSize60);
height: var(--fontSize40);
border-radius: var(--fontSize32);
opacity: 1;
background: #f2f2f2;
align-items: center;
justify-content: center;
display: flex;
margin-left: var(--fontSize16);
flex-shrink: 0; /* 防止被压缩 */
}
.gl-form .scan-box .scan-icon {
width: var(--fontSize28);
height: var(--fontSize28);
}
/* @media screen and (min-device-width: 600px) and (-webkit-min-device-pixel-ratio: 1) {
} */
\ No newline at end of file
} */
var isShowFn = function (formData, targetItem) {
var flag = false
var flag = false;
if (targetItem.isShowObj && formData) {
for (var i = 0; i <= targetItem.isShowObj.list.length; i++) {
var item = targetItem.isShowObj.list[i]
var item = targetItem.isShowObj.list[i];
if (item == formData[targetItem.isShowObj.attr]) {
flag = true
break
flag = true;
break;
}
}
} else {
flag = true
flag = true;
}
return flag
}
return flag;
};
// 根据 formData 的值和 optionList 计算 picker 的选中索引
var getPickerIndex = function (formData, item) {
if (!formData || !item) {
return 0;
}
var optionList = item.optionList;
var optionId = item.optionId;
var fieldName = item.name;
if (!optionList || optionList.length === 0 || !optionId || !fieldName) {
return 0;
}
var currentValue = formData[fieldName];
if (
currentValue === null ||
currentValue === undefined ||
currentValue === ""
) {
return 0;
}
// WXS 不支持 String(),使用 "" + value 的方式转换为字符串
var currentValueStr = "" + currentValue;
for (var i = 0; i < optionList.length; i++) {
var option = optionList[i];
if (!option) continue;
// 在 WXS 中,需要使用字符串键名访问对象属性
var optionValue = null;
if (optionId === "value") {
optionValue = option.value;
} else if (optionId === "name") {
optionValue = option.name;
} else {
optionValue = option[optionId];
}
if (optionValue === null || optionValue === undefined) continue;
// WXS 不支持 String(),使用 "" + value 的方式转换为字符串
var optionValueStr = "" + optionValue;
// 比较字符串值(已确保数据类型一致,直接字符串比较即可)
if (optionValueStr === currentValueStr) {
return i;
}
}
return 0;
};
module.exports = {
isShowFn: isShowFn
}
\ No newline at end of file
isShowFn: isShowFn,
getPickerIndex: getPickerIndex,
};
// packageIndex/pages/editOrder/components/FirstStep/FirstStep.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageIndex/pages/editOrder/components/FirstStep/FirstStep.wxss */
\ No newline at end of file
<!--packageIndex/pages/editOrder/components/FirstStep/FirstStep.wxml-->
<text>packageIndex/pages/editOrder/components/FirstStep/FirstStep.wxml</text>
\ No newline at end of file
{
"usingComponents": {
"van-steps": "@vant/weapp/steps/index",
"gl-cust-form": "/components/GLCustForm/index"
},
"navigationBarTitleText": "发布车辆",
"navigationBarBackgroundColor": "#ffffff"
}
\ No newline at end of file
/* packageIndex/pages/editOrder/editOrder.wxss */
\ No newline at end of file
<!--packageIndex/pages/editOrder/editOrder.wxml-->
<view class="container">
<!-- 顶部步骤条 -->
<view class="step-wrap">
<van-steps
steps="{{ steps }}"
active="{{ active }}"
active-color="#ff6600"
/>
</view>
<!-- 表单内容 -->
<view class="form-wrap">
<gl-cust-form
config="{{ formConfig }}"
formData="{{ formData }}"
bind:change="onFormChange"
/>
<!-- 底部灰色占位区域(视需求) -->
<view class="grey-box"></view>
</view>
<!-- 底部固定栏占位 -->
<view class="footer-placeholder"></view>
<!-- 底部操作栏 -->
<view class="footer-bar">
<view class="dots-indicator">
<view class="dot active"></view>
<view class="dot"></view>
<view class="dot"></view>
<view class="dot"></view>
</view>
<view class="action-row">
<text class="draft-btn" bindtap="saveDraft">保存草稿</text>
<view class="next-btn" bindtap="nextStep">下一步</view>
</view>
</view>
</view>
\ No newline at end of file
page {
background-color: #f7f8fa;
}
.container {
min-height: 100vh;
}
.step-wrap {
background-color: #ffffff;
padding: 30rpx 0;
margin-bottom: 20rpx;
}
.form-wrap {
background-color: #ffffff;
}
.grey-box {
background-color: #f5f5f5;
height: 300rpx;
margin: 0 30rpx 30rpx;
border-radius: 8rpx;
}
.footer-placeholder {
height: 160rpx;
}
.footer-bar {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #ffffff;
box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05);
z-index: 100;
padding-bottom: env(safe-area-inset-bottom);
}
.dots-indicator {
display: flex;
justify-content: center;
align-items: center;
padding-top: 10rpx;
}
.dot {
width: 24rpx;
height: 6rpx;
background-color: #e5e5e5;
border-radius: 3rpx;
margin: 0 6rpx;
}
.dot.active {
background-color: #ff6600;
}
.action-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 30rpx;
}
.draft-btn {
font-size: 28rpx;
color: #666666;
padding: 20rpx;
}
.next-btn {
flex: 1;
background-color: #ff6600;
color: #ffffff;
font-size: 32rpx;
text-align: center;
height: 88rpx;
line-height: 88rpx;
border-radius: 44rpx;
margin-left: 40rpx;
}
// packageIndex/pages/editOrder/editOrder.js
// packageIndex/pages/editOrder/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
title: "新增申请",
step: "first", // first | second | third | fourth
currentStep: 1, // 当前步骤:1-基本信息 | 2-车辆详情 | 3-价格设置 | 4-照片上传
stepList: [
{ step: 1, name: "基本信息" },
{ step: 2, name: "车辆详情" },
{ step: 3, name: "价格设置" },
{ step: 4, name: "照片上传" },
],
},
/**
......@@ -15,6 +23,13 @@ Page({
},
navbarReady(e) {
let navBarHeight = e.detail.height;
this.setData({
navBarHeight,
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
......
{
"navigationBarTitleText": "新增申请",
"usingComponents": {
"first-step": "../components/FirstStep/FirstStep",
"van-sticky": "@vant/weapp/sticky/index"
}
}
\ No newline at end of file
/* packageIndex/pages/editOrder/index/index.wxss */
.addEvaluationForm-layout {
min-height: 100vh;
display: flex;
flex-direction: column;
.bg {
width: 100%;
height: var(--fontSize800);
background: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/usedCar/evaluationForm-bg.png")
no-repeat;
background-size: 100% 100%;
position: fixed;
left: 0;
top: 0;
z-index: -1;
}
.navigation-bar {
background-color: rgb(246, 247, 247);
box-shadow: none;
}
}
page {
background-color: rgb(246, 247, 247);
}
.main {
box-sizing: border-box;
// padding: 0 var(--fontSize20) var(--fontSize376);
padding: 0rpx 20rpx 200rpx;
padding-bottom: 250rpx;
&.showTips {
padding-bottom: 360rpx;
}
}
.isFullSucreen {
// padding-bottom: 702rpx !important;
// padding-bottom: 166px !important;
}
.isFullSucreen.fullSucreen-tips {
padding-bottom: 136px !important;
}
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
.input {
text-align: right;
font-size: var(--fontSize28);
height: 100%;
}
.placeholder-class {
color: #bec1c7;
}
.between {
display: flex;
align-items: center;
justify-content: flex-end;
}
.between .start {
max-width: 70%;
}
.between .end text {
margin: 0 var(--fontSize6);
}
.btns {
width: 100%;
flex-shrink: 0;
background: #ffffff;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
font-size: var(--fontSize32);
font-weight: 500;
flex-direction: column;
margin-top: var(--fontSize32);
padding: var(--fontSize20) 0;
}
.btns-con {
box-sizing: border-box;
display: flex;
padding: var(--fontSize20) 0;
width: calc(100% - var(--fontSize80));
}
.tipsIcon,
.closeIcon {
width: var(--fontSize32);
height: var(--fontSize32);
}
.btns .btns-con view {
border: var(--fontSize2) solid #0075f9;
border-radius: var(--fontSize12);
height: var(--fontSize80);
box-sizing: border-box;
}
.btns .save,
.confirm {
border: var(--fontSize2) solid #0075f9;
border-radius: var(--fontSize12);
height: var(--fontSize80);
box-sizing: border-box;
}
.btns .save {
/* width: var(--fontSize186); */
width: 50%;
margin-right: var(--fontSize20);
color: #347bff;
margin-right: var(--fontSize20);
}
.btns .confirm {
/* width: var(--fontSize480); */
width: 50%;
color: #fff;
background-color: #347bff;
}
.btns .save.disabled {
border: 1px solid #dcdee0;
color: #c0c0cc;
}
.waitOrderCon {
box-sizing: border-box;
position: fixed;
bottom: 165rpx;
width: 100%;
display: flex;
align-items: center;
font-size: var(--fontSize24);
font-weight: 600;
color: #347bff;
z-index: 10;
/* padding: 0 var(--fontSize20); */
height: var(--fontSize74);
background: #eff5fe;
z-index: 10;
&.showTips {
bottom: 305rpx;
}
}
.waitOrderCon .tipsIcon {
width: var(--fontSize32);
height: var(--fontSize32);
margin-right: var(--fontSize20);
z-index: 1;
}
.waitOrderCon .btn {
color: #f24724;
padding: var(--fontSize6) var(--fontSize20);
margin-left: auto;
border: 1px solid #f24724;
border-radius: var(--fontSize28);
}
.tipsadd {
position: relative;
box-sizing: border-box;
display: flex;
justify-content: space-between;
/* align-items: center; */
padding: var(--fontSize20);
background: #eff5fe;
height: var(--fontSize140);
width: 100%;
color: #333333;
font-size: var(--fontSize24);
}
.tipsadd .contentText {
margin-left: var(--fontSize20);
margin-right: auto;
display: flex;
font-weight: 500;
flex-direction: column;
.tradeNo {
max-width: 400rpx;
margin-right: 10rpx;
}
.tradeNoCon {
display: flex;
justify-content: space-between;
}
.tipsbox {
margin-top: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.tipsbtn {
position: absolute;
right: 120rpx;
bottom: 20rpx;
color: #347bff;
padding: var(--fontSize6) var(--fontSize20);
margin-left: auto;
border: 1px solid #347bff;
border-radius: var(--fontSize28);
margin-top: -26rpx;
margin-right: -90rpx;
}
}
.btns-con {
box-sizing: border-box;
display: flex;
padding: var(--fontSize10) 0;
width: calc(100% - var(--fontSize80));
}
.btn-box .contentText {
margin: 0 var(--fontSize20);
}
/* 固定在顶部的区域 */
.fixed-header {
background-color: #ffffff;
height: auto;
flex-shrink: 0;
position: relative;
z-index: 1;
margin: 0;
padding: 20rpx 24rpx 18rpx;
.stepper-container {
display: flex;
align-items: flex-start;
justify-content: center;
.step-item {
display: flex;
flex-direction: column;
align-items: center;
min-width: 90rpx;
}
.step-number-circle {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
background-color: #e3e3e3;
display: flex;
align-items: center;
justify-content: center;
&.active {
background-color: #2f63f8;
}
}
.step-number {
font-size: 26rpx;
color: #a6a6a6;
font-weight: 500;
}
.step-number-circle.active .step-number {
color: #ffffff;
}
.step-name {
margin-top: 14rpx;
font-size: 28rpx;
line-height: 1;
color: #999999;
white-space: nowrap;
&.active {
color: #2f63f8;
font-weight: 500;
}
}
.step-line {
width: 92rpx;
height: 0;
border-top: 2rpx solid #d3d3d3;
margin: 22rpx 14rpx 0;
&.active {
border-top: 2rpx solid #2f63f8;
}
}
}
.scan-box-container {
.scan-box {
height: var(--fontSize64);
border-radius: var(--fontSize64);
border: var(--fontSize2) solid #999ea833;
background: #ffffff;
justify-content: center;
}
.scan-icon {
width: var(--fontSize32);
height: var(--fontSize32);
}
.scan-text {
font-size: var(--fontSize28);
color: #333333;
margin-left: var(--fontSize5);
}
}
}
/* 可滚动的内容区域 */
.scroll-content {
padding: var(--fontSize16) var(--fontSize20);
box-sizing: border-box;
}
.flex {
display: flex;
}
.flex-1 {
flex: 1;
}
.justify-between {
-webkit-box-pack: justify;
-ms-flex-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.align-center {
align-items: center;
}
.step-content {
padding: var(--fontSize32);
.temp-placeholder {
padding: var(--fontSize80) var(--fontSize32);
text-align: center;
color: #999;
font-size: var(--fontSize28);
background: #f5f5f5;
border-radius: var(--fontSize16);
}
}
<glsx-privacy
appletName="优加发拍"
bind:agreeClick="agreeClick"
bind:disagreeClick="disagreeClick"
>
</glsx-privacy>
<view class="addEvaluationForm-layout">
<!-- 步骤条,固定在顶部的区域 -->
<van-sticky offset-top="{{navBarHeight}}">
<view class="fixed-header">
<view class="stepper-container flex flex-1">
<block wx:for="{{stepList}}" wx:key="step">
<view class="step-item">
<view class="step-number-circle {{currentStep >= item.step ? 'active' : ''}}">
<view class="step-number">{{item.step}}</view>
</view>
<view class="step-name {{currentStep >= item.step ? 'active' : ''}}">{{item.name}}</view>
</view>
<view
wx:if="{{index < stepList.length - 1}}"
class="step-line {{currentStep > item.step ? 'active' : ''}}"
>
</view>
</block>
</view>
</view>
</van-sticky>
</view>
......@@ -194,7 +194,7 @@ Page({
},
jump() {
wx.p.router.go("/packageIndex/pages/editOrder/editOrder");
wx.p.router.go("/packageIndex/pages/editOrder/index/index");
},
// 跳转积分中心
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!