Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
user
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
mp
user
Commits
447b16d9
Commit
447b16d9
authored
Aug 13, 2022
by
songbingqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复部分bug
parent
8b2bdda8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
99 additions
and
42 deletions
+99
-42
components/Ticket/index.vue
+3
-3
mineSubPackage/pages/coupon/index.vue
+2
-1
orderSubPackage/pages/coupon/index.vue
+7
-1
orderSubPackage/pages/settlement/index.vue
+3
-0
pages/mine/mine.vue
+16
-1
request/menu/index.js
+37
-30
request/user/index.js
+14
-0
store/modules/order.js
+17
-6
No files found.
components/Ticket/index.vue
View file @
447b16d9
...
...
@@ -30,8 +30,7 @@
</view>
<view
class=
"right_bottom"
>
<view
class=
"more_info"
@
click=
"openDetail"
>
<view
:style=
"[descColor]"
class=
"desc"
v-if=
"info.couponType===1||info.couponType===2"
>
抵扣订单金额
</view>
<view
:style=
"[descColor]"
class=
"desc"
v-else
>
下单可抵扣商品,指定分类商品可用
</view>
<view
:style=
"[descColor]"
class=
"desc"
>
{{
info
.
categoryDesc
}}
</view>
<image
:class=
"['arrow-right-select',arrowFlag?'arrow-right-select-down':'arrow-right-select-up']"
:src=
"info.status!==0?'../../static/imgs/jiantouqian.png':'../../static/imgs/jiantouhei.png'"
/>
</view>
</view>
...
...
@@ -82,6 +81,7 @@ export default {
zkPrice
:
'7'
,
// 折扣金额
dkPrice
:
'免单'
,
// 抵扣金额
priceDesc
:
'满130可用'
,
// 条件描述
categoryDesc
:
'最大免单'
,
// 下拉行描述
checkStatus
:
false
,
// 优惠券选中状态
title
:
'最大字数最大字数最大'
,
// 优惠券标题
time
:[
'2022.07.24.17:20'
],
// 过期时间
...
...
@@ -159,7 +159,7 @@ export default {
},
selected
(
info
)
{
if
(
info
.
status
!==
0
)
return
this
.
$emit
(
"updata"
,
info
.
id
)
this
.
$emit
(
"updata"
,
{
id
:
info
.
id
,
checkStatus
:
info
.
checkStatus
}
)
},
goMenu
()
{
uni
.
switchTab
({
url
:
'/pages/menu/menu'
});
...
...
mineSubPackage/pages/coupon/index.vue
View file @
447b16d9
...
...
@@ -65,6 +65,7 @@ export default {
zkPrice
:
'7'
,
// 折扣金额
dkPrice
:
'免单'
,
// 抵扣金额
priceDesc
:
'满130可用'
,
// 条件描述
categoryDesc
:
'最大免单'
,
// 下拉行描述
checkStatus
:
false
,
// 优惠券选中状态
title
:
'最大字数最大字数最大'
,
// 优惠券标题
time
:[
'2022.07.24.17:20'
],
// 过期时间
...
...
@@ -82,7 +83,6 @@ export default {
async
getTickList
(
val
)
{
const
{
data
}
=
await
Mine
.
getUserList
(
val
)
const
{
rows
}
=
data
console
.
log
(
data
)
const
canuse
=
rows
.
map
(
item
=>
{
let
timeStart
=
''
let
timeEnd
=
''
...
...
@@ -99,6 +99,7 @@ export default {
typeDesc
:
item
.
categoryName
,
price
:
item
.
priceDiscount
,
priceDesc
:
item
.
ruleDesc
,
categoryDesc
:
item
.
categoryDesc
,
checkStatus
:
false
,
title
:
item
.
name
,
time
:
[
timeStart
,
timeEnd
],
...
...
orderSubPackage/pages/coupon/index.vue
View file @
447b16d9
...
...
@@ -103,12 +103,18 @@ export default {
this
.
canuse
=
this
.
$store
.
state
.
order
.
tickListSettle
.
canuse
},
methods
:
{
updata
(
id
){
updata
(
val
){
const
{
id
,
checkStatus
}
=
val
this
.
canuse
.
map
(
item
=>
{
if
(
item
.
id
===
id
){
item
.
checkStatus
=
!
item
.
checkStatus
}
else
{
item
.
checkStatus
=
false
item
.
status
=
1
item
.
reson
=
'不可与已勾选券叠加使用'
}
if
(
checkStatus
){
item
.
status
=
0
}
})
this
.
canuse
=
[...
this
.
canuse
]
...
...
orderSubPackage/pages/settlement/index.vue
View file @
447b16d9
...
...
@@ -478,7 +478,10 @@ export default {
}
let
orderInfo
=
await
Menu
.
saveReserve
(
sendData
);
if
(
orderInfo
&&
orderInfo
.
data
.
code
==
200
)
{
// const {}
await
Menu
.
requestPayment
(
orderInfo
.
data
.
data
,
res
,
this
.
buyType
);
}
else
{
}
}
...
...
pages/mine/mine.vue
View file @
447b16d9
...
...
@@ -41,6 +41,7 @@
<view
class=
"box"
@
click
.
stop=
"goToPage('coupon')"
>
<view
class=
"left"
>
<view
class=
"text"
>
HOOLOO券
</view>
<view
class=
"tickNum"
v-if=
"tickNum"
>
{{
tickNum
}}
张可用
</view>
</view>
<view
class=
"right"
><image
class=
"icon"
src=
"/static/imgs/youhuijuan.png"
></image></view>
</view>
...
...
@@ -107,10 +108,15 @@ export default {
this
.
img
=
'https://s3.bmp.ovh/imgs/2022/07/05/1768111c5c7f5300.gif'
}
},
async
onShow
()
{
const
{
data
}
=
await
User
.
getCouponNum
()
this
.
tickNum
=
data
?.
data
||
0
},
data
()
{
return
{
loginInfo
:
""
,
img
:
''
img
:
''
,
tickNum
:
0
}
},
computed
:
{
...
...
@@ -424,6 +430,15 @@ button::after {
font-weight
:
normal
;
color
:
#333333
;
}
.tickNum
{
font-size
:
20
rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#999999
;
position
:
absolute
;
left
:
40
rpx
;
bottom
:
-18
rpx
;
}
.desc
{
font-size
:
20
rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
...
...
request/menu/index.js
View file @
447b16d9
...
...
@@ -48,17 +48,36 @@ export default {
requestPayment
(
data
,
oldData
,
buyType
)
{
// res为调起微信支付所需参数
// 调起微信支付
const
{
switchTab
=
true
,
callBack
}
=
data
uni
.
requestPayment
({
provider
:
'wxpay'
,
// 服务提提供商微信支付
timeStamp
:
data
.
timeStamp
,
// 时间戳
nonceStr
:
data
.
nonceStr
,
// 随机字符串
package
:
data
.
package
,
signType
:
data
.
signType
||
'MD5'
,
// 签名算法
paySign
:
data
.
paySign
,
// 签名
success
:
async
function
(
res
)
{
if
(
res
.
errMsg
==
'requestPayment:ok'
)
{
// 删除购物车数据后重新放回购物车
if
(
data
.
appId
)
{
const
{
switchTab
=
true
,
callBack
}
=
data
uni
.
requestPayment
({
provider
:
'wxpay'
,
// 服务提提供商微信支付
timeStamp
:
data
.
timeStamp
,
// 时间戳
nonceStr
:
data
.
nonceStr
,
// 随机字符串
package
:
data
.
package
,
signType
:
data
.
signType
||
'MD5'
,
// 签名算法
paySign
:
data
.
paySign
,
// 签名
success
:
async
function
(
res
)
{
if
(
res
.
errMsg
==
'requestPayment:ok'
)
{
// 删除购物车数据后重新放回购物车
uni
.
setStorageSync
(
'shopCarInfo'
,
[]);
$EventBus
.
$emit
(
'updateCar'
);
uni
.
setStorageSync
(
'orderId'
,
data
.
orderId
);
if
(
switchTab
){
let
url
=
'/orderSubPackage/pages/orderInfo/index?from=settlement'
uni
.
navigateTo
({
url
})
}
else
{
callBack
()
}
}
// 业务逻辑。。。
},
fail
:
async
function
(
err
)
{
context
.
showToast
({
title
:
'支付失败'
,
icon
:
'error'
,
});
uni
.
setStorageSync
(
'shopCarInfo'
,
[]);
$EventBus
.
$emit
(
'updateCar'
);
uni
.
setStorageSync
(
'orderId'
,
data
.
orderId
);
...
...
@@ -68,26 +87,14 @@ export default {
}
else
{
callBack
()
}
}
},
});
}
else
{
uni
.
setStorageSync
(
'orderId'
,
data
);
let
url
=
'/orderSubPackage/pages/orderInfo/index?from=settlement'
uni
.
navigateTo
({
url
})
}
// 业务逻辑。。。
},
fail
:
async
function
(
err
)
{
context
.
showToast
({
title
:
'支付失败'
,
icon
:
'error'
,
});
uni
.
setStorageSync
(
'shopCarInfo'
,
[]);
$EventBus
.
$emit
(
'updateCar'
);
uni
.
setStorageSync
(
'orderId'
,
data
.
orderId
);
if
(
switchTab
){
let
url
=
'/orderSubPackage/pages/orderInfo/index?from=settlement'
uni
.
navigateTo
({
url
})
}
else
{
callBack
()
}
},
});
},
// 优惠卷信息接口
requestTicketList
(
data
){
...
...
request/user/index.js
View file @
447b16d9
...
...
@@ -181,5 +181,19 @@ export default {
context
.
showToast
({
title
:
msg
,
icon
:
'none'
});
return
err
});
},
// 获取用户优惠券数量
getCouponNum
(
params
)
{
return
uni
.
$u
.
http
.
get
(
'/app/homepage/coupon-count'
)
.
then
((
res
)
=>
{
return
res
;
})
.
catch
((
err
)
=>
{
const
{
data
}
=
err
const
{
msg
}
=
data
context
.
showToast
({
title
:
msg
,
icon
:
'none'
});
return
err
});
}
};
store/modules/order.js
View file @
447b16d9
...
...
@@ -17,18 +17,19 @@ const order = {
let
timeStart
=
''
let
timeEnd
=
''
if
(
item
.
useStartTime
){
timeStart
=
item
.
useStartTime
.
slice
(
0
,
11
).
replace
(
'-'
,
'.'
)
timeStart
=
item
.
useStartTime
.
slice
(
0
,
11
).
replace
(
new
RegExp
(
'-'
,
'g'
)
,
'.'
)
}
if
(
item
.
useEndTime
){
timeEnd
=
item
.
useEndTime
.
slice
(
0
,
11
).
replace
(
'-'
,
'.'
)
timeEnd
=
item
.
useEndTime
.
slice
(
0
,
11
).
replace
(
new
RegExp
(
'-'
,
'g'
)
,
'.'
)
}
return
{
id
:
item
.
id
,
status
:
0
,
couponType
:
item
.
type
,
typeDesc
:
item
.
categoryName
,
price
:
item
.
priceDiscount
,
price
:
item
.
priceDiscount
===
0
?
'免单'
:
item
.
priceDiscount
,
priceDesc
:
item
.
ruleDesc
,
categoryDesc
:
item
.
categoryDesc
,
checkStatus
:
false
,
title
:
item
.
name
,
time
:
[
timeStart
,
timeEnd
],
...
...
@@ -44,23 +45,33 @@ const order = {
}).
sort
((
a
,
b
)
=>
{
return
b
.
couponAmount
-
a
.
couponAmount
})
for
(
let
i
=
0
;
i
<
canuse
.
length
;
i
++
){
if
(
i
===
0
){
canuse
[
i
].
checkStatus
=
true
}
else
{
canuse
[
i
].
checkStatus
=
false
canuse
[
i
].
status
=
1
canuse
[
i
].
reson
=
'不可与已勾选券叠加使用'
}
}
if
(
canuse
.
length
!=
0
)
canuse
[
0
].
checkStatus
=
true
const
cantUse
=
data
.
notfitable
.
map
(
item
=>
{
let
timeStart
=
''
let
timeEnd
=
''
if
(
item
.
useStartTime
){
timeStart
=
item
.
useStartTime
.
slice
(
0
,
11
).
replace
(
'-'
,
'.'
)
timeStart
=
item
.
useStartTime
.
slice
(
0
,
11
).
replace
(
new
RegExp
(
'-'
,
'g'
)
,
'.'
)
}
if
(
item
.
useEndTime
){
timeEnd
=
item
.
useEndTime
.
slice
(
0
,
11
).
replace
(
'-'
,
'.'
)
timeEnd
=
item
.
useEndTime
.
slice
(
0
,
11
).
replace
(
new
RegExp
(
'-'
,
'g'
)
,
'.'
)
}
return
{
id
:
item
.
id
,
status
:
1
,
couponType
:
item
.
type
,
typeDesc
:
item
.
categoryName
,
price
:
item
.
priceDiscount
,
price
:
item
.
priceDiscount
===
0
?
'免单'
:
item
.
priceDiscount
,
priceDesc
:
item
.
ruleDesc
,
categoryDesc
:
item
.
categoryDesc
,
checkStatus
:
false
,
title
:
item
.
name
,
time
:
[
timeStart
,
timeEnd
],
...
...
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