Commit db26226b by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !171
2 parents 26db70a6 67262f59
...@@ -42,8 +42,9 @@ App({ ...@@ -42,8 +42,9 @@ App({
wx.onMemoryWarning(function () { wx.onMemoryWarning(function () {
console.log('onMemoryWarningReceive') console.log('onMemoryWarningReceive')
}) })
console.log('lifeshow');
getUpdateManager() getUpdateManager()
if (options) { if (options) {
console.log('options', options) console.log('options', options)
let res = checkScene(options) let res = checkScene(options)
...@@ -71,9 +72,11 @@ App({ ...@@ -71,9 +72,11 @@ App({
data data
} = res } = res
if (code == '0' && data) { if (code == '0' && data) {
// util.setUserinfo(data) // util.setUserinfo( console.log('noSignInUuid_sessionId',data?.sessionId);
wx.reLaunch({url: '/pages/accountItems/accountItems'})
util.setSessionId(data?.sessionId) util.setSessionId(data?.sessionId)
return router.reLaunch('pages.accountItems') return
// return router.reLaunch('pages.accountItems')
} else { } else {
util.removeStorage() util.removeStorage()
removeSystemStorage() removeSystemStorage()
......
...@@ -17,6 +17,8 @@ Component({ ...@@ -17,6 +17,8 @@ Component({
placeholder: String, placeholder: String,
iconSrc: String, iconSrc: String,
labelStyle: String, labelStyle: String,
cellStyle: String,
cellBoxStyle: String,
background: { background: {
type: String, type: String,
value: '#FFFFFF', value: '#FFFFFF',
......
<view class='cell-box' style="background:{{background}}"> <view class='cell-box' style="background:{{background}};{{cellBoxStyle}}">
<view class="cell {{cellHeight?'cellHeight': ''}} {{border?'border':''}}" bindtap="click"> <view class="cell {{cellHeight?'cellHeight': ''}} {{border?'border':''}}" style="{{cellStyle}}" bindtap="click">
<view class='cell-label title-style' style="width:{{labelWidth}};{{labelStyle}}" bindtap="titleClick"> <view class='cell-label title-style' style="width:{{labelWidth}};{{labelStyle}}" bindtap="titleClick">
<text wx:if='{{required&&requiredBefore}}' class='required'>*</text> <text wx:if='{{required&&requiredBefore}}' class='required'>*</text>
{{label||'标题'}} {{label||'标题'}}
......
...@@ -100,4 +100,5 @@ ...@@ -100,4 +100,5 @@
transform: translateY(-50%); transform: translateY(-50%);
width: 28rpx; width: 28rpx;
height: 26rpx; height: 26rpx;
margin: 0 !important;
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
Component({ Component({
externalClasses: ['custom-class'], externalClasses: ['custom-class'],
options: { options: {
multipleSlots: true // 在组件定义时的选项中启用多 slot 支持 multipleSlots: true, // 在组件定义时的选项中启用多 slot 支持
styleIsolation: 'shared', // 自定义覆盖vant样式
}, },
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -90,15 +91,22 @@ Component({ ...@@ -90,15 +91,22 @@ Component({
}, this) }, this)
}) })
}, },
parentSetData(attr, value) {
let { dataAttrName } = this.data
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
[dataAttrName + '.' + attr]: value
})
},
handleInput(e) { handleInput(e) {
let value = e.detail let value = e.detail
let { attr, item } = e.target.dataset let { attr, item } = e.target.dataset
let { dataAttrName } = this.data let { dataAttrName } = this.data
// if (attr == 'price') { // if (attr == 'price') {
// value = value >= 2000000 ? '2000000' : value // value = value >= 2000000 ? '2000000' : value
// // wx.$eventbus.emit('delete_goodsSelect') // // wx.$eventbus.emit('delete_goodsSelect')
// } // }
// console.log(item,'handleInput'); // console.log(item,'handleInput');
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
if (item.inputLimit && item.inputLimit.maxVal) { if (item.inputLimit && item.inputLimit.maxVal) {
value = value >= item.inputLimit.maxVal ? item.inputLimit.maxVal : value value = value >= item.inputLimit.maxVal ? item.inputLimit.maxVal : value
...@@ -117,9 +125,9 @@ Component({ ...@@ -117,9 +125,9 @@ Component({
const diffValue = value.toString() const diffValue = value.toString()
const trimValue = value.toString().trim() const trimValue = value.toString().trim()
if (diffValue != trimValue) { if (diffValue != trimValue) {
value = trimValue value = trimValue
} }
thisPage.setData({ thisPage.setData({
[dataAttrName + '.' + attr]: value [dataAttrName + '.' + attr]: value
}) })
......
<!-- packageEquity/pages/carEquity/components/GLForm/GLForm.wxml --> <!-- packageEquity/pages/carEquity/components/GLForm/GLForm.wxml -->
<wxs src="./GLForm.wxs" module="filterUtils" /> <wxs src="./GLForm.wxs" module="filterUtils" />
<view wx:for="{{formDataList}}" wx:key="index" class="custom-class"> <view wx:for="{{formDataList}}" wx:key="index" class="custom-class gl-form">
<gl-cell <gl-cell
wx:if="{{filterUtils.isShowFn(formData, item)}}" wx:if="{{filterUtils.isShowFn(formData, item)}}"
border="{{!item.noBorder}}" border="{{!item.noBorder}}"
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
background="{{background}}" background="{{background}}"
required="{{item.required}}" required="{{item.required}}"
requiredAfter="{{item.requiredAfter}}" requiredAfter="{{item.requiredAfter}}"
cellHeight="{{!item.noCellHeight}}"> cellHeight="{{!item.noCellHeight}}"
cellStyle="{{item.cellStyle}}"
cellBoxStyle="{{item.cellBoxStyle}}">
<!-- slot --> <!-- slot -->
<slot wx:if="{{item.type == 'slot'}}" name="{{item.name}}" /> <slot wx:if="{{item.type == 'slot'}}" name="{{item.name}}" />
<!-- input / textarea --> <!-- input / textarea -->
...@@ -67,7 +69,6 @@ ...@@ -67,7 +69,6 @@
bindchange="handleTimeChange" bindchange="handleTimeChange"
data-target="{{item}}"> data-target="{{item}}">
<view class="picker"> <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> <view class="text-hide" wx:if="{{formData[item.name]}}">{{formData[item.name]}}</view>
<text class="placeholder" wx:else>请选择</text> <text class="placeholder" wx:else>请选择</text>
</view> </view>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
color: #B6B6B8; color: #B6B6B8;
} }
.arrow { .gl-form .arrow {
width: 28rpx; width: 28rpx;
height: 26rpx; height: 26rpx;
margin-top: 26rpx; margin-top: 26rpx;
...@@ -50,4 +50,9 @@ ...@@ -50,4 +50,9 @@
.brand { .brand {
text-align: right; text-align: right;
padding: 40rpx 0; padding: 40rpx 0;
}
.gl-form .van-field__control--disabled {
color: #666666;
-webkit-text-fill-color: #666666;
} }
\ No newline at end of file \ No newline at end of file
...@@ -15,10 +15,9 @@ ...@@ -15,10 +15,9 @@
<!-- test --> <!-- test -->
</view> </view>
<view class="text" wx:elif="{{item.type == 'project' }}"> <view class="text" wx:elif="{{item.type == 'project' }}">
<block wx:for="{{orderInfo.subOrderList}}" wx:for-item="subItem" wx:key="idx"> <block wx:for="{{orderInfo.quotationGoodsInfoList || orderInfo.subOrderList}}" wx:for-item="subItem" wx:key="idx">
<view class="goodsName">{{subItem.upgradeGoodsName}} <text class="goodsItem">(包含{{subItem.serviceItems}})</text></view> <view class="goodsName">{{subItem.goodsName||subItem.upgradeGoodsName}} <text class="goodsItem">(包含{{subItem.serviceItems||subItem.position}})</text></view>
</block> </block>
<!-- <view class="goodsItem">包含{{orderInfo.subOrderList[0].serviceItems}}</view> -->
</view> </view>
<view class="text" wx:else>{{orderInfo[item.key]||''}}</view> <view class="text" wx:else>{{orderInfo[item.key]||''}}</view>
</view> </view>
......
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
import constantData from '../constant/secondStepData' import constantData from '../constant/secondStepData'
import fn from '../constant/ruleFn' import fn from '../constant/ruleFn'
const defaultLabelWidth = '140rpx' const defaultLabelWidth = '140rpx'
import api from '~/api/api'
Component({ Component({
options: {
styleIsolation: 'shared', // 自定义覆盖vant样式
},
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
...@@ -21,17 +25,17 @@ Component({ ...@@ -21,17 +25,17 @@ Component({
}, },
cardSetting: { cardSetting: {
type: Boolean, type: Boolean,
observer: function(n) { observer: function (n) {
console.log(n,'cardSetting'); console.log(n, 'cardSetting');
if (!n) { if (!n) {
let {secondObj,formRule} = this.data let { secondObj, formRule } = this.data
const productFormList = secondObj.productFormList.filter(item=>item.name != 'card') const productFormList = secondObj.productFormList.filter(item => item.name != 'card')
delete formRule.card delete formRule.card
// formRule = formRule.filter(item=> ) // formRule = formRule.filter(item=> )
this.setData({ this.setData({
['secondObj.productFormList']: productFormList, ['secondObj.productFormList']: productFormList,
formRule formRule
}) })
} }
} }
}, },
...@@ -44,11 +48,58 @@ Component({ ...@@ -44,11 +48,58 @@ Component({
defaultLabelWidth, defaultLabelWidth,
secondObj: constantData.secondObj, secondObj: constantData.secondObj,
formRule: constantData.formRule, formRule: constantData.formRule,
energyFormRule: constantData.energyFormRule,
oilFormRule: constantData.oilFormRule,
isShowObj: { isShowObj: {
car: true, car: true,
customer: true, customer: true,
product: true, product: true,
info: true,
store: true store: true
},
codeToAttr: {
YB0001: 'invoice',
YB0003: 'driveFront',
YB0004: 'driveBack',
YB0002: 'contract',
YB0005: 'other'
},
imgToInfo: {
invoice: {
code: 'YB0001',
label: '购车发票'
},
driveFront: {
code: 'YB0003',
label: '行驶证主页'
},
driveBack: {
code: 'YB0004',
label: '行驶证副页'
},
contract: {
code: 'YB0002',
label: '合同购买时里程数'
},
other: {
code: 'YB0005'
}
},
imgObj: {
invoice: [],
driveFront: [],
driveBack: [],
contract: [],
other: []
},
popObj: {
popValue: ''
}
},
lifetimes: {
attached() {
this.dealImg()
} }
}, },
...@@ -60,28 +111,83 @@ Component({ ...@@ -60,28 +111,83 @@ Component({
let formData = this.getPageData() let formData = this.getPageData()
var { formRule } = this.data var { formRule } = this.data
const list = ['tireBrand', 'frontTireSpecification', 'rearTireSpecification'] const list = ['tireBrand', 'frontTireSpecification', 'rearTireSpecification']
if(formData && formData.tireFlag == 0) { if (formData && formData.tireFlag == 0) {
list.forEach(item => { list.forEach(item => {
formRule[item][0].required = false formRule[item][0].required = false
}) })
} }
console.log(formRule);
this.setData({ this.setData({
formRule formRule
}) })
}, },
dealImg() {
let { serviceInfo, codeToAttr, imgObj } = this.data
if (serviceInfo.ybAttachmentFlag == 0 && serviceInfo.attachmentList.length) {
serviceInfo.attachmentList.forEach(item => {
imgObj[codeToAttr[item.attachmentCode]].push({ url: item.attachmentFile })
})
}
this.setData({
imgObj
})
},
handleUpDown(e) { handleUpDown(e) {
let { attr } = e.currentTarget.dataset let { attr } = e.currentTarget.dataset
this.setData({ this.setData({
['isShowObj.' + attr]: !this.data.isShowObj[attr] ['isShowObj.' + attr]: !this.data.isShowObj[attr]
}) })
}, },
handlePopupShow(e) {
let { attr, idx, typename } = e.currentTarget.dataset
let { serviceInfo } = this.data
let popValue = serviceInfo.goodInfoList[idx][attr] || ''
this.setData({
popupShow: true,
popObj: {
idx,
attr,
popValue,
typename
}
})
},
handleSelectConfirm(e) {
let { popObj } = this.data
let { value } = e.detail
let formData = this.getPageData()
let curitem = formData.goodInfoList[popObj.idx]
let idName = curitem.itemsCode == 'YB0003' ? 'oil' : 'energy'
let childCom = this.selectComponent('#' + idName + popObj.idx)
childCom.parentSetData(popObj.attr, value)
this.setData({
[`serviceInfo.goodInfoList[${popObj.idx}].${popObj.attr}`]: value
})
},
getPageData() { getPageData() {
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
return thisPage?.data[this.data.dataAttrName] return thisPage?.data[this.data.dataAttrName]
}, },
confirmDealImg() {
var { serviceInfo, imgObj, imgToInfo } = this.data
let formData = this.getPageData()
// 图片处理
if (serviceInfo.ybAttachmentFlag == 0) {
formData.attachmentList = []
let attrList = Object.keys(imgObj)
for (let i = 0; i < attrList.length; i++) {
let item = attrList[i]
imgObj[item].forEach(k => {
formData.attachmentList.push({
attachmentCode: imgToInfo[item].code,
attachmentType: 'IMG',
attachmentFile: k.url
})
})
}
}
},
handleConfirm(e) { handleConfirm(e) {
var { formRule } = this.data var { formRule, serviceInfo, imgObj, imgToInfo, energyFormRule, oilFormRule } = this.data
let formData = this.getPageData() let formData = this.getPageData()
let validObj = fn.checkRequired(formData, formRule) let validObj = fn.checkRequired(formData, formRule)
if (validObj) { if (validObj) {
...@@ -109,22 +215,105 @@ Component({ ...@@ -109,22 +215,105 @@ Component({
// } // }
return return
} }
for(let i = 0; i < formData.goodInfoList.length; i++) { for (let i = 0; i < formData.goodInfoList.length; i++) {
let item = formData.goodInfoList[i] let item = formData.goodInfoList[i]
if(item.entityCardFlag == 'Y' && !/[a-zA-Z0-9]{6}/.test(item.card)) { if (item.entityCardFlag == 'Y' && !/[a-zA-Z0-9]{6}/.test(item.card)) {
wx.$util.showToast(item.goodName + '商品卡号请输入6位字母或数字') wx.$util.showToast(item.goodName + '商品卡号请输入6位字母或数字')
return return
} }
// 延保产品-验证
if (item.printType == 2) {
// itemsCode标识:YB0001-延保-6大件,YB0002-延保-3电,YB0003-延保-油车
let subValidObj = fn.checkRequired(item, item.itemsCode == 'YB0003' ? oilFormRule : energyFormRule)
if (subValidObj) {
wx.$util.showToast(subValidObj.message)
return
}
}
}
// 图片处理
if (serviceInfo.ybAttachmentFlag == 0) {
formData.attachmentList = []
let attrList = Object.keys(imgObj)
for (let i = 0; i < attrList.length; i++) {
let item = attrList[i]
if (item != 'other' && !imgObj[item].length) {
wx.$util.showToast('请上传' + imgToInfo[item].label)
return true
}
}
} }
this.confirmDealImg()
console.log(formData, 'formData---')
this.triggerEvent('confirm', { type: 'confirm' }) this.triggerEvent('confirm', { type: 'confirm' })
}, },
handleDraft() { handleDraft() {
this.confirmDealImg()
this.triggerEvent('draft', { type: 'draft' }) this.triggerEvent('draft', { type: 'draft' })
}, },
handleWarrantyInput(e) {
let value = e.detail
let { attr, idx, curitem } = e.target.dataset
let [number, decimal] = value.toString().split('.')
if (decimal != undefined) {
decimal = decimal.substring(0, 2)
number += `.${decimal}`
value = number
}
let idName = curitem.itemsCode == 'YB0003' ? 'oil' : 'energy'
let childCom = this.selectComponent('#' + idName + idx)
childCom.parentSetData(attr, value)
this.setData({
[`serviceInfo.goodInfoList[${idx}].${attr}`]: value
})
},
// 拍照识别 // 拍照识别
navOcr(e) { navOcr(e) {
let { type } = e.currentTarget.dataset let { type } = e.currentTarget.dataset
wx.$router.go(`ocrEquityModules?type=${type}`) wx.$router.go(`ocrEquityModules?type=${type}`)
},
// 图片上传
upLoad(event) {
let _this = this
const { file } = event.detail
const { attr, idx } = event.currentTarget.dataset
let { imgObj } = this.data
let tempFiles = file?.url
let imgType = tempFiles.split('.')[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()
let { code, data, message } = img
if (code == 0) {
imgObj[attr].push({ url: data })
_this.setData({
imgObj
})
} else {
wx.$util.showToast(message)
}
})
}
})
},
// 图片删除
handleDeleteImg(e) {
const { attr } = e.currentTarget.dataset
let { imgObj } = this.data
const { index } = e.detail
imgObj[attr].splice(index, 1)
this.setData({
imgObj
})
} }
} }
}) })
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"gl-form": "/packageEquity/components/GLForm/GLForm" "gl-form": "/packageEquity/components/GLForm/GLForm",
"popup-select": "/packageEquity/pages/carQuotation/components/PopupSelect/PopupSelect"
} }
} }
<!--packageEquity/pages/carEquity/components/SecondStep/SecondStep.wxml--> <!--packageEquity/pages/carEquity/components/SecondStep/SecondStep.wxml-->
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<view> <view>
<view class="box"> <view class="box">
<view class="title"> <view class="title">
...@@ -47,17 +48,73 @@ ...@@ -47,17 +48,73 @@
<!-- 多商品 --> <!-- 多商品 -->
<view slot="goodInfoList"> <view slot="goodInfoList">
<view wx:for="{{serviceInfo.goodInfoList}}" wx:key="index"> <view wx:for="{{serviceInfo.goodInfoList}}" wx:key="index">
<view class="pro-head"> <view>
<view>{{item.goodName}}</view> <view class="pro-head">
<view class="pro-service">包含{{item.items}}</view> <view>{{item.goodName}}</view>
</view> <view class="pro-service">包含{{item.items}}</view>
<view class="pro-list"> </view>
<gl-form id="proList" background="#F4F5F7" formData="{{item}}" dataAttrName="{{'serviceInfo.goodInfoList[' + index +']'}}" formDataList="{{secondObj.productFormList[0].proFormList}}"></gl-form> <view class="pro-list">
<view wx:if="{{item.printType == 2}}">
<!-- itemsCode标识:YB0001-延保-6大件,YB0002-延保-3电,YB0003-延保-油车 -->
<gl-form wx:if="{{item.itemsCode == 'YB0003'}}" id="{{'oil' + index}}" background="#F4F5F7" formData="{{item}}" dataAttrName="{{'serviceInfo.goodInfoList[' + index +']'}}" formDataList="{{secondObj.productFormList[0].oilProFormList}}">
<view slot="warranty" class="warranty">
<van-field class="textarea" custom-style="width: 100rpx; padding: 20rpx 0; background: #F4F5F7;" border="{{false}}" value="{{item.warrantyPeriod}}" input-align="right" autosize hold-keyboard type="number" placeholder="请输入" maxlength="140" data-attr="warrantyPeriod" data-idx="{{index}}" data-curitem="{{item}}" bindinput="handleWarrantyInput" />
<text class="input-suffix">年或</text>
<van-field class="textarea" custom-style="width: 100rpx; padding: 20rpx 0 20rpx 12rpx; background: #F4F5F7;" border="{{false}}" value="{{item.warrantyKm}}" input-align="right" autosize hold-keyboard type="number" placeholder="请输入" maxlength="140" data-attr="warrantyKm" data-idx="{{index}}" data-curitem="{{item}}" bindinput="handleWarrantyInput" />
<text class="input-suffix">万公里</text>
</view>
<view slot="gearbox" class="selectItem gearbox" data-attr="gearbox" data-idx="{{index}}" data-typename="gearboxtype" catchtap="handlePopupShow">
{{item.gearbox}}
<image class="arrow" src="/components/images/arrow-x.png" mode="widthFix" binderror="" bindload="" />
</view>
</gl-form>
<gl-form wx:else id="{{'energy' + index}}" background="#F4F5F7" formData="{{item}}" dataAttrName="{{'serviceInfo.goodInfoList[' + index +']'}}" formDataList="{{secondObj.productFormList[0].energyProFormList}}">
<view slot="warranty" class="warranty">
<van-field class="textarea" custom-style="width: 100rpx; padding: 20rpx 0; background: #F4F5F7;" border="{{false}}" value="{{item.warrantyPeriod}}" input-align="right" autosize hold-keyboard type="number" placeholder="请输入" maxlength="140" data-attr="warrantyPeriod" data-idx="{{index}}" data-curitem="{{item}}" bindinput="handleWarrantyInput" />
<text class="input-suffix">年或</text>
<van-field class="textarea" custom-style="width: 100rpx; padding: 20rpx 0 20rpx 12rpx; background: #F4F5F7;" border="{{false}}" value="{{item.warrantyKm}}" input-align="right" autosize hold-keyboard type="number" placeholder="请输入" maxlength="140" data-attr="warrantyKm" data-curitem="{{item}}" data-idx="{{index}}" bindinput="handleWarrantyInput" />
<text class="input-suffix">万公里</text>
</view>
</gl-form>
</view>
<gl-form wx:else id="proList" background="#F4F5F7" formData="{{item}}" dataAttrName="{{'serviceInfo.goodInfoList[' + index +']'}}" formDataList="{{secondObj.productFormList[0].equityProFormList}}"></gl-form>
</view>
</view> </view>
</view> </view>
</view> </view>
</gl-form> </gl-form>
</view> </view>
<!-- 延保附件展示标识,0-展示,1-不展示 -->
<view wx:if="{{serviceInfo.ybAttachmentFlag == 0}}" class="box m-b-40">
<view class="title">
<view>上传资料</view>
<view class="up-down-box" bindtap="handleUpDown" data-attr="info">
<view class="up-down-arrow">
<view class="arrow-up {{isShowObj.info ? '' : 'arrow-down'}}"></view>
</view>
</view>
</view>
<gl-form wx:if="{{isShowObj.info}}" id="store" formData="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" formDataList="{{secondObj.infoFormList}}">
<view slot="upload" class="upload">
<view class="label">购车发票</view>
<van-uploader class="plus" file-list="{{ imgObj.invoice }}" upload-text="上传照片" max-count="1" deletable preview-size="192rpx" bind:after-read="upLoad" bind:delete="handleDeleteImg" data-attr="invoice">
</van-uploader>
<view class="label">行驶证</view>
<view class="flex">
<van-uploader class="driveFront" file-list="{{ imgObj.driveFront }}" upload-text="行驶证主页" max-count="1" deletable preview-size="192rpx" bind:after-read="upLoad" bind:delete="handleDeleteImg" data-attr="driveFront">
</van-uploader>
<van-uploader class="driveBack" file-list="{{ imgObj.driveBack }}" upload-text="行驶证副页" max-count="1" deletable preview-size="192rpx" bind:after-read="upLoad" bind:delete="handleDeleteImg" data-attr="driveBack">
</van-uploader>
</view>
<view class="label">合同购买时里程数</view>
<van-uploader class="plus" file-list="{{ imgObj.contract }}" upload-text="上传照片" max-count="1" deletable preview-size="192rpx" bind:after-read="upLoad" bind:delete="handleDeleteImg" data-attr="contract">
</van-uploader>
<view class="label">其他</view>
<van-uploader class="plus" file-list="{{ imgObj.other }}" upload-text="上传照片\n最多9张" max-count="9" deletable preview-size="192rpx" bind:after-read="upLoad" bind:delete="handleDeleteImg" data-attr="other">
</van-uploader>
</view>
</gl-form>
</view>
<view class="box m-b-40"> <view class="box m-b-40">
<view class="title"> <view class="title">
<view>店面信息</view> <view>店面信息</view>
...@@ -72,4 +129,5 @@ ...@@ -72,4 +129,5 @@
<button class="btn" bindtap="handleConfirm">{{serviceInfo.mode?'确认提交':'确认提交(2/2)'}}</button> <button class="btn" bindtap="handleConfirm">{{serviceInfo.mode?'确认提交':'确认提交(2/2)'}}</button>
<button class="btn draft-btn" bindtap="handleDraft">存草稿</button> <button class="btn draft-btn" bindtap="handleDraft">存草稿</button>
<view class="h-40"></view> <view class="h-40"></view>
</view>
\ No newline at end of file \ No newline at end of file
</view>
<popup-select show="{{ popupShow }}" popObj="{{ popObj }}" typeName="{{ popObj.typename }}" bindconfirm="handleSelectConfirm" />
\ No newline at end of file \ No newline at end of file
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
color: #B6B6B8; color: #B6B6B8;
} }
.arrow { .gearbox .arrow {
width: 28rpx; width: 28rpx;
height: 26rpx; height: 26rpx;
margin-top: 26rpx; margin-top: 26rpx;
...@@ -186,10 +186,101 @@ ...@@ -186,10 +186,101 @@
.pro-head .pro-service { .pro-head .pro-service {
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
margin-top: 4rpx;
} }
.pro-list { .pro-list {
border: 4rpx solid #F4F5F7; border: 4rpx solid #F4F5F7;
border-radius: 8rpx; border-radius: 8rpx;
margin: 30rpx 0; margin: 30rpx 0;
}
.label {
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
color: #222222;
}
.selectItem {
box-sizing: border-box;
height: 88rpx;
line-height: 88rpx;
text-align: right;
}
.selectItem .arrow {
width: 28rpx;
height: 26rpx;
margin-top: 32rpx;
}
.warranty {
display: flex;
justify-content: flex-end;
height: 80rpx;
line-height: 80rpx;
}
.warranty .input-suffix {
/* width: calc((100% - 212rpx) / 2); */
margin-left: 12rpx;
}
.upload {
padding-bottom: 40rpx;
}
.upload .van-uploader .van-uploader__wrapper .van-uploader__preview .van-uploader__preview-delete {
background-color: #B2B2B2 !important;
border-radius: 0 4rpx !important;
top: 0rpx !important;
right: 0rpx !important;
}
.upload .plus .van-icon-photograph:before {
content: '';
width: 32rpx;
height: 32rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/icon-plus.png');
background-size: 100% 100%;
}
.upload .driveFront {
margin-right: 24rpx;
}
.upload .driveFront .van-icon-photograph:before {
content: '';
width: 152rpx;
height: 108rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/icon-front.png');
background-size: 100% 100%;
}
.upload .driveBack .van-icon-photograph:before {
content: '';
width: 152rpx;
height: 108rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/icon-back.png');
background-size: 100% 100%;
}
.upload .van-uploader__upload-text {
font-size: 22rpx !important;
color: #9B9B9E !important;
}
.upload .driveFront .van-uploader .van-uploader__wrapper .van-uploader__upload,
.upload .driveBack .van-uploader .van-uploader__wrapper .van-uploader__upload {
width: 256rpx !important;
}
.upload .driveFront .van-uploader .van-uploader__wrapper .van-uploader__preview image,
.upload .driveBack .van-uploader .van-uploader__wrapper .van-uploader__preview image {
width: 256rpx !important;
}
.upload .van-uploader .van-uploader__wrapper .van-uploader__upload {
order: 0 !important;
} }
\ No newline at end of file \ No newline at end of file
...@@ -67,9 +67,18 @@ const buyCarTypeList = [{ ...@@ -67,9 +67,18 @@ const buyCarTypeList = [{
optionLabel: '全款车' optionLabel: '全款车'
}] }]
const vehicleNatureList = [{
optionId: 0,
optionLabel: '营运'
}, {
optionId: 1,
optionLabel: '非营运'
}]
export default { export default {
seatesList, seatesList,
customerTypeList, customerTypeList,
cardTypeList, cardTypeList,
buyCarTypeList buyCarTypeList,
vehicleNatureList
} }
...@@ -54,6 +54,82 @@ const formRule = { ...@@ -54,6 +54,82 @@ const formRule = {
merchantAddress: [{ required: true, message: '联系地址不能为空' }] merchantAddress: [{ required: true, message: '联系地址不能为空' }]
} }
const energyFormRule = {
servicePeriod: [{ required: true, message: '服务年限不能为空' }],
vehicleRegistrationDate: [{ required: true, message: '车辆登记日期不能为空' }],
vehicleDisplacement: [
{ required: true, message: '车型排量不能为空' },
{
validator: (rule, value) => {
return /^\d+(\.\d{1,2})?$/.test(value) ? null : { message: '车型排量请输入仅有两位小数的数字' }
}
}
],
warrantyPeriod: [
{ required: true, message: '原厂质保年限不能为空' },
{
validator: (rule, value) => {
return /^\d+$/.test(value) ? null : { message: '原厂质保年限请输入整数' }
}
}
],
warrantyKm: [
{ required: true, message: '原厂质保里程数不能为空' },
{
validator: (rule, value) => {
return /^\d+(\.\d{1,2})?$/.test(value) ? null : { message: '原厂质保里程数请输入仅有两位小数的数字' }
}
}
],
mileage: [
{ required: true, message: '合同购买时里程数不能为空' },
{
validator: (rule, value) => {
return /^\d+(\.\d{1,2})?$/.test(value) ? null : { message: '合同购买时里程数请输入仅有两位小数的数字' }
}
}
]
}
const oilFormRule = {
servicePeriod: [{ required: true, message: '服务年限不能为空' }],
vehicleRegistrationDate: [{ required: true, message: '车辆登记日期不能为空' }],
vehicleNatureName: [{ required: true, message: '车辆使用性质不能为空' }],
gearbox: [{ required: true, message: '变速箱类型不能为空' }],
vehicleDisplacement: [
{ required: true, message: '车型排量不能为空' },
{
validator: (rule, value) => {
return /^\d+(\.\d{1,2})?$/.test(value) ? null : { message: '车型排量请输入仅有两位小数的数字' }
}
}
],
warrantyPeriod: [
{ required: true, message: '原厂质保年限不能为空' },
{
validator: (rule, value) => {
return /^\d+$/.test(value) ? null : { message: '原厂质保年限请输入整数' }
}
}
],
warrantyKm: [
{ required: true, message: '原厂质保里程数不能为空' },
{
validator: (rule, value) => {
return /^\d+(\.\d{1,2})?$/.test(value) ? null : { message: '原厂质保里程数请输入仅有两位小数的数字' }
}
}
],
mileage: [
{ required: true, message: '合同购买时里程数不能为空' },
{
validator: (rule, value) => {
return /^\d+(\.\d{1,2})?$/.test(value) ? null : { message: '合同购买时里程数请输入仅有两位小数的数字' }
}
}
]
}
const secondObj = { const secondObj = {
carFormList: [ carFormList: [
{ {
...@@ -93,7 +169,8 @@ const secondObj = { ...@@ -93,7 +169,8 @@ const secondObj = {
label: '购车日期', label: '购车日期',
name: 'billingDate', name: 'billingDate',
type: 'pickerTime', type: 'pickerTime',
end: new Date() end: Util.tsFormatTime(new Date(), 'Y-M-D'),
haveArrow: true
}, },
{ {
label: '品牌车系', label: '品牌车系',
...@@ -149,7 +226,6 @@ const secondObj = { ...@@ -149,7 +226,6 @@ const secondObj = {
name: 'customerAddress', name: 'customerAddress',
type: 'input', type: 'input',
maxlength: '100', maxlength: '100',
noCellHeight: true,
fieldType: 'input' fieldType: 'input'
} }
], ],
...@@ -160,7 +236,8 @@ const secondObj = { ...@@ -160,7 +236,8 @@ const secondObj = {
type: 'slot', type: 'slot',
labelWidth: '0rpx', labelWidth: '0rpx',
noCellHeight: true, noCellHeight: true,
proFormList: [{ // 权益表单
equityProFormList: [{
label: '服务年限', label: '服务年限',
name: 'servicePeriod', name: 'servicePeriod',
type: 'input', type: 'input',
...@@ -193,7 +270,125 @@ const secondObj = { ...@@ -193,7 +270,125 @@ const secondObj = {
attr: 'entityCardFlag', attr: 'entityCardFlag',
list: ['Y'] list: ['Y']
} }
}] }],
// 新能源3电和6大件表单
energyProFormList: [{
label: '服务年限',
name: 'servicePeriod',
type: 'input',
disabled: true,
suffix: '年',
noCellHeight: true,
cellStyle: "height: 90rpx;"
}, {
label: '车辆登记日期',
name: 'vehicleRegistrationDate',
type: 'pickerTime',
end: Util.tsFormatTime(new Date(), 'Y-M-D'),
labelWidth: '220rpx',
noCellHeight: true,
cellStyle: "height: 90rpx;",
haveArrow: true
}, {
label: '车型排量',
name: 'vehicleDisplacement',
type: 'input',
suffix: 'L',
fieldType: 'digit',
inputLimit: {
type: 'digit',
minVal: 0,
maxVal: 100
},
noCellHeight: true,
cellStyle: "height: 90rpx;"
}, {
label: '原厂质保',
name: 'warranty',
type: 'slot',
noCellHeight: true,
cellBoxStyle: "width: 100%;"
}, {
label: '合同购买时里程数',
name: 'mileage',
type: 'input',
suffix: 'KM',
noCellHeight: true,
fieldType: 'digit',
inputLimit: {
type: 'digit',
minVal: 0
},
labelWidth: '240rpx',
noCellHeight: true,
cellStyle: "height: 90rpx; border-bottom: 0;"
}],
// 燃油车4大件
oilProFormList: [{
label: '服务年限',
name: 'servicePeriod',
type: 'input',
disabled: true,
suffix: '年',
noCellHeight: true,
cellStyle: "height: 90rpx;"
}, {
label: '车辆登记日期',
name: 'vehicleRegistrationDate',
type: 'pickerTime',
end: Util.tsFormatTime(new Date(), 'Y-M-D'),
labelWidth: '220rpx',
noCellHeight: true,
cellStyle: "height: 90rpx;",
haveArrow: true
}, {
label: '车辆使用性质',
name: 'vehicleNature',
labelName: 'vehicleNatureName',
type: 'select',
optionList: constantList.vehicleNatureList,
optionId: 'optionId',
optionLabel: 'optionLabel',
labelWidth: '180rpx',
noCellHeight: true,
cellStyle: "height: 90rpx;"
}, {
label: '变速箱类型',
name: 'gearbox',
type: 'slot',
noCellHeight: true,
cellStyle: "height: 90rpx;"
}, {
label: '车型排量',
name: 'vehicleDisplacement',
type: 'input',
suffix: 'L',
inputLimit: {
type: 'digit',
minVal: 0,
maxVal: 100
},
noCellHeight: true,
cellStyle: "height: 90rpx;"
}, {
label: '原厂质保',
name: 'warranty',
type: 'slot',
noCellHeight: true,
cellBoxStyle: "width: 100%;"
}, {
label: '合同购买时里程数',
name: 'mileage',
type: 'input',
suffix: 'KM',
labelWidth: '240rpx',
inputLimit: {
type: 'digit',
minVal: 0
},
noCellHeight: true,
cellStyle: "height: 90rpx; border-bottom: 0;"
}],
}, },
// { // {
// label: '服务年限', // label: '服务年限',
...@@ -206,7 +401,8 @@ const secondObj = { ...@@ -206,7 +401,8 @@ const secondObj = {
label: '生效日期', label: '生效日期',
name: 'effectiveDate', name: 'effectiveDate',
type: 'pickerTime', type: 'pickerTime',
start: Util.tsFormatTime(new Date(new Date().setDate(new Date(new Date()).getDate() + 1)), 'Y-M-D') start: Util.tsFormatTime(new Date(new Date().setDate(new Date(new Date()).getDate() + 1)), 'Y-M-D'),
haveArrow: true
// .toLocaleDateString().replace('/','-') // .toLocaleDateString().replace('/','-')
}, },
// { // {
...@@ -260,6 +456,13 @@ const secondObj = { ...@@ -260,6 +456,13 @@ const secondObj = {
type: 'input' type: 'input'
} }
], ],
infoFormList: [{
label: ' ',
name: 'upload',
type: 'slot',
labelWidth: '0rpx',
noCellHeight: true,
}],
storeFormList: [ storeFormList: [
{ {
label: '店面名称', label: '店面名称',
...@@ -288,5 +491,7 @@ const secondObj = { ...@@ -288,5 +491,7 @@ const secondObj = {
export default { export default {
constantList, constantList,
formRule, formRule,
energyFormRule,
oilFormRule,
secondObj secondObj
} }
// packageEquity/pages/carEquity/serviceInfo/serviceInfo.js // packageEquity/pages/carEquity/serviceInfo/serviceInfo.js
import carLifeApi from '../../../carEquityApi' import carLifeApi from '../../../carEquityApi'
import secondStepData from '../components/constant/secondStepData' import secondStepData from '../components/constant/secondStepData'
import constantData from '../components/constant/constantList'
const sussObj = { const sussObj = {
type: 'success', type: 'success',
title: '提单成功', title: '提单成功',
...@@ -43,7 +44,8 @@ Page({ ...@@ -43,7 +44,8 @@ Page({
isDialogShow: false, isDialogShow: false,
dialogObj: {}, dialogObj: {},
scrollTop: 0, scrollTop: 0,
cardSetting: true cardSetting: true,
isAsk: false
}, },
getPickerObj(obj) { getPickerObj(obj) {
...@@ -85,9 +87,21 @@ Page({ ...@@ -85,9 +87,21 @@ Page({
} }
}) })
// 商品服务费,分-元 // 商品服务费,分-元
let priceList = ['actualSalesPrice']
obj.goodInfoList.forEach((item, idx) => { obj.goodInfoList.forEach((item, idx) => {
if (item.actualSalesPrice) { priceList.forEach(k => {
obj.goodInfoList[idx].actualSalesPrice = (item.actualSalesPrice / 100).toFixed(2) obj.goodInfoList[idx][k] = (item[k] / 100).toFixed(2)
})
if (item.vehicleRegistrationDate) {
item.vehicleRegistrationDate = new Date(item.vehicleRegistrationDate).format('yyyy-MM-dd')
}
if (item.itemsCode == 'YB0003') {
item.gearbox = item.gearbox || ''
item.vehicleNature = typeof item.vehicleNature == 'number' ? item.vehicleNature : 1
let val = constantData.vehicleNatureList.find(k => k.optionId == item.vehicleNature)
if (val) {
item.vehicleNatureName = val.optionLabel
}
} }
}) })
// picker-label处理 // picker-label处理
...@@ -152,30 +166,10 @@ Page({ ...@@ -152,30 +166,10 @@ Page({
// 权益卡 // 权益卡
this.getInterestCardSetting(data.goodId) this.getInterestCardSetting(data.goodId)
} }
// goodInfoList,数据结构 - 删 // data.attachmentList = data.attachmentList
// data.goodInfoList = [{
// items: ['xx服务', '哈哈服务', '嘻嘻服务'],
// goodName: '商品名称',
// actualSalesPrice: 3 || data.actualSalesPrice,
// card: data.card,
// contractNo: data.contractNo,
// packageCode: data.packageCode,
// servicePeriod: data.servicePeriod,
// goodId: data.goodId,
// entityCardFlag: 'Y'
// }, {
// items: ['xx服务', '哈哈服务', '嘻嘻服务'],
// goodName: '商品名称22',
// actualSalesPrice: data.actualSalesPrice,
// card: data.card,
// contractNo: data.contractNo,
// packageCode: data.packageCode,
// servicePeriod: data.servicePeriod,
// goodId: data.goodId,
// entityCardFlag: 'N'
// }]
this.setData({ this.setData({
serviceInfo: data, serviceInfo: data,
['serviceInfo.attachmentList']:data?.attachmentList||[],
step: data.mode ? 'second' : 'first' step: data.mode ? 'second' : 'first'
// 先调试 // 先调试
}) })
...@@ -258,10 +252,11 @@ Page({ ...@@ -258,10 +252,11 @@ Page({
} }
}) })
// 商品服务费,分-元 // 商品服务费,分-元
let priceList = ['actualSalesPrice']
obj.goodInfoList.forEach((item, idx) => { obj.goodInfoList.forEach((item, idx) => {
if (item.actualSalesPrice) { priceList.forEach(k => {
obj.goodInfoList[idx].actualSalesPrice = (item.actualSalesPrice * 100).toFixed(0) obj.goodInfoList[idx][k] = (item[k] * 100).toFixed(0)
} })
}) })
return obj return obj
}, },
...@@ -271,12 +266,19 @@ Page({ ...@@ -271,12 +266,19 @@ Page({
draft: 0, draft: 0,
confirm: 1 confirm: 1
} }
let { serviceInfo } = this.data let _this = this
let { serviceInfo, isAsk } = this.data
if (isAsk) {
return true
}
let type = e.detail?.type || 'draft' let type = e.detail?.type || 'draft'
let params = this.dealComfirmData(JSON.parse(JSON.stringify(serviceInfo))) let params = this.dealComfirmData(JSON.parse(JSON.stringify(serviceInfo)))
// 0草稿,1提单 // 0草稿,1提单
params.operationType = typeObj[type] params.operationType = typeObj[type]
console.log(params, '调接口---') console.log(params, '调接口---')
this.setData({
isAsk: true
})
// return // return
carLifeApi.updateEquity(params).then(res => { carLifeApi.updateEquity(params).then(res => {
if (res.code == '0') { if (res.code == '0') {
...@@ -289,11 +291,15 @@ Page({ ...@@ -289,11 +291,15 @@ Page({
}) })
} else { } else {
// wx.$router.reLaunch('packageEquity.equityPage') // wx.$router.reLaunch('packageEquity.equityPage')
wx.$router.reLaunch('packageEquity.equityPage',{tabIndex:1}) wx.$router.reLaunch('packageEquity.equityPage', { tabIndex: 1 })
} }
} else { } else {
wx.$util.showToast(res.message || '接口异常') wx.$util.showToast(res.message || '接口异常')
} }
}).finally(() => {
_this.setData({
isAsk: false
})
}) })
}, },
...@@ -305,13 +311,22 @@ Page({ ...@@ -305,13 +311,22 @@ Page({
}) })
}, },
handleSecondConfirm(e) { handleSecondConfirm(e) {
let { serviceInfo, conSecondObj } = this.data let { serviceInfo, conSecondObj, isAsk } = this.data
if (isAsk) {
return true
}
if (e.detail?.type == 'confirm') { if (e.detail?.type == 'confirm') {
this.setData({
isAsk: true
})
carLifeApi carLifeApi
.checkVin({ .checkVin({
vin: serviceInfo.vin vin: serviceInfo.vin
}) })
.then(res => { .then(res => {
this.setData({
isAsk: false
})
if (res.code == '0') { if (res.code == '0') {
this.confirm(e) this.confirm(e)
} else if (res.code == '-2') { } else if (res.code == '-2') {
...@@ -367,7 +382,7 @@ Page({ ...@@ -367,7 +382,7 @@ Page({
this.setData({ this.setData({
isDialogShow: false isDialogShow: false
}) })
wx.$router.reLaunch('packageEquity.equityPage',{tabIndex:1}) wx.$router.reLaunch('packageEquity.equityPage', { tabIndex: 1 })
}, },
// 合同地址 // 合同地址
...@@ -458,7 +473,7 @@ Page({ ...@@ -458,7 +473,7 @@ Page({
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() {}, onReady() { },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
...@@ -466,32 +481,32 @@ Page({ ...@@ -466,32 +481,32 @@ Page({
onShow() { onShow() {
let { isBack } = this.data let { isBack } = this.data
if (isBack) { if (isBack) {
wx.$router.reLaunch('packageEquity.equityPage',{tabIndex:1}) wx.$router.reLaunch('packageEquity.equityPage', { tabIndex: 1 })
} }
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() {}, onHide() { },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() {}, onUnload() { },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() {}, onPullDownRefresh() { },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() {}, onReachBottom() { },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {} onShareAppMessage() { }
}) })
/* packageEquity/pages/carEquity/serviceInfo/serviceInfo.wxss */ /* packageEquity/pages/carEquity/serviceInfo/serviceInfo.wxss */
.layout { .layout {
height: 100vh; min-height: 100vh;
background: #F4F5F7; background: #F4F5F7;
padding: 20rpx 0 60rpx; padding: 20rpx 0 60rpx;
}
\ No newline at end of file \ No newline at end of file
}
// packageEquity/pages/carQuotation/CarQuotationDetail/CarQuotationDetail.js // packageEquity/pages/carQuotation/CarQuotationDetail/CarQuotationDetail.js
import { getOrderDetail } from '../../../api' import { getOrderDetail,getQuotationInfoById } from '../../../api'
let timer = null let timer = null
Page({ Page({
/** /**
...@@ -57,8 +57,48 @@ Page({ ...@@ -57,8 +57,48 @@ Page({
apiName: 'handler' apiName: 'handler'
}) })
}, },
getQuotationInfoById() {
let { id } = this.data
getQuotationInfoById({ id }).then(res => {
let { code, data } = res
console.log(res)
let { orderId, payId, merchantAddress, merchantName4s, quotationGoodsInfoList } = data
quotationGoodsInfoList
if (quotationGoodsInfoList&&quotationGoodsInfoList.length) {
quotationGoodsInfoList.forEach(item=>{
if (item.position) {
const fieldMap = {
"4大件": "燃油车4大件服务",
"3电": "新能源3电服务",
"6大件": "新能源6大件服务",
// 在这里可以添加更多的替换规则
};
// 如果输入字段在字段映射中有匹配项,则进行替换,否则保持不变
fieldMap[item.position]&&( item.position = fieldMap[item.position])
}
if (item.quotationGoodsServiceItemsRelationDTOList&&item.quotationGoodsServiceItemsRelationDTOList.length) {
item.serviceItems = item.quotationGoodsServiceItemsRelationDTOList.reduce((prev,subItm,index)=>{
let unit = index == 0 ? '':'/'
prev += unit+subItm.serviceName
return prev
},'')
}
})
}
this.setData({
orderCode: payId,
merchantAddress,
merchantName4s,
orderId,
['orderDetail.quotationGoodsInfoList']:quotationGoodsInfoList
// quotationGoodsInfoList
// id
})
this.createWxQrcode()
})
},
getOrderDetail() { getOrderDetail() {
let { orderCode } = this.data let { orderCode, orderDetail } = this.data
getOrderDetail({ orderCode }).then(res => { getOrderDetail({ orderCode }).then(res => {
console.log(res) console.log(res)
let { code, data } = res let { code, data } = res
...@@ -69,6 +109,7 @@ Page({ ...@@ -69,6 +109,7 @@ Page({
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
orderDetail: { orderDetail: {
...orderDetail,
...data.customer, ...data.customer,
...data ...data
} }
...@@ -85,6 +126,7 @@ Page({ ...@@ -85,6 +126,7 @@ Page({
id id
}) })
this.getOrderDetail() this.getOrderDetail()
this.getQuotationInfoById()
// this.countDownTimer() // this.countDownTimer()
}, },
/** /**
......
...@@ -120,7 +120,7 @@ Page({ ...@@ -120,7 +120,7 @@ Page({
// _this.getDetail(orderCode) // _this.getDetail(orderCode)
// }, // },
getDetail() { getDetail() {
let { orderCode } = this.data let { orderCode,orderDetail } = this.data
// console.log(orderCode) // console.log(orderCode)
let _this = this let _this = this
getOrderDetail({ getOrderDetail({
...@@ -137,6 +137,7 @@ Page({ ...@@ -137,6 +137,7 @@ Page({
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
orderDetail: { orderDetail: {
...orderDetail,
...data.customer, ...data.customer,
...data ...data
// ...data.payOrder // ...data.payOrder
...@@ -191,7 +192,30 @@ Page({ ...@@ -191,7 +192,30 @@ Page({
getQuotationInfoById({ id }).then(res => { getQuotationInfoById({ id }).then(res => {
let { code, data } = res let { code, data } = res
console.log(res) console.log(res)
let { orderId, payId, merchantAddress, merchantName4s, goodsOrderDTO: orderInfo } = data let { orderId, payId, merchantAddress, merchantName4s, quotationGoodsInfoList } = data
// quotationGoodsInfoList
if (quotationGoodsInfoList&&quotationGoodsInfoList.length) {
quotationGoodsInfoList.forEach(item=>{
if (item.position) {
const fieldMap = {
"4大件": "燃油车4大件服务",
"3电": "新能源3电服务",
"6大件": "新能源6大件服务",
// 在这里可以添加更多的替换规则
};
// 如果输入字段在字段映射中有匹配项,则进行替换,否则保持不变
fieldMap[item.position]&&( item.position = fieldMap[item.position])
}
if (item.quotationGoodsServiceItemsRelationDTOList&&item.quotationGoodsServiceItemsRelationDTOList.length) {
item.serviceItems = item.quotationGoodsServiceItemsRelationDTOList.reduce((prev,subItm,index)=>{
let unit = index == 0 ? '':'/'
prev += unit+subItm.serviceName
return prev
},'')
}
})
}
console.log(quotationGoodsInfoList,'quotationGoodsInfoList');
this.setData({ this.setData({
// || '230311133649896' // || '230311133649896'
// orderCode: orderCode || '230310104652929', // orderCode: orderCode || '230310104652929',
...@@ -199,16 +223,19 @@ Page({ ...@@ -199,16 +223,19 @@ Page({
// orderCode: '230310104652929', // orderCode: '230310104652929',
merchantAddress, merchantAddress,
merchantName4s, merchantName4s,
orderId orderId,
['orderDetail.quotationGoodsInfoList']:quotationGoodsInfoList
// quotationGoodsInfoList
// id // id
}) })
this.createWxQrcode() this.createWxQrcode()
}) })
}, },
onRoute(options) { onRoute(options) {
// console.log(options,'options');
// console.log(options = 19) // console.log(options = 19)
let { data, id } = options let { data, id } = options
// id = 123 // id = 150
// orderCode: 230724111753590 // orderCode: 230724111753590
this.setData({ id }) this.setData({ id })
this.getQuotationInfoById() this.getQuotationInfoById()
......
...@@ -134,6 +134,32 @@ Component({ ...@@ -134,6 +134,32 @@ Component({
} }
] ]
}, },
gearboxtype: {
name: '变速箱类型',
height: '810rpx',
optionsList: [
{
value: 'MT变速箱'
},
{
value: 'AMT变速箱'
},
{
value: 'AT变速箱'
},
{
value: 'CVT变速箱'
},
{
value: 'DCT变速箱'
},
{
label: '自定义',
value: '',
type: 'input'
}
]
},
optionsList: [] optionsList: []
}, },
pageLifetimes: { pageLifetimes: {
...@@ -142,8 +168,8 @@ Component({ ...@@ -142,8 +168,8 @@ Component({
// console.log('attached', attached) // console.log('attached', attached)
this.initOptions() this.initOptions()
}, },
show: function () {}, show: function () { },
hide: function () {} hide: function () { }
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
...@@ -221,13 +247,15 @@ Component({ ...@@ -221,13 +247,15 @@ Component({
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
// let popValue = thisPage.data[attrname][attrtype] // let popValue = thisPage.data[attrname][attrtype]
console.log(flag.value, attrname, attrtype, 'flag.value') console.log(flag.value, attrname, attrtype, 'flag.value')
thisPage.setData({ if (attrtype || attrname) {
['orderInfo' + '.' + attrtype + '.' + attrname]: flag.value thisPage.setData({
}) ['orderInfo' + '.' + attrtype + '.' + attrname]: flag.value
})
}
this.setData({ this.setData({
show: false show: false
}) })
this.triggerEvent('confirm') this.triggerEvent('confirm', {value: flag.value})
} }
} }
}) })
...@@ -44,7 +44,7 @@ Page({ ...@@ -44,7 +44,7 @@ Page({
orderInfo: { orderInfo: {
mode: 1, mode: 1,
insurancePrice: '', insurancePrice: '',
vdQuotationGoodsList:[] vdQuotationGoodsList: []
// 0-商业,1-交强,2-车船,3-增值车损,4-other 对应下面字段名字 // 0-商业,1-交强,2-车船,3-增值车损,4-other 对应下面字段名字
// owner // owner
// business: { // business: {
...@@ -69,7 +69,7 @@ Page({ ...@@ -69,7 +69,7 @@ Page({
// 页面存放表单对象的对象名 // 页面存放表单对象的对象名
dataAttrName: 'owner', dataAttrName: 'owner',
// step: 'first', // step: 'first',
step: 'second',// 非融合不要第一步 step: 'second', // 非融合不要第一步
needChangeList: ['price', 'base', 'threePremium', 'carInsidePremium', 'passengerPremium', 'payPrice', , 'insurancePrice', 'quotedPriceUpdate', 'minEquityPrice'] needChangeList: ['price', 'base', 'threePremium', 'carInsidePremium', 'passengerPremium', 'payPrice', , 'insurancePrice', 'quotedPriceUpdate', 'minEquityPrice']
}, },
closeTips() { closeTips() {
...@@ -195,6 +195,9 @@ Page({ ...@@ -195,6 +195,9 @@ Page({
data data
} = result } = result
if (code == 0 && data) { if (code == 0 && data) {
this.setData({
confirmStatus: false
})
wx.showToast({ wx.showToast({
title: '补录订单成功', title: '补录订单成功',
icon: 'success' icon: 'success'
...@@ -221,13 +224,13 @@ Page({ ...@@ -221,13 +224,13 @@ Page({
// 修改权益报价逻辑 // 修改权益报价逻辑
// let { modifyEquityQuotation, confirmStatus,outTradeNo } = this.data // let { modifyEquityQuotation, confirmStatus,outTradeNo } = this.data
// 是订单补录直接走另外的补录逻辑 // 是订单补录直接走另外的补录逻辑
if (outTradeNo) return this.setQuotationRecording()
if (confirmStatus) return false if (confirmStatus) return false
wx.showLoading('报价中...')
this.setData({ this.setData({
confirmStatus: true confirmStatus: true
}) })
if (outTradeNo) return this.setQuotationRecording()
wx.showLoading('报价中...')
let result = await this.handleSecondConfirmCheck(true) let result = await this.handleSecondConfirmCheck(true)
let { let {
code, code,
...@@ -240,8 +243,11 @@ Page({ ...@@ -240,8 +243,11 @@ Page({
// 校验生成告知书是否成功 // 校验生成告知书是否成功
let status = await this.createWithPay(id) let status = await this.createWithPay(id)
wx.hideLoading() wx.hideLoading()
this.setData({ let that = this
confirmStatus: false setTimeout(() => {
that.setData({
confirmStatus: false
})
}) })
console.log('id', id) console.log('id', id)
// { orderId:data.orderId, id } // { orderId:data.orderId, id }
...@@ -518,21 +524,25 @@ Page({ ...@@ -518,21 +524,25 @@ Page({
data = data.map(item => { data = data.map(item => {
// console.log(item.upgradeGoodsServiceItemsList,'item.upgradeGoodsServiceItemsList'); // console.log(item.upgradeGoodsServiceItemsList,'item.upgradeGoodsServiceItemsList');
let serveName let serveName
if (item.upgradeGoodsServiceItemsList) { if (item.upgradeGoodsServiceItemsList && item.upgradeGoodsServiceItemsList.length) {
serveName = item.upgradeGoodsServiceItemsList.reduce((label, ele, index) => { serveName = item.upgradeGoodsServiceItemsList.reduce((label, ele, index) => {
let unit = index == item.upgradeGoodsServiceItemsList.length ? '' : '/' let unit = index == 0 ? '' : '/'
// debugger // debugger
label = label + ele?.serviceName + unit label = label + unit + ele?.serviceName
return label return label
}, '') }, '')
} }
// let serveName = item.upgradeGoodsServiceItemsList.reduce((label, ele, index) => { if (item.position) {
// let unit = index == item.upgradeGoodsServiceItemsList.length ? '' : '/' const fieldMap = {
// // debugger "4大件": "燃油车4大件服务",
// label = label + ele?.serviceName + unit "3电": "新能源3电服务",
// return label "6大件": "新能源6大件服务",
// }, '') // 在这里可以添加更多的替换规则
// console.log(serveName,'serveName'); };
// 如果输入字段在字段映射中有匹配项,则进行替换,否则保持不变
fieldMap[item.position] && (serveName = fieldMap[item.position])
}
console.log(serveName, 'serveName');
return { return {
...item, ...item,
serveName, serveName,
......
...@@ -38,7 +38,7 @@ Page({ ...@@ -38,7 +38,7 @@ Page({
let query = wx.createSelectorQuery().in(this) //获取自定义组件的SelectQuery对象 let query = wx.createSelectorQuery().in(this) //获取自定义组件的SelectQuery对象
this.canvasCtx = wx.createCanvasContext('signature', that) this.canvasCtx = wx.createCanvasContext('signature', that)
// 设置线的样式 // 设置线的样式
this.canvasCtx.setFillStyle('white') this.canvasCtx.setFillStyle('rgba(0, 0, 0, 0)')
this.canvasCtx.fillRect(0, 0, windowWidth, windowHeight) this.canvasCtx.fillRect(0, 0, windowWidth, windowHeight)
this.canvasCtx.setLineCap('round') this.canvasCtx.setLineCap('round')
this.canvasCtx.setLineJoin('round') this.canvasCtx.setLineJoin('round')
...@@ -115,7 +115,7 @@ Page({ ...@@ -115,7 +115,7 @@ Page({
//清空画布 //清空画布
let ctx = this.canvasCtx let ctx = this.canvasCtx
ctx.clearRect(0, 0, this.data.canvasWidth, this.data.canvasHeight) ctx.clearRect(0, 0, this.data.canvasWidth, this.data.canvasHeight)
ctx.fillStyle = 'rgba(0, 0, 0, .1)' ctx.fillStyle = 'rgba(0, 0, 0, 0)'
ctx.draw() ctx.draw()
this.setData({ this.setData({
hasDraw: false, //未签字 hasDraw: false, //未签字
......
...@@ -41,7 +41,7 @@ Page({ ...@@ -41,7 +41,7 @@ Page({
let query = wx.createSelectorQuery().in(this) //获取自定义组件的SelectQuery对象 let query = wx.createSelectorQuery().in(this) //获取自定义组件的SelectQuery对象
this.canvasCtx = wx.createCanvasContext('signature', that) this.canvasCtx = wx.createCanvasContext('signature', that)
// 设置线的样式 // 设置线的样式
this.canvasCtx.setFillStyle('white') this.canvasCtx.setFillStyle('rgba(0, 0, 0, 0)')
this.canvasCtx.fillRect(0, 0, 600, 600) this.canvasCtx.fillRect(0, 0, 600, 600)
this.canvasCtx.setLineCap('round') this.canvasCtx.setLineCap('round')
this.canvasCtx.setLineJoin('round') this.canvasCtx.setLineJoin('round')
...@@ -129,7 +129,7 @@ Page({ ...@@ -129,7 +129,7 @@ Page({
//清空画布 //清空画布
let ctx = this.canvasCtx let ctx = this.canvasCtx
ctx.clearRect(0, 0, this.data.canvasWidth, this.data.canvasHeight) ctx.clearRect(0, 0, this.data.canvasWidth, this.data.canvasHeight)
ctx.fillStyle = 'rgba(0, 0, 0, .1)' ctx.fillStyle = 'rgba(0, 0, 0, 0)'
ctx.draw() ctx.draw()
this.setData({ this.setData({
hasDraw: false, //未签字 hasDraw: false, //未签字
......
...@@ -227,38 +227,38 @@ Page({ ...@@ -227,38 +227,38 @@ Page({
}) })
let { goodsList } = this.data let { goodsList } = this.data
// this.setGoodsTotal(goodsList) this.setGoodsTotal(goodsList)
}, },
// 屏蔽不用 // 屏蔽不用
// setGoodsTotal(goodsList) { setGoodsTotal(goodsList) {
// let { totalFee } = this.data let { totalFee } = this.data
// let total = 0 let total = 0
// // goodsList.map(i => (total += i.count * i.price)) // goodsList.map(i => (total += i.count * i.price))
// goodsList.map(i => { goodsList.map(i => {
// const totalPrice = NP.times(i.count, i.price) const totalPrice = NP.times(i.count, i.price)
// total = NP.plus(total, totalPrice) total = NP.plus(total, totalPrice)
// }) })
// // 用来解决小数相减导致精度问题 // 用来解决小数相减导致精度问题
// // total = this.accMul(total, 100) // total = this.accMul(total, 100)
// total = NP.times(total, 100) total = NP.times(total, 100)
// // total = parseFloat(total.toFixed(2)) // total = parseFloat(total.toFixed(2))
// // console.log(total * 100) // console.log(total * 100)
// // console.log(totalFee) // console.log(totalFee)
// // console.log(totalFee * 100) // console.log(totalFee * 100)
// // 计算差价格 没有就归0 100是用来解决小数相减导致精度问题 // 计算差价格 没有就归0 100是用来解决小数相减导致精度问题
// // console.log(this.accMul(total, 100)) // console.log(this.accMul(total, 100))
// // 解决数据精度丢失问题 // 解决数据精度丢失问题
// // let priceSpread = goodsList.length ? parseFloat((total - totalFee).toFixed(2)) : 0 // let priceSpread = goodsList.length ? parseFloat((total - totalFee).toFixed(2)) : 0
// let priceSpread = goodsList.length ? NP.minus(total, totalFee) : 0 let priceSpread = goodsList.length ? NP.minus(total, totalFee) : 0
// // console.log(priceSpread) // console.log(priceSpread)
// this.setData({ this.setData({
// priceSpread: priceSpread, priceSpread: priceSpread,
// // total: wx.$util.decimal(total, 2) // total: wx.$util.decimal(total, 2)
// total // total
// }) })
// }, },
// accSub(arg1, arg2) { // accSub(arg1, arg2) {
// let r1, r2, m, n // let r1, r2, m, n
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!