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
d4a945f7
Commit
d4a945f7
authored
Apr 21, 2021
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化导入
parent
a12146df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
8 deletions
+3
-8
use-native-bridge.ts
src/util/use-native-bridge.ts
+1
-2
index.vue
src/views/bonus/bonus-detail/index.vue
+1
-2
index.vue
src/views/bonus/withdraw/index.vue
+1
-4
No files found.
src/util/use-native-bridge.ts
View file @
d4a945f7
...
...
@@ -24,12 +24,11 @@ window.$geek_excuteJS = function (args) {
const
params
=
JSON
.
parse
(
args
);
eventBus
.
emit
<
NativeInvokeFuncParams
>
(
GEEK_NATIVE_NAME
,
params
);
}
catch
(
error
)
{
eventBus
.
emit
<
NativeInvokeFuncParams
>
(
GEEK_NATIVE_NAME
,
args
);
}
};
const
sendNativeMessage
=
(
data
:
{
type
:
string
;
data
?:
any
;
__callback__
?:
string
})
=>
{
export
const
sendNativeMessage
=
(
data
:
{
type
:
string
;
data
?:
any
;
__callback__
?:
string
})
=>
{
if
(
isAndroid
())
{
window
.
ReactNativeWebView
&&
window
.
ReactNativeWebView
.
onMessage
&&
...
...
src/views/bonus/bonus-detail/index.vue
View file @
d4a945f7
...
...
@@ -94,7 +94,7 @@ import { NavBar, Tab, Tabs, Cell, Empty, List, PullRefresh } from "vant";
import
{
computed
,
defineComponent
,
onMounted
,
reactive
,
toRefs
}
from
"vue"
;
import
{
getBonusList
}
from
"@/server/api/bonus"
;
import
{
useStore
}
from
"vuex"
;
import
{
useNativeBrid
ge
}
from
"@/util/use-native-bridge"
;
import
{
sendNativeMessa
ge
}
from
"@/util/use-native-bridge"
;
import
{
useRoute
}
from
"vue-router"
;
interface
BonusList
{
...
...
@@ -127,7 +127,6 @@ const BonusDetail = defineComponent({
addList
:
[],
reduceList
:
[]
});
const
[
sendNativeMessage
]
=
useNativeBridge
(
"test"
,
arg
=>
console
.
log
(
arg
));
const
onLoad
=
async
()
=>
{
state
.
loading
=
true
;
if
(
state
.
refreshing
)
{
...
...
src/views/bonus/withdraw/index.vue
View file @
d4a945f7
...
...
@@ -133,7 +133,7 @@ import { computed, defineComponent, onMounted, reactive, toRefs } from "vue";
import
{
Button
,
Cell
,
Dialog
,
Field
,
Toast
}
from
"vant"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
useStore
}
from
"vuex"
;
import
{
useNativeBrid
ge
}
from
"@/util/use-native-bridge"
;
import
{
sendNativeMessa
ge
}
from
"@/util/use-native-bridge"
;
import
{
countDown
}
from
"@/util/timer"
;
import
{
checkCaptcha
,
withdraw
,
getWithdrawRisk
}
from
"@/server/api/bonus"
;
import
{
WithdrawResponse
}
from
"@/model/bonus"
;
...
...
@@ -161,9 +161,6 @@ const Withdraw = defineComponent({
[
Dialog
.
Component
.
name
]:
Dialog
.
Component
},
setup
()
{
const
[
sendNativeMessage
]
=
useNativeBridge
(
"title"
,
function
(
arg
)
{
console
.
log
(
this
,
arg
);
});
const
route
=
useRoute
();
const
store
=
useStore
();
const
bonusStoreState
=
computed
(()
=>
store
.
state
.
bonus
);
...
...
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