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
65afed47
Commit
65afed47
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
c1ae52ec
b9f7427a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
9 deletions
+17
-9
formatBonusTipTxt.ts
src/util/formatBonusTipTxt.ts
+2
-1
use-native-bridge.ts
src/util/use-native-bridge.ts
+2
-2
index.vue
src/views/bonus/bonus-detail/index.vue
+9
-1
index.vue
src/views/bonus/index.vue
+4
-5
No files found.
src/util/formatBonusTipTxt.ts
View file @
65afed47
...
@@ -21,7 +21,7 @@ export function formatBonusTipTxt(errCode: string): string {
...
@@ -21,7 +21,7 @@ export function formatBonusTipTxt(errCode: string): string {
tip
=
'提现金额至少为:1.00元。当前奖励金账户余额不足,多多转介绍吧!'
;
tip
=
'提现金额至少为:1.00元。当前奖励金账户余额不足,多多转介绍吧!'
;
break
;
break
;
default
:
default
:
tip
=
'
绑定微信后,才可进行提现!
'
tip
=
''
}
}
return
tip
;
return
tip
;
}
}
\ No newline at end of file
src/util/use-native-bridge.ts
View file @
65afed47
...
@@ -19,7 +19,7 @@ const isAndroid = () => {
...
@@ -19,7 +19,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_NATIVE_NAME
,
params
);
eventBus
.
emit
<
NativeInvokeFuncParams
>
(
GEEK_NATIVE_NAME
,
params
);
...
@@ -54,7 +54,7 @@ function useNativeBridge(
...
@@ -54,7 +54,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 @
65afed47
...
@@ -83,9 +83,10 @@
...
@@ -83,9 +83,10 @@
import
{
BonusListResponse
}
from
"@/model/bonus"
;
import
{
BonusListResponse
}
from
"@/model/bonus"
;
import
{
FlowType
,
BizType
}
from
"@/model/bonus/constant"
;
import
{
FlowType
,
BizType
}
from
"@/model/bonus/constant"
;
import
{
NavBar
,
Tab
,
Tabs
,
Cell
,
Empty
,
List
,
PullRefresh
}
from
"vant"
;
import
{
NavBar
,
Tab
,
Tabs
,
Cell
,
Empty
,
List
,
PullRefresh
}
from
"vant"
;
import
{
computed
,
defineComponent
,
reactive
,
toRefs
}
from
"vue"
;
import
{
computed
,
defineComponent
,
onMounted
,
reactive
,
toRefs
}
from
"vue"
;
import
{
bonusModel
}
from
"@/server/api"
;
import
{
bonusModel
}
from
"@/server/api"
;
import
{
useStore
}
from
"vuex"
;
import
{
useStore
}
from
"vuex"
;
import
{
useNativeBridge
}
from
"@/util/use-native-bridge"
;
interface
BonusList
{
interface
BonusList
{
addList
:
BonusListResponse
[];
addList
:
BonusListResponse
[];
...
@@ -117,6 +118,7 @@ const BonusDetail = defineComponent({
...
@@ -117,6 +118,7 @@ const BonusDetail = defineComponent({
addList
:
[],
addList
:
[],
reduceList
:
[]
reduceList
:
[]
});
});
const
[
sendNativeMessage
]
=
useNativeBridge
(
"test"
,
arg
=>
console
.
log
(
arg
));
const
onLoad
=
()
=>
{
const
onLoad
=
()
=>
{
if
(
state
.
refreshing
)
{
if
(
state
.
refreshing
)
{
if
(
state
.
active
===
FlowType
.
ADD
)
{
if
(
state
.
active
===
FlowType
.
ADD
)
{
...
@@ -167,6 +169,12 @@ const BonusDetail = defineComponent({
...
@@ -167,6 +169,12 @@ const BonusDetail = defineComponent({
onLoad
();
onLoad
();
}
}
};
};
onMounted
(()
=>
{
sendNativeMessage
({
type
:
"title"
,
data
:
"奖励金明细"
});
});
return
{
return
{
...
toRefs
(
state
),
...
toRefs
(
state
),
...
toRefs
(
bonusList
),
...
toRefs
(
bonusList
),
...
...
src/views/bonus/index.vue
View file @
65afed47
...
@@ -188,9 +188,6 @@ const Bonus = defineComponent({
...
@@ -188,9 +188,6 @@ const Bonus = defineComponent({
store
.
commit
(
"bonus/saveStudentId"
,
studentId
);
store
.
commit
(
"bonus/saveStudentId"
,
studentId
);
store
.
commit
(
"bonus/saveToken"
,
token
);
store
.
commit
(
"bonus/saveToken"
,
token
);
store
.
commit
(
"bonus/saveUserId"
,
userId
);
store
.
commit
(
"bonus/saveUserId"
,
userId
);
const
[
sendNativeMessage
]
=
useNativeBridge
(
"bindWeChatChange"
,
function
(
arg
)
{
Toast
(
'成功啦'
)
});
const
state
=
reactive
<
BonusState
>
({
const
state
=
reactive
<
BonusState
>
({
loading
:
false
,
loading
:
false
,
finished
:
false
,
finished
:
false
,
...
@@ -201,6 +198,9 @@ const Bonus = defineComponent({
...
@@ -201,6 +198,9 @@ const Bonus = defineComponent({
BonusAccountStatus
,
BonusAccountStatus
,
withdrawList
:
[]
withdrawList
:
[]
});
});
const
[
sendNativeMessage
]
=
useNativeBridge
(
"bindWeChatChange"
,
function
()
{
state
.
showBindWx
=
false
;
});
// 获取奖励金信息
// 获取奖励金信息
bonusModel
.
getBonusAccount
(
bonusStoreState
.
value
.
studentId
).
then
(
res
=>
{
bonusModel
.
getBonusAccount
(
bonusStoreState
.
value
.
studentId
).
then
(
res
=>
{
const
{
data
}
=
res
;
const
{
data
}
=
res
;
...
@@ -232,8 +232,7 @@ const Bonus = defineComponent({
...
@@ -232,8 +232,7 @@ const Bonus = defineComponent({
const
withdraw
=
()
=>
{
const
withdraw
=
()
=>
{
if
(
!
state
.
bonusAccount
?.
errCode
)
{
if
(
!
state
.
bonusAccount
?.
errCode
)
{
// 都正常的状态
// 都正常的状态
// router.push("withdraw");
router
.
push
(
"withdraw"
);
state
.
showBindWx
=
true
;
}
else
if
(
state
.
bonusAccount
?.
errCode
===
ErrCode
.
NOT_BIND
)
{
}
else
if
(
state
.
bonusAccount
?.
errCode
===
ErrCode
.
NOT_BIND
)
{
state
.
showBindWx
=
true
;
state
.
showBindWx
=
true
;
}
else
{
}
else
{
...
...
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