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
7b2e7c08
Commit
7b2e7c08
authored
May 14, 2022
by
zhangcheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加首页店铺ui,功能未完成
parent
6d7235bc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
26 deletions
+79
-26
menuSubPackage/pages/goodsDetail/goodsDetail.vue
+14
-6
pages.json
+9
-10
pages/menu/menu.vue
+52
-6
request/index.js
+3
-3
request/menu/index.js
+1
-1
No files found.
menuSubPackage/pages/
demo/demo
.vue
→
menuSubPackage/pages/
goodsDetail/goodsDetail
.vue
View file @
7b2e7c08
<
template
>
<view>
详情页
</view>
</
template
>
<
script
>
export
default
{
}
export
default
{
data
()
{
return
{
}
},
methods
:
{
}
}
</
script
>
<
style
>
</
style
>
\ No newline at end of file
</
style
>
pages.json
View file @
7b2e7c08
...
...
@@ -42,16 +42,15 @@
"root"
:
"menuSubPackage"
,
"pages"
:
[
{
"path"
:
"pages/demo/demo"
,
"style"
:
{
//
"navigationBarBackgroundColor"
:
""
,
//
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
//
"navigationStyle"
:
"custom"
}
}
]
"path"
:
"pages/goodsDetail/goodsDetail"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
}
]
},
{
"root"
:
"orderSubPackage"
,
...
...
pages/menu/menu.vue
View file @
7b2e7c08
...
...
@@ -2,6 +2,14 @@
<view
class=
"menu-box"
:style=
"
{height:`${height}px`}">
<view
class=
"menu-banner"
>
<image
src=
"../../static/imgs/banner.png"
></image>
<view
class=
"shop-info"
:style=
"
{top: `${menuINfo.top}px`}">
<view
class=
"shop-box"
:style=
"
{height: `${menuINfo.height}px`,'line-height': `${menuINfo.height}px`}" @click="getLocation">
<text
class=
"shop-name"
>
北京国贸银泰中心店
</text>
<u-icon
name=
"arrow-right"
class=
"arrow-right-select"
color=
"#FFFFFF"
></u-icon>
</view>
<view
class=
"distance"
>
距您130m
</view>
</view>
<view
class=
"login-area"
>
<view
class=
"avatar"
><image
:src=
"'../../static/logo.png'"
></image></view>
<view
class=
"user-info"
>
...
...
@@ -45,7 +53,7 @@
>
<view
v-for=
"(category, index) in classifyData"
:key=
"index"
class=
"box"
>
<view
class=
"right-title"
>
{{
category
.
name
}}
</view>
<view
class=
"nav-right-item"
v-for=
"(item, i) in category.goods"
:key=
"item.goodsId"
@
click=
"cart(item
.name
)"
>
<view
class=
"nav-right-item"
v-for=
"(item, i) in category.goods"
:key=
"item.goodsId"
@
click=
"cart(item)"
>
<image
class=
"thumbnail"
:src=
"item.pics.thumbnail"
/>
<view
class=
"info"
>
<view
class=
"goods-name"
>
{{
item
.
name
}}
</view>
...
...
@@ -105,6 +113,7 @@ import Menu from '@/request/menu'
},
created
()
{
this
.
menuINfo
=
uni
.
getMenuButtonBoundingClientRect
();
console
.
log
(
this
.
menuINfo
,
77766
)
//如果你的分类数据为后台异步获取请 将下方代码放置你的数据回调中
// this.$nextTick(()=>{
// this.getHeightList();
...
...
@@ -144,6 +153,15 @@ import Menu from '@/request/menu'
uniGetUserInfo
()
{
User
.
uniGetUserInfo
();
},
getLocation
()
{
uni
.
authorize
({
scope
:
'scope.userLocation'
,
success
(
res
)
{
console
.
log
(
res
)
User
.
getLocation
();
}
})
},
async
getMenuList
()
{
let
res
=
await
Menu
.
getMenuList
();
if
(
res
.
data
.
code
==
200
){
...
...
@@ -229,10 +247,11 @@ import Menu from '@/request/menu'
this
.
scrollTop
==
this
.
arr
[
index
]
?
(
this
.
scrollTop
=
this
.
scrollTop
+
1
)
:
(
this
.
scrollTop
=
this
.
arr
[
index
]);
//防止两次相等造成点击不触发滚动时间
},
cart
:
function
(
text
)
{
uni
.
showToast
({
title
:
text
,
icon
:
"none"
});
uni
.
navigateTo
({
url
:
'/menuSubPackage/pages/goodsDetail/goodsDetail'
})
// uni.showToast({
// title: text,
// icon: "none"
// });
}
},
components
:
{
ShopCar
}
...
...
@@ -240,7 +259,34 @@ import Menu from '@/request/menu'
</
script
>
<
style
lang=
"scss"
>
.menu-box
{}
.menu-box
{
.shop-info{
position
:
absolute
;
left
:
32
rpx
;
color
:
#FFFFFF
;
.shop-box{
min-width
:
300
rpx
;
font-size
:
28
rpx
;
font-family
:
PingFangSC-Semibold
,
PingFang
SC
;
font-weight
:
600
;
display
:
flex
;
.shop-name{
flex
:
1
;
}
.arrow-right-select
{
width
:
9
rpx
;
}
}
.distance
{
height
:
46
rpx
;
font-size
:
24
rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#FFFFFF
;
line-height
:
42
rpx
;
}
}
}
.menu-banner
{
height
:
376
rpx
;
position
:
relative
;
...
...
request/index.js
View file @
7b2e7c08
...
...
@@ -30,9 +30,9 @@ uni.$u.http.interceptors.request.use((config) => { // å¯ä½¿ç”¨async await åšå¼
mask
:
true
,
});
let
Authorization
=
uni
.
getStorageSync
(
`Authorization`
);
if
(
Authorization
)
{
config
.
header
.
Authorization
=
Authorization
;
}
//
if (Authorization) {
//
config.header.Authorization = Authorization;
//
}
console
.
log
(
config
,
4444
)
if
(
!
Authorization
)
{
// 如果token不存在,return Promise.reject(config) 会取消本次请求
// return Promise.reject(config);
...
...
request/menu/index.js
View file @
7b2e7c08
...
...
@@ -3,7 +3,7 @@ export default {
getMenuList
(
id
)
{
return
uni
.
$u
.
http
.
get
(
'/weixin/infoByShop'
,
{
params
:{
shopId
:
"
4
"
shopId
:
"
6
"
}
}).
then
(
res
=>
{
return
res
;
...
...
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