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
3684fae3
Commit
3684fae3
authored
Jul 06, 2022
by
宋冰琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复部分bug
parent
c96c9e2a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
49 deletions
+67
-49
components/OrderQrCode/index.vue
+1
-1
components/menuAssembly/index.vue
+6
-2
menuSubPackage/pages/goodsDetail/goodsDetail.vue
+2
-2
orderSubPackage/pages/orderInfo/index.vue
+45
-40
request/menu/index.js
+13
-4
No files found.
components/OrderQrCode/index.vue
View file @
3684fae3
...
...
@@ -101,7 +101,7 @@ export default {
this
.
clientYEnd
=
e
.
changedTouches
[
0
].
clientY
;
const
val
=
parseInt
((
this
.
clientYStart
-
this
.
clientYEnd
))
console
.
log
(
val
)
if
(
val
<-
30
0
){
if
(
val
<-
2
0
){
console
.
log
(
'滑动了:'
+
val
+
',关闭'
)
this
.
close
()
}
else
{
...
...
components/menuAssembly/index.vue
View file @
3684fae3
...
...
@@ -47,6 +47,7 @@
<
script
>
import
{
$EventBus
}
from
"../../utils/EventBus"
;
import
Utils
from
'@/utils/utils'
import
Order
from
'@/request/order'
export
default
{
name
:
'menuAssembly'
,
props
:[
'buied'
],
...
...
@@ -184,16 +185,19 @@ export default {
});
},
cart
(
item
,
category
){
async
cart
(
item
,
category
){
console
.
log
(
item
,
category
)
const
skuStatus
=
item
.
skus
.
filter
(
item
=>
{
return
Number
(
item
.
state
)
===
1
})
const
{
data
}
=
await
Order
.
checkSku
({
skuId
:
item
.
skus
[
0
].
skuId
})
const
{
goods
}
=
data
.
data
if
(
skuStatus
.
length
===
0
){
this
.
showToast
({
title
:
'该商品已售罄'
,
icon
:
'none'
,
})
}
else
{
uni
.
setStorageSync
(
'goodsInfo'
,
JSON
.
stringify
({
...
item
,
category
}));
console
.
log
(
goods
)
uni
.
setStorageSync
(
'goodsInfo'
,
JSON
.
stringify
({
...
goods
,
category
}));
uni
.
navigateTo
({
url
:
'/menuSubPackage/pages/goodsDetail/goodsDetail'
})
}
...
...
menuSubPackage/pages/goodsDetail/goodsDetail.vue
View file @
3684fae3
...
...
@@ -297,7 +297,7 @@ export default {
if
(
state
==
2
){
this
.
showToast
({
title
:
'本商品已经售罄'
,
icon
:
'none'
});
this
.
getMenuList
()
//
this.getMenuList()
return
;
}
else
{
goods
.
num
=
this
.
size
;
...
...
@@ -323,7 +323,7 @@ export default {
if
(
state
==
2
){
this
.
showToast
({
title
:
'本商品已经售罄'
,
icon
:
'none'
});
this
.
getMenuList
()
//
this.getMenuList()
return
;
}
else
{
goods
.
num
=
this
.
size
...
...
orderSubPackage/pages/orderInfo/index.vue
View file @
3684fae3
...
...
@@ -113,46 +113,8 @@ import { $EventBus } from "@/utils/EventBus";
export
default
{
mixins
:
[
systemInfo
],
async
onLoad
(
option
)
{
this
.
getSystemInfo
()
let
oId
=
0
// 从订阅消息进入
this
.
option
=
JSON
.
stringify
(
option
)
const
{
orderId
}
=
option
let
Authorization
=
uni
.
getStorageSync
(
'Authorization'
)
console
.
log
(
Authorization
)
if
(
orderId
){
if
(
!
Authorization
){
this
.
goBack
()
return
}
else
{
oId
=
orderId
}
}
else
{
oId
=
uni
.
getStorageSync
(
'orderId'
);
}
// return
const
{
data
=
{}}
=
await
Order
.
getOrderDetail
({
orderId
:
oId
})
this
.
orderInfo
=
data
?.
data
const
getTime
=
[
'2'
,
'3'
].
indexOf
(
this
.
orderInfo
.
state
)
>=
0
const
isBuild
=
[
'4'
,
'5'
].
indexOf
(
this
.
orderInfo
.
state
)
>=
0
;
if
(
getTime
){
const
{
data
=
{}}
=
await
Order
.
getOrderWaiteTime
({
orderId
:
oId
})
this
.
waitTime
=
data
?.
data
}
if
(
isBuild
)
{
new
QRCode
(
'myQrcode'
,
{
text
:
this
.
orderInfo
.
pickCode
,
width
:
141
,
//canvas 画布的宽
height
:
141
,
//canvas 画布的高
padding
:
0
,
// 生成二维码四周自动留边宽度,不传入默认为0
correctLevel
:
QRCode
.
CorrectLevel
.
L
,
// 二维码可辨识度
callback
:
(
res
)
=>
{
this
.
ewmImg
=
res
.
path
}
})
}
this
.
isBuild
=
isBuild
onLoad
(
option
)
{
this
.
initData
(
option
)
},
onUnload
(){
this
.
goBack
()
...
...
@@ -211,10 +173,53 @@ export default {
this
.
backFlag
=
true
uni
.
switchTab
({
url
:
'/pages/menu/menu'
})
},
async
initData
(
option
){
this
.
getSystemInfo
()
let
oId
=
uni
.
getStorageSync
(
'orderId'
);
// 从订阅消息进入
if
(
JSON
.
stringify
(
option
)
!==
'{}'
&&
option
){
this
.
option
=
JSON
.
stringify
(
option
)
const
{
orderId
=
''
}
=
option
let
Authorization
=
uni
.
getStorageSync
(
'Authorization'
)
console
.
log
(
Authorization
)
if
(
orderId
){
if
(
!
Authorization
){
this
.
goBack
()
return
}
else
{
oId
=
orderId
}
}
}
// return
const
{
data
=
{}}
=
await
Order
.
getOrderDetail
({
orderId
:
oId
})
this
.
orderInfo
=
data
?.
data
const
getTime
=
[
'2'
,
'3'
].
indexOf
(
this
.
orderInfo
.
state
)
>=
0
const
isBuild
=
[
'4'
,
'5'
].
indexOf
(
this
.
orderInfo
.
state
)
>=
0
;
if
(
getTime
){
const
{
data
=
{}}
=
await
Order
.
getOrderWaiteTime
({
orderId
:
oId
})
this
.
waitTime
=
data
?.
data
}
if
(
isBuild
)
{
new
QRCode
(
'myQrcode'
,
{
text
:
this
.
orderInfo
.
pickCode
,
width
:
141
,
//canvas 画布的宽
height
:
141
,
//canvas 画布的高
padding
:
0
,
// 生成二维码四周自动留边宽度,不传入默认为0
correctLevel
:
QRCode
.
CorrectLevel
.
L
,
// 二维码可辨识度
callback
:
(
res
)
=>
{
this
.
ewmImg
=
res
.
path
}
})
}
this
.
isBuild
=
isBuild
},
async
PayNow
()
{
const
orderInfo
=
await
Order
.
payOrder
({
orderId
:
this
.
orderInfo
.
id
})
const
sendData
=
{
orderId
:
this
.
orderInfo
.
id
,
switchTab
:
false
,
callBack
:
this
.
initData
,
...
orderInfo
.
data
.
data
}
if
(
orderInfo
)
{
...
...
request/menu/index.js
View file @
3684fae3
...
...
@@ -48,6 +48,7 @@ export default {
requestPayment
(
data
,
oldData
,
buyType
)
{
// res为调起微信支付所需参数
// 调起微信支付
const
{
switchTab
=
true
,
callBack
}
=
data
uni
.
requestPayment
({
provider
:
'wxpay'
,
// 服务提提供商微信支付
timeStamp
:
data
.
timeStamp
,
// 时间戳
...
...
@@ -61,8 +62,12 @@ export default {
uni
.
setStorageSync
(
'shopCarInfo'
,
[]);
$EventBus
.
$emit
(
'updateCar'
);
uni
.
setStorageSync
(
'orderId'
,
data
.
orderId
);
let
url
=
'/orderSubPackage/pages/orderInfo/index'
uni
.
navigateTo
({
url
})
if
(
switchTab
){
let
url
=
'/orderSubPackage/pages/orderInfo/index'
uni
.
navigateTo
({
url
})
}
else
{
callBack
()
}
}
// 业务逻辑。。。
...
...
@@ -75,8 +80,12 @@ export default {
uni
.
setStorageSync
(
'shopCarInfo'
,
[]);
$EventBus
.
$emit
(
'updateCar'
);
uni
.
setStorageSync
(
'orderId'
,
data
.
orderId
);
let
url
=
'/orderSubPackage/pages/orderInfo/index'
uni
.
navigateTo
({
url
})
if
(
switchTab
){
let
url
=
'/orderSubPackage/pages/orderInfo/index'
uni
.
navigateTo
({
url
})
}
else
{
callBack
()
}
},
});
},
...
...
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