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
f84dc333
Commit
f84dc333
authored
Apr 14, 2021
by
李俊赕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change-base
parent
23860b66
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
156 additions
and
167 deletions
+156
-167
main.js
src/main.js
+0
-1
pages.json
src/pages.json
+0
-9
index.vue
src/pages/index/index.vue
+156
-157
No files found.
src/main.js
View file @
f84dc333
...
...
@@ -3,7 +3,6 @@ import App from './App'
import
uView
from
"uview-ui"
;
import
vuexStore
from
"@/store/$u.mixin.js"
;
import
store
from
'@/store/index'
// let vuexStore = require('@/store/$u.mixin.js')
import
{
router
,
RouterMount
}
from
'@/router/index.js'
//路径换成自己的
Vue
.
config
.
productionTip
=
false
...
...
src/pages.json
View file @
f84dc333
...
...
@@ -140,15 +140,6 @@
}
}
,{
"path"
:
"components/business-card/business-card"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
}
],
"globalStyle"
:
{
"navigationBarTextStyle"
:
"black"
,
...
...
src/pages/index/index.vue
View file @
f84dc333
<
template
>
<view
class=
"content"
>
<scroll-view
scroll-y
style=
"height: 100%;width: 100%;"
@
scrolltolower=
"reachBottom"
@
scroll=
"handleScroll"
refresher-enabled
:refresher-triggered=
"triggered"
@
refresherrefresh=
"onRefresh"
scroll-anchoring
@
refresherrestore=
"onRestore"
>
refresher-enabled
:refresher-triggered=
"triggered"
@
refresherrefresh=
"onRefresh"
scroll-anchoring
@
refresherrestore=
"onRestore"
>
<u-swiper
:height=
"250"
:list=
"list"
:indicator-pos=
"indicatorPos"
:mode=
"mode"
:interval=
"3000"
@
click=
"clickSwiper"
>
@
click=
"clickSwiper"
>
</u-swiper>
<view>
<text
class=
"title"
>
最新消息
</text>
...
...
@@ -34,7 +34,7 @@
<view
v-else
>
<text
class=
"title"
>
当前订单
{{
count
}}
笔\n入驻通过后,平台将向您推荐订单
</text>
<u-button
class=
"settle-button"
type=
"primary"
shape=
"circle"
@
click=
"immediatelyIn"
:custom-style=
"buttonStyle"
>
:custom-style=
"buttonStyle"
>
立即入驻
</u-button>
</view>
...
...
@@ -45,180 +45,179 @@
</
template
>
<
script
>
import
util
from
'@/utils/util.js'
;
import
util
from
'@/utils/util.js'
;
const
app
=
getApp
();
import
OrderCell
from
'@/components/order/index.vue'
const
app
=
getApp
();
import
OrderCell
from
'@/components/order/index.vue'
export
default
{
components
:
{
OrderCell
},
data
()
{
return
{
settled
:
false
,
triggered
:
false
,
list
:
[{
image
:
'https://cdn.uviewui.com/uview/swiper/1.jpg'
,
},
{
image
:
'https://cdn.uviewui.com/uview/swiper/2.jpg'
,
},
{
image
:
'https://cdn.uviewui.com/uview/swiper/3.jpg'
,
}
],
title
:
false
,
mode
:
'round'
,
indicatorPos
:
'bottomCenter'
,
title
:
'Hello'
,
count
:
0
,
// 推荐订单数量
status
:
0
,
// 入驻状态
messageList
:
[{
id
:
1234
,
type
:
''
,
level
:
''
,
title
:
''
,
url
:
''
,
body
:
'好消息'
,
},
{
id
:
1234
,
type
:
''
,
level
:
''
,
title
:
''
,
url
:
''
,
body
:
'好消息'
,
},
{
id
:
1234
,
type
:
''
,
level
:
''
,
title
:
''
,
url
:
''
,
body
:
'好消息'
,
}],
loadStatus
:
[
'more'
,
'loading'
,
'noMore'
],
currentLoadStatus
:
'loading'
,
orderList
:
[{},
{},
{},
{},
{},
{},
{},
{},
{},
{}],
bottomLoading
:
false
}
},
computed
:
{
buttonStyle
()
{
export
default
{
components
:
{
OrderCell
},
data
()
{
return
{
'width'
:
'300rpx'
,
settled
:
false
,
triggered
:
false
,
list
:
[{
image
:
'https://cdn.uviewui.com/uview/swiper/1.jpg'
,
},
{
image
:
'https://cdn.uviewui.com/uview/swiper/2.jpg'
,
},
{
image
:
'https://cdn.uviewui.com/uview/swiper/3.jpg'
,
}
],
title
:
false
,
mode
:
'round'
,
indicatorPos
:
'bottomCenter'
,
title
:
'Hello'
,
count
:
0
,
// 推荐订单数量
status
:
0
,
// 入驻状态
messageList
:
[{
id
:
1234
,
type
:
''
,
level
:
''
,
title
:
''
,
url
:
''
,
body
:
'好消息'
,
},
{
id
:
1234
,
type
:
''
,
level
:
''
,
title
:
''
,
url
:
''
,
body
:
'好消息'
,
},
{
id
:
1234
,
type
:
''
,
level
:
''
,
title
:
''
,
url
:
''
,
body
:
'好消息'
,
}],
loadStatus
:
[
'more'
,
'loading'
,
'noMore'
],
currentLoadStatus
:
'loading'
,
orderList
:
[{},
{},
{},
{},
{},
{},
{},
{},
{},
{}],
bottomLoading
:
false
}
}
},
onLoad
()
{
this
.
_freshing
=
false
;
this
.
triggered
=
true
;
},
onShow
()
{
// 每次进入页面都刷新入驻状态
if
(
app
.
globalData
.
token
)
{
this
.
initSettleInfo
()
}
},
methods
:
{
async
initSettleInfo
()
{
const
callBack
=
(
vm
,
result
)
=>
{
// 后台自动判断入驻流程是否完成,前台通过settled确定状态
if
(
result
&&
result
.
settled
)
{
vm
.
settled
=
result
.
settled
}
else
{
vm
.
settled
=
false
},
computed
:
{
buttonStyle
()
{
return
{
'width'
:
'300rpx'
,
}
}
await
app
.
getBaseInfo
(
this
,
callBack
)
},
onRefresh
()
{
if
(
this
.
_freshing
)
return
;
this
.
_freshing
=
true
;
// 加载数据
// ...
setTimeout
(()
=>
{
// 数据加载完成更新status和推荐列表
this
.
triggered
=
false
;
this
.
_freshing
=
false
;
},
1000
)
onLoad
()
{
this
.
_freshing
=
false
;
this
.
triggered
=
true
;
},
onRestore
()
{
this
.
triggered
=
'restore'
;
},
reachBottom
()
{
console
.
log
(
'-----bottom will-----'
)
if
(
this
.
bottomLoading
||
this
.
currentLoadStatus
==
this
.
loadStatus
[
2
])
{
return
onShow
()
{
// 每次进入页面都刷新入驻状态
if
(
app
.
globalData
.
token
)
{
this
.
initSettleInfo
()
}
console
.
log
(
'-----bottom did-----'
)
},
methods
:
{
async
initSettleInfo
()
{
const
callBack
=
(
vm
,
result
)
=>
{
// 后台自动判断入驻流程是否完成,前台通过settled确定状态
if
(
result
&&
result
.
settled
)
{
vm
.
settled
=
result
.
settled
}
else
{
vm
.
settled
=
false
}
}
await
app
.
getBaseInfo
(
this
,
callBack
)
},
onRefresh
()
{
if
(
this
.
_freshing
)
return
;
this
.
_freshing
=
true
;
// 加载数据
// ...
this
.
bottomLoading
=
true
setTimeout
(()
=>
{
// 数据加载完成更新status和推荐列表
this
.
triggered
=
false
;
this
.
_freshing
=
false
;
},
1000
)
},
onRestore
()
{
this
.
triggered
=
'restore'
;
},
reachBottom
()
{
console
.
log
(
'-----bottom will-----'
)
if
(
this
.
bottomLoading
||
this
.
currentLoadStatus
==
this
.
loadStatus
[
2
])
{
return
}
console
.
log
(
'-----bottom did-----'
)
setTimeout
(()
=>
{
// 加载更多数据
// ...
this
.
orderList
.
push
(...[{},
{},
{},
{},
{},
{},
{},
{},
{},
{}])
this
.
bottomLoading
=
true
// 加载完成
this
.
currentLoadStatus
=
this
.
loadStatus
[
2
]
this
.
$nextTick
(
function
()
{
this
.
bottomLoading
=
false
})
},
1000
);
},
clickSwiper
(
index
)
{
setTimeout
(()
=>
{
// 加载更多数据
// ...
this
.
orderList
.
push
(...[{},
{},
{},
{},
{},
{},
{},
{},
{},
{}])
},
handleScroll
()
{
console
.
log
(
'-----scroll-------'
)
},
immediatelyIn
()
{
if
(
util
.
getToken
())
{
uni
.
navigateTo
({
url
:
'pages/settle/index'
});
}
else
{
uni
.
navigateTo
({
url
:
'pages/login/index'
});
// 加载完成
this
.
currentLoadStatus
=
this
.
loadStatus
[
2
]
this
.
$nextTick
(
function
()
{
this
.
bottomLoading
=
false
})
},
1000
);
},
clickSwiper
(
index
)
{
},
handleScroll
()
{
console
.
log
(
'-----scroll-------'
)
},
immediatelyIn
()
{
if
(
util
.
getToken
())
{
uni
.
navigateTo
({
url
:
'pages/settle/index'
});
}
else
{
uni
.
navigateTo
({
url
:
'pages/login/index'
});
}
}
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.content
{
height
:
100vh
;
}
.content
{
height
:
100vh
;
}
.logo
{
height
:
200
rpx
;
width
:
100%
;
margin
:
0
rpx
auto
50
rpx
auto
;
}
.logo
{
height
:
200
rpx
;
width
:
100%
;
margin
:
0
rpx
auto
50
rpx
auto
;
}
.text-area
{
display
:
flex
;
justify-content
:
center
;
}
.text-area
{
display
:
flex
;
justify-content
:
center
;
}
.title
{
font-size
:
36
rpx
;
color
:
#8f8f94
;
}
.title
{
font-size
:
36
rpx
;
color
:
#8f8f94
;
}
.sticky
{
height
:
120
rpx
;
background-color
:
#2979ff
;
color
:
#fff
;
padding
:
24
rpx
;
text-align
:
left
;
}
.sticky
{
height
:
120
rpx
;
background-color
:
#2979ff
;
color
:
#fff
;
padding
:
24
rpx
;
text-align
:
left
;
}
.order-view
{
text-align
:
center
;
}
</
style
>
.order-view
{
text-align
:
center
;
}
</
style
>
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