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