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
d5254d3c
Commit
d5254d3c
authored
Mar 29, 2021
by
hewenhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/2021_03_12_bonus' of…
Merge branch 'feature/2021_03_12_bonus' of
https://dev.jiuaoedu.com/wykolor/GeekBonusH5
into feature/2021_03_12_bonus
parents
2c95129f
00d4ebd8
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
104 additions
and
92 deletions
+104
-92
package.json
package.json
+3
-1
index.html
public/index.html
+1
-0
main.ts
src/main.ts
+2
-0
index.ts
src/model/bonus/index.ts
+7
-4
index.ts
src/router/index.ts
+0
-0
index.ts
src/server/api/bonus/index.ts
+2
-2
bonus.ts
src/store/module/bonus.ts
+14
-7
nativeBridge.ts
src/util/nativeBridge.ts
+1
-1
use-native-bridge.ts
src/util/use-native-bridge.ts
+2
-2
index.vue
src/views/bonus/bonus-detail/index.vue
+1
-1
index.vue
src/views/bonus/index.vue
+71
-74
No files found.
package.json
View file @
d5254d3c
...
@@ -57,7 +57,9 @@
...
@@ -57,7 +57,9 @@
"parserOptions"
:
{
"parserOptions"
:
{
"ecmaVersion"
:
2020
"ecmaVersion"
:
2020
},
},
"rules"
:
{}
"rules"
:
{
"@typescript-eslint/camelcase"
:
"off"
}
},
},
"browserslist"
:
[
"browserslist"
:
[
"> 1%"
,
"> 1%"
,
...
...
public/index.html
View file @
d5254d3c
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<meta
name=
"format-detection"
content=
"telephone=yes"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<link
rel=
"stylesheet"
href=
"//at.alicdn.com/t/font_2425189_lvk0clvlo2.css"
>
<link
rel=
"stylesheet"
href=
"//at.alicdn.com/t/font_2425189_lvk0clvlo2.css"
>
<title><
%=
htmlWebpackPlugin
.
options
.
title
%
></title>
<title><
%=
htmlWebpackPlugin
.
options
.
title
%
></title>
...
...
src/main.ts
View file @
d5254d3c
...
@@ -4,7 +4,9 @@ import router from "./router";
...
@@ -4,7 +4,9 @@ import router from "./router";
import
store
from
"./store"
;
import
store
from
"./store"
;
import
"./assets/style/normalize.css"
;
import
"./assets/style/normalize.css"
;
import
"amfe-flexible"
;
import
"amfe-flexible"
;
import
nativeBridge
from
'./util/nativeBridge'
createApp
(
App
)
createApp
(
App
)
.
use
(
store
)
.
use
(
store
)
.
use
(
router
)
.
use
(
router
)
.
use
(
nativeBridge
)
.
mount
(
"#app"
);
.
mount
(
"#app"
);
src/model/bonus/index.ts
View file @
d5254d3c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: wykolor
* @Author: wykolor
* @Date: 2021-03-23 11:44:35
* @Date: 2021-03-23 11:44:35
* @Last Modified by: wykolor
* @Last Modified by: wykolor
* @Last Modified time: 2021-03-2
4 16:20:07
* @Last Modified time: 2021-03-2
6 15:38:13
*/
*/
export
interface
PageParams
{
export
interface
PageParams
{
...
@@ -44,10 +44,13 @@ export interface BonusListParams extends PageParams {
...
@@ -44,10 +44,13 @@ export interface BonusListParams extends PageParams {
export
interface
BonusAccountResponse
{
export
interface
BonusAccountResponse
{
status
:
string
;
status
:
string
;
balance
:
number
;
sumAdd
:
number
;
sumWithdraw
:
number
;
withdrawing
:
number
;
withdrawing
:
number
;
balanceTotal
:
number
;
addTotal
:
number
;
withdrawedTotal
:
number
;
withdrawAccount
:
string
;
withdrawableTotal
:
number
;
errCode
:
string
;
}
}
export
interface
WithdrawListParams
extends
PageParams
{
export
interface
WithdrawListParams
extends
PageParams
{
...
...
src/router/index.ts
View file @
d5254d3c
src/server/api/bonus/index.ts
View file @
d5254d3c
...
@@ -20,12 +20,12 @@ export const getBonusList = (params: BonusListParams) => {
...
@@ -20,12 +20,12 @@ export const getBonusList = (params: BonusListParams) => {
// 奖励金账户信息
// 奖励金账户信息
export
const
getBonusAccount
=
(
studentId
:
string
)
=>
{
export
const
getBonusAccount
=
(
studentId
:
string
)
=>
{
return
get
<
BonusAccountResponse
>
(
`v1/marketingAccount/bonus/count`
,
{
studentId
});
return
get
<
BonusAccountResponse
>
(
`
/mock/api-jksxb-app/
v1/marketingAccount/bonus/count`
,
{
studentId
});
};
};
// 提现记录列表
// 提现记录列表
export
const
getWithdrawList
=
(
params
:
WithdrawListParams
)
=>
{
export
const
getWithdrawList
=
(
params
:
WithdrawListParams
)
=>
{
return
post
<
Paging
<
WithdrawListResponse
>>
(
`/v1/withdraw/query`
,
params
);
return
post
<
Paging
<
WithdrawListResponse
>>
(
`/
mock/api-jksxb-app/
v1/withdraw/query`
,
params
);
};
};
// 检验图形验证码
// 检验图形验证码
...
...
src/store/module/bonus.ts
View file @
d5254d3c
const
bonus
=
{
const
bonus
=
{
namespaced
:
true
,
namespaced
:
true
,
state
:
()
=>
({
state
:
()
=>
({
studentId
:
12
,
studentId
:
0
,
userId
:
"color"
token
:
""
,
userId
:
0
}),
}),
getters
:
{
getters
:
{},
studentId
:
state
=>
state
.
studentId
+
1
,
mutations
:
{
userName
:
state
=>
state
.
userId
+
"wangyan"
,
saveStudentId
(
state
,
payload
)
{
studentFullName
:
state
=>
state
.
studentId
+
state
.
userId
state
.
studentId
=
payload
;
},
saveToken
(
state
,
payload
)
{
state
.
token
=
payload
;
},
saveUserId
(
state
,
payload
)
{
state
.
userId
=
payload
;
}
},
},
mutations
:
{},
actions
:
{}
actions
:
{}
};
};
...
...
src/util/nativeBridge.ts
View file @
d5254d3c
...
@@ -43,7 +43,7 @@ function install(Vue: App) {
...
@@ -43,7 +43,7 @@ function install(Vue: App) {
const
event_bus
=
mitt
();
const
event_bus
=
mitt
();
// eslint-disable-next-line func-names
// eslint-disable-next-line func-names
window
.
$geek_excuteJS
=
function
(
args
)
{
window
.
$geek_excuteJS
=
function
(
args
)
{
try
{
try
{
const
params
=
JSON
.
parse
(
args
);
const
params
=
JSON
.
parse
(
args
);
event_bus
.
emit
(
GEEK_NATVIE_NAME
,
params
);
event_bus
.
emit
(
GEEK_NATVIE_NAME
,
params
);
...
...
src/util/use-native-bridge.ts
View file @
d5254d3c
...
@@ -17,7 +17,7 @@ const isAndroid = () => {
...
@@ -17,7 +17,7 @@ const isAndroid = () => {
return
android
;
return
android
;
};
};
window
.
$geek_excuteJS
=
function
(
args
)
{
window
.
$geek_excuteJS
=
function
(
args
)
{
try
{
try
{
const
params
=
JSON
.
parse
(
args
);
const
params
=
JSON
.
parse
(
args
);
eventBus
.
emit
<
NativeInvokeFuncParams
>
(
GEEK_NATVIE_NAME
,
params
);
eventBus
.
emit
<
NativeInvokeFuncParams
>
(
GEEK_NATVIE_NAME
,
params
);
...
@@ -52,7 +52,7 @@ function useNativeBridge(
...
@@ -52,7 +52,7 @@ function useNativeBridge(
eventTypeOrEventMap
:
string
|
{
[
key
:
string
]:
ListenerType
},
eventTypeOrEventMap
:
string
|
{
[
key
:
string
]:
ListenerType
},
listener
?:
ListenerType
listener
?:
ListenerType
):
[
typeof
sendNativeMessage
,
typeof
eventBus
]
{
):
[
typeof
sendNativeMessage
,
typeof
eventBus
]
{
const
_listener
=
function
(
this
:
ComponentInternalInstance
|
null
,
arg
?:
NativeInvokeFuncParams
)
{
const
_listener
=
function
(
this
:
ComponentInternalInstance
|
null
,
arg
?:
NativeInvokeFuncParams
)
{
if
(
!
arg
)
return
;
if
(
!
arg
)
return
;
const
{
method
,
data
}
=
arg
;
const
{
method
,
data
}
=
arg
;
if
(
typeof
eventTypeOrEventMap
===
"string"
)
{
if
(
typeof
eventTypeOrEventMap
===
"string"
)
{
...
...
src/views/bonus/bonus-detail/index.vue
View file @
d5254d3c
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
v-model:loading=
"loading"
v-model:loading=
"loading"
v-model:error=
"error"
v-model:error=
"error"
:finished=
"finished"
:finished=
"finished"
finished-text=
"
没有更多了
"
finished-text=
"
~我是有底线的~
"
@
load=
"onLoad"
@
load=
"onLoad"
>
>
<van-tab
name=
"REDUCE"
title=
"支出"
class=
"bonus-detail-pay-list"
>
<van-tab
name=
"REDUCE"
title=
"支出"
class=
"bonus-detail-pay-list"
>
...
...
src/views/bonus/index.vue
View file @
d5254d3c
...
@@ -10,9 +10,16 @@
...
@@ -10,9 +10,16 @@
></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"
<van-col
span=
"12"
class=
"money-desc"
>
><span>
¥
{{
bonusAccount
.
balance
}}
</span></van-col
<span
style=
"position: relative"
>
¥
{{
bonusAccount
.
balanceTotal
}}
<label
class=
"frozen"
v-if=
"bonusAccount.status && bonusAccount.status === BonusAccountStatus.FREEZE"
>
冻结
</label></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%"
...
@@ -28,11 +35,11 @@
...
@@ -28,11 +35,11 @@
<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>
¥
{{
bonusAccount
.
sumAdd
}}
</span>
<span>
¥
{{
bonusAccount
.
addTotal
}}
</span>
</van-col>
</van-col>
<van-col
span=
"8"
>
<van-col
span=
"8"
>
<label>
累计提现
</label>
<label>
累计提现
</label>
<span>
¥
{{
bonusAccount
.
sumWithdraw
}}
</span>
<span>
¥
{{
bonusAccount
.
withdrawedTotal
}}
</span>
</van-col>
</van-col>
<van-col
span=
"8"
>
<van-col
span=
"8"
>
<label>
提现中
</label>
<label>
提现中
</label>
...
@@ -42,7 +49,7 @@
...
@@ -42,7 +49,7 @@
</div>
</div>
<van-cell
<van-cell
center
center
:title=
"`可提现金额:¥$
{bonusAccount.
balance
}`"
:title=
"`可提现金额:¥$
{bonusAccount.
withdrawableTotal
}`"
size="large"
size="large"
style="border-radius: 0.3rem;"
style="border-radius: 0.3rem;"
:border="false"
:border="false"
...
@@ -51,19 +58,18 @@
...
@@ -51,19 +58,18 @@
>
提现
</van-button
>
提现
</van-button
>
>
</van-cell>
</van-cell>
<!-- -->
<div
class=
"bouns-record"
>
<div
class=
"bouns-record"
>
<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"
>
总计:
{{
bonusAccount
.
sumWithdraw
}}
元
</van-col
>
总计:
{{
bonusAccount
.
withdrawedTotal
}}
元
</van-col
>
>
</van-row>
</van-row>
<van-list
<van-list
v-model:loading=
"
state.
loading"
v-model:loading=
"loading"
:finished=
"
state.
finished"
:finished=
"finished"
finished-text=
"
我是有底线的
"
finished-text=
"
~我是有底线的~
"
@
load=
"onLoad"
@
load=
"onLoad"
>
>
<div
class=
"bonus-record-item"
v-for=
"item in withdrawList"
:key=
"item.id"
>
<div
class=
"bonus-record-item"
v-for=
"item in withdrawList"
:key=
"item.id"
>
...
@@ -103,7 +109,6 @@
...
@@ -103,7 +109,6 @@
</div>
</div>
</van-list>
</van-list>
</div>
</div>
<!-- 规则弹窗 -->
<!-- 规则弹窗 -->
<van-dialog
<van-dialog
v-model:show=
"showDialog"
v-model:show=
"showDialog"
...
@@ -154,81 +159,58 @@
...
@@ -154,81 +159,58 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
import
{
computed
,
defineComponent
,
reactive
}
from
"vue"
;
import
{
computed
,
defineComponent
,
reactive
,
toRefs
}
from
"vue"
;
import
{
Dialog
,
Button
,
Col
,
Row
,
Cell
,
List
}
from
"vant"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
BonusAccountResponse
,
WithdrawListResponse
}
from
"@/model/bonus"
;
import
{
useStore
}
from
"vuex"
;
import
{
useStore
}
from
"vuex"
;
import
{
Dialog
,
Button
,
Col
,
Row
,
Cell
,
List
}
from
"vant"
;
import
{
WithdrawListParams
,
WithdrawListResponse
}
from
"@/model/bonus"
;
import
{
bonusModel
}
from
"@/server/api"
;
import
{
BonusAccountStatus
}
from
"@/model/bonus/constant"
;
interface
BonusState
{
withdrawList
:
WithdrawListResponse
[];
[
key
:
string
]:
unknown
;
}
const
Bonus
=
defineComponent
({
const
Bonus
=
defineComponent
({
setup
()
{
setup
()
{
const
route
=
useRoute
();
const
store
=
useStore
();
const
store
=
useStore
();
const
{
studentId
,
token
,
userId
}
=
route
.
query
;
const
bonusStoreState
=
computed
(()
=>
store
.
state
.
bonus
);
const
bonusStoreState
=
computed
(()
=>
store
.
state
.
bonus
);
const
getters
=
computed
(()
=>
store
.
getters
);
store
.
commit
(
"bonus/saveStudentId"
,
studentId
);
console
.
log
(
getters
);
store
.
commit
(
"bonus/saveToken"
,
token
);
const
state
=
reactive
({
store
.
commit
(
"bonus/saveUserId"
,
userId
);
const
state
=
reactive
<
BonusState
>
({
loading
:
false
,
loading
:
false
,
finished
:
false
finished
:
false
,
bonusAccount
:
{},
BonusAccountStatus
,
withdrawList
:
[]
});
});
const
bonusAccount
=
reactive
<
BonusAccountResponse
>
({
// 获取奖励金信息
status
:
""
,
bonusModel
.
getBonusAccount
(
bonusStoreState
.
value
.
studentId
).
then
(
res
=>
{
balance
:
1.97
,
const
{
data
}
=
res
;
sumAdd
:
2.09
,
state
.
bonusAccount
=
data
;
sumWithdraw
:
376.79
,
});
withdrawing
:
4.09
const
withdrawListParams
=
reactive
<
WithdrawListParams
>
({
pageSize
:
10
,
pageNum
:
1
,
studentId
:
bonusStoreState
.
value
.
studentId
});
});
const
withdrawList
=
reactive
<
WithdrawListResponse
[]
>
([
{
status
:
"0"
,
// 提现中
accountName
:
"王嘉尔"
,
withdrawApplyTime
:
"2021-10-12 12:12:12"
,
withdrawPayTime
:
"2021-10-12 12:12:12"
,
expectedPayTime
:
"2021-10-12 12:12:12"
,
failTime
:
"2021-10-12 12:12:12"
,
withdrawAmount
:
12.04
,
reason
:
"账户异常"
},
{
status
:
"1"
,
// 提现成功
accountName
:
"王嘉尔"
,
withdrawApplyTime
:
"2021-10-12 12:12:12"
,
withdrawPayTime
:
"2021-10-12 12:12:12"
,
expectedPayTime
:
"2021-10-12 12:12:12"
,
failTime
:
"2021-10-12 12:12:12"
,
withdrawAmount
:
12.02
,
reason
:
"账户异常"
},
{
status
:
"2"
,
// 提现失败
accountName
:
"王嘉尔"
,
withdrawApplyTime
:
"2021-10-12 12:12:12"
,
withdrawPayTime
:
"2021-10-12 12:12:12"
,
expectedPayTime
:
"2021-10-12 12:12:12"
,
failTime
:
"2021-10-12 12:12:12"
,
withdrawAmount
:
12.5
,
reason
:
"账户异常"
}
]);
const
onLoad
=
()
=>
{
const
onLoad
=
()
=>
{
// 异步更新数据
bonusModel
.
getWithdrawList
(
withdrawListParams
).
then
(
res
=>
{
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
const
{
hasNextPage
,
list
}
=
res
.
data
;
setTimeout
(()
=>
{
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
// withdrawList.push();
}
// 加载状态结束
state
.
loading
=
false
;
state
.
loading
=
false
;
state
.
finished
=
!
hasNextPage
;
// 数据全部加载完成
state
.
withdrawList
=
state
.
withdrawList
.
concat
(
list
);
if
(
withdrawList
.
length
>=
40
)
{
withdrawListParams
.
pageNum
++
;
state
.
finished
=
true
;
});
}
},
1000
);
};
};
return
{
return
{
state
,
...
toRefs
(
state
),
bonusAccount
,
withdrawList
,
onLoad
,
onLoad
,
bonusStoreState
bonusStoreState
};
};
...
@@ -257,7 +239,9 @@ const Bonus = defineComponent({
...
@@ -257,7 +239,9 @@ const Bonus = defineComponent({
withdraw
()
{
withdraw
()
{
// this.showDangerous = true;
// this.showDangerous = true;
this
.
$router
.
push
(
"withdraw"
);
// this.$router.push("withdraw");
// console.log(this.withdrawRule);
window
.
open
(
'tel:10086'
,
'_blank'
)
}
}
}
}
});
});
...
@@ -278,6 +262,19 @@ export default Bonus;
...
@@ -278,6 +262,19 @@ export default Bonus;
.money-desc
{
.money-desc
{
font-size
:
72px
;
font-size
:
72px
;
font-weight
:
600
;
font-weight
:
600
;
.frozen
{
background
:
url("../../assets/images/bonus/frozen.png")
no-repeat
;
background-size
:
100%
100%
;
font-size
:
26px
;
display
:
inline-block
;
width
:
117px
;
height
:
88px
;
line-height
:
76px
;
text-align
:
center
;
position
:
absolute
;
top
:
-40px
;
right
:
-100px
;
}
}
}
}
}
.bonus-account-status
{
.bonus-account-status
{
...
...
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