Commit f5d58b18 by 胡悦

Merge branch 'v1.0.5' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.5

2 parents 84d3c6a7 081d1880
......@@ -2,23 +2,24 @@ import http from "../request/http";
module.exports = {
/**获取APP更新 */
findSoureList(data) {
findSoureList (data) {
return http.post({
method: 'dj.api.smartcarlife.recepiton.soure.findSoureList',
projectName: "boutique",
...data,
});
},
/** 查当前4s商户下商户券 */
findCouponList(data) {
/** 查询可发放礼券-分页查询商户券列表 */
findCouponList (data) {
return http.post({
method: 'dj.api.smartCarLife.merchant.coupon.list',
method: 'dj.api.smartcarlife.merchantCoupon.pageForZYApp',
projectName: "boutique",
onlyUsable: true,
...data,
});
},
/**查询用户是否领券 */
findCustomerReceivedStatus(data) {
findCustomerReceivedStatus (data) {
return http.post({
method: 'dj.api.smartcarlife.customerCoupon.page',
projectName: "boutique",
......
......@@ -21,7 +21,7 @@
<view
class="pop-tips"
v-else
>检测到“{{sceneType == 0 ? '交车通知书':'精品加装服务说明页'}}”中未填写客户档案,请填写后再完成接待。</view>
>{{tips}}</view>
</template>
<view class="form">
<template v-for="(i, index) in formObject">
......@@ -30,7 +30,7 @@
:key="index"
>
<view class="label">{{ i.label }}</view>
<view :class="['value', { error: showError(i.key) }]">
<view :class="['value', { error: showError(i.key) },{disabled:customerType == 0}]">
<template v-if="i.type == 'input'">
<input
:type="i.inputType"
......@@ -38,7 +38,7 @@
v-model="formData[i.key]"
class="input"
:placeholder="i.placeholder"
placeholder-class="placeholder"
:disabled="customerType == 0"
/>
</template>
<template v-else>
......@@ -102,6 +102,36 @@ import Employee from '@/components/Employee.vue'
import CarBrands from '@/components/CarBrands.vue'
import { mapMutations } from "vuex";
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
const formObject_boutique = [{
label: "车主姓名",
key: "customerName",
type: "input",
inputType: "text",
maxlength: 50,
placeholder: '请输入姓名'
},
{
label: "车型",
key: "carModel",
type: "select",
popKey: "carBrandListVisible",
placeholder: '请选择车型'
},
{
label: "车主电话",
key: "phoneNumber",
type: "input",
inputType: "tel",
maxlength: 11,
placeholder: '请输入电话'
},
{
label: "交付专员",
key: "staffName",
type: "select",
popKey: "employeeBoxVisible",
placeholder: '请选择交付专员'
},]
export default {
components: { Employee, CarBrands },
name: 'FinishStep',
......@@ -109,6 +139,10 @@ export default {
sceneType: {
type: Number,
default: 0
},
customerType: {
type: Number,
default: 1
}
},
data () {
......@@ -174,6 +208,12 @@ export default {
watchStatus () {
return this.$store.state.user.historyStatus
},
tips () {
let { sceneType } = this,
text = '检测到“交车通知书”中未填写客户档案,请填写后再完成接待。'
if (sceneType == 1) text = '请确认“精品加装服务说明页”中的客户信息,并点击完成接待结束客户接待。'
return text
}
},
watch: {
watchStatus: {
......@@ -196,6 +236,8 @@ export default {
return this.errorTip && flag
},
showPopup (e) {
let {customerType} = this
if(customerType == 0) return
this.$refs[e].open();
},
// 取消
......@@ -257,16 +299,26 @@ export default {
},
open () {
this.$store.dispatch('getCustomerInfo').then((customerInfo) => {
let { sceneType } = this
this.errorTip = false
this.receptionStatus = sceneType == 0 ? -1 : 1 //精品默认1
this.formData = customerInfo
let step = sceneType == 0 ? Object.values(customerInfo).every((value) => !!value) ? 2 : 1 : 1
let { sceneType, customerType } = this,
receptionStatus = -1,
step = Object.values(customerInfo).every((value) => !!value) ? 2 : 1
this.errorTip = false
if (sceneType == 1) {
if (customerType == 0 && !this.check()) return uni.showToast({
title: '请选择回店客户',
icon: 'none'
})
receptionStatus = 1 //精品默认1
step = 1
this.formObject = formObject_boutique
}
if (step == 2 && !this.check()) {
this.errorTip = true
step = 1
}
this.step = step
this.receptionStatus = receptionStatus
this.$refs.formRef.open()
})
},
......@@ -341,6 +393,10 @@ export default {
border: none !important;
outline: none;
padding: 0 !important;
font-size: 30rpx;
&::placeholder {
color: #c9c9c9;
}
}
.select {
display: flex;
......@@ -354,6 +410,9 @@ export default {
color: #c9c9c9;
}
}
.disabled{
background: #f4f4f4;
}
}
}
.choose-box {
......
......@@ -25,7 +25,7 @@
@input="inputCustomer"
:placeholder="i.placeholder"
@focus="focusIndex = index"
@blur="focusIndex = -1"
@blur="resetFocusIndex"
/>
</template>
<template v-else>
......@@ -88,13 +88,13 @@
<car-brands
ref="carBrandListVisible"
@select="handleSelect($event,'carBrandListVisible')"
@close="focusIndex = -1"
@close="resetFocusIndex"
/>
<employee
ref="employeeBoxVisible"
@select="handleSelect($event,'employeeBoxVisible')"
title="交付人员"
@close="focusIndex = -1"
@close="resetFocusIndex"
/>
<MessageBox
ref="couponBoxVisible"
......@@ -102,7 +102,7 @@
:isFooter="false"
title="请选择礼券类型"
:maxHeight="1000"
@close="focusIndex = -1"
@close="resetFocusIndex"
>
<view class="select-box">
<view
......@@ -129,6 +129,8 @@
import Employee from '@/components/Employee.vue'
import CarBrands from '@/components/CarBrands.vue'
import QrBox from './QrBox.vue'
import dayjs from 'dayjs'
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
export default {
name: 'Reception',
components: { Employee, CarBrands, QrBox },
......@@ -202,14 +204,14 @@ export default {
methods: {
init () {
this.qrTimer = null
this.focusIndex = -1
this.resetFocusIndex()
this.findCouponList()
},
async findCouponList () {
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo,
couponList = await uni.$api.boutiqueApi.findCouponList({
merchantId: shopMerchantId
merchantIdList: [shopMerchantId]
})
this.couponList = couponList || []
},
......@@ -226,7 +228,7 @@ export default {
this.customerInfo.carModel = item.name
this.carInfo = item
}
this.focusIndex = -1
this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
showPopup (e, index) {
......@@ -237,6 +239,8 @@ export default {
this.$refs.carBrandListVisible.close()
this.$refs.employeeBoxVisible.close()
this.$refs.couponBoxVisible.close()
this.resetFocusIndex()
this.closeQr()
},
chooseCoupon (item) {
this.couponId = item.id
......@@ -249,11 +253,7 @@ export default {
async createCoupon () {
try {
const { couponId, customerInfo, carInfo } = this
if (!customerInfo.customerName) throw '请输入车主姓名'
if (!customerInfo.phoneNumber) throw '请输入车主手机'
if (!customerInfo.carModel) throw '请选择车型'
if (!customerInfo.staffName) throw '请选择交付专员'
if (!couponId) throw '请选择礼券类型'
await this.validate()
uni.showLoading()
const {
uuid,
......@@ -281,7 +281,7 @@ export default {
if (code == 0) {
if (data) {
this.QRURL = data
this.checkCustomerReceivedStatus()
this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss"))
}
else throw '生成小程序码失败,请重试!'
} else throw message
......@@ -294,10 +294,30 @@ export default {
})
}
},
checkCustomerReceivedStatus () {
async validate () {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo,
{ couponId } = this
// 检查车主姓名
if (!customerName) throw '请输入车主姓名'
// 检查车主手机
if (!phoneNumber) throw '请输入车主手机'
if (phoneNumber && !phoneRex.test(phoneNumber)) throw '请输入正确的手机号'
// 检查车型
if (!carModel) throw '请选择车型'
// 检查交付专员
if (!staffName) throw '请选择交付专员'
// 检查礼券类型
if (!couponId) throw '请选择礼券类型'
},
checkCustomerReceivedStatus (receiveCouponStartTime) {
this.qrTimer = setInterval(async () => {
// const res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({})
if (true) {
const { couponId, customerInfo } = this,
res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({
merchantCouponId: couponId,
customerPhone: customerInfo.phoneNumber,
receiveCouponStartTime
})
if (res.total) {
this.received = true
this.closeQr()
setTimeout(() => {
......@@ -309,6 +329,9 @@ export default {
closeQr () {
clearInterval(this.qrTimer)
this.qrTimer = null
},
resetFocusIndex () {
this.focusIndex = -1
}
}
}
......
......@@ -51,6 +51,7 @@
ref="stepRef"
@submit="done"
:sceneType="1"
:customerType="customerType"
/>
</view>
</template>
......
......@@ -189,7 +189,7 @@ export default {
chooseCustomerType (index) {
const { moduleList } = this
this.customerType = index
if (index == 0) this.jumpPage(moduleList.at(-1).id)
if (index == 0) this.jumpPage(moduleList.at(-1).id) //跳转处理
else this.jumpPage()
},
done (e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!