Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
singleStore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Max
singleStore
Commits
49a59ee6
Commit
49a59ee6
authored
Jul 21, 2021
by
June
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed:优化自定义导航栏的计算,详情页购物车数量为0的隐藏,首页ui优化
parent
2f865155
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
54 additions
and
58 deletions
+54
-58
App.vue
App.vue
+2
-3
apis/order.js
apis/order.js
+2
-1
components/c-nav_bar/index.vue
components/c-nav_bar/index.vue
+8
-15
pages/category/index.vue
pages/category/index.vue
+2
-0
pages/goods/detail.vue
pages/goods/detail.vue
+1
-1
pages/home/components/goods-module.vue
pages/home/components/goods-module.vue
+1
-1
pages/home/index.vue
pages/home/index.vue
+10
-20
pages/mine/index.vue
pages/mine/index.vue
+1
-6
store/modules/systemInfo.js
store/modules/systemInfo.js
+27
-11
No files found.
App.vue
View file @
49a59ee6
...
...
@@ -5,9 +5,8 @@ import dayjs from 'dayjs'
import
{
removeStorage
}
from
'
@/lib/storage/index.js
'
export
default
{
onLaunch
:
function
()
{
this
.
setSystemInfo
()
// 获取系统信息
this
.
setMenuButtonInfo
()
// 获取胶囊信息
this
.
checkUpdate
()
// 检查更新
this
.
setMobileData
()
// 获取系统信息和胶囊信息
const
extConfig
=
wx
.
getExtConfigSync
?
wx
.
getExtConfigSync
():
{}
console
.
log
(
extConfig
)
...
...
@@ -33,7 +32,7 @@ export default {
},
methods
:
{
...
mapActions
(
'
systemInfo
'
,
[
'
set
SystemInfo
'
,
'
setMenuButtonInfo
'
]),
...
mapActions
(
'
systemInfo
'
,
[
'
set
MobileData
'
]),
...
mapActions
(
'
user
'
,
[
'
setToken
'
,
'
setLoginStatus
'
,
'
getStoreInfo
'
]),
// 检查更新
...
...
apis/order.js
View file @
49a59ee6
...
...
@@ -38,7 +38,8 @@ export function orderList(params) {
return
request
({
url
:
'
zsxcx/orderXcx.htm
'
,
method
:
'
post
'
,
data
:
params
data
:
params
,
needMask
:
true
})
}
...
...
components/c-nav_bar/index.vue
View file @
49a59ee6
...
...
@@ -36,26 +36,19 @@ export default {
computed
:
{
...
mapState
([
'
systemInfo
'
]),
cNavSty
()
{
const
{
systemInfo
,
menuButtonInfo
}
=
this
.
systemInfo
const
space
=
menuButtonInfo
.
top
-
systemInfo
.
statusBarHeight
return
`height:
${
menuButtonInfo
.
bottom
+
space
}
px;background-color:
${
this
.
bg
}
;color:
${
this
.
color
}
;`
const
{
menuCalcInfo
}
=
this
.
systemInfo
return
`height:
${
menuCalcInfo
.
navH
}
px;background-color:
${
this
.
bg
}
;color:
${
this
.
color
}
;`
},
backStyle
()
{
const
{
systemInfo
,
menuButtonInfo
}
=
this
.
systemInfo
const
space
=
menuButtonInfo
.
top
-
systemInfo
.
statusBarHeight
// 上下间距
const
navH
=
menuButtonInfo
.
bottom
+
space
const
titleH
=
navH
-
systemInfo
.
statusBarHeight
const
lrSpace
=
systemInfo
.
windowWidth
-
menuButtonInfo
.
right
// 左右间距
return
`height:
${
titleH
}
px;left:
${
lrSpace
}
px;`
const
{
systemInfo
,
menuCalcInfo
}
=
this
.
systemInfo
const
titleH
=
menuCalcInfo
.
navH
-
systemInfo
.
statusBarHeight
return
`height:
${
titleH
}
px;left:
${
menuCalcInfo
.
lrSpace
}
px;`
},
cTitleStyle
()
{
const
{
systemInfo
,
menuButtonInfo
}
=
this
.
systemInfo
const
space
=
menuButtonInfo
.
top
-
systemInfo
.
statusBarHeight
// 上下间距
const
navH
=
menuButtonInfo
.
bottom
+
space
const
titleH
=
navH
-
systemInfo
.
statusBarHeight
const
lrSpace
=
systemInfo
.
windowWidth
-
menuButtonInfo
.
right
// 左右间距
const
{
systemInfo
,
menuButtonInfo
,
menuCalcInfo
}
=
this
.
systemInfo
const
titleH
=
menuCalcInfo
.
navH
-
systemInfo
.
statusBarHeight
const
v
=
systemInfo
.
system
.
includes
(
'
iOS
'
)
?
'
center
'
:
'
flex-start
'
return
`height:
${
titleH
}
px;font-size:
${
systemInfo
.
fontSizeSetting
}
px;padding: 0
${
lrSpace
}
px;justify-content:
${
v
}
;margin-top:
${
systemInfo
.
statusBarHeight
}
px;`
return
`height:
${
titleH
}
px;font-size:
${
systemInfo
.
fontSizeSetting
}
px;padding: 0
${
menuCalcInfo
.
lrSpace
}
px;justify-content:
${
v
}
;margin-top:
${
systemInfo
.
statusBarHeight
}
px;`
}
},
methods
:
{
...
...
pages/category/index.vue
View file @
49a59ee6
...
...
@@ -169,11 +169,13 @@ export default {
// this.getCate()
// },
onShow
()
{
uni
.
showLoading
()
this
.
getCate
()
this
.
getCateGoods
()
if
(
this
.
token
)
{
this
.
setCount
()
}
uni
.
hideLoading
()
},
onShareAppMessage
()
{
return
{
...
...
pages/goods/detail.vue
View file @
49a59ee6
...
...
@@ -130,7 +130,7 @@
>
<image
class=
"icon mb-1"
src=
"/static/images/common/icon-cart_gray.png"
mode=
"aspectFit"
/>
<text>
购物车
</text>
<view
class=
"cart_count"
>
{{ cart_count
<
=
99
?
cart_count
:
'
99
+'
}}</
view
>
<view
class=
"cart_count"
v-if=
"cart_count !== 0"
>
{{ cart_count
<
=
99
?
cart_count
:
'
99
+'
}}</
view
>
</navigator>
<view
class=
"flex-1 left-item flex flex-column j-center a-center"
@
click=
"handleCollect(detail.is_col)"
>
<image
v-show=
"detail.is_col === 10"
class=
"icon mb-1"
src=
"/static/images/common/icon-collect_active.png"
mode=
"aspectFit"
/>
...
...
pages/home/components/goods-module.vue
View file @
49a59ee6
<
template
>
<view
class=
"w-100"
>
<view
class=
"font-bold font-36 px-3 p
y
-2"
>
{{
title
}}
</view>
<view
class=
"font-bold font-36 px-3 p
b
-2"
>
{{
title
}}
</view>
<view
class=
"list-wrap w-100 flex j-start a-center flex-wrap"
>
<navigator
class=
"list-item mb-3 ml-3"
...
...
pages/home/index.vue
View file @
49a59ee6
...
...
@@ -93,13 +93,8 @@
<search-bar
bg=
"#f8f8f8"
innerBg=
"#fff"
/>
<view
class=
"w-100 content-wrap"
>
<block
v-if=
"!cate_data.xplist.length && !cate_data.cxlist.length && !cate_data.bklist.length && !searchList.length"
>
<empty-view
iconSrc=
"/static/images/common/noGoods.png"
text=
"店铺尚未上架商品"
/>
</block>
<block
v-else
>
<block
v-if=
"cate_data.xplist.length || cate_data.cxlist.length || cate_data.bklist.length && !searchList.length"
>
<template
v-if=
"cate_data"
>
<goods-module
v-if=
"cate_data.xplist.length > 0"
...
...
@@ -165,6 +160,13 @@
</view>
</
template
>
</block>
<block
v-else
>
<empty-view
iconSrc=
"/static/images/common/noGoods.png"
text=
"店铺尚未上架商品"
/>
</block>
</view>
</template>
...
...
@@ -218,19 +220,7 @@ export default {
isOverdue
:
state
=>
state
.
user
.
isOverdue
,
token
:
state
=>
state
.
user
.
token
,
storeInfo
:
state
=>
state
.
user
.
storeInfo
}),
cH
()
{
const
{
systemInfo
,
menuButtonInfo
}
=
this
.
systemInfo
const
space
=
menuButtonInfo
.
top
-
systemInfo
.
statusBarHeight
const
cH
=
menuButtonInfo
.
bottom
+
space
return
cH
},
// scrollH() {
// const { systemInfo, menuButtonInfo } = this.systemInfo
// const space = menuButtonInfo.top - systemInfo.statusBarHeight
// const cH = menuButtonInfo.bottom + space
// return `height: ${systemInfo.windowHeight - cH}px;`
// },
})
},
created
()
{
...
...
pages/mine/index.vue
View file @
49a59ee6
...
...
@@ -130,12 +130,7 @@ export default {
...
mapState
({
token
:
state
=>
state
.
user
.
token
,
userInfo
:
state
=>
state
.
user
.
userInfo
,
// menuButtonInfo: state => state.systemInfo.menuButtonInfo
}),
// navTitleSty() {
// const menuButtonInfo = this.menuButtonInfo
// return `height:${menuButtonInfo.height}px;line-height:${menuButtonInfo.height}px;top:${menuButtonInfo.top}px;`
// }
})
},
onShow
()
{
// 获取更新用户信息
if
(
this
.
token
)
{
...
...
store/modules/systemInfo.js
View file @
49a59ee6
const
state
=
{
systemInfo
:
null
,
menuButtonInfo
:
null
menuButtonInfo
:
null
,
menuCalcInfo
:
null
}
const
mutations
=
{
SETSYSTEMINFO
(
state
,
params
){
state
.
systemInfo
=
params
},
SETMENUBUTTONINFO
(
state
,
params
)
{
state
.
menuButtonInfo
=
params
SETMOBILEDATA
(
state
,
params
)
{
state
.
systemInfo
=
params
.
systemInfo
state
.
menuButtonInfo
=
params
.
menuButtonInfo
state
.
menuCalcInfo
=
params
.
menuCalcInfo
}
}
const
actions
=
{
setSystemInfo
:
({
commit
})
=>
{
commit
(
'
SETSYSTEMINFO
'
,
uni
.
getSystemInfoSync
())
},
setMenuButtonInfo
:
({
commit
})
=>
{
commit
(
'
SETMENUBUTTONINFO
'
,
uni
.
getMenuButtonBoundingClientRect
())
setMobileData
:
({
commit
})
=>
{
try
{
const
systemInfo
=
uni
.
getSystemInfoSync
()
const
menuButtonInfo
=
uni
.
getMenuButtonBoundingClientRect
()
const
lrSpace
=
systemInfo
.
windowWidth
-
menuButtonInfo
.
right
const
btSpace
=
menuButtonInfo
.
top
-
systemInfo
.
statusBarHeight
const
menuCalcInfo
=
Object
.
freeze
({
navH
:
menuButtonInfo
.
bottom
+
btSpace
,
//导航栏高度
lrSpace
,
// 和胶囊一样的左右间距
btSpace
,
// 和胶囊一样的上下间距
})
const
params
=
Object
.
freeze
({
systemInfo
,
menuButtonInfo
,
menuCalcInfo
})
commit
(
'
SETMOBILEDATA
'
,
params
)
}
catch
(
e
){
console
.
log
(
e
)
//TODO handle the exception
}
}
}
...
...
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