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 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2024-09-06 10:11:03
* @Date: 2024-09-06 10:11:03
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2024-09-12 1
0:15:21
* @LastEditTime: 2024-09-12 1
5:25:12
-->
-->
<
template
>
<
template
>
<view>
<view>
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
:key=
"index"
:key=
"index"
>
>
<view
:class=
"['label',
{required:i.required}]">
{{
i
.
label
}}
</view>
<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'"
>
<template
v-if=
"i.type == 'input'"
>
<input
<input
:type=
"i.inputType"
:type=
"i.inputType"
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
v-model=
"customerInfo[i.key]"
v-model=
"customerInfo[i.key]"
class=
"input"
class=
"input"
:placeholder=
"i.placeholder"
:placeholder=
"i.placeholder"
:disabled=
"
customerType == 0
"
:disabled=
"
pageParams.received
"
@
input=
"inputCustomer"
@
input=
"inputCustomer"
placeholder-style=
"color:#c9c9c9;"
placeholder-style=
"color:#c9c9c9;"
/>
/>
...
@@ -93,38 +93,30 @@
...
@@ -93,38 +93,30 @@
</view>
</view>
</
template
>
</
template
>
<
template
v-else
>
<
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
<image
class=
"qr-code-img
"
src=
"@/assets/images/boutique/no-data.webp
"
:src=
"pageParams.QRURL
"
class=
"no-data-img
"
/>
/>
</
template
>
<view>
填写客户信息后点击
</view>
<tempalate
v-else
>
<view>
生成专属二维码」生成券码
</view>
<view
class=
"no-data"
>
</view>
<image
src=
"@/assets/images/boutique/no-data.webp"
class=
"no-data-img"
/>
<view>
填写客户信息后点击
</view>
<view>
生成专属二维码」生成券码
</view>
</view>
</tempalate>
</
template
>
</
template
>
</template>
</template>
<
template
v-else
>
<
template
v-else
>
<!--
<vue-qr
<image
ref=
"qrCode"
class=
"qr-code-img"
:margin=
"10"
:src=
"pageParams.customerQr"
:text=
"pageParams.customerCouponId"
/>
colorDark=
"black"
colorLight=
"#F9F9F9"
:size=
"200"
></vue-qr>
-->
</
template
>
</
template
>
</view>
</view>
<view
<view
class=
"ok-tips"
class=
"ok-tips"
v-if=
"pageParams.received"
v-if=
"
customerType == 1 &&
pageParams.received"
>
>
<view>
车主已领取该礼券
</view>
<view>
车主已领取该礼券
</view>
<view>
请前往客户邀约列表查看
</view>
<view>
请前往客户邀约列表查看
</view>
...
@@ -188,7 +180,7 @@ const formObject_boutique = [{
...
@@ -188,7 +180,7 @@ const formObject_boutique = [{
key
:
"customerName"
,
key
:
"customerName"
,
type
:
"input"
,
type
:
"input"
,
inputType
:
"text"
,
inputType
:
"text"
,
maxlength
:
5
0
,
maxlength
:
2
0
,
placeholder
:
'请输入姓名'
,
placeholder
:
'请输入姓名'
,
required
:
true
required
:
true
},
},
...
@@ -227,10 +219,6 @@ const formObject_boutique = [{
...
@@ -227,10 +219,6 @@ const formObject_boutique = [{
export
default
{
export
default
{
name
:
'CouponPop'
,
name
:
'CouponPop'
,
props
:
{
props
:
{
customerType
:
{
type
:
Number
,
default
:
1
},
carInfo
:
{
carInfo
:
{
type
:
Object
,
type
:
Object
,
default
:
()
=>
({})
default
:
()
=>
({})
...
@@ -242,15 +230,29 @@ export default {
...
@@ -242,15 +230,29 @@ export default {
immediate
:
true
,
immediate
:
true
,
handler
(
newval
)
{
handler
(
newval
)
{
console
.
log
(
newval
,
'carModel'
)
console
.
log
(
newval
,
'carModel'
)
this
.
customerInfo
=
newval
this
.
customerInfo
=
Object
.
assign
(
this
.
customerInfo
,
newval
)
this
.
pageParams
.
showDetail
=
false
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
:
{
computed
:
{
watchCustomerInfo
()
{
watchCustomerInfo
()
{
return
this
.
$store
.
state
.
user
.
customerInfo
return
this
.
$store
.
state
.
user
.
customerInfo
},
},
watchStatus
()
{
return
this
.
$store
.
state
.
user
.
historyStatus
},
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -265,9 +267,11 @@ export default {
...
@@ -265,9 +267,11 @@ export default {
QRURL
:
''
,
QRURL
:
''
,
showDetail
:
false
,
showDetail
:
false
,
clickFlag
:
false
,
clickFlag
:
false
,
customerCouponId
:
''
customerCouponId
:
''
,
customerQr
:
''
},
},
isCheck
:
false
isCheck
:
false
,
customerType
:
1
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -302,7 +306,6 @@ export default {
...
@@ -302,7 +306,6 @@ export default {
let
item
=
arr
.
find
(
e
=>
e
.
couponType
==
1
),
let
item
=
arr
.
find
(
e
=>
e
.
couponType
==
1
),
item2
=
arr
.
find
(
e
=>
e
.
couponType
==
18
)
item2
=
arr
.
find
(
e
=>
e
.
couponType
==
18
)
if
(
!
this
.
pageParams
.
couponId
)
{
if
(
!
this
.
pageParams
.
couponId
)
{
console
.
log
(
1111111111111
)
if
(
item
)
this
.
chooseCoupon
(
item
)
//默认填入类型为「太阳膜」类型
if
(
item
)
this
.
chooseCoupon
(
item
)
//默认填入类型为「太阳膜」类型
else
if
(
item2
)
this
.
chooseCoupon
(
item2
)
//次选填入「精品」类型
else
if
(
item2
)
this
.
chooseCoupon
(
item2
)
//次选填入「精品」类型
else
this
.
chooseCoupon
(
arr
[
0
])
// 无此两种类型情况默认带入任意类型礼券
else
this
.
chooseCoupon
(
arr
[
0
])
// 无此两种类型情况默认带入任意类型礼券
...
@@ -321,6 +324,7 @@ export default {
...
@@ -321,6 +324,7 @@ export default {
console
.
log
(
item
,
'----------'
)
console
.
log
(
item
,
'----------'
)
this
.
pageParams
.
couponId
=
item
.
id
this
.
pageParams
.
couponId
=
item
.
id
this
.
customerInfo
.
couponTypeName
=
item
.
couponTypeName
this
.
customerInfo
.
couponTypeName
=
item
.
couponTypeName
this
.
$store
.
dispatch
(
'setCustomerInfo'
,
this
.
customerInfo
)
this
.
$refs
.
couponBoxVisible
.
close
()
this
.
$refs
.
couponBoxVisible
.
close
()
},
},
showError
(
key
)
{
showError
(
key
)
{
...
@@ -329,13 +333,17 @@ export default {
...
@@ -329,13 +333,17 @@ export default {
return
this
.
errorTip
&&
flag
return
this
.
errorTip
&&
flag
},
},
showPopup
(
e
)
{
showPopup
(
e
)
{
let
{
customerType
}
=
this
let
{
pageParams
}
=
this
if
(
customerType
==
0
)
return
if
(
pageParams
.
received
)
return
this
.
$refs
[
e
].
open
();
this
.
$refs
[
e
].
open
();
},
},
open
()
{
open
(
customerType
,
customerCouponId
)
{
this
.
$refs
.
couponPopup
.
open
()
this
.
$refs
.
couponPopup
.
open
()
this
.
customerType
=
customerType
this
.
pageParams
.
customerCouponId
=
customerCouponId
this
.
init
()
this
.
init
()
const
{
customerName
,
phoneNumber
,
staffName
}
=
this
.
customerInfo
this
.
isCheck
=
customerName
&&
phoneNumber
&&
staffName
},
},
close
()
{
close
()
{
this
.
$refs
.
couponPopup
.
close
()
this
.
$refs
.
couponPopup
.
close
()
...
@@ -377,7 +385,8 @@ export default {
...
@@ -377,7 +385,8 @@ export default {
console
.
log
(
flag
,
this
.
customerInfo
,
this
.
pageParams
)
console
.
log
(
flag
,
this
.
customerInfo
,
this
.
pageParams
)
return
flag
return
flag
},
},
async
createCoupon
()
{
async
createCoupon
()
{
if
(
this
.
pageParams
.
received
)
return
try
{
try
{
console
.
log
(
this
.
pageParams
)
console
.
log
(
this
.
pageParams
)
const
{
pageParams
:
{
clickFlag
,
couponId
},
carInfo
,
customerInfo
}
=
this
,
{
const
{
pageParams
:
{
clickFlag
,
couponId
},
carInfo
,
customerInfo
}
=
this
,
{
...
@@ -409,6 +418,8 @@ export default {
...
@@ -409,6 +418,8 @@ export default {
if
(
code
==
0
)
{
if
(
code
==
0
)
{
if
(
data
)
{
if
(
data
)
{
this
.
pageParams
.
QRURL
=
data
this
.
pageParams
.
QRURL
=
data
clearInterval
(
this
.
pageParams
.
qrTimer
)
this
.
pageParams
.
qrTimer
=
null
this
.
checkCustomerReceivedStatus
(
dayjs
().
format
(
"YYYY-MM-DD HH:mm:ss"
))
this
.
checkCustomerReceivedStatus
(
dayjs
().
format
(
"YYYY-MM-DD HH:mm:ss"
))
uni
.
hideLoading
()
uni
.
hideLoading
()
this
.
pageParams
.
clickFlag
=
false
this
.
pageParams
.
clickFlag
=
false
...
@@ -443,6 +454,8 @@ export default {
...
@@ -443,6 +454,8 @@ export default {
})
})
if
(
res
&&
res
.
total
)
{
if
(
res
&&
res
.
total
)
{
this
.
pageParams
.
received
=
true
this
.
pageParams
.
received
=
true
console
.
log
(
this
.
pageParams
,
'======='
)
this
.
isCheck
=
false
this
.
$emit
(
'reception'
,
{
this
.
$emit
(
'reception'
,
{
item
:
{
item
:
{
customerName
:
customerInfo
.
customerName
,
customerName
:
customerInfo
.
customerName
,
...
@@ -450,7 +463,8 @@ export default {
...
@@ -450,7 +463,8 @@ export default {
customerPhone
:
customerInfo
.
phoneNumber
,
customerPhone
:
customerInfo
.
phoneNumber
,
userId
:
customerInfo
.
salesUuid
,
userId
:
customerInfo
.
salesUuid
,
employeeName
:
customerInfo
.
staffName
,
employeeName
:
customerInfo
.
staffName
,
receiveCouponDate
:
Date
.
now
()
receiveCouponDate
:
Date
.
now
(),
customerCouponId
:
res
.
list
[
0
].
id
,
}
}
})
})
}
}
...
@@ -675,7 +689,7 @@ export default {
...
@@ -675,7 +689,7 @@ export default {
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
.label
{
.label
{
width
:
1
50
rpx
;
width
:
1
85
rpx
;
text-align
:
right
;
text-align
:
right
;
margin-right
:
32
rpx
;
margin-right
:
32
rpx
;
font-size
:
28
rpx
;
font-size
:
28
rpx
;
...
@@ -683,6 +697,7 @@ export default {
...
@@ -683,6 +697,7 @@ export default {
line-height
:
44
rpx
;
line-height
:
44
rpx
;
}
}
.value-text
{
.value-text
{
flex
:
1
;
font-size
:
30
rpx
;
font-size
:
30
rpx
;
color
:
#333333
;
color
:
#333333
;
line-height
:
44
rpx
;
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