Commit 1b008b58 authored by hewenhao's avatar hewenhao

feat: 文案

parent 79b2e798
......@@ -26,7 +26,7 @@ export enum BonusAccountStatus {
FREEZE = "FREEZE" // 冻结
}
// 奖励金预提现错误状态
// 奖励金预提现错误状态
export enum ErrCode {
NOT_BIND = "NOT_BIND", // 未绑定微信
USER_FREEZE = "USER_FREEZE", // 用户冻结
......@@ -34,7 +34,7 @@ export enum ErrCode {
USER_UP_LIMIT = "USER_UP_LIMIT", // 用户上限
SYSTEM_UP_LIMIT = "SYSTEM_UP_LIMIT", // 系统上限
STUDENT_WITHDRAWING = "STUDENT_WITHDRAWING", // 学生提现中
BALANCE_NOT_ENOUGH = "BALANCE_NOT_ENOUGH", // 余额不足
BALANCE_NOT_ENOUGH = "BALANCE_NOT_ENOUGH" // 余额不足
}
// 提现记录状态
......@@ -43,4 +43,4 @@ export enum WithdrawStatus {
WITHDRAWING = "WITHDRAWING",
RECEIVED = "RECEIVED",
FAILED = "FAILED"
}
\ No newline at end of file
}
import axios, { AxiosRequestConfig } from "axios";
import Cookies from 'js-cookie';
import Cookies from "js-cookie";
import { unref } from "vue";
import router from "../router";
const instance = axios.create({
headers: {
'content-type': 'application/json;charset=UTF-8',
'Authorization': `Bearer ${Cookies.get('token')}`
"content-type": "application/json;charset=UTF-8",
Authorization: `Bearer ${Cookies.get("token")}`
},
baseURL: "",
timeout: 10000,
......
import { ErrCode } from "@/model/bonus/constant";
export function formatBonusTipTxt(errCode: string): string {
let tip = '';
switch (errCode) {
case ErrCode.NOT_BIND:
tip = '绑定微信后,才可进行提现!';
break;
case ErrCode.USER_FREEZE:
case ErrCode.ACCOUNT_FREEZE:
tip = '当前账号存在风险,无法进行提现操作!如需帮助请联系:400-8777389';
break;
case ErrCode.USER_UP_LIMIT:
case ErrCode.SYSTEM_UP_LIMIT:
tip = '今日已达到提现次数/提现金额上限,无法进行提现操作,请明日进行提现操作!如需帮助请联系:400-8777389';
break;
case ErrCode.STUDENT_WITHDRAWING:
tip = '您当前有一笔资金处于提现中,待该笔资金完成提现后,再进行提现操作!如需帮助请联系:400-8777389';
break;
case ErrCode.BALANCE_NOT_ENOUGH:
tip = '提现金额至少为:1.00元。今日可提现金额不足,烦请明日再来提现!如需帮助请联系:400-8777389';
break;
default:
tip = ''
}
return tip;
}
\ No newline at end of file
let tip = "";
switch (errCode) {
case ErrCode.NOT_BIND:
tip = "绑定微信后,才可进行提现!";
break;
case ErrCode.USER_FREEZE:
case ErrCode.ACCOUNT_FREEZE:
tip = "当前账号存在风险,无法进行提现操作!如需帮助请联系:400-8777389";
break;
case ErrCode.USER_UP_LIMIT:
case ErrCode.SYSTEM_UP_LIMIT:
tip =
"今日已达到提现次数/提现金额上限,无法进行提现操作,请明日进行提现操作!如需帮助请联系:400-8777389";
break;
case ErrCode.STUDENT_WITHDRAWING:
tip =
"您当前有一笔资金处于提现中,待该笔资金完成提现后,再进行提现操作!如需帮助请联系:400-8777389";
break;
case ErrCode.BALANCE_NOT_ENOUGH:
tip = "提现金额至少为:1.00元。当前可提现金额不足!如需帮助请联系:400-8777389!";
break;
default:
tip = "";
}
return tip;
}
/* eslint-disable @typescript-eslint/camelcase */
import { App } from "vue";
import mitt from "./mitt";
const isiOS = () => {
const u = navigator.userAgent;
const iOs = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
return iOs;
};
const isAndroid = () => {
const u = navigator.userAgent;
const android = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1;
return android;
};
const postMessage = data => {
if (isAndroid()) {
window.ReactNativeWebView &&
window.ReactNativeWebView.onMessage &&
window.ReactNativeWebView.onMessage(JSON.stringify(data));
}
window.ReactNativeWebView &&
window.ReactNativeWebView.postMessage &&
window.ReactNativeWebView.postMessage(JSON.stringify(data));
};
if (isiOS() || isAndroid()) {
// const debugLog = console.log
// eslint-disable-next-line func-names
// console.log = function (...args) {
// postMessage({
// type: 'log',
// data: args
// })
// debugLog(...args)
// }
}
function install(Vue: App) {
const GEEK_NATVIE_NAME = "GEEK_NATVIE_NAME";
// eslint-disable-next-line camelcase
const event_bus = mitt();
// eslint-disable-next-line func-names
window.$geek_excuteJS = function (args) {
try {
const params = JSON.parse(args);
event_bus.emit(GEEK_NATVIE_NAME, params);
} catch (error) {
event_bus.emit(GEEK_NATVIE_NAME, args);
}
};
Vue.mixin({
methods: {
listenNativeMessage(arg) {
const { method, data } = arg;
if (method) {
this[method] && this[method](data);
}
},
$nativeTitle(title) {
const message = {
type: "title",
data: title
};
postMessage(message);
},
$shareImg(base64Img, timeline = false) {
const message = {
type: timeline ? "shareTimeline" : "share",
data: {
type: "img",
img: base64Img
}
};
postMessage(message);
},
$shareText(txt, timeline = false) {
const message = {
type: timeline ? "shareTimeline" : "share",
data: {
type: "text",
description: txt
}
};
postMessage(message);
},
$shareNews({ title, url, description }, timeline = false) {
const message = {
type: timeline ? "shareTimeline" : "share",
data: {
type: "news",
description,
webpageUrl: url,
title
}
};
postMessage(message);
},
$playVieo(url) {
const message = {
type: "video",
data: {
url
}
};
postMessage(message);
},
$postMessage(message) {
postMessage(message);
},
$exitWebView(data) {
this.$postMessage({
type: "exitWebview",
data
});
},
$shareReport(params) {
this.$postMessage({
type: "reportShare",
params
});
}
},
created() {
event_bus.on(GEEK_NATVIE_NAME, this.listenNativeMessage);
},
beforeUnmount() {
event_bus.off(GEEK_NATVIE_NAME, this.listenNativeMessage);
}
});
}
export default install;
/* eslint-disable @typescript-eslint/camelcase */
import { App } from "vue";
import mitt from "./mitt";
const isiOS = () => {
const u = navigator.userAgent;
const iOs = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
return iOs;
};
const isAndroid = () => {
const u = navigator.userAgent;
const android = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1;
return android;
};
const postMessage = data => {
if (isAndroid()) {
window.ReactNativeWebView &&
window.ReactNativeWebView.onMessage &&
window.ReactNativeWebView.onMessage(JSON.stringify(data));
}
window.ReactNativeWebView &&
window.ReactNativeWebView.postMessage &&
window.ReactNativeWebView.postMessage(JSON.stringify(data));
};
if (isiOS() || isAndroid()) {
// const debugLog = console.log
// eslint-disable-next-line func-names
// console.log = function (...args) {
// postMessage({
// type: 'log',
// data: args
// })
// debugLog(...args)
// }
}
function install(Vue: App) {
const GEEK_NATVIE_NAME = "GEEK_NATVIE_NAME";
// eslint-disable-next-line camelcase
const event_bus = mitt();
// eslint-disable-next-line func-names
window.$geek_excuteJS = function(args) {
try {
const params = JSON.parse(args);
event_bus.emit(GEEK_NATVIE_NAME, params);
} catch (error) {
event_bus.emit(GEEK_NATVIE_NAME, args);
}
};
Vue.mixin({
methods: {
listenNativeMessage(arg) {
const { method, data } = arg;
if (method) {
this[method] && this[method](data);
}
},
$nativeTitle(title) {
const message = {
type: "title",
data: title
};
postMessage(message);
},
$shareImg(base64Img, timeline = false) {
const message = {
type: timeline ? "shareTimeline" : "share",
data: {
type: "img",
img: base64Img
}
};
postMessage(message);
},
$shareText(txt, timeline = false) {
const message = {
type: timeline ? "shareTimeline" : "share",
data: {
type: "text",
description: txt
}
};
postMessage(message);
},
$shareNews({ title, url, description }, timeline = false) {
const message = {
type: timeline ? "shareTimeline" : "share",
data: {
type: "news",
description,
webpageUrl: url,
title
}
};
postMessage(message);
},
$playVieo(url) {
const message = {
type: "video",
data: {
url
}
};
postMessage(message);
},
$postMessage(message) {
postMessage(message);
},
$exitWebView(data) {
this.$postMessage({
type: "exitWebview",
data
});
},
$shareReport(params) {
this.$postMessage({
type: "reportShare",
params
});
}
},
created() {
event_bus.on(GEEK_NATVIE_NAME, this.listenNativeMessage);
},
beforeUnmount() {
event_bus.off(GEEK_NATVIE_NAME, this.listenNativeMessage);
}
});
}
export default install;
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