Commit 8d8c4128 by 张立顺

下单功能开发

1 parent fb52e0f6
Showing 42 changed files with 1147 additions and 81 deletions
/**
*
0本地
1开发
2测试
3生产环境
*/
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion)
//手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = false
const release = false
let index = 1
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
// trial:体验版
// release:正式版
// console.log( systemInfo.platform);
// console.log(accountInfo.miniProgram.envVersion);
if (systemInfo.platform != 'devtools') {
switch (accountInfo.miniProgram.envVersion) {
case 'develop':
// this.globalData.url = 'http://192.168.0.252:3000/api'; //
break
case 'trial':
index = manual ? index : 2
break
case 'release':
index = release ? index : 3
break
default:
index = 3
break
}
}
// console.log(index);
const secretKey_items = {
ip: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
dev: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
uat: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
prod: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
},
preRelease: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}
}
const domain_items = {
// ip: 'http://192.168.2.59:8292',
// ip: 'http://192.168.1.129:8392',
// ip: 'http://192.168.1.129:8292',
ip: 'http://192.168.1.165:8292',
// ip: 'http://192.168.2.3:8292',
dev: 'https://dj.dev.glsx.com.cn',
uat: 'https://dj.test.glsx.com.cn',
// uat: 'https://dj.beta.glsx.com.cn',
prod: 'https://dj.glsx.com.cn',
preRelease: 'https://dj.beta.glsx.com.cn'
}
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
// console.log(domain_items[target[index]]);
module.exports = {
domain: domain_items[target[index]],
secretKey: secretKey_items[target[index]]
}
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
"pages/carQuotation/CarQuotationDetail/CarQuotationDetail", "pages/carQuotation/CarQuotationDetail/CarQuotationDetail",
"pages/carQuotation/CarQuotationPay/CarQuotationPay", "pages/carQuotation/CarQuotationPay/CarQuotationPay",
"pages/carQuotation/createOrderCarQuotation/createOrderCarQuotation", "pages/carQuotation/createOrderCarQuotation/createOrderCarQuotation",
"pages/carQuotation/createOrderUserInfo/createOrderUserInfo",
"pages/ocrEquityModules/ocrEquityModules", "pages/ocrEquityModules/ocrEquityModules",
"pages/carEquity/serviceInfo/serviceInfo", "pages/carEquity/serviceInfo/serviceInfo",
"pages/carEquity/carBrands/carBrands", "pages/carEquity/carBrands/carBrands",
......
// packageEquity/pages/carEquity/components/GLForm/GLForm.js
Component({
/**
* 组件的属性列表
*/
properties: {
formData: {
type: Object,
value: () => { },
observer: function (n) {
this.setData({
formData: n
})
}
},
formDataList: {
type: Array,
value: () => []
},
labelWidth: {
type: String,
value: '140rpx'
},
// 页面存放表单对象的对象名,用于直接变更page的值
dataAttrName: {
type: String,
value: null
}
},
/**
* 组件的初始数据
*/
data: {
targetIdx: -1
},
lifetimes: {
attached() {
let thisPage = wx.$router.getPageInstance()
wx.$eventbus.on("set_car_info", (n) => {
let { targetIdx, dataAttrName } = this.data
let formData = thisPage?.data[dataAttrName] || null
if (formData) {
if (targetIdx != -1) {
let targetItem = this.data.formDataList[targetIdx] || {}
if (targetItem.handleChange) {
targetItem.handleChange(thisPage, dataAttrName, n)
}
if (!targetItem.noDefault) {
thisPage.setData({
[dataAttrName + '.' + targetItem.labelName]: n.vehicleBrandName + '/' + n.vehicleSeriesName + '/' + n.vehicleShapeName + '/' + n.vehicleSubBrandName
})
}
}
formData = Object.assign(formData, n)
thisPage.setData({
[dataAttrName]: formData
// carInfo: n,
})
}
})
}
},
/**
* 组件的方法列表
*/
methods: {
handleInput(e) {
let value = e.detail
let { attr } = e.target.dataset
let { dataAttrName } = this.data
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
[dataAttrName + '.' + attr]: value
})
// console.log(thisPage.data)
},
handlePickerChange(e) {
let idx = e.detail.value || 0
let { target } = e.currentTarget.dataset
let { dataAttrName } = this.data
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
[dataAttrName + '.' + target.name]: target.optionList[idx][target.optionId],
[dataAttrName + '.' + target.labelName]: target.optionList[idx][target.optionLabel]
})
this.triggerEvent('pickerChange', { obj: target.optionList[idx] })
},
handleTimeChange(e) {
let { value } = e.detail
let { target } = e.currentTarget.dataset
let { dataAttrName } = this.data
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
[dataAttrName + '.' + target.name]: value
})
// console.log(this.data.formData)
},
// 品牌车型
handleJumpBrand(e) {
wx.$router.go("packageEquity.carBrands")
},
handleCellClick(e) {
let { target, idx } = e.currentTarget.dataset
switch (target.type) {
case 'brand':
this.setData({
targetIdx: idx
})
this.handleJumpBrand()
break
default:
break
}
}
}
})
{
"component": true,
"usingComponents": {
"van-field": "@vant/weapp/field/index"
}
}
\ No newline at end of file \ No newline at end of file
<!-- packageEquity/pages/carEquity/components/GLForm/GLForm.wxml -->
<view wx:for="{{formDataList}}" wx:key="index">
<gl-cell border="{{!item.noBorder}}" class="{{item.name}}" haveArrow="{{item.haveArrow || false}}" valueAlign="right" label="{{item.label}}" labelWidth="{{labelWidth}}" placeholder="{{item.placeholder || ''}}" bindclick="handleCellClick" data-target="{{item}}" data-idx="{{index}}" cellHeight="{{!item.noCellHeight}}">
<!-- input / textarea -->
<van-field wx:if="{{item.type == 'input'}}" class="textarea" value="{{formData[item.name]}}" input-align="{{itme.inputAlign || 'right'}}" rows="1" autosize type="{{item.fieldType || 'text'}}" placeholder="{{item.placeholder || '请输入'}}" maxlength="{{item.maxlength || 140}}" disabled="{{item.disabled}}" readonly="{{item.readonly}}" data-attr="{{item.name}}" bindinput="handleInput" />
<!-- picker -->
<picker wx:if="{{item.type == 'select'}}" bindchange="handlePickerChange" data-target="{{item}}" value="{{index}}" 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>
</picker>
<!-- 时间选择器 -->
<picker wx:if="{{item.type == 'pickerTime'}}" mode="date" value="{{formData[name]}}" start="{{item.start || ''}}" end="{{item.end || ''}}" bindchange="handleTimeChange" data-target="{{item}}">
<view class="picker">
<image class="arrow" src="../../../components/images/arrow-x.png" />
<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'}}">{{formData[item.labelName]}}</view>
</gl-cell>
</view>
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/carEquity/components/GLForm/GLForm.wxss */
.input {
text-align: right;
font-size: 28rpx;
}
.placeholder-class {
color: #C3C3C3;
}
.picker {
display: flex;
flex-direction: row-reverse;
height: 80rpx;
line-height: 80rpx;
text-align: right;
}
.placeholder {
font-weight: 400;
font-size: 28rpx;
color: #B6B6B8;
}
.arrow {
width: 28rpx;
height: 26rpx;
margin-top: 26rpx;
flex-shrink: 0;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/TabBar/equityPage.wxss */
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/carEquity/carBrands/carBrands.wxss */
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/carEquity/carSeries/carSeries.wxss */
\ No newline at end of file \ No newline at end of file
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"gl-form": "../GLForm/GLForm" "gl-form": "../../../../components//GLForm/GLForm"
} }
} }
{ {
"navigationBarTitleText": "服务信息", "navigationBarTitleText": "车辆和车主信息",
"usingComponents": { "usingComponents": {
"first-step": "../components/FirstStep/FirstStep", "first-step": "../components/FirstStep/FirstStep",
"second-step": "../components/SecondStep/SecondStep" "second-step": "../components/SecondStep/SecondStep"
......
/* packageEquity/pages/carQuotation/CarQuotationDetail/CarQuotationDetail.wxss */
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.wxss */
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/carEquity/components/FirstStep/FirstStep.js
import data from '../constant/data'
import fn from '../constant/ruleFn'
const defaultLabelWidth = '140rpx'
import api from '~/api/api'
Component({
/**
* 组件的属性列表
*/
properties: {
serviceInfo: {
type: Object,
value: () => {}
},
// 页面存放表单对象的对象名
dataAttrName: {
type: String,
value: null
}
},
/**
* 组件的初始数据
*/
data: {
defaultLabelWidth,
formData: {},
secondObj: data.secondObj,
salesList: [
{
id: '1',
name: 'CCC'
},
{
id: '2',
name: 'AAA'
}
],
formRule: data.formRule,
// 品牌车型
brandBox: false
},
lifetimes: {
attached() {
wx.$eventbus.on('set_car_info', n => {
let { formData } = this.data
if (formData) {
formData = Object.assign(formData, n)
this.setData({
formData,
carInfo: n
})
}
})
}
},
/**
* 组件的方法列表
*/
methods: {
// showPopup(e) {
// let { showName } = e.currentTarget.dataset
// this.setData({
// [showName]: true
// })
// },
// 推荐人
handleSalesChange(e) {
let idx = e.detail.value || 0
this.setData({
'formData.actualSalesPersonId': this.data.salesList[idx].id,
'formData.actualSalesPerson': this.data.salesList[idx].name
})
},
// 品牌车型
handleJumpBrand(e) {
// let {
// detail: { brandInfo },
// carInfo,
// } = this.data
// { name } = e.currentTarget.dataset,
// chooseItem = Object.keys(carInfo).length;
// if (name == "carSeries") {
// console.log(carInfo);
// if (chooseItem || hasDefaultBrands) {
// let id = chooseItem
// ? carInfo.vehicleSubBrandId
// : brandInfo.vehicleSubBrandId,
// name = chooseItem
// ? carInfo.vehicleSubBrandName
// : brandInfo.vehicleSubBrandName,
// list = [
// {
// id,
// name,
// childs: null,
// },
// ];
// wx.$router.go("/pages/crowdfunding/carSeries/carSeries", {
// brandInfo: chooseItem ? carInfo : brandInfo,
// list,
// });
// return;
// }
// }
// wx.$router.go("/packageEquity/pages/carEquity/carBrands/carBrands");
wx.$router.go('packageEquity.carBrands')
},
handleUpload(e) {
let _this = this
let { attr } = e.currentTarget.dataset
wx.chooseImage({
count: 1,
success(res) {
let [tempFiles] = res.tempFilePaths
let tempFilesList = tempFiles.split('.')
let imgType = tempFilesList[tempFilesList.length - 1]
let type = imgType == 'unknown' ? 'jpg' : imgType
wx.getFileSystemManager().readFile({
filePath: tempFiles, //选择图片返回的相对路径
encoding: 'base64', //编码格式
success(_res) {
wx.$util.showLoading('上传中...')
api
.uploadImg({
file: `${type}@${_res.data}`
})
.then(img => {
wx.$util.hideLoading()
console.log(img)
let { code, data, message } = img
if (code == 0) {
_this.setData({
['formData.' + attr]: data
})
} else {
wx.$util.showToast(message)
}
})
}
})
}
})
},
handleInput(e) {
let { value } = e.detail
let { attr } = e.currentTarget.dataset
this.setData({
['formData.' + attr]: value
})
},
handleDraft() {},
handleConfirm() {
var { formData, formRule } = this.data
let validObj = fn.checkRequired(formData, formRule)
if (validObj) {
wx.$util.showToast(validObj.message)
// wx.pageScrollTo({
// selector: `.${key}`
// })
return
}
this.triggerEvent('confirm', { formData })
}
}
})
{
"component": true,
"usingComponents": {
"gl-form": "../../../../components//GLForm/GLForm"
}
}
<!-- packageEquity/pages/carEquity/components/FirstStep/FirstStep.wxml -->
<view>
<view class="box">
<view class="title ">车辆信息</view>
<gl-form formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{secondObj.carFormList}}" />
</view>
<view class="box">
<view class="title">客户信息</view>
<gl-form formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{secondObj.customerFormList}}" />
</view>
<button class="btn" bindtap="handleConfirm">下一步(1/2)</button>
<button class="btn draft-btn" bindtap="handleDraft">存草稿</button>
</view>
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/carEquity/components/FirstStep/FirstStep.wxss */
.box {
background: #FFFFFF;
box-shadow: 0 6rpx 16rpx 0 #cdcdd159;
border-radius: 16rpx;
margin: 20rpx;
color: #222222;
}
.m-b-40 {
margin-bottom: 40rpx;
}
.flex {
display: flex;
}
.title {
height: 96rpx;
line-height: 96rpx;
font-weight: 600;
font-size: 32rpx;
padding: 0 32rpx;
}
.picker {
display: flex;
flex-direction: row-reverse;
height: 80rpx;
line-height: 80rpx;
text-align: right;
}
.placeholder {
font-weight: 400;
font-size: 28rpx;
color: #B6B6B8;
}
.arrow {
width: 28rpx;
height: 26rpx;
margin-top: 26rpx;
flex-shrink: 0;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.input {
text-align: right;
font-size: 28rpx;
}
.placeholder-class {
color: #C3C3C3;
}
.tire-box {
padding: 0 40rpx 44rpx;
font-size: 28rpx;
color: #9B9B9E;
}
.tire-block {
width: 240rpx;
height: 240rpx;
box-sizing: border-box;
background-color: #F4F5F7;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.tire-block:first-child {
margin-right: 20rpx;
}
.tire-tip {
height: 40rpx;
line-height: 40rpx;
background-color: #ebf2fd;
border-radius: 8rpx;
font-size: 24rpx;
color: #3582EE;
margin-top: 28rpx;
padding: 4rpx 24rpx;
border-radius: 8rpx;
}
.icon-plus {
width: 35rpx;
height: 35rpx;
margin-bottom: 20rpx;
}
.btn {
box-sizing: border-box;
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 32rpx;
color: #FFFFFF;
background: #3582EE;
border-radius: 12rpx;
margin: 0 64rpx 20rpx;
}
.draft-btn {
background: #FFFFFF;
color: #3582EE;
}
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/carEquity/components/SecondStep/SecondStep.js
import data from '../constant/secondStepData'
import fn from '../constant/ruleFn'
const defaultLabelWidth = '140rpx'
Component({
/**
* 组件的属性列表
*/
properties: {
serviceInfo: {
type: Object,
value: () => { }
},
// 页面存放表单对象的对象名
dataAttrName: {
type: String,
value: null
}
},
/**
* 组件的初始数据
*/
data: {
defaultLabelWidth,
secondObj: data.secondObj,
formRule: data.formRule
},
/**
* 组件的方法列表
*/
methods: {
getPageData() {
let thisPage = wx.$router.getPageInstance()
return thisPage?.data[this.data.dataAttrName]
},
handleConfirm() {
var { formRule } = this.data
let formData = this.getPageData()
let validObj = fn.checkRequired(formData, formRule)
if (validObj) {
wx.$util.showToast(validObj.message)
// wx.pageScrollTo({
// selector: `.${validObj.attr}`
// })
return
}
this.triggerEvent('confirm')
}
}
})
{
"component": true,
"usingComponents": {
"gl-form": "../../../../components//GLForm/GLForm"
}
}
<!-- packageEquity/pages/carEquity/components/SecondStep/SecondStep.wxml -->
<view>
<view class="box">
<view class="title ">车辆信息</view>
<gl-form formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{secondObj.carFormList}}" />
</view>
<view class="box">
<view class="title">客户信息</view>
<gl-form formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{secondObj.customerFormList}}" />
</view>
<view class="box">
<view class="title">产品信息</view>
<gl-form formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{secondObj.productFormList}}" />
</view>
<view class="box m-b-40">
<view class="title">店面信息</view>
<gl-form formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{secondObj.storeFormList}}" />
</view>
<button class="btn" bindtap="handleConfirm">确认提交(2/2)</button>
<button class="btn draft-btn" bindtap="handleDraft">存草稿</button>
</view>
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/carEquity/components/SecondStep/SecondStep.wxss */
.box {
background: #FFFFFF;
box-shadow: 0 6rpx 16rpx 0 #cdcdd159;
border-radius: 16rpx;
margin: 20rpx;
color: #222222;
}
.m-b-40 {
margin-bottom: 40rpx;
}
.flex {
display: flex;
}
.title {
height: 96rpx;
line-height: 96rpx;
font-weight: 600;
font-size: 32rpx;
padding: 0 32rpx;
}
.picker {
display: flex;
flex-direction: row-reverse;
height: 80rpx;
line-height: 80rpx;
text-align: right;
}
.placeholder {
font-weight: 400;
font-size: 28rpx;
color: #B6B6B8;
}
.arrow {
width: 28rpx;
height: 26rpx;
margin-top: 26rpx;
flex-shrink: 0;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.input {
text-align: right;
font-size: 28rpx;
}
.placeholder-class {
color: #C3C3C3;
}
.tire-box {
padding: 0 40rpx 44rpx;
font-size: 28rpx;
color: #9B9B9E;
}
.tire-block {
width: 240rpx;
height: 240rpx;
box-sizing: border-box;
background-color: #F4F5F7;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.tire-block:first-child {
margin-right: 20rpx;
}
.tire-tip {
height: 40rpx;
line-height: 40rpx;
background-color: #ebf2fd;
border-radius: 8rpx;
font-size: 24rpx;
color: #3582EE;
margin-top: 28rpx;
padding: 4rpx 24rpx;
border-radius: 8rpx;
}
.icon-plus {
width: 35rpx;
height: 35rpx;
margin-bottom: 20rpx;
}
.btn {
box-sizing: border-box;
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 32rpx;
color: #FFFFFF;
background: #3582EE;
border-radius: 12rpx;
margin: 0 64rpx 20rpx;
}
.draft-btn {
background: #FFFFFF;
color: #3582EE;
}
\ No newline at end of file \ No newline at end of file
// 固定optionList
const seatesList = [{
optionId: 1,
optionLabel: 1
}, {
optionId: 2,
optionLabel: 2
}, {
optionId: 3,
optionLabel: 3
}, {
optionId: 4,
optionLabel: 4
}, {
optionId: 5,
optionLabel: 5
}, {
optionId: 6,
optionLabel: 6
}, {
optionId: 7,
optionLabel: 7
}]
const customerTypeList = [{
optionId: 1,
optionLabel: '个人'
}, {
optionId: 2,
optionLabel: '企业'
}, {
optionId: 3,
optionLabel: '个人(港澳)'
}, {
optionId: 4,
optionLabel: '个人(台)'
}, {
optionId: 5,
optionLabel: '个人(军官)'
}]
const cardTypeList = [{
optionId: 1,
optionLabel: '身份证'
}, {
optionId: 4,
optionLabel: '军官证'
}, {
optionId: 22,
optionLabel: '统一社会信息代码'
}]
const buyCarTypeList = [{
optionId: 0,
optionLabel: '贷款车'
}, {
optionId: 1,
optionLabel: '全款车'
}]
export default {
seatesList,
customerTypeList,
cardTypeList,
buyCarTypeList
}
const formRule = {
actualSalesPersonId: [
{ required: true, message: '推荐人不能为空' },
// {
// validator: (rule, value) => {
// return value != 'cwq' ? { message: '不为cwq--' } : null
// }
// }
],
vehicleBrandId: [{ required: true, message: '汽车品牌不能为空' }],
vehicleSubBrandId: [{ required: true, message: '汽车子品牌不能为空' }],
vehicleSeriesId: [{ required: true, message: '车系不能为空' }],
vehicleShapeId: [{ required: true, message: '车型不能为空' }],
tireBrand: [{ required: true, message: '轮胎品牌不能为空' }],
frontTireUrl: [{ required: true, message: '请上传前轮胎图片' }],
rearTireUrl: [{ required: true, message: '请上传后轮胎图片' }],
}
const phoneRex = /^[1]([3-9])[0-9]{9}$/
export default {
formRule,
phoneRex
}
\ No newline at end of file \ No newline at end of file
/**
* 动态校验字段
* @param {*} obj 需校验的对象
* @param {*} formRule 校验规则
* formRule = {
* id: [
* { required: true, message: 'xx不能为空' },
* {
* validator: (rule, value) => {
* return value != 'cwq' ? { message: '错误信息' } : null
* }
* }
* ],
* }
*/
const checkRequired = function (obj, formRule) {
let target = Object.keys(formRule)
for (let i = 0; i < target.length; i++) {
let attr = target[i]
let item = formRule[attr]
let requirObj = item.find(k => k.required == true)
let validFn = item.find(k => k.validator)
if (requirObj && !obj[attr]) {
return {
...requirObj,
attr
}
}
if (validFn) {
let validObj = validFn.validator({}, obj[attr])
if (validObj) {
return {
...validObj,
attr
}
}
}
}
return false
}
export default {
checkRequired
}
\ No newline at end of file \ No newline at end of file
import constantList from './constantList'
import data from './data'
const formRule = {
vin: [{ required: true, message: '车架号不能为空' }],
seatesNum: [{ required: true, message: '座位数不能为空' }],
engineNo: [{ required: true, message: '发动机号不能为空' }],
vehicleColor: [{ required: true, message: '车身颜色不能为空' }],
billingDate: [{ required: true, message: '购车日期不能为空' }],
vehicleBrandId: [{ required: true, message: '品牌车系不能为空' }],
customerType: [{ required: true, message: '客户类型不能为空' }],
customerName: [{ required: true, message: '姓名不能为空' }],
phone: [
{ required: true, message: '联系电话不能为空' },
{
validator: (rule, value) => {
return !data.phoneRex.test(value) ? { message: '请输入正确的手机号' } : null
}
}
],
cardNo: [{ required: true, message: '证件号码不能为空' }],
customerAddress: [{ required: true, message: '联系地址不能为空' }],
effectiveDate: [{ required: true, message: '生效日期不能为空' }],
tireBrand: [{ required: true, message: '轮胎品牌不能为空' }],
frontTireSpecification: [{ required: true, message: '规格型号(前轮)不能为空' }],
rearTireSpecification: [{ required: true, message: '规格型号(后轮)不能为空' }],
compensationName: [{ required: true, message: '第一受益人不能为空' }],
merchantPhone: [{ required: true, message: '联系电话不能为空' }],
merchantAddress: [{ required: true, message: '联系地址不能为空' }],
}
const secondObj = {
carFormList: [{
label: '车架号',
name: 'vin',
type: 'input',
maxlength: '17'
}, {
label: '车辆发票价',
name: 'invoicePrice',
type: 'input',
readonly: true
}, {
label: '座位数',
name: 'seatesNum',
labelName: 'seatesNum',
type: 'select',
optionList: constantList.seatesList,
optionId: 'optionId',
optionLabel: 'optionLabel'
}, {
label: '发动机号',
name: 'engineNo',
type: 'input',
maxlength: '30'
}, {
label: '车身颜色',
name: 'vehicleColor',
type: 'input',
maxlength: '5'
}, {
label: '购车日期',
name: 'billingDate',
type: 'pickerTime',
end: new Date()
}, {
label: '品牌车系',
name: 'vehicleBrandId',
labelName: 'brandTxt',
type: 'brand',
haveArrow: true,
placeholder: '请选择'
// handleChange: function (that, dataAttrName, brandObj) {
// console.log(brandObj,'brandObj--')
// that.setData({
// [dataAttrName + '.brandTxt']: brandObj.vehicleBrandName + '/' + brandObj.vehicleSeriesName + '/' + brandObj.vehicleShapeName + '/' + brandObj.vehicleSubBrandName
// })
// }
}],
customerFormList: [{
label: '客户类型',
name: 'customerType',
labelName: 'customerTypeName',
type: 'select',
optionList: constantList.customerTypeList,
optionId: 'optionId',
optionLabel: 'optionLabel'
}, {
label: '姓名',
name: 'customerName',
type: 'input',
maxlength: '100',
noCellHeight: true,
fieldType: 'textarea'
}, {
label: '联系电话',
name: 'phone',
type: 'input',
maxlength: '11',
}, {
label: '证件类型',
name: 'cardType',
labelName: 'cardTypeName',
type: 'select',
optionList: constantList.cardTypeList,
optionId: 'optionId',
optionLabel: 'optionLabel'
}, {
label: '证件号码',
name: 'cardNo',
type: 'input'
}, {
label: '联系地址',
name: 'customerAddress',
type: 'input',
maxlength: '100',
noCellHeight: true,
fieldType: 'textarea'
}],
productFormList: [{
label: '服务年限',
name: 'servicePeriod',
type: 'input',
disabled: true
}, {
label: '生效日期',
name: 'effectiveDate',
type: 'pickerTime',
start: new Date(new Date().setDate(new Date(new Date()).getDate() + 1)).toLocaleDateString()
}, {
label: '轮胎品牌',
name: 'tireBrand',
type: 'input',
maxlength: '20'
}, {
label: '规格型号(前轮)',
name: 'frontTireSpecification',
type: 'input',
maxlength: '20'
}, {
label: '规格型号(后轮)',
name: 'rearTireSpecification',
type: 'input',
maxlength: '20'
}, {
label: '购车类型',
name: 'buyCarType',
labelName: 'buyCarTypeName',
type: 'select',
optionList: constantList.buyCarTypeList,
optionId: 'optionId',
optionLabel: 'optionLabel'
}, {
label: '第一受益人',
name: 'compensationName',
type: 'input'
}],
storeFormList: [{
label: '店面名称',
name: 'merchantName',
type: 'input',
readonly: true
}, {
label: '联系电话',
name: 'merchantPhone',
type: 'input',
maxlength: '20'
}, {
label: '联系地址',
name: 'merchantAddress',
type: 'input',
fieldType: 'textarea',
maxlength: '100'
}]
}
export default {
formRule,
secondObj
}
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/carQuotation/createOrderCarQuotation/createOrderCarQuotation.js // packageEquity/pages/carEquity/serviceInfo/serviceInfo.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
serviceInfo: {
seatesNum: 5,
servicePeriod: '1年'
},
// 页面存放表单对象的对象名
dataAttrName: 'serviceInfo',
step: 'first'
},
handleFirstConfirm(e) {
let { formData } = e.detail
this.setData({
serviceInfo: formData,
step: 'second'
})
},
handleSecondConfirm() {
let { serviceInfo } = this.data
console.log(serviceInfo, '调接口---')
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
}, },
/** /**
......
{ {
"usingComponents": {} "navigationBarTitleText": "服务信息",
"usingComponents": {
"first-step": "../components/FirstStep/FirstStep",
"second-step": "../components/SecondStep/SecondStep"
}
} }
/* packageEquity/pages/carQuotation/createOrderCarQuotation/createOrderCarQuotation.wxss */
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/carQuotation/createOrderCarQuotation/createOrderCarQuotation.wxml--> <!-- packageEquity/pages/carEquity/serviceInfo/serviceInfo.wxml -->
<text>packageEquity/pages/carQuotation/createOrderCarQuotation/createOrderCarQuotation.wxml</text> <view class="layout">
<first-step wx:if="{{step == 'first'}}" id="FirstStep" serviceInfo="{{serviceInfo}}" bindconfirm="handleFirstConfirm" />
<second-step wx:if="{{step == 'second'}}" id="SecondStep" serviceInfo="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" bindconfirm="handleSecondConfirm" />
</view>
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/carEquity/serviceInfo/serviceInfo.wxss */
.layout {
background: #F4F5F7;
padding-bottom: 60rpx;
}
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/carQuotation/createOrderUserInfo/createOrderUserInfo.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/carQuotation/createOrderUserInfo/createOrderUserInfo.wxss */
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/carQuotation/createOrderUserInfo/createOrderUserInfo.wxml-->
<text>packageEquity/pages/carQuotation/createOrderUserInfo/createOrderUserInfo.wxml</text>
/* packageEquity/pages/carQuotation/fullSignture/fullSignture.wxss */
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/carQuotation/index/index.wxss */
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/carQuotation/signature/signature.wxss */
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/ocrEquityModules/ocrEquityModules.wxss */
\ No newline at end of file \ No newline at end of file
/* pages/sceneIndex/sceneIndex.wxss */
\ No newline at end of file \ No newline at end of file
...@@ -60,6 +60,13 @@ ...@@ -60,6 +60,13 @@
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
},
{
"name": "报价单",
"pathName": "packageEquity/pages/carQuotation/createOrderCarQuotation/createOrderCarQuotation",
"query": "",
"launchMode": "default",
"scene": null
} }
] ]
} }
......
/* tabDate/pages/detail/detail.wxss */
\ No newline at end of file \ No newline at end of file
/* tabDate/pages/index/index.wxss */
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!