Commit 1b008b58 authored by hewenhao's avatar hewenhao

feat: 文案

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