Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
Project
Project
Details
Activity
Releases
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
李俊赕
self-support
Commits
fa6c0184
Commit
fa6c0184
authored
May 10, 2021
by
Morson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加默认导航组件
登录页面跳转问题修复
parent
39c1f4c6
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
163 additions
and
57 deletions
+163
-57
http.interceptor.js
src/common/http.interceptor.js
+4
-4
w-navbar.vue
src/components/w-navbar/w-navbar.vue
+75
-0
pages.json
src/pages.json
+21
-2
index.vue
src/pages/index/index.vue
+0
-1
index.vue
src/pages/login/index.vue
+6
-14
index.vue
src/pages/mine/address/index.vue
+54
-35
index.js
src/store/index.js
+3
-1
No files found.
src/common/http.interceptor.js
View file @
fa6c0184
...
...
@@ -16,11 +16,11 @@ const install = (Vue, vm) => {
function
toLoginPage
(){
const
app
=
getApp
()
let
jumpLoginStatus
=
app
&&
app
.
globalData
&&
app
.
globalData
.
jumpLoginStatus
if
(
!
jumpLoginStatus
){
return
let
curpath
=
vm
.
$Route
.
path
if
(
curpath
==
'/pages/login/index'
)
{
// 如果已经在登录页,无需再次跳转
return
false
}
app
.
globalData
.
jumpLoginStatus
=
false
vm
.
$u
.
route
(
'/pages/login/index'
);
}
Vue
.
prototype
.
$u
.
http
.
setConfig
({
...
...
src/components/w-navbar/w-navbar.vue
0 → 100644
View file @
fa6c0184
<
template
>
<u-navbar
:height=
"40"
:background=
"background"
:back-icon-color=
"navbarColor"
:title=
"title"
:titleColor=
"navbarColor"
:is-back=
"isBack"
:is-fixed=
"isFixed"
:title-bold=
"true"
:border-bottom=
"false"
>
</u-navbar>
</
template
>
<
script
>
/**
* navbar 自定义导航栏
* @description 此组件一般用于在特殊情况下,需要自定义导航栏的时候用到,一般建议使用uniapp自带的导航栏。
* @tutorial https://www.uviewui.com/components/navbar.html
* @property {String Number} height 导航栏高度(不包括状态栏高度在内,内部自动加上),注意这里的单位是px(默认40)
* @property {String} navbar-Color 导航栏内容的颜色(默认#333333)
* @property {String} title 导航栏标题,如设置为空字符,将会隐藏标题占位区域
* @property {String Number} title-width 导航栏标题的最大宽度,内容超出会以省略号隐藏,单位rpx(默认250)
* @property {Boolean} is-back 是否显示导航栏左边返回图标和辅助文字(默认true)
* @property {Object} background 导航栏背景设置,见官网说明(默认{ background: '#ffffff' })
* @property {Boolean} is-fixed 导航栏是否固定在顶部(默认true)
* @example <w-navbar title="剑未配妥,出门已是江湖"></w-navbar>
*/
export
default
{
name
:
"w-navbar"
,
props
:
{
height
:
{
type
:
String
,
default
:
"40"
},
background
:
{
type
:
Object
,
default
(){
return
{
backgroundColor
:
'none'
}
}
},
navbarColor
:
{
type
:
String
,
default
:
"#333333"
},
title
:
{
type
:
String
,
default
:
""
},
titleBold
:
{
type
:
Boolean
,
default
:
true
},
isBack
:
{
type
:
Boolean
,
default
:
true
},
isFixed
:
{
type
:
Boolean
,
default
:
true
},
},
data
()
{
return
{
};
}
}
</
script
>
<
style
lang=
"scss"
>
</
style
>
src/pages.json
View file @
fa6c0184
...
...
@@ -137,7 +137,26 @@
},
{
"root"
:
"pages/mine"
,
"pages"
:
[]
"pages"
:
[
{
"path"
:
"address/index"
,
"style"
:
{
"navigationBarTitleText"
:
"收获地址"
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"disableScroll"
:
true
}
},
{
"path"
:
"address/addSite"
,
"style"
:
{
"navigationBarTitleText"
:
"修改地址"
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"disableScroll"
:
true
}
}
]
},
{
"root"
:
"pages/order"
,
...
...
@@ -323,7 +342,7 @@
"preloadRule"
:
{
"pages/index/index"
:
{
"network"
:
"all"
,
"packages"
:
[
"pages/order"
,
"pages/learn"
]
"packages"
:
[
"pages/order"
,
"pages/learn"
,
"pages/mine"
]
}
},
"globalStyle"
:
{
...
...
src/pages/index/index.vue
View file @
fa6c0184
...
...
@@ -108,7 +108,6 @@
watch
:
{
vuex_token
(
val
,
oldVal
)
{
// 监听token变化,如果更新则重新加载页面数据
console
.
log
(
''
,
val
,
oldVal
)
val
&&
this
.
initSettleInfo
()
}
},
...
...
src/pages/login/index.vue
View file @
fa6c0184
...
...
@@ -113,9 +113,6 @@ export default {
signupLogin
(
e
)
{
var
that
=
this
console
.
log
(
e
.
detail
.
errMsg
)
console
.
log
(
e
.
detail
.
iv
)
console
.
log
(
e
.
detail
.
encryptedData
)
if
(
!
e
||
!
e
.
detail
||
e
.
detail
.
errMsg
.
indexOf
(
'user deny'
)
>
-
1
)
{
wx
.
showModal
({
title
:
'提示'
,
...
...
@@ -157,22 +154,17 @@ export default {
goBackPage
()
{
let
pages
=
getCurrentPages
();
debugger
if
(
pages
.
length
)
{
let
index
=
pages
.
length
-
1
;
if
(
index
)
{
let
prevPage
=
pages
[
index
];
//上一个页面
if
(
prevPage
.
route
==
"pages/login/index"
)
{
uni
.
redirectTo
({
url
:
'pages/index/index'
})
}
else
{
if
(
prevPage
&&
prevPage
.
$vm
)
{
prevPage
.
$vm
.
isRefresh
=
true
;
}
uni
.
navigateBack
({
delta
:
1
})
}
}
else
{
uni
.
redirectTo
({
url
:
'pages/index/index'
...
...
src/pages/mine/address/index.vue
View file @
fa6c0184
<
template
>
<view>
<view
class=
"item"
v-for=
"(res, index) in siteList"
:key=
"res.id"
>
<view
class=
"address-wrap"
>
<w-navbar
title=
"收货地址"
></w-navbar>
<view
class=
"item"
v-for=
"(res, sindex) in siteList"
:key=
"res.id"
>
<view
class=
"top"
>
<view
class=
"name"
>
{{
res
.
name
}}
</view>
<view
class=
"phone"
>
{{
res
.
phone
}}
</view>
<view
class=
"tag"
>
<text
v-for=
"(item, index) in res.tag"
:key=
"index"
:class=
"
{red:item.tagText=='默认'}">
{{
item
.
tagText
}}
</text>
</view>
</view>
<view
class=
"bottom"
>
广东省深圳市宝安区 自由路66号
<u-icon
name=
"edit-pen"
:size=
"40"
color=
"#999999"
></u-icon>
<view
class=
"address"
>
广东省深圳市宝安区宝城67区留芳路6号庭威产业园3栋10C
</view>
<u-icon
:name=
"editPen"
:size=
"32"
color=
"#999999"
></u-icon>
</view>
<view
class=
"default"
v-show=
"true"
>
<u-icon
name=
"checkmark-circle"
color=
"#2272FF"
size=
"32"
></u-icon>
<text
class=
"txt"
>
默认地址
</text>
</view>
</view>
<view
class=
"addSite"
@
tap=
"toAddSite"
>
...
...
@@ -25,12 +27,20 @@
export
default
{
data
()
{
return
{
background
:
{
backgroundColor
:
'none'
},
siteList
:
[]
};
},
onLoad
()
{
this
.
getData
();
},
computed
:
{
editPen
()
{
return
process
.
uniEnv
.
qn_base_url
+
'icon/edit-pen.png'
}
},
methods
:
{
getData
()
{
this
.
siteList
=
[
...
...
@@ -46,7 +56,7 @@ export default {
tagText
:
'家'
}
],
site
:
'广东省深圳市宝安区
自由路66号
'
site
:
'广东省深圳市宝安区
宝城67区留芳路6号庭威产业园3栋10C
'
},
{
id
:
2
,
...
...
@@ -70,7 +80,7 @@ export default {
},
toAddSite
(){
uni
.
navigateTo
({
url
:
'/pages/
templat
e/address/addSite'
url
:
'/pages/
min
e/address/addSite'
});
}
}
...
...
@@ -78,42 +88,51 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.address-wrap
{
background-color
:
#F4F5F7
;
}
.item
{
padding
:
40rpx
20rpx
;
margin
:
30rpx
;
padding
:
50rpx
30rpx
48rpx
30rpx
;
background-color
:
#FFFFFF
;
border-radius
:
12px
;
.top
{
display
:
flex
;
font-size
:
32rpx
;
font-weight
:
bold
;
font-size
:
34rpx
;
color
:
#333333
;
line-height
:
32rpx
;
.phone
{
margin-left
:
60rpx
;
}
.tag
{
display
:
flex
;
font-weight
:
normal
;
align-items
:
center
;
text
{
display
:
block
;
width
:
60rpx
;
height
:
34rpx
;
line-height
:
34rpx
;
color
:
#ffffff
;
font-size
:
20rpx
;
border-radius
:
6rpx
;
text-align
:
center
;
margin-left
:
30rpx
;
background-color
:rgb
(
49
,
145
,
253
)
;
}
.red
{
background-color
:red
}
margin-left
:
20rpx
;
font-size
:
28rpx
;
font-weight
:
400
;
color
:
#666666
;
}
}
.bottom
{
display
:
flex
;
margin-top
:
20rpx
;
font-size
:
28rpx
;
margin-top
:
24rpx
;
justify-content
:
space-between
;
color
:
#999999
;
align-items
:
flex-start
;
font-size
:
28rpx
;
font-weight
:
400
;
color
:
#333333
;
.address
{
max-width
:
500rpx
;
line-height
:
40rpx
;
}
}
.default
{
border-top
:
2rpx
solid
#F4F5F7
;
margin-top
:
22rpx
;
padding-top
:
30rpx
;
.txt
{
margin-left
:
12rpx
;
font-size
:
28rpx
;
font-weight
:
400
;
color
:
#333333
;
line-height
:
28rpx
;
}
}
}
.addSite
{
...
...
src/store/index.js
View file @
fa6c0184
...
...
@@ -34,6 +34,8 @@ const store = new Vuex.Store({
vuex_token
:
lifeData
.
vuex_token
?
lifeData
.
vuex_token
:
''
,
vuex_version
:
'1.0.1'
,
vuex_config
:
{},
// 入驻信息
vuex_settled
:
{},
vuex_wx_uid
:
lifeData
.
vuex_wx_uid
||
0
,
},
mutations
:
{
...
...
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