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
7956d42d
Commit
7956d42d
authored
Apr 07, 2023
by
honghong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付,退款
parent
b536ed2d
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
299 additions
and
138 deletions
+299
-138
api/my/index.js
+3
-2
api/system/index.js
+25
-5
components/comment/comment.vue
+2
-2
components/evaluate.vue
+8
-2
demand/confirm/index.vue
+7
-4
demand/payment/index.vue
+105
-24
demand/updateForm/updateForm.vue
+3
-0
my/coupon/index.vue
+12
-13
my/invite/index.vue
+39
-17
order/detail/detail.vue
+28
-44
pages/demand/components/index.vue
+10
-8
pages/demand/index.vue
+27
-3
pages/my/index.vue
+3
-2
pages/order/index.vue
+9
-12
utils/request.js
+18
-0
No files found.
api/my/index.js
View file @
7956d42d
...
...
@@ -25,14 +25,14 @@ const queryInviteListGet = (params) =>{
return
ApiHttp
(
'/xinrenli/Inviter/list'
,
params
,
'GET'
)
}
// 查询邀请列表
const
addInviter
Get
=
(
params
)
=>
{
const
addInviter
POST
=
(
params
)
=>
{
return
ApiHttp
(
'/xinrenli/Inviter'
,
params
,
'POST'
)
}
export
{
addUserFeedback
,
couponListGet
,
queryInviteListGet
,
addInviter
Get
,
addInviter
POST
,
userCouponList
,
userCouponListLose
}
\ No newline at end of file
api/system/index.js
View file @
7956d42d
...
...
@@ -28,10 +28,6 @@ const orderDetailMsgNew = (params) => {
const
myNeedList
=
(
params
)
=>
{
return
ApiHttp
(
'/xinrenli/order/MyNeeds'
,
params
,
'GET'
)
}
// 上传图片视频
// const = () => {
// return ApiHttp('/system/oss/upload')
// }
// 新增订单(发布)
const
addOrderFunction
=
(
params
)
=>
{
...
...
@@ -42,12 +38,31 @@ const addOrderFunction = (params) =>{
const
updateOrderFunction
=
(
params
)
=>
{
return
ApiHttp
(
'/xinrenli/order/edit'
,
params
,
'POST'
)
}
// 重新发布接口
const
againSubmitOrder
=
(
params
)
=>
{
return
ApiHttp
(
'/xinrenli/order/edit'
,
params
,
'POST'
)
}
//取消订单
const
removeOrderFunction
=
(
params
)
=>
{
return
ApiHttp
(
'/xinrenli/order/remove'
,
params
,
'GET'
)
}
//生成支付订单
const
createPayOrder
=
(
params
)
=>
{
return
ApiHttp
(
'/xinrenli/order/orderPay'
,
params
,
'GET'
)
}
//退款
const
refundFunction
=
(
params
)
=>
{
return
ApiHttp
(
'/xinrenli/order/refund'
,
params
,
'POST'
)
}
//查询用户折扣列表
const
userDiscountList
=
(
params
)
=>
{
return
ApiHttp
(
'/xinrenli/userDiscount/list'
,
params
,
'GET'
)
}
export
{
updateUserMsg
,
userNeedSquare
,
...
...
@@ -56,6 +71,10 @@ export {
orderDetailMsgNew
,
myNeedList
,
addOrderFunction
,
againSubmitOrder
,
updateOrderFunction
,
removeOrderFunction
removeOrderFunction
,
createPayOrder
,
refundFunction
,
userDiscountList
}
\ No newline at end of file
components/comment/comment.vue
View file @
7956d42d
...
...
@@ -4,8 +4,8 @@
<img
class=
"avatar-img"
:src=
"item.userHead"
alt=
""
>
<view
class=
"flex-1 margin-left-one"
>
<view
class=
"d-flex a-center j-sb"
>
<view
class=
"nickname"
>
{{
item
.
createUser
?
item
.
createUser
:
''
}}
</view>
<view
class=
"font"
>
{{
item
.
create
Time
|
formatDate
}}
</view>
<view
class=
"nickname"
>
{{
item
.
userName
?
item
.
userName
:
''
}}
</view>
<view
class=
"font"
>
{{
item
.
modify
Time
|
formatDate
}}
</view>
</view>
<view
class=
"evaluateText"
>
{{
item
.
content
}}
</view>
</view>
...
...
components/evaluate.vue
View file @
7956d42d
...
...
@@ -7,12 +7,12 @@
<view
class=
"evaluateTip d-flex j-sb a-center"
>
<view
class=
"d-flex a-center"
>
<image
class=
"img"
src=
"../static/logoLogin.png"
mode=
"widthFix"
></image>
<view
class=
"evaluate-name"
>
{{
item
.
createUser
}}
</view>
<view
class=
"evaluate-name"
>
{{
item
.
createUser
?
item
.
createUser
:
'官方发布'
}}
</view>
</view>
<view
class=
"font"
>
{{
item
.
createTime
|
formatDate
}}
</view>
</view>
<view
class=
"evaluate-title"
>
{{
item
.
title
}}
</view>
<view
class=
"evaluateText"
:class=
"
{lineclamp2:item.contentAll}"
>
{{
item
.
content
}}
</view>
<view
class=
"evaluateText"
:class=
"
{lineclamp2:item.contentAll}"
v-html="item.content">
</view>
<!--
<view
class=
""
v-if=
"item.isMore"
>
<view
class=
"rightText"
v-if=
"item.contentAll"
@
click=
"changeAllFun(item, index)"
>
全部
</view>
<view
class=
"rightText"
v-else
@
click=
"changeAllFun(item, index)"
>
收起
</view>
...
...
@@ -100,6 +100,12 @@
<
style
lang=
"scss"
scoped
>
.evaluate
.evaluateCenter
.evaluateItem
{
//
display
:
inline-block
;
background
:
#ffa
;
background-color
:
#FFFFFF
;
padding
:
30
rpx
20
rpx
;
border-radius
:
10
rpx
;
margin
:
10px
20
rpx
0
20
rpx
;
box-shadow
:
0px
0px
8px
0px
rgba
(
0
,
0
,
0
,
0.1
);
}
//
展开收起
...
...
demand/confirm/index.vue
View file @
7956d42d
...
...
@@ -16,6 +16,7 @@
<
script
>
import
apiBaseConfig
from
'@/config/index.js'
;
import
{
createPayOrder
}
from
'@/api/system/index.js'
export
default
{
data
()
{
return
{
...
...
@@ -26,10 +27,12 @@
},
onLoad
()
{},
methods
:
{
jump
(){
this
.
$uniGo
.
navigateTo
({
url
:
`/demand/prosperity/index`
});
async
jump
(){
const
data_back
=
await
createPayOrder
()
console
.
log
(
data_back
,
'支付'
)
// this.$uniGo.navigateTo({
// url: `/demand/prosperity/index`
// });
}
}
}
...
...
demand/payment/index.vue
View file @
7956d42d
...
...
@@ -3,28 +3,25 @@
<view
class=
"content-bgcolor"
>
<view
class=
"content-bgcolor-table"
>
<view
class=
""
>
<text></text>
灯泡灯芯坏了
<text></text>
{{
detailInfo
.
title
}}
</view>
<view
class=
""
>
维修时间:
2023-02-23
维修时间:
{{
detailInfo
.
repairTime
|
formatDate
}}
</view>
</view>
<view
class=
"content-bgcolor-matter"
>
说明:有一个字不是特别亮,希望换一盏灯希望换一盏灯希望换一盏灯,
有一个字不是特别亮,有一个字不是特别亮,希望换一盏灯希望换一盏灯有一个字不是特别亮,
希望换一盏灯,有一个字不是特别亮,希望换一盏灯有一个字不是特别亮,
希望换一盏灯希望换一盏灯
说明:
{{
detailInfo
.
remark
?
detailInfo
.
remark
:
''
}}
</view>
<view
class=
"content-bgcolor-photo"
>
<image
class=
"content-bgcolor-photo-graph"
src=
"@/static/logo.png"
mode=
""
v-for=
"(v ,index) in 5"
:key=
"index"
></image>
<image
class=
"content-bgcolor-photo-graph"
:src=
"v.url"
mode=
""
v-for=
"(v ,index) in detailInfo.pictureList"
:key=
"index"
></image>
</view>
<view
class=
"content-bgcolor-payment"
>
<view
class=
""
>
已沟通审核通过,待支付
</view>
<view
class=
""
>
300元
{{
detailInfo
.
actualAmount
?
detailInfo
.
actualAmount
:
0
}}
元
</view>
</view>
</view>
...
...
@@ -33,13 +30,13 @@
选择优惠券
</view>
<view
class=
""
>
{{
times
}}
元
{{
payInfo
.
fullSubtraction
?
payInfo
.
fullSubtraction
:
0
}}
元
<image
src=
"@/static/icon/jt.png"
mode=
""
></image>
</view>
</view>
<view
class=
"content-discounts"
>
<view
class=
"content-discounts"
v-if=
"discountList.length && discountList[0].discountRatio"
>
<view
class=
""
>
您当前可享1单
9
折优惠,是否使用
您当前可享1单
{{
Number
(
discountList
[
0
].
discountRatio
)
*
10
}}
折优惠,是否使用
</view>
<view
class=
""
>
<u-switch
v-model=
"isUse"
activeColor=
"#D6E1FF"
inactiveColor=
"#F1F1F1"
@
change=
"changeUse"
></u-switch>
...
...
@@ -49,12 +46,13 @@
<view
class=
""
>
截止1小时内支付完成
<text>
00:59:42
</text>
</view>
<button
@
click=
"jump(2)"
>
立即支付
300.00元
</button>
<button
@
click=
"jump(2)"
>
立即支付
{{
sumPrice
}}
元
</button>
</view>
</view>
</
template
>
<
script
>
import
{
createPayOrder
,
userDiscountList
}
from
'@/api/system/index.js'
import
apiBaseConfig
from
'@/config/index.js'
;
export
default
{
data
()
{
...
...
@@ -62,24 +60,105 @@
imgBgUrl
:
apiBaseConfig
.
imgBgUrl
,
globalData
:
getApp
().
globalData
,
scrollTopHeader
:
0
,
times
:
'0'
,
isUse
:
true
isUse
:
true
,
detailInfo
:
{},
//详情数据
payInfo
:{},
discountList
:[]
};
},
onLoad
()
{},
created
()
{
this
.
getDisCountList
()
},
onLoad
(
option
)
{
let
that
=
this
if
(
option
.
detailInfo
)
{
this
.
detailInfo
=
JSON
.
parse
(
decodeURIComponent
(
option
.
detailInfo
))
}
uni
.
$on
(
'payInfo'
,
res
=>
{
console
.
log
(
res
,
'打算今年'
);
that
.
payInfo
=
res
})
},
onUnload
()
{
uni
.
$off
(
'payInfo'
)
},
computed
:{
sumPrice
(){
let
that
=
this
// 1.判断优惠券是否有值并且价格大于优惠券时
console
.
log
(
that
.
payInfo
.
fullSubtraction
,
that
.
detailInfo
.
actualAmount
,
'第三句话'
)
if
(
that
.
payInfo
.
fullSubtraction
&&
Number
(
that
.
detailInfo
.
actualAmount
)
>
Number
(
that
.
payInfo
.
fullSubtraction
)){
console
.
log
(
'优质'
,
that
.
detailInfo
.
actualAmount
-
that
.
payInfo
.
fullSubtraction
)
// 判断是否使用折扣(使用×折扣)
return
that
.
isUse
?
Number
((
that
.
detailInfo
.
actualAmount
-
that
.
payInfo
.
fullSubtraction
)
*
that
.
discountList
[
0
].
discountRatio
).
toFixed
(
2
):
Number
(
that
.
detailInfo
.
actualAmount
-
that
.
payInfo
.
fullSubtraction
).
toFixed
(
2
)
}
else
{
console
.
log
(
'物质'
)
return
that
.
detailInfo
.
actualAmount
&&
that
.
isUse
?
Number
(
that
.
detailInfo
.
actualAmount
*
that
.
discountList
[
0
].
discountRatio
).
toFixed
(
2
)
:
that
.
detailInfo
.
actualAmount
// return that.detailInfo.actualAmount && that.isUse ? Number(that.detailInfo.actualAmount * 0.1).toFixed(2) : that.detailInfo.actualAmount
}
}
},
methods
:
{
async
getDisCountList
(){
const
data_back
=
await
userDiscountList
({
useStatus
:
0
})
console
.
log
(
data_back
,
'折扣列表'
)
const
{
code
,
rows
}
=
data_back
if
(
code
===
200
){
this
.
discountList
=
rows
}
},
// 支付接口
async
handlePay
(){
let
that
=
this
let
orderQuery
=
{
orderId
:
that
.
detailInfo
.
id
,
//订单的id
couponId
:
that
.
payInfo
.
id
?
that
.
payInfo
.
id
:
''
,
//优惠券的id
discountId
:
that
.
isUse
&&
that
.
discountList
.
length
?
that
.
discountList
[
0
].
id
:
''
,
//折扣的id
}
const
data_back
=
await
createPayOrder
(
orderQuery
)
console
.
log
(
data_back
,
'单靠'
)
const
{
code
,
data
}
=
data_back
if
(
code
===
200
){
uni
.
requestPayment
({
provider
:
'wxpay'
,
nonceStr
:
data
.
nonceStr
,
// 随机字符串
package
:
data
.
packageValue
,
// 固定值
timeStamp
:
data
.
timeStamp
,
// 时间戳(单位:秒)
signType
:
data
.
signType
,
paySign
:
data
.
paySign
,
success
:
(
res
)
=>
{
console
.
log
(
res
,
'成功'
)
if
(
res
.
errMsg
==
'requestPayment:ok'
)
{
that
.
$uniGo
.
navigateTo
({
url
:
'/demand/prosperity/index'
})
}
},
fail
(
err
)
{
console
.
log
(
'失败'
)
if
(
err
.
errMsg
==
'requestPayment:fail cancel'
)
{
}
}
})
}
},
jump
(
val
)
{
if
(
val
==
1
){
if
(
val
==
1
)
{
this
.
$uniGo
.
navigateTo
({
url
:
`/my/coupon/index?type=pay`
});
}
else
{
this
.
$uniGo
.
navigateTo
({
url
:
`/demand/confirm/index`
});
}
else
{
this
.
handlePay
()
// this.$uniGo.navigateTo({
// url: `/demand/confirm/index`
// });
}
},
changeUse
(
e
){
changeUse
(
e
)
{
let
that
=
this
that
.
isUse
=
e
}
...
...
@@ -90,10 +169,12 @@
page
{
background
:
#F7F8F9
;
}
.u-switch__node
{
.u-switch__node
{
background
:
#888888
!important
;
}
.u-switch__node--on
{
.u-switch__node--on
{
background
:
#2C66FF
!important
;
}
</
style
>
...
...
demand/updateForm/updateForm.vue
View file @
7956d42d
...
...
@@ -43,6 +43,9 @@
//重新发布和修改按钮事件
async
handleSubmit
(
data
){
let
that
=
this
if
(
that
.
detailInfo
.
status
==
1
){
that
.
$set
(
data
,
'status'
,
0
)
}
const
back_data
=
await
updateOrderFunction
(
data
)
const
{
code
}
=
back_data
if
(
code
==
200
){
...
...
my/coupon/index.vue
View file @
7956d42d
...
...
@@ -7,7 +7,7 @@
<text></text>
<view>
可用优惠券
{{
cantotal
}}
</view>
</view>
<view
class=
"index-content-item-qu"
@
click=
"optionData.type === 'pay'?jump():null"
>
<view
class=
"index-content-item-qu"
@
click=
"optionData.type === 'pay'?jump(
item
):null"
>
<image
class=
"index-content-item-qu-bg"
src=
"@/static/icon/xy01.png"
mode=
""
></image>
<view
class=
"index-content-item-qu-bl"
>
<text
class=
"index-content-item-qu-bl-tl"
>
满减优惠券
</text>
...
...
@@ -78,16 +78,16 @@
optionData
:
{},
title
:
''
,
queryParams
:{
pageNum
:
1
,
pageSize
:
10
,
//
pageNum:1,
//
pageSize:10,
deleteStatus
:
0
,
useStatus
:
0
},
//优惠券有效参数
useCouponList
:[],
//可使用的优惠券列表
cantotal
:
0
,
loseParams
:{
pageNum
:
1
,
pageSize
:
10
,
//
pageNum:1,
//
pageSize:10,
deleteStatus
:
1
,
useStatus
:
1
},
...
...
@@ -140,22 +140,21 @@
break
;
}
},
jump
()
{
console
.
log
(
'22222'
)
jump
(
data
)
{
uni
.
$emit
(
'payInfo'
,
data
)
// 获取所有页面栈实例列表
let
pages
=
getCurrentPages
();
//
let pages = getCurrentPages();
// 上一页页面实例
let
prevPage
=
pages
[
pages
.
length
-
2
];
//
//
上一页页面实例
//
let prevPage = pages[pages.length - 2];
// 修改上一页data里面的times参数值为100
prevPage
.
$vm
.
times
=
100
;
//
//
修改上一页data里面的times参数值为100
//
prevPage.$vm.times = 100;
//uni.navigateTo跳转的返回,默认1为返回上一级
uni
.
navigateBack
({
delta
:
1
});
console
.
log
(
'1111111'
)
}
}
};
...
...
my/invite/index.vue
View file @
7956d42d
...
...
@@ -17,7 +17,7 @@
<text></text>
<view>
我已邀请:
<text>
3
位用户
</text>
<text>
{{
total
}}
位用户
</text>
</view>
</view>
</view>
...
...
@@ -34,42 +34,64 @@
-->
</view>
<view>
<button
class=
"invite-btn"
data-name=
"shareB
tn"
open-type=
"share"
>
继续邀请新用户
</button>
<button
class=
"invite-b
tn"
open-type=
"share"
>
继续邀请新用户
</button>
</view>
</view>
</
template
>
<
script
>
import
apiBaseConfig
from
'@/config/index.js'
;
import
{
queryInviteListGet
,
addInviterGet
}
from
'@/api/my/index.js'
import
{
queryInviteListGet
,
addInviterGet
}
from
'@/api/my/index.js'
export
default
{
data
()
{
return
{
imgBgUrl
:
apiBaseConfig
.
imgBgUrl
,
globalData
:
getApp
().
globalData
,
scrollTopHeader
:
0
scrollTopHeader
:
0
,
inviteList
:
[],
total
:
0
};
},
//分享
onShareAppMessage
()
{
return
{
title
:
'分享的标题'
,
success
()
{
addInviterGet
().
then
(
res
=>
{
})
}
onShareAppMessage
(
options
)
{
var
that
=
this
;
// 设置菜单中的转发按钮触发转发事件时的转发内容
var
shareObj
=
{
title
:
"新人力小程序"
,
// 默认是小程序的名称(可以写slogan等)
path
:
'/my/login/login'
,
// 默认是当前页面,必须是以‘/'开头的完整路径
};
// 来自页面内的按钮的转发
if
(
options
.
from
==
'button'
)
{
var
eData
=
options
.
target
.
dataset
;
console
.
log
(
eData
.
name
);
// shareBtn
// 此处可以修改 shareObj 中的内容
shareObj
.
path
=
'/my/login/login'
;
}
console
.
log
(
"shareObj"
,
shareObj
)
// 返回shareObj
return
shareObj
;
},
onLoad
()
{
wx
.
hideShareMenu
()
this
.
getList
()
},
methods
:
{
// 获取邀请列表
getList
(){
queryInviteListGet
().
then
(
res
=>
{
})
async
getList
()
{
const
data_back
=
await
queryInviteListGet
()
console
.
log
(
data_back
,
'第三节'
)
const
{
code
,
rows
,
total
}
=
data_back
if
(
code
==
200
&&
total
>
0
)
{
this
.
inviteList
=
rows
this
.
total
=
total
}
}
}
};
...
...
order/detail/detail.vue
View file @
7956d42d
...
...
@@ -16,14 +16,12 @@
<image
class=
"img"
src=
"https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
mode=
"widthFix"
></image>
<view
class=
"evaluate-name"
>
张三
</view>
<view
class=
"evaluate-name"
>
{{
articleData
.
createUser
?
articleData
.
createUser
:
'官方'
}}
</view>
</view>
<view
class=
"eval-time"
>
发布于
{{
articleData
.
createTime
|
formatDate
}}
</view>
</view>
<view
class=
"evaluateText text-indent"
>
{{
articleData
.
content
}}
</view>
<view
class=
"evaluateText text-indent"
v-html=
"articleData.content"
></view>
</view>
</view>
<view
class=
"bgWhite"
>
...
...
@@ -34,7 +32,7 @@
</view>
<view
class=
"comment-box"
>
<view
class=
"paddding-x-two comment-box-height d-flex a-center j-sb"
>
<input
v-model=
"content"
class=
"send-input"
type=
"text"
placeholder=
"评论一下吧"
>
<input
v-model=
"
evalQuery.
content"
class=
"send-input"
type=
"text"
placeholder=
"评论一下吧"
>
<view
class=
"send-btn-box"
@
click=
"handleSend"
>
发送
</view>
</view>
</view>
...
...
@@ -47,37 +45,6 @@
export
default
{
data
()
{
return
{
personEvalList
:
[{
avatar
:
'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
,
nickname
:
'李哈哈'
,
date
:
'2022-01-31'
,
content
:
'评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
{
avatar
:
'https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
,
nickname
:
'李小乖'
,
date
:
'2022-05-11'
,
content
:
'评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
{
avatar
:
'https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
,
nickname
:
'李晓扎'
,
date
:
'2022-05-11'
,
content
:
'评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
{
avatar
:
'https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
,
nickname
:
'李小乖'
,
date
:
'2022-05-11'
,
content
:
'评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
{
avatar
:
'https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
,
nickname
:
'李晓扎'
,
date
:
'2022-05-11'
,
content
:
'评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
},
],
articleData
:{},
userQuery
:{
pageNum
:
1
,
...
...
@@ -85,11 +52,14 @@
articleId
:
null
},
userEvalList
:[],
evalQuery
:{
content
:
''
,
//评论的内容
articleId
:
''
,
//文章id
deleteStatus
:
0
}
}
},
onLoad
(
option
)
{
console
.
log
(
option
.
id
,
'接受的'
)
this
.
getDetail
(
option
.
id
)
this
.
getUserEvalList
(
option
.
id
)
},
...
...
@@ -97,7 +67,6 @@
getDetail
(
id
){
let
that
=
this
articleDetail
(
id
).
then
(
res
=>
{
console
.
log
(
res
,
'文章详情'
)
if
(
res
.
code
==
200
){
that
.
articleData
=
res
.
data
}
...
...
@@ -107,7 +76,6 @@
let
that
=
this
that
.
userQuery
.
articleId
=
id
userEvaluateGet
(
that
.
userQuery
).
then
(
res
=>
{
console
.
log
(
res
,
'用户评论列表'
)
if
(
res
.
code
==
200
){
if
(
res
.
total
>
0
){
this
.
userEvalList
=
res
.
rows
...
...
@@ -115,13 +83,29 @@
}
})
},
handleSend
(){
async
handleSend
(){
let
that
=
this
that
.
content
=
that
.
content
.
trim
()
if
(
that
.
content
){
addUserEvaluate
({
content
:
this
.
content
.
trim
()}).
then
(
res
=>
{
console
.
log
(
'发送'
,
res
)
if
(
that
.
evalQuery
.
content
){
that
.
$set
(
that
.
evalQuery
,
'content'
,
that
.
evalQuery
.
content
.
trim
())
that
.
$set
(
that
.
evalQuery
,
'articleId'
,
that
.
articleData
.
id
)
const
data_back
=
await
addUserEvaluate
(
that
.
evalQuery
)
const
{
code
}
=
data_back
if
(
code
===
200
){
that
.
evalQuery
.
content
=
''
uni
.
showToast
({
title
:
'评论成功!'
,
icon
:
'none'
,
duration
:
2000
,
success
()
{
let
clearTime
=
setTimeout
(()
=>
{
clearTimeout
(
clearTime
)
that
.
$uniGo
.
navigateBack
({
delta
:
1
})
},
1000
)
}
})
}
}
else
{
return
uni
.
showToast
({
title
:
'不可发布空白内容'
,
...
...
pages/demand/components/index.vue
View file @
7956d42d
...
...
@@ -40,15 +40,15 @@
截止1小时内支付完成
<text>
{{
isEndTime
}}
</text>
</view>
</view>
<view
class=
""
@
click
.
stop=
"payment"
>
<view
class=
""
@
click
.
stop=
"payment
(item)
"
>
<button
class=
"buttoncl"
>
支付
</button>
</view>
</view>
<!-- // 已接单 -->
<view
class=
"buttoncolor"
v-if=
"subscript == '3'"
>
<button
class=
"buttoncl"
@
click
.
stop=
"abolish(2)"
>
退款
</button>
<button
class=
"buttonclde"
@
click
.
stop=
"abolish(3)"
>
详情
</button>
<button
class=
"buttonclde"
@
click
.
stop=
"abolish(4)"
>
已退款
</button>
<button
class=
"buttoncl"
@
click
.
stop=
"abolish(2
,item
)"
>
退款
</button>
<button
class=
"buttonclde"
@
click
.
stop=
"abolish(3
,item
)"
>
详情
</button>
<button
class=
"buttonclde"
@
click
.
stop=
"abolish(4
,item
)"
>
已退款
</button>
</view>
</view>
</view>
...
...
@@ -83,6 +83,7 @@
title
:
'确认取消订单吗'
,
titbut
:
'取消订单'
,
currentId
:
''
,
//当前的id
actualAmount
:
0
,
//实付金饿
}
},
...
...
@@ -114,15 +115,16 @@
});
},
// 跳转支付界面
payment
()
{
payment
(
data
)
{
this
.
$uniGo
.
navigateTo
({
url
:
`/demand/payment/index`
url
:
`/demand/payment/index
?detailInfo=
${
encodeURIComponent
(
JSON
.
stringify
(
data
))}
`
});
},
// 取消订单1 立即退款2
abolish
(
val
,
data
)
{
console
.
log
(
data
.
id
,
'数控'
)
console
.
log
(
data
.
id
,
data
.
actualAmount
,
'数控'
)
this
.
currentId
=
data
.
id
this
.
actualAmount
=
data
.
actualAmount
if
(
val
==
1
)
{
this
.
title
=
'确认取消订单吗'
this
.
titbut
=
'1'
...
...
@@ -154,7 +156,7 @@
},
// 取消订单2 立即退款3
aindexst
(
val
)
{
this
.
$emit
(
'getVal'
,
val
,
this
.
currentId
)
this
.
$emit
(
'getVal'
,
val
,
this
.
currentId
,
this
.
actualAmount
)
this
.
show
=
false
}
}
...
...
pages/demand/index.vue
View file @
7956d42d
...
...
@@ -58,7 +58,8 @@
import
{
myNeedList
,
orderDetailList
,
removeOrderFunction
removeOrderFunction
,
refundFunction
}
from
'../../api/system/index.js'
import
apiBaseConfig
from
'@/config/index.js'
;
import
uniGo
from
'@/utils/unIGO.js'
;
...
...
@@ -150,12 +151,35 @@
})
}
},
// 立即退款接口
async
handleRefund
(
id
,
price
){
const
data_back
=
await
refundFunction
({
refundeAmount
:
price
,
orderId
:
id
})
console
.
log
(
data_back
,
'退款'
)
const
{
code
}
=
back_data
if
(
code
==
200
)
{
uni
.
showToast
({
title
:
'退款成功!'
,
icon
:
'none'
,
duration
:
2000
,
success
()
{
setTimeout
(()
=>
{
that
.
getMyNeedList
()
},
1000
)
}
})
}
},
// 取消订单2 立即退款3
handleStatus
(
val
,
id
)
{
console
.
log
(
val
,
id
,
'装订好'
)
handleStatus
(
val
,
id
,
price
)
{
console
.
log
(
val
,
id
,
price
,
'装订好'
)
let
that
=
this
if
(
val
==
2
)
{
that
.
handleCancle
(
id
)
}
else
if
(
val
==
3
){
that
.
handleRefund
(
id
,
price
)
}
}
}
...
...
pages/my/index.vue
View file @
7956d42d
...
...
@@ -10,7 +10,7 @@
<view
class=
"content-in-info-r"
>
<view
class=
"content-in-info-r-t baiyin-flex"
>
<text
v-if=
"nameDisabled"
>
{{
nickname
}}
</text>
<input
v-else
confirm-type=
"确定"
@
confirm=
"inputNameConfirm"
maxlength=
"15"
type=
"text"
value=
"用户名称1
"
/>
<input
v-else
confirm-type=
"确定"
@
confirm=
"inputNameConfirm"
maxlength=
"15"
type=
"text"
:value=
"nickname
"
/>
<image
src=
"@/static/icon/my02.png"
mode=
""
@
click=
"nameDisabled = !nameDisabled"
></image>
</view>
<view
class=
"content-in-info-r-b"
v-if=
"mobile"
>
手机号:
{{
mobile
}}
</view>
...
...
@@ -93,7 +93,7 @@ export default {
globalData
:
getApp
().
globalData
,
scrollTopHeader
:
0
,
nameDisabled
:
true
,
nickname
:
this
.
$store
.
state
.
login
.
userInfo
.
user
.
nickname
,
nickname
:
'用户名称'
,
mobile
:
''
,
//手机号
list
:
[
{
...
...
@@ -124,6 +124,7 @@ export default {
};
},
onLoad
()
{
this
.
nickname
=
this
.
$store
.
state
.
login
.
userInfo
.
user
.
nickname
console
.
log
(
this
.
$store
.
state
.
login
.
userInfo
.
user
.
nickname
,
'D撒'
)
let
mobile
=
uni
.
getStorageSync
(
'mobile'
)
this
.
mobile
=
mobile
...
...
pages/order/index.vue
View file @
7956d42d
...
...
@@ -105,21 +105,18 @@
]
}
},
onLoad
()
{
onReachBottom
()
{
let
that
=
this
if
(
that
.
total
<=
that
.
queryParams
.
pageNum
*
that
.
queryParams
.
pageSize
)
return
that
.
queryParams
.
pageNum
++
that
.
getArticleList
()
},
onShow
()
{
this
.
getArticleList
()
},
methods
:
{
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
// }
// }
// })
const
data_back
=
await
userArticleGet
(
that
.
queryParams
);
const
{
code
,
total
,
rows
}
=
data_back
;
if
(
code
===
200
&&
total
>
0
)
{
...
...
@@ -142,10 +139,10 @@
<
style
>
.friends-list-box
{
background-color
:
#FFFFFF
;
/*
background-color: #FFFFFF;
padding: 30rpx 20rpx;
border-radius: 10rpx;
margin: 10px 20rpx 0 20rpx;
box-shadow
:
0px
0px
8px
0px
rgba
(
0
,
0
,
0
,
0.1
);
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
*/
}
</
style
>
utils/request.js
View file @
7956d42d
...
...
@@ -63,6 +63,23 @@ const ApiHttp = (url, params, method, isToken = true) => {
if
(
code
===
200
)
{
resolve
(
data
);
}
else
if
(
code
===
401
)
{
uni
.
clearStorageSync
();
uni
.
showModal
({
title
:
'请登录'
,
content
:
'您需要登录才能使用该功能'
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
uni
.
reLaunch
({
url
:
'/my/login/login'
})
}
else
if
(
res
.
cancel
)
{
uni
.
navigateBack
()
}
}
})
resolve
(
data
);
}
else
{
if
(
url
==
'/group-buy/by-consumer-order/leader/refunde'
||
...
...
@@ -75,6 +92,7 @@ const ApiHttp = (url, params, method, isToken = true) => {
title
:
msg
||
'系统内部错误'
,
icon
:
"none"
})
if
(
url
==
'/system/xcxLogin'
||
url
==
'system/getPhone'
)
{
uni
.
clearStorageSync
();
store
.
dispatch
(
'loginOut'
)
...
...
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