Commit 9cf095cb by 李伟康

修改车牌号

1 parent 31ea316d
...@@ -176,8 +176,8 @@ export default { ...@@ -176,8 +176,8 @@ export default {
} }
if (n.selectCarNumberFlag && n.selectCarNumberFlag == 2) formList.push({ if (n.selectCarNumberFlag && n.selectCarNumberFlag == 2) formList.push({
key: 'plateNo', key: 'plateNo',
maxlength: 10, name: '车牌号',
name: '车牌号' type: 'plate'
}) })
if (n.selectVehicleTypeFlag && n.selectVehicleTypeFlag == 2) { if (n.selectVehicleTypeFlag && n.selectVehicleTypeFlag == 2) {
formList.push(...[{ formList.push(...[{
...@@ -247,7 +247,7 @@ export default { ...@@ -247,7 +247,7 @@ export default {
isExclusive: linkParams.isExclusive || ''//专属链接参数 isExclusive: linkParams.isExclusive || ''//专属链接参数
} }
shopmallApi.createOrder(params).then(({ data, code, message }) => { shopmallApi.createOrder(params).then(({ data, code, message }) => {
if(detail.liveBroadcastRoomId) data.liveBroadcastRoomId = detail.liveBroadcastRoomId if (detail.liveBroadcastRoomId) data.liveBroadcastRoomId = detail.liveBroadcastRoomId
if (code == '0') that.pay(data) if (code == '0') that.pay(data)
else { else {
that.payStatus = Date.now() that.payStatus = Date.now()
...@@ -258,6 +258,7 @@ export default { ...@@ -258,6 +258,7 @@ export default {
pay (orderInfo) { pay (orderInfo) {
this.showLoading('结算中') this.showLoading('结算中')
this.payStatus = Date.now() this.payStatus = Date.now()
console.log(orderInfo)
shopmallApi.payOrder({ shopmallApi.payOrder({
orderCode: orderInfo.orderCode, orderCode: orderInfo.orderCode,
paymentSource: 2 //1128版本 支付来源(1:小程序,2:公众号) paymentSource: 2 //1128版本 支付来源(1:小程序,2:公众号)
...@@ -269,6 +270,7 @@ export default { ...@@ -269,6 +270,7 @@ export default {
this.showModal = false this.showModal = false
let { needPay, payParams, order } = data, let { needPay, payParams, order } = data,
{ videoFullscreen } = this { videoFullscreen } = this
if(order.orderGoodsDTOS && order.orderGoodsDTOS.length) orderInfo.orderNumber = order.orderGoodsDTOS[0].orderCode
if (needPay) { if (needPay) {
let params = { let params = {
nonceStr: payParams.nonceStr, nonceStr: payParams.nonceStr,
...@@ -296,7 +298,7 @@ export default { ...@@ -296,7 +298,7 @@ export default {
else this.to('crowdfunding.success', { orderInfo }) else this.to('crowdfunding.success', { orderInfo })
} }
if (videoFullscreen) { if (videoFullscreen) {
console.log('直播间下单',orderInfo) console.log('直播间下单', orderInfo)
const res = await shopmallApi.liveRoomReport({ const res = await shopmallApi.liveRoomReport({
bizDataCode: orderInfo.orderCode, bizDataCode: orderInfo.orderCode,
liveBroadcastRoomId: orderInfo.liveBroadcastRoomId, liveBroadcastRoomId: orderInfo.liveBroadcastRoomId,
......
<template>
<van-action-sheet
v-model="hidden"
lock-scroll
>
<div class="license-plate">
<div class="license-plate-box">
<div class="license-plate-title flex">
<button
class="cancel btn"
@click="toggle"
>
取消
</button>
<button
class="done btn"
:disabled="plateNoErr"
hover-class="btn-hover"
@click="done"
>
完成
</button>
</div>
<div class="license-plate-content">
<div class="title">
请输入车牌号码
</div>
<div
class="plate-box flex"
:key="plateKey"
>
<template v-for="(item,index) in plateNo">
<div
:key="index"
:class="['item flex', {'active':index==plateIndex}, {'has-icon':index==2}]"
@click="changeIndex(index)"
>
{{item}}
<template v-if="index==2">
<div class="arc y-center"></div>
</template>
</div>
</template>
</div>
<!-- <button
class="paste"
hover-class="btn-hover"
@click="paste"
>
一键粘贴
</button> -->
</div>
<div
class="license-plate-keyboard isFullSucreen"
:key="dataKey"
>
<div class="keyboard-left">
<template v-if="plateIndex == 0">
<div class="grid city">
<template v-for="(item,index) in cityList">
<div
:key="index"
class="item"
@click="changePlateNo(item)"
>
{{item}}
</div>
</template>
</div>
</template>
<template v-else>
<div class="grid number">
<template v-for="(item,index) in 10">
<button
:key="index"
class="item"
@click="changePlateNo(item - 1)"
:disabled="plateIndex == 1 || (keyboardDisabled && plateIndex == 7)"
>
{{item - 1}}
</button>
</template>
</div>
<div class="grid letter">
<template v-for="(item,index) in letter">
<button
:key="index"
class="item"
@click="changePlateNo(item)"
:disabled="keyboardDisabled && plateIndex == 7"
>
{{item}}
</button>
</template>
</div>
<div class="grid suffix">
<template v-for="(item,index) in suffix">
<button
:key="index"
class="item"
@click="changePlateNo(item)"
:disabled="plateIndex < 6 || (keyboardDisabled && plateIndex == 7)"
>
{{item}}
</button>
</template>
</div>
</template>
</div>
<div
class="keyboard-del flex"
@click="del"
>
<img
src="https://img02.glsx.com.cn/weapp/resource/miniprogram/crowdfunding/KeyboardDeleteOutlined.png?v=1.0.3"
class="icon"
>
</div>
</div>
</div>
</div>
</van-action-sheet>
</template>
<script type='text/ecmascript-6'>
const suffix = '港澳学挂',
city = '京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼'
export default {
name: 'LicensePlate',
data () {
return {
plateKey: Date.now(),
dataKey: Date.now(),
plateNoErr: true,
plateIndex: 0,
plateNo: new Array(8).fill(''),
hidden: true,
cityList: [],
letter: [],
suffix: [],
keyboardDisabled: false,
hidden: false,
}
},
mounted () {
this.cityList = [...city]
this.letter = [...'ABCDEFGHJKLMNPQRSTUVWXYZ']
this.suffix = [...suffix]
this.dataKey = Date.now()
},
methods: {
changeIndex (index) {
let {
plateIndex
} = this
if (plateIndex == index) return
plateIndex = index
this.plateIndex = index
},
changePlateNo (value) {
let {
plateIndex
} = this
const index = plateIndex
if (plateIndex < 7) ++plateIndex
this.plateNo[index] = value
this.plateIndex = plateIndex
this.check()
},
del () {
let {
plateIndex
} = this
const index = plateIndex
if (plateIndex > 0) --plateIndex
this.plateNo[index] = ''
this.plateIndex = plateIndex
this.check()
},
check () {
let {
plateNo
} = this,
plateNoErr = false,
platNumberRex = /^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学港澳])$/
/**车牌后缀 */
if (plateNo[6] && plateNo[7] && suffix.includes(plateNo[6])) this.plateNo[7] = ''
if (!platNumberRex.test(plateNo.join(''))) plateNoErr = true
this.plateNoErr = plateNoErr
this.keyboardDisabled = suffix.includes(plateNo[6])
this.plateKey = Date.now()
},
toggle () {
let {
hidden
} = this
this.hidden = !hidden
},
done () {
let {
plateNo
} = this,
value = plateNo.join('')
this.$emit('done', { value })
this.toggle()
},
}
}
</script>
<style scoped lang='scss'>
.license-plate {
&-box {
position: relative;
width: 100vw;
height: 80vh;
background-color: #fff;
}
&-title {
padding: 10px 10px;
justify-content: space-between;
}
.cancel {
background-color: transparent !important;
}
.done {
background-color: #556af5;
color: #fff;
}
.btn {
height: 30px;
margin: 0 !important;
font-size: 14px;
display: flex;
align-items: center;
border: none;
padding: 0 14px;
border-radius: 5px;
}
.btn[disabled] {
background-color: #f7f7f7;
color: rgba(0, 0, 0, 0.3);
}
.btn-hover {
opacity: 0.75;
}
&-content {
.title {
font-size: 20px;
font-weight: 700;
text-align: center;
padding: 10px 0 20px;
}
.plate-box {
justify-content: center;
.item {
width: 30px;
height: 40px;
background: rgba($color: #b6b6b6, $alpha: 0.26);
border-radius: 4px;
border: 1px solid rgba($color: #b6b6b6, $alpha: 0.26);
margin-right: 5px;
justify-content: center;
}
.has-icon {
position: relative;
margin-left: 9px;
}
.active {
border-color: #556af5;
}
.arc {
width: 4px;
height: 4px;
border-radius: 50%;
background-color: #000;
left: -9px;
}
}
.paste {
background-color: #556af5;
color: #fff;
margin: 30px !important;
width: calc(100% - 60px);
height: 46px;
border: none;
}
}
&-keyboard {
position: absolute;
width: calc(100% - 20px);
min-height: 200px;
left: 0;
bottom: 0;
background: rgba($color: #b6b6b6, $alpha: 0.16);
padding: 10px;
display: flex;
.keyboard-left {
width: calc(100% - 70px);
}
.keyboard-del {
width: 60px;
height: auto;
margin-left: auto;
background-color: #fff;
justify-content: center;
.icon {
width: 30px;
height: 30px;
}
}
.grid {
display: grid;
gap: 7px;
}
.city,
.letter {
grid-template-columns: repeat(7, 1fr);
}
.number {
grid-template-columns: repeat(10, 1fr);
margin-bottom: 7px;
}
.suffix {
grid-template-columns: repeat(4, 1fr);
margin-top: 7px;
}
.item {
height: 30px;
background-color: #fff;
display: flex;
justify-content: center;
align-items: center;
padding: 0 !important;
font-size: 12px;
margin: 0 !important;
border: none;
}
.item[disabled] {
opacity: 0.2;
}
}
}
.license-plate.show {
animation: show-license-plate 0.5s forwards;
}
.license-plate.true {
animation: show-license-plate 0.5s forwards reverse;
}
@keyframes show-license-plate {
0% {
bottom: -100%;
}
100% {
bottom: 0;
}
}
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
</style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<van-action-sheet v-model="showBox" @click-overlay="onCancel" :lock-scroll="false"> <div>
<div class="box"> <van-action-sheet
<template v-for="(i, index) in items"> v-model="showBox"
<template v-if="i.name"> @click-overlay="onCancel"
<div class="item flex" :key="index"> :lock-scroll="false"
<div class="label text-hide"> >
<span>*</span> <div class="box">
{{ i.name }} <template v-for="(i, index) in items">
<template v-if="i.name">
<div
class="item flex"
:key="index"
>
<div class="label text-hide">
<span>*</span>
{{ i.name }}
</div>
<div class="value">
<template v-if="i.route">
<van-field
readonly
:placeholder="`请选择您的${i.name}`"
@click="jumpCarBrands(i.route)"
v-model="params[i.key]"
class="readonly"
right-icon="arrow"
></van-field>
</template>
<template v-else-if="i.type == 'plate'">
<van-field
readonly
:placeholder="`请填写您的${i.name}`"
@click="showPlate"
v-model="params[i.key]"
class="readonly"
></van-field>
</template>
<template v-else>
<van-field
v-model="params[i.key]"
:placeholder="`请填写您的${i.name}`"
:maxlength="i.maxlength"
:type="i.type"
clearable
/>
</template>
</div>
</div> </div>
<div class="value"> </template>
<template v-if="i.route">
<van-field readonly :placeholder="`请选择您的${i.name}`" @click="jumpCarBrands(i.route)" v-model="params[i.key]" class="readonly" right-icon="arrow"></van-field>
</template>
<template v-else>
<van-field v-model="params[i.key]" :placeholder="`请填写您的${i.name}`" :maxlength="i.maxlength" :type="i.type" clearable />
</template>
</div>
</div>
</template> </template>
</template> <!-- <div class="tips">
<!-- <div class="tips">
本人已阅读且同意<span @click="jump('agreement')">《隐私协议》</span> 本人已阅读且同意<span @click="jump('agreement')">《隐私协议》</span>
</div> --> </div> -->
<template v-if="ISWXWORK"> <template v-if="ISWXWORK">
<van-button color="#b1b1b1" class="btn disabled">企微暂不支持支付</van-button> <van-button
</template> color="#b1b1b1"
<template v-else> class="btn disabled"
<van-button color="#f13c3d" class="btn" @click="pay" loading-text="支付中..." :loading="payLoading">立即支付</van-button> >企微暂不支持支付</van-button>
</template> </template>
</div> <template v-else>
</van-action-sheet> <van-button
color="#f13c3d"
class="btn"
@click="pay"
loading-text="支付中..."
:loading="payLoading"
>立即支付</van-button>
</template>
</div>
</van-action-sheet>
<license-plate
ref="plate"
@done="plateDone"
></license-plate>
</div>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
...@@ -109,9 +153,7 @@ export default { ...@@ -109,9 +153,7 @@ export default {
let { params, items, hasCarBrand, carInfo, hasPhoneSelect } = this, let { params, items, hasCarBrand, carInfo, hasPhoneSelect } = this,
obj = {}, obj = {},
phoneRex = /^[1]([3-9])[0-9]{9}$/, phoneRex = /^[1]([3-9])[0-9]{9}$/,
userInfo = this.getUserInfo(), userInfo = this.getUserInfo()
platNumberRex = /^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([A-Z]([A-HJ-NP-Z0-9]){5})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
console.log(params) console.log(params)
try { try {
items.map(e => { items.map(e => {
...@@ -127,13 +169,6 @@ export default { ...@@ -127,13 +169,6 @@ export default {
this.showToast('请填写正确的手机号') this.showToast('请填写正确的手机号')
return return
} }
if (params.plateNo) {
params.plateNo = params.plateNo.toUpperCase()
if (!platNumberRex.test(params.plateNo)) {
this.showToast('请填写正确的车牌号')
return
}
}
Object.keys(params).map(key => { Object.keys(params).map(key => {
if (params[key]) obj[key] = params[key] if (params[key]) obj[key] = params[key]
}) })
...@@ -190,6 +225,12 @@ export default { ...@@ -190,6 +225,12 @@ export default {
} }
} }
this.to('crowdfunding.carBrands') this.to('crowdfunding.carBrands')
},
showPlate () {
this.$refs.plate.toggle()
},
plateDone ({ value }) {
this.params.plateNo = value
} }
} }
} }
......
<template> <template>
<canvas :id="canvasId" class="create"></canvas> <canvas
:id="canvasId"
class="create"
></canvas>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
...@@ -37,6 +40,7 @@ export default { ...@@ -37,6 +40,7 @@ export default {
userName, userName,
goodsName, goodsName,
orderCode, orderCode,
orderNumber,
orderStatus, orderStatus,
createdDate, createdDate,
vehicleBrandName, vehicleBrandName,
...@@ -80,9 +84,9 @@ export default { ...@@ -80,9 +84,9 @@ export default {
} }
labelList = [...labelList, '商品名称:', '支付时间:'] labelList = [...labelList, '商品名称:', '支付时间:']
valueList = [...valueList, goodsName, new Date(createdDate).format('yyyy年M月d日 hh:mm:ss')] valueList = [...valueList, goodsName, new Date(createdDate).format('yyyy年M月d日 hh:mm:ss')]
if (orderStatus != 10 && orderCode) { if (orderStatus != 10 && (orderNumber || orderCode)) {
labelList.push('订单号:') labelList.push('订单号:')
valueList.push(orderCode) valueList.push(orderNumber || orderCode)
} }
if (formContentFirst) { if (formContentFirst) {
labelList.push(formDescribeFirst) labelList.push(formDescribeFirst)
...@@ -122,7 +126,7 @@ export default { ...@@ -122,7 +126,7 @@ export default {
textBaseline textBaseline
}) })
draw.drawText({ draw.drawText({
text: orderCode || '', text: orderNumber || orderCode || '',
x: labelX - 1, x: labelX - 1,
y: 54, y: 54,
color: '#282829', color: '#282829',
......
...@@ -33,7 +33,8 @@ export default { ...@@ -33,7 +33,8 @@ export default {
activityJoin, activityJoin,
payPrice, payPrice,
orderGoods: [orderGoods], orderGoods: [orderGoods],
orderCode orderCode,
orderNumber
} = orderInfo } = orderInfo
this.orderInfo = { this.orderInfo = {
userName: activityJoin.userName, userName: activityJoin.userName,
...@@ -50,7 +51,8 @@ export default { ...@@ -50,7 +51,8 @@ export default {
formContentSecond: activityJoin.formContentSecond, formContentSecond: activityJoin.formContentSecond,
formDescribeFirst: activityJoin.formDescribeFirst, formDescribeFirst: activityJoin.formDescribeFirst,
formDescribeSecond: activityJoin.formDescribeSecond, formDescribeSecond: activityJoin.formDescribeSecond,
orderCode orderCode,
orderNumber
} }
}, },
methods: { methods: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!