Commit af78516c by 张立顺

功能开发

1 parent f01f640d
// components/OrderPopup/OrderPopup.js
// import qrcode from '../../utils/wxqrcode'
import qrcode from '~/utils/lib/wxqrcode'
import api from '../../api/api.js'
Component({
......
......@@ -61,9 +61,18 @@ module.exports = {
let params = data || {}
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.generate', params)
},
/** 更新报价单状态 */
updateOrderStatus(data) {
let params = data || {}
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
import { getOrderDetail, updateOrderStatus, getQuotationInfoById } from '../../../api'
import { createQrcodeImage } from '~/api/api'
import qrcode from '~/utils/lib/wxqrcode'
let time = null
Page({
/**
......@@ -9,7 +10,34 @@ Page({
data: {
orderCode: '',
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() {
......
{
"usingComponents": {
"order-detail": "../../../components/orderInfoCom/orderInfoCom"
"order-detail": "../../../components/orderInfoCom/orderInfoCom",
"popup-select-pay": "../components/PopupSelectPay/PopupSelect"
},
"navigationBarTitleText": "订单支付"
}
......@@ -48,4 +48,5 @@
</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
<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
......@@ -80,7 +80,9 @@ Component({
popInputObj: {
type: 'add'
},
showError: false
showError: false,
insuranceCheck: false,
testQuotedPriceUpdate: 123
},
/**
......@@ -91,6 +93,12 @@ Component({
// let { activeNames } = this.data
// console.log('activeNames', activeNames)
// },
onChangeInsurance(e) {
console.log(e)
let thisPage = wx.$router.getPageInstance()
console.log(thisPage)
let params = thisPage.getInsurance()
},
//--------自定义方法----------
// 选择年份的区域,弹出弹窗框
chooseYear() {
......
......@@ -35,7 +35,7 @@
value="{{orderInfo.business.base}}"
data-attrName="base"
data-type='number'
type="digit"
type="digit"
placeholder="请输入保费"
data-attrType="business"
bindinput="handleInput">
......@@ -65,7 +65,7 @@
placeholder="请输入保费"
data-hold-keyboard
value="{{orderInfo.business.threePremium}}"
type="digit"
type="digit"
data-type='number'
data-attrType="business"
data-attrName="threePremium"
......@@ -99,7 +99,7 @@
value="{{orderInfo.business.carInsidePremium}}"
data-attrType="business"
data-attrName="carInsidePremium"
type="digit"
type="digit"
bindinput="handleInput">
<view slot="left-icon">
<view>¥</view>
......@@ -130,7 +130,7 @@
value="{{orderInfo.business.passengerPremium}}"
data-attrType="business"
data-attrName="passengerPremium"
type="digit"
type="digit"
bindinput="handleInput">
<view slot="left-icon">
<view>¥</view>
......@@ -183,6 +183,7 @@
border="{{false}}"
data-hold-keyboard
readonly="{{true}}"
disabled="{{true}}"
value="{{item.payPrice}}"
data-attrType="otherInsuranceList"
data-attrName="payPrice"
......@@ -224,7 +225,7 @@
value="{{orderInfo.mutualStrength.payPrice}}"
data-attrType="mutualStrength"
data-attrName="payPrice"
type="digit"
type="digit"
bindinput="handleInput">
<view slot="left-icon">
<view>¥</view>
......@@ -250,7 +251,7 @@
value="{{orderInfo.vehiclesAndVessels.payPrice}}"
data-attrType="vehiclesAndVessels"
data-attrName="payPrice"
type="digit"
type="digit"
bindinput="handleInput">
<view slot="left-icon">
<view>¥</view>
......@@ -267,26 +268,43 @@
</view>
</view>
<!-- bind:change="onChange" -->
<van-checkbox value="{{ true }}" shape="square">请勾选增值车损险服务</van-checkbox>
<view class="incrementInfo">
<!-- <view class="img" mode="widthFix" /> -->
<image class="img" src="{{orderInfo.quotationGoodsInfo.titlePictureUrl}}" />
<view class="info">
<view class="infoTitle">{{orderInfo.quotationGoodsInfo.goodsName}}</view>
<!-- class="content " -->
<view>
<text>包含</text>
<!-- {{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList.length==index?'':'、'}} -->
<block wx:key="index" wx:for="{{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList}}">
<text>{{item.serviceName}}{{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList.length==index?'':'、'}}</text>
</block>
<van-checkbox value="{{ insuranceCheck }}" shape="square" bind:change="onChangeInsurance">
请勾选增值车损险服务
</van-checkbox>
<block wx:if="{{insuranceCheck}}">
<view class="incrementInfo">
<!-- <view class="img" mode="widthFix" /> -->
<image class="img" src="{{orderInfo.quotationGoodsInfo.titlePictureUrl}}" />
<view class="info">
<view class="infoTitle">{{orderInfo.quotationGoodsInfo.goodsName}}</view>
<!-- class="content " -->
<view>
<text>包含</text>
<!-- {{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList.length==index?'':'、'}} -->
<block wx:key="index" wx:for="{{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList}}">
<text>{{item.serviceName}}{{orderInfo.quotationGoodsInfo.quotationGoodsServiceItemsRelationDTOList.length==index?'':'、'}}</text>
</block>
</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="title">增值权益价格</view>
<van-field
class="inputBox"
border="{{false}}"
data-hold-keyboard
value="{{orderInfo.modifyEquityQuotation.quotedPriceUpdate}}"
......@@ -294,7 +312,7 @@
data-attrName="quotedPriceUpdate"
maxlength="10"
data-type='number'
type="digit"
type="digit"
bindinput="handleInput">
<view slot="left-icon">
<view>¥</view>
......
......@@ -7,24 +7,24 @@ Page({
* 页面的初始数据
*/
data: {
owner: {
owner: '',
phone: '',
certificateNo: '',
carVin: '',
seat: '5',
price: '',
confirmStatus: false,
saveStatus: false
},
// owner: {
// owner: 'test2',
// phone: 15816539334,
// certificateNo: '230182198012251659',
// carVin: '12345678912345678',
// seat: 5,
// price: 7
// owner: '',
// phone: '',
// certificateNo: '',
// carVin: '',
// seat: '5',
// price: '',
// confirmStatus: false,
// saveStatus: false
// },
owner: {
owner: 'test2',
phone: 15816539334,
certificateNo: '230182198012251659',
carVin: '12345678912345678',
seat: 5,
price: 7
},
orderInfo: {
// 0-商业,1-交强,2-车船,3-增值车损,4-other 对应下面字段名字
// owner
......@@ -49,8 +49,8 @@ Page({
},
// 页面存放表单对象的对象名
dataAttrName: 'owner',
step: 'first',
// step: 'second',
// step: 'first',
step: 'second',
needChangeList: ['price', 'base', 'threePremium', 'carInsidePremium', 'passengerPremium', 'payPrice']
},
reWrite(type, data) {
......@@ -157,34 +157,40 @@ Page({
// wx.$router.go('packageEquity.index')
},
handleSecondConfirmCheck() {
let { orderInfo, owner } = this.data
const insurance = ['business', 'mutualStrength', 'vehiclesAndVessels', 'valueAddedVehicleLoss', 'otherInsuranceList']
getInsurance() {
let { orderInfo } = this.data
orderInfo = wx.$util.deepClone(orderInfo)
owner = wx.$util.deepClone(owner)
let { default4SStoreInfo } = wx.$util.getUserInfo()
orderInfo.owner = owner
orderInfo.owner.price = this.multipliedByHundred(orderInfo.owner?.price) || ''
orderInfo.merchantId4s = default4SStoreInfo?.merchantId
orderInfo.merchantName4s = default4SStoreInfo?.merchantName
const insurance = ['business', 'mutualStrength', 'vehiclesAndVessels', 'valueAddedVehicleLoss', 'otherInsuranceList']
orderInfo.insureList = []
// multipliedByHundredObj
const business = this.multipliedByHundredObj(orderInfo.business)
const mutualStrength = this.multipliedByHundredObj(orderInfo.mutualStrength)
const vehiclesAndVessels = this.multipliedByHundredObj(orderInfo.vehiclesAndVessels)
const valueAddedVehicleLoss = this.multipliedByHundredObj(orderInfo.valueAddedVehicleLoss)
orderInfo.insureList = [business, mutualStrength, vehiclesAndVessels, valueAddedVehicleLoss]
// const otherInsuranceList =
orderInfo.otherInsuranceList.forEach(item => {
// return 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 => {
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)
try {
return new Promise(async (resolve, reject) => {
......@@ -382,7 +388,7 @@ Page({
onRoute(options) {
console.log(options, 'options')
// 判断是编辑还是新增
// options.id = 14
options.id = 14
// options.modifyEquityQuotation = true
if (options.id) {
// 修改权益报价
......
......@@ -96,8 +96,8 @@ module.exports = {
notUpgradeOrder(data) {
return api.post('dj.api.smartcarlife.order.notUpgrade.batchInsert', data)
},
/** 批量新建预录工单 */
createPrerecordedOrderBatch(data) {
/** 批量新建预录工单 */
createPrerecordedOrderBatch(data) {
return api.post('dj.api.smartcarlife.order.preliminaryOrder.batch', data)
},
/** 新建预录工单 */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!