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
3c8038f6
Commit
3c8038f6
authored
Apr 20, 2021
by
Morson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页与入驻页面对接
parent
98eac386
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
94 additions
and
52 deletions
+94
-52
App.vue
src/App.vue
+7
-2
index.js
src/common/api/index.js
+4
-1
order.js
src/common/api/order.js
+11
-0
settled.js
src/common/api/settled.js
+5
-1
pages.json
src/pages.json
+0
-5
index.vue
src/pages/index/index.vue
+63
-41
prompt.vue
src/pages/settle/prompt.vue
+2
-2
login.js
src/utils/login.js
+2
-0
No files found.
src/App.vue
View file @
3c8038f6
...
...
@@ -46,10 +46,12 @@
that
.
globalData
.
token
=
util
.
getToken
()
AnalysysAgent
.
registerSuperProperty
(
"platform"
,
"self-support"
);
// 应用启动,或从后台进入前台显示
this
.
autoLogin
()
},
onShow
:
function
()
{
// 应用启动,或从后台进入前台显示
this
.
autoLogin
()
//
this.autoLogin()
},
onHide
:
function
()
{
// 应用从前台进入后台
...
...
@@ -73,7 +75,9 @@
if
(
!
res
.
data
)
{
return
}
callBack
(
vm
,
res
.
data
)
if
(
typeof
callBack
==
'function'
)
{
callBack
(
vm
,
res
.
data
)
}
uni
.
hideLoading
()
return
res
.
data
...
...
@@ -95,6 +99,7 @@
if
(
result
)
{
if
(
result
.
code
==
200
&&
result
.
data
)
{
that
.
setUserData
(
result
.
data
)
that
.
getBaseInfo
(
that
)
}
}
else
{
uni
.
showModal
({
...
...
src/common/api/index.js
View file @
3c8038f6
...
...
@@ -8,16 +8,19 @@ import {
settledApiFun
}
from
'@/common/api/settled.js'
;
import
{
learnApiFun
}
from
"@/common/api/learn.js"
;
import
{
orderApiFun
}
from
"@/common/api/order.js"
;
let
apiFun
=
function
(
vm
)
{
let
commonApi
=
commonApiFun
(
vm
);
let
settledApi
=
settledApiFun
(
vm
)
let
cloudApi
=
cloudRulesApiFun
(
vm
)
let
learnApi
=
learnApiFun
(
vm
)
let
orderApi
=
orderApiFun
(
vm
)
let
apiUrl
=
{
...
commonApi
,
...
settledApi
,
...
cloudApi
,
...
learnApi
...
learnApi
,
...
orderApi
,
}
return
apiUrl
}
...
...
src/common/api/order.js
0 → 100644
View file @
3c8038f6
let
orderApiFun
=
function
(
vm
){
let
listByRecommendOrder
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/wxh-worker-rest/rest/recommend/order'
,
params
);
const
orderApi
=
{
listByRecommendOrder
,
}
return
orderApi
}
module
.
exports
=
{
orderApiFun
}
\ No newline at end of file
src/common/api/settled.js
View file @
3c8038f6
...
...
@@ -36,7 +36,10 @@ let settledApiFun = function(vm){
let
listOrderingTutorials
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
ucenterApiUrl
+
'/v1/settled/get-course-rate'
,
params
);
/* 更新接单教程状态 */
let
saveCourseRate
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
ucenterApiUrl
+
'/v1/settled/save-course-rate'
,
params
);
let
saveCourseRate
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
ucenterApiUrl
+
'/v1/settled/save-course-rate'
,
params
);
/* 获取消息内容列表 */
let
listByNotice
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
ucenterApiUrl
+
'/v1/notice/list'
,
params
);
const
settledApi
=
{
getSettleBaseInfo
,
...
...
@@ -52,6 +55,7 @@ let settledApiFun = function(vm){
checkSettleSignInfo
,
listOrderingTutorials
,
saveCourseRate
,
listByNotice
,
}
return
settledApi
}
...
...
src/pages.json
View file @
3c8038f6
...
...
@@ -254,11 +254,6 @@
"path"
:
"pages/settle/sign-contract"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
},
{
"name"
:
"订单列表"
,
//模式名称
"path"
:
"pages/order/index"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
},
{
"name"
:
"订单 - 完工配置"
,
//模式名称
"path"
:
"pages/order/complete"
,
//启动页面,必选
...
...
src/pages/index/index.vue
View file @
3c8038f6
...
...
@@ -38,18 +38,8 @@
<!-- 入驻成功之后显示推荐订单列表 -->
<view
class=
"order-list-view"
>
<view
v-if=
"status == 7 && orderList.length > 0"
class=
"order-item-view"
>
<view
v-for=
"(item, index) in orderList"
:key=
"index"
>
<OrderCell
:orderData=
"item"
>
</OrderCell>
</view>
<u-loadmore
:status=
"currentLoadStatus"
bgColor=
"#f2f2f2"
></u-loadmore>
</view>
<!-- 入驻成功之后无推荐订单 -->
<view
v-else-if=
"status == 7 && orderList.length
<
=
0
"
class=
"no-order-view"
>
暂无订单
</view>
<!-- 入驻前-->
<view
v-
else-if=
"load
ed"
class=
"tip-view"
>
<view
v-
if=
"needSettl
ed"
class=
"tip-view"
>
<view
class=
"tip-title"
>
当前订单(笔)
</view>
<view
class=
"tip-count"
>
{{
count
}}
</view>
<view
class=
"tip-other"
>
入驻通过后平台将向您推荐订单
</view>
...
...
@@ -58,6 +48,16 @@
立即入驻
</u-button>
</view>
<view
v-else-if=
"!needSettled && orderList.length > 0"
class=
"order-item-view"
>
<view
v-for=
"(item, index) in orderList"
:key=
"index"
>
<OrderCell
:orderData=
"item"
>
</OrderCell>
</view>
<u-loadmore
:status=
"currentLoadStatus"
bgColor=
"#f2f2f2"
></u-loadmore>
</view>
<!-- 入驻成功之后无推荐订单 -->
<view
v-else-if=
"!needSettled && orderList.length
<
=
0
"
class=
"no-order-view"
>
暂无订单
</view>
</view>
</view>
</view>
...
...
@@ -94,38 +94,22 @@
indicatorPos
:
"bottomCenter"
,
title
:
"Hello"
,
loaded
:
false
,
needSettled
:
true
,
count
:
0
,
// 推荐订单数量
messageList
:
[{
id
:
1234
,
type
:
""
,
level
:
""
,
title
:
""
,
url
:
""
,
body
:
"好消息"
,
},
{
id
:
1234
,
type
:
""
,
level
:
""
,
title
:
""
,
url
:
""
,
body
:
"好消息"
,
},
{
id
:
1234
,
type
:
""
,
level
:
""
,
title
:
""
,
url
:
""
,
body
:
"好消息"
,
},
],
messageList
:
[],
loadStatus
:
[
"more"
,
"loading"
,
"noMore"
],
currentLoadStatus
:
"loading"
,
orderList
:
[{},
{},
{},
{},
{},
{},
{},
{},
{},
{}],
search
:
{
token
:
app
.
globalData
.
token
||
''
,
pageNumber
:
0
,
pageSize
:
10
,
},
bottomLoading
:
false
,
};
},
watch
:
{},
computed
:
{
buttonStyle
()
{
return
{
...
...
@@ -150,21 +134,58 @@
onShow
()
{
// 每次进入页面都刷新入驻状态
if
(
app
.
globalData
.
token
)
{
//
获取是否显示入驻按钮
//
初始化入驻信息
this
.
initSettleInfo
();
}
else
{
// 初始化订单数据
this
.
loadOrderList
()
}
},
methods
:
{
async
initSettleInfo
()
{
if
(
this
.
status
==
7
)
return
;
let
self
=
this
if
(
self
.
status
==
7
)
return
;
const
callBack
=
(
vm
,
result
)
=>
{
// 后台自动判断入驻流程是否完成,前台通过status确定状态
if
(
result
&&
result
.
record
)
{
vm
.
loaded
=
true
;
vm
.
status
=
Number
(
result
.
record
.
status
);
vm
.
needSettled
=
result
.
needSettled
}
};
await
app
.
getBaseInfo
(
this
,
callBack
);
await
app
.
getBaseInfo
(
self
,
callBack
);
// 加载消息列表
self
.
loadMessageList
()
self
.
loadOrderList
()
},
loadMessageList
()
{
let
self
=
this
self
.
$u
.
api
.
listByNotice
().
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
data
&&
res
.
data
.
length
>
3
)
{
self
.
messageList
=
res
.
data
.
slice
(
0
,
3
)
}
else
{
self
.
messageList
=
res
.
data
||
[]
}
}
else
{
console
.
log
(
res
.
message
,
"初始化消息列表异常"
);
}
})
},
loadOrderList
()
{
let
self
=
this
// 加载订单列表
self
.
search
.
token
=
app
.
globalData
.
token
self
.
$u
.
api
.
listByRecommendOrder
(
self
.
search
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
data
&&
res
.
data
.
length
>
0
)
{
self
.
orderList
.
push
().
apply
(
res
.
data
)
}
}
else
{
console
.
log
(
res
.
message
,
"初始化订单列表异常"
);
}
})
},
onRefresh
()
{
if
(
this
.
_freshing
)
return
;
...
...
@@ -212,9 +233,9 @@
console
.
log
(
"-----scroll-------"
);
},
immediatelyIn
()
{
if
(
util
.
getToken
())
{
if
(
util
.
getToken
()
&&
this
.
needSettled
)
{
uni
.
navigateTo
({
url
:
this
.
status
>
0
?
"/pages/settle/prompt"
:
"/pages/settle/index
"
,
url
:
!
this
.
status
?
"/pages/settle/index"
:
"/pages/settle/prompt
"
,
});
}
else
{
uni
.
navigateTo
({
...
...
@@ -257,6 +278,7 @@
border-radius
:
12rpx
;
background-color
:
#FFFFFF
;
padding
:
6rpx
30rpx
;
height
:
268rpx
;
}
.msg-content
{
...
...
src/pages/settle/prompt.vue
View file @
3c8038f6
...
...
@@ -8,11 +8,11 @@
</image>
</view>
<view
class=
"txt-box"
>
<text
:class=
"['title',
{failed: status == 4} ,index ? 'active' : '']" v-for="(txt,index) in info.txtArr">
{{
txt
}}
</text>
<text
:class=
"['title',
{failed: status == 4} ,index ? 'active' : '']" v-for="(txt,index) in info.txtArr"
:key="index"
>
{{
txt
}}
</text>
</view>
<view
class=
"tips-box"
v-if=
"info.tipsArr"
>
<text
:class=
"['tips',info.tipsArr.length>1 && index===0 ? 'red' : '']"
v-for=
"(txt,index) in info.tipsArr"
>
{{
txt
}}
</text>
v-for=
"(txt,index) in info.tipsArr"
:key=
"index"
>
{{
txt
}}
</text>
</view>
<view
class=
"services-view"
>
<Services/>
...
...
src/utils/login.js
View file @
3c8038f6
...
...
@@ -33,6 +33,7 @@ function authorization(data) {
if
(
res
)
{
if
(
res
.
code
==
200
&&
res
.
data
)
{
app
.
setUserData
(
res
.
data
)
app
.
getBaseInfo
(
app
.
$vm
)
resolve
(
res
);
}
else
{
reject
(
res
);
...
...
@@ -53,6 +54,7 @@ function signup(data) {
if
(
res
)
{
if
(
res
.
code
==
200
&&
res
.
data
)
{
app
.
setUserData
(
res
.
data
)
app
.
getBaseInfo
(
app
.
$vm
)
resolve
(
res
);
}
else
{
uni
.
showModal
({
...
...
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