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
9ac07820
Commit
9ac07820
authored
Jun 30, 2022
by
weijiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://140.143.224.240:8100/hooloo/mp/user
parents
f234919c
12a5ac2b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
27 deletions
+85
-27
components/OrderQrCode/index.vue
+16
-3
components/menuAssembly/index.vue
+46
-22
menuSubPackage/pages/goodsDetail/goodsDetail.vue
+16
-1
pages/menu/menu.vue
+2
-1
store/modules/menu.js
+5
-0
No files found.
components/OrderQrCode/index.vue
View file @
9ac07820
<
template
>
<div>
<u-popup
:show=
"show"
:round=
"10"
mode=
"bottom"
@
close=
"close"
:safeAreaInsetBottom=
"false"
zIndex=
"10078"
>
<view
class=
"bigBox"
:style=
"
{'height':'94vh'}">
<u-popup
:show=
"show"
:round=
"10"
mode=
"bottom"
@
close=
"close"
:safeAreaInsetBottom=
"false"
zIndex=
"10078"
>
<view
class=
"bigBox"
:style=
"
{'height':'94vh'}"
@touchstart="start" @touchend="end" ref="op"
>
<div
class=
"order_flow"
>
<div
class=
"code"
>
取单码
{{
orderInfo
.
orderNum
}}
</div>
<!--
<image
mode=
"scaleToFill"
:src=
"qrCode"
class=
"qr_code"
></image>
-->
...
...
@@ -40,6 +40,9 @@ export default {
orderInfo
:
{},
qrCode
:
''
,
show
:
false
,
clientYStart
:
0
,
clientYEnd
:
0
,
bigBox
:{}
}
},
computed
:
{
...
...
@@ -75,9 +78,19 @@ export default {
}
},
onLoad
()
{
},
methods
:
{
start
(
e
)
{
this
.
clientYStart
=
e
.
changedTouches
[
0
].
clientY
},
end
(
e
)
{
this
.
clientYEnd
=
e
.
changedTouches
[
0
].
clientY
;
const
val
=
parseInt
((
this
.
clientYStart
-
this
.
clientYEnd
))
if
(
val
<-
500
){
this
.
close
()
}
},
close
()
{
this
.
show
=
false
;
},
...
...
components/menuAssembly/index.vue
View file @
9ac07820
...
...
@@ -56,7 +56,6 @@ export default {
'--scroll-height'
:
0
},
Utils
,
classifyData
:
[],
categoryId
:
''
,
categoryPostion
:
[],
scrollLeftTop
:
0
,
...
...
@@ -79,6 +78,30 @@ export default {
}
}
},
computed
:{
classifyData
(){
const
categorys
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
$store
.
state
.
menu
.
setMenuCategorys
))
// 删除没有商品的分类
if
(
categorys
)
{
for
(
var
i
=
categorys
.
length
-
1
;
i
>=
0
;
i
--
)
{
var
category
=
categorys
[
i
];
if
(
!
category
.
goods
||
category
.
goods
.
length
<=
0
)
{
categorys
.
splice
(
i
,
1
);
}
}
if
(
categorys
.
length
>
0
){
this
.
categoryId
=
categorys
[
0
].
id
;
}
}
this
.
$nextTick
(()
=>
{
const
query
=
uni
.
createSelectorQuery
().
in
(
this
);
query
.
selectAll
(
'.box'
).
boundingClientRect
(
data
=>
{
this
.
categoryPostion
=
data
}).
exec
();
})
return
categorys
}
},
created
()
{
$EventBus
.
$off
(
'updateCar'
);
},
...
...
@@ -105,27 +128,27 @@ export default {
return
sku
;
},
createList
(
data
)
{
this
.
classifyData
=
data
;
console
.
log
(
this
.
classifyData
);
//
this.classifyData = data;
//
console.log(this.classifyData);
// 删除没有商品的分类
if
(
this
.
classifyData
)
{
for
(
var
i
=
this
.
classifyData
.
length
-
1
;
i
>=
0
;
i
--
)
{
var
category
=
this
.
classifyData
[
i
];
if
(
!
category
.
goods
||
category
.
goods
.
length
<=
0
)
{
this
.
classifyData
.
splice
(
i
,
1
);
}
}
if
(
this
.
classifyData
.
length
>
0
){
this
.
categoryId
=
this
.
classifyData
[
0
].
id
;
}
}
this
.
$nextTick
(()
=>
{
const
query
=
uni
.
createSelectorQuery
().
in
(
this
);
query
.
selectAll
(
'.box'
).
boundingClientRect
(
data
=>
{
this
.
categoryPostion
=
data
}).
exec
();
})
//
//
删除没有商品的分类
//
if(this.classifyData) {
//
for(var i=this.classifyData.length-1; i>=0; i--) {
//
var category = this.classifyData[i];
//
if(!category.goods || category.goods.length
<=
0
)
{
//
this.classifyData.splice(i, 1);
//
}
//
}
//
if(this.classifyData.length>0){
//
this.categoryId = this.classifyData[0].id;
//
}
//
}
//
this.$nextTick(() => {
//
const query = uni.createSelectorQuery().in(this);
//
query.selectAll('.box').boundingClientRect(data => {
//
this.categoryPostion = data
//
}).exec();
//
})
},
getallNum
(
item
,
category
)
{
this
.
$emit
(
'getallNum'
,
item
,
category
)
...
...
@@ -386,7 +409,8 @@ export default {
}
.box
:last-child
{
padding-bottom
:
590
rpx
;
padding-bottom
:
255
rpx
;
//
height
:
100%
;
}
.nav-right-item
image
{
...
...
menuSubPackage/pages/goodsDetail/goodsDetail.vue
View file @
9ac07820
...
...
@@ -84,6 +84,7 @@
import
Utils
from
'@/utils/utils'
import
User
from
'@/request/user'
;
import
Order
from
'@/request/order'
import
Menu
from
'@/request/menu'
export
default
{
data
()
{
return
{
...
...
@@ -298,13 +299,14 @@ export default {
if
(
state
==
2
){
this
.
showToast
({
title
:
'本商品已经售罄'
,
icon
:
'none'
});
this
.
getMenuList
()
return
;
}
else
{
goods
.
num
=
this
.
size
;
Utils
.
getallNum
(
goods
)
uni
.
switchTab
({
url
:
'/pages/menu/menu'
})
}
return
//
return
// const { data } = await Order.checkSku({skuId:goods.skuId})
// else{
// goods.num = this.size;
...
...
@@ -332,6 +334,7 @@ export default {
if
(
state
==
2
){
this
.
showToast
({
title
:
'本商品已经售罄'
,
icon
:
'none'
});
this
.
getMenuList
()
return
;
}
else
{
goods
.
num
=
this
.
size
...
...
@@ -339,6 +342,18 @@ export default {
uni
.
navigateTo
({
url
:
`/orderSubPackage/pages/settlement/index?buyType=1&goodsList=1`
})
}
},
async
getMenuList
()
{
const
shopId
=
uni
.
getStorageSync
(
'shopData'
).
id
let
{
data
}
=
await
Menu
.
getMenuList
(
shopId
);
// console.log("menus:"+JSON.stringify(data));
if
(
data
.
code
==
200
)
{
data
.
data
=
data
.
data
;
this
.
$store
.
commit
(
'setMenuAllInfo'
,
data
.
data
);
this
.
$store
.
commit
(
'setMenuCategorys'
,
data
.
data
.
categorys
);
uni
.
setStorageSync
(
'countOfOrder'
,
parseInt
(
data
.
data
.
countOfOrder
));
// this.$refs.MenuAssembly.createList(data.data.categorys)
}
},
// 付款前未登录发起授权
loginByPhoneNumber
(
e
)
{
if
(
e
.
detail
.
errMsg
==
'getPhoneNumber:ok'
)
{
...
...
pages/menu/menu.vue
View file @
9ac07820
...
...
@@ -259,8 +259,9 @@ export default {
if
(
data
.
code
==
200
)
{
data
.
data
=
data
.
data
;
this
.
$store
.
commit
(
'setMenuAllInfo'
,
data
.
data
);
this
.
$store
.
commit
(
'setMenuCategorys'
,
data
.
data
.
categorys
);
uni
.
setStorageSync
(
'countOfOrder'
,
parseInt
(
data
.
data
.
countOfOrder
));
this
.
$refs
.
MenuAssembly
.
createList
(
data
.
data
.
categorys
)
//
this.$refs.MenuAssembly.createList(data.data.categorys)
}
},
// 加入购物车数据
...
...
store/modules/menu.js
View file @
9ac07820
...
...
@@ -3,6 +3,7 @@ const menu = {
state
:
{
menuAllInfo
:
null
,
//菜单信息
orderPrePayInfo
:
null
,
//(需要和购物车数据格式一致)
setMenuCategorys
:[]
},
mutations
:
{
// 设置用户菜单信息
...
...
@@ -13,6 +14,10 @@ const menu = {
saveOrderPrePayInfo
(
state
,
orderPrePayInfo
)
{
state
.
orderPrePayInfo
=
orderPrePayInfo
;
},
// 设置首页商品信息
setMenuCategorys
(
state
,
setMenuCategorys
){
state
.
setMenuCategorys
=
setMenuCategorys
}
},
actions
:
{
...
...
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