Commit d4a945f7 authored by hewenhao's avatar hewenhao

feat: 优化导入

parent a12146df
...@@ -24,12 +24,11 @@ window.$geek_excuteJS = function (args) { ...@@ -24,12 +24,11 @@ window.$geek_excuteJS = function (args) {
const params = JSON.parse(args); const params = JSON.parse(args);
eventBus.emit<NativeInvokeFuncParams>(GEEK_NATIVE_NAME, params); eventBus.emit<NativeInvokeFuncParams>(GEEK_NATIVE_NAME, params);
} catch (error) { } catch (error) {
eventBus.emit<NativeInvokeFuncParams>(GEEK_NATIVE_NAME, args); 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()) { if (isAndroid()) {
window.ReactNativeWebView && window.ReactNativeWebView &&
window.ReactNativeWebView.onMessage && window.ReactNativeWebView.onMessage &&
......
...@@ -94,7 +94,7 @@ import { NavBar, Tab, Tabs, Cell, Empty, List, PullRefresh } from "vant"; ...@@ -94,7 +94,7 @@ import { NavBar, Tab, Tabs, Cell, Empty, List, PullRefresh } from "vant";
import { computed, defineComponent, onMounted, reactive, toRefs } from "vue"; import { computed, defineComponent, onMounted, reactive, toRefs } from "vue";
import { getBonusList } from "@/server/api/bonus"; import { getBonusList } from "@/server/api/bonus";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { useNativeBridge } from "@/util/use-native-bridge"; import { sendNativeMessage } from "@/util/use-native-bridge";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
interface BonusList { interface BonusList {
...@@ -127,7 +127,6 @@ const BonusDetail = defineComponent({ ...@@ -127,7 +127,6 @@ const BonusDetail = defineComponent({
addList: [], addList: [],
reduceList: [] reduceList: []
}); });
const [sendNativeMessage] = useNativeBridge("test", arg => console.log(arg));
const onLoad = async () => { const onLoad = async () => {
state.loading = true; state.loading = true;
if (state.refreshing) { if (state.refreshing) {
......
...@@ -133,7 +133,7 @@ import { computed, defineComponent, onMounted, reactive, toRefs } from "vue"; ...@@ -133,7 +133,7 @@ import { computed, defineComponent, onMounted, reactive, toRefs } from "vue";
import { Button, Cell, Dialog, Field, Toast } from "vant"; import { Button, Cell, Dialog, Field, Toast } from "vant";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { useNativeBridge } from "@/util/use-native-bridge"; import { sendNativeMessage } from "@/util/use-native-bridge";
import { countDown } from "@/util/timer"; import { countDown } from "@/util/timer";
import { checkCaptcha, withdraw, getWithdrawRisk } from "@/server/api/bonus"; import { checkCaptcha, withdraw, getWithdrawRisk } from "@/server/api/bonus";
import { WithdrawResponse } from "@/model/bonus"; import { WithdrawResponse } from "@/model/bonus";
...@@ -161,9 +161,6 @@ const Withdraw = defineComponent({ ...@@ -161,9 +161,6 @@ const Withdraw = defineComponent({
[Dialog.Component.name]: Dialog.Component [Dialog.Component.name]: Dialog.Component
}, },
setup() { setup() {
const [sendNativeMessage] = useNativeBridge("title", function(arg) {
console.log(this, arg);
});
const route = useRoute(); const route = useRoute();
const store = useStore(); const store = useStore();
const bonusStoreState = computed(() => store.state.bonus); const bonusStoreState = computed(() => store.state.bonus);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment