@ -0,0 +1,44 @@ |
|||
# ---> Vue |
|||
# gitignore template for Vue.js projects |
|||
# |
|||
# Recommended template: Node.gitignore |
|||
|
|||
# TODO: where does this rule come from? |
|||
docs/_book |
|||
|
|||
# TODO: where does this rule come from? |
|||
test/ |
|||
|
|||
# ---> macOS |
|||
# General |
|||
.DS_Store |
|||
.AppleDouble |
|||
.LSOverride |
|||
|
|||
# Icon must end with two \r |
|||
Icon |
|||
|
|||
# Thumbnails |
|||
._* |
|||
|
|||
# Files that might appear in the root of a volume |
|||
.DocumentRevisions-V100 |
|||
.fseventsd |
|||
.Spotlight-V100 |
|||
.TemporaryItems |
|||
.Trashes |
|||
.VolumeIcon.icns |
|||
.com.apple.timemachine.donotpresent |
|||
|
|||
# Directories potentially created on remote AFP share |
|||
.AppleDB |
|||
.AppleDesktop |
|||
Network Trash Folder |
|||
Temporary Items |
|||
.apdisk |
|||
|
|||
node_modules/ |
|||
unpackage |
|||
|
|||
.idea/ |
|||
.hbuilderx/ |
|||
@ -0,0 +1,159 @@ |
|||
<script> |
|||
import Member from "@/api/member"; |
|||
import { mapActions } from "vuex"; |
|||
import app from "@/app.js" |
|||
export default { |
|||
onLaunch: function () { |
|||
setInterval(() => { |
|||
this.$navFontColor(); |
|||
}, 1000); |
|||
this.mobileLogo(); |
|||
// this.update() |
|||
}, |
|||
methods: { |
|||
...mapActions({ |
|||
setLogoMap: "logoMap", |
|||
}), |
|||
mobileLogo() { |
|||
Member.mobileLogo().then((res) => { |
|||
let data = res.data; |
|||
this.setLogoMap({ |
|||
home_logo: data.home_logo, |
|||
login_logo: data.login_logo, |
|||
title_logo: data.title_logo, |
|||
share_logo: data.share_logo, |
|||
name: data.name, |
|||
}); |
|||
}); |
|||
}, |
|||
// update(){ |
|||
// var baseUrl=app.baseUrl + '/api/app/getNewestVersion' |
|||
// console.log(baseUrl) |
|||
// var _this = this; |
|||
// uni.request({ |
|||
// url: baseUrl, //请求接口 |
|||
// method: 'GET', |
|||
// success: result => { |
|||
// console.log(result) |
|||
// if (result.data.code == 200) { |
|||
// plus.runtime.getProperty(plus.runtime.appid, function(inf) { |
|||
// console.log(inf) |
|||
// if(inf.version != result.data.data.versions){ |
|||
// uni.showModal({ |
|||
// title: "发现新版本", |
|||
// content: "确认下载更新", |
|||
// success: (res) => { |
|||
// if (res.confirm == true) {//当用户确定更新,执行更新 |
|||
// _this.doUpData(); |
|||
// } |
|||
// } |
|||
// }) |
|||
// } |
|||
// }); |
|||
// } |
|||
// }, |
|||
// }) |
|||
// }, |
|||
|
|||
// doUpData() { |
|||
// uni.showLoading({ |
|||
// title: '更新中……' |
|||
// }) |
|||
// uni.downloadFile({//执行下载 |
|||
// url: 'https://www.AMATAKex.net/download/android/AMATAK.apk', //下载地址 |
|||
// success: downloadResult => {//下载成功 |
|||
// uni.hideLoading(); |
|||
// if (downloadResult.statusCode == 200) { |
|||
// uni.showModal({ |
|||
// title: '', |
|||
// content: '更新成功,确定现在重启吗?', |
|||
// confirmText: '重启', |
|||
// confirmColor: '#EE8F57', |
|||
// success: function(res) { |
|||
// if (res.confirm == true) { |
|||
// plus.runtime.install(//安装 |
|||
// downloadResult.tempFilePath, { |
|||
// force: true |
|||
// }, |
|||
// function(res) { |
|||
// utils.showToast('更新成功,重启中'); |
|||
// plus.runtime.restart(); |
|||
// } |
|||
// ); |
|||
// } |
|||
// } |
|||
// }); |
|||
// } |
|||
// } |
|||
// }); |
|||
// } |
|||
}, |
|||
// onLaunch: function() { |
|||
// console.log('App Launch'); |
|||
// 检测升级 |
|||
// #ifdef APP-PLUS |
|||
// var baseUrl=app.baseUrl + '/api/app/getNewestVersion' |
|||
// uni.request({ |
|||
// url: baseUrl, //检查更新的服务器地址 |
|||
// method: 'GET', |
|||
// // data: { |
|||
// // appid: plus.runtime.appid, |
|||
// // version: plus.runtime.version, |
|||
// // imei: plus.device.imei |
|||
// // }, |
|||
// success: (res) => { |
|||
// console.log(res) |
|||
// if (res.data.code == 200) { |
|||
// console.log(res.data.data.android.url) |
|||
// var openUrl = plus.os.name === 'iOS' ? res.data.data.ios.url : res.data.data.android.url; |
|||
// // 提醒用户更新 |
|||
// uni.showModal({ |
|||
// title: '更新提示', |
|||
// content: '是否选择更新', |
|||
// success: (showResult) => { |
|||
// if (showResult.confirm) { |
|||
// plus.runtime.openURL(openUrl); |
|||
// } |
|||
// } |
|||
// }) |
|||
// } |
|||
// } |
|||
// }) |
|||
// #endif |
|||
// }, |
|||
onLaunch() { |
|||
|
|||
}, |
|||
onShow: function () { |
|||
uni.$emit("appShow"); |
|||
this.$navFontColor(); |
|||
}, |
|||
onHide: function () {}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.layout-page { |
|||
height: 100vh; |
|||
font-size: 14px; |
|||
background: $panel-1; |
|||
color: $text-color; |
|||
} |
|||
|
|||
/* #ifdef H5 */ |
|||
.layout-page { |
|||
height: 100%!important; |
|||
} |
|||
uni-page-body{ |
|||
height: 100%; |
|||
} |
|||
/* #endif */ |
|||
@import "./assets/scss/app.scss"; |
|||
/* 解决头条小程序组件内引入字体不生效的问题 */ |
|||
/* #ifdef MP-TOUTIAO */ |
|||
@font-face { |
|||
font-family: uniicons; |
|||
src: url("/static/uni.ttf"); |
|||
} |
|||
/* #endif */ |
|||
</style> |
|||
@ -0,0 +1 @@ |
|||
初始化 |
|||
@ -0,0 +1,177 @@ |
|||
class Socket { |
|||
constructor(link) { |
|||
// 初始化socket
|
|||
if (link.constructor === WebSocket) { |
|||
this.socket = link; |
|||
} else { |
|||
this.socket = new WebSocket(link); |
|||
} |
|||
|
|||
// this.socket.binaryType = 'arraybuffer';
|
|||
|
|||
this.doOpen(); |
|||
|
|||
// 连接状态的标识符
|
|||
this.readyState = this.socket.readyState; |
|||
|
|||
// 订阅/发布模型
|
|||
this._events = { |
|||
// 订阅的事件 : 发布的方法
|
|||
|
|||
}; |
|||
|
|||
// 定时验证的标识符
|
|||
this.heartBeatTimer = null; |
|||
|
|||
} |
|||
|
|||
// 执行socket并发布事件
|
|||
doOpen() { |
|||
|
|||
this.afterOpenEmit = []; |
|||
|
|||
// 执行socket连接 并初始化验证请求
|
|||
this.socket.addEventListener("open", evt => this.onOpen(evt)); |
|||
|
|||
// 接收socket数据
|
|||
this.socket.addEventListener("message", evt => this.onMessage(evt)); |
|||
|
|||
// 关闭socket连接
|
|||
this.socket.addEventListener("close", evt => this.onClose(evt)); |
|||
|
|||
// 请求发生错误
|
|||
this.socket.addEventListener("error", err => this.onError(err)); |
|||
|
|||
} |
|||
|
|||
// 发布后通知订阅者
|
|||
Notify(entry) { |
|||
// 检查是否有订阅者 返回队列
|
|||
const cbQueue = this._events[entry.Event]; |
|||
if (cbQueue && cbQueue.length) { |
|||
for (let callback of cbQueue) { |
|||
if (callback instanceof Function) callback(entry.Data); |
|||
} |
|||
} |
|||
} |
|||
|
|||
// 请求数据的方法
|
|||
onOpen(evt) { |
|||
|
|||
// 每隔20s检查连接
|
|||
// this.heartBeatTimer = setInterval(() => this.send({
|
|||
// 'cmd': 'ping',
|
|||
// 'args': ''
|
|||
// }), 20000);
|
|||
|
|||
// 通知订阅
|
|||
this.Notify({Event: 'open', Data : evt}); |
|||
} |
|||
|
|||
/** |
|||
* 订阅所有的数据 |
|||
* @param {array|object} datas 订阅参数集合 |
|||
*/ |
|||
send(datas) { |
|||
if (datas.constructor != Array) { |
|||
datas = [datas]; |
|||
} |
|||
|
|||
for (let item of datas) { |
|||
this.socket.send(JSON.stringify(item)); |
|||
} |
|||
} |
|||
|
|||
|
|||
onMessage(evt) { |
|||
|
|||
try { |
|||
|
|||
// 解析推送的数据
|
|||
const data = JSON.parse(evt.data); |
|||
|
|||
// 通知订阅者
|
|||
this.Notify({ |
|||
Event: 'message', |
|||
Data: data |
|||
}); |
|||
|
|||
} catch (err) { |
|||
console.error(' >> Data parsing error:', err); |
|||
|
|||
// 通知订阅者
|
|||
this.Notify({ |
|||
Event: 'error', |
|||
Data: err |
|||
}); |
|||
} |
|||
} |
|||
|
|||
// 添加事件监听
|
|||
on(name, handler) { |
|||
this.subscribe(name, handler); |
|||
} |
|||
|
|||
// 取消订阅事件
|
|||
off(name, handler) { |
|||
this.unsubscribe(name, handler); |
|||
} |
|||
|
|||
// 订阅事件的方法
|
|||
subscribe(name, handler) { |
|||
if (this._events[name]) { |
|||
this._events[name].push(handler); // 追加事件
|
|||
} else { |
|||
this._events[name] = [handler]; // 添加事件
|
|||
} |
|||
} |
|||
|
|||
// 取消订阅事件
|
|||
unsubscribe(name, handler) { |
|||
|
|||
let start = this._events[name].findIndex(item => item === handler); |
|||
|
|||
// 删除该事件
|
|||
this._events[name].splice(start, 1); |
|||
|
|||
} |
|||
|
|||
checkOpen() { |
|||
return this.readyState >= 2; |
|||
} |
|||
|
|||
onClose(evt) { |
|||
this.Notify({Event: 'close', Data : evt}); |
|||
} |
|||
|
|||
|
|||
onError(err) { |
|||
this.Notify({Event: 'error', Data : err}); |
|||
} |
|||
|
|||
emit(data) { |
|||
return new Promise((resolve) => { |
|||
this.send(JSON.stringify(data)); |
|||
this.on('message', function (data) { |
|||
resolve(data); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
doClose() { |
|||
this.socket.close(); |
|||
} |
|||
|
|||
destroy() { |
|||
if (this.heartBeatTimer) { |
|||
clearInterval(this.heartBeatTimer); |
|||
this.heartBeatTimer = null; |
|||
} |
|||
this.doClose(); |
|||
this._events = {}; |
|||
this.readyState = 0; |
|||
this.socket = null; |
|||
} |
|||
} |
|||
|
|||
export default Socket |
|||
@ -0,0 +1,251 @@ |
|||
import {$get,$post,$postFile} from '@/api' |
|||
|
|||
|
|||
class Assets { |
|||
/** |
|||
* 数字货币提现 |
|||
* @param {Object} data |
|||
*/ |
|||
static cryptocurrenciesWithdrawal(data) { |
|||
|
|||
return $post(`/withdraw/cryptocurrenciesWithdrawal`, data); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* assets页面 |
|||
* @param {Object} data |
|||
*/ |
|||
static assets(data) { |
|||
|
|||
return $post(`/userCoin/assets`, data); |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* assets页面 |
|||
* @param {Object} data |
|||
*/ |
|||
static getAllList(data) { |
|||
|
|||
return $get(`coin/getAllList`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 币币用户历史委托 |
|||
* @param {Object} data |
|||
*/ |
|||
static history(data) { |
|||
|
|||
return $post(`/coin/orders/history`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 资金划转记录 |
|||
* @param {Object} data |
|||
*/ |
|||
static fundsTransferRecordPageList(data) { |
|||
|
|||
return $post(`/fundsTransferRecord/pageList`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 资金划转 |
|||
* @param {Object} data |
|||
*/ |
|||
static transfer(data) { |
|||
|
|||
return $post(`/userCoin/transfer`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 数字货币充值 |
|||
* @param {int} params |
|||
*/ |
|||
static cryptocurrenciesRecharge(coinId) { |
|||
|
|||
return $get(`/recharge/cryptocurrenciesRecharge/${coinId}`); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 数字货币充值记录 |
|||
* @param {Object} data |
|||
*/ |
|||
static cryptocurrenciesRechargeRecords(data) { |
|||
|
|||
return $post(`/recharge/cryptocurrenciesRechargeRecords`, data); |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* 用户数字货币提现记录 |
|||
* @param {Object} data |
|||
*/ |
|||
static cryptocurrenciesWithdrawRecords(data) { |
|||
|
|||
return $post(`/withdraw/cryptocurrenciesWithdrawRecords`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 删除提现地址 |
|||
* @param {Object} data |
|||
*/ |
|||
static deleteById(data) { |
|||
|
|||
return $post(`/withdrawAddress/deleteById`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 编辑提现地址 |
|||
* @param {Object} data |
|||
*/ |
|||
static editById(data) { |
|||
|
|||
return $post(`/withdrawAddress/editById`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 移除添加地址 |
|||
* @param {Object} data |
|||
*/ |
|||
static addRemove(data) { |
|||
|
|||
return $post(`/withdrawAddress/addOrRemoveWhiteList`, data); |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* 提现地址分页列表 |
|||
* @param {Object} data |
|||
*/ |
|||
static pageList(data) { |
|||
|
|||
return $post(`/withdrawAddress/pageList`, data); |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加提现地址 |
|||
* @param {Object} data |
|||
*/ |
|||
static save(data) { |
|||
|
|||
return $post(`/withdrawAddress/save`, data); |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* 费率列表(手续费) |
|||
* @param {Object} data |
|||
*/ |
|||
static getList(data) { |
|||
|
|||
return $get(`/transferFee/getList`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 用户合约资金 |
|||
* @param {Object} data |
|||
*/ |
|||
static contractsAccount(data) { |
|||
|
|||
return $get(`/futuresUserCoin/contractsAccount`, data); |
|||
|
|||
} |
|||
/** |
|||
* 用户合约资金(详情) |
|||
* @param {number} accountId |
|||
*/ |
|||
static contractsAccountDetail(accountId) { |
|||
|
|||
return $get(`/futuresUserCoin/contractsAccountDetail/${accountId}`); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 用户资金历史记录 |
|||
* @param {Object} data |
|||
*/ |
|||
static transactionHistory(data) { |
|||
|
|||
return $post(`/futuresUserCoin/transactionHistory`, data); |
|||
|
|||
} |
|||
/** |
|||
* 确认是否白名单地址 |
|||
* @param {Object} data |
|||
*/ |
|||
static checkIsWhiteList(data) { |
|||
|
|||
return $post(`/withdrawAddress/checkIsWhiteList`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 用户已实现盈亏列表 |
|||
* @param {Object} data |
|||
*/ |
|||
static realisedPnlLog(data) { |
|||
|
|||
return $post(`/realisedPnlLog/list`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 定期宝列表 |
|||
* @param {Object} data |
|||
*/ |
|||
static financeList(data) { |
|||
|
|||
return $post(`/finance/list`, data); |
|||
|
|||
} |
|||
/** |
|||
* 理财订单列表 |
|||
* @param {Object} data |
|||
*/ |
|||
static financeOrderList(data) { |
|||
|
|||
return $post(`/finance/order/list`, data); |
|||
|
|||
} |
|||
/** |
|||
* 定期宝列表 |
|||
* @param {Object} data |
|||
*/ |
|||
static financeApply(data) { |
|||
|
|||
return $post(`/finance/apply`, data); |
|||
|
|||
} |
|||
/** |
|||
* 定期理财账户资产 |
|||
* @param {Object} data |
|||
*/ |
|||
static financeAccount(data) { |
|||
|
|||
return $post(`/finance/account`, data); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
export default Assets; |
|||
@ -0,0 +1,104 @@ |
|||
/** |
|||
* @description 返回数据时提示的消息 |
|||
* @param {String} msg 返回的消息 |
|||
* @param {Object} data 返回的数据 |
|||
* @returns { { msg,data } } |
|||
*/ |
|||
function msg(msg = '请传递消息', data = null) { |
|||
return { msg, data }; |
|||
} |
|||
let map = new Map(), |
|||
storage = uni.getStorageInfoSync(); //所有数据缓存
|
|||
/** |
|||
* @description 缓存类 |
|||
* @class 缓存类class |
|||
*/ |
|||
class Cache { |
|||
/** |
|||
* @constructor |
|||
* @param {Number} [timeout=86400] 缓存时间默认86400秒等于一天,传0为永久存储 |
|||
*/ |
|||
constructor(timeout = 86400) { |
|||
// 把本地缓存数据存入map中
|
|||
storage.keys.forEach((key) => map.set(key, uni.getStorageSync(key))); |
|||
this.map = map; //map数据
|
|||
this.timeout = timeout; |
|||
} |
|||
/** |
|||
* @description 设置缓存数据 |
|||
* @param {String} key 存储的key |
|||
* @param {Object} data 存储的data数据 |
|||
* @param {String} [timeout] 缓存时间,传0为永久存储 |
|||
* @returns { {msg,data} } |
|||
*/ |
|||
set(key, data, timeout = this.timeout) { |
|||
//data = 数据value值,超时时间,加入缓存时间
|
|||
Object.assign(data, { createTime: Date.now(), timeout }); |
|||
uni.setStorageSync(key, data); //保存到本地缓存
|
|||
this.map.set(key, data); //保存到map
|
|||
return msg('保存成功', data); |
|||
} |
|||
/** |
|||
* @description 获取缓存数据 |
|||
* @param {String} key 存储的key |
|||
* @returns { {msg,data | data:null} } |
|||
*/ |
|||
get(key) { |
|||
let value = this.map.get(key); //取值
|
|||
if (!value) return msg('没有key值'); //如果没有值,那就就返回空
|
|||
// 数据,超时时间,加入缓存时间 现在时间 时间差(秒)
|
|||
let { timeout, createTime, ...data } = value, |
|||
presentTime = Date.now(), |
|||
tdoa = (presentTime - createTime) / 1000; |
|||
// 超出缓存时间,那么就清除缓存返回空
|
|||
if (timeout != 0 && tdoa > timeout) { |
|||
uni.removeStorageSync(key); |
|||
this.map.delete(key); //删除map中对应的key值
|
|||
return msg('数据过期'); |
|||
} else { |
|||
return msg('ok', data); |
|||
} |
|||
} |
|||
/** |
|||
* @description 清除某个缓存数据 |
|||
* @param {String} key 存储的key |
|||
* @returns { {msg,data:null} } |
|||
*/ |
|||
remove(key) { |
|||
uni.removeStorageSync(key); //删除缓存的数据
|
|||
this.map.delete(key); //删除map中对应的key值
|
|||
return msg('删除成功'); |
|||
} |
|||
/** |
|||
* @description 清除整个缓存数据 |
|||
* @returns { {msg,data:null} } |
|||
*/ |
|||
clear() { |
|||
uni.clearStorageSync(); //清空缓存的数据
|
|||
this.map.clear(); //清空map
|
|||
return msg('清空成功'); |
|||
} |
|||
/** |
|||
* @description 获取缓存数据大小 |
|||
* @param { function } cb - 缓存大小 |
|||
*/ |
|||
getSize(cb) { |
|||
plus.cache.calculate((size) => { |
|||
let sizeCache = parseInt(size); |
|||
let cacheSize; |
|||
if (sizeCache == 0) { |
|||
cacheSize = '0B'; |
|||
} else if (sizeCache < 1024) { |
|||
cacheSize = sizeCache + 'B'; |
|||
} else if (sizeCache < 1048576) { |
|||
cacheSize = (sizeCache / 1024).toFixed(2) + 'KB'; |
|||
} else if (sizeCache < 1073741824) { |
|||
cacheSize = (sizeCache / 1048576).toFixed(2) + 'MB'; |
|||
} else { |
|||
cacheSize = (sizeCache / 1073741824).toFixed(2) + 'GB'; |
|||
} |
|||
cb(cacheSize); |
|||
}); |
|||
} |
|||
} |
|||
export default new Cache(); |
|||
@ -0,0 +1,25 @@ |
|||
import Serve from '@/api/serve' |
|||
|
|||
class College { |
|||
static college(data) { |
|||
return Serve.get(`/college`,data); |
|||
} |
|||
|
|||
static getArticleList(data) { |
|||
return Serve.get(`/articleList`,data); |
|||
} |
|||
|
|||
static getCategoryList() { |
|||
return Serve.get(`/categoryList`); |
|||
} |
|||
|
|||
static getArticleDetail(data) { |
|||
return Serve.get(`/article/detail`,data); |
|||
} |
|||
|
|||
static getRecommend() { |
|||
return Serve.get(`/recommend`); |
|||
} |
|||
} |
|||
|
|||
export default College; |
|||
@ -0,0 +1,110 @@ |
|||
import Serve from '@/api/serve' |
|||
|
|||
class Contract { |
|||
/** |
|||
* 合约初始化面板数据 |
|||
* @param {Object} data |
|||
*/ |
|||
static getMarketInfo(data) { |
|||
return Serve.get(`/contract/getMarketInfo`, data); |
|||
} |
|||
|
|||
/** |
|||
* 获取合约市场 |
|||
*/ |
|||
static getMarketList(data) { |
|||
return Serve.get('/contract/getMarketList', data) |
|||
} |
|||
|
|||
/** |
|||
* 获取合约账户信息 |
|||
*/ |
|||
static contractAccount(data, config) { |
|||
return Serve.get('/contract/contractAccount', data, config) |
|||
} |
|||
|
|||
/** |
|||
* 获取合约详情 |
|||
*/ |
|||
static getSymbolDetail(data) { |
|||
return Serve.get('/contract/getSymbolDetail', data) |
|||
} |
|||
/** |
|||
* 可开张数(合约上限) |
|||
* */ |
|||
static openNum(data,config) { |
|||
return Serve.get('/contract/openNum', data,config) |
|||
} |
|||
/** |
|||
* 合约开仓 |
|||
*/ |
|||
static openPosition(data, config) { |
|||
return Serve.post('/contract/openPosition', data, config) |
|||
} |
|||
|
|||
// 获取合约持仓
|
|||
static holdPosition(data, config) { |
|||
return Serve.get('/contract/holdPosition', data, config) |
|||
} |
|||
// 合约平仓
|
|||
static closePosition(data, config) { |
|||
return Serve.post('/contract/closePosition', data, config) |
|||
} |
|||
// 一键全平
|
|||
static closeAllPosition(data, config) { |
|||
return Serve.post('/contract/closeAllPosition', data, config) |
|||
} |
|||
// 获取当前合约委托
|
|||
static getCurrentEntrust(data, config) { |
|||
return Serve.get('/contract/getCurrentEntrust', data, config) |
|||
} |
|||
// 撤单
|
|||
static cancelEntrust(data, config) { |
|||
return Serve.post('/contract/cancelEntrust', data, config) |
|||
} |
|||
// 历史委托
|
|||
static getHistoryEntrust(data, config) { |
|||
return Serve.get('/contract/getHistoryEntrust', data, config) |
|||
} |
|||
// 获取k线数据
|
|||
static getKline(data, config) { |
|||
return Serve.get('/contract/getKline', data, config) |
|||
} |
|||
// 获取委托明细
|
|||
static getEntrustDealList(data, config) { |
|||
return Serve.get('/contract/getEntrustDealList', data, config) |
|||
} |
|||
// 获取开通状态
|
|||
static openStatus() { |
|||
return Serve.get('/contract/openStatus') |
|||
} |
|||
// 开通永续合约
|
|||
static opening() { |
|||
return Serve.post('/contract/opening') |
|||
} |
|||
static setStrategy(data, config) { |
|||
return Serve.post('/contract/setStrategy', data, config) |
|||
} |
|||
// 委托盈亏分享
|
|||
static entrustShare(data) { |
|||
return Serve.get('/contract/entrustShare', data, { loading: true }) |
|||
} |
|||
// 持仓盈亏分享
|
|||
static positionShare(data) { |
|||
return Serve.get('/contract/positionShare', data, { loading: true }) |
|||
} |
|||
// 一键全平
|
|||
static onekeyAllFlat(data) { |
|||
return Serve.post('/contract/onekeyAllFlat', data, { loading: true }) |
|||
} |
|||
// 一键反向
|
|||
static onekeyReverse(data) { |
|||
return Serve.post('/contract/onekeyReverse', data, { loading: true }) |
|||
} |
|||
// 合约说明
|
|||
static instruction() { |
|||
return Serve.get('/contract/instruction') |
|||
} |
|||
} |
|||
|
|||
export default Contract; |
|||
@ -0,0 +1,42 @@ |
|||
import Serve from '@/api/serve' |
|||
|
|||
class Currency { |
|||
// 获取平台收款方式列表
|
|||
static legalPayList() { |
|||
return Serve.post(`/collection/legalPayList`); |
|||
} |
|||
//用户收款地址列表
|
|||
static paymentsList() { |
|||
return Serve.post(`/user/paymentsList`); |
|||
} |
|||
//法币交易创建订单
|
|||
static legalCurrency(data) { |
|||
return Serve.post(`/user/legalCurrency`,data); |
|||
} |
|||
//法币交易订单列表
|
|||
static legalList(data) { |
|||
return Serve.post(`/user/legalList`,data); |
|||
} |
|||
//法币交易订单详情
|
|||
static legalInfo(data) { |
|||
return Serve.post(`/user/legalInfo`,data); |
|||
} |
|||
//用户收款地址编辑
|
|||
static paymentsSubmit(data) { |
|||
return Serve.post(`/user/paymentsSubmit`,data); |
|||
} |
|||
//订单确认支付/收款/取消
|
|||
static legalPay(data) { |
|||
return Serve.post(`/user/legalPay`,data); |
|||
} |
|||
//用户收款方式详情
|
|||
static paymentsInfo(data) { |
|||
return Serve.post(`/user/paymentsInfo`,data); |
|||
} |
|||
//用户收款方式开启关闭
|
|||
static paymentsStatus(data) { |
|||
return Serve.post(`/user/paymentsStatus`,data); |
|||
} |
|||
} |
|||
|
|||
export default Currency; |
|||
@ -0,0 +1,41 @@ |
|||
import Serve from '@/api/serve' |
|||
|
|||
class Exchange { |
|||
|
|||
// 获取账户余额
|
|||
static getUserBalance(data) { |
|||
return Serve.get(`/exchange/getUserCoinBalance`,data); |
|||
} |
|||
|
|||
/** |
|||
* 提交订单 |
|||
* @param {object} data |
|||
* @param {string} data.direction buy sell |
|||
* @param {string} data.type 1限价2市价 |
|||
* @param {string} data.symbol 交易对 |
|||
* @param {number} data.entrust_price 限价单价 |
|||
* @param {number} data.amount 限价数量 |
|||
* @param {number} data.trigger_price 条件单单价 |
|||
* @param {number} data.total 市价单总价 |
|||
* |
|||
*/ |
|||
static storeEntrust(data,config) { |
|||
return Serve.post(`/exchange/storeEntrust`, data,config); |
|||
} |
|||
|
|||
// 获取币种基本信息
|
|||
static getSymbolInfo(data) { |
|||
return Serve.post(`/user/tradingPairCurrency`, data); |
|||
} |
|||
|
|||
// 查询最新资讯
|
|||
static newTrends() { |
|||
return Serve.get(`/newTrends`); |
|||
} |
|||
// 获取汇率
|
|||
static getCurrencyExCny(data){ |
|||
return Serve.get('/market/getCurrencyExCny',data) |
|||
} |
|||
} |
|||
|
|||
export default Exchange; |
|||
@ -0,0 +1,25 @@ |
|||
|
|||
import Serve from '@/api/serve/index' |
|||
|
|||
class Home { |
|||
// 获取大部分数据
|
|||
static indexList(data,config){ |
|||
return Serve.get('/indexList',data,config) |
|||
} |
|||
// 获取自选数据
|
|||
static getCollect(){ |
|||
return Serve.get('/getCollect') |
|||
} |
|||
|
|||
/** |
|||
* 添加自选 |
|||
* @param {object} data |
|||
* @param {string} data.pair_id |
|||
* @param {string} data.pair_name |
|||
*/ |
|||
static option(data){ |
|||
return Serve.post('/option',data) |
|||
} |
|||
} |
|||
|
|||
export default Home; |
|||
@ -0,0 +1,56 @@ |
|||
import Serve from '@/api/serve' |
|||
|
|||
class Market { |
|||
|
|||
/** |
|||
* 轮播图列表 |
|||
* @param {Object} data |
|||
* @param {int} type 请求类型 1是pc(默认) 2是app |
|||
* @param {int} position 位置 1(币币首页) 2(预留扩展) |
|||
*/ |
|||
static cryptocurrenciesWithdrawal(type, position) { |
|||
|
|||
return Serve.post(`/market/banner/${type}/${position}`); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 用户收藏交易对信息 需要先登录 |
|||
*/ |
|||
static userFavList() { |
|||
|
|||
return Serve.get(`/coin/market/collection/list`); |
|||
|
|||
} |
|||
|
|||
|
|||
static blogCategoryList() { |
|||
return Serve.get(`/blogCategory/list`); |
|||
} |
|||
|
|||
static blogDetailList(categoryId, params) { |
|||
return Serve.get(`/blog/list/${categoryId}`, params ); |
|||
} |
|||
|
|||
static blogDetailContent(id) { |
|||
return Serve.get(`/blog/detail/${id}`); |
|||
} |
|||
|
|||
// 初始化查询市场行情
|
|||
static getMarketList() { |
|||
return Serve.get(`/exchange/getMarketList`); |
|||
} |
|||
|
|||
// 初始化买卖盘数据
|
|||
static getBooks(data) { |
|||
return Serve.get(`/exchange/getMarketInfo`,data); |
|||
} |
|||
|
|||
// 获取币种信息
|
|||
static getCoinInfo(data){ |
|||
return Serve.get(`/exchange/getCoinInfo`,data) |
|||
} |
|||
|
|||
} |
|||
|
|||
export default Market; |
|||
@ -0,0 +1,144 @@ |
|||
import server from '@/api/serve' |
|||
|
|||
class Member { |
|||
|
|||
/** |
|||
* 注册滑块验证码 |
|||
* @param {object} data |
|||
*/ |
|||
static sliderVerify(data) { |
|||
return server.post(`/sliderVerify`, data); |
|||
} |
|||
|
|||
/** |
|||
* 注册发送手机验证码 |
|||
* @param data {phone,country_code,token} |
|||
*/ |
|||
static sendSmsCode(data) { |
|||
return server.post(`/register/sendSmsCode`, data); |
|||
} |
|||
|
|||
/** |
|||
* 注册发送验证码 |
|||
* @param data {email,token} |
|||
*/ |
|||
static sendEmailCode(data) { |
|||
return server.post(`/register/sendEmailCode`, data); |
|||
} |
|||
|
|||
/** |
|||
* 获取国家区号 |
|||
* @param {object} data |
|||
*/ |
|||
static getCountryCode() { |
|||
return server.get(`/getCountryList`); |
|||
} |
|||
|
|||
/** |
|||
* 注册提交 |
|||
* @param {object} data |
|||
*/ |
|||
static register(data) { |
|||
return server.post(`/user/register`, data); |
|||
} |
|||
|
|||
/** |
|||
* 登陆发送短信验证码 |
|||
* @param {object} data |
|||
*/ |
|||
static sendSmsCodeBeforeLogin(data) { |
|||
return server.post(`/login/sendSmsCodeBeforeLogin`, data) |
|||
} |
|||
|
|||
/** |
|||
* 登陆发送邮箱验证码 |
|||
* @param {object} data |
|||
*/ |
|||
static sendEmailCodeBeforeLogin(data) { |
|||
return server.post(`/login/sendEmailCodeBeforeLogin`, data); |
|||
} |
|||
|
|||
/** |
|||
* 登陆初始化验证 |
|||
* @param {object} data |
|||
*/ |
|||
static login(data) { |
|||
return server.post(`/user/login`, data); |
|||
} |
|||
|
|||
/** |
|||
* 登陆二次验证 |
|||
* @param {object} data |
|||
*/ |
|||
static loginConfirm(data,{loading}) { |
|||
return server.post(`/user/loginConfirm`, data,{loading}) |
|||
} |
|||
|
|||
/** |
|||
* 退出登录 |
|||
*/ |
|||
static logout(data) { |
|||
return server.post(`/user/logout`,data); |
|||
} |
|||
/** |
|||
* 上传文件 |
|||
* @param {FormData} data |
|||
*/ |
|||
static uploadImage(data) { |
|||
|
|||
return server.uploadFile(`/uploadImage`,data); |
|||
} |
|||
|
|||
// 页面底部信息
|
|||
static floor(){ |
|||
return server.get('/floor') |
|||
} |
|||
// 移动端logo
|
|||
static mobileLogo(){ |
|||
return server.get('/index/logo',{},{loading:false}) |
|||
} |
|||
// 消息通知
|
|||
static myNotifiables(data){ |
|||
return server.get('/user/myNotifiables',data) |
|||
} |
|||
// 消息通知详情
|
|||
static readNotifiable(data){ |
|||
return server.get('/user/readNotifiable',data) |
|||
} |
|||
// 移动端文章
|
|||
static article(data){ |
|||
return server.get('/article/list',data) |
|||
} |
|||
// 文章详情
|
|||
static articleDetail(data){ |
|||
return server.get('/article/detail',data) |
|||
} |
|||
// 获取协议
|
|||
static clause(){ |
|||
return server.get('/login/clause') |
|||
} |
|||
// 获取app更新信息
|
|||
static getNewestVersion(){ |
|||
return server.get('/getNewestVersion') |
|||
} |
|||
static serviceDetail(data) { |
|||
return server.get(`/article/serviceDetail`, data); |
|||
} |
|||
static contact () { |
|||
return server.get(`/contact`); |
|||
} |
|||
|
|||
/** |
|||
* 获取图形验证码 |
|||
* @param data {email,token} |
|||
*/ |
|||
static Graph_che() { |
|||
return server.get(`/register/Graph_che`); |
|||
} |
|||
// 提币获取邮箱验证码
|
|||
static getWdcode(data){ |
|||
return server.get(`/user/wdcode`, data); |
|||
} |
|||
} |
|||
|
|||
export default Member; |
|||
@ -0,0 +1,119 @@ |
|||
|
|||
import Serve from '@/api/serve' |
|||
|
|||
class Option { |
|||
// 交易对
|
|||
static getOptionSymbol() { |
|||
return Serve.get(`/option/getOptionSymbol`); |
|||
} |
|||
/** |
|||
* 获取期权交割记录 |
|||
* @param {object} data |
|||
* @param {string} data.pair_id |
|||
* @param {string} data.time_id |
|||
*/ |
|||
static getSceneResultList(data) { |
|||
return Serve.get(`/option/getSceneResultList`, data) |
|||
} |
|||
/** |
|||
* 获取k线数据 |
|||
* @param {object} data |
|||
* @param {string} data.symbol |
|||
* @param {string} data.period |
|||
* @param {string} data.size |
|||
* @param {string} data.form |
|||
* @param {string} data.to |
|||
*/ |
|||
static getKline(data) { |
|||
// let url = `https://api.hadax.com/market/history/kline`;
|
|||
let url = `/option/getKline`; |
|||
return Serve.get(url, data) |
|||
} |
|||
/** |
|||
* 获取可用于期权交易的币种列表 |
|||
*/ |
|||
static getBetCoinList() { |
|||
return Serve.get(`/option/getBetCoinList`) |
|||
} |
|||
/** |
|||
* 获取指定币种的余额 |
|||
* @param {object} data |
|||
* @param {string} data.coin_id |
|||
*/ |
|||
static getUserCoinBalance(data) { |
|||
return Serve.get(`/option/getUserCoinBalance`, data) |
|||
} |
|||
/** |
|||
* 获取当前最新期权场景 |
|||
* @param {object} data |
|||
* @param {string} data.pair_id |
|||
* @param {string} data.time_id |
|||
*/ |
|||
static sceneDetail(data) { |
|||
return Serve.get(`/option/sceneDetail`, data) |
|||
} |
|||
/** |
|||
* 获取全部期权场景 |
|||
*/ |
|||
static sceneListByPairs() { |
|||
return Serve.get(`/option/sceneListByPairs`) |
|||
} |
|||
/** |
|||
* 获取当前最新期权场景赔率 |
|||
* @param {object} data |
|||
* @param {string} data.pair_id |
|||
* @param {string} data.time_id |
|||
*/ |
|||
static getOddsList(data) { |
|||
return Serve.get(`/option/getOddsList`, data) |
|||
} |
|||
/** |
|||
* 获取用户期权购买记录 |
|||
* @param {object} data |
|||
* @param {string} data.status |
|||
* @param {string} data.pair_id |
|||
* @param {string} data.time_id |
|||
*/ |
|||
static getOptionHistoryOrders(data) { |
|||
return Serve.get(`/option/getOptionHistoryOrders`, data) |
|||
} |
|||
/** |
|||
* 购买期权 |
|||
* @param {object} data |
|||
* @param {string} data.bet_amount |
|||
* @param {string} data.bet_coin_id |
|||
* @param {string} data.odds_id |
|||
* */ |
|||
static betScene(data) { |
|||
return Serve.post(`/option/betScene`, data) |
|||
} |
|||
/** |
|||
* 获取交易价格组 |
|||
* @param {object} data |
|||
* @param {string} data.symbol |
|||
* |
|||
*/ |
|||
static getNewPriceBook(data) { |
|||
return Serve.get('/option/getNewPriceBook', data) |
|||
} |
|||
/** |
|||
* 移动端期权列表 |
|||
*/ |
|||
static sceneListByTimes() { |
|||
return Serve.get('/option/sceneListByTimes') |
|||
} |
|||
/** |
|||
* 移动端详情 |
|||
* @param {object} data |
|||
* @param {string} data.order_id |
|||
*/ |
|||
static getOptionOrderDetail(data) { |
|||
return Serve.get('/option/getOptionOrderDetail', data) |
|||
} |
|||
//期权说明
|
|||
static instruction() { |
|||
return Serve.get('/option/instruction') |
|||
} |
|||
} |
|||
|
|||
export default Option; |
|||
@ -0,0 +1,95 @@ |
|||
import Serve from '@/api/serve' |
|||
class Order { |
|||
/** |
|||
* 发布委托 |
|||
* @param {object} data |
|||
* @param {string} data.direction 方向 |
|||
* @param {number} data.type - 类型 |
|||
* @param {string} data.symbol - 交易对 |
|||
* @param {number} data.entrust_price - 价格 |
|||
* @param {number} data.amount - 数量 |
|||
* |
|||
*/ |
|||
static storeEntrust(data) { |
|||
return Serve.post(`/exchange/storeEntrust`,data); |
|||
} |
|||
/** |
|||
* 获取历史委托 |
|||
* @param {object} data |
|||
* @param {string} data.direction 方向 |
|||
* @param {number} data.type - 类型 |
|||
* @param {string} data.symbol - 交易对 |
|||
* |
|||
*/ |
|||
static getHistoryEntrust(data) { |
|||
return Serve.get(`/exchange/getHistoryEntrust`,data); |
|||
} |
|||
/** |
|||
* 获取当前委托 |
|||
* @param {object} data |
|||
* @param {string} data.direction 方向 |
|||
* @param {number} data.type - 类型 |
|||
* @param {string} data.symbol - 交易对 |
|||
* |
|||
*/ |
|||
static getCurrentEntrust(data) { |
|||
return Serve.get(`/exchange/getCurrentEntrust`,data); |
|||
} |
|||
|
|||
// 获取止盈止损单
|
|||
static getConditionEntrust(data) { |
|||
return Serve.get(`/exchange/getConditionEntrust`,data); |
|||
} |
|||
|
|||
/** |
|||
* 获取委托成交记录 |
|||
* @param {object} data |
|||
* @param {string} data.entrust_id 委托id |
|||
* @param {number} data.entrust_type - 买入卖出 |
|||
* @param {string} data.symbol - 交易对 |
|||
* |
|||
*/ |
|||
static getEntrustTradeRecord(data) { |
|||
return Serve.get(`/exchange/getEntrustTradeRecord`,data); |
|||
} |
|||
|
|||
/** |
|||
* 撤单 |
|||
* @param {object} data |
|||
* @param {string} data.entrust_id 委托id |
|||
* @param {number} data.entrust_type - 买入卖出 |
|||
* @param {string} data.symbol - 交易对 |
|||
* |
|||
*/ |
|||
static cancelEntrust(data) { |
|||
return Serve.post(`/exchange/cancelEntrust`,data); |
|||
} |
|||
/** |
|||
* 批量撤单 |
|||
* @param {object} data |
|||
* @param {string} data.symbol - 交易对 |
|||
* |
|||
*/ |
|||
static batchCancelEntrust(data) { |
|||
return Serve.post(`/exchange/batchCancelEntrust`,data); |
|||
} |
|||
// 获取交易对
|
|||
static getExchangeSymbol(){ |
|||
return Serve.get('/exchange/getExchangeSymbol') |
|||
} |
|||
/** |
|||
* 期权交易记录 |
|||
* @param {object} [data] |
|||
* @param {string} data.status |
|||
* @param {string} data.pair_id |
|||
* @param {string} data.time_id |
|||
* |
|||
*/ |
|||
static getOptionHistoryOrders(data){ |
|||
return Serve.get('/option/getOptionHistoryOrders',data) |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
export default Order; |
|||
@ -0,0 +1,69 @@ |
|||
import Serve from '@/api/serve/index' |
|||
class Otc { |
|||
static userPayment(data) { |
|||
return Serve.get(`/userPayment`,data,{loading:true}); |
|||
} |
|||
static editUserPayment(data) { |
|||
return Serve.post(`/userPayment/${data.id}`,data,{loading:true}); |
|||
} |
|||
static getUserPayment(data) { |
|||
return Serve.post(`/userPayment/${data.id}`,{},{loading:true}); |
|||
} |
|||
static addUserPayment(data) { |
|||
return Serve.post(`/userPayment`,data,{loading:true}); |
|||
} |
|||
static otcTicker(){ |
|||
return Serve.get(`/otc/otcTicker`,{}); |
|||
} |
|||
static tradingEntrusts(data){ |
|||
return Serve.get(`/otc/tradingEntrusts`,data,{loading:true}) |
|||
} |
|||
static storeEntrust(data){ |
|||
return Serve.post(`/otc/storeEntrust`,data,{loading:true}) |
|||
} |
|||
static storeOrder(data){ |
|||
return Serve.post(`/otc/storeOrder`,data,{loading:true}) |
|||
} |
|||
static myEntrusts(data){ |
|||
return Serve.get(`/otc/myEntrusts`,data,{loading:true}) |
|||
} |
|||
static myOrders(data){ |
|||
return Serve.get(`/otc/myOrders`,data,{loading:true}) |
|||
} |
|||
static cancelEntrust(data){ |
|||
return Serve.post(`/otc/cancelEntrust`,data,{loading:true}) |
|||
} |
|||
static cancelOrder(data){ |
|||
return Serve.post(`/otc/cancelOrder`,data,{loading:true}) |
|||
} |
|||
static confirmPaidOrder(data){ |
|||
return Serve.post(`/otc/confirmPaidOrder`,data,{loading:true}) |
|||
} |
|||
static confirmOrder(data){ |
|||
return Serve.post(`/otc/confirmOrder`,data,{loading:true}) |
|||
} |
|||
static notConfirmOrder(data){ |
|||
return Serve.post(`/otc/notConfirmOrder`,data,{loading:true}) |
|||
} |
|||
static orderDetail(data){ |
|||
return Serve.get(`/otc/orderDetail`,data,{loading:true}) |
|||
} |
|||
static otcAccount(data){ |
|||
return Serve.get(`/otc/otcAccount`,data,{loading:true}) |
|||
} |
|||
|
|||
static legalBuy(data){ |
|||
return Serve.post(`/user/legal-buy-sell`,data) |
|||
} |
|||
static legalPrice(data){ |
|||
return Serve.post(`/user/legal-unit-price`,data) |
|||
} |
|||
static legalList(data){ |
|||
return Serve.post(`/user/legal-order-list`,data) |
|||
} |
|||
static otcWalletLogs(data){ |
|||
return Serve.get(`/user/otcWalletLogs`,data) |
|||
} |
|||
} |
|||
|
|||
export default Otc; |
|||
@ -0,0 +1,81 @@ |
|||
import Serve from '@/api/serve/index' |
|||
class Profile { |
|||
// 获取用户信息
|
|||
static getUserInfo() { |
|||
return Serve.get(`/user/getUserInfo`); |
|||
} |
|||
// 获取实名认证信息
|
|||
static getAuthInfo() { |
|||
return Serve.get(`/user/getAuthInfo`); |
|||
} |
|||
/** |
|||
* 初级认证 (认证第一步) |
|||
* @param {object} data |
|||
* @param {number} data.country_code |
|||
* @param {number} data.country_id // 区号id
|
|||
* @param {string} data.realname |
|||
* @param {number} data.id_card //证件号
|
|||
* @param {number} data.type //证件类型
|
|||
* @param {string} data.birthday //出生日期
|
|||
* @param {string} data.address //地址
|
|||
* @param {string} data.city //城市
|
|||
* @param {string} data.extra //额外信息
|
|||
* @param {string} data.postal_code //邮政编码
|
|||
* @param {string} data.phone //手机号
|
|||
*/ |
|||
static primaryAuth(data) { |
|||
return Serve.post(`/user/primaryAuth`, data); |
|||
} |
|||
/** |
|||
* 高级认证(认证第二步) |
|||
* @param {object} data |
|||
* @param {string} data.front_img //证件照正面
|
|||
* @param {string} data.back_img //证件照反面
|
|||
* @param {string} data.hand_img //手持证件照
|
|||
*/ |
|||
static topAuth(data) { |
|||
return Serve.post(`/user/topAuth`, data); |
|||
} |
|||
|
|||
/** |
|||
* 登录记录 |
|||
*/ |
|||
static getLoginLogs(data){ |
|||
return Serve.get(`/user/getLoginLogs`, data) |
|||
} |
|||
/** |
|||
* 邀请推广 |
|||
*/ |
|||
static generalizeInfo(){ |
|||
return Serve.get(`/generalize/info`,) |
|||
} |
|||
/** |
|||
* 推广记录 |
|||
*/ |
|||
static generalizeList(data){ |
|||
return Serve.get(`/generalize/list`,data) |
|||
} |
|||
/** |
|||
* 返佣记录 |
|||
*/ |
|||
static rewardLogs(data){ |
|||
return Serve.get('/generalize/rewardLogs',data) |
|||
} |
|||
/** |
|||
* 获取用户等级详情 |
|||
*/ |
|||
static getGradeInfo(){ |
|||
return Serve.get('/user/getGradeInfo') |
|||
} |
|||
/** |
|||
* 海报图 |
|||
*/ |
|||
static poster(data){ |
|||
return Serve.get('/generalize/poster',data) |
|||
} |
|||
static qrcode(){ |
|||
return Serve.get('/generalize/invite_qrcode') |
|||
} |
|||
} |
|||
|
|||
export default Profile; |
|||
@ -0,0 +1,101 @@ |
|||
import {$get,$post,$postFile} from '@/api' |
|||
|
|||
class Record { |
|||
/** |
|||
* fundHistory列表 |
|||
* @param {Object} data |
|||
*/ |
|||
static fundList(data) { |
|||
|
|||
return $get(`/coin/getAllList`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 币币用户当前委托记录 |
|||
* @param {Object} data |
|||
*/ |
|||
static openOrder(data) { |
|||
|
|||
return $post(`/coin/orders/openOrder`, data); |
|||
|
|||
} |
|||
static conditionOrders(data) { |
|||
|
|||
return $post(`/coin/orders/condition/openOrder`, data); |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* 币币用户取消接口 |
|||
* @param {Object} data |
|||
*/ |
|||
static openOrderCancel(data) { |
|||
|
|||
return $post(`/coin/orders/cancel/${data}`); |
|||
|
|||
} |
|||
|
|||
static orderConditionCancel(data) { |
|||
return $post(`/coin/orders/condition/cancel/${data}`) |
|||
} |
|||
|
|||
/** |
|||
* 币币用户筛选接口 |
|||
* @param {Object} data |
|||
*/ |
|||
static openOrderfilter() { |
|||
|
|||
return $post(`/coin/orders/filter`); |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* 用户返佣记录 |
|||
* @param {Object} data |
|||
*/ |
|||
static rewardList(data) { |
|||
|
|||
return $post(`/member/rewardList`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 币币用户历史委托 |
|||
* @param {Object} data |
|||
*/ |
|||
static history(data) { |
|||
|
|||
return $post(`/coin/orders/history`, data); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 联系我们 |
|||
* @param {Object} data |
|||
*/ |
|||
static contactUs(data) { |
|||
return $post(`/contactUs/save` , data); |
|||
} |
|||
|
|||
/** |
|||
* 取消订单 |
|||
* @param {Object} data |
|||
*/ |
|||
static cancelActiveOrder(data) { |
|||
return $get(`/futuresOrders/cancelActiveOrder/${data}`); |
|||
} |
|||
|
|||
/** |
|||
* 取消订单 |
|||
* @param {Object} data |
|||
*/ |
|||
static cancelById(data) { |
|||
return $get(`/futuresConditionOrders/cancelById/${data}`); |
|||
} |
|||
|
|||
} |
|||
|
|||
export default Record; |
|||
@ -0,0 +1,31 @@ |
|||
import vue from "vue"; |
|||
import router from '@/router' |
|||
const resIntercept = (result) => { |
|||
let res = result.data |
|||
let config = result.config |
|||
return new Promise( |
|||
function (resolve, reject) { |
|||
// 是否提示
|
|||
if (typeof config.toast == 'boolean') { |
|||
if (config.toast) { |
|||
vue.prototype.$toast(res.msg) |
|||
} |
|||
} else { |
|||
if (res.code != 200 && res.code != 100) { |
|||
vue.prototype.$toast(res.msg) |
|||
} |
|||
} |
|||
// 过滤
|
|||
if (res.code == 200) {//成功
|
|||
resolve(res) |
|||
} else {//失败
|
|||
reject(res) |
|||
if (res.code == 100 && !config.notLogin) { |
|||
router.push('/InterceptAccount') |
|||
} |
|||
} |
|||
} |
|||
) |
|||
} |
|||
|
|||
export default resIntercept |
|||
@ -0,0 +1,330 @@ |
|||
import app from "@/app.js" |
|||
import Cache from "../cache.js" |
|||
let settings = { |
|||
method: "get", // 默认请求方法
|
|||
contentType: "application/json", // 传参格式
|
|||
dataType: "json", // 返回值类型
|
|||
baseUrl: app.baseUrl + '/api/app', // 请求根地址
|
|||
} |
|||
|
|||
let loadNum = 0; //加载框的数量
|
|||
let loadingShow = () => { |
|||
loadNum++ |
|||
uni.showLoading({ |
|||
title: 'loading...' |
|||
}); |
|||
} |
|||
let loadingHide = () => { |
|||
loadNum-- |
|||
if (loadNum <= 0) { |
|||
uni.hideLoading(); |
|||
} |
|||
} |
|||
function x(options = null) { |
|||
|
|||
// 返回当前实例对象 无需手动return
|
|||
return new x.fn.init(options); |
|||
|
|||
} |
|||
|
|||
x.fn = x.prototype = { |
|||
|
|||
constructor: x, |
|||
|
|||
config(options) { |
|||
// 解构并设置默认值
|
|||
let { |
|||
baseUrl, |
|||
url, |
|||
data, |
|||
method, |
|||
contentType, |
|||
dataType |
|||
} = options; |
|||
|
|||
// 请求头参数 写入token和language
|
|||
let auth = null; |
|||
if (uni.getStorageSync('token')) { |
|||
auth = uni.getStorageSync('token'); |
|||
} |
|||
|
|||
let lang=uni.getStorageSync('language') |
|||
const header = auth ? { |
|||
'X-Requested-With': 'XMLHttpRequest', |
|||
lang: lang || 'en', |
|||
authorization: `bearer ${auth}`, |
|||
'content-type': 'application/x-www-form-urlencoded' |
|||
} : { |
|||
'X-Requested-With': 'XMLHttpRequest', |
|||
lang: lang || 'en', |
|||
'content-type': 'application/x-www-form-urlencoded' |
|||
}; |
|||
|
|||
this.header = header; |
|||
|
|||
// 请求地址解析
|
|||
if (url.startsWith('http')) { // 外部链接
|
|||
this.url = url; |
|||
} else { // 本地相对路径
|
|||
this.url = baseUrl + url; |
|||
} |
|||
|
|||
if (data) this.data = data; |
|||
if (method) this.method = method; |
|||
if (contentType) this.contentType = contentType; |
|||
if (dataType) this.dataType = dataType; |
|||
}, |
|||
|
|||
init(options) { |
|||
// 将用户参数 写入配置信息
|
|||
this.config(Object.assign(settings, options)); |
|||
let { config = {} } = options |
|||
return new Promise((resolve, reject) => { |
|||
let reg=new RegExp('/','g')//g代表全部
|
|||
let newMsg=options.url.replace(reg,'_'); |
|||
// console.info(newMsg)
|
|||
if(Cache.get(newMsg).data){ |
|||
if(newMsg!='_user_walletImage'&& newMsg!='_user_getAuthInfo' && newMsg!='_user_withdrawalBalance' |
|||
&& newMsg!='_wallet_getBalance' && newMsg!='_contract_getMarketInfo'&& newMsg!='_contract_openNum' |
|||
&& newMsg!='_user_primaryAuth' && newMsg!='_user_subscribeTokenList' && newMsg!='_article_detail' && newMsg!='_articleList' |
|||
&& newMsg!='_user_subscribeRecords' && newMsg!='_user_subscribeNow' && newMsg!='_exchange_getMarketInfo' |
|||
&& newMsg!='_indexList'&& newMsg!='_user_subscribe'&& newMsg!='_contract_getSymbolDetail' && newMsg!='_user_withdrawalRecord'){ |
|||
// resolve(Cache.get(newMsg).data);//缓存数据
|
|||
|
|||
} |
|||
uni.request({ |
|||
url: this.url, |
|||
data: this.data, |
|||
method: this.method, |
|||
header: this.header, |
|||
dataType: this.dataType, |
|||
sslVerify: false, |
|||
success: (res) => { |
|||
// console.info(res)
|
|||
let message = res.data.message |
|||
let code = res.data.code |
|||
if (code != 200) { |
|||
switch (code) { |
|||
case 1003: // 登陆失效 清除状态 重新登陆
|
|||
// 清除session
|
|||
uni.removeStorageSync('token'); |
|||
uni.redirectTo({ |
|||
url: "/pages/login/index", |
|||
}); |
|||
break; |
|||
case 1021: |
|||
resolve(res.data); |
|||
break; |
|||
case 4001: |
|||
resolve(res.data); |
|||
break; |
|||
default: |
|||
reject(message); |
|||
break; |
|||
} |
|||
if (config.toast !== false&&message) { |
|||
uni.showToast({ |
|||
title: message, |
|||
duration: 2000, |
|||
icon: 'none' |
|||
}); |
|||
} |
|||
} else { |
|||
// console.info(Cache.set(newMsg,res.data))
|
|||
Cache.set(newMsg,res.data); |
|||
// console.info(res.data)
|
|||
resolve(res.data); // 直接返回数据
|
|||
if (config.toast&&message) { |
|||
uni.showToast({ |
|||
title: message, |
|||
duration: 2000, |
|||
icon: 'none' |
|||
}); |
|||
} |
|||
} |
|||
}, |
|||
fail: (err) => { |
|||
console.log(err) |
|||
reject(err) |
|||
if (config.toast !== false) { |
|||
// uni.showToast({
|
|||
// title: 'error reload!',
|
|||
// icon: "none"
|
|||
// });
|
|||
} |
|||
if (err) { |
|||
throw new Error(); |
|||
} |
|||
}, |
|||
complete: (er) => { |
|||
console.log() |
|||
reject(er) |
|||
} |
|||
}) |
|||
}else{ |
|||
// 提示状态
|
|||
if (config.loading) { |
|||
loadingShow() |
|||
} |
|||
uni.request({ |
|||
url: this.url, |
|||
data: this.data, |
|||
method: this.method, |
|||
header: this.header, |
|||
dataType: this.dataType, |
|||
sslVerify: false, |
|||
success: (res) => { |
|||
let message = res.data.message |
|||
let code = res.data.code |
|||
if (code != 200) { |
|||
switch (code) { |
|||
case 1003: // 登陆失效 清除状态 重新登陆
|
|||
// 清除session
|
|||
uni.removeStorageSync('token'); |
|||
uni.redirectTo({ |
|||
url: "/pages/login/index", |
|||
}); |
|||
break; |
|||
case 1021: |
|||
resolve(res.data); |
|||
break; |
|||
case 4001: |
|||
resolve(res.data); |
|||
break; |
|||
default: |
|||
reject(message); |
|||
break; |
|||
} |
|||
if (config.toast !== false&&message) { |
|||
uni.showToast({ |
|||
title: message, |
|||
duration: 2000, |
|||
icon: 'none' |
|||
}); |
|||
} |
|||
} else { |
|||
Cache.set(newMsg,res.data); |
|||
resolve(Cache.get(newMsg).data); // 直接返回数据
|
|||
if (config.toast&&message) { |
|||
uni.showToast({ |
|||
title: message, |
|||
duration: 2000, |
|||
icon: 'none' |
|||
}); |
|||
} |
|||
} |
|||
}, |
|||
fail: (err) => { |
|||
reject(err) |
|||
if (config.toast !== false) { |
|||
uni.showToast({ |
|||
title: 'error reload!', |
|||
icon: "none" |
|||
}); |
|||
} |
|||
if (err) { |
|||
throw new Error(); |
|||
} |
|||
}, |
|||
complete: () => { |
|||
loadingHide() |
|||
} |
|||
}) |
|||
} |
|||
|
|||
}) |
|||
|
|||
}, |
|||
|
|||
// 使用promise封装同步化的确认框
|
|||
confirmSync(content, fullfilled, rejected = null) { |
|||
let showCancel = false; |
|||
if (rejected instanceof Function) { |
|||
showCancel = true; |
|||
} |
|||
return new Promise(function (resolve, reject) { |
|||
uni.showModal({ |
|||
content, |
|||
showCancel, |
|||
success(res) { // confirm or cancel
|
|||
if (res.confirm) { |
|||
resolve(fullfilled()); // 执行动作 需要返回值 则标记到resolve中
|
|||
} else if (res.cancel && rejected) { |
|||
reject(rejected()); // 执行动作 需要返回值 则标记到reject中
|
|||
} |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
get(url, data = null, config = {}) { |
|||
return x({ |
|||
method: "get", |
|||
url, |
|||
data, |
|||
config |
|||
}) |
|||
}, |
|||
|
|||
post(url, data, config = {}) { |
|||
return x({ |
|||
method: "post", |
|||
url, |
|||
data, |
|||
config |
|||
}) |
|||
}, |
|||
// data 为uni的chooseImage
|
|||
uploadFile(url, data, config = {}) { |
|||
let auth = null; |
|||
if (uni.getStorageSync('token')) { |
|||
auth = uni.getStorageSync('token'); |
|||
} |
|||
let lang=uni.getStorageSync('language') |
|||
let header = { |
|||
'X-Requested-With': 'XMLHttpRequest', |
|||
lang: lang || "en", |
|||
} |
|||
if (auth) header.authorization = `bearer ${auth}`; |
|||
if (config.loading !== false) { |
|||
loadingShow() |
|||
} |
|||
return new Promise((resolve, reject) => { |
|||
uni.uploadFile({ |
|||
url: settings.baseUrl + url, //仅为示例,非真实的接口地址
|
|||
filePath: data.tempFilePaths[0], |
|||
name: 'image', |
|||
formData: {}, |
|||
sslVerify: false, |
|||
header, |
|||
success: (res) => { |
|||
resolve(JSON.parse(res.data)) |
|||
}, |
|||
fail: () => { |
|||
reject() |
|||
}, |
|||
complete: () => { |
|||
loadingHide() |
|||
} |
|||
}); |
|||
}) |
|||
|
|||
}, |
|||
head() { |
|||
|
|||
}, |
|||
put() { |
|||
|
|||
}, |
|||
// ...
|
|||
} |
|||
|
|||
x.fn.init.prototype = x.fn, x.extend = x.fn.extend = function (obj, prop) { |
|||
if (!prop) { //如果未设置prop 则表示给this扩展一个对象的内容
|
|||
prop = obj; |
|||
obj = this; |
|||
} |
|||
for (var i in prop) obj[i] = prop[i]; |
|||
}, x.extend(x.fn); |
|||
|
|||
export default x; |
|||
@ -0,0 +1,200 @@ |
|||
|
|||
class Ws { |
|||
constructor(ws, data, ...args) { // [{url, data, method...},,,,]
|
|||
this._ws = ws; |
|||
this._data = data; |
|||
// 待发送的消息列
|
|||
this._msgs = [] |
|||
|
|||
this.socket = this.doLink(); |
|||
this.doOpen(); |
|||
// 订阅/发布模型
|
|||
this._events = {}; |
|||
// 是否保持连接
|
|||
this._isLink = true; |
|||
// 订阅列表(交易所专用)
|
|||
this.subs = [] |
|||
// 循环检查
|
|||
setInterval(() => { |
|||
if (this._isLink) { |
|||
if (this.socket.readyState == 2 || this.socket.readyState == 3) { |
|||
this.resetLink() |
|||
} |
|||
} |
|||
}, 3000) |
|||
} |
|||
// 重连
|
|||
resetLink() { |
|||
this.socket = this.doLink(() => { |
|||
this.Notify({ |
|||
Event: 'resetLink' |
|||
}); |
|||
this.resetSub() |
|||
}); |
|||
this.doOpen(); |
|||
} |
|||
// 连接
|
|||
doLink(call) { |
|||
let ws = uni.connectSocket({ |
|||
url: this._ws, |
|||
// 可选参数 设置默认值
|
|||
header: { |
|||
'content-type': 'application/json' |
|||
}, |
|||
method: 'GET', |
|||
success: () => { |
|||
call && call() |
|||
} |
|||
}) |
|||
return ws; |
|||
} |
|||
doOpen() { |
|||
this.socket.onOpen((ev) => { |
|||
this.onOpen(ev) |
|||
}) |
|||
this.socket.onMessage((ev) => { |
|||
this.onMessage(ev) |
|||
}) |
|||
this.socket.onClose((ev) => { |
|||
this.onClose(ev) |
|||
}) |
|||
this.socket.onError((ev) => { |
|||
this.onError(ev) |
|||
}) |
|||
|
|||
} |
|||
// 打开
|
|||
onOpen() { |
|||
// 打开时重发未发出的消息
|
|||
let list = Object.assign([], this._msgs) |
|||
list.forEach((item) => { |
|||
if (this.send(item)) { |
|||
let idx = this._msgs.indexOf(item) |
|||
if (idx != -1) { |
|||
this._msgs.splice(idx, 1) |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
// 手动关闭
|
|||
doClose() { |
|||
this._isLink = false |
|||
this._events = {} |
|||
this._msgs = [] |
|||
this.socket.close({ |
|||
success: () => { |
|||
console.log('socket close success') |
|||
} |
|||
}) |
|||
} |
|||
// 添加监听
|
|||
on(name, handler) { |
|||
this.subscribe(name, handler); |
|||
} |
|||
// 取消监听
|
|||
off(name, handler) { |
|||
this.unsubscribe(name, handler); |
|||
} |
|||
// 关闭事件
|
|||
onClose() { |
|||
// 是否重新连接
|
|||
if (this._isLink) { |
|||
setTimeout(() => { |
|||
this.resetLink() |
|||
}, 3000) |
|||
} |
|||
} |
|||
// 错误
|
|||
onError(evt) { |
|||
this.Notify({ |
|||
Event: 'error', |
|||
Data: evt |
|||
}); |
|||
|
|||
} |
|||
// 接受数据
|
|||
onMessage(evt) { |
|||
try { |
|||
|
|||
// 解析推送的数据
|
|||
const data = JSON.parse(evt.data); |
|||
|
|||
// 通知订阅者
|
|||
this.Notify({ |
|||
Event: 'message', |
|||
Data: data |
|||
}); |
|||
|
|||
} catch (err) { |
|||
console.error(' >> Data parsing error:', err); |
|||
// 通知订阅者
|
|||
this.Notify({ |
|||
Event: 'error', |
|||
Data: err |
|||
}); |
|||
} |
|||
} |
|||
// 订阅事件的方法
|
|||
subscribe(name, handler) { |
|||
if (this._events.hasOwnProperty(name)) { |
|||
this._events[name].push(handler); // 追加事件
|
|||
} else { |
|||
this._events[name] = [handler]; // 添加事件
|
|||
} |
|||
} |
|||
// 取消订阅事件
|
|||
unsubscribe(name, handler) { |
|||
let start = this._events[name].findIndex(item => item === handler); |
|||
// 删除该事件
|
|||
this._events[name].splice(start, 1); |
|||
} |
|||
// 发布后通知订阅者
|
|||
Notify(entry) { |
|||
// 检查是否有订阅者 返回队列
|
|||
const cbQueue = this._events[entry.Event]; |
|||
if (cbQueue && cbQueue.length) { |
|||
for (let callback of cbQueue) { |
|||
if (callback instanceof Function) callback(entry.Data); |
|||
} |
|||
} |
|||
} |
|||
// 发送消息
|
|||
send(data) { |
|||
this.changeSubs(data) |
|||
if (this.socket.readyState == 1) { |
|||
this.socket.send({ data: JSON.stringify(data) }) |
|||
return true |
|||
} else { |
|||
// 保存到待发送信息
|
|||
if (!this._msgs.includes(data)) { |
|||
this._msgs.push(data) |
|||
}; |
|||
return false |
|||
} |
|||
|
|||
} |
|||
// 修改订阅列表(交易所用)
|
|||
changeSubs(data) { |
|||
if (data.cmd == 'sub') { |
|||
if (!this.subs.includes(data.msg)) { |
|||
this.subs.push(data.msg) |
|||
} |
|||
} else if (data.cmd == 'unsub') { |
|||
let idx = this.subs.indexOf(data.msg) |
|||
if (idx != -1) { |
|||
this.subs.splice(idx, 1) |
|||
} |
|||
} |
|||
} |
|||
// 重新订阅(交易所用)
|
|||
resetSub() { |
|||
let list = Object.assign([], this.subs) |
|||
list.forEach((item) => { |
|||
this.send({ |
|||
cmd: 'sub', |
|||
msg: item |
|||
}) |
|||
}) |
|||
} |
|||
} |
|||
export default Ws |
|||
@ -0,0 +1,62 @@ |
|||
import axios from 'axios' |
|||
import app from '@/app' |
|||
import qs from 'qs'; |
|||
|
|||
// 初始化配置
|
|||
let setting = { |
|||
baseURL: app.baseUrl + '/api/app', |
|||
timeout: 10000, |
|||
withCredentials: true, |
|||
crossDomain: true, |
|||
responseType: 'json', |
|||
headers: { |
|||
'content-type': 'application/x-www-form-urlencoded' |
|||
} |
|||
} |
|||
const server = axios.create(setting) |
|||
|
|||
// 请求拦截
|
|||
server.interceptors.request.use(function (config) { |
|||
if (config.method === 'post') { |
|||
if (!config.file) { |
|||
config.data = qs.stringify(config.data) |
|||
} |
|||
} |
|||
config.headers = Object.assign(config.headers, { |
|||
'X-Requested-With': 'XMLHttpRequest', |
|||
|
|||
}) |
|||
return config; |
|||
}, function (error) { |
|||
return Promise.reject(error); |
|||
}) |
|||
// 响应拦截
|
|||
server.interceptors.response.use(function (response) { |
|||
return response.data; |
|||
}, function (error) { |
|||
return Promise.reject(error); |
|||
}) |
|||
export default server; |
|||
|
|||
|
|||
const $get = (url, data, config) => { |
|||
return server.get(url, { |
|||
params: data, |
|||
...config |
|||
}) |
|||
} |
|||
const $post = (url, data, config) => { |
|||
return server.post(url, data, config) |
|||
} |
|||
const $postFile = (url, data, config) => { |
|||
let form = new FormData() |
|||
for (let i in data) { |
|||
form.append(i, data[i]) |
|||
} |
|||
let postConfig = { |
|||
file: true |
|||
} |
|||
return server.post(url, form, Object.assign(postConfig, config)) |
|||
} |
|||
export { $get, $post, $postFile } |
|||
|
|||
@ -0,0 +1,197 @@ |
|||
import Serve from '@/api/serve' |
|||
class Setting { |
|||
// 获取用户信息
|
|||
static getUserInfo() { |
|||
return Serve.get(`/user/getUserInfo`); |
|||
} |
|||
/** |
|||
* 修改用户信息 |
|||
* @param {{username:string,avatar:'url'}} data |
|||
*/ |
|||
static updateUserInfo(data) { |
|||
return Serve.post(`/user/updateUserInfo`, data); |
|||
} |
|||
/** |
|||
* 关闭手机号/邮箱/谷歌验证 |
|||
* @param {object} data |
|||
* @param {number} data.type 1:手机 2:邮箱 3:谷歌 |
|||
* @param {number} data.sms_code 手机验证码 |
|||
* @param {number} data.email_code 邮箱验证码 |
|||
* @param {number} data.google_code 谷歌验证码 |
|||
*/ |
|||
static disableSmsEmailGoogle(data,{btn}) { |
|||
return Serve.post(`/user/disableSmsEmailGoogle`, data,{btn}); |
|||
} |
|||
/** |
|||
* 开启手机号/邮箱/谷歌验证 |
|||
* @param {object} data |
|||
* @param {number} data.type 1:手机 2:邮箱 3:谷歌 |
|||
* @param {number} data.sms_code 手机验证码 |
|||
* @param {number} data.email_code 邮箱验证码 |
|||
* @param {number} data.google_code 谷歌验证码 |
|||
*/ |
|||
static enableSmsEmailGoogle(data,{btn}) { |
|||
return Serve.post(`/user/enableSmsEmailGoogle`, data,{btn}); |
|||
} |
|||
/** |
|||
* 发送邮箱验证码 |
|||
* @param {object} data |
|||
* @param {string} data.email 邮箱号 |
|||
*/ |
|||
static sendBindEmailCode(data) { |
|||
return Serve.post(`/user/sendBindEmailCode`, data); |
|||
} |
|||
/** |
|||
* 登录二次验证开关 |
|||
*/ |
|||
static switchSecondVerify() { |
|||
return Serve.get(`/user/switchSecondVerify`); |
|||
} |
|||
/** |
|||
* 账号安全信息 |
|||
*/ |
|||
static accountSecurity() { |
|||
return Serve.get(`/user/security/home`); |
|||
} |
|||
/** |
|||
* 设置或重置交易密码 |
|||
* @param {object} data |
|||
* @param {string} data.payword |
|||
* @param {string} data.payword_confirmation |
|||
* @param {string} data.sms_code |
|||
* @param {string} data.email_code |
|||
* @param {string} data.google_code |
|||
*/ |
|||
static setOrResetPaypwd(data) { |
|||
return Serve.post(`/user/setOrResetPaypwd`, data); |
|||
} |
|||
/** |
|||
* 设置或重置登录密码 |
|||
* @param {object} data |
|||
* @param {string} data.password |
|||
* @param {string} data.password_confirmation |
|||
* @param {string} data.sms_code |
|||
* @param {string} data.email_code |
|||
* @param {string} data.google_code |
|||
*/ |
|||
static updatePassword(data,{btn}) { |
|||
return Serve.post(`/user/updatePassword`, data,{btn}); |
|||
} |
|||
/** |
|||
* 绑定邮箱 |
|||
* @param {object} data |
|||
* @param {string} data.email |
|||
* @param {string} data.email_code |
|||
* @param {string} data.sms_code |
|||
* @param {string} data.google_code |
|||
*/ |
|||
static bindEmail(data,{btn}) { |
|||
return Serve.post(`/user/bindEmail`, data,{btn}); |
|||
} |
|||
|
|||
/** |
|||
* 绑定手机 |
|||
* @param {object} data |
|||
* @param {string} data.phone |
|||
* @param {string} data.country_code - 手机区号 |
|||
* @param {string} data.sms_code |
|||
* @param {string} data.email_code |
|||
* @param {string} data.google_code |
|||
*/ |
|||
static bindPhone(data,{btn}) { |
|||
return Serve.post(`/user/bindPhone`, data,{btn}); |
|||
} |
|||
|
|||
/** |
|||
* 解绑邮箱 |
|||
* @param {object} data |
|||
* @param {string} data.sms_code |
|||
* @param {string} data.email_code |
|||
* @param {string} data.google_code |
|||
*/ |
|||
static unbindEmail(data) { |
|||
return Serve.post(`/user/unbindEmail`, data); |
|||
} |
|||
|
|||
/** |
|||
* 解绑手机 |
|||
* @param {object} data |
|||
* @param {string} data.sms_code |
|||
* @param {string} data.email_code |
|||
* @param {string} data.google_code |
|||
*/ |
|||
static unbindPhone(data) { |
|||
return Serve.post(`/user/unbindPhone`, data); |
|||
} |
|||
|
|||
/** |
|||
* 忘记登录密码 - 账号确认 |
|||
* @param {object} data |
|||
* @param {string} data.account |
|||
*/ |
|||
static forgetPasswordAttempt(data) { |
|||
return Serve.post(`/user/forgetPasswordAttempt`, data,{toast:false}); |
|||
} |
|||
/** |
|||
* 忘记登录密码 - 提交 |
|||
* @param {object} data |
|||
* @param {string} data.account |
|||
* @param {string} data.email_code |
|||
* @param {string} data.google_code |
|||
* @param {string} data.password |
|||
* @param {string} data.password_confirmation |
|||
*/ |
|||
static forgetPassword(data,{btn}) { |
|||
return Serve.post(`/user/forgetPassword`, data,{btn}); |
|||
} |
|||
|
|||
/** |
|||
* 获取谷歌密钥 |
|||
*/ |
|||
static getGoogleToken(data) { |
|||
return Serve.get(`/user/getGoogleToken`, data); |
|||
} |
|||
/** |
|||
* 绑定谷歌 |
|||
* @param {object} data |
|||
* @param {string} data.google_token |
|||
* @param {string} data.google_code |
|||
* @param {string} data.sms_code |
|||
* @param {string} data.email_code |
|||
*/ |
|||
static bindGoogleToken(data,{btn}) { |
|||
return Serve.post(`/user/bindGoogleToken`, data,{btn}); |
|||
} |
|||
/** |
|||
* 解绑谷歌 |
|||
* @param {object} data |
|||
* @param {string} data.sms_code |
|||
* @param {string} data.google_code |
|||
* @param {string} data.email_code |
|||
*/ |
|||
static unbindGoogleToken(data) { |
|||
return Serve.post(`/user/unbindGoogleToken`, data); |
|||
} |
|||
/** |
|||
* 发送绑定手机短信验证码 |
|||
* @param {object} data |
|||
* @param {string} data.phone |
|||
* @param {string} data.country_code |
|||
*/ |
|||
static sendBindSmsCode(data) { |
|||
return Serve.post(`/user/sendBindSmsCode`, data); |
|||
} |
|||
/** |
|||
* 在线获取验证码 |
|||
* @param {object} data |
|||
* @param {string} data.type 1:手机 2:邮箱 |
|||
*/ |
|||
static getCode(data) { |
|||
return Serve.post(`/user/getCode`, data); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
export default Setting; |
|||
@ -0,0 +1,31 @@ |
|||
|
|||
import Serve from '@/api/serve' |
|||
|
|||
class Subscribe { |
|||
/** |
|||
* 请求数据 |
|||
*/ |
|||
static subscribeTokenList(data){ |
|||
return Serve.post('/user/subscribeTokenList',data) |
|||
} |
|||
static activity(data){ |
|||
return Serve.get('/subscribe/activity',data) |
|||
} |
|||
static subscribe(data){ |
|||
return Serve.post('/user/subscribe',data) |
|||
} |
|||
/** |
|||
* 提交数据 |
|||
* @param {object} data |
|||
* @param {string} data.amount |
|||
* @param {string} data.coin_name |
|||
*/ |
|||
static subscribeNow(data){ |
|||
return Serve.post('/user/subscribeNow',data) |
|||
} |
|||
static changePurchaseCode(data){ |
|||
return Serve.post('/user/changePurchaseCode',data) |
|||
} |
|||
} |
|||
|
|||
export default Subscribe; |
|||
@ -0,0 +1,175 @@ |
|||
|
|||
import Serve from '@/api/serve' |
|||
|
|||
class Wallet { |
|||
|
|||
// 提币记录
|
|||
static withdrawalRecord() { |
|||
return Serve.post(`/user/withdrawalRecord`); |
|||
} |
|||
// PayPal支付
|
|||
static rechargeManualPost(data) { |
|||
return Serve.post(`/user/rechargeManualPost`, data); |
|||
} |
|||
// PayPal账号
|
|||
static paypal() { |
|||
return Serve.get(`/user/paypal`); |
|||
} |
|||
// PayPal支付记录
|
|||
static rechargeManualLog(data) { |
|||
return Serve.post(`/user/rechargeManualLog`,data); |
|||
} |
|||
// 充值记录
|
|||
static depositHistory(data) { |
|||
return Serve.post(`/user/depositHistory`,data); |
|||
} |
|||
|
|||
// 钱包划转记录
|
|||
static transferRecord() { |
|||
return Serve.post(`/user/transferRecord`); |
|||
} |
|||
// 申购记录
|
|||
static subscribeRecords() { |
|||
return Serve.post(`/user/subscribeRecords`); |
|||
} |
|||
// 个人资产管理
|
|||
static personalAssets() { |
|||
return Serve.post(`/user/personalAssets`); |
|||
} |
|||
|
|||
// 各个币种的资产
|
|||
static fundAccount(data) { |
|||
return Serve.post(`/user/fundAccount`, data); |
|||
} |
|||
|
|||
// 代币以及对应的余额
|
|||
static tokenList(data) { |
|||
return Serve.post(`/user/tokenList`, data); |
|||
} |
|||
|
|||
// 资金划转
|
|||
static fundsTransfer(data) { |
|||
return Serve.post(`/user/appFundsTransfer`, data); |
|||
} |
|||
|
|||
// 生成充值地址
|
|||
static walletImage(data) { |
|||
return Serve.post(`/user/walletImage`, data); |
|||
} |
|||
|
|||
// 提交充值
|
|||
static recharge(data) { |
|||
return Serve.post(`/user/recharge`, data); |
|||
} |
|||
|
|||
// 提交提币
|
|||
static withdraw(data) { |
|||
return Serve.post(`/user/withdraw`, data); |
|||
} |
|||
|
|||
// 提币地址管理
|
|||
static getUserWithdrawAdress(data) { |
|||
return Serve.post(`/user/withdrawalAddressManagement`, data); |
|||
} |
|||
|
|||
// 编辑提币地址
|
|||
static editUserWithdrawAdress (data) { |
|||
return Serve.post(`/user/editUserAdress`, data); |
|||
} |
|||
|
|||
// 删除提币地址
|
|||
static delUserWithdrawAdress(data) { |
|||
return Serve.post(`/user/withdrawalAddressManagement`, data); |
|||
} |
|||
|
|||
// 添加提币地址
|
|||
static addUserWithdrawAdress(data) { |
|||
return Serve.post(`/`, data); |
|||
} |
|||
|
|||
static withdrawalSelectAddress() { |
|||
return Serve.post(`/user/withdrawalSelectAddress`); |
|||
} |
|||
|
|||
static addWithdrawAddress(data) { |
|||
return Serve.post(`/user/withdrawalAddressAdd`, data); |
|||
} |
|||
|
|||
|
|||
// 查询币种余额
|
|||
static withdrawalBalance(data) { |
|||
return Serve.post(`/user/withdrawalBalance`, data); |
|||
} |
|||
|
|||
// 修改用户地址
|
|||
static withdrawalAddressModify(data) { |
|||
return Serve.post(`/user/withdrawalAddressModify`, data); |
|||
} |
|||
|
|||
// 删除币种地址
|
|||
static withdrawalAddressDeleted(data) { |
|||
return Serve.post(`/user/withdrawalAddressDeleted`, data); |
|||
} |
|||
// 资金余额
|
|||
static appTokenAssets(data){ |
|||
return Serve.post(`/user/appTokenAssets`,data) |
|||
} |
|||
// 指定币种划转记录
|
|||
static appTransferRecord(data){ |
|||
return Serve.post(`/user/appTransferRecord`,data) |
|||
} |
|||
// 指定币种提币记录
|
|||
static appWithdrawalRecord(data){ |
|||
return Serve.post(`/user/appWithdrawalRecord`,data) |
|||
} |
|||
// 指定币种提币记录
|
|||
static appDepositHistory(data){ |
|||
return Serve.post(`/user/appDepositHistory`,data) |
|||
} |
|||
// 指定币种币币记录
|
|||
static getWalletLogs(data){ |
|||
return Serve.get(`/user/getWalletLogs`,data) |
|||
} |
|||
// 生成钱包地址
|
|||
static createWalletAddress() { |
|||
return Serve.post(`/user/createWalletAddress`); |
|||
} |
|||
// 获取充币地址
|
|||
static collectionType(data) { |
|||
return Serve.post(`/user/collectionType`, data) |
|||
} |
|||
// 获取转换列表
|
|||
static accounts(data){ |
|||
return Serve.get(`/wallet/accounts`, data) |
|||
} |
|||
// 获取子账户类别
|
|||
static accountPairList(data){ |
|||
return Serve.get('/wallet/accountPairList',data) |
|||
} |
|||
// 获取转换币种列表
|
|||
static coinList(data){ |
|||
return Serve.get('/wallet/coinList',data) |
|||
} |
|||
// 获取余额
|
|||
static getBalance(data){ |
|||
return Serve.get('/wallet/getBalance',data) |
|||
} |
|||
// 资金划转
|
|||
static transfer(data){ |
|||
return Serve.post('/wallet/transfer',data) |
|||
} |
|||
// 合约资金列表
|
|||
static accountList(data){ |
|||
return Serve.get('/contract/accountList',data) |
|||
} |
|||
// 合约资金流水
|
|||
static accountFlow(data){ |
|||
return Serve.get('/contract/accountFlow',data) |
|||
} |
|||
// 合约资金流水
|
|||
static cancelWithdraw(data){ |
|||
return Serve.post('/user/cancelWithdraw',data,{loading:true}) |
|||
} |
|||
} |
|||
|
|||
export default Wallet; |
|||
@ -0,0 +1,55 @@ |
|||
|
|||
let config = {}; |
|||
if (process.env.NODE_ENV == 'production'||true) { //生产环境
|
|||
config = { |
|||
// ajax地址
|
|||
baseUrl: 'https://seee.moabcoin.com', |
|||
// 图片地址 (暂时无用)
|
|||
imgUrl: 'https://seee.moabcoin.com/storage', |
|||
// socket地址
|
|||
socketUrl: 'wss://seee.moabcoin.com/ws1', |
|||
socketUrl1: 'wss://seee.moabcoin.com/ws2', |
|||
// pc端地址
|
|||
pcUrl:'https://www.moabcoin.com/', |
|||
// app名称
|
|||
appName: 'Moabcoin', |
|||
// 版本
|
|||
version: '1.0.0', |
|||
// 移动端地址
|
|||
mobile: 'https://app.moabcoin.com/', |
|||
down:"https://app.moabcoin.com/download/Moabcoin.html" |
|||
}; |
|||
} else { //开发环境
|
|||
config = { |
|||
baseUrl: 'http://qkladmin2.ruanmeng.top', |
|||
imgUrl: 'http://qkladmin2.ruanmeng.top/upload', |
|||
socketUrl: 'ws://qkladmin2.ruanmeng.top:2346/', |
|||
socketUrl1: 'ws://qkladmin2.ruanmeng.top:2348/', |
|||
// pc端地址
|
|||
pcUrl:'http://qklhome2.ruanmeng.top', |
|||
// app名称
|
|||
appName: '本地开发', |
|||
// 版本
|
|||
version: '0.0.0', |
|||
// 移动端地址
|
|||
mobile: '' |
|||
} |
|||
// config = {
|
|||
// // ajax地址
|
|||
// baseUrl: 'https://server.7coin.in',
|
|||
// // 图片地址 (暂时无用)
|
|||
// imgUrl: 'https://server.7coin.in/upload',
|
|||
// // socket地址
|
|||
// socketUrl: 'wss://server.7coin.in:2346/',
|
|||
// socketUrl1: 'wss://server.7coin.in:2348/',
|
|||
// // pc端地址
|
|||
// pcUrl:'https://www.7coin.in',
|
|||
// // app名称
|
|||
// appName: '7COIN test',
|
|||
// // 版本
|
|||
// version: '1.0.0',
|
|||
// // 移动端地址
|
|||
// mobile: 'https://h5.7coin.in'
|
|||
// };
|
|||
} |
|||
export default config; |
|||
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 7.0 MiB |
|
After Width: | Height: | Size: 812 KiB |
|
After Width: | Height: | Size: 185 KiB |
|
After Width: | Height: | Size: 176 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1005 B |
|
After Width: | Height: | Size: 145 B |
|
After Width: | Height: | Size: 830 B |
|
After Width: | Height: | Size: 694 B |
|
After Width: | Height: | Size: 963 B |
|
After Width: | Height: | Size: 380 B |
|
After Width: | Height: | Size: 160 KiB |
|
After Width: | Height: | Size: 746 B |
|
After Width: | Height: | Size: 305 B |
|
After Width: | Height: | Size: 381 B |
|
After Width: | Height: | Size: 306 B |
|
After Width: | Height: | Size: 279 B |
|
After Width: | Height: | Size: 904 B |
|
After Width: | Height: | Size: 157 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 373 B |
|
After Width: | Height: | Size: 106 B |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 905 B |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 695 B |
|
After Width: | Height: | Size: 223 KiB |
|
After Width: | Height: | Size: 638 B |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 716 B |
|
After Width: | Height: | Size: 764 B |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 369 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 44 KiB |