Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
user
Overview
Overview
Details
Activity
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
hooloo
mp
user
Commits
3eb9bf9e
Commit
3eb9bf9e
authored
Apr 07, 2023
by
songbingqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成优惠券弹框问题
parent
9f432744
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
153 additions
and
46 deletions
+153
-46
components/OrderQrCode/index.vue
+13
-11
components/bocft-popup/bocft-popup.vue
+49
-0
components/bocft-popup/initPopup.js
+29
-0
components/bocft-toast/bocft-toast.vue
+2
-2
components/shopCar/shopCar.vue
+4
-1
main.js
+4
-0
orderSubPackage/pages/orderInfo/index.vue
+19
-6
pages/menu/menu.vue
+3
-25
pages/mine/mine.vue
+1
-0
pages/order/order.vue
+1
-0
request/user/index.js
+28
-1
static/imgs/testCouponImg.png
+0
-0
No files found.
components/OrderQrCode/index.vue
View file @
3eb9bf9e
...
@@ -62,8 +62,8 @@
...
@@ -62,8 +62,8 @@
</view>
</view>
</view>
</view>
<!--
<div
class=
"code"
>
取单码
{{
orderInfo
.
orderNum
}}
</div>
-->
<!--
<div
class=
"code"
>
取单码
{{
orderInfo
.
orderNum
}}
</div>
-->
<div
class=
"qr_code_readly"
:style=
"
{'background-image':`url(${ewmImg})`}"
>
<div
class=
"qr_code_readly"
>
<
!--
<image
mode=
"scaleToFill"
:src=
"ewmImg"
class=
"qr"
></image>
--
>
<
image
mode=
"aspectFit"
:src=
"ewmImg"
class=
"qr"
></image
>
</div>
</div>
<div
class=
"ercodeTip"
>
制作完成后,扫描此二维码取杯。
</div>
<div
class=
"ercodeTip"
>
制作完成后,扫描此二维码取杯。
</div>
...
@@ -469,17 +469,19 @@ export default {
...
@@ -469,17 +469,19 @@ export default {
text-align
:
center
;
text-align
:
center
;
}
}
.qr_code_readly
{
.qr_code_readly
{
margin
:
20
rpx
auto
;
margin
:
0
auto
;
margin-top
:
20
rpx
;
width
:
300
rpx
;
margin-bottom
:
20
rpx
;
margin-top
:
20
rpx
;
height
:
300
rpx
;
margin-bottom
:
20
rpx
;
background-repeat
:
no-repeat
;
height
:
300
rpx
;
background-repeat
:
no-repeat
;
background-position
:
center
;
background-position
:
center
;
overflow
:
hidden
;
overflow
:
hidden
;
.qr
{
image
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
}
vertical-align
:
bottom
;
}
}
}
.qr_code
{
.qr_code
{
height
:
468
rpx
;
height
:
468
rpx
;
...
...
components/bocft-popup/bocft-popup.vue
0 → 100644
View file @
3eb9bf9e
<
template
>
<u-popup
:overlayStyle=
"
{'z-index':'10073'}" bgColor="transparent" :show="show" mode="center" @close="close">
<image
mode=
"widthFix"
v-if=
"urlImg&&width&&height"
class=
"empty_icon"
:src=
"urlImg"
:style=
"
{'width':width+'rpx','height':height+'rpx'}">
</image>
</u-popup>
</
template
>
<
script
>
export
default
{
name
:
'bocft-popup'
,
computed
:
{
show
(){
return
this
.
$popupStore
.
state
.
show
;
},
urlImg
()
{
return
this
.
$popupStore
.
state
.
url
}
},
watch
:{
urlImg
(
val
)
{
uni
.
getImageInfo
({
src
:
val
,
success
:(
image
)
=>
{
const
wheight
=
uni
.
getSystemInfoSync
().
windowHeight
;
const
wwidth
=
uni
.
getSystemInfoSync
().
windowWidth
;
this
.
width
=
image
.
width
>
wwidth
?
wwidth
+
(
wwidth
/
4
):
image
.
width
this
.
height
=
image
.
height
>
wheight
?
wheight
:
image
.
height
}
})
}
},
data
()
{
return
{
percent
:
0
,
width
:
0
,
height
:
0
,
flag
:
false
};
},
methods
:{
close
()
{
this
.
$popupStore
.
commit
(
'closePopup'
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
\ No newline at end of file
components/bocft-popup/initPopup.js
0 → 100644
View file @
3eb9bf9e
// initPopup.js
import
Vuex
from
'vuex'
export
default
function
initPopup
(
v
)
{
// 挂在store到全局Vue原型上
v
.
prototype
.
$popupStore
=
new
Vuex
.
Store
({
state
:
{
show
:
false
,
url
:
""
},
mutations
:
{
closePopup
(
state
,
data
)
{
state
.
show
=
false
},
showPopup
(
state
,
data
)
{
console
.
log
(
data
)
state
=
Object
.
assign
(
state
,
data
)
state
.
show
=
true
},
}
})
v
.
prototype
.
showPopup
=
function
(
option
)
{
if
(
typeof
option
===
'object'
)
{
if
(
option
.
hideTabBar
){
wx
.
hideTabBar
();
}
v
.
prototype
.
$popupStore
.
commit
(
'showPopup'
,
option
)
}
}
}
components/bocft-toast/bocft-toast.vue
View file @
3eb9bf9e
...
@@ -23,9 +23,9 @@
...
@@ -23,9 +23,9 @@
title
(){
title
(){
return
this
.
$toastStore
.
state
.
title
;
return
this
.
$toastStore
.
state
.
title
;
},
},
time
(){
time
(){
return
this
.
$toastStore
.
state
.
time
;
return
this
.
$toastStore
.
state
.
time
;
}
}
},
},
methods
:{
methods
:{
...
...
components/shopCar/shopCar.vue
View file @
3eb9bf9e
...
@@ -143,7 +143,7 @@
...
@@ -143,7 +143,7 @@
</view>
</view>
<view
<view
class=
"shopClose"
class=
"shopClose"
v-if=
"!orderState"
v-if=
"!orderState
&&orderState!=null
"
:style=
"
{ bottom: shopCar + 'rpx' }"
:style=
"
{ bottom: shopCar + 'rpx' }"
>
>
<view
class=
"content"
>
{{
<view
class=
"content"
>
{{
...
@@ -291,6 +291,9 @@ export default {
...
@@ -291,6 +291,9 @@ export default {
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
console
.
log
(
res
);
console
.
log
(
res
);
if
(
res
.
authSetting
[
"scope.userLocation"
]
==
true
)
{
if
(
res
.
authSetting
[
"scope.userLocation"
]
==
true
)
{
User
.
getLocation
((
state
,
params
)
=>
{
console
.
log
(
params
)
});
//判断res.authsetting的值是true还是false
//判断res.authsetting的值是true还是false
settleMentFunc
();
settleMentFunc
();
}
else
{
}
else
{
...
...
main.js
View file @
3eb9bf9e
...
@@ -14,10 +14,14 @@ import User from "@/request/user";
...
@@ -14,10 +14,14 @@ import User from "@/request/user";
// main.js
// main.js
import
initToast
from
"@/components/bocft-toast/initToast.js"
;
import
initToast
from
"@/components/bocft-toast/initToast.js"
;
import
showToast
from
"@/components/bocft-toast/bocft-toast.vue"
;
import
showToast
from
"@/components/bocft-toast/bocft-toast.vue"
;
import
Popup
from
"@/components/bocft-popup/bocft-popup.vue"
;
import
initPopup
from
"@/components/bocft-popup/initPopup.js"
;
import
taBar
from
"@/components/tabBar/tabBar.vue"
;
import
taBar
from
"@/components/tabBar/tabBar.vue"
;
initToast
(
Vue
);
initToast
(
Vue
);
initPopup
(
Vue
)
Vue
.
component
(
"show-toast"
,
showToast
);
Vue
.
component
(
"show-toast"
,
showToast
);
Vue
.
component
(
"show-popup"
,
Popup
);
Vue
.
component
(
"taBar"
,
taBar
);
Vue
.
component
(
"taBar"
,
taBar
);
Vue
.
use
(
uView
);
Vue
.
use
(
uView
);
...
...
orderSubPackage/pages/orderInfo/index.vue
View file @
3eb9bf9e
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
>
分钟后可取,请稍等!
</view
>
分钟后可取,请稍等!
</view
>
>
<view
v-if=
"orderInfo.state == 4||orderInfo.state == 5"
>
制作完成请取杯,享用愉快!
</view>
<view
v-if=
"orderInfo.state == 4||orderInfo.state == 5"
>
制作完成请取杯,享用愉快!
</view>
<view
v-if=
"orderInfo.state == 6"
>
订单完成 请搅拌后尽快
引
用哦~
</view>
<view
v-if=
"orderInfo.state == 6"
>
订单完成 请搅拌后尽快
饮
用哦~
</view>
<view
v-if=
"orderInfo.state == 7"
>
待取超时 品质不佳已丢弃,请联系客服重做!
</view>
<view
v-if=
"orderInfo.state == 7"
>
待取超时 品质不佳已丢弃,请联系客服重做!
</view>
<view
v-if=
"orderInfo.state >= 8 && orderInfo.state
<
=
15
"
<view
v-if=
"orderInfo.state >= 8 && orderInfo.state
<
=
15
"
>
非常抱歉,我们会继续努力的~
</view
>
非常抱歉,我们会继续努力的~
</view
...
@@ -82,13 +82,13 @@
...
@@ -82,13 +82,13 @@
class=
"btn"
class=
"btn"
>
立即支付
</a
>
立即支付
</a
>
>
<a
<
!--
<
a
type=
"primary"
type=
"primary"
@
click=
"oneMoreOrder(orderInfo)"
@
click=
"oneMoreOrder(orderInfo)"
v-if=
"orderInfo.state != 1&&orderInfo.state != 2&&orderInfo.state != 4&&orderInfo.state != 5"
v-if=
"orderInfo.state != 1&&orderInfo.state != 2&&orderInfo.state != 4&&orderInfo.state != 5"
class=
"btn"
class=
"btn"
>
再来一单
</a
>
再来一单
</a
>
>
-->
<a
<a
type=
"primary"
type=
"primary"
@
click=
"refundInfo"
@
click=
"refundInfo"
...
@@ -101,8 +101,8 @@
...
@@ -101,8 +101,8 @@
<div
class=
"order_flow"
v-if=
"qrShow"
>
-->
<div
class=
"order_flow"
v-if=
"qrShow"
>
-->
<!--
<div
v-if=
"qrShow"
class=
"code"
>
取单码
{{
orderInfo
.
orderNum
}}
</div>
-->
<!--
<div
v-if=
"qrShow"
class=
"code"
>
取单码
{{
orderInfo
.
orderNum
}}
</div>
-->
<!--
<div
class=
"realQrcodeBox"
:style=
"
{'background-image':`url(${ewmImg})`}" v-if="isBuild"> -->
<!--
<div
class=
"realQrcodeBox"
:style=
"
{'background-image':`url(${ewmImg})`}" v-if="isBuild"> -->
<div
class=
"realQrcodeBox"
:style=
"
{'background-image':`url(${ewmImg})`}"
v-if="isBuild">
<div
class=
"realQrcodeBox"
v-if=
"isBuild"
>
<
!--
<image
mode=
"aspectFit"
:src=
"ewmImg"
/>
--
>
<
image
mode=
"aspectFit"
:src=
"ewmImg"
/
>
</div>
</div>
<!--
<div
v-else
class=
"qr_code"
>
<!--
<div
v-else
class=
"qr_code"
>
<image
<image
...
@@ -169,7 +169,7 @@
...
@@ -169,7 +169,7 @@
type=
"primary"
type=
"primary"
@
click=
"oneMoreOrder(orderInfo)"
@
click=
"oneMoreOrder(orderInfo)"
v-else-if=
"orderInfo.state != 1&&orderInfo.state != 2&&orderInfo.state != 4&&orderInfo.state != 5"
v-else-if=
"orderInfo.state != 1&&orderInfo.state != 2&&orderInfo.state != 4&&orderInfo.state != 5"
class=
"btn"
class=
"btn
_again
"
>
再来一单
</div>
>
再来一单
</div>
</div>
</div>
</div>
</div>
...
@@ -741,6 +741,19 @@ export default {
...
@@ -741,6 +741,19 @@ export default {
line-height
:
64
rpx
;
line-height
:
64
rpx
;
width
:
180
rpx
;
width
:
180
rpx
;
}
}
.btn_again
{
font-size
:
24
rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#ffffff
;
width
:
167
rpx
;
height
:
64
rpx
;
text-align
:
center
;
line-height
:
64
rpx
;
background
:
#0050f6
;
border-radius
:
5
rpx
;
}
}
}
.btn
{
.btn
{
font-size
:
24
rpx
;
font-size
:
24
rpx
;
...
...
pages/menu/menu.vue
View file @
3eb9bf9e
...
@@ -75,31 +75,6 @@
...
@@ -75,31 +75,6 @@
</view>
</view>
</view>
</view>
<OrderQrCode
ref=
"OrderQrCode"
v-if=
"buied"
:shopInfo=
"shopInfo"
:userms=
"userms"
/>
<OrderQrCode
ref=
"OrderQrCode"
v-if=
"buied"
:shopInfo=
"shopInfo"
:userms=
"userms"
/>
<!--
<view
class=
"order-banner"
v-if=
"buied"
@
click=
"openQrcode"
>
<view
class=
"info"
>
<view
class=
"first"
>
取单码:
<text
class=
"first-code"
>
{{
orderInfo
.
orderNum
}}
</text></view
>
<view
class=
"second1"
v-if=
"orderInfo.state == '4'"
>
订单已制作完成,请尽快取餐~
</view
>
<view
class=
"second"
v-else
>
请您耐心等候,剩余等候时间
<text
class=
"time"
>
{{
orderInfo
.
waitTime
}}
</text
>
分钟
</view
>
</view>
<view
class=
"line"
></view>
<view
class=
"barCode-box"
>
<view
class=
"barCode"
>
<image
:src=
"'/static/imgs/icon-barcode.png'"
></image>
</view>
<view
class=
"barCode-dis"
>
点击二维码取单
</view>
</view>
</view>
-->
<MenuAssembly
<MenuAssembly
ref=
"MenuAssembly"
ref=
"MenuAssembly"
@
getallNum=
"getallNum"
@
getallNum=
"getallNum"
...
@@ -111,6 +86,7 @@
...
@@ -111,6 +86,7 @@
<AreaPicker
ref=
"AreaPicker"
/>
<AreaPicker
ref=
"AreaPicker"
/>
<show-toast
ref=
"toast"
/>
<show-toast
ref=
"toast"
/>
<show-popup
ref=
"popup"
/>
<taBar
select=
"0"
></taBar>
<taBar
select=
"0"
></taBar>
<ShopCar
ref=
"shopbar"
:orderState=
"shopInfo.orderState"
:orderStateDesc=
"shopInfo.stateDesc"
/>
<ShopCar
ref=
"shopbar"
:orderState=
"shopInfo.orderState"
:orderStateDesc=
"shopInfo.stateDesc"
/>
<u-popup
:show=
"locationPopup"
:round=
"10"
mode=
"bottom"
z-index=
"209999"
>
<u-popup
:show=
"locationPopup"
:round=
"10"
mode=
"bottom"
z-index=
"209999"
>
...
@@ -251,6 +227,8 @@ export default {
...
@@ -251,6 +227,8 @@ export default {
User
.
wxLoginAndGetOpenid
(
true
).
then
((
loginInfo
)
=>
{
User
.
wxLoginAndGetOpenid
(
true
).
then
((
loginInfo
)
=>
{
this
.
loginInfo
=
loginInfo
;
this
.
loginInfo
=
loginInfo
;
});
});
}
else
{
User
.
getCouponImg
()
}
}
},
},
onHide
()
{
onHide
()
{
...
...
pages/mine/mine.vue
View file @
3eb9bf9e
...
@@ -183,6 +183,7 @@
...
@@ -183,6 +183,7 @@
</view>
</view>
<taBar
select=
"2"
></taBar>
<taBar
select=
"2"
></taBar>
<show-toast
ref=
"toast"
/>
<show-toast
ref=
"toast"
/>
<show-popup
ref=
"popup"
/>
</view>
</view>
</
template
>
</
template
>
...
...
pages/order/order.vue
View file @
3eb9bf9e
...
@@ -169,6 +169,7 @@
...
@@ -169,6 +169,7 @@
</view>
</view>
<show-toast
ref=
"toast"
/>
<show-toast
ref=
"toast"
/>
<show-popup
ref=
"popup"
/>
<taBar
select=
"1"
></taBar>
<taBar
select=
"1"
></taBar>
</view>
</view>
</
template
>
</
template
>
...
...
request/user/index.js
View file @
3eb9bf9e
...
@@ -168,7 +168,6 @@ export default {
...
@@ -168,7 +168,6 @@ export default {
return
uni
.
$u
.
http
return
uni
.
$u
.
http
.
get
(
`/system/customer/detail`
,
{})
.
get
(
`/system/customer/detail`
,
{})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
res
,
data
);
const
{
birthday
,
createTime
,
id
,
phone
,
sex
,
userName
,
avatarUrl
}
=
const
{
birthday
,
createTime
,
id
,
phone
,
sex
,
userName
,
avatarUrl
}
=
res
.
data
.
data
;
res
.
data
.
data
;
const
{
avatarUrl
:
localAvatarUrl
}
=
uni
.
getStorageSync
(
"UserInfo"
);
const
{
avatarUrl
:
localAvatarUrl
}
=
uni
.
getStorageSync
(
"UserInfo"
);
...
@@ -189,6 +188,7 @@ export default {
...
@@ -189,6 +188,7 @@ export default {
}
}
Store
.
commit
(
"setUserInfo"
,
sendData
);
Store
.
commit
(
"setUserInfo"
,
sendData
);
uni
.
setStorageSync
(
"UserInfo"
,
sendData
);
uni
.
setStorageSync
(
"UserInfo"
,
sendData
);
this
.
getCouponImg
()
const
MenuOption
=
Store
.
state
.
user
.
menuOption
;
const
MenuOption
=
Store
.
state
.
user
.
menuOption
;
if
(
JSON
.
stringify
(
MenuOption
)
!==
"{}"
)
{
if
(
JSON
.
stringify
(
MenuOption
)
!==
"{}"
)
{
const
{
num
,
serial_no
,
source
}
=
MenuOption
;
const
{
num
,
serial_no
,
source
}
=
MenuOption
;
...
@@ -238,6 +238,33 @@ export default {
...
@@ -238,6 +238,33 @@ export default {
});
});
});
});
},
},
getCouponImg
()
{
const
data
=
uni
.
getStorageSync
(
'UserInfo'
)
const
pages
=
getCurrentPages
()
const
route
=
pages
[
pages
.
length
-
1
].
route
const
params
=
{
page_path
:
route
,
// 点击登录的页面路径
user_id
:
data
.
id
,
phone
:
data
.
phoneNumber
,
source
:
"return_user"
,
param
:
""
}
return
uni
.
$u
.
http
.
post
(
"/v1/issue/return/user/coupon"
,
params
)
.
then
((
res
)
=>
{
const
{
url
,
flag
}
=
res
.
data
.
data
if
(
flag
===
1
)
{
context
.
showPopup
({
url
:
url
});
}
return
res
;
})
.
catch
((
err
)
=>
{
const
{
data
}
=
err
;
const
{
msg
}
=
data
;
context
.
showToast
({
title
:
msg
,
icon
:
"none"
});
return
err
;
});
},
setAllow
(
params
)
{
setAllow
(
params
)
{
return
uni
.
$u
.
http
return
uni
.
$u
.
http
.
post
(
"/system/customer/allow"
,
params
)
.
post
(
"/system/customer/allow"
,
params
)
...
...
static/imgs/testCouponImg.png
0 → 100644
View file @
3eb9bf9e
158 KB
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