Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4a145e97
authored
Sep 12, 2024
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交优惠券
1 parent
c8623cbb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
41 deletions
pages/boutique/components/CouponPop.vue
pages/boutique/components/CouponPop.vue
View file @
4a145e9
...
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-09-06 10:11:03
* @LastEditors: huyue
* @LastEditTime: 2024-09-12 1
0:15:21
* @LastEditTime: 2024-09-12 1
5:25:12
-->
<
template
>
<view>
...
...
@@ -31,7 +31,7 @@
:key=
"index"
>
<view
:class=
"['label',
{required:i.required}]">
{{
i
.
label
}}
</view>
<view
:class=
"['value',
{ error: showError(i.key)
&&
i.required },{disabled:
customerType == 0
}]">
<view
:class=
"['value',
{ error: showError(i.key)
&&
i.required },{disabled:
pageParams.received
}]">
<template
v-if=
"i.type == 'input'"
>
<input
:type=
"i.inputType"
...
...
@@ -39,7 +39,7 @@
v-model=
"customerInfo[i.key]"
class=
"input"
:placeholder=
"i.placeholder"
:disabled=
"
customerType == 0
"
:disabled=
"
pageParams.received
"
@
input=
"inputCustomer"
placeholder-style=
"color:#c9c9c9;"
/>
...
...
@@ -93,38 +93,30 @@
</view>
</
template
>
<
template
v-else
>
<template
v-if=
"pageParams.QRURL"
>
<image
v-if=
"pageParams.QRURL"
class=
"qr-code-img"
:src=
"pageParams.QRURL"
/>
<view
v-else
class=
"no-data"
>
<image
class=
"qr-code-img
"
:src=
"pageParams.QRURL
"
src=
"@/assets/images/boutique/no-data.webp
"
class=
"no-data-img
"
/>
</
template
>
<tempalate
v-else
>
<view
class=
"no-data"
>
<image
src=
"@/assets/images/boutique/no-data.webp"
class=
"no-data-img"
/>
<view>
填写客户信息后点击
</view>
<view>
生成专属二维码」生成券码
</view>
</view>
</tempalate>
<view>
填写客户信息后点击
</view>
<view>
生成专属二维码」生成券码
</view>
</view>
</
template
>
</template>
<
template
v-else
>
<!--
<vue-qr
ref=
"qrCode"
:margin=
"10"
:text=
"pageParams.customerCouponId"
colorDark=
"black"
colorLight=
"#F9F9F9"
:size=
"200"
></vue-qr>
-->
<image
class=
"qr-code-img"
:src=
"pageParams.customerQr"
/>
</
template
>
</view>
<view
class=
"ok-tips"
v-if=
"pageParams.received"
v-if=
"
customerType == 1 &&
pageParams.received"
>
<view>
车主已领取该礼券
</view>
<view>
请前往客户邀约列表查看
</view>
...
...
@@ -188,7 +180,7 @@ const formObject_boutique = [{
key
:
"customerName"
,
type
:
"input"
,
inputType
:
"text"
,
maxlength
:
5
0
,
maxlength
:
2
0
,
placeholder
:
'请输入姓名'
,
required
:
true
},
...
...
@@ -227,10 +219,6 @@ const formObject_boutique = [{
export
default
{
name
:
'CouponPop'
,
props
:
{
customerType
:
{
type
:
Number
,
default
:
1
},
carInfo
:
{
type
:
Object
,
default
:
()
=>
({})
...
...
@@ -242,15 +230,29 @@ export default {
immediate
:
true
,
handler
(
newval
)
{
console
.
log
(
newval
,
'carModel'
)
this
.
customerInfo
=
newval
this
.
customerInfo
=
Object
.
assign
(
this
.
customerInfo
,
newval
)
this
.
pageParams
.
showDetail
=
false
}
},
watchStatus
:
{
immediate
:
true
,
handler
(
newval
)
{
console
.
log
(
'重新进入'
,
this
.
pageParams
)
let
item
=
this
.
couponList
.
find
(
e
=>
e
.
couponType
==
1
),
item2
=
this
.
couponList
.
find
(
e
=>
e
.
couponType
==
18
)
if
(
item
)
this
.
chooseCoupon
(
item
)
//默认填入类型为「太阳膜」类型
else
if
(
item2
)
this
.
chooseCoupon
(
item2
)
//次选填入「精品」类型
else
this
.
chooseCoupon
(
this
.
couponList
[
0
])
// 无此两种类型情况默认带入任意类型礼券
}
}
},
computed
:
{
watchCustomerInfo
()
{
return
this
.
$store
.
state
.
user
.
customerInfo
},
watchStatus
()
{
return
this
.
$store
.
state
.
user
.
historyStatus
},
},
data
()
{
return
{
...
...
@@ -265,9 +267,11 @@ export default {
QRURL
:
''
,
showDetail
:
false
,
clickFlag
:
false
,
customerCouponId
:
''
customerCouponId
:
''
,
customerQr
:
''
},
isCheck
:
false
isCheck
:
false
,
customerType
:
1
}
},
mounted
()
{
...
...
@@ -302,7 +306,6 @@ export default {
let
item
=
arr
.
find
(
e
=>
e
.
couponType
==
1
),
item2
=
arr
.
find
(
e
=>
e
.
couponType
==
18
)
if
(
!
this
.
pageParams
.
couponId
)
{
console
.
log
(
1111111111111
)
if
(
item
)
this
.
chooseCoupon
(
item
)
//默认填入类型为「太阳膜」类型
else
if
(
item2
)
this
.
chooseCoupon
(
item2
)
//次选填入「精品」类型
else
this
.
chooseCoupon
(
arr
[
0
])
// 无此两种类型情况默认带入任意类型礼券
...
...
@@ -321,6 +324,7 @@ export default {
console
.
log
(
item
,
'----------'
)
this
.
pageParams
.
couponId
=
item
.
id
this
.
customerInfo
.
couponTypeName
=
item
.
couponTypeName
this
.
$store
.
dispatch
(
'setCustomerInfo'
,
this
.
customerInfo
)
this
.
$refs
.
couponBoxVisible
.
close
()
},
showError
(
key
)
{
...
...
@@ -329,13 +333,17 @@ export default {
return
this
.
errorTip
&&
flag
},
showPopup
(
e
)
{
let
{
customerType
}
=
this
if
(
customerType
==
0
)
return
let
{
pageParams
}
=
this
if
(
pageParams
.
received
)
return
this
.
$refs
[
e
].
open
();
},
open
()
{
open
(
customerType
,
customerCouponId
)
{
this
.
$refs
.
couponPopup
.
open
()
this
.
customerType
=
customerType
this
.
pageParams
.
customerCouponId
=
customerCouponId
this
.
init
()
const
{
customerName
,
phoneNumber
,
staffName
}
=
this
.
customerInfo
this
.
isCheck
=
customerName
&&
phoneNumber
&&
staffName
},
close
()
{
this
.
$refs
.
couponPopup
.
close
()
...
...
@@ -377,7 +385,8 @@ export default {
console
.
log
(
flag
,
this
.
customerInfo
,
this
.
pageParams
)
return
flag
},
async
createCoupon
()
{
async
createCoupon
()
{
if
(
this
.
pageParams
.
received
)
return
try
{
console
.
log
(
this
.
pageParams
)
const
{
pageParams
:
{
clickFlag
,
couponId
},
carInfo
,
customerInfo
}
=
this
,
{
...
...
@@ -409,6 +418,8 @@ export default {
if
(
code
==
0
)
{
if
(
data
)
{
this
.
pageParams
.
QRURL
=
data
clearInterval
(
this
.
pageParams
.
qrTimer
)
this
.
pageParams
.
qrTimer
=
null
this
.
checkCustomerReceivedStatus
(
dayjs
().
format
(
"YYYY-MM-DD HH:mm:ss"
))
uni
.
hideLoading
()
this
.
pageParams
.
clickFlag
=
false
...
...
@@ -443,6 +454,8 @@ export default {
})
if
(
res
&&
res
.
total
)
{
this
.
pageParams
.
received
=
true
console
.
log
(
this
.
pageParams
,
'======='
)
this
.
isCheck
=
false
this
.
$emit
(
'reception'
,
{
item
:
{
customerName
:
customerInfo
.
customerName
,
...
...
@@ -450,7 +463,8 @@ export default {
customerPhone
:
customerInfo
.
phoneNumber
,
userId
:
customerInfo
.
salesUuid
,
employeeName
:
customerInfo
.
staffName
,
receiveCouponDate
:
Date
.
now
()
receiveCouponDate
:
Date
.
now
(),
customerCouponId
:
res
.
list
[
0
].
id
,
}
})
}
...
...
@@ -675,7 +689,7 @@ export default {
display
:
flex
;
align-items
:
center
;
.label
{
width
:
1
50
rpx
;
width
:
1
85
rpx
;
text-align
:
right
;
margin-right
:
32
rpx
;
font-size
:
28
rpx
;
...
...
@@ -683,6 +697,7 @@ export default {
line-height
:
44
rpx
;
}
.value-text
{
flex
:
1
;
font-size
:
30
rpx
;
color
:
#333333
;
line-height
:
44
rpx
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment