From 44ac8d6c161e8f8c28e40af9a0e290f001a20442 Mon Sep 17 00:00:00 2001 From: j1ack <1209452658@qq.com> Date: Tue, 27 Jun 2023 14:14:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/form.js | 248 +++++ src/main.js | 55 +- src/utils/ruoyi.js | 50 + src/views/otc/otcFinance/index.vue | 230 +++++ src/views/otc/otcStore/index.vue | 936 ++++++++++++++++++ .../otcStore/pkCouponScopeRangeStoreList.vue | 357 +++++++ src/views/otc/otcStoreRechargeOrder/index.vue | 353 +++++++ vue.config.js | 2 +- 8 files changed, 2227 insertions(+), 4 deletions(-) create mode 100644 src/api/form.js create mode 100644 src/views/otc/otcFinance/index.vue create mode 100644 src/views/otc/otcStore/index.vue create mode 100644 src/views/otc/otcStore/pkCouponScopeRangeStoreList.vue create mode 100644 src/views/otc/otcStoreRechargeOrder/index.vue diff --git a/src/api/form.js b/src/api/form.js new file mode 100644 index 0000000..a479b38 --- /dev/null +++ b/src/api/form.js @@ -0,0 +1,248 @@ +import request from '@/utils/request' +import qs from 'qs' +import { + getToken +} from "@/utils/auth"; +/** + * + * @returns + * 通用数据 - 接口 + * start + * + */ +export const common_api = { + //获取所有商户 + allmerchant: (query) => { + return request({ + url: '/paytest/allmerchant', + method: 'get', + params: query, + }) + }, +} + + +/** + * 商户模块 + */ +export const payMerchant = { + // 商户列表 + listInfo: (query) => { + return request({ + url: '/merchant/merchant/list', + method: 'get', + params: query, + }) + }, + //新增 + addInfo: (data) => { + return request({ + url: '/merchant/merchant', + method: 'post', + data: data + }) + }, + //修改 + updateInfo: (data) => { + return request({ + url: '/merchant/merchant', + method: 'put', + data: data + }) + }, + // 获取商户详细信息 + getInfo: (id) => { + return request({ + url: '/merchant/merchant/' + id, + method: 'get', + }) + }, + // 获取费率 + getRate: (id) => { + return request({ + url: '/merchant/merchant/getRate/' + id, + method: 'get', + }) + }, + // 获取风控 + getMerchantWindControl: (id) => { + return request({ + url: '/merchant/merchant/getMerchantWindControl/' + id, + method: 'get', + }) + }, + // 删除商户 + merchantdel: (data) => { + return request({ + url: '/merchant/merchant/del?' + qs.stringify(data), + method: 'post', + }) + }, + // 获取通道 + getChannelList: (id) => { + return request({ + url: '/merchant/merchant/getChannel/' + id, + method: 'get', + }) + }, + // 获取提现配置 + getWithdrawConfig: (id) => { + return request({ + url: '/merchant/merchant/getWithdrawConfig/' + id, + method: 'get', + }) + }, + // 获取商户MD5 + getmd5Key: (id) => { + return request({ + url: '/merchant/merchant/getmd5Key/' + id, + method: 'get', + }) + }, + // 谷歌密钥 + getKey: (id) => { + return request({ + url: '/merchant/merchant/getGoogleSecret/' + id, + method: 'get', + }) + }, + // 重置md5 + resetMd5Key: (id) => { + return request({ + url: '/merchant/merchant/resetMd5Key/' + id, + method: 'PUT', + }) + }, + // 重置谷歌key + resetGoogleSecret: (id) => { + return request({ + url: '/merchant/merchant/resetGoogleSecret/' + id, + method: 'PUT', + }) + }, + // 登录ip + getLoginIp: (id) => { + return request({ + url: '/merchant/merchant/getIpWhite/' + id, + method: 'get', + }) + }, + // 重置登录ip + resetIpWhite: (data) => { + return request({ + url: '/merchant/merchant/resetIpWhite?' + qs.stringify(data), + method: 'post', + }) + }, + // 修改费率 + setRate: (data) => { + return request({ + url: '/merchant/merchant/setRate', + method: 'put', + data: data + }) + }, + // 重置商户风控信息 + resetMerchantWindControl: (data) => { + return request({ + url: '/merchant/merchant/resetMerchantWindControl', + method: 'put', + data: data + }) + }, + // 支付ip + getPayIp: (id) => { + return request({ + url: '/merchant/merchant/getPayapiWhitelistIp/' + id, + method: 'get', + }) + }, + // 重置支付ip + resetPayapiWhitelistIp: (data) => { + return request({ + url: '/merchant/merchant/resetPayapiWhitelistIp?' + qs.stringify(data), + method: 'post', + }) + }, + // 操作金额 + operatingBalance: (data) => { + return request({ + url: '/merchant/merchant/operatingBalance?' + qs.stringify(data), + method: 'post', + }) + }, + // 修改商户登录密码 + editLoginPwd: (data) => { + return request({ + url: '/merchant/merchant/editLoginPwd?' + qs.stringify(data), + method: 'post', + }) + }, + // 修改商户支付密码 + editPayPwd: (data) => { + return request({ + url: '/merchant/merchant/editPayPwd?' + qs.stringify(data), + method: 'post', + }) + }, +} + + +/** + * 商户充值订单模块 + */ +export const payRecordRecharge = { + // 手工处理 + payHandle: (data) => { + return request({ + url: '/order/RechargeRecord/payHandle?' + qs.stringify(data), + method: 'post', + }) + }, + // 查询充值记录列表 + listInfo: (query) => { + return request({ + url: '/order/RechargeRecord/list', + method: 'get', + params: query, + }) + }, + // 拉单测试 + recharge: (query) => { + return request({ + url: '/paytest/recharge', + method: 'get', + params: query, + }) + }, + // 导出充值记录列表 + exportList: (query) => { + return request({ + url: '/order/RechargeRecord/export', + method: 'get', + params: query, + }) + }, +} + +/** + * 财务流水 + */ + export const merchantWalletLog = { + // 查询财务流水列表 + listInfo: (query) => { + return request({ + url: '/merchant/MerchantWalletLog/list', + method: 'get', + params: query, + }) + }, + // 导出财务流水 + exportList: (query) => { + return request({ + url: '/merchant/MerchantWalletLog/export', + method: 'get', + params: query, + }) + }, + } \ No newline at end of file diff --git a/src/main.js b/src/main.js index 248a305..ad4e39a 100644 --- a/src/main.js +++ b/src/main.js @@ -12,13 +12,13 @@ import store from './store' import router from './router' import directive from './directive' // directive import plugins from './plugins' // plugins -import { download } from '@/utils/request' +// import { download } from '@/utils/request' import './assets/icons' // icon import './permission' // permission control import { getDicts } from "@/api/system/dict/data"; import { getConfigKey } from "@/api/system/config"; -import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"; +import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree,addSESDateRange,download } from "@/utils/ruoyi"; // 分页组件 import Pagination from "@/components/Pagination"; // 自定义表格工具组件 @@ -37,8 +37,8 @@ import DictTag from '@/components/DictTag' import VueMeta from 'vue-meta' // 字典数据组件 import DictData from '@/components/DictData' - // 全局方法挂载 +Vue.prototype.addSESDateRange = addSESDateRange Vue.prototype.getDicts = getDicts Vue.prototype.getConfigKey = getConfigKey Vue.prototype.parseTime = parseTime @@ -69,6 +69,55 @@ Vue.use(plugins) Vue.use(VueMeta) DictData.install() +// 精度计算乘法 +Vue.prototype.NumberMul = function (arg1, arg2) { + var m = 0; + var s1 = arg1.toString(); + var s2 = arg2.toString(); + try { + m += s1.split(".")[1].length; + } catch (e) {} + try { + m += s2.split(".")[1].length; + } catch (e) {} + + return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m); +} +// 精度计算除法 +// 除数,被除数, 保留的小数点后的位数 +Vue.prototype.NumberDiv = function (arg1, arg2) { + arg1 = parseFloat(arg1); + arg2 = parseFloat(arg2); + var t1 = 0, + t2 = 0, + r1, r2; + try { + t1 = arg1.toString().split(".")[1].length; + } catch (e) {} + try { + t2 = arg2.toString().split(".")[1].length; + } catch (e) {} + r1 = Number(arg1.toString().replace(".", "")); + r2 = Number(arg2.toString().replace(".", "")); + return this.Mul(r1 / r2, Math.pow(10, t2 - t1)); +} + +Vue.prototype.Mul = function (arg1, arg2) { + arg1 = parseFloat(arg1); + arg2 = parseFloat(arg2); + var m = 0, + s1 = arg1.toString(), + s2 = arg2.toString(); + try { + m += s1.split(".")[1].length + } catch (e) {} + try { + m += s2.split(".")[1].length + } catch (e) {} + return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m); +} + + /** * If you don't want to use mock-server * you want to use MockJs for mock api diff --git a/src/utils/ruoyi.js b/src/utils/ruoyi.js index f560f86..04cffac 100644 --- a/src/utils/ruoyi.js +++ b/src/utils/ruoyi.js @@ -4,6 +4,7 @@ * 通用js方法封装处理 * Copyright (c) 2019 ruoyi */ + const baseURL = process.env.VUE_APP_BASE_API // 日期格式化 export function parseTime(time, pattern) { @@ -68,6 +69,55 @@ export function addDateRange(params, dateRange, propName) { return search; } +// 添加日期范围 +export function addSESDateRange(params, dateRange, propName) { + var search = params + search.beginTime = null + search.endTime = null + search.updateBeginTime = null + search.updateEndTime = null + if (propName) { + if (dateRange[0]) { + if (dateRange[0][0] && dateRange[0][1]) { + search.beginTime = dateRange[0][0] + search.endTime = dateRange[0][1] + } else if (!dateRange[0][0]) { + search.beginTime = undefined + search.endTime = undefined + } + } + if (dateRange[1]) { + if (dateRange[1][0] && dateRange[1][1]) { + search.updateBeginTime = dateRange[1][0] + search.updateEndTime = dateRange[1][1] + } else if (!dateRange[1][0]) { + search.updateBeginTime = undefined + search.updateEndTime = undefined + } + } + } + if (!propName) { + if (null != dateRange && '' != dateRange) { + // search.beginTime = dateRange[0]; + // search.endTime = dateRange[1]; + if (dateRange[0] && dateRange[1]) { + search.beginTime = dateRange[0] + search.endTime = dateRange[1] + } else if (!dateRange[0]) { + search.beginTime = undefined + search.endTime = undefined + } + } + } + + return search +} + +// 通用下载方法 +export function download(fileName) { + window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true; +} + // 回显数据字典 export function selectDictLabel(datas, value) { if (value === undefined) { diff --git a/src/views/otc/otcFinance/index.vue b/src/views/otc/otcFinance/index.vue new file mode 100644 index 0000000..7c00eb3 --- /dev/null +++ b/src/views/otc/otcFinance/index.vue @@ -0,0 +1,230 @@ + + + + \ No newline at end of file diff --git a/src/views/otc/otcStore/index.vue b/src/views/otc/otcStore/index.vue new file mode 100644 index 0000000..d8605f6 --- /dev/null +++ b/src/views/otc/otcStore/index.vue @@ -0,0 +1,936 @@ + + + + + \ No newline at end of file diff --git a/src/views/otc/otcStore/pkCouponScopeRangeStoreList.vue b/src/views/otc/otcStore/pkCouponScopeRangeStoreList.vue new file mode 100644 index 0000000..2cf5930 --- /dev/null +++ b/src/views/otc/otcStore/pkCouponScopeRangeStoreList.vue @@ -0,0 +1,357 @@ + + + + + diff --git a/src/views/otc/otcStoreRechargeOrder/index.vue b/src/views/otc/otcStoreRechargeOrder/index.vue new file mode 100644 index 0000000..cf08f63 --- /dev/null +++ b/src/views/otc/otcStoreRechargeOrder/index.vue @@ -0,0 +1,353 @@ + + + + \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index b15fe85..bb8f2f6 100644 --- a/vue.config.js +++ b/vue.config.js @@ -35,7 +35,7 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - target: `http://192.168.31.236:5500`, + target: `http://bitcopay-admin.weirui0755.com/stage-api`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: ''