Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-h5-ailipay
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cbeb5f5f
authored
Jan 08, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
19f3aa4e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
402 additions
and
41 deletions
src/api/shopmallApi.js
src/assets/css/index.scss
src/components/SearchBox.vue
src/mixins/shareMixin.js
src/router/router.js
src/router/routes.js
src/utils/util.js
src/views/coupon/goodsVerification.vue
src/views/coupon/verificationDetail.vue
src/views/coupon/verificationList.vue
src/api/shopmallApi.js
View file @
cbeb5f5
...
@@ -33,4 +33,38 @@ export default {
...
@@ -33,4 +33,38 @@ export default {
data
data
})
})
},
},
/** 分页查询商品订单核销列表(待核销、已核销用查询参数区分) */
getGoodsVerficationList
(
data
=
{})
{
data
.
method
=
'scrm.api.shopmall.wework.order.verfication.page'
data
.
pageSize
=
10
return
window
.
$HTTP
({
url
,
data
})
},
/**根据商城订单核销码获取商城订单详情以备核销 */
getGoodsVerficationDetail
(
verificationCode
)
{
let
data
=
{
method
:
'scrm.api.shopmall.wework.order.detail.toVerfication'
,
verificationCode
:
verificationCode
}
return
window
.
$HTTP
({
url
,
data
})
},
/** 商品订单核销 */
verficationGoods
(
verificationCode
)
{
let
data
=
{
method
:
'scrm.api.shopmall.wework.order.verfication'
,
verificationCode
:
verificationCode
}
return
window
.
$HTTP
({
url
,
data
})
}
}
}
src/assets/css/index.scss
View file @
cbeb5f5
...
@@ -4,7 +4,7 @@ html,
...
@@ -4,7 +4,7 @@ html,
body
.app
{
body
.app
{
color
:
#333333
;
color
:
#333333
;
font-family
:
Arial
,
Helvetica
,
'STHeiti STXihei'
,
'Microsoft YaHei'
,
Tohoma
,
sans-serif
;
font-family
:
Arial
,
Helvetica
,
'STHeiti STXihei'
,
'Microsoft YaHei'
,
Tohoma
,
sans-serif
;
background-color
:
#f
ff
;
background-color
:
#f
7f7f7
;
-webkit-overflow-scrolling
:
touch
;
-webkit-overflow-scrolling
:
touch
;
height
:
100%
;
height
:
100%
;
// overflow: hidden;
// overflow: hidden;
...
...
src/components/SearchBox.vue
View file @
cbeb5f5
...
@@ -27,7 +27,9 @@ export default {
...
@@ -27,7 +27,9 @@ export default {
value
:
0
,
value
:
0
,
option
:
[
option
:
[
{
text
:
'优惠券'
,
value
:
0
},
{
text
:
'优惠券'
,
value
:
0
},
{
text
:
'精品礼券'
,
value
:
1
}
{
text
:
'精品礼券'
,
value
:
1
},
{
text
:
'商品订单'
,
value
:
2
},
{
text
:
'会员服务'
,
value
:
3
}
]
]
}
}
},
},
...
...
src/mixins/shareMixin.js
View file @
cbeb5f5
...
@@ -7,8 +7,7 @@ export default {
...
@@ -7,8 +7,7 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
// if (this.$route.meta.isTab || this.$route.meta.isIndex)
if
(
this
.
$route
.
meta
.
isTab
||
this
.
$route
.
meta
.
isIndex
)
this
.
wxInit
()
this
.
wxInit
()
},
},
methods
:
{
methods
:
{
wxInit
()
{
wxInit
()
{
...
...
src/router/router.js
View file @
cbeb5f5
...
@@ -25,7 +25,7 @@ function createRouter() {
...
@@ -25,7 +25,7 @@ function createRouter() {
return
new
Router
({
return
new
Router
({
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
base
:
process
.
env
.
BASE_URL
,
base
:
process
.
env
.
BASE_URL
,
scrollBehavior
:
function
(
to
,
from
,
savedPosition
)
{
scrollBehavior
:
function
(
to
,
from
,
savedPosition
)
{
return
savedPosition
||
{
x
:
0
,
y
:
0
}
return
savedPosition
||
{
x
:
0
,
y
:
0
}
},
},
routes
routes
...
@@ -41,7 +41,7 @@ router.beforeEach((to, from, next) => {
...
@@ -41,7 +41,7 @@ router.beforeEach((to, from, next) => {
}
}
store
.
commit
(
'SET_LAST_PATH'
,
to
.
name
)
store
.
commit
(
'SET_LAST_PATH'
,
to
.
name
)
/* 路由发生变化修改页面背景色 */
/* 路由发生变化修改页面背景色 */
document
.
documentElement
.
style
.
backgroundColor
=
to
.
meta
.
backgroundColor
||
'#fff'
if
(
to
.
meta
.
backgroundColor
)
document
.
documentElement
.
style
.
backgroundColor
=
to
.
meta
.
backgroundColor
if
(
to
.
matched
.
some
(
recode
=>
recode
.
meta
.
noAuth
))
{
if
(
to
.
matched
.
some
(
recode
=>
recode
.
meta
.
noAuth
))
{
store
.
state
.
app
.
showWindow
=
true
store
.
state
.
app
.
showWindow
=
true
}
else
{
}
else
{
...
@@ -50,8 +50,6 @@ router.beforeEach((to, from, next) => {
...
@@ -50,8 +50,6 @@ router.beforeEach((to, from, next) => {
next
()
next
()
})
})
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export
function
resetRouter
()
{
export
function
resetRouter
()
{
const
newRouter
=
createRouter
()
const
newRouter
=
createRouter
()
...
...
src/router/routes.js
View file @
cbeb5f5
...
@@ -3,20 +3,25 @@ const pages = [
...
@@ -3,20 +3,25 @@ const pages = [
name
:
'coupon'
,
name
:
'coupon'
,
meta
:
{
meta
:
{
isTab
:
true
,
isTab
:
true
,
keepAlive
:
true
,
keepAlive
:
true
backgroundColor
:
'#F7F7F7'
},
},
children
:
[
children
:
[
{
{
name
:
'verificationList'
,
name
:
'verificationList'
,
meta
:
{
meta
:
{
backgroundColor
:
'#F7F7F7
'
title
:
'核销列表
'
}
}
},
},
{
{
name
:
'verificationDetail'
,
name
:
'verificationDetail'
,
meta
:
{
meta
:
{
backgroundColor
:
'#F7F7F7'
title
:
'核销详情'
}
},
{
name
:
'goodsVerification'
,
meta
:
{
title
:
'核销订单'
}
}
}
}
]
]
...
...
src/utils/util.js
View file @
cbeb5f5
...
@@ -161,6 +161,10 @@ const watchPageBack = () => {
...
@@ -161,6 +161,10 @@ const watchPageBack = () => {
}
}
})
})
}
}
/**分转元 */
const
centsToyuan
=
price
=>
{
return
decimal
(
price
/
100
,
2
).
toFixed
(
2
)
}
const
utils
=
{
const
utils
=
{
removeLocalStorage
,
removeLocalStorage
,
setClipboardData
,
setClipboardData
,
...
@@ -174,6 +178,7 @@ const utils = {
...
@@ -174,6 +178,7 @@ const utils = {
setSessionId
,
setSessionId
,
getSessionId
,
getSessionId
,
showLoading
,
showLoading
,
centsToyuan
,
hideLoading
,
hideLoading
,
refreshPage
,
refreshPage
,
touchstart
,
touchstart
,
...
...
src/views/coupon/goodsVerification.vue
0 → 100644
View file @
cbeb5f5
<
template
>
<div
class=
"layout"
v-if=
"flag"
>
<div
class=
"box order"
>
<div
class=
"title"
>
订单信息
</div>
<template
v-for=
"(i,index) in orderObj"
>
<div
class=
"item"
:key=
"index"
>
<div
class=
"label"
>
{{
i
.
label
}}
:
</div>
<div
class=
"value"
>
<template
v-if=
"i.format"
>
{{
i
.
format
(
detail
)
}}
</
template
>
<
template
v-else
>
{{
detail
[
i
.
key
]
||
''
}}
</
template
>
</div>
</div>
</template>
</div>
<div
class=
"box"
>
<div
class=
"title"
>
订单商品
</div>
<div
class=
"subtitle"
>
{{detail.merchantName}}
</div>
<div
class=
"goods-box"
>
<
template
v-for=
"(i,index) in detail.orderGoods"
>
<div
class=
"item flex"
:key=
"index"
>
<img
:src=
"i.goodsImage"
class=
"icon"
>
<div
class=
"info flex"
>
<div
class=
"name"
>
{{
i
.
goodsName
}}
</div>
<div
class=
"price flex"
>
¥
{{
i
.
retailPrice
||
0
}}
<div
class=
"num"
>
x
{{
i
.
goodsNumber
||
1
}}
</div>
</div>
</div>
</div>
</
template
>
</div>
</div>
<div
class=
"box order-price"
>
<div
class=
"title"
>
订单金额
</div>
<div
class=
"flex item"
>
<div
class=
"label"
>
商品总价:
</div>
<div
class=
"value"
>
¥{{price}}
</div>
</div>
<div
class=
"flex item"
>
<div
class=
"label"
>
运费:
</div>
<div
class=
"value"
>
¥{{detail.expressFee}}
</div>
</div>
<div
class=
"total flex item"
>
<div
class=
"label"
>
订单金额:
</div>
<div
class=
"value"
>
<span
class=
"unit"
>
¥
</span>
{{total}}
</div>
</div>
</div>
<div
class=
"btn text-center"
@
click=
"submit"
>
确认核销
</div>
</div>
</template>
<
script
type=
'text/ecmascript-6'
>
import
{
shopmallApi
}
from
'@/api'
export
default
{
name
:
''
,
data
()
{
return
{
flag
:
false
,
detail
:
{},
total
:
0
,
price
:
0
,
orderObj
:
[
{
label
:
'客户姓名'
,
key
:
'customerName'
},
{
label
:
'下单日期'
,
format
(
item
)
{
return
new
Date
(
item
.
createdDate
).
format
(
'yyyy.MM.dd hh:mm'
)
}
},
{
label
:
'订单编号'
,
key
:
'orderCode'
},
{
label
:
'收货地址'
,
key
:
'shipAddress'
},
{
label
:
'订单状态'
,
format
(
item
)
{
return
{
1
:
'待付款'
,
2
:
'已支付'
,
3
:
'已关闭'
,
4
:
'已发货'
,
5
:
'已收货'
,
6
:
'待审核'
,
7
:
'审核通过'
,
8
:
'审核不通过'
,
9
:
'待确认收到退货'
,
10
:
'退款中'
,
11
:
'已退款'
,
12
:
'退款失败'
,
13
:
'待发货'
,
14
:
'待安装'
,
15
:
'已安装'
}[
item
.
orderStatus
]
}
}
]
}
},
mounted
()
{
let
{
verficationCode
}
=
this
.
getParams
()
this
.
showLoading
()
shopmallApi
.
getGoodsVerficationDetail
(
verficationCode
)
.
then
(
res
=>
{
res
.
orderGoods
.
map
(
e
=>
(
this
.
price
+=
e
.
retailPrice
))
this
.
detail
=
res
this
.
flag
=
true
this
.
total
=
this
.
price
+
res
.
expressFee
this
.
hideLoading
()
console
.
log
(
res
)
})
},
methods
:
{
submit
()
{
let
{
verficationCode
}
=
this
.
getParams
()
this
.
showLoading
()
shopmallApi
.
verficationGoods
(
verficationCode
)
.
then
(
res
=>
{
this
.
hideLoading
()
if
(
res
)
this
.
showToast
(
'已核销'
,
()
=>
{
this
.
$router
.
back
()
})
})
}
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.layout
{
padding
:
0
16px
60px
;
.box
{
background
:
linear-gradient
(
180deg
,
#ffffff
0%
,
#ffffff
100%
);
border-radius
:
4px
;
padding
:
12px
;
margin-top
:
10px
;
font-size
:
12px
;
.title
{
font-size
:
16px
;
font-weight
:
500
;
color
:
#282829
;
margin-bottom
:
12px
;
}
.subtitle
{
color
:
#2d2d2e
;
margin-bottom
:
16px
;
}
.goods-box
{
.item
{
margin-bottom
:
20px
;
.icon
{
width
:
80px
;
height
:
80px
;
margin-right
:
10px
;
}
.info
{
width
:
calc
(
100%
-
90px
);
height
:
80px
;
flex-direction
:
column
;
justify-content
:
space-between
;
align-items
:
flex-start
;
.name
{
font-size
:
15px
;
font-weight
:
500
;
color
:
#333333
;
}
.price
{
font-size
:
14px
;
color
:
#3975c6
;
width
:
100%
;
.num
{
margin-left
:
auto
;
color
:
#656566
;
}
}
}
&
:last-of-type
{
margin-bottom
:
0
;
}
}
}
}
.order
{
.item
{
display
:
flex
;
color
:
#282829
;
line-height
:
24px
;
.label
{
width
:
60px
;
}
.value
{
width
:
246px
;
color
:
#656566
;
}
}
}
.order-price
{
.item
{
justify-content
:
space-between
;
font-size
:
12px
;
color
:
#656566
;
line-height
:
30px
;
.value
{
font-weight
:
600
;
font-size
:
14px
;
color
:
#3975c6
;
.unit
{
font-size
:
12px
;
}
}
}
.total
{
margin-bottom
:
2px
;
border-top
:
1px
solid
#e3e3e6
;
}
}
.btn
{
position
:
fixed
;
width
:
343px
;
left
:
50%
;
bottom
:
16px
;
transform
:
translateX
(
-50%
);
height
:
42px
;
font-size
:
14px
;
border-radius
:
21px
;
box-sizing
:
border-box
;
}
}
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/coupon/verificationDetail.vue
View file @
cbeb5f5
<
template
>
<
template
>
<div
<div
class=
"layout"
class=
"layout"
v-if=
"
detail
"
v-if=
"
flag
"
>
>
<div
class=
"title"
>
客户信息
</div>
<div
class=
"title"
>
客户信息
</div>
<div
class=
"box"
>
<div
class=
"box"
>
...
@@ -22,9 +22,9 @@
...
@@ -22,9 +22,9 @@
</div>
</div>
</template>
</template>
</div>
</div>
<div
class=
"title"
>
优惠券信息
</div>
<div
class=
"title"
>
{{detail.discountType == 7?'服务信息':'优惠券信息'}}
</div>
<div
class=
"box"
>
<div
class=
"box"
>
<
template
v-for=
"(i,index) in
coupon
Obj"
>
<
template
v-for=
"(i,index) in
info
Obj"
>
<div
<div
:key=
"index"
:key=
"index"
class=
"item flex"
class=
"item flex"
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
<div
class=
"label"
>
{{
i
.
label
}}
</div>
<div
class=
"label"
>
{{
i
.
label
}}
</div>
<div
class=
"value"
>
<div
class=
"value"
>
<template
v-if=
"i.format"
>
<template
v-if=
"i.format"
>
{{
i
.
format
(
detail
)
}}
<div
v-html=
"i.format(detail)"
></div>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
{{
detail
[
i
.
key
]
||
''
}}
{{
detail
[
i
.
key
]
||
''
}}
...
@@ -40,6 +40,27 @@
...
@@ -40,6 +40,27 @@
</div>
</div>
</div>
</div>
</template>
</template>
<
template
v-if=
"detail.discountType == 7"
>
<div
class=
"item flex"
>
<div
class=
"label"
>
使用限制
</div>
<div
class=
"value flex"
>
<div
class=
"value-btn text-center"
>
已核销
{{
detail
.
usedAmount
}}
次
</div>
<div
class=
"use-type"
>
<template
v-if=
"detail.useType == 0"
>
不限次数
</
template
>
<
template
v-else-if=
"detail.useType == 1"
>
{{
detail
.
effectiveType
>
2
?
''
:
'有效期'
}}
可用
{{
detail
.
useAllAmount
}}
次
</
template
>
<
template
v-else
>
每隔
{{
detail
.
useLimitDays
}}
天
|
可用
{{
detail
.
useAmount
}}
次
</
template
>
</div>
</div>
</div>
</template>
</div>
</div>
<div
<div
class=
"btn text-center"
class=
"btn text-center"
...
@@ -51,29 +72,7 @@
...
@@ -51,29 +72,7 @@
<
script
type=
'text/ecmascript-6'
>
<
script
type=
'text/ecmascript-6'
>
import
{
discountTypeMixin
}
from
'@/mixins'
import
{
discountTypeMixin
}
from
'@/mixins'
import
{
couponApi
}
from
'@/api'
import
{
couponApi
}
from
'@/api'
export
default
{
const
couponObj
=
[
name
:
''
,
mixins
:
[
discountTypeMixin
],
data
()
{
return
{
detail
:
{},
customerObj
:
[
{
label
:
'客户姓名'
,
key
:
'userName'
},
{
label
:
'客户手机号'
,
key
:
'phone'
},
{
label
:
'领取时间'
,
format
(
item
)
{
return
new
Date
(
item
.
receiveTime
).
format
(
'yyyy年MM月dd日'
)
}
}
],
couponObj
:
[
{
{
label
:
'优惠券名称'
,
label
:
'优惠券名称'
,
key
:
'couponName'
key
:
'couponName'
...
@@ -98,21 +97,72 @@ export default {
...
@@ -98,21 +97,72 @@ export default {
return
new
Date
(
item
.
issueDate
).
format
(
'yyyy年MM月dd日'
)
return
new
Date
(
item
.
issueDate
).
format
(
'yyyy年MM月dd日'
)
}
}
}
}
]
const
vipObj
=
[
{
label
:
'所属套餐'
,
key
:
'packageName'
},
{
label
:
'服务名称'
,
key
:
'couponName'
},
{
label
:
'有效期'
,
format
(
item
)
{
let
{
effectiveType
}
=
item
let
str
=
''
if
(
effectiveType
==
1
)
str
=
`
${
item
.
effectiveDays
}
天`
else
if
(
effectiveType
==
1
)
str
=
`
${
new
Date
(
item
.
effectiveStartTime
).
format
(
'yyyy/MM/dd'
)}
~
${
new
Date
(
item
.
effectiveEndTime
).
format
(
'yyyy/MM/dd'
)}
`
else
str
=
'无有效期'
return
str
}
}
]
export
default
{
name
:
''
,
mixins
:
[
discountTypeMixin
],
data
()
{
return
{
detail
:
{},
customerObj
:
[
{
label
:
'客户姓名'
,
key
:
'userName'
},
{
label
:
'客户手机号'
,
key
:
'phone'
},
{
label
:
'领取时间'
,
format
(
item
)
{
return
new
Date
(
item
.
receiveTime
).
format
(
'yyyy年MM月dd日'
)
}
}
],
],
verficationCode
:
''
infoObj
:
[],
verficationCode
:
''
,
flag
:
false
}
}
},
},
mounted
()
{
mounted
()
{
let
{
verficationCode
}
=
this
.
getParams
()
let
{
verficationCode
}
=
this
.
getParams
()
this
.
showLoading
()
couponApi
.
scan
({
verficationCode
}).
then
(
res
=>
{
couponApi
.
scan
({
verficationCode
}).
then
(
res
=>
{
this
.
hideLoading
()
this
.
detail
=
res
this
.
detail
=
res
this
.
infoObj
=
res
.
discountType
==
7
?
vipObj
:
couponObj
this
.
verficationCode
=
verficationCode
this
.
verficationCode
=
verficationCode
this
.
flag
=
true
})
})
},
},
methods
:
{
methods
:
{
submit
()
{
submit
()
{
let
{
verficationCode
}
=
this
let
{
verficationCode
}
=
this
this
.
showLoading
()
couponApi
.
verificationCode
({
verficationCode
}).
then
(
res
=>
{
couponApi
.
verificationCode
({
verficationCode
}).
then
(
res
=>
{
this
.
hideLoading
()
if
(
res
)
if
(
res
)
this
.
showToast
(
'已核销'
,
()
=>
{
this
.
showToast
(
'已核销'
,
()
=>
{
this
.
$router
.
back
()
this
.
$router
.
back
()
...
@@ -147,7 +197,16 @@ export default {
...
@@ -147,7 +197,16 @@ export default {
}
}
.value
{
.value
{
margin-left
:
auto
;
margin-left
:
auto
;
color
:
#d0d0d0
;
color
:
#333333
;
&-btn
{
font-size
:
12px
;
color
:
#3975c6
;
padding
:
0
6px
;
height
:
24px
;
background
:
rgba
(
57
,
117
,
198
,
0.15
);
border-radius
:
4px
;
margin-right
:
10px
;
}
}
}
}
}
}
}
...
...
src/views/coupon/verificationList.vue
View file @
cbeb5f5
This diff is collapsed.
Click to expand it.
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