Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
mallapp
Commits
448ded4d
Commit
448ded4d
authored
Mar 07, 2022
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2
parent
456a03bd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
177 additions
and
147 deletions
+177
-147
buy.vue
pages/coffee/buy.vue
+3
-1
confirmDialog.vue
pages/coffee/confirmDialog.vue
+0
-88
confirmOrder.vue
pages/coffee/confirmOrder.vue
+10
-7
index.vue
pages/coffee/index.vue
+81
-27
myOrder.vue
pages/coffee/myOrder.vue
+2
-2
orderDetail.vue
pages/coffee/orderDetail.vue
+66
-8
coffeeConfirmDialog.vue
pages/user-center/components/coffeeConfirmDialog.vue
+7
-7
user-center.vue
pages/user-center/user-center.vue
+8
-7
No files found.
pages/coffee/buy.vue
View file @
448ded4d
<
template
>
<view
class=
"coffeeBuy"
>
<view
class=
"coffeeBuy"
v-if=
"showPage"
>
<view
class=
"topBox"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/banner2.png"
mode=
"widthFix"
class=
"bg"
></image>
...
...
@@ -57,6 +57,7 @@
export
default
{
data
()
{
return
{
showPage
:
false
,
statusNavBar
:
0
,
pageData
:
{},
menuList
:
[{
...
...
@@ -97,6 +98,7 @@
data
:
{}
},
res
=>
{
this
.
showPage
=
true
this
.
pageData
=
res
.
data
}
);
...
...
pages/coffee/confirmDialog.vue
deleted
100644 → 0
View file @
456a03bd
<
template
>
<view>
<u-popup
v-model=
"showDig"
:maskCloseAble=
"false"
mode=
"center"
@
close=
"closePopup"
>
<view
style=
"margin: 60rpx;"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup3.png"
mode=
"widthFix"
style=
"width:546rpx;height:auto;display: block;"
></image>
<view
class=
"viewBox"
>
<view
class=
"cup"
>
1杯
</view>
<view
class=
"successText"
>
核销成功
</view>
<view
class=
"user"
>
小猪
</view>
</view>
<view
class=
"closeIcon"
@
click=
"closePopup"
>
<u-icon
name=
"close"
color=
"#fefefe"
size=
"60"
></u-icon>
</view>
</view>
</u-popup>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
show
:{
type
:
Boolean
,
default
:
false
,
}
},
watch
:{
show
(
val
){
console
.
log
(
36
,
val
)
this
.
showDig
=
val
}
},
data
()
{
return
{
showDig
:
false
}
},
methods
:
{
closePopup
()
{
console
.
log
(
'close'
,
this
.
showDig
)
this
.
showDig
=
false
this
.
$emit
(
"close"
);
},
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
.viewBox
{
width
:
546rpx
;
height
:
286rpx
;
background-color
:
#FFFFFF
;
border-radius
:
0rpx
0rpx
24rpx
24rpx
;
padding-top
:
40rpx
;
.cup
{
font-size
:
40rpx
;
font-weight
:
800
;
color
:
#3E766E
;
text-align
:
center
;
margin-bottom
:
6rpx
;
}
.successText
{
font-size
:
32rpx
;
color
:
#111111
;
font-weight
:
700
;
text-align
:
center
;
margin-bottom
:
40rpx
;
}
.user
{
font-size
:
28rpx
;
font-weight
:
500
;
color
:
#888888
;
text-align
:
center
;
}
}
.closeIcon
{
margin
:
35rpx
auto
0
;
display
:
flex
;
justify-content
:
center
;
}
</
style
>
pages/coffee/confirmOrder.vue
View file @
448ded4d
<
template
>
<view
class=
"confirmOrder"
>
<view
class=
"confirmOrder"
v-if=
"showPage"
>
<view
class=
"addr"
>
<view
class=
"info"
>
<text
class=
"store"
>
阳光新业店
</text>
<text
class=
"store"
>
{{
store
}}
</text>
<text
class=
"type"
>
到店消费
</text>
</view>
<view
class=
"addrText"
>
{{
item
.
addr
||
""
}}
</view>
<view
class=
"addrText"
>
{{
addr
}}
</view>
</view>
<view
class=
"orderDetail"
>
<view
class=
"row1"
>
...
...
@@ -37,10 +37,6 @@
<view
class=
"label"
>
赠送数量
</view>
<view
class=
"value"
>
{{
item
.
GiveAwayNum
||
0
}}
杯
</view>
</view>
<view
class=
"row2"
>
<view
class=
"label"
>
使用期限
</view>
<view
class=
"value"
>
6个月
</view>
</view>
<view
class=
"row3"
>
<text
class=
"name"
>
应付
</text>
<text
class=
"totalPrice"
>
¥
{{
detailData
.
total_price
||
0
}}
</text>
...
...
@@ -87,9 +83,12 @@
},
data
()
{
return
{
showPage
:
false
,
payBtn
:
false
,
payExit
:
false
,
item
:
{},
store
:
""
,
addr
:
""
,
formdata
:
{
AddressId
:
0
,
DeliveryMethod
:
0
,
...
...
@@ -115,6 +114,9 @@
this
.
payInfo
.
OpenId
=
uni
.
getStorageSync
(
'mall_UserInfo'
).
OpenId
;
const
data
=
JSON
.
parse
(
decodeURIComponent
(
options
.
item
))
this
.
item
=
data
let
address
=
data
.
addr
this
.
store
=
address
.
split
(
'|'
)[
0
]
this
.
addr
=
address
.
split
(
'|'
)[
1
]
this
.
formdata
.
DetailList
=
[{
GoodsId
:
data
.
GoodsId
,
Number
:
data
.
BuyNum
,
...
...
@@ -133,6 +135,7 @@
},
res
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
showPage
=
true
this
.
detailData
=
res
.
data
this
.
payInfo
.
total_price
=
res
.
data
.
total_price
this
.
payInfo
.
GoodsName
=
res
.
data
.
mch_list
[
0
].
goods_list
[
0
].
name
.
slice
(
0
,
10
);
...
...
pages/coffee/index.vue
View file @
448ded4d
...
...
@@ -28,9 +28,6 @@
<view
class=
"goodsinfoTitle"
>
剩余已购
</view>
<view
class=
"validate"
>
有效期:2022.12.25
</view>
</view>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup.png"
...
...
@@ -47,10 +44,10 @@
<view
class=
"goodsinfo"
>
<view
class=
"left"
>
<view
class=
"goodsinfoTitle"
>
剩余
已购
剩余
赠送
</view>
<view
class=
"validate"
>
有效期:
2022.12.25
有效期:
当月
</view>
</view>
<image
...
...
@@ -77,23 +74,42 @@
</view>
</view>
<u-popup
v-model=
"isShowQrcode"
mode=
"center"
>
<u-popup
v-model=
"isShowQrcode"
mode=
"center"
@
close=
"closeQrcode"
>
<view
style=
"margin: 60rpx;"
>
<Qrcode
ref=
"qrcode"
:modal=
"modal_qr"
:url=
"qrData"
@
hideQrcode=
"hideQrcode"
:width=
"300"
:height=
"300"
themeColor=
"#44766E"
is_themeImg
:h_w_img=
"80"
:themeImg=
"headImg"
/>
themeColor=
"#000000"
is_themeImg
:h_w_img=
"80"
:themeImg=
"headImg"
/>
</view>
</u-popup>
<u-popup
v-model=
"isShowSuccess"
:maskCloseAble=
"false"
mode=
"center"
@
close=
"closePopup"
>
<view
style=
"margin: 60rpx;"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup3.png"
mode=
"widthFix"
style=
"width:546rpx;height:auto;display: block;"
></image>
<view
class=
"viewBox"
>
<view
class=
"cup"
>
1杯
</view>
<view
class=
"successText"
>
消费成功
</view>
<view
class=
"user"
>
<image
:src=
"headImg"
style=
"width: 66rpx;height: 66rpx;border-radius: 50%;margin-right: 6rpx;"
>
</image>
{{
username
}}
</view>
</view>
<view
class=
"closeIcon"
@
click=
"closePopup"
>
<u-icon
name=
"close"
color=
"#fefefe"
size=
"60"
></u-icon>
</view>
</view>
</u-popup>
<ComfirmDig
:show=
"isShowSuccess"
@
close=
"closeComfirmDig"
></ComfirmDig>
</view>
</
template
>
<
script
>
import
Qrcode
from
"./qrcode/ay-qrcode.vue"
import
ComfirmDig
from
"./confirmDialog.vue"
export
default
{
components
:
{
Qrcode
,
ComfirmDig
,
},
data
()
{
return
{
...
...
@@ -106,9 +122,10 @@
headImg
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup.png"
,
pageData
:
{},
isShowSuccess
:
false
,
timer
:
null
,
timing
:
0
,
//二维码计时用
flag
:
false
,
timer
:
null
,
timing
:
0
,
//二维码计时用
username
:
""
,
flag
:
false
,
//是否继续请求扫码结果
}
},
...
...
@@ -118,6 +135,7 @@
if
(
userInfo
.
Photo
)
{
this
.
headImg
=
userInfo
.
Photo
}
this
.
username
=
userInfo
.
Name
this
.
UserId
=
userInfo
.
UserId
this
.
getData
()
...
...
@@ -132,7 +150,6 @@
await
this
.
showQrcode
()
//生成二维码
this
.
isShowQrcode
=
true
setTimeout
(()
=>
{
this
.
timing
=
Date
.
now
()
this
.
flag
=
true
this
.
getVerificat
()
},
2000
)
...
...
@@ -177,28 +194,24 @@
},
res
=>
{
if
(
res
.
data
.
State
===
1
)
{
this
.
isShowQrcode
=
false
this
.
isShowSuccess
=
true
this
.
getData
()
clearTimeout
(
this
.
timer
)
}
else
if
(
res
.
data
.
State
===
2
)
{
}
else
if
(
res
.
data
.
State
===
2
&&
this
.
flag
)
{
this
.
timer
=
setTimeout
(()
=>
{
let
curTime
=
Date
.
now
()
if
((
curTime
-
this
.
timing
)
<
2
*
60
*
1000
&&
this
.
flag
){
this
.
getVerificat
()
}
else
{
console
.
log
(
'二维码超时'
)
clearTimeout
(
this
.
timer
)
}
this
.
getVerificat
()
},
2000
)
}
}
);
},
close
ComfirmDig
()
{
console
.
log
(
111
)
this
.
isShowSuccess
=
false
clearTimeout
(
this
.
timer
)
close
Popup
()
{
this
.
isShowSuccess
=
false
},
closeQrcode
(){
this
.
flag
=
false
clearTimeout
(
this
.
timer
)
}
}
}
...
...
@@ -393,4 +406,45 @@
margin-right
:
130rpx
;
}
}
.viewBox
{
width
:
546rpx
;
height
:
286rpx
;
background-color
:
#FFFFFF
;
border-radius
:
0rpx
0rpx
24rpx
24rpx
;
padding-top
:
40rpx
;
.cup
{
font-size
:
40rpx
;
font-weight
:
800
;
color
:
#3E766E
;
text-align
:
center
;
margin-bottom
:
6rpx
;
}
.successText
{
font-size
:
32rpx
;
color
:
#111111
;
font-weight
:
700
;
text-align
:
center
;
margin-bottom
:
40rpx
;
}
.user
{
font-size
:
28rpx
;
font-weight
:
500
;
color
:
#888888
;
text-align
:
center
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
}
.closeIcon
{
margin
:
35rpx
auto
0
;
display
:
flex
;
justify-content
:
center
;
}
</
style
>
pages/coffee/myOrder.vue
View file @
448ded4d
...
...
@@ -5,7 +5,7 @@
<view
v-for=
"(item,index) in list"
:key=
"index"
class=
"item"
@
click=
"goDetail(item.OrderId)"
>
<view
class=
"top"
>
<view
class=
"orderNo"
>
阳光新业店
{{
item
.
OrderId
}}
</view>
<view
class=
"orderStatus"
>
<text
v-if=
"item.OrderStatus===1"
>
待付款
</text>
...
...
@@ -84,7 +84,7 @@
},
goDetail
(
id
)
{
uni
.
navigateTo
({
url
:
'/pages/coffee/orderDetail?id='
+
id
+
'&addr='
+
this
.
addr
url
:
'/pages/coffee/orderDetail?id='
+
id
})
},
},
...
...
pages/coffee/orderDetail.vue
View file @
448ded4d
...
...
@@ -5,12 +5,13 @@
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/starbuckslogo.png"
mode=
"widthFix"
style=
"width: 190rpx;height: auto;"
></image>
<view
class=
"orderStatus"
>
已完成
<text
v-if=
"detailData.OrderStatus==5"
>
已完成
</text>
<text
v-if=
"detailData.OrderStatus==1"
>
待付款
</text>
</view>
</view>
<view
class=
"addr"
>
<view
class=
"info"
>
<text
class=
"store"
>
阳光新业店
</text>
<text
class=
"store"
>
{{
store
}}
</text>
<text
class=
"type"
>
到店消费
</text>
</view>
<view
class=
"addrText"
>
{{
addr
}}
</view>
...
...
@@ -46,39 +47,66 @@
<view
class=
"label"
>
赠送数量
</view>
<view
class=
"value"
>
{{
detailData
.
DetailList
[
0
].
PresentCoffeeNum
||
0
}}
杯
</view>
</view>
<view
class=
"row2"
>
<view
class=
"label"
>
使用期限
</view>
<view
class=
"value"
>
6个月
</view>
</view>
<view
class=
"row3"
>
<text
class=
"name"
>
应付
</text>
<text
class=
"totalPrice"
>
¥
{{
detailData
.
PreferPrice
||
0
}}
</text>
</view>
<view
class=
"row4"
>
下单时间:
{{
detailData
.
CreateDate
}}
<view
class=
"payBtn"
v-if=
"detailData.OrderStatus==1"
@
click=
"setOrder"
>
去支付
</view>
</view>
</view>
<payCom
v-if=
"payBtn"
:payInfo=
"payInfo"
@
closePay=
"closePay"
></payCom>
<u-popup
v-model=
"payExit"
mode=
"center"
:mask-close-able=
"false"
>
<view
style=
"background:#fff;width:500rpx;border-radius: 10rpx;"
>
<view
style=
"padding:10px 0 0 10px"
>
提交失败
</view>
<view
style=
"text-align:center;padding-bottom:40rpx"
>
<view
style=
"margin:80rpx 0"
>
支付取消
</view>
<span
@
click=
"exitPay"
style=
"padding:10rpx 50rpx;color:#fff;background:#19be6b;border-radius: 12px;"
>
确定
</span>
</view>
</view>
</u-popup>
</view>
</
template
>
<
script
>
import
PayCom
from
'@/components/pay/pay'
;
export
default
{
components
:{
PayCom
},
data
()
{
return
{
store
:
""
,
addr
:
''
,
detailData
:
{},
msg
:{
OrderId
:
0
},
payBtn
:
false
,
payExit
:
false
,
payInfo
:
{
OpenId
:
'ow_7I5XC1-RGwwk8QANBmWKYKmOc'
,
OrderId
:
''
,
OrderPayType
:
1
,
GoodsName
:
''
,
type
:
2
,
//是甲鹤付款
total_price
:
0
,
isCoffee
:
true
,
},
}
},
onLoad
(
options
)
{
this
.
addr
=
options
.
addr
uni
.
setNavigationBarTitle
({
title
:
"订单详情"
})
this
.
msg
.
OrderId
=
options
.
id
this
.
getInfo
()
this
.
payInfo
.
OpenId
=
uni
.
getStorageSync
(
'mall_UserInfo'
).
OpenId
;
},
methods
:
{
getInfo
()
{
...
...
@@ -89,11 +117,27 @@
res
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
detailData
=
res
.
data
let
address
=
res
.
data
.
Address
this
.
store
=
address
.
split
(
'|'
)[
0
]
this
.
addr
=
address
.
split
(
'|'
)[
1
]
}
}
);
},
setOrder
()
{
this
.
payInfo
.
total_price
=
this
.
detailData
.
PreferPrice
this
.
payInfo
.
OrderId
=
this
.
detailData
.
OrderId
this
.
payInfo
.
GoodsName
=
this
.
detailData
.
DetailList
[
0
].
GoodsName
this
.
payBtn
=
true
},
closePay
()
{
this
.
payBtn
=
false
;
this
.
payExit
=
true
;
},
exitPay
()
{
this
.
payExit
=
false
;
},
}
}
</
script
>
...
...
@@ -250,6 +294,20 @@
font-size
:
24rpx
;
color
:
#999999
;
border-top
:
1px
solid
#E8E8E8
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
.payBtn
{
height
:
60rpx
;
border-radius
:
30rpx
;
background-color
:
#3E766E
;
text-align
:
center
;
line-height
:
60rpx
;
padding
:
0
20rpx
;
font-size
:
28rpx
;
font-weight
:
500
;
color
:
#FFFFFF
;
}
}
}
</
style
>
pages/user-center/components/coffeeConfirmDialog.vue
View file @
448ded4d
...
...
@@ -6,13 +6,14 @@
mode=
"widthFix"
style=
"width:546rpx;height:auto;display: block;"
></image>
<view
class=
"viewBox"
>
<view
class=
"cup"
>
1
杯
{{
dataObj
.
Number
||
0
}}
杯
</view>
<view
class=
"successText"
>
核销成功
</view>
<view
class=
"user"
>
小猪
<image
:src=
"dataObj.Photo"
style=
"width: 66rpx;height: 66rpx;border-radius: 50%;margin-right: 6rpx;"
></image>
{{
dataObj
.
Name
||
''
}}
</view>
</view>
<view
class=
"closeIcon"
@
click=
"closePopup"
>
...
...
@@ -25,10 +26,6 @@
<
script
>
export
default
{
// model: {
// prop: 'show',
// event: "change"
// },
props
:
{
show
:{
type
:
Boolean
,
...
...
@@ -43,7 +40,6 @@
},
watch
:{
show
(
val
){
console
.
log
(
this
.
dataObj
)
this
.
showDig
=
val
}
},
...
...
@@ -54,6 +50,7 @@
},
methods
:
{
closePopup
()
{
this
.
showDig
=
false
this
.
$emit
(
"close"
);
}
},
...
...
@@ -85,6 +82,9 @@
font-weight
:
500
;
color
:
#888888
;
text-align
:
center
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
}
...
...
pages/user-center/user-center.vue
View file @
448ded4d
...
...
@@ -750,7 +750,7 @@
AppletID
:
0
,
//小程序id 5-8日 判断是否是甲鹤
isAttestationEdu
:
0
,
//学员是否认证了 0否1是
isMallAdmin
:
0
,
//是否是饭粒汪商城管理员 0否1是
showCoffeeVerification
:
tru
e
,
//是否显示咖啡核验成功弹窗
showCoffeeVerification
:
fals
e
,
//是否显示咖啡核验成功弹窗
coffeeVerificationData
:{},
//咖啡核验成功弹窗参数
};
},
...
...
@@ -1066,8 +1066,8 @@
scanType
:
[
'qrCode'
],
success
:
function
(
res
)
{
let
qrdata
=
JSON
.
parse
(
decodeURIComponent
(
res
.
result
))
console
.
log
(
'条码类型:'
,
qrdata
)
;
that
.
setAdminVerificationCoffee
(
qrdata
.
UserId
)
console
.
log
(
'条码类型:'
,
qrdata
)
that
.
setAdminVerificationCoffee
(
qrdata
.
UserId
,
qrdata
.
timestamp
)
},
fail
:
err
=>
{
uni
.
showToast
({
...
...
@@ -1079,18 +1079,19 @@
});
},
//核验咖啡券
setAdminVerificationCoffee
(
id
){
setAdminVerificationCoffee
(
id
,
code
){
this
.
request2
({
url
:
'/api/AppletCoffee/SetAdminVerificationCoffee'
,
data
:
{
UserId
:
id
UserId
:
id
,
Code
:
code
}
},
res
=>
{
if
(
res
.
resultCode
==
1
)
{
console
.
log
(
res
)
if
(
res
.
State
==
1
){
if
(
res
.
data
.
State
==
1
){
this
.
coffeeVerificationData
=
res
.
data
console
.
log
(
this
.
coffeeVerificationData
)
this
.
showCoffeeVerification
=
true
}
else
{
uni
.
showToast
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment