feat(充值页面): 取消给任何用户充值,更改为只为自己充值,删除上一个搜索页面
This commit is contained in:
parent
7a2c79d717
commit
bcd41d133a
Binary file not shown.
|
Before Width: | Height: | Size: 581 KiB |
@ -158,12 +158,6 @@ const router = createRouter({
|
|||||||
{
|
{
|
||||||
path: '/recharge',
|
path: '/recharge',
|
||||||
name: 'recharge',
|
name: 'recharge',
|
||||||
component: () => import('../views/Recharge/Recharge.vue'),
|
|
||||||
meta: { requiresAuth: true },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/recharge-freight-agent',
|
|
||||||
name: 'recharge-freight-agent',
|
|
||||||
component: () => import('../views/Recharge/RechargeFreightAgent.vue'),
|
component: () => import('../views/Recharge/RechargeFreightAgent.vue'),
|
||||||
meta: { requiresAuth: true },
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
export const useCountryStore = defineStore("country", {
|
export const useCountryStore = defineStore('country', {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
list: [],
|
list: [], //国家列表
|
||||||
selectedCountry: {},
|
selectedCountry: {}, //选中的国家
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
setCountryList(data) {
|
setCountryList(data) {
|
||||||
this.list = data;
|
this.list = data
|
||||||
},
|
},
|
||||||
setCountry(country) {
|
setCountry(country) {
|
||||||
this.selectedCountry = country;
|
this.selectedCountry = country
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
|
|||||||
@ -76,7 +76,6 @@ export const ROLE_PERMISSIONS = {
|
|||||||
...RANKING_PAGES, //排行榜
|
...RANKING_PAGES, //排行榜
|
||||||
...ACTIVITIES, //活动页面
|
...ACTIVITIES, //活动页面
|
||||||
'/recharge',
|
'/recharge',
|
||||||
'/recharge-freight-agent',
|
|
||||||
'/recharge-agency-recruit', //充值代理介绍页面
|
'/recharge-agency-recruit', //充值代理介绍页面
|
||||||
'/search-payee', //搜索收款人
|
'/search-payee', //搜索收款人
|
||||||
'/cash-out', // 提现页面
|
'/cash-out', // 提现页面
|
||||||
@ -128,7 +127,6 @@ export const ROLE_PERMISSIONS = {
|
|||||||
PAGES.COIN_SELLER, // 主页面
|
PAGES.COIN_SELLER, // 主页面
|
||||||
'/seller-records',
|
'/seller-records',
|
||||||
'/coin-seller-search',
|
'/coin-seller-search',
|
||||||
'/recharge-freight-agent',
|
|
||||||
],
|
],
|
||||||
|
|
||||||
// Agency (代理商)
|
// Agency (代理商)
|
||||||
|
|||||||
@ -424,7 +424,6 @@ class RouteGuard {
|
|||||||
'/404', // 404页面
|
'/404', // 404页面
|
||||||
'/error', // 通用错误页面
|
'/error', // 通用错误页面
|
||||||
'/recharge',
|
'/recharge',
|
||||||
'/recharge-freight-agent',
|
|
||||||
'/recharge-agency-recruit', //充值代理介绍页面
|
'/recharge-agency-recruit', //充值代理介绍页面
|
||||||
'/pay-result',
|
'/pay-result',
|
||||||
'/search-payee', //搜索收款人
|
'/search-payee', //搜索收款人
|
||||||
|
|||||||
@ -1,223 +0,0 @@
|
|||||||
<!-- Recharge.vue -->
|
|
||||||
<template>
|
|
||||||
<div class="fullPage">
|
|
||||||
<div class="bg">
|
|
||||||
<!-- 顶部 -->
|
|
||||||
<MobileHeader title="Recharge" showHelp="true" isHomePage="true" @help="popupHelp" />
|
|
||||||
|
|
||||||
<!-- 内容 -->
|
|
||||||
<div style="padding: 4%">
|
|
||||||
<!-- 输入框 -->
|
|
||||||
<div style="display: flex; gap: 20px; width: 100%">
|
|
||||||
<div style="flex: 1">
|
|
||||||
<input
|
|
||||||
style="
|
|
||||||
width: 100%;
|
|
||||||
border: 0;
|
|
||||||
border-radius: 8px;
|
|
||||||
box-shadow: 0 0 2px 2px #00000020;
|
|
||||||
padding: 10px 8px;
|
|
||||||
"
|
|
||||||
type="text"
|
|
||||||
placeholder="Please enter your Likei's lD"
|
|
||||||
v-model="targetUserId"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button
|
|
||||||
style="
|
|
||||||
border: 0;
|
|
||||||
border-radius: 8px;
|
|
||||||
font-weight: 590;
|
|
||||||
color: white;
|
|
||||||
padding: 10px 8px;
|
|
||||||
background-color: #c670ff;
|
|
||||||
background: linear-gradient(to bottom, rgba(198, 112, 255, 1), rgba(119, 38, 255, 1));
|
|
||||||
box-shadow: 0 0 1px 1px #00000020;
|
|
||||||
"
|
|
||||||
@click="checkUserId"
|
|
||||||
>
|
|
||||||
Recharge
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 功能介绍 -->
|
|
||||||
<div style="margin-top: 16px">
|
|
||||||
<p style="font-weight: bold">Frequently asked question:</p>
|
|
||||||
<div class="textContent">
|
|
||||||
<p>1.Question:</p>
|
|
||||||
<p>How to check whether the account recharge amounthasbeen received.</p>
|
|
||||||
<p>Ask:</p>
|
|
||||||
<p>
|
|
||||||
Firstly, open Likei, enter the 'My' page, click on theWallet' page, and select the
|
|
||||||
recharge record in theupper right corner.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 弹窗 -->
|
|
||||||
<!-- 遮罩层 -->
|
|
||||||
<div
|
|
||||||
style="
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
z-index: 9999;
|
|
||||||
background-color: #00000080;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
"
|
|
||||||
v-show="dialogshow"
|
|
||||||
@click="closedPopup"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style="
|
|
||||||
width: 80%;
|
|
||||||
padding: 8%;
|
|
||||||
background-color: white;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
border-radius: 20px;
|
|
||||||
"
|
|
||||||
@click.stop
|
|
||||||
>
|
|
||||||
<!-- 标题行 -->
|
|
||||||
<div
|
|
||||||
style="
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
font-weight: 800;
|
|
||||||
font-size: 16px;
|
|
||||||
position: relative;
|
|
||||||
padding: 5px 0;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
Help
|
|
||||||
<div
|
|
||||||
style="
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
right: 0;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
font-weight: bold;
|
|
||||||
"
|
|
||||||
@click="closedPopup"
|
|
||||||
>
|
|
||||||
x
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 内容 -->
|
|
||||||
<div>
|
|
||||||
<p style="font-weight: bold">User recharge instructions:</p>
|
|
||||||
<div class="textContent">
|
|
||||||
<p>
|
|
||||||
1、Before recharging,the user needs toprovide the correct Likei lD to complete
|
|
||||||
thisrecharge.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
2、After the coin seller recharges, therecharged coins will be directly sent to
|
|
||||||
thecoin seller account.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
3、How to obtain an lD for an account:(1)In Likei open the 'My' page.(2)You can
|
|
||||||
confrm the account lD at the topof the page.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
4、lf the lD account you enter is a coinseller account, the coin will be sent to
|
|
||||||
thecoin seller center of that account.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue'
|
|
||||||
import { useRouter } from 'vue-router'
|
|
||||||
import { showWarning } from '@/utils/toast.js'
|
|
||||||
|
|
||||||
import { searchUser } from '@/api/userInfo'
|
|
||||||
|
|
||||||
import MobileHeader from '@/components/MobileHeader.vue'
|
|
||||||
|
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const dialogshow = ref(false)
|
|
||||||
// 展示弹窗
|
|
||||||
const popupHelp = () => {
|
|
||||||
dialogshow.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 关闭弹窗
|
|
||||||
const closedPopup = () => {
|
|
||||||
dialogshow.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
const targetUserId = ref('')
|
|
||||||
|
|
||||||
const checkUserId = async () => {
|
|
||||||
console.log('充值目标用户id:', targetUserId.value)
|
|
||||||
|
|
||||||
try {
|
|
||||||
const targetUserInfo = await searchUser(targetUserId.value)
|
|
||||||
console.log('targetUserInfo:', targetUserInfo)
|
|
||||||
if (targetUserInfo.status && targetUserInfo.body.id) {
|
|
||||||
router.push({
|
|
||||||
path: '/recharge-freight-agent',
|
|
||||||
query: {
|
|
||||||
targetUserId: targetUserId.value,
|
|
||||||
isSuperFreightAgent: targetUserInfo.body?.isSuperFreightAgent || false,
|
|
||||||
isFreightAgent: targetUserInfo.body.isFreightAgent,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
// 信息提示id有误
|
|
||||||
showWarning('User info not found')
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log('error:', error.response.errorMsg)
|
|
||||||
throw error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
* {
|
|
||||||
color: black;
|
|
||||||
font-family: 'SF Pro';
|
|
||||||
}
|
|
||||||
|
|
||||||
.fullPage {
|
|
||||||
background-color: #ffffff;
|
|
||||||
min-height: 100vh;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg {
|
|
||||||
width: 100vw;
|
|
||||||
min-height: 100vh;
|
|
||||||
background-image: url(../../assets/images/secondBg.png);
|
|
||||||
background-size: 100% auto;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
.textContent > p {
|
|
||||||
font-weight: bold;
|
|
||||||
color: rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
input::placeholder {
|
|
||||||
font-weight: bold;
|
|
||||||
color: rgba(0, 0, 0, 0.4);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,152 +1,185 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="fullPage">
|
<div class="fullPage">
|
||||||
<div class="bg">
|
<div class="bg">
|
||||||
<!-- 顶部 -->
|
<!-- 顶部导航 -->
|
||||||
<MobileHeader title="Recharge">
|
<GeneralHeader
|
||||||
<template v-slot:extraFunction>
|
:isHomePage="true"
|
||||||
<div
|
:showLanguageList="true"
|
||||||
style="
|
title="Recharge"
|
||||||
display: flex;
|
:backImg="imgUrl"
|
||||||
align-items: center;
|
color="black"
|
||||||
position: relative;
|
style="box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 999"
|
||||||
color: rgba(187, 146, 255, 1) !important;
|
/>
|
||||||
"
|
|
||||||
@click="showLang"
|
|
||||||
>
|
|
||||||
<div style="font-weight: bold">{{ selectedLanguage.value }}</div>
|
|
||||||
<!-- <div
|
|
||||||
style="margin-left: 5px; transition: transform 0.5s"
|
|
||||||
:class="{ rotated: visibleList }"
|
|
||||||
>
|
|
||||||
>
|
|
||||||
</div> -->
|
|
||||||
<transition name="slide-fade">
|
|
||||||
<div
|
|
||||||
style="
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 100%;
|
|
||||||
padding: 10px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
width: max-content;
|
|
||||||
background-color: rgba(255, 255, 255, 0.1);
|
|
||||||
border-radius: 10px;
|
|
||||||
margin-top: 5px;
|
|
||||||
backdrop-filter: blur(8px);
|
|
||||||
"
|
|
||||||
v-show="visibleList"
|
|
||||||
class="extraList"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style="padding: 8px; color: white !important; font-weight: 590"
|
|
||||||
v-for="(item, index) in languageList"
|
|
||||||
:key="index"
|
|
||||||
@click="selectLang(item)"
|
|
||||||
>
|
|
||||||
{{ item.value }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</MobileHeader>
|
|
||||||
|
|
||||||
<div style="padding: 10px">
|
<!-- 主要内容 -->
|
||||||
|
<div style="padding: 10px; display: flex; flex-direction: column; gap: 8px">
|
||||||
<!-- 头部展示图 -->
|
<!-- 头部展示图 -->
|
||||||
<img src="../../assets/images/firstRechargeBonus.png" alt="" style="width: 100%" />
|
<img :src="imageUrl('headImg')" alt="" style="width: 100%" />
|
||||||
|
|
||||||
<div style="font-weight: 600; margin-bottom: 10px">Recharge ID:</div>
|
<!-- 个人信息模块 -->
|
||||||
<!-- 个人信息 -->
|
<div style="display: flex; flex-direction: column; gap: 8px">
|
||||||
<div
|
<!-- 标题 -->
|
||||||
style="
|
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||||
display: flex;
|
<div style="font-weight: 600">My Information:</div>
|
||||||
border-radius: 8px;
|
<div style="min-width: 0; width: 1.5em">
|
||||||
box-shadow: 0 0 4px 0 #00000050;
|
|
||||||
align-items: center;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
:src="userProfile.userAvatar"
|
|
||||||
alt=""
|
|
||||||
style="
|
|
||||||
width: 10%;
|
|
||||||
margin: 10px;
|
|
||||||
border-radius: 50%;
|
|
||||||
aspect-ratio: 1/1;
|
|
||||||
object-fit: cover;
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
<div style="">
|
|
||||||
<div style="font-weight: 700; display: flex; align-items: center">
|
|
||||||
{{ userProfile.userNickname }}
|
|
||||||
<img
|
<img
|
||||||
src="../../assets/icon/identity/coinSeller.png"
|
src="../../assets/icon/help.png"
|
||||||
alt=""
|
alt=""
|
||||||
style="height: 20px; margin-left: 5px"
|
style="display: block; width: 100%; object-fit: cover"
|
||||||
v-if="isFreightAgent"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-weight: 500; color: rgba(0, 0, 0, 0.4)">
|
</div>
|
||||||
ID:{{ userProfile.account }}
|
|
||||||
|
<!-- 个人信息 -->
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
min-width: 0;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 0 4px 0 #00000050;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<!-- 头像 -->
|
||||||
|
<img
|
||||||
|
:src="userInfo.userAvatar || ''"
|
||||||
|
alt=""
|
||||||
|
style="
|
||||||
|
width: 3em;
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
|
border-radius: 50%;
|
||||||
|
aspect-ratio: 1/1;
|
||||||
|
object-fit: cover;
|
||||||
|
"
|
||||||
|
@error="handleAvatarImageError"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 基本信息 -->
|
||||||
|
<div style="flex: 1; min-width: 0">
|
||||||
|
<div style="display: flex; align-items: center; gap: 4px">
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
font-weight: 700;
|
||||||
|
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ userInfo.userNickname }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<img
|
||||||
|
v-if="isFreightAgent"
|
||||||
|
src="../../assets/icon/identity/coinSeller.png"
|
||||||
|
alt=""
|
||||||
|
style="
|
||||||
|
display: block;
|
||||||
|
width: auto;
|
||||||
|
min-width: 0;
|
||||||
|
height: 1.5em;
|
||||||
|
object-fit: contain;
|
||||||
|
flex-shrink: 0;
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div style="font-weight: 500; color: rgba(0, 0, 0, 0.4)">
|
||||||
|
ID:{{ userInfo.account }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 当前选择国家 -->
|
<!-- 商品展示模块 -->
|
||||||
<div style="width: 100%; display: flex; justify-content: space-between; margin: 10px 0">
|
<div style="display: flex; flex-direction: column; gap: 8px">
|
||||||
<div style="font-weight: 600">Select a country:</div>
|
<!-- 当前选择国家 -->
|
||||||
<div style="font-weight: 500; color: rgba(0, 0, 0, 0.4)" @click="goMap">
|
<div style="width: 100%; display: flex; justify-content: space-between">
|
||||||
<img src="../../assets/icon/Vector.png" alt="" style="width: 10px" />
|
<div style="font-weight: 600">Select a country:</div>
|
||||||
{{ selectedCountry.countryName }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 支付渠道 -->
|
|
||||||
<div v-if="channels.length != 0">
|
|
||||||
<div v-for="(channelItem, index) in channels" :key="index">
|
|
||||||
<!-- 支付类型 -->
|
|
||||||
<div
|
<div
|
||||||
style="
|
style="
|
||||||
|
padding: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: #7726ff;
|
||||||
|
box-shadow: 0 1px 18px 2px #f2d9ff inset, 0 1px 4px 2px #f2d9ff inset;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
border-radius: 8px;
|
justify-content: center;
|
||||||
box-shadow: 0 0 4px 0 #00000050;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
"
|
"
|
||||||
@click="setChannelName(channelItem.channel.channelName)"
|
@click="goMap"
|
||||||
>
|
>
|
||||||
<img :src="channelItem.channel.channelIcon" alt="" style="width: 10%; margin: 10px" />
|
<!-- 国旗 -->
|
||||||
<div style="font-weight: 500">{{ channelItem.channel.channelName }}</div>
|
<img
|
||||||
</div>
|
:src="selectedCountry.country?.nationalFlag"
|
||||||
|
alt=""
|
||||||
|
style="display: block; width: 1.5em; object-fit: contain"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 支付商品 -->
|
<!-- 国家名字 -->
|
||||||
|
<div style="font-size: 0.8em; font-weight: 500; color: #fff">
|
||||||
|
{{ selectedCountry.countryName }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 支付渠道 -->
|
||||||
|
<div v-if="channels.length != 0" style="display: flex; flex-direction: column; gap: 12px">
|
||||||
<div
|
<div
|
||||||
|
v-for="(channelItem, index) in channels"
|
||||||
|
:key="index"
|
||||||
style="
|
style="
|
||||||
|
padding: 10px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 0 0 4px 0 #00000050;
|
box-shadow: 0 0 4px 0 #00000050;
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
display: flex;
|
||||||
gap: 12px;
|
flex-direction: column;
|
||||||
padding: 10px;
|
gap: 8px;
|
||||||
margin-top: 1rem;
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div
|
<!-- 支付类型 -->
|
||||||
style="
|
<div style="display: flex; align-items: center; gap: 8px">
|
||||||
width: 100%;
|
<img :src="channelItem.channel.channelIcon" style="display: block; width: 2.5em" />
|
||||||
border-radius: 8px;
|
<div style="font-weight: 500">{{ channelItem.channel.channelName }}</div>
|
||||||
box-shadow: 0 0 4px 0 #00000050;
|
</div>
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
<!-- 支付商品 -->
|
||||||
align-items: center;
|
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px">
|
||||||
"
|
<div
|
||||||
v-for="(goods, index) in commodityList"
|
style="
|
||||||
:key="index"
|
padding: 8px;
|
||||||
@click="goPay(channelItem, goods)"
|
width: 100%;
|
||||||
>
|
border-radius: 8px;
|
||||||
<img src="../../assets/icon/coin.png" alt="" style="width: 30%" />
|
box-shadow: 0 0 4px 0 #00000050;
|
||||||
<div>{{ goods.content }}</div>
|
|
||||||
<div>${{ goods.amountUsd }}</div>
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
"
|
||||||
|
v-for="(goods, index) in commodityList"
|
||||||
|
:key="index"
|
||||||
|
@click="goPay(channelItem, goods)"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src="../../assets/icon/coin.png"
|
||||||
|
alt=""
|
||||||
|
style="display: block; width: 3em; object-fit: cover"
|
||||||
|
/>
|
||||||
|
<div style="font-size: 0.9em; font-weight: 500; color: #373232">
|
||||||
|
{{ goods.content }}
|
||||||
|
</div>
|
||||||
|
<div style="font-size: 1em; font-weight: 500; color: #131111">
|
||||||
|
${{ goods.amountUsd }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -157,97 +190,69 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, watch } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import router from '@/router'
|
import { connectToApp } from '@/utils/appConnector.js'
|
||||||
import { useI18n } from 'vue-i18n'
|
|
||||||
import { goAirwallex } from '@/utils/payment'
|
import { goAirwallex } from '@/utils/payment'
|
||||||
import { showWarning } from '@/utils/toast.js'
|
import { showWarning } from '@/utils/toast.js'
|
||||||
|
|
||||||
import { useCountryStore } from '@/stores/country'
|
import { useCountryStore } from '@/stores/country'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
|
import { handleAvatarImageError } from '@/utils/imageHandler.js'
|
||||||
|
import { getPngUrl } from '@/config/imagePaths.js'
|
||||||
|
import { preloadImages } from '@/utils/imagePreloader.js'
|
||||||
|
|
||||||
import { searchPayRechargeUser } from '@/api/userInfo'
|
import { getMemberProfile } from '@/api/wallet'
|
||||||
|
import { searchUser, searchPayRechargeUser } from '@/api/userInfo'
|
||||||
import { getPayAplication, getAppCommodityCard, payPlaceAnOrderRecharge } from '@/api/pay'
|
import { getPayAplication, getAppCommodityCard, payPlaceAnOrderRecharge } from '@/api/pay'
|
||||||
|
|
||||||
import MobileHeader from '@/components/MobileHeader.vue'
|
import GeneralHeader from '@/components/GeneralHeader.vue'
|
||||||
|
|
||||||
const { t, locale } = useI18n()
|
// 获取OSS图片URL的函数
|
||||||
|
const imageUrl = (filename) => getPngUrl('Recharge/', filename)
|
||||||
|
const imgUrl = new URL('/src/assets/icon/arrowBackBlack.png', import.meta.url).href
|
||||||
|
|
||||||
const countryStore = useCountryStore()
|
const countryStore = useCountryStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
const languageList = ref([
|
|
||||||
{
|
|
||||||
type: 'en',
|
|
||||||
value: 'English',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'ar',
|
|
||||||
value: 'اللغة العربية',
|
|
||||||
},
|
|
||||||
])
|
|
||||||
const selectedLanguage = ref({
|
|
||||||
type: 'en',
|
|
||||||
value: 'English',
|
|
||||||
})
|
|
||||||
|
|
||||||
const visibleList = ref(false) //语言列表显示
|
|
||||||
//语言列表显示
|
|
||||||
const showLang = () => {
|
|
||||||
visibleList.value = !visibleList.value
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectLang = (item) => {
|
|
||||||
selectedLanguage.value = item
|
|
||||||
localStorage.setItem('lang', item)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 监听语言变化并设置文档方向
|
|
||||||
watch(locale, (newLocale) => {
|
|
||||||
setDocumentDirection(newLocale)
|
|
||||||
})
|
|
||||||
|
|
||||||
const applicationId = ref('1963531459019739137')
|
const applicationId = ref('1963531459019739137')
|
||||||
const userProfile = ref({}) //用户信息
|
const userInfo = ref({}) //用户信息
|
||||||
const type = ref('') //用户身份
|
const type = ref(route.params.type || '') //用户身份
|
||||||
const isFreightAgent = ref(false)
|
const isFreightAgent = ref(route.query.isFreightAgent === 'true')
|
||||||
|
const isSuperFreightAgent = ref(route.query.isSuperFreightAgent === 'true')
|
||||||
|
|
||||||
const regionId = ref('') //区域id
|
const regionId = ref('') //区域id
|
||||||
|
|
||||||
const { list: countryList, selectedCountry } = storeToRefs(countryStore) //国家信息
|
const { selectedCountry } = storeToRefs(countryStore) //国家信息
|
||||||
|
|
||||||
const channels = ref([]) //支付渠道
|
const channels = ref([]) //支付渠道
|
||||||
const selectedChannelName = ref('') //选中的支付渠道
|
|
||||||
|
|
||||||
const commodityList = ref([]) //商品列表
|
const commodityList = ref([]) //商品列表
|
||||||
const selectedCommodity = ref({}) //选中的商品
|
|
||||||
|
|
||||||
// 前往地图页
|
// 前往地图页
|
||||||
const goMap = () => {
|
const goMap = () => {
|
||||||
router.push({ path: '/map' })
|
router.push({ path: '/map' })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 点击商品支付
|
||||||
const goPay = async (item, commodity) => {
|
const goPay = async (item, commodity) => {
|
||||||
selectedCommodity.value = commodity
|
|
||||||
let payData = {
|
let payData = {
|
||||||
applicationId: applicationId.value,
|
applicationId: applicationId.value,
|
||||||
payCountryId: selectedCountry.value.id,
|
payCountryId: selectedCountry.value.id,
|
||||||
goodsId: commodity.id,
|
goodsId: commodity.id,
|
||||||
userId: userProfile.value.id,
|
userId: userInfo.value.id,
|
||||||
channelCode: item.channel.channelCode,
|
channelCode: item.channel.channelCode,
|
||||||
}
|
}
|
||||||
console.log('payData:', payData)
|
|
||||||
|
|
||||||
const payRes = await payPlaceAnOrderRecharge(payData)
|
const payRes = await payPlaceAnOrderRecharge(payData) // 下单充值
|
||||||
const body = payRes.body
|
if (!payRes.body) {
|
||||||
if (!body) {
|
|
||||||
console.log('Payment not available, please contact administrator!!!')
|
console.log('Payment not available, please contact administrator!!!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (body.factoryCode === 'AIRWALLEX') {
|
if (payRes.body.factoryCode === 'AIRWALLEX') {
|
||||||
|
// 拉起对应的h5支付页
|
||||||
goAirwallex({
|
goAirwallex({
|
||||||
result: body,
|
result: payRes.body,
|
||||||
props: {
|
props: {
|
||||||
logoUrl: that.sysOriginLog,
|
logoUrl: that.sysOriginLog,
|
||||||
successUrl: `${location.origin}/#/pay-result?redirect=recharge&appType=${type.value}&appId=${applicationId.value}&appStatus=0`,
|
successUrl: `${location.origin}/#/pay-result?redirect=recharge&appType=${type.value}&appId=${applicationId.value}&appStatus=0`,
|
||||||
@ -261,68 +266,117 @@ const goPay = async (item, commodity) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (body.requestUrl) {
|
if (payRes.body.requestUrl) {
|
||||||
location.href = decodeURIComponent(body.requestUrl)
|
location.href = decodeURIComponent(payRes.body.requestUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//获取用户信息
|
||||||
|
const getUserInfo = async () => {
|
||||||
|
const resUserInfo = await getMemberProfile()
|
||||||
|
if (resUserInfo.status && resUserInfo.body) {
|
||||||
|
userInfo.value = resUserInfo.body
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选中支付渠道
|
// 检查身份
|
||||||
const setChannelName = (channelName) => {
|
const checkAccount = async () => {
|
||||||
selectedChannelName.value = selectedChannelName.value != channelName ? channelName : ''
|
console.log('充值目标用户account:', userInfo.value.account)
|
||||||
|
|
||||||
|
try {
|
||||||
|
const targetUserInfo = await searchUser(userInfo.value.account)
|
||||||
|
console.log('targetUserInfo:', targetUserInfo)
|
||||||
|
if (targetUserInfo.status && targetUserInfo.body.id) {
|
||||||
|
isSuperFreightAgent.value = targetUserInfo.body?.isSuperFreightAgent
|
||||||
|
isFreightAgent.value = targetUserInfo.body?.isFreightAgent
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log('error:', error.response.errorMsg)
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取appCode
|
||||||
|
const getAppCode = async () => {
|
||||||
|
const PayAplication = await getPayAplication(applicationId.value)
|
||||||
|
return PayAplication.body.appCode
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取支付渠道和商品列表
|
||||||
|
const getPayAplicationAndCommodity = async () => {
|
||||||
|
let appCommodityCardParams = {
|
||||||
|
applicationId: applicationId.value,
|
||||||
|
payCountryId: selectedCountry.value.id,
|
||||||
|
regionId: regionId.value,
|
||||||
|
type: isSuperFreightAgent.value
|
||||||
|
? 'FREIGHT_GOLD_SUPER'
|
||||||
|
: isFreightAgent.value
|
||||||
|
? 'FREIGHT_GOLD'
|
||||||
|
: 'GOLD',
|
||||||
|
}
|
||||||
|
const appCommodityCard = await getAppCommodityCard(appCommodityCardParams)
|
||||||
|
commodityList.value = appCommodityCard.body.commodity
|
||||||
|
if (appCommodityCard.body.channels) {
|
||||||
|
channels.value = appCommodityCard.body.channels
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取用户信息和国家列表
|
||||||
|
const getUserInfoAndCountry = async () => {
|
||||||
|
let appCode = await getAppCode()
|
||||||
|
if (appCode) {
|
||||||
|
let params = {
|
||||||
|
sysOrigin: appCode,
|
||||||
|
account: userInfo.value.account,
|
||||||
|
type: isSuperFreightAgent.value
|
||||||
|
? 'FREIGHT_GOLD_SUPER'
|
||||||
|
: isFreightAgent.value
|
||||||
|
? 'FREIGHT_GOLD'
|
||||||
|
: 'GOLD',
|
||||||
|
}
|
||||||
|
const countryAndRegionInfo = await searchPayRechargeUser(params)
|
||||||
|
|
||||||
|
if (
|
||||||
|
countryAndRegionInfo.body &&
|
||||||
|
countryAndRegionInfo.body.regionId &&
|
||||||
|
countryAndRegionInfo.body.countryList.length != 0
|
||||||
|
) {
|
||||||
|
countryStore.setCountryList(countryAndRegionInfo.body.countryList) // 存储国家列表
|
||||||
|
// 设置默认国家
|
||||||
|
if (JSON.stringify(selectedCountry.value) == '{}') {
|
||||||
|
countryStore.setCountry(countryAndRegionInfo.body.countryList[0])
|
||||||
|
}
|
||||||
|
|
||||||
|
regionId.value = countryAndRegionInfo.body.regionId //区域id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 数据初始化
|
||||||
|
const init = async () => {
|
||||||
|
await getUserInfoAndCountry() // 获取用户信息和国家列表
|
||||||
|
await getPayAplicationAndCommodity() // 获取支付渠道和商品列表
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用工具函数连接APP
|
||||||
|
const connectToAppHandler = () => {
|
||||||
|
connectToApp(async () => {
|
||||||
|
// 连接成功回调
|
||||||
|
await getUserInfo() //获取用户信息
|
||||||
|
await checkAccount() // 检查身份
|
||||||
|
await init() // 数据初始化
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 预加载关键图片
|
||||||
|
const preloadCriticalImages = () => {
|
||||||
|
const criticalImages = [imageUrl('headImg')]
|
||||||
|
|
||||||
|
preloadImages(criticalImages)
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
type.value = route.params.type || 'GOLD'
|
preloadCriticalImages() // 预加载关键图片
|
||||||
isFreightAgent.value = route.query.isFreightAgent === 'true'
|
connectToAppHandler()
|
||||||
|
|
||||||
const PayAplication = await getPayAplication(applicationId.value)
|
|
||||||
console.log('PayAplication:', PayAplication)
|
|
||||||
if (PayAplication.body && PayAplication.body.appCode) {
|
|
||||||
let params = {
|
|
||||||
sysOrigin: PayAplication.body.appCode,
|
|
||||||
account: route.query.targetUserId,
|
|
||||||
type:
|
|
||||||
route.query.isSuperFreightAgent === 'true'
|
|
||||||
? 'FREIGHT_GOLD_SUPER'
|
|
||||||
: route.query.isFreightAgent === 'true'
|
|
||||||
? 'FREIGHT_GOLD'
|
|
||||||
: 'GOLD',
|
|
||||||
}
|
|
||||||
const userInfo = await searchPayRechargeUser(params)
|
|
||||||
|
|
||||||
if (userInfo.body && userInfo.body.regionId && userInfo.body.countryList.length != 0) {
|
|
||||||
userProfile.value = { ...userInfo.body.userProfile, type: 'GOLD' }
|
|
||||||
|
|
||||||
countryStore.setCountryList(userInfo.body.countryList)
|
|
||||||
if (JSON.stringify(selectedCountry.value) == '{}') {
|
|
||||||
countryStore.setCountry(userInfo.body.countryList[0])
|
|
||||||
}
|
|
||||||
|
|
||||||
regionId.value = userInfo.body.regionId
|
|
||||||
|
|
||||||
let appCommodityCardParams = {
|
|
||||||
applicationId: applicationId.value,
|
|
||||||
payCountryId: selectedCountry.value.id,
|
|
||||||
regionId: userInfo.body.regionId,
|
|
||||||
type:
|
|
||||||
route.query.isSuperFreightAgent === 'true'
|
|
||||||
? 'FREIGHT_GOLD_SUPER'
|
|
||||||
: route.query.isFreightAgent === 'true'
|
|
||||||
? 'FREIGHT_GOLD'
|
|
||||||
: 'GOLD',
|
|
||||||
}
|
|
||||||
const appCommodityCard = await getAppCommodityCard(appCommodityCardParams)
|
|
||||||
console.log('appCommodityCard:', appCommodityCard)
|
|
||||||
commodityList.value = appCommodityCard.body.commodity
|
|
||||||
if (appCommodityCard.body.channels) {
|
|
||||||
channels.value = appCommodityCard.body.channels
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
watch(selectedCountry, (New, Old) => {
|
|
||||||
console.log(`新值:${New.id},旧值:${Old.id}`)
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -375,4 +429,28 @@ watch(selectedCountry, (New, Old) => {
|
|||||||
.rotated {
|
.rotated {
|
||||||
transform: rotate(90deg);
|
transform: rotate(90deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 360px) {
|
||||||
|
* {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 360px) {
|
||||||
|
* {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 768px) {
|
||||||
|
* {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 1024px) {
|
||||||
|
* {
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,49 +1,41 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="fullPage">
|
<div class="fullPage">
|
||||||
<div class="bg">
|
<div class="bg">
|
||||||
<div>
|
<!-- 顶部导航 -->
|
||||||
<!-- 顶部 -->
|
<GeneralHeader
|
||||||
<MobileHeader title="Country&Region">
|
title="Select Country"
|
||||||
<!-- <template v-slot:extraFunction>
|
:backImg="imgUrl"
|
||||||
<div style="display: flex; justify-content: center; align-items: center; width: 10%">
|
color="black"
|
||||||
<img src="../assets/icon/selected.png" alt="" style="width: 100%" @click="confirm" />
|
style="box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 999"
|
||||||
</div>
|
/>
|
||||||
</template> -->
|
|
||||||
</MobileHeader>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 内容 -->
|
<!-- 内容 -->
|
||||||
<div style="padding: 10px">
|
<div style="padding: 10px; display: grid; gap: 10px">
|
||||||
<div style="font-weight: 510; color: rgba(0, 0, 0, 0.4)">Select your country</div>
|
<div style="font-weight: 510; color: rgba(0, 0, 0, 0.4)">Select your country</div>
|
||||||
|
|
||||||
<div v-for="(countries, gIndex) in groupedCountries" :key="gIndex">
|
<div v-for="(countries, gIndex) in groupedCountries" :key="gIndex">
|
||||||
<div style="font-weight: 400; color: rgba(0, 0, 0, 0.4)">{{ countries.letter }}</div>
|
<div style="font-weight: 400; color: rgba(0, 0, 0, 0.4); margin-bottom: 10px">
|
||||||
|
{{ countries.letter }}
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
style="
|
style="
|
||||||
margin: 10px 0;
|
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
box-shadow: 0 0 4px 0 #00000050;
|
box-shadow: 0 0 4px 0 #00000050;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
gap: 10px;
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-for="(country, cIndex) in countries.countries"
|
v-for="(country, cIndex) in countries.countries"
|
||||||
:key="cIndex"
|
:key="cIndex"
|
||||||
style="
|
style="display: flex; justify-content: space-between; align-items: center"
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin: 10px 0;
|
|
||||||
"
|
|
||||||
@click="selectC(gIndex, cIndex, country)"
|
@click="selectC(gIndex, cIndex, country)"
|
||||||
>
|
>
|
||||||
<div style="display: flex; align-items: center">
|
<div style="display: flex; align-items: center; gap: 10px">
|
||||||
<img
|
<img :src="country.country.nationalFlag" alt="" style="height: 16px" />
|
||||||
:src="country.country.nationalFlag"
|
|
||||||
alt=""
|
|
||||||
style="height: 16px; margin-right: 10px"
|
|
||||||
/>
|
|
||||||
{{ country.countryName }}
|
{{ country.countryName }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@ -81,7 +73,9 @@ import { useRouter } from 'vue-router'
|
|||||||
|
|
||||||
import { useCountryStore } from '@/stores/country'
|
import { useCountryStore } from '@/stores/country'
|
||||||
|
|
||||||
import MobileHeader from '@/components/MobileHeader.vue'
|
import GeneralHeader from '@/components/GeneralHeader.vue'
|
||||||
|
|
||||||
|
const imgUrl = new URL('/src/assets/icon/arrowBackBlack.png', import.meta.url).href
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const countryStore = useCountryStore()
|
const countryStore = useCountryStore()
|
||||||
@ -162,4 +156,28 @@ const confirm = () => {
|
|||||||
background-size: 100% auto;
|
background-size: 100% auto;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 360px) {
|
||||||
|
* {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 360px) {
|
||||||
|
* {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 768px) {
|
||||||
|
* {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 1024px) {
|
||||||
|
* {
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user