Commit af78516c by 张立顺

功能开发

1 parent f01f640d
// components/OrderPopup/OrderPopup.js // components/OrderPopup/OrderPopup.js
// import qrcode from '../../utils/wxqrcode'
import qrcode from '~/utils/lib/wxqrcode' import qrcode from '~/utils/lib/wxqrcode'
import api from '../../api/api.js' import api from '../../api/api.js'
Component({ Component({
......
...@@ -61,9 +61,18 @@ module.exports = { ...@@ -61,9 +61,18 @@ module.exports = {
let params = data || {} let params = data || {}
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.generate', params) return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.generate', params)
}, },
/** 更新报价单状态 */ /** 更新报价单状态 */
updateOrderStatus(data) { updateOrderStatus(data) {
let params = data || {} let params = data || {}
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.status.update', params) return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.status.update', params)
},
/** 车损报价单权益价格计算 */
priceCounter(data) {
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.equity.price.counter', data)
},
/**改变支付订单状态 */
createPayOrder(data) {
return api.post('dj.api.smartcarlife.payOrder.create', data)
} }
} }
// packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.js // packageEquity/pages/carQuotation/CarQuotationPay/CarQuotationPay.js
import { getOrderDetail, updateOrderStatus, getQuotationInfoById } from '../../../api' import { getOrderDetail, updateOrderStatus, getQuotationInfoById } from '../../../api'
import { createQrcodeImage } from '~/api/api' import { createQrcodeImage } from '~/api/api'
import qrcode from '~/utils/lib/wxqrcode'
let time = null let time = null
Page({ Page({
/** /**
...@@ -9,7 +10,34 @@ Page({ ...@@ -9,7 +10,34 @@ Page({
data: { data: {
orderCode: '', orderCode: '',
wxqrcode: '', wxqrcode: '',
orderDetail: {} orderDetail: {},
popPayShow: true
},
changePayType() {
// pos支付
console.log('pos支付')
// createQRCode(text) {
// _this.data.orderCode
let { orderCode } = this.data
// let {}
console.log(text)
let size = 0
try {
const info = wx.getSystemInfoSync()
let scale = info.windowWidth / 750 //不同屏幕下QRcode的适配比例;设计稿是750宽
let width = 300 * scale
size = width
} catch (e) {
size = 150
}
let _img = qrcode.createQrCodeImg(text, {
size: parseInt(size)
})
this.setData({
qr: _img
})
// },
}, },
// 生成小程序码 // 生成小程序码
createWxQrcode() { createWxQrcode() {
......
{ {
"usingComponents": { "usingComponents": {
"order-detail": "../../../components/orderInfoCom/orderInfoCom" "order-detail": "../../../components/orderInfoCom/orderInfoCom",
"popup-select-pay": "../components/PopupSelectPay/PopupSelect"
}, },
"navigationBarTitleText": "订单支付" "navigationBarTitleText": "订单支付"
} }
...@@ -48,4 +48,5 @@ ...@@ -48,4 +48,5 @@
</view> </view>
</view> </view>
</view> </view>
<popup-select-pay show="{{popPayShow}}" bindconfirm="changePayType" />
// components/CarBrands/CarBrands.js
// import api from '../../api/api.js'
import { optionsSelect } from '../constant/stepData'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function (n) {
if (n) {
// console.log(n)
// n & this.initOptions()
}
}
}
},
/**
* 组件的初始数据
*/
data: {
// orderInfo: {},
optionsObj: {
name: '支付方式',
height: '450rpx'
// optionsList: [
// {
// value: '微信支付'
// },
// {
// value: 'pos支付'
// },
// ]
},
optionsList: [
{
value: 1,
label: '微信支付',
active: true
},
{
value: 3,
label: 'pos支付'
}
]
},
pageLifetimes: {
attached: function () {
// 在组件实例进入页面节点树时执行
// console.log('attached', attached)
// this.initOptions()
},
show: function () {},
hide: function () {}
},
/**
* 组件的方法列表
*/
methods: {
choose(e) {
let { item, index } = e.currentTarget.dataset
console.log(item, index)
let { optionsList } = this.data
optionsList = optionsList.map(item => {
item.active = false
return item
})
optionsList[index].active = true
this.setData({
optionsList
})
},
confirm() {
// let { attrname, attrtype } = this.data.popObj
let { optionsList } = this.data
let flag = optionsList.find(item => {
return item.active
})
if (!flag) {
return wx.$util.showToast('请选择')
}
if (flag.value == 3) {
this.triggerEvent('confirm', flag)
}
this.setData({
show: false
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<popup
title="{{optionsObj.name}}"
show="{{show}}"
bindconfirm="confirm"
height="{{optionsObj.height}}">
<view class="box">
<block
wx:for="{{optionsList}}"
wx:for-item="item"
wx:key="ind"
wx:for-index="ind">
<view
class="list y-center child {{item.active?'active':''}}"
data-item="{{item}}"
data-index="{{ind}}"
catchtap="choose">
<view wx:if="{{!item.type}}">{{item.label}}</view>
<view class="icon">
<image src="../../../../images/choose.png" />
</view>
</view>
</block>
</view>
</popup>
/* components/CarBrands/CarBrands.wxss */
.label {
padding-left: 32rpx;
line-height: 88rpx;
}
.labelName {
font-size: 16px;
color: #333333;
padding-right: 20rpx;
}
.y-center {
display: flex;
align-items: center;
}
.list {
box-sizing: border-box;
height: 88rpx;
/* padding-left: 32rpx; */
padding: 0 32rpx 0 92rpx;
font-weight: 700;
border-bottom: 2rpx solid #EBEDF0;
}
.list:last-child {
border: none;
}
.child {
font-weight: normal;
/* padding-left: 96rpx; */
font-size: 28rpx;
/* color: #888888; */
position: relative;
color: #333333;
}
.child.active {
color: #3582ee;
}
.child.title {
color: #282829;
padding-left: 64rpx;
/* color: #3582ee; */
}
.child .icon {
display: none;
width: 32rpx;
height: 32rpx;
position: absolute;
top: 50%;
left: 20rpx;
transform: translateY(-50%);
}
.customCom {
display: flex;
/* justify-content: center; */
align-items: center;
}
/* .custom-class */
.inputSty {
box-sizing: border-box;
width: 400rpx;
height: 72rpx;
margin-left: 32rpx;
padding: 16rpx 20rpx;
background: #F4F5F7;
border: 2rpx solid #EFF0F2;
border-radius: 8rpx;
}
.placeholderStyle {
font-size: 28rpx;
color: #CDCDD1;
}
.child.active .icon {
display: block;
}
\ No newline at end of file \ No newline at end of file
...@@ -80,7 +80,9 @@ Component({ ...@@ -80,7 +80,9 @@ Component({
popInputObj: { popInputObj: {
type: 'add' type: 'add'
}, },
showError: false showError: false,
insuranceCheck: false,
testQuotedPriceUpdate: 123
}, },
/** /**
...@@ -91,6 +93,12 @@ Component({ ...@@ -91,6 +93,12 @@ Component({
// let { activeNames } = this.data // let { activeNames } = this.data
// console.log('activeNames', activeNames) // console.log('activeNames', activeNames)
// }, // },
onChangeInsurance(e) {
console.log(e)
let thisPage = wx.$router.getPageInstance()
console.log(thisPage)
let params = thisPage.getInsurance()
},
//--------自定义方法---------- //--------自定义方法----------
// 选择年份的区域,弹出弹窗框 // 选择年份的区域,弹出弹窗框
chooseYear() { chooseYear() {
......
...@@ -183,6 +183,7 @@ ...@@ -183,6 +183,7 @@
border="{{false}}" border="{{false}}"
data-hold-keyboard data-hold-keyboard
readonly="{{true}}" readonly="{{true}}"
disabled="{{true}}"
value="{{item.payPrice}}" value="{{item.payPrice}}"
data-attrType="otherInsuranceList" data-attrType="otherInsuranceList"
data-attrName="payPrice" data-attrName="payPrice"
...@@ -267,7 +268,10 @@ ...@@ -267,7 +268,10 @@
</view> </view>
</view> </view>
<!-- bind:change="onChange" --> <!-- bind:change="onChange" -->
<van-checkbox value="{{ true }}" shape="square">请勾选增值车损险服务</van-checkbox> <van-checkbox value="{{ insuranceCheck }}" shape="square" bind:change="onChangeInsurance">
请勾选增值车损险服务
</van-checkbox>
<block wx:if="{{insuranceCheck}}">
<view class="incrementInfo"> <view class="incrementInfo">
<!-- <view class="img" mode="widthFix" /> --> <!-- <view class="img" mode="widthFix" /> -->
<image class="img" src="{{orderInfo.quotationGoodsInfo.titlePictureUrl}}" /> <image class="img" src="{{orderInfo.quotationGoodsInfo.titlePictureUrl}}" />
...@@ -283,10 +287,24 @@ ...@@ -283,10 +287,24 @@
</view> </view>
</view> </view>
</view> </view>
<van-field
class="inputBox"
border="{{false}}"
value="{{testQuotedPriceUpdate}}"
data-attrType="modifyEquityQuotation"
data-attrName="quotedPriceUpdate"
maxlength="10"
readonly
custom-style="-webkit-text-fill-color:rgb(130 127 127 / 83%); "
data-type='number'>
<view slot="left-icon">
<view>¥</view>
</view>
</van-field>
</block>
<view class="equityPirce" wx:if="{{orderInfo.modifyEquityQuotation}}"> <view class="equityPirce" wx:if="{{orderInfo.modifyEquityQuotation}}">
<view class="title">增值权益价格</view> <view class="title">增值权益价格</view>
<van-field <van-field
class="inputBox"
border="{{false}}" border="{{false}}"
data-hold-keyboard data-hold-keyboard
value="{{orderInfo.modifyEquityQuotation.quotedPriceUpdate}}" value="{{orderInfo.modifyEquityQuotation.quotedPriceUpdate}}"
......
...@@ -7,24 +7,24 @@ Page({ ...@@ -7,24 +7,24 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
owner: {
owner: '',
phone: '',
certificateNo: '',
carVin: '',
seat: '5',
price: '',
confirmStatus: false,
saveStatus: false
},
// owner: { // owner: {
// owner: 'test2', // owner: '',
// phone: 15816539334, // phone: '',
// certificateNo: '230182198012251659', // certificateNo: '',
// carVin: '12345678912345678', // carVin: '',
// seat: 5, // seat: '5',
// price: 7 // price: '',
// confirmStatus: false,
// saveStatus: false
// }, // },
owner: {
owner: 'test2',
phone: 15816539334,
certificateNo: '230182198012251659',
carVin: '12345678912345678',
seat: 5,
price: 7
},
orderInfo: { orderInfo: {
// 0-商业,1-交强,2-车船,3-增值车损,4-other 对应下面字段名字 // 0-商业,1-交强,2-车船,3-增值车损,4-other 对应下面字段名字
// owner // owner
...@@ -49,8 +49,8 @@ Page({ ...@@ -49,8 +49,8 @@ Page({
}, },
// 页面存放表单对象的对象名 // 页面存放表单对象的对象名
dataAttrName: 'owner', dataAttrName: 'owner',
step: 'first', // step: 'first',
// step: 'second', step: 'second',
needChangeList: ['price', 'base', 'threePremium', 'carInsidePremium', 'passengerPremium', 'payPrice'] needChangeList: ['price', 'base', 'threePremium', 'carInsidePremium', 'passengerPremium', 'payPrice']
}, },
reWrite(type, data) { reWrite(type, data) {
...@@ -157,34 +157,40 @@ Page({ ...@@ -157,34 +157,40 @@ Page({
// wx.$router.go('packageEquity.index') // wx.$router.go('packageEquity.index')
}, },
handleSecondConfirmCheck() { getInsurance() {
let { orderInfo, owner } = this.data let { orderInfo } = this.data
const insurance = ['business', 'mutualStrength', 'vehiclesAndVessels', 'valueAddedVehicleLoss', 'otherInsuranceList']
orderInfo = wx.$util.deepClone(orderInfo) orderInfo = wx.$util.deepClone(orderInfo)
owner = wx.$util.deepClone(owner)
let { default4SStoreInfo } = wx.$util.getUserInfo() let { default4SStoreInfo } = wx.$util.getUserInfo()
orderInfo.owner = owner orderInfo.merchantId4s = default4SStoreInfo?.merchantId
orderInfo.owner.price = this.multipliedByHundred(orderInfo.owner?.price) || '' orderInfo.merchantName4s = default4SStoreInfo?.merchantName
const insurance = ['business', 'mutualStrength', 'vehiclesAndVessels', 'valueAddedVehicleLoss', 'otherInsuranceList']
orderInfo.insureList = [] orderInfo.insureList = []
// multipliedByHundredObj
const business = this.multipliedByHundredObj(orderInfo.business) const business = this.multipliedByHundredObj(orderInfo.business)
const mutualStrength = this.multipliedByHundredObj(orderInfo.mutualStrength) const mutualStrength = this.multipliedByHundredObj(orderInfo.mutualStrength)
const vehiclesAndVessels = this.multipliedByHundredObj(orderInfo.vehiclesAndVessels) const vehiclesAndVessels = this.multipliedByHundredObj(orderInfo.vehiclesAndVessels)
const valueAddedVehicleLoss = this.multipliedByHundredObj(orderInfo.valueAddedVehicleLoss) const valueAddedVehicleLoss = this.multipliedByHundredObj(orderInfo.valueAddedVehicleLoss)
orderInfo.insureList = [business, mutualStrength, vehiclesAndVessels, valueAddedVehicleLoss] orderInfo.insureList = [business, mutualStrength, vehiclesAndVessels, valueAddedVehicleLoss]
// const otherInsuranceList =
orderInfo.otherInsuranceList.forEach(item => { orderInfo.otherInsuranceList.forEach(item => {
// return this.multipliedByHundredObj(item)
orderInfo.insureList.push(this.multipliedByHundredObj(item)) orderInfo.insureList.push(this.multipliedByHundredObj(item))
}) })
// || 44211547 || 'test'
orderInfo.merchantId4s = default4SStoreInfo?.merchantId
orderInfo.merchantName4s = default4SStoreInfo?.merchantName
delete orderInfo.owner?.buyCarTime
insurance.forEach(item => { insurance.forEach(item => {
delete orderInfo[item] delete orderInfo[item]
}) })
return orderInfo
},
handleSecondConfirmCheck() {
let { owner } = this.data
// 获取保险信息
let orderInfo = this.getInsurance()
// orderInfo = wx.$util.deepClone(orderInfo)
owner = wx.$util.deepClone(owner)
orderInfo.owner = owner
orderInfo.owner.price = this.multipliedByHundred(orderInfo.owner?.price) || ''
delete orderInfo.owner?.buyCarTime
console.log('orderInfo', orderInfo) console.log('orderInfo', orderInfo)
try { try {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
...@@ -382,7 +388,7 @@ Page({ ...@@ -382,7 +388,7 @@ Page({
onRoute(options) { onRoute(options) {
console.log(options, 'options') console.log(options, 'options')
// 判断是编辑还是新增 // 判断是编辑还是新增
// options.id = 14 options.id = 14
// options.modifyEquityQuotation = true // options.modifyEquityQuotation = true
if (options.id) { if (options.id) {
// 修改权益报价 // 修改权益报价
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!