Commit 65afed47 authored by hewenhao's avatar hewenhao

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
...@@ -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
...@@ -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") {
......
...@@ -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),
......
...@@ -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 {
......
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