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
22681fd6
Commit
22681fd6
authored
Apr 12, 2023
by
honghong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
倒计时,轮播图跳转
parent
61feeae6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
36 deletions
+64
-36
demand/payment/index.vue
+54
-26
my/coupon/index.vue
+2
-2
my/invite/index.vue
+1
-1
my/login/login.vue
+4
-4
pages/demand/components/index.vue
+2
-2
pages/demand/index.vue
+1
-1
pages/home/index.vue
+0
-0
No files found.
demand/payment/index.vue
View file @
22681fd6
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
</view>
</view>
<view
class=
"content-accomplish"
>
<view
class=
"content-accomplish"
>
<view
class=
""
>
<view
class=
""
>
截止1小时内支付完成
<text>
00:59:42
</text>
截止1小时内支付完成
<text>
{{
detailInfo
.
isEndTime
}}
</text>
</view>
</view>
<button
@
click=
"jump(2)"
>
立即支付
{{
sumPrice
}}
元
</button>
<button
@
click=
"jump(2)"
>
立即支付
{{
sumPrice
}}
元
</button>
</view>
</view>
...
@@ -52,7 +52,9 @@
...
@@ -52,7 +52,9 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
userDiscountList
}
from
'@/api/system/index.js'
import
{
userDiscountList
}
from
'@/api/system/index.js'
import
apiBaseConfig
from
'@/config/index.js'
;
import
apiBaseConfig
from
'@/config/index.js'
;
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -62,9 +64,12 @@
...
@@ -62,9 +64,12 @@
scrollTopHeader
:
0
,
scrollTopHeader
:
0
,
isUse
:
true
,
isUse
:
true
,
detailInfo
:
{},
//详情数据
detailInfo
:
{},
//详情数据
payInfo
:{},
payInfo
:
{},
discountList
:[]
discountList
:
[],
timer
:
""
,
//定时器
isEndTime
:
""
,
//倒计时要有个初始值
};
};
},
},
created
()
{
created
()
{
...
@@ -74,48 +79,71 @@
...
@@ -74,48 +79,71 @@
let
that
=
this
let
that
=
this
if
(
option
.
detailInfo
)
{
if
(
option
.
detailInfo
)
{
this
.
detailInfo
=
JSON
.
parse
(
decodeURIComponent
(
option
.
detailInfo
))
this
.
detailInfo
=
JSON
.
parse
(
decodeURIComponent
(
option
.
detailInfo
))
console
.
log
(
this
.
detailInfo
,
'读书'
)
}
}
this
.
timer
=
setInterval
(()
=>
{
let
allTime
=
0
;
let
h
=
that
.
detailInfo
.
isEndTime
.
substring
(
0
,
2
);
let
m
=
that
.
detailInfo
.
isEndTime
.
substring
(
3
,
5
);
let
s
=
that
.
detailInfo
.
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
;
that
.
detailInfo
.
isEndTime
=
h
+
"时"
+
m
+
"分"
+
s
+
"秒"
;
},
1000
)
uni
.
$on
(
'payInfo'
,
res
=>
{
uni
.
$on
(
'payInfo'
,
res
=>
{
console
.
log
(
res
,
'打算今年'
);
that
.
payInfo
=
res
that
.
payInfo
=
res
})
})
},
},
onUnload
()
{
onUnload
()
{
uni
.
$off
(
'payInfo'
)
uni
.
$off
(
'payInfo'
)
},
},
computed
:{
computed
:
{
sumPrice
(){
sumPrice
()
{
let
that
=
this
let
that
=
this
// 1.判断优惠券是否有值并且价格大于优惠券时
// 1.判断优惠券是否有值并且价格大于优惠券时
// console.log(that.payInfo.fullSubtraction,that.detailInfo.actualAmount,'第三句话')
// console.log(that.payInfo.fullSubtraction,that.detailInfo.actualAmount,'第三句话')
if
(
that
.
payInfo
.
fullSubtraction
&&
Number
(
that
.
detailInfo
.
actualAmount
)
>
Number
(
that
.
payInfo
.
fullSubtraction
)){
if
(
that
.
payInfo
.
fullSubtraction
&&
Number
(
that
.
detailInfo
.
actualAmount
)
>
Number
(
that
.
payInfo
.
fullSubtraction
))
{
// console.log('优质',that.detailInfo.actualAmount - 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
)
return
that
.
isUse
?
Number
((
that
.
detailInfo
.
actualAmount
-
that
.
payInfo
.
fullSubtraction
)
*
that
}
else
{
.
discountList
[
0
].
discountRatio
).
toFixed
(
2
)
:
Number
(
that
.
detailInfo
.
actualAmount
-
that
.
payInfo
if
(
that
.
discountList
.
length
&&
that
.
discountList
[
0
].
discountRatio
){
.
fullSubtraction
).
toFixed
(
2
)
return
that
.
detailInfo
.
actualAmount
&&
that
.
isUse
?
Number
(
that
.
detailInfo
.
actualAmount
*
that
.
discountList
[
0
].
discountRatio
).
toFixed
(
2
)
:
that
.
detailInfo
.
actualAmount
}
else
{
}
else
{
if
(
that
.
discountList
.
length
&&
that
.
discountList
[
0
].
discountRatio
)
{
return
that
.
detailInfo
.
actualAmount
&&
that
.
isUse
?
Number
(
that
.
detailInfo
.
actualAmount
*
that
.
discountList
[
0
].
discountRatio
).
toFixed
(
2
)
:
that
.
detailInfo
.
actualAmount
}
else
{
that
.
isUse
=
false
that
.
isUse
=
false
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
*
that
.
discountList
[
0
].
discountRatio
).
toFixed
(
2
)
:
that
.
detailInfo
.
actualAmount
}
}
}
}
}
}
},
},
methods
:
{
methods
:
{
async
getDisCountList
(){
async
getDisCountList
()
{
const
data_back
=
await
userDiscountList
({
useStatus
:
0
})
const
data_back
=
await
userDiscountList
({
const
{
code
,
rows
,
total
}
=
data_back
useStatus
:
0
if
(
code
===
200
&&
total
>
0
){
})
const
{
code
,
rows
,
total
}
=
data_back
if
(
code
===
200
&&
total
>
0
)
{
this
.
discountList
=
rows
this
.
discountList
=
rows
this
.
isUse
=
true
this
.
isUse
=
true
}
else
{
}
else
{
this
.
isUse
=
false
this
.
isUse
=
false
}
}
},
},
jump
(
val
)
{
jump
(
val
)
{
let
that
=
this
let
that
=
this
if
(
val
==
1
)
{
if
(
val
==
1
)
{
...
@@ -124,9 +152,9 @@
...
@@ -124,9 +152,9 @@
});
});
}
else
{
}
else
{
let
orderQuery
=
{
let
orderQuery
=
{
orderId
:
that
.
detailInfo
.
id
,
//订单的id
orderId
:
that
.
detailInfo
.
id
,
//订单的id
couponId
:
that
.
payInfo
.
id
?
that
.
payInfo
.
id
:
''
,
//优惠券的id
couponId
:
that
.
payInfo
.
id
?
that
.
payInfo
.
id
:
''
,
//优惠券的id
discountId
:
that
.
isUse
&&
that
.
discountList
.
length
?
that
.
discountList
[
0
].
id
:
''
,
//折扣的id
discountId
:
that
.
isUse
&&
that
.
discountList
.
length
?
that
.
discountList
[
0
].
id
:
''
,
//折扣的id
}
}
this
.
$uniGo
.
navigateTo
({
this
.
$uniGo
.
navigateTo
({
url
:
`/demand/confirm/index?orderQuery=
${
encodeURIComponent
(
JSON
.
stringify
(
orderQuery
))}
&sumPrice=
${
that
.
sumPrice
}
&title=
${
this
.
detailInfo
.
title
}
`
url
:
`/demand/confirm/index?orderQuery=
${
encodeURIComponent
(
JSON
.
stringify
(
orderQuery
))}
&sumPrice=
${
that
.
sumPrice
}
&title=
${
this
.
detailInfo
.
title
}
`
...
...
my/coupon/index.vue
View file @
22681fd6
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
<view
class=
"index"
>
<view
class=
"index"
>
<com-navbar
:title=
"title"
:titleStyle=
"
{ color: '#000000', fontSize: '32rpx' }" />
<com-navbar
:title=
"title"
:titleStyle=
"
{ color: '#000000', fontSize: '32rpx' }" />
<view
class=
"index-content"
v-if=
"useCouponList.length || couponLoseList.length"
>
<view
class=
"index-content"
v-if=
"useCouponList.length || couponLoseList.length"
>
<view
class=
"index-content-item"
v-for=
"(item,index) in useCouponList"
>
<view
class=
"index-content-item"
>
<view
class=
"index-content-item-nav baiyin-flex baiyin-flex-c-b"
>
<view
class=
"index-content-item-nav baiyin-flex baiyin-flex-c-b"
>
<text></text>
<text></text>
<view>
可用优惠券
{{
cantotal
}}
</view>
<view>
可用优惠券
{{
cantotal
}}
</view>
</view>
</view>
<view
class=
"index-content-item-qu"
@
click=
"optionData.type === 'pay'?jump(item):null"
>
<view
class=
"index-content-item-qu"
v-for=
"(item,index) in useCouponList"
@
click=
"optionData.type === 'pay'?jump(item):null"
>
<image
class=
"index-content-item-qu-bg"
src=
"@/static/icon/xy01.png"
mode=
""
></image>
<image
class=
"index-content-item-qu-bg"
src=
"@/static/icon/xy01.png"
mode=
""
></image>
<view
class=
"index-content-item-qu-bl"
>
<view
class=
"index-content-item-qu-bl"
>
<text
class=
"index-content-item-qu-bl-tl"
>
满减优惠券
</text>
<text
class=
"index-content-item-qu-bl-tl"
>
满减优惠券
</text>
...
...
my/invite/index.vue
View file @
22681fd6
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
var
eData
=
options
.
target
.
dataset
;
var
eData
=
options
.
target
.
dataset
;
console
.
log
(
eData
.
name
);
// shareBtn
console
.
log
(
eData
.
name
);
// shareBtn
// 此处可以修改 shareObj 中的内容
// 此处可以修改 shareObj 中的内容
shareObj
.
path
=
'/my/login/login?id=${that.$store.state.login.userInfo.user.id}'
;
shareObj
.
path
=
`/my/login/login?id=
${
that
.
$store
.
state
.
login
.
userInfo
.
user
.
id
}
`
;
}
}
console
.
log
(
"shareObj"
,
shareObj
)
console
.
log
(
"shareObj"
,
shareObj
)
// 返回shareObj
// 返回shareObj
...
...
my/login/login.vue
View file @
22681fd6
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
xcxCode
:
''
xcxCode
:
''
},
},
token
:
''
,
token
:
''
,
I
nviterId
:
''
,
//邀请人的id
i
nviterId
:
''
,
//邀请人的id
}
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
})
})
this
.
getUserInfo
()
this
.
getUserInfo
()
if
(
option
.
id
){
if
(
option
.
id
){
this
.
I
nviterId
=
option
.
id
this
.
i
nviterId
=
option
.
id
}
}
},
},
methods
:
{
methods
:
{
...
@@ -56,9 +56,9 @@
...
@@ -56,9 +56,9 @@
async
getSessionkeyAndOpenId
(
xcxCode
)
{
async
getSessionkeyAndOpenId
(
xcxCode
)
{
let
that
=
this
let
that
=
this
let
codeParams
=
{}
let
codeParams
=
{}
if
(
that
.
I
nviterId
){
if
(
that
.
i
nviterId
){
that
.
$set
(
codeParams
,
'xcxCode'
,
xcxCode
)
that
.
$set
(
codeParams
,
'xcxCode'
,
xcxCode
)
that
.
$set
(
codeParams
,
'
InviterId'
,
that
.
I
nviterId
)
that
.
$set
(
codeParams
,
'
inviterId'
,
that
.
i
nviterId
)
}
else
{
}
else
{
that
.
$set
(
codeParams
,
'xcxCode'
,
xcxCode
)
that
.
$set
(
codeParams
,
'xcxCode'
,
xcxCode
)
}
}
...
...
pages/demand/components/index.vue
View file @
22681fd6
...
@@ -49,8 +49,8 @@
...
@@ -49,8 +49,8 @@
<view
class=
"buttoncolor"
v-if=
"subscript == '3'"
>
<view
class=
"buttoncolor"
v-if=
"subscript == '3'"
>
<button
v-if=
"item.status == 3"
style=
"background: red;"
class=
"buttoncl"
<button
v-if=
"item.status == 3"
style=
"background: red;"
class=
"buttoncl"
@
click
.
stop=
"abolish(2,item)"
>
退款
</button>
@
click
.
stop=
"abolish(2,item)"
>
退款
</button>
<button
v-else-if=
"item.status == 5 || item.status == 6"
class=
"buttonclde buttonGray"
<button
v-else-if=
"item.status ==
4 || item.status ==
5 || item.status == 6"
class=
"buttonclde buttonGray"
@
click
.
stop=
"abolish(4,item)"
>
{{
item
.
status
==
5
?
'退款中'
:
'已退款
'
}}
</button>
@
click
.
stop=
"abolish(4,item)"
>
{{
item
.
status
==
4
?
'已完成'
:
item
.
status
==
5
?
'退款中'
:
item
.
status
==
6
?
'已退款'
:
'
'
}}
</button>
<button
class=
"buttoncl"
@
click
.
stop=
"abolish(3,item)"
>
详情
</button>
<button
class=
"buttoncl"
@
click
.
stop=
"abolish(3,item)"
>
详情
</button>
</view>
</view>
</view>
</view>
...
...
pages/demand/index.vue
View file @
22681fd6
...
@@ -111,7 +111,7 @@
...
@@ -111,7 +111,7 @@
that
.
statusNeedList
=
[]
that
.
statusNeedList
=
[]
if
(
that
.
subscript
==
3
)
{
if
(
that
.
subscript
==
3
)
{
that
.
$delete
(
that
.
needInfo
,
"status"
)
that
.
$delete
(
that
.
needInfo
,
"status"
)
that
.
$set
(
that
.
needInfo
,
'statusList'
,
'3,5,6'
)
that
.
$set
(
that
.
needInfo
,
'statusList'
,
'3,
4,
5,6'
)
}
else
{
}
else
{
that
.
$delete
(
that
.
needInfo
,
"statusList"
)
that
.
$delete
(
that
.
needInfo
,
"statusList"
)
}
}
...
...
pages/home/index.vue
View file @
22681fd6
This diff is collapsed.
Click to expand it.
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