Commit 1543fea5 by 李伟康

commit 提交

1 parent 0fdbbd5c
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
.icon-customer-detail { width: 40rpx; height: 40rpx; background-position: -830rpx -668rpx;} .icon-customer-detail { width: 40rpx; height: 40rpx; background-position: -830rpx -668rpx;}
.icon-customer-file-active { width: 112rpx; height: 112rpx; background-position: -638rpx -558rpx;} .icon-customer-file-active { width: 112rpx; height: 112rpx; background-position: -638rpx -558rpx;}
.icon-customer-file { width: 112rpx; height: 112rpx; background-position: 0rpx -726rpx;} .icon-customer-file { width: 112rpx; height: 112rpx; background-position: 0rpx -726rpx;}
.icon-detail-start { width: 80rpx; height: 80rpx; background-position: 0rpx -964rpx;}
.icon-face-error-active { width: 96rpx; height: 96rpx; background-position: -746rpx -726rpx;} .icon-face-error-active { width: 96rpx; height: 96rpx; background-position: -746rpx -726rpx;}
.icon-face-error { width: 96rpx; height: 96rpx; background-position: -857rpx -726rpx;} .icon-face-error { width: 96rpx; height: 96rpx; background-position: -857rpx -726rpx;}
.icon-face-success-active { width: 96rpx; height: 96rpx; background-position: -968rpx -726rpx;} .icon-face-success-active { width: 96rpx; height: 96rpx; background-position: -968rpx -726rpx;}
...@@ -35,8 +36,8 @@ ...@@ -35,8 +36,8 @@
.icon-kf-2 { width: 32rpx; height: 32rpx; background-position: -765rpx -621rpx;} .icon-kf-2 { width: 32rpx; height: 32rpx; background-position: -765rpx -621rpx;}
.icon-kf-3 { width: 32rpx; height: 32rpx; background-position: -476rpx -853rpx;} .icon-kf-3 { width: 32rpx; height: 32rpx; background-position: -476rpx -853rpx;}
.icon-logo { width: 160rpx; height: 160rpx; background-position: -1041rpx -382rpx;} .icon-logo { width: 160rpx; height: 160rpx; background-position: -1041rpx -382rpx;}
.icon-mask-del { width: 80rpx; height: 80rpx; background-position: 0rpx -964rpx;} .icon-mask-del { width: 80rpx; height: 80rpx; background-position: -95rpx -964rpx;}
.icon-mask-edit { width: 80rpx; height: 80rpx; background-position: -95rpx -964rpx;} .icon-mask-edit { width: 80rpx; height: 80rpx; background-position: -190rpx -964rpx;}
.icon-no-insurance-data { width: 488rpx; height: 296rpx; background-position: 0rpx -415rpx;} .icon-no-insurance-data { width: 488rpx; height: 296rpx; background-position: 0rpx -415rpx;}
.icon-pen-active { width: 120rpx; height: 120rpx; background-position: -646rpx -415rpx;} .icon-pen-active { width: 120rpx; height: 120rpx; background-position: -646rpx -415rpx;}
.icon-pen { width: 120rpx; height: 120rpx; background-position: -503rpx -558rpx;} .icon-pen { width: 120rpx; height: 120rpx; background-position: -503rpx -558rpx;}
...@@ -51,10 +52,9 @@ ...@@ -51,10 +52,9 @@
.icon-second-nav { width: 480rpx; height: 176rpx; background-position: -830rpx 0rpx;} .icon-second-nav { width: 480rpx; height: 176rpx; background-position: -830rpx 0rpx;}
.icon-setting { width: 64rpx; height: 64rpx; background-position: -372rpx -964rpx;} .icon-setting { width: 64rpx; height: 64rpx; background-position: -372rpx -964rpx;}
.icon-store { width: 96rpx; height: 96rpx; background-position: -222rpx -853rpx;} .icon-store { width: 96rpx; height: 96rpx; background-position: -222rpx -853rpx;}
.icon-tag-checked { width: 60rpx; height: 32rpx; background-position: -1240rpx -557rpx;}
.icon-tool-file { width: 60rpx; height: 60rpx; background-position: -451rpx -964rpx;} .icon-tool-file { width: 60rpx; height: 60rpx; background-position: -451rpx -964rpx;}
.icon-tool-finish { width: 60rpx; height: 60rpx; background-position: -526rpx -964rpx;} .icon-tool-finish { width: 60rpx; height: 60rpx; background-position: -526rpx -964rpx;}
.icon-tool-pay { width: 60rpx; height: 60rpx; background-position: -601rpx -964rpx;} .icon-tool-pay { width: 60rpx; height: 60rpx; background-position: -601rpx -964rpx;}
.icon-total { width: 32rpx; height: 32rpx; background-position: -570rpx -853rpx;} .icon-total { width: 32rpx; height: 32rpx; background-position: -570rpx -853rpx;}
.icon-visible { width: 40rpx; height: 40rpx; background-position: -995rpx -668rpx;} .icon-visible { width: 40rpx; height: 40rpx; background-position: -995rpx -668rpx;}
\ No newline at end of file \ No newline at end of file
.icon-tag-checked { width: 60rpx; height: 32rpx; background-position: -1240rpx -557rpx;}
.icon-detail-start { width: 80rpx; height: 80rpx; background-position: -190rpx -964rpx;}
\ No newline at end of file \ No newline at end of file
No preview for this file type
No preview for this file type

1.19 MB | W: | H:

1.19 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
> >
<view <view
class="select-views" class="select-views"
:key="dateKey"
> >
<template v-for="(i,index) in list"> <template v-for="(i,index) in list">
<view <view
...@@ -57,7 +56,6 @@ export default { ...@@ -57,7 +56,6 @@ export default {
return { return {
list: [], list: [],
component_chooseList: [], component_chooseList: [],
dateKey: Date.now()
} }
}, },
watch: { watch: {
...@@ -70,8 +68,7 @@ export default { ...@@ -70,8 +68,7 @@ export default {
chooseList: { chooseList: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
this.component_chooseList = JSON.parse(JSON.stringify(newval))
// if (newval && newval.length) this.component_chooseList = JSON.parse(JSON.stringify(newval))
} }
} }
}, },
...@@ -101,7 +98,7 @@ export default { ...@@ -101,7 +98,7 @@ export default {
if (index == -1) component_chooseList.push(item) if (index == -1) component_chooseList.push(item)
else component_chooseList.splice(index, 1) else component_chooseList.splice(index, 1)
this.component_chooseList = component_chooseList this.component_chooseList = component_chooseList
this.dateKey = Date.now() this.$forceUpdate()
}, },
close () { close () {
this.$refs?.customerTagstVisible?.close() this.$refs?.customerTagstVisible?.close()
......
<template> <template>
<view class="record-box"> <view class="record-box">
<view :class="['record-content',{'hide-record':showInfo}]"> <view :class="['record-content',`${showInfo?'hide-record':'show-record'}`]">
<view <view
class="add-btn flex" class="add-btn flex"
@click="editItem(false)" @click="editItem(false)"
...@@ -53,10 +53,7 @@ ...@@ -53,10 +53,7 @@
scroll-y scroll-y
@scrolltolower="pageonReachBottom" @scrolltolower="pageonReachBottom"
> >
<view <view class="list">
class="list"
:key="dateKey"
>
<template v-if="flag"> <template v-if="flag">
<template v-if="list.length && list[0] && list[0].length"> <template v-if="list.length && list[0] && list[0].length">
<template v-for="(i,index) in list"> <template v-for="(i,index) in list">
...@@ -94,8 +91,7 @@ ...@@ -94,8 +91,7 @@
</template> </template>
<view <view
class="mask" :class="['mask',{'show-mask':item.maskStatus}]"
v-if="item.maskStatus"
@click.stop @click.stop
> >
<view <view
...@@ -177,6 +173,7 @@ ...@@ -177,6 +173,7 @@
<customer-info <customer-info
:customerId="customerId" :customerId="customerId"
:show.sync="showInfo" :show.sync="showInfo"
@refresh="refresh"
/> />
</view> </view>
</template> </template>
...@@ -204,7 +201,7 @@ export default { ...@@ -204,7 +201,7 @@ export default {
{ text: '全部' } { text: '全部' }
], ],
itemObject: [ itemObject: [
{ label: '车主电话', key: 'phone' }, { label: '车主电话', key: 'ownerPhone' },
{ label: '品牌车型', key: 'brandModel' }, { label: '品牌车型', key: 'brandModel' },
{ label: '客户标签', key: 'customerTagName' }, { label: '客户标签', key: 'customerTagName' },
{ label: '到店日期', key: 'arrivalDate' }, { label: '到店日期', key: 'arrivalDate' },
...@@ -219,7 +216,6 @@ export default { ...@@ -219,7 +216,6 @@ export default {
nothing: false, nothing: false,
pageSize: 18, pageSize: 18,
customerId: '', customerId: '',
dateKey: Date.now(),
showInfo: false, showInfo: false,
} }
}, },
...@@ -227,7 +223,7 @@ export default { ...@@ -227,7 +223,7 @@ export default {
activeBtnStyle () { activeBtnStyle () {
let { dateIndex } = this let { dateIndex } = this
return { return {
left: `calc(4rpx + ${dateIndex * 184}rpx)` transform: `translate(calc(${dateIndex * 184}rpx), -50%)`
} }
} }
}, },
...@@ -235,15 +231,18 @@ export default { ...@@ -235,15 +231,18 @@ export default {
this.init(); this.init();
}, },
methods: { methods: {
changeType (index, name) { refresh () {
if (this.firstIndex == index) return // 点击同一个
this.flag = false this.flag = false
this.firstIndex = index
this.list = [] this.list = []
this.pageNum = 1; this.pageNum = 1;
this.nothing = false this.nothing = false
this.getReceptionList() this.getReceptionList()
}, },
changeType (index) {
if (this.firstIndex == index) return // 点击同一个
this.firstIndex = index
this.refresh()
},
init () { init () {
this.dateList.map((e, index) => { this.dateList.map((e, index) => {
const tatget = ['day', 'week', 'month', 'all'][index] const tatget = ['day', 'week', 'month', 'all'][index]
...@@ -278,7 +277,9 @@ export default { ...@@ -278,7 +277,9 @@ export default {
let ownerPhone = e.ownerPhone let ownerPhone = e.ownerPhone
e.arrivalDate = dayjs(e.arrivalDate).format("YYYY.MM.DD") e.arrivalDate = dayjs(e.arrivalDate).format("YYYY.MM.DD")
e.receptionTime = dayjs(e.receptionTime).format("YYYY.MM.DD HH:mm") e.receptionTime = dayjs(e.receptionTime).format("YYYY.MM.DD HH:mm")
e.phone = ownerPhone.slice(0, 3) + " " + ownerPhone.slice(3, 7) + " " + ownerPhone.slice(7) e.ownerPhone = ownerPhone.slice(0, 3) + " " + ownerPhone.slice(3, 7) + " " + ownerPhone.slice(7)
e.customerTagName = e.customerTagName ? e.customerTagName.replace(/,/g, '|') : ''
e.maskStatus = false
}) })
this.list[pageNum - 1] = list this.list[pageNum - 1] = list
this.flag = true this.flag = true
...@@ -300,13 +301,8 @@ export default { ...@@ -300,13 +301,8 @@ export default {
}, },
changeIndex (index, isType = false) { changeIndex (index, isType = false) {
if (this.dateIndex == index && !isType) return if (this.dateIndex == index && !isType) return
this.flag = false
this.nothing = false
this.total = 0
this.list = []
this.pageNum = 1
this.dateIndex = index this.dateIndex = index
this.getReceptionList() this.refresh()
}, },
pageonReachBottom () { pageonReachBottom () {
let { pageNum, total, nothing, pageSize } = this let { pageNum, total, nothing, pageSize } = this
...@@ -347,15 +343,15 @@ export default { ...@@ -347,15 +343,15 @@ export default {
longPress (item, index, ind) { longPress (item, index, ind) {
if (this.firstIndex == 1 || item.maskStatus) return if (this.firstIndex == 1 || item.maskStatus) return
this.list[index][ind].maskStatus = true this.list[index][ind].maskStatus = true
this.dateKey = Date.now() this.$forceUpdate()
}, },
closeMask (index, ind) { closeMask (index, ind) {
this.list[index][ind].maskStatus = false this.list[index][ind].maskStatus = false
this.dateKey = Date.now() this.switchDel(index, ind, false)
}, },
switchDel (index, ind, result) { switchDel (index, ind, result) {
this.list[index][ind].showDel = result this.list[index][ind].showDel = result
this.dateKey = Date.now() this.$forceUpdate()
}, },
editItem (item) { editItem (item) {
this.customerId = item.id || '' this.customerId = item.id || ''
...@@ -363,10 +359,12 @@ export default { ...@@ -363,10 +359,12 @@ export default {
}, },
async delItem (id, index, ind) { async delItem (id, index, ind) {
try { try {
await uni.$api.customerApi.delCustomerFile({ id }) const res = await uni.$api.customerApi.delCustomerFile({ id })
if (res) {
this.list[index].splice(ind, 1) this.list[index].splice(ind, 1)
this.dateKey = Date.now() this.$forceUpdate()
this.$refs.successRef.open() this.$refs.successRef.open()
}
} catch (error) { } catch (error) {
uni.showToast({ uni.showToast({
title: error, title: error,
...@@ -376,10 +374,11 @@ export default { ...@@ -376,10 +374,11 @@ export default {
} }
}, },
jumpDetail (id) { jumpDetail (id) {
if (this.firstIndex == 1) return
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/customerDetail?id=${id}`, url: `/pages/common/customerDetail?id=${id}`,
animationType: 'pop-in', animationType: 'pop-in',
animationDuration: 200 animationDuration: 100
}) })
} }
} }
...@@ -449,6 +448,19 @@ export default { ...@@ -449,6 +448,19 @@ export default {
.hide-record { .hide-record {
opacity: 0; opacity: 0;
} }
.show-record {
opacity: 1;
position: relative;
animation: show-box 0.15s forwards;
}
@keyframes show-box {
0% {
left: 100%;
}
100% {
left: 0;
}
}
.record-list { .record-list {
height: calc(100% - 248rpx); height: calc(100% - 248rpx);
position: relative; position: relative;
...@@ -524,16 +536,20 @@ export default { ...@@ -524,16 +536,20 @@ export default {
height: 100%; height: 100%;
background: rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.4);
border-radius: 16rpx; border-radius: 16rpx;
opacity: 0;
pointer-events: none;
&-close { &-close {
position: absolute; position: absolute;
right: 16rpx; right: 16rpx;
top: 16rpx; top: 16rpx;
z-index: 8;
} }
&-box { &-box {
width: 100%; width: 100%;
height: 100%; height: 100%;
justify-content: center; justify-content: center;
gap: 0 96rpx; gap: 0 96rpx;
.mask-item { .mask-item {
font-size: 26rpx; font-size: 26rpx;
color: #ffffff; color: #ffffff;
...@@ -552,6 +568,7 @@ export default { ...@@ -552,6 +568,7 @@ export default {
color: #ffffff; color: #ffffff;
line-height: 36rpx; line-height: 36rpx;
flex-direction: column; flex-direction: column;
animation: opacity-0-1 0.5s forwards;
.btns { .btns {
justify-content: center; justify-content: center;
gap: 0 16rpx; gap: 0 16rpx;
...@@ -574,6 +591,10 @@ export default { ...@@ -574,6 +591,10 @@ export default {
} }
} }
} }
.show-mask {
pointer-events: auto;
opacity: 1;
}
} }
} }
} }
...@@ -645,8 +666,8 @@ export default { ...@@ -645,8 +666,8 @@ export default {
background: #ffffff; background: #ffffff;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
transition: all 0.15s;
border-radius: 16rpx; border-radius: 16rpx;
transition: all 0.15s;
} }
} }
} }
...@@ -668,4 +689,12 @@ export default { ...@@ -668,4 +689,12 @@ export default {
padding: 50rpx 0; padding: 50rpx 0;
font-size: 24rpx; font-size: 24rpx;
} }
@keyframes opacity-0-1 {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style> </style>
<template> <template>
<view :class="['fixed-page',{'show-box':show}]"> <view :class="['fixed-page',{'show-box':show}]">
<view :class="['customer-info-box']"> <view :class="['customer-info-box',backClass]">
<view class="nav-bar"> <view class="nav-bar">
<view <view
class="back" class="back"
...@@ -14,10 +14,7 @@ ...@@ -14,10 +14,7 @@
</view> </view>
客户档案 客户档案
</view> </view>
<view <view class="form-box flex">
class="form-box flex"
:key="dateKey"
>
<template v-for="(i,index) in customerForm"> <template v-for="(i,index) in customerForm">
<view <view
class="form-item flex" class="form-item flex"
...@@ -36,6 +33,8 @@ ...@@ -36,6 +33,8 @@
v-model="customerInfo[i.valueKey]" v-model="customerInfo[i.valueKey]"
:class="['input',{error:i.error}]" :class="['input',{error:i.error}]"
placeholder="请选择" placeholder="请选择"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
/> />
</template> </template>
<template v-else-if="i.type == 'date'"> <template v-else-if="i.type == 'date'">
...@@ -45,6 +44,7 @@ ...@@ -45,6 +44,7 @@
:start="startDate" :start="startDate"
:end="endDate" :end="endDate"
@change="bindDateChange" @change="bindDateChange"
:value="customerInfo[i.valueKey]"
> >
<view :class="['select flex',{placeholderStyle:!customerInfo[i.valueKey]}]"> <view :class="['select flex',{placeholderStyle:!customerInfo[i.valueKey]}]">
<view class="value text-hide">{{customerInfo[i.valueKey] ||'请选择'}}</view> <view class="value text-hide">{{customerInfo[i.valueKey] ||'请选择'}}</view>
...@@ -98,8 +98,19 @@ ...@@ -98,8 +98,19 @@
<reception-sence <reception-sence
ref="receptionSceneVisible" ref="receptionSceneVisible"
@select="handleSelect($event,'receptionSceneVisible')" @select="handleSelect($event,'receptionSceneVisible')"
:customerInfo="customerInfo"
></reception-sence> ></reception-sence>
</view> </view>
<uni-popup
ref="successRef"
type="message"
>
<uni-popup-message
type="success"
message="数据保存成功"
:duration="1500"
></uni-popup-message>
</uni-popup>
</view> </view>
</template> </template>
...@@ -138,7 +149,7 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -138,7 +149,7 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
}, },
{ {
label: '接待场景', label: '接待场景',
valueKey: 'receptionSceneString', valueKey: 'receptionSceneName',
key: 'receptionScene', key: 'receptionScene',
type: 'select', type: 'select',
required: true, required: true,
...@@ -167,25 +178,23 @@ export default { ...@@ -167,25 +178,23 @@ export default {
name: 'CustomerInfo', name: 'CustomerInfo',
components: { CarBrands, CustomerTags, ReceptionSence }, components: { CarBrands, CustomerTags, ReceptionSence },
watch: { watch: {
customerId: {
immediate: true,
handler (newval) {
if (newval) this.findVisitsInfo(newval)
}
},
show: { show: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
if (!newval) return
this.$store.dispatch("clearCustomerInfo");
this.$store.dispatch("clearHistory")
this.customerForm = JSON.parse(JSON.stringify(default_customerForm)) this.customerForm = JSON.parse(JSON.stringify(default_customerForm))
this.customerInfo = { this.customerInfo = {
ownerName:'', ownerName: '',
ownerPhone:'', ownerPhone: '',
brandModel:'', brandModel: '',
receptionScene:'', receptionScene: '',
arrivalDate:'', arrivalDate: '',
customerTagName:'', customerTagName: '',
receptionSceneString:'' receptionSceneName: ''
} }
if (this.customerId) this.findVisitsInfo()
} }
} }
...@@ -219,12 +228,12 @@ export default { ...@@ -219,12 +228,12 @@ export default {
}, },
data () { data () {
return { return {
dateKey: Date.now(),
customerForm: [], customerForm: [],
customerInfo: {}, customerInfo: {},
startDate: '', startDate: '',
endDate: '', endDate: '',
customerTag: '' customerTag: '',
backClass: ''
} }
}, },
mounted () { mounted () {
...@@ -232,21 +241,27 @@ export default { ...@@ -232,21 +241,27 @@ export default {
this.endDate = dayjs(dayjs().add(30, 'day')).format("YYYY-MM-DD") this.endDate = dayjs(dayjs().add(30, 'day')).format("YYYY-MM-DD")
}, },
methods: { methods: {
async findVisitsInfo (id) { async findVisitsInfo () {
const res = await uni.$api.customerApi.findVisitsInfo({ const res = await uni.$api.customerApi.findVisitsInfo({
id id: this.customerId
}) })
if (res.customerTag) this.customerTag = res.customerTag if (res.customerTag) this.customerTag = res.customerTag
res.customerTagName = res.customerTagName.replace(/,/g, '|')
res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
this.customerInfo = res this.customerInfo = res
console.log(res) console.log(res)
}, },
back () { back () {
this.backClass = 'backClass'
setTimeout(() => {
this.backClass = ''
this.$emit('update:show', false) this.$emit('update:show', false)
}, 300)
}, },
showPopup (e) { showPopup (e) {
this.$refs[e].open() this.$refs[e].open()
}, },
handleSelect (item, popkey, key) { handleSelect (item, popkey) {
this.$refs[popkey].close() this.$refs[popkey].close()
if (popkey == 'carBrandVisible') { if (popkey == 'carBrandVisible') {
this.$refs.carBrandVisible.close() this.$refs.carBrandVisible.close()
...@@ -260,29 +275,26 @@ export default { ...@@ -260,29 +275,26 @@ export default {
}) })
this.customerInfo.customerTagName = names.join('|') this.customerInfo.customerTagName = names.join('|')
this.customerTag = ids.join(',') this.customerTag = ids.join(',')
} } else {
else { this.customerInfo.receptionSceneName = item.receptionSceneName
this.customerInfo.receptionSceneString = item.receptionSceneName
this.customerInfo.receptionScene = item.id this.customerInfo.receptionScene = item.id
} }
}, },
bindDateChange (e) { bindDateChange (e) {
this.customerInfo.arrivalDate = e.detail.value this.customerInfo.arrivalDate = e.detail.value
}, },
updatedForm () {
this.dateKey = Date.now()
},
async submit () { async submit () {
console.log(this.customerInfo)
if (this.check) return if (this.check) return
try { try {
this.customerForm.map(e => { this.customerForm.map(e => {
e.error = false e.error = false
}) })
let { customerInfo, customerForm, customerTag } = this, let { customerInfo, customerForm, customerTag } = this,
{ shopMerchantId } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo', targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo',
params = { params = {
customerTag customerTag,
merchantId: shopMerchantId
} }
if (!phoneRex.test(customerInfo.ownerPhone)) throw 'ownerPhone' if (!phoneRex.test(customerInfo.ownerPhone)) throw 'ownerPhone'
customerForm.map(e => { customerForm.map(e => {
...@@ -291,7 +303,13 @@ export default { ...@@ -291,7 +303,13 @@ export default {
if (customerInfo.id) params.id = customerInfo.id if (customerInfo.id) params.id = customerInfo.id
params.customerTagName = params.customerTagName.replace(/|/g, ',') params.customerTagName = params.customerTagName.replace(/|/g, ',')
const res = await uni.$api.customerApi[targetApi](params) const res = await uni.$api.customerApi[targetApi](params)
console.log(params) if (res) {
this.$refs.successRef.open()
setTimeout(() => {
this.back()
this.$emit('refresh')
}, 1e3)
}
} catch (error) { } catch (error) {
let index = this.customerForm.findIndex(e => e.key == error) let index = this.customerForm.findIndex(e => e.key == error)
this.customerForm[index].error = true this.customerForm[index].error = true
...@@ -379,6 +397,7 @@ export default { ...@@ -379,6 +397,7 @@ export default {
line-height: 76rpx; line-height: 76rpx;
padding: 0 32rpx !important; padding: 0 32rpx !important;
box-sizing: border-box; box-sizing: border-box;
font-size: 28rpx;
&::placeholder { &::placeholder {
color: #33333333; color: #33333333;
} }
...@@ -422,6 +441,9 @@ export default { ...@@ -422,6 +441,9 @@ export default {
} }
} }
} }
.backClass {
animation: back 0.25s forwards;
}
.popup { .popup {
pointer-events: auto; pointer-events: auto;
} }
...@@ -433,6 +455,14 @@ export default { ...@@ -433,6 +455,14 @@ export default {
left: 240rpx; left: 240rpx;
} }
} }
@keyframes back {
0% {
left: 240rpx;
}
100% {
left: 100%;
}
}
} }
.show-box { .show-box {
......
...@@ -418,7 +418,7 @@ export default { ...@@ -418,7 +418,7 @@ export default {
background: #ffffff; background: #ffffff;
border-radius: 48rpx; border-radius: 48rpx;
margin-top: 48rpx; margin-top: 48rpx;
height: calc(100vh - 440rpx); height: 1112rpx;
margin-right: 66rpx; margin-right: 66rpx;
box-shadow: inset 0 0 16rpx 0 #ffffff; box-shadow: inset 0 0 16rpx 0 #ffffff;
border: 2rpx solid #fff; border: 2rpx solid #fff;
...@@ -472,10 +472,10 @@ export default { ...@@ -472,10 +472,10 @@ export default {
position: relative; position: relative;
z-index: 4; z-index: 4;
} }
.type-1{ .type-1 {
height: calc(100% - 128rpx); height: calc(100% - 128rpx);
margin-top: -48rpx; margin-top: -48rpx;
.list{ .list {
padding-top: 48rpx; padding-top: 48rpx;
} }
} }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
export default { export default {
name: 'ReceptionSence', name: 'ReceptionSence',
props: { props: {
customerInfo:Object
}, },
data () { data () {
return { return {
...@@ -39,11 +40,21 @@ export default { ...@@ -39,11 +40,21 @@ export default {
this.close() this.close()
} }
}, },
watchCustomerInfo: {
immediate: true,
handler (newval) {
console.log(newval)
this.id = newval.receptionScene
}
},
}, },
computed: { computed: {
watchStatus () { watchStatus () {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
watchCustomerInfo() {
return this.customerInfo
},
}, },
mounted () { mounted () {
}, },
......
<template> <template>
<view>案例详情</view> <view class="case-box">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
家庭车主的延保套餐营销案
</view>
<view class="case-content">
<view class="
left-menu">
<view class="title">方案目录</view>
<scroll-view
scroll-y
class="scroll"
>
<template v-for="(item,index) in menuList">
<view
class="item"
:key="index"
>
<view
class="name"
:id="item.id"
>{{item.name}}</view>
<template v-if="item.children && item.children.length">
<template v-for="(i,j) in item.children">
<view
class="name"
:id="i.id"
:key="j"
>
<view class="icon"></view>
{{i.name}}
</view>
</template>
</template>
</view>
</template>
</scroll-view>
</view>
<scroll-view
class="right-content"
scroll-y
></scroll-view>
</view>
</view>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { export default {
name: '',
data () { data () {
return { return {
menuList: [{
name: '方案一',
id: '1',
children: [{
name: '子方案一',
id: '1-1'
}, {
name: '子方案二',
id: '1-2'
}, {
name: '子方案三',
id: '1-3'
}]
}, {
name: '方案二',
id: '2'
}, {
name: '方案三',
id: '3'
}, {
name: '方案四',
id: '4'
}, {
name: '方案五',
id: '5'
}, {
} }
]
}
},
onLoad (options) {
console.log(options)
}, },
mounted () { mounted () {
}, },
methods: { methods: {
} }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.case-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: linear-gradient(0deg, #eef3ff 0%, #f3f6ff 100%);
box-sizing: border-box;
padding-top: 176rpx;
.nav-bar {
position: fixed;
width: 100%;
height: 96rpx;
left: 0;
top: 48rpx;
z-index: 9;
text-align: center;
font-weight: 500;
font-size: 32rpx;
color: #1a1a1a;
line-height: 96rpx;
.back {
position: absolute;
left: 0;
top: 0;
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
}
.case-content {
height: calc(100vh - 176rpx);
position: relative;
.left-menu {
position: absolute;
top: 0;
left: 64rpx;
width: 480rpx;
height: 1296rpx;
border-radius: 16rpx;
background-color: #fff;
background-image: url('@/assets/images/common/left-menu.webp');
background-size: 100%;
.title {
padding: 48rpx 48rpx 32rpx;
font-weight: 500;
font-size: 36rpx;
color: #333333;
line-height: 56rpx;
}
.scroll {
height: calc(100% - 136rpx);
padding-left: 48rpx;
.item {
.name {
font-size: 30rpx;
color: #333333b3;
line-height: 40rpx;
display: flex;
align-items: center;
padding-bottom: 48rpx;
.icon {
width: 6rpx;
height: 6rpx;
border-radius: 100%;
background: #33333399;
margin:0 12rpx;
}
}
}
}
}
.right-content {
width: calc(100% - 624rpx);
height: 100%;
margin-left: 624rpx;
background: red;
}
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template>
<MessageBox
ref="packageVisible"
position="bottom"
:isFooter="false"
title="请选择适用套餐"
:maxHeight="1000"
@close="$emit('close')"
>
<view class="search-box">
<view class="search-input">
<template v-if="!edit">
<view
:class="['input', `${searchValue ? '' : 'placeholder'}`]"
@click="openInput"
>
<template v-if="searchValue">
{{searchValue}}
</template>
<template v-else>
请输入关键字搜索
<view class="sprite-icon icon-search"></view>
</template>
</view>
</template>
<template v-else>
<input
type="text"
class="input"
v-model="searchValue"
:focus='inputFocus'
confirm-type="search"
@confirm="search"
/>
</template>
</view>
<template v-if="searchValue">
<view
class="clear"
@click="clear"
>
<uni-icons
type="closeempty"
:size="16"
color="#1A1A1A"
></uni-icons>
</view>
</template>
</view>
<view class="select-box">
<view
class="select-item"
:class="{ checked: salesUuid == item.uuid }"
@click="handleSelect(item)"
v-for="(item, index) in employeeList"
:key="index"
>
{{ item.staffName }}
</view>
</view>
</MessageBox>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Employee',
props: {
},
data () {
return {
searchValue: '',
edit: false,
}
},
watch: {
watchStatus: {
immediate: true,
handler (newval) {
this.close()
}
},
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
salesUuid () {
return this.$store.state.user.customerInfo.salesUuid
},
employeeList () {
return this.$store.state.user.employeeList
}
},
mounted () {
},
methods: {
search () {
this.edit = false
console.log(this.searchValue)
},
openInput () {
this.edit = true
this.inputFocus = true
},
open () {
this.$refs.packageVisible.open()
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo;
/**获取销售人员 */
uni.$api.commonApi
.getEmployeeList({
merchantId: shopMerchantId,
})
.then((res) => {
this.$store.dispatch("setEmployeeList", res);
uni.$storage.set("employeeList", res || []);
})
},
handleSelect (item) {
this.close();
this.$emit('select', item)
},
close () {
this.$emit('close')
this.$refs?.packageVisible?.close()
},
clear () {
this.searchValue = ''
this.search()
}
}
}
</script>
<style scoped lang='scss'>
.search-box {
margin: 32rpx 0;
position: relative;
z-index: 2;
.search-input {
width: 100%;
height: 80rpx;
background: #ffffff;
border: 3rpx solid #A8C1FF;;
border-radius: 16rpx;
box-sizing: border-box;
color: #333;
padding: 0 24rpx;
font-size: 28rpx;
position: relative;
.input {
display: flex;
align-items: center;
height: 100%;
width: 100%;
justify-content: center;
text-align: center;
font-size: 28rpx;
}
.icon-search {
margin-left: 16rpx;
}
.placeholder {
font-size: 28rpx;
color: #999999;
}
}
.clear {
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
padding: 0 32rpx;
height: 100%;
display: flex;
align-items: center;
}
}
.select-box {
margin: 32rpx 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
overflow-y: scroll;
max-height: 50vh;
padding-bottom: 60rpx;
.select-item {
text-align: center;
height: 68rpx;
line-height: 68rpx;
opacity: 1;
border: 2rpx solid #dce0e6;
color: #292d33;
font-size: 28rpx;
border-radius: 8rpx;
&.checked {
border: 2rpx solid #292d33;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -13,26 +13,138 @@ ...@@ -13,26 +13,138 @@
</view> </view>
车主详情 车主详情
</view> </view>
<view class="start flex"> <view class="customer-box box">
<view class="sprite-icon icon-detail-start"></view>开始接待 <view class="title">车主信息</view>
<view class="customer-info">
<template v-for="(item, index) in customerForm">
<view
class="item flex"
:key="index"
>
<view class="label">{{item.label}}</view>
<view class="value text-hide">{{customerInfo[item.key]}}</view>
</view> </view>
<view class="customer-box"> </template>
</view> </view>
</view> </view>
<view class="case-box box">
<view class="title flex">
营销话术方案
<view
:class="['search-btn flex',{'arrow-popup':arrowPopup}]"
@click="showPopup"
>家庭车主的延保套餐营销案</view>
</view>
<view class="case-list">
<template v-for="(item, index) in 20">
<view
class="case-item"
:key="index"
@click="jumpDetail(item)"
>
<image
class="img"
src="http://192.168.3.233:8090/uploads/user/avatar/25/avatar.png"
></image>
<view class="case-info">
<view class="case-name text-hide">家庭车主的延保套餐营销案</view>
<template v-for="(i,ind) in caseInfo">
<view
class="case-text flex"
:key="ind"
>
<view class="case-label">{{i.label}}:</view>
<view :class="['case-value',i.class]">M5原厂延保MAX套餐(4年)、M7原厂延保MAX套餐(4年)</view>
</view>
</template>
</view>
</view>
</template>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
</view>
</view>
<package-popup
ref="packageVisible"
@select="handleSearch"
@close="arrowPopup = false"
></package-popup>
</view>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import dayjs from 'dayjs'
import PackagePopup from './components/PackagePopup.vue'
export default { export default {
name: '', components: {
PackagePopup
},
data () { data () {
return { return {
customerInfo: {} customerForm: [{
label: '车主姓名',
key: 'ownerName',
},
{
label: '车主电话',
key: 'ownerPhone',
},
{
label: '品牌车型',
key: 'brandModel',
},
{
label: '接待场景',
key: 'receptionSceneName',
},
{
label: '到店日期',
key: 'arrivalDate',
},
{
label: '客户标签',
key: 'customerTagName',
}],
caseInfo: [
{
label: '业务场景',
key: 'ownerPhone',
class: 'text-hide'
},
{
label: '客户类型',
key: 'brandModel',
class: 'text-hide'
},
{
label: '适用套餐',
key: 'receptionSceneName',
class: 'text-two-line'
},
],
customerInfo: {},
arrowPopup: false,
nothing: true
} }
}, },
onLoad (options) { onLoad (options) {
console.log(options) if (options.id) this.findVisitsInfo(options.id)
this.findVisitsInfo(options.id) else {
uni.showToast({
title: '客户id为空',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 200
})
}, 1e3)
}
}, },
mounted () { mounted () {
}, },
...@@ -41,13 +153,27 @@ export default { ...@@ -41,13 +153,27 @@ export default {
const customerInfo = await uni.$api.customerApi.findVisitsInfo({ const customerInfo = await uni.$api.customerApi.findVisitsInfo({
id id
}) })
customerInfo.customerTagName = customerInfo.customerTagName.replace(/,/g, '|')
customerInfo.arrivalDate = dayjs(customerInfo.arrivalDate).format("YYYY.MM.DD")
this.customerInfo = customerInfo this.customerInfo = customerInfo
}, },
showPopup () {
this.arrowPopup = true
this.$refs.packageVisible.open()
},
handleSearch (e) {
},
back () { back () {
uni.navigateBack({ uni.navigateBack({
delta: 1, delta: 1,
animationType: 'pop-out', animationType: 'pop-out',
animationDuration: 200 animationDuration: 100
})
},
jumpDetail(item){
uni.navigateTo({
url: `/pages/common/caseDetail?`
}) })
} }
} }
...@@ -62,7 +188,7 @@ export default { ...@@ -62,7 +188,7 @@ export default {
background-image: url('@/assets/images/common/page-bg.webp'); background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%; background-size: 100%;
box-sizing: border-box; box-sizing: border-box;
padding-top: 160rpx; padding-top: 176rpx;
.nav-bar { .nav-bar {
position: fixed; position: fixed;
width: 100%; width: 100%;
...@@ -86,28 +212,118 @@ export default { ...@@ -86,28 +212,118 @@ export default {
justify-content: center; justify-content: center;
} }
} }
.start { .box {
width: 2218rpx; width: 2218rpx;
height: 200rpx;
margin: 0 auto;
background-image: url('@/assets/images/common/detail-btn.webp');
background-size: 100%;
font-weight: 700;
font-size: 48rpx;
color: #ffffff;
justify-content: center;
.sprite-icon {
margin-right: 32rpx;
}
}
.customer-box {
width: 2218rpx;
height: 1112rpx;
background: #ffffff59; background: #ffffff59;
box-shadow: inset 0 0 16rpx 0 #ffffff; box-shadow: inset 0 0 16rpx 0 #ffffff;
border-radius: 48rpx; border-radius: 48rpx;
backdrop-filter: blur(8rpx); backdrop-filter: blur(8rpx);
margin: 32rpx auto 0; margin: 0 auto;
box-sizing: border-box;
.title {
font-weight: 500;
font-size: 32rpx;
color: #333333;
line-height: 44rpx;
padding: 32rpx 48rpx 28rpx;
.search-btn {
margin-left: auto;
position: relative;
&::after {
content: '';
display: block;
border: 16rpx solid transparent;
border-left-width: 12rpx;
border-right-width: 12rpx;
border-top-color: #000000e6;
position: relative;
top: 8rpx;
margin-left: 20rpx;
transition: all 0.15s;
}
}
.arrow-popup {
&::after {
transform: rotate(180deg);
top: -8rpx;
}
}
}
}
.customer-box {
height: 292rpx;
margin-bottom: 32rpx;
.customer-info {
display: flex;
flex-wrap: wrap;
padding: 0 48rpx;
.item {
width: 50%;
flex-shrink: 0;
font-size: 28rpx;
margin-bottom: 12rpx;
line-height: 44rpx;
.label {
color: #292d3399;
width: 160rpx;
flex-shrink: 0;
}
.value {
color: #292d33;
}
}
}
}
.case-box {
height: 1004rpx;
padding: 0 !important;
.case-list {
display: flex;
flex-wrap: wrap;
gap: 32rpx 46rpx;
height: calc(100% - 104rpx);
overflow-y: auto;
padding: 0 48rpx;
.case-item {
width: 496rpx;
height: 588rpx;
background: #ffffff;
box-shadow: 0 8rpx 24rpx 0 #2c66f71a;
border-radius: 16rpx;
.img {
width: 100%;
height: 324rpx;
}
.case-name {
font-weight: 500;
font-size: 28rpx;
color: #333333;
line-height: 48rpx;
padding: 16rpx 32rpx 8rpx;
} }
.case-text {
align-items: flex-start;
font-size: 24rpx;
color: #666666;
line-height: 40rpx;
padding: 0 32rpx;
margin-bottom: 2rpx;
}
.case-label {
width: 120rpx;
flex-shrink: 0;
}
}
}
}
}
.end-text {
width: 100%;
text-align: center;
color: #999;
text-align: center;
padding: 50rpx 0;
font-size: 24rpx;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!