Commit 0a853e98 by GiottoMaster

update

parent 803a21a9
......@@ -75,7 +75,19 @@
</div>
<div class="register_operateBtn__12YnF register_deleteBtn__2EnTW" style="opacity: 0"></div>
</div>
<div class="code_wrap">
<div class="register_inputGroup__2VkRD">
<div class="register_inputIcon__2arpa register_passwordIcon__18fIi"></div>
<div class="register_inputMain__3Ur5m"><input :placeholder="$t('main.login.placeholder11')" v-model="registerInfo.code" maxlength="32" data-inputtype="register" class="register_input__1ukwi" type="password" autocomplete="off" /></div>
</div>
<div class="button" :class="{ send: isSend || sendLoading }" @click="sendCode">
<span v-if="sendLoading"><van-loading type="spinner" size="20" /></span>
<span v-else-if="!isSend">{{ $t('main.login.label7') }}</span>
<span v-else>
<van-count-down :time="countTime" format="ss" @finish="countFinish"></van-count-down>
</span>
</div>
</div>
<div class="register_inputGroup__2VkRD">
<div class="register_inputIcon__2arpa register_passwordIcon__18fIi"></div>
<div class="register_inputMain__3Ur5m"><input :placeholder="$t('main.login.placeholder5')" v-model="registerInfo.password" maxlength="32" data-inputtype="register" class="register_input__1ukwi" type="password" autocomplete="off" /></div>
......@@ -197,7 +209,6 @@
</div>
</template>
<script>
import { registerApi } from '@/http/index'
export default {
name: 'login',
data() {
......@@ -212,6 +223,9 @@ export default {
psw3: true,
pid: '',
saveAccount: false,
sendLoading: false,
isSend: false,
countTime: 0,
};
},
created() {
......@@ -232,6 +246,30 @@ export default {
}
},
methods: {
async sendCode() {
let info = this.registerInfo;
if (!info.name || info.name.length < 6) {
this.$parent.showTost(0, this.$t('main.login.toast1'));
return;
}
if (this.isSend || this.sendLoading) {
return
}
this.sendLoading = true
const res = await this.$apiFun.registerCodeApi({ phone: this.registerInfo.name })
if (res.code === 200) {
this.sendLoading = false
this.isSend = true
this.countTime = 120 * 1000
this.$parent.showTost(0, this.$t('main.login.label8'));
} else {
this.sendLoading = false
this.isSend = true
}
},
countFinish() {
this.isSend = false
},
handleSaveAccount() {
this.saveAccount = !this.saveAccount
},
......@@ -457,4 +495,32 @@ export default {
background-repeat: no-repeat;
background-size: 100% 100%;
}
.code_wrap {
margin-bottom: 0.2rem;
display: flex;
align-items: center;
gap: .2rem;
.register_inputGroup__2VkRD {
width: 3.9rem !important;
margin-bottom: 0 !important;
}
.send {
background: #a57766 !important;
}
.button {
background: #cf866b;
height: 0.9rem;
border-radius: .45rem;
flex: 1;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
font-size: .27rem;
}
.van-count-down {
color: #fff;
}
}
</style>
......@@ -6,7 +6,7 @@
<!-- 存款方式选择 -->
<div class="typelis">
<div :class="pay_way == 'bank' ? ' tyls atc' : 'tyls'" @click="changPayway('bank')" v-if="payWayList.card == 1"><img src="/static/image/trans_logo11.png" alt="" />{{ $t('main.recharge.label1') }}</div>
<div :class="pay_way == 'bank2' ? ' tyls atc' : 'tyls'" @click="changPayway('bank2')" v-if="payWayList.bank == 1"><img src="/static/image/bank.ico" alt="" />TOPPAY</div>
<div :class="pay_way == 'bank3' ? ' tyls atc' : 'tyls'" @click="changPayway('bank3')" v-if="payWayList.bank == 1"><img src="/static/image/bank.ico" alt="" />TOPPAY</div>
<div :class="pay_way == 'usdt' ? ' tyls atc' : 'tyls'" @click="changPayway('usdt')" v-if="payWayList.usdt == 1"><img src="/static/image/1595237922936176.png" alt="" />USDT</div>
<!-- <div :class="pay_way == 'wechat' ? ' tyls atc' : 'tyls'" @click="changPayway('wechat')" v-if="payWayList.wechat == 1"><img src="/static/image/QuickWechat.png" alt="" />{{ $t('main.recharge.label2') }}</div>
<div :class="pay_way == 'alipay' ? ' tyls atc' : 'tyls'" @click="changPayway('alipay')" v-if="payWayList.alipay == 1"><img src="/static/image/icoAlipay2@3x.png" alt="" />{{ $t('main.recharge.label3') }}</div> -->
......@@ -134,6 +134,28 @@
</div>
</div>
<div v-if="pay_way == 'bank3'">
<div class="usrse">
<div style="height: 0.2rem; background: #f8f8f8; width: 100wh"></div>
<div style="height: 0.2rem; background: #f8f8f8; width: 100wh"></div>
<div class="hgs">
<div class="nams">{{ $t('main.recharge.label14') }}</div>
<div style="border-bottom: 1px solid #f2f2f2">
<van-cell-group>
<van-field label="THB" v-model="bank3Params.amount" type="text" ::placeholder="`$t'(main.recharge.placeholder5') ${min_price} - ${max_price}`">
<template #button> <span style="color: #000"> {{ $t('main.recharge.label15') }}</span> </template>
</van-field>
</van-cell-group>
</div>
<div class="lasthg"></div>
</div>
<div style="height: 0.2rem; background: #f8f8f8; width: 100wh"></div>
</div>
</div>
<div v-if="pay_way == 'usdt'">
<div class="tipsh">
<div class="tops">{{ $t('main.recharge.label16') }} </div>
......@@ -266,6 +288,30 @@
<div class="content">{{ $t('main.recharge.tips2') }}</div>
<div class="content">{{ $t('main.recharge.tips3') }}</div>
</van-popup>
<!-- 支付页面 iframe 弹窗 -->
<van-popup v-model="paymentPopupShow" :style="{ width: '100%', height: '100%' }" class="payment-popup">
<div class="payment-header">
<van-nav-bar
:title="$t('main.recharge.title')"
left-arrow
@click-left="closePaymentPopup"
:style="{ background: '#ede9e7' }"
/>
</div>
<div class="payment-content">
<iframe
v-if="paymentUrl"
:src="paymentUrl"
frameborder="0"
class="payment-iframe"
@load="onIframeLoad"
></iframe>
<div v-if="iframeLoading" class="iframe-loading">
<van-loading type="spinner" size="24px">{{ $t('foot.loading') }}...</van-loading>
</div>
</div>
</van-popup>
</div>
</template>
<script>
......@@ -285,7 +331,8 @@ export default {
payWayList: {
card: 1,
usdt: 1,
bank: 1
bank: 1,
bank2: 1
},
show: false,
userbank: [],
......@@ -307,7 +354,14 @@ export default {
pay_user_card_no: '',
bank_symbol: '',
pay_username: ''
}
},
bank3Params: {
amount: ''
},
// 支付弹窗相关
paymentPopupShow: false,
paymentUrl: '',
iframeLoading: false
};
},
created() {
......@@ -352,7 +406,11 @@ export default {
const res = await this.$apiFun.post('api/toppay/submit', this.bank2Params)
if(res.code == '200') {
this.hideLoading()
window.open(res.data.pay_url)
// 使用 iframe 弹窗代替 window.open
this.paymentUrl = res.data.pay_url
this.paymentPopupShow = true
this.iframeLoading = true
// 清空表单数据
this.bank2Params.amount = ''
this.bank2Params.pay_username = ''
this.bank2Params.pay_user_card_no = ''
......@@ -361,6 +419,43 @@ export default {
this.showTost(0, res.message || this.$t('main.recharge.toast10')); // 提交失败,请重试
}
},
async bank3Submit() {
// 验证输入内容不能为空
if (!this.bank3Params.amount || this.bank3Params.amount <= 0) {
this.showTost(0, this.$t('main.recharge.toast7')); // 请输入存款金额
return;
}
this.showLoading()
const res = await this.$apiFun.post('api/toppay-dx/submit', this.bank3Params)
if(res.code == '200') {
this.hideLoading()
// 使用 iframe 弹窗代替 window.open
this.paymentUrl = res.data.pay_url
this.paymentPopupShow = true
this.iframeLoading = true
// 清空表单数据
this.bank3Params.amount = ''
} else {
this.hideLoading()
this.showTost(0, res.message || this.$t('main.recharge.toast10')); // 提交失败,请重试
}
},
// 关闭支付弹窗
closePaymentPopup() {
this.paymentPopupShow = false
this.paymentUrl = ''
this.iframeLoading = false
// 可以在这里添加支付完成后的逻辑,比如刷新余额或跳转到记录页面
this.showTost(1, this.$t('main.recharge.toast11'))
},
// iframe 加载完成
onIframeLoad() {
this.iframeLoading = false
},
async getUsdtList() {
this.showLoading()
const res = await this.$apiFun.post('api/getpaycode',{type: this.usdtType})
......@@ -480,6 +575,9 @@ export default {
if(this.pay_way == 'bank2') {
this.bank2Submit()
return
}else if(this.pay_way == 'bank3') {
this.bank3Submit()
return
}
// bank 情况下 bank bank_address bank_no bank_owner
......@@ -875,6 +973,37 @@ export default {
}
}
/* 支付弹窗样式 */
.payment-popup {
.payment-header {
position: sticky;
top: 0;
z-index: 1000;
}
.payment-content {
height: calc(100vh - 46px);
position: relative;
.payment-iframe {
width: 100%;
height: 100%;
border: none;
}
.iframe-loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
}
}
}
</style>
<style >
......
......@@ -38,6 +38,10 @@ import https from './http.js';
}
return https.post('/api/v2/register', params)
}
apiFun.registerCodeApi = function(params) {
return https.post('/api/sendsms', params)
}
//暴露出这个对象
......
......@@ -325,6 +325,8 @@ export const main = {
label4: '返回登录',
label5: '注册',
label6: '记住账号/密码',
label7: '获取',
label8: '已发送',
placeholder1: '用户名',
placeholder2: '密码',
placeholder3: '验证码',
......@@ -335,7 +337,8 @@ export const main = {
placeholder8: '支付密码',
placeholder9: '验证码',
placeholder10: '邀请码',
toast1: '用户名长度6~16位,以字母或数字组合!',
placeholder11: '短信验证码',
toast1: '请输入您的手机号码',
toast2: '请输入正确的密码长度,最少6位!',
toast3: '两次密码不一致!',
toast4: '请输入您的真实姓名!',
......@@ -467,6 +470,7 @@ export const main = {
toast8: '请输入正确的银行卡号',
toast9: '请输入正确的姓名格式',
toast10: '提交失败,请重试',
toast11: '支付窗口已关闭,如已完成支付请查看交易记录',
other1: '钱包地址',
other2: '备注',
other3: '请输入备注',
......
......@@ -462,6 +462,11 @@ export const main = {
toast4: 'Please enter the bank address where you opened an account',
toast5: 'Submit successfully, waiting for background review',
toast6: 'Copy successfully!',
toast7: 'Please enter the deposit amount',
toast8: 'Please enter a valid bank card number',
toast9: 'Please enter a valid name format (no numbers or special characters)',
toast10: 'Submission failed, please try again',
toast11: 'Payment window closed. If payment is completed, please check transaction records',
other1: 'Wallet address',
other2: 'Remarks',
other3: 'Please enter remarks',
......@@ -533,7 +538,17 @@ export const main = {
label22: 'Revoked',
label23: 'Cancelled',
label24: 'Recharge record',
label25: 'Withdrawal record'
label25: 'Withdrawal record',
state1: 'Undefined',
state2: 'Pending review',
state3: 'Review passed',
state4: 'Review rejected',
state5: 'Cancelled',
state11: 'Pending payment',
state22: 'Payment successful',
state33: 'Payment failed',
nav1: 'Offline recharge',
nav2: 'Online recharge'
},
usdtmore: {
......
......@@ -321,6 +321,8 @@ export const main = {
label4: 'กลับไปหน้าเข้าสู่ระบบ',
label5: 'ลงทะเบียน',
label6: 'จดจำบัญชีผู้ใช้/รหัสผ่าน',
label7: 'รับ',
label8: 'ส่ง',
placeholder1: 'ชื่อผู้ใช้',
placeholder2: 'รหัสผ่าน',
placeholder3: 'รหัสยืนยัน',
......@@ -331,7 +333,8 @@ export const main = {
placeholder8: 'รหัสชำระเงิน',
placeholder9: 'รหัสยืนยัน',
placeholder10: 'รหัสเชิญ',
toast1: 'ชื่อผู้ใช้ต้องมีความยาว 6-16 ตัวอักษร และประกอบด้วยตัวอักษรหรือตัวเลขเท่านั้น',
placeholder11: 'รหัสยืนยันทาง SMS',
toast1: 'กรุณากรอกหมายเลขโทรศัพท์มือถือของคุณ',
toast2: 'กรุณากรอกรหัสผ่านให้ถูกต้อง อย่างน้อย 6 ตัวอักษร',
toast3: 'รหัสผ่านไม่ตรงกัน',
toast4: 'กรุณากรอกชื่อ-นามสกุลจริง',
......@@ -463,6 +466,7 @@ export const main = {
toast8: 'กรุณากรอกหมายเลขบัญชีธนาคารให้ถูกต้อง',
toast9: 'กรุณากรอกชื่อให้ถูกต้อง (ไม่ควรมีตัวเลขหรือสัญลักษณ์พิเศษ)',
toast10: 'การส่งข้อมูลล้มเหลว กรุณาลองใหม่อีกครั้ง',
toast11: 'หน้าต่างชำระเงินถูกปิด หากชำระเงินเสร็จแล้ว กรุณาตรวจสอบประวัติการทำรายการ',
other1: 'ที่อยู่กระเป๋าเงิน',
other2: 'หมายเหตุ',
other3: 'กรุณากรอกหมายเหตุ',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment