Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mall-webview
Project
Project
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
frontend
mall-webview
Commits
6977ae15
Commit
6977ae15
authored
Mar 23, 2021
by
wykolor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: mock数据对接
parent
48e03072
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
221 additions
and
60 deletions
+221
-60
main.ts
src/main.ts
+2
-1
constant.ts
src/model/bonus/constant.ts
+29
-0
index.ts
src/model/bonus/index.ts
+81
-0
index.ts
src/server/api/bonus/index.ts
+32
-0
index.ts
src/server/api/index.ts
+6
-0
request.ts
src/server/request.ts
+6
-14
index.vue
src/views/bonus/bonus-detail/index.vue
+0
-0
index.vue
src/views/bonus/index.vue
+64
-43
vue.config.js
vue.config.js
+1
-2
No files found.
src/main.ts
View file @
6977ae15
...
@@ -5,7 +5,7 @@ import store from "./store";
...
@@ -5,7 +5,7 @@ import store from "./store";
import
'./assets/style/normalize.css'
;
import
'./assets/style/normalize.css'
;
import
'vant/lib/index.css'
;
import
'vant/lib/index.css'
;
import
'amfe-flexible'
;
import
'amfe-flexible'
;
createApp
(
App
)
createApp
(
App
)
.
use
(
store
)
.
use
(
store
)
.
use
(
router
)
.
use
(
router
)
.
mount
(
"#app"
);
.
mount
(
"#app"
);
\ No newline at end of file
src/model/bonus/constant.ts
0 → 100644
View file @
6977ae15
/*
* @Author: wykolor
* @Date: 2021-03-23 10:36:45
* @Last Modified by: wykolor
* @Last Modified time: 2021-03-23 10:36:45
*/
// 流水类型
export
enum
FlowType
{
ADD
=
'ADD'
,
// 收入
REDUCE
=
'REDUCE'
// 支出
}
// 业务类型
export
enum
BizType
{
WITHDRAW
=
'WITHDRAW'
,
// 提现
ORDER
=
'ORDER'
,
// 订单支付
ORDER_RETURN
=
'ORDER_RETURN'
,
// 订单返还
INTRODUCE
=
'INTRODUCE'
,
// 转介绍
WITHDRAW_RETURN
=
'WITHDRAW_RETURN'
,
// 提现返还
}
// 奖励金账户状态
export
enum
BonusAccountStatus
{
ACTIVE
=
'ACTIVE'
,
// 正常
FREEZE
=
'FREEZE'
,
// 冻结
}
\ No newline at end of file
src/model/bonus/index.ts
0 → 100644
View file @
6977ae15
/*
* @Author: wykolor
* @Date: 2021-03-23 11:44:35
* @Last Modified by: wykolor
* @Last Modified time: 2021-03-23 17:00:17
*/
export
interface
PageParams
{
pageSize
?:
number
pageNum
?:
number
}
export
interface
baseResponse
<
T
=
object
>
{
code
:
number
;
msg
:
string
;
data
:
T
}
export
interface
Paging
<
T
=
object
>
{
total
:
number
;
pageNum
:
number
;
pageSize
:
number
;
hasNextPage
:
boolean
;
list
:
Array
<
T
>
}
export
interface
BonusListResponse
{
creationTime
:
string
;
flowType
:
string
;
amountChange
:
number
;
bizType
:
string
;
bizTypeName
:
string
;
relationNo
:
string
;
withdrawApplyTime
:
string
;
withdrawPayTime
:
string
;
className
:
string
;
schoolAreaName
:
string
;
}
export
interface
BonusListParams
extends
PageParams
{
studentId
:
number
;
flowType
:
string
;
}
export
interface
BonusAccountResponse
{
status
:
string
;
balance
:
number
;
sumAdd
:
number
;
sumWithdraw
:
number
;
withdrawing
:
number
;
}
export
interface
WithdrawListParams
extends
PageParams
{
studentId
:
number
;
}
export
interface
WithdrawListResponse
{
accountName
:
string
;
withdrawApplyTime
:
string
;
withdrawAmount
:
number
;
withdrawPayTime
:
string
;
status
:
string
;
expectedPayTime
:
string
;
failTime
:
string
;
reason
:
string
;
}
export
interface
CheckCaptchaParams
{
userId
:
string
;
ticket
:
string
;
randStr
:
string
;
}
export
interface
WithdrawParams
{
withdrawAmount
:
number
;
userId
:
number
;
studentId
:
number
;
smsVerifyCode
:
string
;
}
\ No newline at end of file
src/server/api/bonus/index.ts
0 → 100644
View file @
6977ae15
import
{
BonusAccountResponse
,
BonusListParams
,
BonusListResponse
,
CheckCaptchaParams
,
Paging
,
WithdrawListParams
,
WithdrawListResponse
,
WithdrawParams
}
from
'@/model/bonus'
;
import
{
get
,
post
}
from
'../../request'
;
const
bonusUrl
=
'/v1/marketingAccount/'
;
const
withdrawUrl
=
'/v1/withdraw/'
// 奖励金收支列表
export
const
getBonusList
=
(
params
:
BonusListParams
)
=>
{
return
post
<
Paging
<
BonusListResponse
>>
(
`
${
bonusUrl
}
bonus/flow/list`
,
params
)
}
// 奖励金账户信息
export
const
getBonusAccount
=
(
studentId
:
string
)
=>
{
return
get
<
BonusAccountResponse
>
(
`
${
bonusUrl
}
bonus/count`
,
{
studentId
})
}
// 提现记录列表
export
const
getWithdrawList
=
(
params
:
WithdrawListParams
)
=>
{
return
post
<
Paging
<
WithdrawListResponse
>>
(
`
${
withdrawUrl
}
query`
,
params
)
}
// 检验图形验证码
export
const
checkCaptcha
=
(
params
:
CheckCaptchaParams
)
=>
{
return
get
<
string
>
(
`
${
withdrawUrl
}
checkCaptcha`
,
params
);
}
// 提现
export
const
withdraw
=
(
params
:
WithdrawParams
)
=>
{
return
post
<
string
>
(
''
,
params
);
}
\ No newline at end of file
src/server/api/index.ts
0 → 100644
View file @
6977ae15
import
*
as
bonusModel
from
"./bonus/index"
;
export
{
bonusModel
}
\ No newline at end of file
src/server/request.ts
View file @
6977ae15
import
axios
from
"./http"
import
axios
from
"./http"
import
{
baseResponse
}
from
'../model/bonus/index'
/**
/**
* 封装的get请求
* 封装的get请求
* @param {*} url 请求路径
* @param {*} url 请求路径
* @param {*} params 请求参数
* @param {*} params 请求参数
* @returns
* @returns
*/
*/
export
function
get
(
url
:
string
,
params
?:
object
)
{
export
function
get
<
T
=
any
>
(
url
:
string
,
params
?:
object
)
{
return
axios
({
return
axios
.
get
<
baseResponse
<
T
>>
(
url
,
params
)
method
:
"get"
,
url
:
url
,
params
:
params
});
}
}
/**
/**
...
@@ -20,11 +16,6 @@ import axios from "./http"
...
@@ -20,11 +16,6 @@ import axios from "./http"
* @param {*} params 请求参数
* @param {*} params 请求参数
* @returns
* @returns
*/
*/
export
function
post
(
url
:
string
,
params
?:
object
,
headers
?:
object
)
{
export
function
post
<
T
=
any
>
(
url
:
string
,
params
?:
object
)
{
return
axios
({
return
axios
.
post
<
baseResponse
<
T
>>
(
url
,
params
)
method
:
"post"
,
url
:
url
,
data
:
params
,
headers
});
}
}
\ No newline at end of file
src/views/bonus/bonus-detail/index.vue
View file @
6977ae15
This diff is collapsed.
Click to expand it.
src/views/bonus/index.vue
View file @
6977ae15
...
@@ -10,7 +10,9 @@
...
@@ -10,7 +10,9 @@
></van-col>
></van-col>
</van-row>
</van-row>
<van-row
class=
"bonus-account-money"
align=
"center"
>
<van-row
class=
"bonus-account-money"
align=
"center"
>
<van-col
span=
"12"
class=
"money-desc"
><span>
¥1200.00
</span></van-col>
<van-col
span=
"12"
class=
"money-desc"
><span>
¥
{{
bonusAccount
.
balance
}}
</span></van-col
>
<van-col
span=
"12"
style=
"text-align: right"
<van-col
span=
"12"
style=
"text-align: right"
><van-button
><van-button
style=
"border-color: #fff; width: 45%"
style=
"border-color: #fff; width: 45%"
...
@@ -26,21 +28,21 @@
...
@@ -26,21 +28,21 @@
<van-row
class=
"bonus-account-status"
>
<van-row
class=
"bonus-account-status"
>
<van-col
span=
"8"
>
<van-col
span=
"8"
>
<label>
累计收入
</label>
<label>
累计收入
</label>
<span>
¥
11334.00
</span>
<span>
¥
{{
bonusAccount
.
sumAdd
}}
</span>
</van-col>
</van-col>
<van-col
span=
"8"
>
<van-col
span=
"8"
>
<label>
累计提现
</label>
<label>
累计提现
</label>
<span>
¥
00.00
</span>
<span>
¥
{{
bonusAccount
.
sumWithdraw
}}
</span>
</van-col>
</van-col>
<van-col
span=
"8"
>
<van-col
span=
"8"
>
<label>
提现中
</label>
<label>
提现中
</label>
<span>
¥
334.00
</span>
<span>
¥
{{
bonusAccount
.
withdrawing
}}
</span>
</van-col>
</van-col>
</van-row>
</van-row>
</div>
</div>
<van-cell
<van-cell
center
center
title=
"可提现金额:¥12.00
"
:title=
"`可提现金额:¥$
{bonusAccount.balance}`
"
size="large"
size="large"
style="border-radius: 0.3rem;"
style="border-radius: 0.3rem;"
:border="false"
:border="false"
...
@@ -54,7 +56,7 @@
...
@@ -54,7 +56,7 @@
<van-row>
<van-row>
<van-col
span=
"12"
class=
"tip"
>
 
奖励金提现金额
</van-col>
<van-col
span=
"12"
class=
"tip"
>
 
奖励金提现金额
</van-col>
<van-col
span=
"12"
class=
"tip-money"
style=
"text-align: right; font-weight: 550"
<van-col
span=
"12"
class=
"tip-money"
style=
"text-align: right; font-weight: 550"
>
总计:
570.00
元
</van-col
>
总计:
{{
bonusAccount
.
sumWithdraw
}}
元
</van-col
>
>
</van-row>
</van-row>
...
@@ -64,36 +66,39 @@
...
@@ -64,36 +66,39 @@
finished-text=
"我是有底线的"
finished-text=
"我是有底线的"
@
load=
"onLoad"
@
load=
"onLoad"
>
>
<div
class=
"bonus-record-item"
v-for=
"item in
state.bonusRecord
List"
:key=
"item.id"
>
<div
class=
"bonus-record-item"
v-for=
"item in
withdraw
List"
:key=
"item.id"
>
<div
class=
"bonus-record-item-header"
>
<div
class=
"bonus-record-item-header"
>
<div
class=
"bonus-record-item-header-status"
>
<div
class=
"bonus-record-item-header-status"
>
<i
<i
class=
"iconfont"
class=
"iconfont"
:class=
"
:class=
"
item.status ===
0
item.status ===
'0'
? 'icon-shijian'
? 'icon-shijian'
: item.status ===
1
: item.status ===
'1'
? 'icon-jindutiaoqiandai'
? 'icon-jindutiaoqiandai'
: 'icon-xiazaishibai'
: 'icon-xiazaishibai'
"
"
:style=
"
{
:style=
"
{
color: item.status === 0 ? '#46BB36' : item.status === 1 ? '#027AFF' : '#F1551E'
color:
item.status === '0' ? '#46BB36' : item.status === '1' ? '#027AFF' : '#F1551E'
}"
}"
>
</i>
>
</i>
<span>
{{
<span>
{{
item
.
status
===
0
?
"提现中"
:
item
.
status
===
1
?
"提现成功"
:
"提现失败"
item
.
status
===
"0"
?
"提现中"
:
item
.
status
===
"1"
?
"提现成功"
:
"提现失败"
}}
</span>
}}
</span>
<label
v-if=
"item.status ===
0
"
>
请耐心等候~
</label>
<label
v-if=
"item.status ===
'0'
"
>
请耐心等候~
</label>
</div>
</div>
<p
class=
"bonus-record-item-apply-money"
>
<p
class=
"bonus-record-item-apply-money"
>
{{
item
.
status
===
1
?
"-"
:
""
}}
¥
{{
item
.
applyMoney
}}
{{
item
.
status
===
"1"
?
"-"
:
""
}}
¥
{{
item
.
withdrawAmount
}}
</p>
</p>
</div>
</div>
<ul
class=
"bonus-record-item-detail"
>
<ul
class=
"bonus-record-item-detail"
>
<li>
微信提现:
{{
item
.
userName
}}
</li>
<li>
微信提现:
{{
item
.
accountName
}}
</li>
<li>
申请时间:
{{
item
.
applyTime
}}
</li>
<li>
申请时间:
{{
item
.
withdrawApplyTime
}}
</li>
<li>
预计时间:
{{
item
.
arrivalTime
}}
</li>
<li
v-if=
"item.status === '0'"
>
预计时间:
{{
item
.
expectedPayTime
}}
</li>
<li
v-if=
"item.status === 2"
>
失败原因:
{{
item
.
errorReason
}}
</li>
<li
v-if=
"item.status === '1'"
>
到账时间:
{{
item
.
withdrawPayTime
}}
</li>
<li
v-if=
"item.status === '2'"
>
失败时间:
{{
item
.
failTime
}}
</li>
<li
v-if=
"item.status === '2'"
>
失败原因:
{{
item
.
reason
}}
</li>
</ul>
</ul>
</div>
</div>
</van-list>
</van-list>
...
@@ -151,58 +156,74 @@
...
@@ -151,58 +156,74 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
import
{
defineComponent
,
reactive
}
from
"vue"
;
import
{
defineComponent
,
reactive
}
from
"vue"
;
import
{
Dialog
,
Button
,
Col
,
Row
,
Cell
,
List
}
from
"vant"
;
import
{
Dialog
,
Button
,
Col
,
Row
,
Cell
,
List
}
from
"vant"
;
import
{
BonusAccountResponse
,
WithdrawListResponse
}
from
"@/model/bonus"
;
const
Bonus
=
defineComponent
({
const
Bonus
=
defineComponent
({
setup
()
{
setup
(
props
)
{
const
state
=
reactive
({
const
state
=
reactive
({
loading
:
false
,
loading
:
false
,
finished
:
false
,
finished
:
false
bonusRecordList
:
[
});
const
bonusAccount
=
reactive
<
BonusAccountResponse
>
({
status
:
""
,
balance
:
1.97
,
sumAdd
:
2.09
,
sumWithdraw
:
376.79
,
withdrawing
:
4.09
});
const
withdrawList
=
reactive
<
WithdrawListResponse
[]
>
([
{
{
status
:
0
,
// 提现中
status
:
"0"
,
// 提现中
userName
:
"王嘉尔"
,
accountName
:
"王嘉尔"
,
applyTime
:
"2021-10-12 12:12:12"
,
withdrawApplyTime
:
"2021-10-12 12:12:12"
,
arrivalTime
:
"2021-10-12 12:12:12"
,
withdrawPayTime
:
"2021-10-12 12:12:12"
,
applyMoney
:
12.04
expectedPayTime
:
"2021-10-12 12:12:12"
,
failTime
:
"2021-10-12 12:12:12"
,
withdrawAmount
:
12.04
,
reason
:
"账户异常"
},
},
{
{
status
:
1
,
// 提现成功
status
:
"1"
,
// 提现成功
userName
:
"王嘉尔"
,
accountName
:
"王嘉尔"
,
applyTime
:
"2021-10-12 12:12:12"
,
withdrawApplyTime
:
"2021-10-12 12:12:12"
,
arrivalTime
:
"2021-10-12 12:12:12"
,
withdrawPayTime
:
"2021-10-12 12:12:12"
,
applyMoney
:
12.02
expectedPayTime
:
"2021-10-12 12:12:12"
,
failTime
:
"2021-10-12 12:12:12"
,
withdrawAmount
:
12.02
,
reason
:
"账户异常"
},
},
{
{
status
:
2
,
// 提现失败
status
:
"2"
,
// 提现失败
userName
:
"王嘉尔"
,
accountName
:
"王嘉尔"
,
applyTime
:
"2021-10-12 12:12:12"
,
withdrawApplyTime
:
"2021-10-12 12:12:12"
,
arrivalTime
:
"2021-10-12 12:12:12"
,
withdrawPayTime
:
"2021-10-12 12:12:12"
,
applyMoney
:
12.5
,
expectedPayTime
:
"2021-10-12 12:12:12"
,
errorReason
:
"账户异常"
failTime
:
"2021-10-12 12:12:12"
,
}
withdrawAmount
:
12.5
,
]
reason
:
"账户异常"
});
}
]);
const
onLoad
=
()
=>
{
const
onLoad
=
()
=>
{
// 异步更新数据
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
setTimeout
(()
=>
{
setTimeout
(()
=>
{
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
//
state.bonusRecord
List.push();
//
withdraw
List.push();
}
}
// 加载状态结束
// 加载状态结束
state
.
loading
=
false
;
state
.
loading
=
false
;
// 数据全部加载完成
// 数据全部加载完成
if
(
state
.
bonusRecord
List
.
length
>=
40
)
{
if
(
withdraw
List
.
length
>=
40
)
{
state
.
finished
=
true
;
state
.
finished
=
true
;
}
}
},
1000
);
},
1000
);
};
};
return
{
return
{
state
,
state
,
bonusAccount
,
withdrawList
,
onLoad
onLoad
};
};
},
},
...
...
vue.config.js
View file @
6977ae15
...
@@ -30,8 +30,7 @@ module.exports = {
...
@@ -30,8 +30,7 @@ module.exports = {
replace
:
true
,
replace
:
true
,
mediaQuery
:
false
,
mediaQuery
:
false
,
minPixelValue
:
2
,
minPixelValue
:
2
,
exclude
:
/
(
node_module
)
/i
,
exclude
:
/
(
node_module
)
/i
selectorBlackList
:
[
"tc-"
,
"t"
]
})
})
]
]
}
}
...
...
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