Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xinrenli-app
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑云飞
xinrenli-app
Commits
2b28a6b6
Commit
2b28a6b6
authored
Mar 17, 2023
by
honghong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口对接方式
parent
041dd035
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
149 additions
and
54 deletions
+149
-54
components/form.vue
+60
-21
demand/index/index.vue
+1
-1
demand/updateForm/updateForm.vue
+33
-5
pages/demand/components/index.vue
+25
-8
pages/home/index.vue
+11
-6
pages/order/index.vue
+17
-11
pages/release/index.vue
+2
-2
No files found.
components/form.vue
View file @
2b28a6b6
...
...
@@ -2,7 +2,8 @@
<view>
<view
class=
"content"
>
<view
class=
"content-form"
>
<u--form
:label-style=
"
{'font-size':'26rpx'}" label-position="top" labelWidth="150" :model="formInfo" ref="form" :rules="rules">
<u--form
:label-style=
"
{'font-size':'26rpx'}" label-position="top" labelWidth="150" :model="formInfo"
ref="form" :rules="rules">
<u-form-item
required
label=
"标题"
prop=
"title"
borderBottom
:customStyle=
"
{
'flex-direction': 'row !important'}">
<u--input
fontSize=
"24rpx"
placeholderStyle=
"color: #999"
inputAlign=
"right"
border=
"none"
...
...
@@ -52,7 +53,7 @@
<view>
<view
class=
"d-flex j-sb a-center form-item-height-only"
>
<view
class=
"form-item-name"
>
上传图片
</view>
<view
class=
"form-tips"
>
一
下内容三选一必填
</view>
<view
class=
"form-tips"
>
以
下内容三选一必填
</view>
</view>
<view
class=
""
>
<comUpload></comUpload>
...
...
@@ -80,11 +81,11 @@
<view>
添加语音描述
</view>
</view>
</view>
<u-popup
:show=
"showPopup"
@
close=
"handleClosePopup"
@
open=
"handleOpenPopup"
>
<
!--
<
u-popup
:show=
"showPopup"
@
close=
"handleClosePopup"
@
open=
"handleOpenPopup"
>
<view
class=
"padding-y-two"
>
<recordCom></recordCom>
</view>
</u-popup>
</u-popup>
-->
</view>
</view>
...
...
@@ -98,7 +99,9 @@
</u--form>
</view>
</view>
<view
class=
"submit-btn"
@
click=
"handlePublish"
>
发布需求
</view>
<view
v-if=
"statusBtn == -1"
class=
"submit-btn"
@
click=
"handlePublish"
>
发布需求
</view>
<view
class=
"submit-btn"
v-else-if=
"statusBtn == 0"
@
click=
"handleUpdateForm"
>
确认修改
</view>
<view
class=
"submit-btn"
v-else-if=
"statusBtn == 1"
@
click=
"handleUpdateForm"
>
重新发布
</view>
</view>
</
template
>
...
...
@@ -111,6 +114,10 @@
freeAudio
,
recordCom
,
},
props
:
{
statusBtn
:
Number
,
detailData
:
Object
},
data
()
{
return
{
showTime
:
false
,
//时间选择器是否显示
...
...
@@ -118,15 +125,16 @@
path
:
'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3'
,
voicePath
:
''
,
showPopup
:
false
,
formInfo
:
{
title
:
undefined
,
//标题
linkman
:
undefined
,
//联系人
phone
:
undefined
,
//联系电话
repairTime
:
undefined
,
//维修时间
repairAddress
:
undefined
,
//维修地址
budget
:
undefined
,
//预算金额
remark
:
undefined
,
//备注说明
},
// formInfo: {
// title: undefined, //标题
// linkman: undefined, //联系人
// phone: undefined, //联系电话
// repairTime: undefined, //维修时间
// repairAddress: undefined, //维修地址
// budget: undefined, //预算金额
// remark: undefined, //备注说明
// },
formInfo
:
{},
rules
:
{
title
:
{
type
:
'string'
,
...
...
@@ -156,7 +164,20 @@
};
},
watch
:
{
detailData
:
{
handler
(
newVal
,
oldVal
)
{
let
that
=
this
if
(
newVal
)
{
that
.
formInfo
=
that
.
detailData
}
else
{
that
.
resetForm
()
}
},
immediate
:
true
,
deep
:
true
}
},
//暂停所有音频(一般用于页面切换时停止正在播放的音频)
onUnload
()
{
//普通页面在 onUnload 生命周期中执行
uni
.
$emit
(
'stop'
)
...
...
@@ -167,17 +188,24 @@
created
()
{
let
that
=
this
// 时间格式化默认值
that
.
formInfo
.
repairTime
=
uni
.
$u
.
timeFormat
(
Number
(
new
Date
()),
'yyyy-mm-dd'
);
if
(
!
that
.
formInfo
.
repairTime
)
{
that
.
formInfo
.
repairTime
=
uni
.
$u
.
timeFormat
(
Number
(
new
Date
()),
'yyyy-mm-dd'
);
}
},
methods
:
{
//确认修改和重新发布按钮
handleUpdateForm
(){
this
.
$emit
(
'submit'
,
this
.
formInfo
)
},
//发布需求按钮
handlePublish
()
{
console
.
log
(
this
.
formInfo
,
'数据'
)
this
.
$refs
.
form
.
validate
().
then
(
res
=>
{
uni
.
$u
.
toast
(
'校验通过'
)
}).
catch
(
errors
=>
{
uni
.
$u
.
toast
(
'校验失败'
)
})
uni
.
$u
.
toast
(
'校验通过'
)
}).
catch
(
errors
=>
{
uni
.
$u
.
toast
(
'校验失败'
)
})
// this.$emit('submit', this.formInfo)
},
// 时间选择器确认事件
...
...
@@ -223,6 +251,17 @@
}
return
value
},
resetForm
()
{
this
.
formInfo
=
{
title
:
undefined
,
//标题
linkman
:
undefined
,
//联系人
phone
:
undefined
,
//联系电话
repairTime
:
undefined
,
//维修时间
repairAddress
:
undefined
,
//维修地址
budget
:
undefined
,
//预算金额
remark
:
undefined
,
//备注说明
}
}
}
}
</
script
>
...
...
demand/index/index.vue
View file @
2b28a6b6
...
...
@@ -99,8 +99,8 @@
if
(
option
.
detailInfo
){
this
.
detailInfo
=
JSON
.
parse
(
decodeURIComponent
(
option
.
detailInfo
))
console
.
log
(
this
.
detailInfo
,
'结束'
)
this
.
getOrder
()
}
this
.
getOrder
()
return
this
.
subs
=
option
.
subs
...
...
demand/updateForm/updateForm.vue
View file @
2b28a6b6
<
template
>
<view>
<view
class=
"paddding-x-two "
>
<releaseForm></releaseForm>
<view
class=
"submit-btn"
>
确认修改
</view>
<view
class=
"paddding-x-two"
v-if=
"JSON.stringify(detailData) != '
{}'">
<releaseForm
:detailData=
"detailData"
:statusBtn=
"detailInfo.status"
@
submit=
"handleSubmit"
></releaseForm>
</view>
</view>
</
template
>
<
script
>
import
{
orderDetailMsg
,
updateOrderFunction
}
from
'../../api/system/index.js'
import
releaseForm
from
'@/components/form.vue'
export
default
{
components
:
{
...
...
@@ -15,11 +18,36 @@
},
data
()
{
return
{
detailInfo
:
{},
//从上个页面接受的参数
detailData
:{},
//详情页的数据
}
},
onLoad
(
option
)
{
if
(
option
.
detailInfo
){
this
.
detailInfo
=
JSON
.
parse
(
decodeURIComponent
(
option
.
detailInfo
))
this
.
getOrder
()
}
},
methods
:
{
//获取订单详情列表
getOrder
()
{
let
that
=
this
orderDetailMsg
({
id
:
that
.
detailInfo
.
id
}).
then
(
res
=>
{
console
.
log
(
'订单详情'
,
res
)
if
(
res
.
code
==
200
)
{
that
.
detailData
=
res
.
data
}
})
},
//重新发布和修改按钮事件
handleSubmit
(
data
){
console
.
log
(
data
,
'表单重新提交'
)
updateOrderFunction
(
data
).
then
(
res
=>
{
console
.
log
(
res
,
'重新提交返回'
)
})
}
}
}
</
script
>
...
...
pages/demand/components/index.vue
View file @
2b28a6b6
...
...
@@ -19,7 +19,7 @@
</view>
<!-- // 已发布 -->
<view
class=
"buttoncolor"
v-if=
"subscript == '0'"
>
<button
class=
"buttoncl"
@
click
.
stop=
"
modify
"
>
修改
</button>
<button
class=
"buttoncl"
@
click
.
stop=
"
handleAgainAdd(item)
"
>
修改
</button>
<button
class=
"buttonclde"
@
click
.
stop=
"abolish(1)"
>
取消订单
</button>
</view>
<!-- // 已驳回 -->
...
...
@@ -27,7 +27,7 @@
<view
class=
"reject flex-1 hiddenMore"
>
驳回理由:没有明确问题描述没有明确问题描述没有明确问题描述没有明确问题描述
</view>
<button
@
click
.
stop=
"handleAgainAdd"
class=
"buttoncl"
style=
"margin-left: 20rpx;"
>
重新发布
</button>
<button
@
click
.
stop=
"handleAgainAdd
(item)
"
class=
"buttoncl"
style=
"margin-left: 20rpx;"
>
重新发布
</button>
</view>
<!-- // 待支付 -->
...
...
@@ -37,7 +37,7 @@
已沟通审核通过,待支付
<text>
{{
item
.
actualAmount
?
item
.
actualAmount
:
0
}}
元
</text>
</view>
<view
class=
""
>
截止1小时内支付完成
<text>
00:59:42
</text>
截止1小时内支付完成
<text>
{{
isEndTime
}}
</text>
</view>
</view>
<view
class=
""
@
click
.
stop=
"payment"
>
...
...
@@ -75,6 +75,8 @@
},
data
()
{
return
{
timer
:
""
,
//定时器
isEndTime
:
"01:00:00"
,
//倒计时要有个初始值
imgBgUrl
:
apiBaseConfig
.
imgBgUrl
,
globalData
:
getApp
().
globalData
,
show
:
false
,
...
...
@@ -83,11 +85,26 @@
}
},
onLoad
()
{
mounted
(){
this
.
timer
=
setInterval
(()
=>
{
this
.
countDown
()
},
1000
)
},
methods
:
{
// 1小时倒计时
countDown
()
{
let
allTime
=
0
;
let
h
=
this
.
isEndTime
.
substring
(
0
,
2
);
let
m
=
this
.
isEndTime
.
substring
(
3
,
5
);
let
s
=
this
.
isEndTime
.
substring
(
6
,
8
);
allTime
=
Number
(
h
)
*
60
*
60
+
Number
(
m
)
*
60
+
Number
(
s
);
if
(
allTime
<=
0
)
return
clearInterval
(
this
.
timer
);
//执行倒计时结束逻辑
allTime
--
;
h
=
parseInt
(
allTime
/
3600
)
<
10
?
'0'
+
String
(
parseInt
(
allTime
/
3600
))
:
parseInt
(
allTime
/
3600
);
m
=
parseInt
(
allTime
/
60
)
<
10
?
'0'
+
String
(
parseInt
(
allTime
/
60
))
:
parseInt
(
allTime
/
60
);
s
=
allTime
%
60
<
10
?
'0'
+
String
(
allTime
%
60
)
:
allTime
%
60
;
this
.
isEndTime
=
h
+
":"
+
m
+
":"
+
s
;
},
// 跳转详情页
jump
(
data
)
{
this
.
$uniGo
.
navigateTo
({
...
...
@@ -122,10 +139,10 @@
}
},
//重新发布按钮事件
handleAgainAdd
()
{
handleAgainAdd
(
info
)
{
let
that
=
this
that
.
$uniGo
.
navigateTo
({
url
:
`/demand/updateForm/updateForm`
url
:
`/demand/updateForm/updateForm
?detailInfo=
${
encodeURIComponent
(
JSON
.
stringify
(
info
))}
`
})
},
// 再看看
...
...
pages/home/index.vue
View file @
2b28a6b6
...
...
@@ -38,7 +38,8 @@
<view
class=
""
>
暂无数据
</view>
</view>
</view>
<u-loadmore
iconSize=
"50px"
@
loadmore=
"loadMore"
color=
"#6A6C6F"
fontSize=
"24rpx"
:nomore-text=
"nomoreText"
:loading-text=
"loadingText"
line
:status=
"loadStatus"
/>
</view>
<com-navbar
:leftIcon=
"false"
:homeShow=
"false"
bgColor=
"transparent"
title=
"首页"
:titleStyle=
"
{ color: '#FFFFFF', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" />
...
...
@@ -90,7 +91,10 @@
queryParams
:{
pageNum
:
1
,
pageSize
:
10
,
}
},
loadStatus
:
'loading'
,
//加载时的状态(loadmore/ loading / nomore)
loadingText
:
'正在加载'
,
nomoreText
:
'已经到底了'
}
},
onLoad
()
{
...
...
@@ -102,9 +106,7 @@
},
onReachBottom
()
{
let
that
=
this
if
(
that
.
total
<
that
.
queryParams
.
pageNum
*
that
.
queryParams
.
pageSize
){
}
if
(
that
.
total
<
that
.
queryParams
.
pageNum
*
that
.
queryParams
.
pageSize
)
return
that
.
nomore
=
'nomore'
},
methods
:
{
getSquare
(){
...
...
@@ -122,7 +124,10 @@
this
.
$uniGo
.
navigateTo
({
url
:
`/home/index/index?id=
${
info
.
id
}
`
});
},
},
loadMore
(){
console
.
log
(
'加载更多'
)
}
}
}
</
script
>
...
...
pages/order/index.vue
View file @
2b28a6b6
...
...
@@ -109,24 +109,30 @@
this
.
getArticleList
()
},
methods
:
{
getArticleList
(){
async
getArticleList
(){
let
that
=
this
userArticleGet
(
that
.
queryParams
).
then
(
res
=>
{
console
.
log
(
'文章列表'
,
res
.
rows
)
if
(
res
.
code
==
200
){
if
(
res
.
total
>
0
){
that
.
articleList
=
res
.
rows
that
.
total
=
res
.
total
}
}
})
// userArticleGet(that.queryParams).then(res=>{
// console.log('文章列表',res.rows)
// if(res.code == 200){
// if(res.total > 0){
// that.articleList = res.rows
// that.total = res.total
// }
// }
// })
const
data_back
=
await
userArticleGet
(
that
.
queryParams
);
const
{
code
,
total
,
rows
}
=
data_back
;
if
(
code
===
200
&&
total
>
0
)
{
that
.
articleList
=
rows
that
.
total
=
total
}
},
handleDetail
(
id
)
{
let
that
=
this
that
.
$uniGo
.
navigateTo
({
url
:
'/order/detail/detail?id='
+
id
url
:
`/order/detail/detail?id=
${
id
}
`
})
}
...
...
pages/release/index.vue
View file @
2b28a6b6
...
...
@@ -2,7 +2,7 @@
<view>
<view
:style=
"
{ height: `calc(${globalData.statusBarHeight}rpx + 130rpx)` }">
</view>
<view
class=
"paddding-x-two "
>
<releaseForm
@
submit=
"handleSubmit"
></releaseForm>
<releaseForm
:statusBtn=
"statusBtn"
@
submit=
"handleSubmit"
></releaseForm>
</view>
<com-navbar
:leftIcon=
"false"
:homeShow=
"false"
bgColor=
"#fff"
title=
"发布"
...
...
@@ -51,7 +51,7 @@
data
()
{
return
{
globalData
:
getApp
().
globalData
,
statusBtn
:
-
1
}
},
onShow
()
{
...
...
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