Commit 697216b5 by 李伟康

refactor(boutique): 重构发券弹窗并添加客户邀约详情功能

- 修改 CouponPop 组件,增加 title 和 tips 属性
- 更新 Reception 组件,调整发券弹窗的标题和提示文本
- 在 invitation 页面添加客户邀约详情功能,使用 CouponPop 组件显示详情信息
- 优化 invitation 页面的客户列表展示,增加查看按钮和状态位置调整
1 parent d004b8bb

2.33 MB | W: | H:

2.33 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
:is-mask-click="false" :is-mask-click="false"
animation animation
:isFooter="false" :isFooter="false"
:title="customerType == 1 ?'为客户发券' : '客户二维码'" :title="title"
:popupW="1200" :popupW="1200"
:maxHeight="896" :maxHeight="896"
> >
...@@ -132,8 +132,7 @@ ...@@ -132,8 +132,7 @@
class="ok-tips" class="ok-tips"
v-if="customerType == 0" v-if="customerType == 0"
> >
<view>请驻店销售员工打开「生意助手</view> <view>{{tips}}</view>
<view>员工版」小程序扫码核销</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -230,7 +229,9 @@ export default { ...@@ -230,7 +229,9 @@ export default {
type: Object, type: Object,
default: () => ({}) default: () => ({})
}, },
show: Boolean show: Boolean,
title: String,
tips: String
}, },
components: { Employee }, components: { Employee },
watch: { watch: {
...@@ -295,7 +296,7 @@ export default { ...@@ -295,7 +296,7 @@ export default {
}, },
isCheck: false, isCheck: false,
customerType: 1, customerType: 1,
selectKey:Date.now() selectKey: Date.now()
} }
}, },
mounted () { mounted () {
...@@ -355,12 +356,44 @@ export default { ...@@ -355,12 +356,44 @@ export default {
this.$refs[e].open(); this.$refs[e].open();
this.$emit('hideTool') this.$emit('hideTool')
}, },
open (customerType, customerCouponId) { open (customerType, customerInfo) {
this.pageParams.customerQr = ''
this.$refs.couponPopup.open() this.$refs.couponPopup.open()
this.customerType = customerType this.customerType = customerType
if (customerCouponId) { if (customerInfo.customerCouponId) {
this.pageParams.customerCouponId = customerCouponId try {
this.pageParams.customerQr = qrcode.createQrCodeImg(`couponId=${customerCouponId}`, { size: 200 }) uni.showLoading({
mask: true
})
let scene = ''
if (customerInfo.inviteRecordId) {
this.customerInfo = customerInfo
scene= `url=/tabDate/pages/detail/detail&id=${customerInfo.inviteRecordId}`
} else {
let params = encodeURIComponent(`couponId=${customerInfo.customerCouponId}`)
scene = `url=/tabWorkOrder/pages/createOrder/createOrder&scene=${params}`
}
uni.$api.commonApi.createQrcode({
scene,
path: '/pages/loading/loading',
appId: 'wx570d9331f9ace0bd'
}).then(({ data, code, message }) => {
uni.hideLoading()
if (code == 0) {
if (data) {
this.pageParams.customerCouponId = customerInfo.customerCouponId
this.pageParams.customerQr = data
} else throw '生成小程序码失败,请重试!'
} else throw message
})
} catch (error) {
uni.hideLoading()
uni.showToast({
title: error,
icon: 'none'
})
}
} }
this.init() this.init()
try { try {
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<view <view
class="coupon-btn flex" class="coupon-btn flex"
v-if="!isPreview" v-if="!isPreview"
@click="couponPopupRef.open(customerType, customerInfo.customerCouponId)" @click="couponPopupRef.open(customerType, customerInfo)"
>{{couponText}}</view> >{{couponText}}</view>
</view> </view>
</view> </view>
...@@ -107,6 +107,8 @@ ...@@ -107,6 +107,8 @@
@reception="reception" @reception="reception"
:show="show" :show="show"
@hideTool="$emit('hideTool')" @hideTool="$emit('hideTool')"
tips="微信扫码进入客户录单页"
:title="customerType == 1 ?'为客户发券' : '客户小程序码'"
/> />
<risk-informed-box <risk-informed-box
ref="riskInformedPop" ref="riskInformedPop"
......
...@@ -52,10 +52,19 @@ ...@@ -52,10 +52,19 @@
:key="item.id" :key="item.id"
@click="reception(item)" @click="reception(item)"
> >
<view :class="['status flex', 'status_' + formatInvite(item)]">{{ inviteStatus[formatInvite(item)] }}</view> <view
class="detail-btn flex"
@click.stop="openDetail(item)"
>
查看
<div class="sprite-icon icon-detail-btn"></div>
</view>
<view class="top flex">
<view class="name"> <view class="name">
{{ item.customerName }} {{ item.customerName }}
</view> </view>
<view :class="['status flex', 'status_' + formatInvite(item)]">{{ inviteStatus[formatInvite(item)] }}</view>
</view>
<template v-for="(k, ind) in itemObject"> <template v-for="(k, ind) in itemObject">
<view <view
class="info flex" class="info flex"
...@@ -98,12 +107,21 @@ ...@@ -98,12 +107,21 @@
confirmBtnText="确定接待" confirmBtnText="确定接待"
@confirm="jumpPage" @confirm="jumpPage"
></MessageBox> ></MessageBox>
<coupon-pop
ref="couponPopup"
@hideTool="$emit('hideTool')"
title="客户邀约详情"
tips="微信扫码进入客户邀约详情"
/>
</view> </view>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import dayjs from 'dayjs' import dayjs from 'dayjs'
import Record from "@/mixin/record"; import Record from "@/mixin/record";
import CouponPop from './components/CouponPop.vue'
export default { export default {
components: { CouponPop },
mixins: [Record], mixins: [Record],
props: { props: {
show: Boolean, show: Boolean,
...@@ -126,6 +144,11 @@ export default { ...@@ -126,6 +144,11 @@ export default {
chooseItem: {} chooseItem: {}
} }
}, },
computed: {
couponPopupRef () {
return this.$refs.couponPopup
},
},
watch: { watch: {
show: { show: {
handler (val) { handler (val) {
...@@ -212,7 +235,14 @@ export default { ...@@ -212,7 +235,14 @@ export default {
clearCanvas () { clearCanvas () {
this.$refs.invitationCanvas.clearBoard() this.$refs.invitationCanvas.clearBoard()
}, },
openDetail (e) {
this.couponPopupRef.open(0, {
...e,
phoneNumber: e.customerPhone,
carModel: e.carSeriesName,
staffName: e.employeeName
})
}
}, },
} }
</script> </script>
...@@ -329,10 +359,19 @@ export default { ...@@ -329,10 +359,19 @@ export default {
position: relative; position: relative;
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
.status { .detail-btn {
position: absolute; position: absolute;
top: toRpx(24); top: toRpx(24);
right: toRpx(32); right: toRpx(32);
color: #2c66f7;
font-size: toRpx(28);
font-weight: 500;
.sprite-icon {
margin-left: toRpx(8);
}
}
.status {
flex-shrink: 0;
padding: toRpx(4) toRpx(16); padding: toRpx(4) toRpx(16);
border-radius: toRpx(4); border-radius: toRpx(4);
font-weight: 500; font-weight: 500;
...@@ -340,6 +379,7 @@ export default { ...@@ -340,6 +379,7 @@ export default {
justify-content: center; justify-content: center;
background: #fdece9; background: #fdece9;
color: #f24724; color: #f24724;
margin-left: toRpx(16);
&.status_1 { &.status_1 {
background: #fff5e6; background: #fff5e6;
color: #ff9d0a; color: #ff9d0a;
...@@ -362,6 +402,9 @@ export default { ...@@ -362,6 +402,9 @@ export default {
background: #eaf9f1; background: #eaf9f1;
color: #35c376; color: #35c376;
} }
.top {
width: calc(100% - #{toRpx(124)});
}
.name { .name {
font-weight: 500; font-weight: 500;
font-size: toRpx(32); font-size: toRpx(32);
...@@ -369,7 +412,6 @@ export default { ...@@ -369,7 +412,6 @@ export default {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
width: calc(100% - #{toRpx(140)});
} }
.goods-name { .goods-name {
font-weight: 500; font-weight: 500;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!