Browse Source

Merge branch 'milestone-20260128-日常优化1.0' of http://39.101.133.168:8807/huangqizhen/gold-vue into milestone-20260128-日常优化1.0

milestone-20260128-日常优化1.0
zhangrenyuan 1 month ago
parent
commit
162c4b5ca0
  1. BIN
      src/assets/images/loadingFaild.png
  2. 7
      src/components/locales/lang/en.js
  3. 7
      src/components/locales/lang/zh-CN.js
  4. 5
      src/util/http.js
  5. 6
      src/views/audit/gold/rechargeAudit.vue
  6. 104
      src/views/consume/gold/addCoinConsume.vue
  7. 137
      src/views/login.vue
  8. 2
      src/views/moneyManage/executor/executor.vue
  9. 6
      src/views/moneyManage/receiveDetail/receiveHead.vue
  10. 18
      src/views/moneyManage/receiveDetail/receiveService.vue
  11. 12
      src/views/moneyManage/receiveDetail/utils/staticData.js
  12. 90
      src/views/recharge/gold/addCoinRecharge.vue

BIN
src/assets/images/loadingFaild.png

After

Width: 200  |  Height: 200  |  Size: 10 KiB

7
src/components/locales/lang/en.js

@ -185,6 +185,8 @@ export default {
// Message Group // Message Group
elmessage: { elmessage: {
// Common // Common
accountEmpty: "Account cannot be empty",
passwordEmpty: "Password cannot be empty",
checkRefundgolds: "Refund gold cannot be empty", checkRefundgolds: "Refund gold cannot be empty",
checkPermanentGold: "Permanent gold cannot be empty", checkPermanentGold: "Permanent gold cannot be empty",
loginSuccess: "Login successful", loginSuccess: "Login successful",
@ -553,6 +555,7 @@ export default {
// Add Form Fields // Add Form Fields
common_add: { common_add: {
orderStatus: "Order Status",
jwcode: "Homily ID", jwcode: "Homily ID",
jwcodePlaceholder: "Enter Homily ID", jwcodePlaceholder: "Enter Homily ID",
originalChinese: "Chinese", originalChinese: "Chinese",
@ -666,10 +669,13 @@ export default {
operationConfirm: "Confirm", operationConfirm: "Confirm",
userInfo: "User Info", userInfo: "User Info",
prompt: "Risk Alert", prompt: "Risk Alert",
promptConsume: "Risk Alert for Consume",
similarRechargeRecords: "Similar recent records detected", similarRechargeRecords: "Similar recent records detected",
similarCosumeRecords: "Similar recent consume records detected",
rechargePermanentGold: "Recharge Perm Coins", rechargePermanentGold: "Recharge Perm Coins",
buy: "Buy", buy: "Buy",
operator: "Operator", operator: "Operator",
orderStatus: "Order Status",
submitter: "Submitter", submitter: "Submitter",
continueOperation: "Continue?", continueOperation: "Continue?",
// Gold Bean // Gold Bean
@ -1089,6 +1095,7 @@ export default {
ipay88: "Ipay88", ipay88: "Ipay88",
paymentAsia: "PaymentAsia", paymentAsia: "PaymentAsia",
transfer: "E-Transfer", transfer: "E-Transfer",
paysolution:'paysolution'
}, },
statusList: { statusList: {
submitted: "Submitted", submitted: "Submitted",

7
src/components/locales/lang/zh-CN.js

@ -185,6 +185,8 @@ export default {
// 提示信息组 // 提示信息组
elmessage: { elmessage: {
// 通用 // 通用
accountEmpty: "账号不能为空",
passwordEmpty: "密码不能为空",
checkRefundgolds: "退款金币总数不能为0", checkRefundgolds: "退款金币总数不能为0",
checkPermanentGold: "永久金币不能为空", checkPermanentGold: "永久金币不能为空",
loginSuccess: "登录成功", loginSuccess: "登录成功",
@ -624,6 +626,7 @@ export default {
receiveArea: "到账地区", receiveArea: "到账地区",
receiveAreaPlaceholder: "请选择到账地区", receiveAreaPlaceholder: "请选择到账地区",
price: "原价", price: "原价",
orderStatus: "订单状态",
goodsNamePlaceholder: "请选择商品", goodsNamePlaceholder: "请选择商品",
使用红包: "使用红包", 使用红包: "使用红包",
不使用红包: "不使用红包", 不使用红包: "不使用红包",
@ -666,9 +669,12 @@ export default {
operationConfirm: "操作确认", operationConfirm: "操作确认",
userInfo: "用户信息", userInfo: "用户信息",
prompt: "重复充值风险提示", prompt: "重复充值风险提示",
promptConsume: "重复消耗风险提示",
similarRechargeRecords: "检测到该用户近期有相似充值记录", similarRechargeRecords: "检测到该用户近期有相似充值记录",
similarCosumeRecords: "检测到该用户近期有相似消耗记录",
rechargePermanentGold: "充值永久金币", rechargePermanentGold: "充值永久金币",
buy: "购买", buy: "购买",
orderStatus:'订单状态',
operator: "操作人", operator: "操作人",
submitter: "提交人", submitter: "提交人",
continueOperation: "是否继续操作?", continueOperation: "是否继续操作?",
@ -1101,6 +1107,7 @@ export default {
ipay88: "Ipay88", ipay88: "Ipay88",
paymentAsia: "PaymentAsia", paymentAsia: "PaymentAsia",
transfer: "E-Transfer", transfer: "E-Transfer",
paysolution:'paysolution'
}, },
statusList: { statusList: {
submitted: "已提交", submitted: "已提交",

5
src/util/http.js

@ -1,14 +1,15 @@
import request from './request' import request from './request'
export default function(options) { export default function(options) {
const { method = 'post', url, data = {}, params = {}, headers = {} } = options
const { method = 'post', url, data = {}, params = {}, headers = {}, responseType } = options
return request({ return request({
method, method,
url, url,
data, data,
params, params,
headers
headers,
responseType
}) })
.then(({ status, data, statusText }) => { .then(({ status, data, statusText }) => {
if (status === 200) { if (status === 200) {

6
src/views/audit/gold/rechargeAudit.vue

@ -332,15 +332,15 @@ const payModel = [
label: t('audit.payMethods.paypal') label: t('audit.payMethods.paypal')
}, },
{ {
value: 'Stripe-链接收款',
value: 'Stripe',
label: t('audit.payMethods.stripe') label: t('audit.payMethods.stripe')
}, },
{ {
value: 'Ipay88-链接收款',
value: 'Ipay88',
label: t('audit.payMethods.ipay88') label: t('audit.payMethods.ipay88')
}, },
{ {
value: 'PaymentAsia-链接收款',
value: 'PaymentAsia',
label: t('audit.payMethods.paymentAsia') label: t('audit.payMethods.paymentAsia')
}, },
{ {

104
src/views/consume/gold/addCoinConsume.vue

@ -264,11 +264,12 @@ function calculateCoins(sumGold) {
// cookie key // cookie key
const WriteCookies = ref(null) const WriteCookies = ref(null)
// cookie value // cookie value
const WriteCookiesTime = ref(null)
const WriteCookiesVale = ref({})
// cookie key // cookie key
const ReadCookies = ref(null) const ReadCookies = ref(null)
// cookie value // cookie value
const ReadCookiesTime = ref(null)
const ReadCookiesValue = ref({})
const orderStatus = ref('')
// //
@ -298,7 +299,7 @@ const add = async function () {
freeGold: addConsume.value.freeGold * 100, freeGold: addConsume.value.freeGold * 100,
taskGold: addConsume.value.taskGold * 100, taskGold: addConsume.value.taskGold * 100,
permanentGold: addConsume.value.permanentGold * 100, permanentGold: addConsume.value.permanentGold * 100,
goodsName: addConsume.value.goodsName.value,
goodsName: addConsume.value.goodsName,
remark: addConsume.value.remark, remark: addConsume.value.remark,
adminName: adminData.value.adminName, adminName: adminData.value.adminName,
redMoney: Number(addConsume.value.redMoney), // 1-使0-使 redMoney: Number(addConsume.value.redMoney), // 1-使0-使
@ -322,16 +323,13 @@ const add = async function () {
function handleResponse(result) { function handleResponse(result) {
console.log("响应结果", result) console.log("响应结果", result)
if (result.code === 200) { if (result.code === 200) {
// jwcode
// jwcode:permanentGold:freeGold
WriteCookies.value = `coinConsume:${addConsume.value.jwcode}:${addConsume.value.goodsName.value}`
//value
WriteCookiesTime.value = dayjs().format("YYYY-MM-DD HH:mm:ss");
// cookies,jwcodekeyvaluejwcode1
Cookies.set(WriteCookies.value, WriteCookiesTime.value, {
expires:
1, path: '/'
WriteCookies.value = `coinConsume:${addConsume.value.jwcode}:${addConsume.value.goodsName}`
//value
WriteCookiesVale.value = JSON.stringify({
payTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
orderCode: result.data
}); });
Cookies.set(WriteCookies.value, WriteCookiesVale.value, {expires: 1, path: '/'});
ElMessage.success(t('elmessage.addSuccess')); ElMessage.success(t('elmessage.addSuccess'));
console.log("请求成功", result); console.log("请求成功", result);
} else { } else {
@ -448,6 +446,26 @@ const FirstConsumeDialogVisibleCancel = () => {
// }); // });
// }; // };
const historyOrder = ref({})
//
const selectByOrderCode = async function (data) {
try {
const result = await request({
url: '/recharge/selectByOrderCode',
data: data,
headers: {
'Content-Type': 'text/plain;charset=utf-8'
},
})
if(result.code == 200){
historyOrder.value = result.data
}
} catch (error) {
console.log('请求失败', error)
//
}
}
// //
const addBefore = () => { const addBefore = () => {
Ref.value.validate(async (valid) => { Ref.value.validate(async (valid) => {
@ -462,14 +480,30 @@ const addBefore = () => {
if (!validateInput() || !validateRedLimit()) { if (!validateInput() || !validateRedLimit()) {
return; return;
} }
ReadCookies.value = `coinConsume:${addConsume.value.jwcode}:${addConsume.value.goodsName.value}`
ReadCookies.value = `coinConsume:${addConsume.value.jwcode}:${addConsume.value.goodsName}`
console.log('ReadCookies',ReadCookies.value);
// cookie // cookie
const cookie = Cookies.get(ReadCookies.value)
console.log("time", WriteCookiesTime.value)
//
ReadCookiesTime.value = moment(cookie).format('YYYY-MM-DD HH:mm:ss')
console.log("cookie========", cookie)
if (cookie) {
const cookieValue = Cookies.get(ReadCookies.value);
if (cookieValue) {
//
const rechargeInfo = JSON.parse(cookieValue);
console.log('充值时间:', rechargeInfo.payTime);
console.log('订单号:', rechargeInfo.orderCode);
ReadCookiesValue.value = {
...rechargeInfo,
}
}
if (Object.keys(ReadCookiesValue.value).length > 0) {
await selectByOrderCode(ReadCookiesValue.value.orderCode)
if(historyOrder.value.type == 1 ){
if(historyOrder.value.auditStatus == 1 ){
if(historyOrder.value.isRefund == 0){
orderStatus.value = '正常'
}else if(historyOrder.value.isRefund == 1){
orderStatus.value = '已退款'
}
}
}
ConsumeDialogVisible.value = true; ConsumeDialogVisible.value = true;
} else { } else {
FirstConsumeDialogVisible.value = true; FirstConsumeDialogVisible.value = true;
@ -606,16 +640,24 @@ watch(
); );
// //
watch(
() => addConsume.value.goodsName,
(newGoods) => {
const handleGoodsChange = (newGoods) => {
if (newGoods && typeof newGoods === 'object') { if (newGoods && typeof newGoods === 'object') {
addConsume.value.price = Number(newGoods.price || 0) || null; addConsume.value.price = Number(newGoods.price || 0) || null;
} else { } else {
addConsume.value.price = null; addConsume.value.price = null;
} }
} }
);
//
// watch(
// () => addConsume.value.goodsName,
// (newGoods) => {
// if (newGoods && typeof newGoods === 'object') {
// addConsume.value.price = Number(newGoods.price || 0) || null;
// } else {
// addConsume.value.price = null;
// }
// }
// );
/* /*
====================红包逻辑================================= ====================红包逻辑=================================
@ -745,7 +787,7 @@ onMounted(async function () {
<el-form-item prop="goodsName" :label="t('common_add.goodsName')"> <el-form-item prop="goodsName" :label="t('common_add.goodsName')">
<el-select v-model="addConsume.goodsName" :placeholder="t('common_add.goodsNamePlaceholder')" <el-select v-model="addConsume.goodsName" :placeholder="t('common_add.goodsNamePlaceholder')"
style="width: 200px" clearable filterable > style="width: 200px" clearable filterable >
<el-option v-for="(item, index) in goods" :key="index" :label="item.label" :value="item" />
<el-option v-for="(item, index) in goods" :key="index" :label="item.label" :value="item.value" @click="handleGoodsChange(item)" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -914,7 +956,7 @@ onMounted(async function () {
<!-- 商品名称 --> <!-- 商品名称 -->
<div class="field"> <div class="field">
<div class="field-label">{{ $t('common_add.goodsName') }}</div> <div class="field-label">{{ $t('common_add.goodsName') }}</div>
<el-input v-model="addConsume.goodsName.value" disabled />
<el-input v-model="addConsume.goodsName" disabled />
</div> </div>
<!--金币总数 --> <!--金币总数 -->
<div class="field"> <div class="field">
@ -972,7 +1014,11 @@ onMounted(async function () {
<!-- 商品名称 --> <!-- 商品名称 -->
<div class="field"> <div class="field">
<div class="field-label">{{ $t('common_add.goodsName') }}</div> <div class="field-label">{{ $t('common_add.goodsName') }}</div>
<el-input v-model="addConsume.goodsName.value" disabled />
<el-input v-model="addConsume.goodsName" disabled />
</div>
<div class="field">
<div class="field-label">{{ $t('common_add.orderStatus') }}</div>
<el-input v-model="orderStatus" disabled />
</div> </div>
<!--金币总数 --> <!--金币总数 -->
<div class="field"> <div class="field">
@ -1006,13 +1052,13 @@ onMounted(async function () {
<el-icon :size="24" color="#FFD700"> <el-icon :size="24" color="#FFD700">
<WarnTriangleFilled /> <WarnTriangleFilled />
</el-icon> </el-icon>
<p>{{ $t('common_add.prompt') }}</p>
<p>{{ $t('common_add.promptConsume') }}</p>
</div> </div>
<!-- 记录 + 虚线分隔 --> <!-- 记录 + 虚线分隔 -->
<div> <div>
<el-divider border-style="dashed" /> <el-divider border-style="dashed" />
<p>{{ $t('common_add.similarRechargeRecords') }}</p>
· {{ ReadCookiesTime }} {{ $t('common_add.buy') }} {{ addConsume.goodsName.value }}({{
<p>{{ $t('common_add.similarCosumeRecords') }}</p>
· {{ ReadCookiesValue.payTime }} {{ $t('common_add.buy') }} {{ addConsume.goodsName }}{{ $t('common_add.orderStatus') }}: {{ orderStatus }}({{
$t('common_add.operator') }}: {{ adminData.adminName }}) $t('common_add.operator') }}: {{ adminData.adminName }})
</div> </div>
<div style="margin-top: 10px"> <div style="margin-top: 10px">

137
src/views/login.vue

@ -1,5 +1,5 @@
<script setup> <script setup>
import {onMounted, ref} from 'vue'
import {onMounted, ref,onUnmounted} from 'vue'
import {ElMessage} from 'element-plus' import {ElMessage} from 'element-plus'
import request from '@/util/http' import request from '@/util/http'
import {useRouter} from 'vue-router' import {useRouter} from 'vue-router'
@ -34,7 +34,78 @@ function getMachineId() {
} }
} }
const form = ref({account: null, password: '', token: '', machineId: machineId1.value})
const form = ref({account: null, password: '', token: '', machineId: machineId1.value, captcha: '', uuid: ''})
const formRef = ref(null)
const rules = {
account: [
{ required: true, message: '请输入账号', trigger: 'blur' }
],
password: [
{ required: true, message: '请输入密码', trigger: 'blur' }
],
captcha: [
{ required: true, message: '请输入验证码', trigger: 'blur' }
]
}
const captchaUrl = ref('')
const isCaptchaCooldown = ref(false)
let captchaCooldownTimer = null
let cooldownStartTime = 0 //
const COOLDOWN_TOTAL = 5 * 1000 // 5
//
const startCaptchaCooldown = () => {
isCaptchaCooldown.value = true
cooldownStartTime = Date.now()
captchaCooldownTimer = setTimeout(() => {
isCaptchaCooldown.value = false //
cooldownStartTime = 0 //
}, COOLDOWN_TOTAL)
}
const getCaptchaRemainingSeconds = () => {
if (!isCaptchaCooldown.value || cooldownStartTime === 0) {
return 0
}
const elapsed = Date.now() - cooldownStartTime
const remainingMs = Math.max(COOLDOWN_TOTAL - elapsed, 0)
const remainingSeconds = Math.ceil(remainingMs / 1000)
return remainingSeconds
}
const clearCaptchaCooldown = () => {
if (captchaCooldownTimer) {
clearTimeout(captchaCooldownTimer)
captchaCooldownTimer = null
}
isCaptchaCooldown.value = false
cooldownStartTime = 0
}
//
const getCaptcha = async () => {
if (isCaptchaCooldown.value) {
ElMessage.warning('验证码获取太频繁,请' + getCaptchaRemainingSeconds() + '秒后再试')
return
}
try {
let uuid = Date.now()
localStorage.setItem('uuid', uuid)
const res = await request({
url: '/captcha' + '?uuid=' + uuid,
method: 'get',
responseType: 'blob',
})
if (captchaUrl.value) {
URL.revokeObjectURL(captchaUrl.value);
}
captchaUrl.value = URL.createObjectURL(res);
startCaptchaCooldown()
} catch (error) {
console.error('获取验证码失败', error)
}
}
const adminRoleId = ref(null) const adminRoleId = ref(null)
@ -42,6 +113,12 @@ const adminRoleId = ref(null)
const adminStore = useAdminStore() const adminStore = useAdminStore()
// //
const login = async function () { const login = async function () {
if (!formRef.value) return
try {
await formRef.value.validate()
} catch (err) {
return
}
if(loading.value) { if(loading.value) {
console.log('正在登录,请稍后') console.log('正在登录,请稍后')
@ -51,11 +128,15 @@ const login = async function () {
loading.value = true loading.value = true
try { try {
let params = {
...form.value,
uuid: localStorage.getItem('uuid')
}
const result = await request({ const result = await request({
url: '/admin/login', url: '/admin/login',
data: form.value
data: params
}) })
console.log('传给后端的参数', form.value)
console.log('传给后端的参数', params)
if (result.code === 200) { if (result.code === 200) {
// token // token
@ -97,6 +178,7 @@ const login = async function () {
} else { } else {
form.value.password = '' form.value.password = ''
form.value.account = '' form.value.account = ''
form.value.captcha = ''
ElMessage.error(result.msg) ElMessage.error(result.msg)
loading.value = false //loading loading.value = false //loading
} }
@ -161,16 +243,22 @@ const selectMarket = async function () {
onMounted(() => { onMounted(() => {
getMachineId() getMachineId()
getCaptcha()
})
onUnmounted(() => {
clearCaptchaCooldown()
}) })
</script> </script>
<template> <template>
<el-row class="login-page"> <el-row class="login-page">
<img :span="12" src="../assets/background.jpg" alt="logo" class="bg" fit="fit"/>
<el-col :span="12" class="bg-container">
<img src="../assets/background.jpg" alt="logo" class="bg" fit="fit"/>
</el-col>
<el-col :span="6" :offset="3" class="form"> <el-col :span="6" :offset="3" class="form">
<!-- 登录表单 --> <!-- 登录表单 -->
<el-form :model="form" size="large" autocomplete="off">
<el-form :model="form" :rules="rules" ref="formRef" size="large" autocomplete="off">
<el-form-item> <el-form-item>
<h1 style="color: #409eff">熵盾管理系统 V1.0</h1> <h1 style="color: #409eff">熵盾管理系统 V1.0</h1>
</el-form-item> </el-form-item>
@ -185,7 +273,20 @@ onMounted(() => {
required required
/> />
</el-form-item> </el-form-item>
<el-form-item class="flex"></el-form-item>
<el-form-item prop="captcha" required>
<el-row :gutter="20" style="width: 100%">
<el-col :span="16">
<el-input v-model="form.captcha" placeholder="请输入验证码" @keyup.enter="login"></el-input>
</el-col>
<el-col :span="8" style="display: flex; align-items: center; justify-content: center;">
<img v-if="captchaUrl" :src="captchaUrl" @click="getCaptcha" style="width: 100%; height: 40px; cursor: pointer; border-radius: 4px;" alt="验证码" title="点击刷新验证码" />
<div v-else @click="getCaptcha" class="failed">
<img src="@/assets/images/loadingFaild.png" >
<text>点击刷新二维码</text>
</div>
</el-col>
</el-row>
</el-form-item>
<!-- 登录按钮 --> <!-- 登录按钮 -->
<el-form-item> <el-form-item>
<button type="button" class="button" @click="login()"> <button type="button" class="button" @click="login()">
@ -205,7 +306,7 @@ onMounted(() => {
.bg { .bg {
border-radius: 0 20px 20px 0; border-radius: 0 20px 20px 0;
height: 110vh; height: 110vh;
width: 50%;
width: 100%;
object-fit: cover; object-fit: cover;
} }
@ -228,13 +329,25 @@ onMounted(() => {
.button { .button {
width: 100%; width: 100%;
margin-top: 20px;
} }
.flex {
width: 100%;
.failed{
display: flex; display: flex;
justify-content: space-between;
flex-direction: column;
align-items: center;
img{
height: 20px;
} }
text{
color: #666666;
font-size: 10px;
white-space: nowrap;
height: 20px;
display: flex;
align-items: center;
}
}
} }
/* From Uiverse.io by kamehame-ha */ /* From Uiverse.io by kamehame-ha */

2
src/views/moneyManage/executor/executor.vue

@ -451,7 +451,7 @@ const currencies = ref([
t('cash.currency.vnd'), // (VND) t('cash.currency.vnd'), // (VND)
t('cash.currency.krw') // (KRW) t('cash.currency.krw') // (KRW)
]) ])
// const channelOptions = ref(["Stripe-", "PaymentAsia-", "Ipay88-", "", "", "", "", "Grabpay", "Nets", "E-Transfer", "Paypal"])
// const channelOptions = ref(["Stripe", "PaymentAsia", "Ipay88", "", "", "", "", "Grabpay", "Nets", "E-Transfer", "Paypal"])
const channelOptions = ref([ const channelOptions = ref([
t('cash.payMethods.stripe'), t('cash.payMethods.stripe'),
t('cash.payMethods.paymentAsia'), t('cash.payMethods.paymentAsia'),

6
src/views/moneyManage/receiveDetail/receiveHead.vue

@ -754,9 +754,9 @@ const customOptions = ref([
]) ])
// - 使cash.payMethods // - 使cash.payMethods
const paytypeList = ref([ const paytypeList = ref([
t('cash.payMethods.stripe'), // Stripe-
t('cash.payMethods.paymentAsia'), // PaymentAsia-
t('cash.payMethods.ipay88'), // Ipay88-
t('cash.payMethods.stripe'), // Stripe
t('cash.payMethods.paymentAsia'), // PaymentAsia
t('cash.payMethods.ipay88'), // Ipay88
t('cash.payMethods.grabpay'), // Grabpay t('cash.payMethods.grabpay'), // Grabpay
t('cash.payMethods.nets'), // Nets t('cash.payMethods.nets'), // Nets
t('cash.payMethods.transfer'), // E-Transfer t('cash.payMethods.transfer'), // E-Transfer

18
src/views/moneyManage/receiveDetail/receiveService.vue

@ -659,6 +659,9 @@ const ifGroup = () => {
} else if (addFormData.value.payType === t('cash.payMethods.grabpay') || addFormData.value.payType === t('cash.payMethods.nets') || addFormData.value.payType === t('cash.payMethods.paypal')) { } else if (addFormData.value.payType === t('cash.payMethods.grabpay') || addFormData.value.payType === t('cash.payMethods.nets') || addFormData.value.payType === t('cash.payMethods.paypal')) {
isGroup.value = true isGroup.value = true
addFormData.value.receivedMarket = t('cash.markets.Singapore') addFormData.value.receivedMarket = t('cash.markets.Singapore')
}else if (addFormData.value.payType === t('cash.payMethods.paysolution')) {
isGroup.value = true
addFormData.value.receivedMarket = t('cash.markets.Thailand')
} else { } else {
isGroup.value = false isGroup.value = false
} }
@ -914,9 +917,9 @@ const customOptions = ref([
]) ])
// - 使cash.payMethods // - 使cash.payMethods
const paytypeOptions = ref([ const paytypeOptions = ref([
t('cash.payMethods.stripe'), // Stripe-
t('cash.payMethods.paymentAsia'), // PaymentAsia-
t('cash.payMethods.ipay88'), // Ipay88-
t('cash.payMethods.stripe'), // Stripe
t('cash.payMethods.paymentAsia'), // PaymentAsia
t('cash.payMethods.ipay88'), // Ipay88
t('cash.payMethods.grabpay'), // Grabpay t('cash.payMethods.grabpay'), // Grabpay
t('cash.payMethods.nets'), // Nets t('cash.payMethods.nets'), // Nets
t('cash.payMethods.transfer'), // E-Transfer t('cash.payMethods.transfer'), // E-Transfer
@ -924,7 +927,8 @@ const paytypeOptions = ref([
t('cash.payMethods.bankTransfer'),// t('cash.payMethods.bankTransfer'),//
t('cash.payMethods.card'), // t('cash.payMethods.card'), //
t('cash.payMethods.cash'), // t('cash.payMethods.cash'), //
t('cash.payMethods.check') //
t('cash.payMethods.check'), //
t('cash.payMethods.paysolution'), // Paysolution
]) ])
const MoneyAddressOptions = ref([ const MoneyAddressOptions = ref([
t('cash.markets.Malaysia'), // 西 t('cash.markets.Malaysia'), // 西
@ -1182,9 +1186,9 @@ const getAdminData = async () => {
// //
// - 使cash.payMethods // - 使cash.payMethods
const paytypeList = ref([ const paytypeList = ref([
t('cash.payMethods.stripe'), // Stripe-
t('cash.payMethods.paymentAsia'), // PaymentAsia-
t('cash.payMethods.ipay88'), // Ipay88-
t('cash.payMethods.stripe'), // Stripe
t('cash.payMethods.paymentAsia'), // PaymentAsia
t('cash.payMethods.ipay88'), // Ipay88
t('cash.payMethods.bankTransfer'),// t('cash.payMethods.bankTransfer'),//
t('cash.payMethods.card'), // t('cash.payMethods.card'), //
t('cash.payMethods.cash'), // t('cash.payMethods.cash'), //

12
src/views/moneyManage/receiveDetail/utils/staticData.js

@ -279,12 +279,12 @@ export const normalizeGoodsName = (name) => {
} }
export const normalizePayType = (name) => { export const normalizePayType = (name) => {
if (name == t('cash.payMethods.stripe') || name == 'Stripe' || name == 'Stripe-链接收款') {
return 'Stripe-链接收款'
} else if (name == t('cash.payMethods.ipay88') || name == 'Ipay88' || name == 'Ipay88-链接收款') {
return 'Ipay88-链接收款'
} else if (name == t('cash.payMethods.paymentAsia') || name == 'PaymentAsia' || name == 'PaymentAsia-链接收款') {
return 'PaymentAsia-链接收款'
if (name == t('cash.payMethods.stripe') || name == 'Stripe' || name == 'Stripe') {
return 'Stripe'
} else if (name == t('cash.payMethods.ipay88') || name == 'Ipay88' || name == 'Ipay88') {
return 'Ipay88'
} else if (name == t('cash.payMethods.paymentAsia') || name == 'PaymentAsia' || name == 'PaymentAsia') {
return 'PaymentAsia'
} else if (name == t('cash.payMethods.transfer') || name == 'E-Transfer') { } else if (name == t('cash.payMethods.transfer') || name == 'E-Transfer') {
return 'E-Transfer' return 'E-Transfer'
} else if (name == t('cash.payMethods.grabpay') || name == 'Grabpay') { } else if (name == t('cash.payMethods.grabpay') || name == 'Grabpay') {

90
src/views/recharge/gold/addCoinRecharge.vue

@ -77,11 +77,12 @@ const recharge = ref({
// cookie key // cookie key
const WriteCookies = ref(null) const WriteCookies = ref(null)
// cookie value // cookie value
const WriteCookiesTime = ref(null)
const WriteCookiesVale = ref(null)
// cookie key // cookie key
const ReadCookies = ref(null) const ReadCookies = ref(null)
// cookie value // cookie value
const ReadCookiesTime = ref(null)
const ReadCookiesValue = ref({})
const orderStatus = ref('')
// //
const add = async function () { const add = async function () {
try { try {
@ -107,12 +108,7 @@ const add = async function () {
console.log('开始添加充值信息', recharge.value) console.log('开始添加充值信息', recharge.value)
// jwcode // jwcode
// jwcode:permanentGold:freeGold
WriteCookies.value = `coinRecharge:${recharge.value.jwcode}:${recharge.value.permanentGold}:${recharge.value.freeGold}`
//value
WriteCookiesTime.value = recharge.value.payTime
// cookies,jwcodekeyvaluejwcode1
Cookies.set(WriteCookies.value, WriteCookiesTime.value, {expires: 1, path: '/'});
// POST // POST
addDisabled.value = true addDisabled.value = true
const result = await API({ const result = await API({
@ -120,6 +116,17 @@ const add = async function () {
data: formattedRecharge data: formattedRecharge
}) })
addDisabled.value = false addDisabled.value = false
if(result.code == 200){
// jwcode:permanentGold:freeGold
WriteCookies.value = `coinRecharge:${recharge.value.jwcode}:${recharge.value.permanentGold}:${recharge.value.freeGold}`
//value
WriteCookiesVale.value = JSON.stringify({
payTime: recharge.value.payTime,
orderCode: result.data
});
// cookies,jwcodekeyvaluejwcode1
Cookies.set(WriteCookies.value, WriteCookiesVale.value, {expires: 1, path: '/'});
}
if (result.code === 0) { if (result.code === 0) {
ElMessage.error(result.msg) ElMessage.error(result.msg)
return return
@ -187,6 +194,25 @@ const FirstRechargeDialogVisibleCancel = () => {
user.value = {} user.value = {}
}; };
const historyOrder = ref({})
//
const selectByOrderCode = async function (data) {
try {
const result = await API({
url: '/recharge/selectByOrderCode',
data: data,
headers: {
'Content-Type': 'text/plain;charset=utf-8'
},
})
if(result.code == 200){
historyOrder.value = result.data
}
} catch (error) {
console.log('请求失败', error)
//
}
}
// //
const addBefore = () => { const addBefore = () => {
// //
@ -251,14 +277,34 @@ const addBefore = () => {
// jwcode:permanentGold:freeGold // jwcode:permanentGold:freeGold
ReadCookies.value = `coinRecharge:${recharge.value.jwcode}:${recharge.value.permanentGold}:${recharge.value.freeGold}` ReadCookies.value = `coinRecharge:${recharge.value.jwcode}:${recharge.value.permanentGold}:${recharge.value.freeGold}`
console.log('ReadCookies',ReadCookies.value);
// cookie // cookie
const cookie = Cookies.get(ReadCookies.value)
console.log("time", WriteCookiesTime.value)
//
ReadCookiesTime.value = moment(cookie).format('YYYY-MM-DD HH:mm:ss')
console.log('cookie', cookie)
// cookie
if (cookie) {
const cookieValue = Cookies.get(ReadCookies.value);
if (cookieValue) {
//
const rechargeInfo = JSON.parse(cookieValue);
console.log('充值时间:', rechargeInfo.payTime);
console.log('订单号:', rechargeInfo.orderCode);
ReadCookiesValue.value = {
...rechargeInfo,
}
}
if (Object.keys(ReadCookiesValue.value).length > 0) {
await selectByOrderCode(ReadCookiesValue.value.orderCode)
if(historyOrder.value.type == 0 ){
if(historyOrder.value.auditStatus == 0){
orderStatus.value = '待审核'
}else if(historyOrder.value.auditStatus == 1){
if(historyOrder.value.isRefund == 1){
orderStatus.value = '已退款'
}else{
orderStatus.value = '已通过'
}
}else if(historyOrder.value.auditStatus == 2){
orderStatus.value = '已驳回'
}
}
RechargeDialogVisible.value = true; RechargeDialogVisible.value = true;
} else { } else {
FirstRechargeDialogVisible.value = true; FirstRechargeDialogVisible.value = true;
@ -590,15 +636,15 @@ const payModel = [
label: t('audit.payMethods.paypal') label: t('audit.payMethods.paypal')
}, },
{ {
value: 'Stripe-链接收款',
value: 'Stripe',
label: t('audit.payMethods.stripe') label: t('audit.payMethods.stripe')
}, },
{ {
value: 'Ipay88-链接收款',
value: 'Ipay88',
label: t('audit.payMethods.ipay88') label: t('audit.payMethods.ipay88')
}, },
{ {
value: 'PaymentAsia-链接收款',
value: 'PaymentAsia',
label: t('audit.payMethods.paymentAsia') label: t('audit.payMethods.paymentAsia')
}, },
{ {
@ -845,6 +891,10 @@ onMounted(() => {
<div class="field-label">{{ $t('common_add.activity') }}</div> <div class="field-label">{{ $t('common_add.activity') }}</div>
<el-input v-model="recharge.activity" disabled/> <el-input v-model="recharge.activity" disabled/>
</div> </div>
<div class="field">
<div class="field-label">{{ $t('common_add.orderStatus') }}</div>
<el-input v-model="orderStatus" disabled/>
</div>
<!-- 金币信息同一行左右排列 --> <!-- 金币信息同一行左右排列 -->
<el-row :gutter="20" class="coins-row"> <el-row :gutter="20" class="coins-row">
<el-col :span="12"> <el-col :span="12">
@ -871,8 +921,8 @@ onMounted(() => {
<div> <div>
<el-divider border-style="dashed"/> <el-divider border-style="dashed"/>
<p>{{ $t('common_add.similarRechargeRecords') }}</p> <p>{{ $t('common_add.similarRechargeRecords') }}</p>
· {{ ReadCookiesTime }} {{ $t('common_add.rechargePermanentGold') }}: {{ recharge.permanentGold }}
{{ $t('common_add.freeGold') }}: {{ recharge.freeGold }}({{ $t('common_add.operator') }}{{ adminData.adminName }})
· {{ moment(ReadCookiesValue.payTime).format('YYYY-MM-DD HH:mm:ss') }} {{ $t('common_add.rechargePermanentGold') }}: {{ recharge.permanentGold }}
{{ $t('common_add.freeGold') }}: {{ recharge.freeGold }} {{ $t('common_add.orderStatus')}}: {{ orderStatus }}({{ $t('common_add.operator') }}{{ adminData.adminName }})
</div> </div>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<p>{{ $t('common_add.continueOperation') }}</p> <p>{{ $t('common_add.continueOperation') }}</p>

Loading…
Cancel
Save