Commit 5d2ea8fd by 张立顺

功能开发完成

1 parent c5afbf83
......@@ -43,6 +43,10 @@ Component({
})
}
}
},
quotationGoodsList: {
type: Array,
value: () => {}
}
},
......@@ -97,6 +101,7 @@ Component({
onChangeInsurance(e) {
console.log(e)
let { detail } = e
let { id } = e.currentTarget.dataset
console.log(detail, 'detail')
if (!detail) {
return this.setData({
......@@ -104,10 +109,28 @@ Component({
})
}
let thisPage = wx.$router.getPageInstance()
let { quotationGoodsList } = this.data
let goodsItem = quotationGoodsList.find(item => item.id == id)
let { id: appreciation, goodsInfo, upgradeGoodsName: goodsName, upgradeGoodsServiceItemsList } = goodsItem
thisPage.setData({})
let params = thisPage.getInsurance()
let owner = thisPage.getOwnerInfo()
// const owner = wx.$util.deepClone(thisPage.data.owner)
params.owner = owner
params.goodsId = goodsItem.id
params.goodsName = goodsItem.goodsName
params.insureList = params.insureList.map(item => {
if (item.type == 3) {
item = {
appreciation,
goodsName,
type: 3
}
}
return item
})
// params.owner = owner
// params.owner.price = this.multipliedByHundred(orderInfo.owner?.price) || ''
// console.log(thisPage)
......@@ -127,8 +150,21 @@ Component({
if (code) {
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
['orderInfo.quotedPriceUpdate']: data.quotedPriceUpdate
['orderInfo.quotedPriceUpdate']: data.quotedPriceUpdate,
['orderInfo.goodsId']: goodsItem.id,
['orderInfo.goodsName']: goodsItem.goodsName,
['orderInfo.valueAddedVehicleLoss']: {
appreciation,
goodsName,
type: 3
},
['orderInfo.quotationGoodsInfo']: {
titlePictureUrl: goodsInfo.thumbUrl,
goodsName,
quotationGoodsServiceItemsRelationDTOList: upgradeGoodsServiceItemsList
}
})
this.setData({
insuranceCheck: true,
......
......@@ -216,7 +216,20 @@
}
}
}
.goodsCheckItem {
display: flex;
.check {
display: flex;
align-items: center;
text-align: center;
}
.goodsInfo {
// flex: 1;
width: 80%;
}
}
.errorMessage {
// text-align: right;
padding-left: 20rpx;
......
......@@ -101,17 +101,20 @@ Component({
onChangeInsurance(e) {
console.log(e)
let { detail } = e
console.log(detail, 'detail')
if (!detail) {
return this.setData({
insuranceCheck: false
})
}
let { id } = e.currentTarget.dataset
if (!detail) return false
let thisPage = wx.$router.getPageInstance()
// console.log(detail, 'detail')
let { quotationGoodsList } = this.data
let goodsItem = quotationGoodsList.find(item => item.id == id)
let params = thisPage.getInsurance()
let owner = thisPage.getOwnerInfo()
// const owner = wx.$util.deepClone(thisPage.data.owner)
params.owner = owner
params.goodsId = goodsItem.id
params.goodsName = goodsItem.goodsName
// params.owner = owner
// params.owner.price = this.multipliedByHundred(orderInfo.owner?.price) || ''
// console.log(thisPage)
......@@ -131,11 +134,20 @@ Component({
if (code) {
let thisPage = wx.$router.getPageInstance()
// thisPage.setData({
// // ['orderInfo.quotedPriceUpdate']: data.quotedPriceUpdate
// })
thisPage.setData({
['orderInfo.quotedPriceUpdate']: data.quotedPriceUpdate
['orderInfo.quotedPriceUpdate']: data.quotedPriceUpdate,
['orderInfo.minEquityPrice']: data.minEquityPrice,
['orderInfo.goodsId']: goodsItem.id,
['orderInfo.goodsName']: goodsItem.goodsName
})
// return
this.setData({
insuranceCheck: true,
// insuranceCheck: true,
showError:false,
testQuotedPriceUpdate: data.quotedPriceUpdate / 100
})
} else {
......@@ -270,12 +282,13 @@ Component({
let thisPage = wx.$router.getPageInstance()
console.log(attrtype)
if (attrtype == 'modifyEquityQuotation') {
if (attrname == 'quotedPriceUpdate') {
let { orderInfo } = this.data
let showError = orderInfo.modifyEquityQuotation.minEquityPrice <= value ? false : true
let showError = orderInfo.minEquityPrice <= value ? false : true
this.setData({
showError
})
if (showError)return false
}
// ['orderInfo' + '.' + attrType]
// console.log(['orderInfo' + '.' + attrType], '2')
......@@ -285,6 +298,12 @@ Component({
this.cancelInsuranceCheck()
// console.log(thisPage.data)
}
// onChange (e){
// console.log(e);
// let value = e.detail
// }
// numberFixedDigit (e) { // 固定两位小数
// e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || ''
// this.$nextTick(() => {
......
......@@ -7,6 +7,8 @@
"van-collapse-item": "@vant/weapp/collapse-item/index",
"van-checkbox": "@vant/weapp/checkbox/index",
"popup-input": "../PopupInput/PopupInput",
"custom-content": "/components/ContentHiden/content"
"custom-content": "/components/ContentHiden/content",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index"
}
}
......@@ -11,7 +11,7 @@
</view>
<view class="box">
<view class="title">商业险总价</view>
<van-field class="inputBox" border="{{false}}" disabled="{{disable}}" data-hold-keyboard value="{{orderInfo.business.base}}" data-attrName="base" data-type='number' type="digit" placeholder="请输入商业险总价" data-attrType="business" bindinput="handleInput">
<van-field class="inputBox" border="{{false}}" disabled="{{disable}}" data-hold-keyboard value="{{orderInfo.insurancePrice}}" data-attrName="insurancePrice" data-type='number' type="digit" placeholder="请输入商业险总价" data-attrType="" bindinput="handleInput">
<view slot="left-icon">
<view>¥</view>
</view>
......@@ -37,33 +37,34 @@
请勾选增值车损险服务
</van-checkbox> -->
<!-- <block wx:if="{{insuranceCheck}}"> -->
<view class="goodsCheckItem" wx:for="{{quotationGoodsList}}" wx:key="index">
<view class="check">
<van-checkbox value="{{ insuranceCheck }}" shape="square" bind:change="onChangeInsurance"></van-checkbox>
</view>
<view class="goodsInfo">
<view class="incrementInfo">
<image class="img" src="{{item.quotationGoodsInfo.titlePictureUrl}}" />
<view class="info">
<view class="infoTitle">{{item.quotationGoodsInfo.goodsName}}</view>
<view>
<text>包含</text>
<block wx:for-index="itemIndex" wx:for-item="i" wx:key="itemIndex" wx:for="{{item.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList}}">
<text>
{{i.serviceName}}{{i.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList.length==index?'':'、'}}
</text>
</block>
<!-- <van-radio-group value="{{orderInfo.goodsId}}" bind:change="onChangeInsurance"> -->
<block wx:for="{{quotationGoodsList}}" wx:key="index" name="{{item.id}}" wx:for-item="item">
<view class="goodsCheckItem">
<view class="check">
<van-checkbox value="{{orderInfo.goodsId ==item.id}}" data-id="{{item.id}}" shape="square" bind:change="onChangeInsurance"></van-checkbox>
</view>
<view class="goodsInfo">
<view class="incrementInfo">
<image class="img" src="{{item.titlePictureUrl}}" />
<view class="info">
<view class="infoTitle">{{item.goodsName}}</view>
<view><text>包含</text><block wx:for-index="itemIndex" wx:for-item="i" wx:key="itemIndex" wx:for="{{item.quotationGoodsServiceItemsRelationDTOList}}"><text>{{i.serviceName}}{{i.quotationGoodsServiceItemsRelationDTOList.length-1==itemIndex?'':'、'}}</text></block></view>
</view>
</view>
<block wx:if="{{orderInfo.goodsId == item.id}}">
<view class="title">增值权益价格</view>
<!-- disabled -->
<van-field class="inputBox customInput " border="{{false}}" value="{{orderInfo.quotedPriceUpdate}}" data-attrType="" data-attrName="quotedPriceUpdate" maxlength="10" bindinput="handleInput" data-type='number' type="digit">
<view slot="left-icon">
<view>¥</view>
</view>
</van-field>
<view class="errorMessage" wx:if="{{showError}}">金额小于最低限制</view>
</block>
</view>
<view class="title">增值权益价格</view>
<van-field class="inputBox customInput disabled" border="{{false}}" value="{{testQuotedPriceUpdate}}" data-attrType="modifyEquityQuotation" data-attrName="quotedPriceUpdate" maxlength="10" readonly disabled label-class="field_test" custom-style=" background-color: #F4F5F7; " data-type='number'>
<view slot="left-icon">
<view>¥</view>
</view>
</van-field>
</view>
</view>
</block>
<!-- </van-radio-group> -->
<!-- </block> -->
</van-collapse-item>
</view>
......
// packageEquity/pages/carEquity/serviceInfo/serviceInfo.js
import { getQuotationInfo, quotationAdd, updateQuotation, quotationGoods, getQuotationInfoById, quotationPicture } from '../../../api'
import { getQuotationInfo, quotationAdd, updateQuotation, listByMerchantIdAndIds, getQuotationInfoById, quotationPicture } from '../../../api'
import { quotedImgUrl } from '~/config'
// console.log(quotedImgUrl, 'quotedImgUrl')
Page({
......@@ -7,24 +7,27 @@ Page({
* 页面的初始数据
*/
data: {
// owner: {
// owner: '',
// phone: '',
// certificateNo: '',
// carVin: '',
// seat: '5',
// price: '',
// confirmStatus: false,
// saveStatus: false
// },
owner: {
owner: '',
phone: '',
certificateNo: '',
carVin: '',
seat: '5',
price: '',
owner: 'test2',
phone: 15816539334,
certificateNo: '230182198012251659',
carVin: '12345678912345678',
seat: 5,
price: 7,
confirmStatus: false,
saveStatus: false
saveStatus: false
},
// owner: {
// owner: 'test2',
// phone: 15816539334,
// certificateNo: '230182198012251659',
// carVin: '12345678912345678',
// seat: 5,
// price: 7
// },
quotationGoodsList: [], //权益商品列表
orderInfo: {
// 0-商业,1-交强,2-车船,3-增值车损,4-other 对应下面字段名字
// owner
......@@ -45,7 +48,8 @@ Page({
valueAddedVehicleLoss: {
type: 3
},
otherInsuranceList: []
otherInsuranceList: [],
mode:0
},
// 页面存放表单对象的对象名
dataAttrName: 'owner',
......@@ -316,23 +320,36 @@ Page({
getQuotationInfo() {
let { default4SStoreInfo } = wx.$util.getUserInfo()
console.log(default4SStoreInfo, 'default4SStoreInfo')
quotationGoods({ merchantId: default4SStoreInfo.merchantId })
listByMerchantIdAndIds({ merchantId: default4SStoreInfo.merchantId })
.then(result => {
console.log(result)
let { data } = result
let { id: appreciation, goodsInfo, upgradeGoodsName: goodsName, upgradeGoodsServiceItemsList } = data[0]
this.setData({
['orderInfo.valueAddedVehicleLoss']: {
appreciation,
goodsName,
type: 3
},
['orderInfo.quotationGoodsInfo']: {
titlePictureUrl: goodsInfo.thumbUrl,
goodsName,
quotationGoodsServiceItemsRelationDTOList: upgradeGoodsServiceItemsList
if (!data.length) return wx.$util.showToast('请先添加权益配置')
data = data.map(item => {
return {
...item,
appreciation: item.appreciation,
goodsName: item.upgradeGoodsName,
quotationGoodsServiceItemsRelationDTOList: item.upgradeGoodsServiceItemsList,
titlePictureUrl: item.titlePictureUrl
}
})
this.setData({
quotationGoodsList: data
})
// let { id: appreciation, goodsInfo, upgradeGoodsName: goodsName, upgradeGoodsServiceItemsList } = data[0]
// this.setData({
// ['orderInfo.valueAddedVehicleLoss']: {
// appreciation,
// goodsName,
// type: 3
// },
// ['orderInfo.quotationGoodsInfo']: {
// titlePictureUrl: goodsInfo.thumbUrl,
// goodsName,
// quotationGoodsServiceItemsRelationDTOList: upgradeGoodsServiceItemsList
// }
// })
})
.catch(err => {})
},
......
<!-- packageEquity/pages/carEquity/serviceInfo/serviceInfo.wxml -->
<navigation-bar
class="navigation-header"
bindnavbarReady="navbarReady"
showBack="{{true}}"
bindback="back">
<!-- showMenu="{{true}}" -->
<!-- bindtap="showStorePicker" -->
<view class="navigation-title">
<view class="navigation-title-text text-hide">
<!-- {{userInfo && userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName}} -->
{{step=='first'?'车辆和车主信息':'车险信息'}}
</view>
<!-- <view class="arrow">
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="{{true}}" bindback="back">
<!-- showMenu="{{true}}" -->
<!-- bindtap="showStorePicker" -->
<view class="navigation-title">
<view class="navigation-title-text text-hide">
<!-- {{userInfo && userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName}} -->
{{step=='first'?'车辆和车主信息':'车险信息'}}
</view>
<!-- <view class="arrow">
<image src="/images/back.png" />
</view> -->
</view>
</view>
</navigation-bar>
<!-- height: calc(100vh - {{navBarHeight}}px); -->
<view class="layout" style="padding-top:{{navBarHeight}}px; ">
<first-step
wx:if="{{step == 'first'}}"
id="FirstStep"
serviceInfo="{{owner}}"
dataAttrName="{{dataAttrName}}"
orderInfo="{{orderInfo}}"
bindconfirm="handleFirstConfirm"
bindeditSave="handleEditSave" />
<second-step
wx:if="{{step == 'second'}}"
id="SecondStep"
orderInfo="{{orderInfo}}"
bindconfirm="handleSecondConfirm"
bindeditSave="handleEditSave" />
</view>
<first-step wx:if="{{step == 'first'}}" id="FirstStep" serviceInfo="{{owner}}" dataAttrName="{{dataAttrName}}" orderInfo="{{orderInfo}}" bindconfirm="handleFirstConfirm" bindeditSave="handleEditSave" />
<second-step wx:if="{{step == 'second'}}" id="SecondStep" orderInfo="{{orderInfo}}" quotationGoodsList="{{quotationGoodsList}}" bindconfirm="handleSecondConfirm" bindeditSave="handleEditSave" />
</view>
\ No newline at end of file
// packageEquity/pages/carEquity/serviceInfo/serviceInfo.js
import { getQuotationInfo, quotationAdd, updateQuotation, quotationGoods, getQuotationInfoById, quotationPicture } from '../../../api'
// packageEquity/pages/carEquity/serviceInfo/serviceInfo.js quotationGoods
import { getQuotationInfo, quotationAdd, updateQuotation, quotationUpgrade, getQuotationInfoById, quotationPicture, listByMerchantIdAndIds } from '../../../api'
import { quotedImgUrl } from '~/config'
// console.log(quotedImgUrl, 'quotedImgUrl')
Page({
......@@ -7,46 +7,48 @@ Page({
* 页面的初始数据
*/
data: {
owner: {
owner: '',
phone: '',
certificateNo: '',
carVin: '',
seat: '5',
price: '',
confirmStatus: false,
saveStatus: false
},
quotationGoodsList: [], //权益商品列表
// owner: {
// owner: 'test2',
// phone: 15816539334,
// certificateNo: '230182198012251659',
// carVin: '12345678912345678',
// seat: 5,
// price: 7
// owner: '',
// phone: '',
// certificateNo: '',
// carVin: '',
// seat: '5',
// price: '',
// confirmStatus: false,
// saveStatus: false
// },
quotationGoodsList: [], //权益商品列表
owner: {
owner: 'test2',
phone: 15816539334,
certificateNo: '230182198012251659',
carVin: '12345678912345678',
seat: 5,
price: 230000
},
orderInfo: {
mode: 1,
insurancePrice: 333
// 0-商业,1-交强,2-车船,3-增值车损,4-other 对应下面字段名字
// owner
business: {
type: 0,
three: '100万',
driver: '1万',
passenger: '1万'
},
mutualStrength: {
type: 1,
compensation: '20万'
},
vehiclesAndVessels: {
type: 2,
compensation: new Date().getFullYear() + '年'
},
valueAddedVehicleLoss: {
type: 3
},
otherInsuranceList: []
// business: {
// type: 0,
// three: '100万',
// driver: '1万',
// passenger: '1万'
// },
// mutualStrength: {
// type: 1,
// compensation: '20万'
// },
// vehiclesAndVessels: {
// type: 2,
// compensation: new Date().getFullYear() + '年'
// },
// valueAddedVehicleLoss: {
// type: 3
// },
// otherInsuranceList: []
},
// 页面存放表单对象的对象名
dataAttrName: 'owner',
......@@ -79,22 +81,23 @@ Page({
step: 'second'
})
},
getQuotationGenerate(id) {
createWithPay(id) {
return new Promise((resolve, reject) => {
getQuotationInfoById({ id })
.then(res => {
resolve(res)
// let { code, data, message } = res
// if (code == 0) {
// resolve(true)
// } else {
// wx.$util.showToast(message)
// reject()
// }
})
.catch(err => {
reject()
})
let para = {
id,
customerNameUrl: '',
orderStatus: 2
}
quotationUpgrade(para).then(res => {
// wx.$util.hideLoading()
console.log(res, 'res')
resolve(res)
// let { code, data } = res
// if (code==0) {
// resolve({ data, id })
// }
})
})
},
updateEquityPrice(type) {
......@@ -133,15 +136,14 @@ Page({
// console.log(id)
if (id) {
// 校验生成告知书是否成功
let status = await this.getQuotationGenerate(id)
let status = await this.createWithPay(id)
wx.hideLoading()
this.setData({
confirmStatus: false
})
console.log('id', id)
status.code == 0 ? this.navigatorNext(id) : wx.$util.showToast(status.message || '报价失败')
// let
// status && this.navigatorNext(id)
// { orderId:data.orderId, id }
status.code == 0 ? this.navigatorNext({ id, orderId: status.data.orderId }) : wx.$util.showToast(status.message || '报价失败')
} else {
console.log(message)
wx.hideLoading()
......@@ -217,9 +219,10 @@ Page({
console.log(error)
}
},
navigatorNext(id) {
navigatorNext(obj) {
// packageEquity/pages/TabBar/equityPage
wx.$router.redirectTo('schemeConfirmation', { id })
wx.$router.redirectTo('CarQuotationPay', obj)
// wx.$router.redirectTo('schemeConfirmation', { id })
},
getOrderInfo() {
let { id, orderInfo } = this.data
......@@ -232,6 +235,7 @@ Page({
// tableInfo.quotedPrice = this.divideByHundred(tableInfo.quotedPrice)
tableInfo.quotedPriceUpdate = this.divideByHundred(tableInfo.quotedPriceUpdate)
if (code == 0) {
// debugger
const insurance = {
0: 'business',
1: 'mutualStrength',
......@@ -239,25 +243,27 @@ Page({
3: 'valueAddedVehicleLoss',
4: 'otherInsuranceList'
}
const insuranceTypeObj = tableInfo.insureList.reduce((obj, item) => {
item = this.divideByHundredObj(item)
console.log(item, 'item')
// 其他的保修是可能为多个
let name = insurance[item.type]
if (name == 'otherInsuranceList') {
if (obj[name]) {
obj[name].push(item)
} else {
obj[name] = [item]
}
} else {
obj[name] = item
}
return obj
}, {})
console.log('insuranceTypeObj', insuranceTypeObj)
// const insuranceTypeObj = tableInfo.insureList.reduce((obj, item) => {
// item = this.divideByHundredObj(item)
// console.log(item, 'item')
// // 其他的保修是可能为多个
// let name = insurance[item.type]
// if (name == 'otherInsuranceList') {
// if (obj[name]) {
// obj[name].push(item)
// } else {
// obj[name] = [item]
// }
// } else {
// obj[name] = item
// }
// return obj
// }, {})
// console.log('insuranceTypeObj', insuranceTypeObj)
// console.log(orderInfo, tableInfo, insuranceTypeObj);
// debugger
this.setData({
orderInfo: Object.assign(orderInfo, tableInfo, insuranceTypeObj),
orderInfo: Object.assign(orderInfo, tableInfo),
owner: tableInfo.owner
// ...insuranceTypeObj
})
......@@ -312,12 +318,12 @@ Page({
getQuotationInfo() {
let { default4SStoreInfo } = wx.$util.getUserInfo()
console.log(default4SStoreInfo, 'default4SStoreInfo')
quotationGoods({ merchantId: default4SStoreInfo.merchantId })
listByMerchantIdAndIds({ merchantId: default4SStoreInfo.merchantId })
.then(result => {
console.log(result)
let { data } = result
if (!data.length) return wx.$util.showToast('请先添加权益配置')
let { id: appreciation, goodsInfo, upgradeGoodsName: goodsName, upgradeGoodsServiceItemsList } = data[0]
// let { id: appreciation, goodsInfo, upgradeGoodsName: goodsName, upgradeGoodsServiceItemsList } = data[0]
data = data.map(item => {
return {
...item,
......@@ -406,6 +412,7 @@ Page({
// 判断是编辑还是新增
// options.id = 14
// options.modifyEquityQuotation = true
this.getQuotationInfo()
if (options.id) {
// 修改权益报价
let { modifyEquityQuotation } = options
......@@ -423,9 +430,10 @@ Page({
}
this.setData({ id: options.id })
this.getOrderInfo()
} else {
this.getQuotationInfo()
}
// else {
// this.getQuotationInfo()
// }
},
/**
* 生命周期函数--监听页面加载
......
......@@ -233,10 +233,11 @@ Component({
// id: target.id
// })
// 0待报价、1待确认、2待支付、3已支付、-1战败 5已完成(已签名)
// mode 0 融合 1 非融合
switch (target.orderStatus + '') {
// schemeConfirmation
case '0':
wx.$router.go('createOrderCarQuotation', {
wx.$router.go(target.mode != 0 ? 'createOrderCarQuotationSimple' : 'createOrderCarQuotation', {
id: target.id
})
break
......
......@@ -103,7 +103,8 @@
</view>
</block>
</view>
<view class="order-detail" wx:if="{{item.orderStatus == '1'|| item.orderStatus == '2' || item.orderStatus == '3' ||item.orderStatus =='4' ||item.orderStatus =='5'}}">
<!-- 非融合不显示 -->
<view class="order-detail" wx:if="{{(item.orderStatus != 0|| item.orderStatus != -1 )&&(item.mode!=1)}}">
<view class="detail-item">
<view class="detail-label">报价金额</view>
<view class="text-hide">{{item.quotedPrice || '--'}}</view>
......
......@@ -305,6 +305,13 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "融合报价",
"pathName": "packageEquity/pages/carQuotation/createOrderCarQuotation/createOrderCarQuotation",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!