mirror of
https://gitee.com/bootx/dax-pay-h5.git
synced 2025-10-13 13:43:53 +00:00
feat 打包配置优化和一些功能修改
This commit is contained in:
10
.env
10
.env
@@ -1,12 +1,12 @@
|
|||||||
# port
|
# port
|
||||||
VITE_PORT = 9100
|
VITE_PORT=9100
|
||||||
|
|
||||||
# spa-title
|
# spa-title
|
||||||
VITE_GLOB_APP_TITLE = DaxPay
|
VITE_GLOB_APP_TITLE=DaxPay
|
||||||
|
|
||||||
# 系统中文名称
|
# 系统中文名称
|
||||||
VITE_GLOB_APP_TITLE_CN = DaxPay支付系统
|
VITE_GLOB_APP_TITLE_CN=DaxPay支付系统
|
||||||
|
|
||||||
# spa shortname 不可出现空格数字等特殊字符
|
# spa shortname 不可出现空格数字连接线等特殊字符
|
||||||
VITE_GLOB_APP_SHORT_NAME = vantMobile
|
VITE_GLOB_APP_SHORT_NAME=DaxPay
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
VITE_PORT=9100
|
VITE_PORT=9100
|
||||||
|
|
||||||
# 网站根目录
|
# 网站根目录
|
||||||
VITE_PUBLIC_PATH=/
|
VITE_PUBLIC_PATH=/h5
|
||||||
|
|
||||||
# 跨域代理,可以配置多个,请注意不要换行
|
# 跨域代理,可以配置多个,请注意不要换行
|
||||||
VITE_PROXY=[["/server","http://localhost:10880"]]
|
VITE_PROXY=[["/server","http://localhost:10880"]]
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
# 独立部署模式
|
# 独立部署模式
|
||||||
VITE_PUBLIC_PATH = /
|
#VITE_PUBLIC_PATH = /
|
||||||
# API 接口前缀
|
|
||||||
VITE_GLOB_API_URL_PREFIX = /api
|
|
||||||
|
|
||||||
# 嵌入式模式 与网关部署在一起, 和 接口 (server) 前缀 这个是
|
|
||||||
#VITE_PUBLIC_PATH=/h5
|
|
||||||
## API 接口前缀
|
## API 接口前缀
|
||||||
#VITE_GLOB_API_URL_PREFIX=
|
#VITE_GLOB_API_URL_PREFIX=/api
|
||||||
|
|
||||||
|
# 嵌入式模式 与网关部署在一起
|
||||||
|
VITE_PUBLIC_PATH=/h5
|
||||||
|
# API 接口前缀
|
||||||
|
VITE_GLOB_API_URL_PREFIX=
|
||||||
|
|
||||||
# 是否删除console
|
# 是否删除console
|
||||||
VITE_DROP_CONSOLE=true
|
VITE_DROP_CONSOLE=true
|
||||||
|
1
components.d.ts
vendored
1
components.d.ts
vendored
@@ -16,6 +16,7 @@ declare module 'vue' {
|
|||||||
VanField: typeof import('vant/es')['Field']
|
VanField: typeof import('vant/es')['Field']
|
||||||
VanLoading: typeof import('vant/es')['Loading']
|
VanLoading: typeof import('vant/es')['Loading']
|
||||||
VanNumberKeyboard: typeof import('vant/es')['NumberKeyboard']
|
VanNumberKeyboard: typeof import('vant/es')['NumberKeyboard']
|
||||||
|
VanOverlay: typeof import('vant/es')['Overlay']
|
||||||
VanTextEllipsis: typeof import('vant/es')['TextEllipsis']
|
VanTextEllipsis: typeof import('vant/es')['TextEllipsis']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ export const DaxPayRoute: RouteRecordRaw = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/channel/cashier/:mchNo/:appId',
|
path: '/channel/cashier/:appId',
|
||||||
name: 'ChannelCashier',
|
name: 'ChannelCashier',
|
||||||
component: () => import('@/views/daxpay/channel/ChannelCashier.vue'),
|
component: () => import('@/views/daxpay/channel/ChannelCashier.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
@@ -35,7 +35,7 @@ export const DaxPayRoute: RouteRecordRaw = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/alipay/cashier/:mchNo/:appId',
|
path: '/alipay/cashier/:appId',
|
||||||
name: 'AlipayCashier',
|
name: 'AlipayCashier',
|
||||||
component: () => import('@/views/daxpay/channel/alipay/cashier/AlipayCashier.vue'),
|
component: () => import('@/views/daxpay/channel/alipay/cashier/AlipayCashier.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
@@ -43,7 +43,7 @@ export const DaxPayRoute: RouteRecordRaw = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/wechat/cashier/:mchNo/:appId',
|
path: '/wechat/cashier/:appId',
|
||||||
name: 'WechatCashier',
|
name: 'WechatCashier',
|
||||||
component: () => import('@/views/daxpay/channel/wechat/cashier/WechatCashier.vue'),
|
component: () => import('@/views/daxpay/channel/wechat/cashier/WechatCashier.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
|
@@ -23,7 +23,7 @@ routeStore.setRouters(constantRouter.concat(routeModuleList))
|
|||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
// 重定向时hash模式有场景无法跳转,需要使用history模式
|
// 重定向时hash模式有场景无法跳转,需要使用history模式
|
||||||
history: createWebHistory(''),
|
history: createWebHistory(import.meta.env.VITE_PUBLIC_PATH),
|
||||||
routes: constantRouter.concat(...routeModuleList),
|
routes: constantRouter.concat(...routeModuleList),
|
||||||
strict: true,
|
strict: true,
|
||||||
scrollBehavior: () => ({ left: 0, top: 0 }),
|
scrollBehavior: () => ({ left: 0, top: 0 }),
|
||||||
|
@@ -2,16 +2,6 @@ import type { AuthResult } from './ChannelAuth.api'
|
|||||||
import { http } from '@/utils/http/axios'
|
import { http } from '@/utils/http/axios'
|
||||||
import type { Result } from '#/axios'
|
import type { Result } from '#/axios'
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取商户名称
|
|
||||||
*/
|
|
||||||
export function getMchName(mchNo: string) {
|
|
||||||
return http.request<Result<string>>({
|
|
||||||
url: '/unipay/ext/channel/cashier/getMchName',
|
|
||||||
method: 'GET',
|
|
||||||
params: { mchNo },
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取收银台信息
|
* 获取收银台信息
|
||||||
@@ -61,8 +51,6 @@ export function cashierPay(param: CashierPayParam) {
|
|||||||
* 通道认证参数
|
* 通道认证参数
|
||||||
*/
|
*/
|
||||||
export interface CashierAuthParam {
|
export interface CashierAuthParam {
|
||||||
// 商户号
|
|
||||||
mchNo?: string
|
|
||||||
// 应用号
|
// 应用号
|
||||||
appId?: string
|
appId?: string
|
||||||
// 收银台类型
|
// 收银台类型
|
||||||
@@ -75,9 +63,6 @@ export interface CashierAuthParam {
|
|||||||
* 通道收银支付参数
|
* 通道收银支付参数
|
||||||
*/
|
*/
|
||||||
export interface CashierPayParam {
|
export interface CashierPayParam {
|
||||||
|
|
||||||
// 商户号
|
|
||||||
mchNo?: string
|
|
||||||
// 应用号
|
// 应用号
|
||||||
appId?: string
|
appId?: string
|
||||||
// 收银台类型
|
// 收银台类型
|
||||||
@@ -127,8 +112,6 @@ export interface WxJsapiSignResult {
|
|||||||
* 收银台配置信息
|
* 收银台配置信息
|
||||||
*/
|
*/
|
||||||
export interface ChannelCashierConfigResult {
|
export interface ChannelCashierConfigResult {
|
||||||
// 商户号
|
|
||||||
mchNo?: string
|
|
||||||
// 应用号
|
// 应用号
|
||||||
appId?: string
|
appId?: string
|
||||||
// 收银台类型
|
// 收银台类型
|
||||||
|
@@ -6,14 +6,14 @@ import { useRoute } from 'vue-router'
|
|||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const { mchNo, appId } = route.params
|
const { appId } = route.params
|
||||||
|
|
||||||
const ua = navigator.userAgent
|
const ua = navigator.userAgent
|
||||||
if (ua.includes('MicroMessenger')) {
|
if (ua.includes('MicroMessenger')) {
|
||||||
router.push({ path: `/wechat/cashier/${mchNo}/${appId}`, replace: true })
|
router.push({ path: `/wechat/cashier/${appId}`, replace: true })
|
||||||
}
|
}
|
||||||
else if (ua.includes('Alipay')) {
|
else if (ua.includes('Alipay')) {
|
||||||
router.push({ path: `/alipay/cashier/${mchNo}/${appId}`, replace: true })
|
router.push({ path: `/alipay/cashier/${appId}`, replace: true })
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
router.push({ name: 'ErrorResult', query: { msg: '请使用支付宝、微信等支付程序进行扫码支付' }, replace: true })
|
router.push({ name: 'ErrorResult', query: { msg: '请使用支付宝、微信等支付程序进行扫码支付' }, replace: true })
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="amount-display">
|
<div class="amount-display">
|
||||||
<p style="font-size: 20px">
|
<p style="font-size: 20px">
|
||||||
付款给{{ mchName }}
|
付款金额
|
||||||
</p>
|
</p>
|
||||||
<p style="font-size: 32px;">
|
<p style="font-size: 32px;">
|
||||||
¥ {{ amount }}
|
¥ {{ amount }}
|
||||||
@@ -70,7 +70,6 @@ import type {
|
|||||||
import {
|
import {
|
||||||
cashierPay,
|
cashierPay,
|
||||||
getCashierInfo,
|
getCashierInfo,
|
||||||
getMchName,
|
|
||||||
} from '@/views/daxpay/channel/ChannelCashier.api'
|
} from '@/views/daxpay/channel/ChannelCashier.api'
|
||||||
|
|
||||||
import { CashierTypeEnum } from '@/enums/daxpay/DaxPayEnum'
|
import { CashierTypeEnum } from '@/enums/daxpay/DaxPayEnum'
|
||||||
@@ -78,14 +77,13 @@ import router from '@/router'
|
|||||||
import { useKeyboard } from '@/hooks/daxpay/useKeyboard'
|
import { useKeyboard } from '@/hooks/daxpay/useKeyboard'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const { mchNo, appId } = route.params
|
const { appId } = route.params
|
||||||
|
|
||||||
const showRemark = ref<boolean>(false)
|
const showRemark = ref<boolean>(false)
|
||||||
const loading = ref<boolean>(false)
|
const loading = ref<boolean>(false)
|
||||||
const cashierInfo = ref<ChannelCashierConfigResult>({})
|
const cashierInfo = ref<ChannelCashierConfigResult>({})
|
||||||
const amount = ref<string>('0')
|
const amount = ref<string>('0')
|
||||||
const description = ref<string>('')
|
const description = ref<string>('')
|
||||||
const mchName = ref<string>('')
|
|
||||||
|
|
||||||
const { input, del } = useKeyboard(amount)
|
const { input, del } = useKeyboard(amount)
|
||||||
|
|
||||||
@@ -102,11 +100,6 @@ function initData() {
|
|||||||
}).catch((res) => {
|
}).catch((res) => {
|
||||||
router.push({ name: 'ErrorResult', query: { msg: res.message } })
|
router.push({ name: 'ErrorResult', query: { msg: res.message } })
|
||||||
})
|
})
|
||||||
getMchName(mchNo as string).then(({ data }) => {
|
|
||||||
mchName.value = data
|
|
||||||
}).catch((res) => {
|
|
||||||
router.push({ name: 'ErrorResult', query: { msg: res.message } })
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -124,7 +117,6 @@ function pay() {
|
|||||||
appId,
|
appId,
|
||||||
cashierType: CashierTypeEnum.ALIPAY,
|
cashierType: CashierTypeEnum.ALIPAY,
|
||||||
description: description.value,
|
description: description.value,
|
||||||
mchNo,
|
|
||||||
} as CashierPayParam
|
} as CashierPayParam
|
||||||
cashierPay(from)
|
cashierPay(from)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="amount-display">
|
<div class="amount-display">
|
||||||
<p style="font-size: 20px">
|
<p style="font-size: 20px">
|
||||||
付款给{{ mchName }}
|
付款金额
|
||||||
</p>
|
</p>
|
||||||
<p style="font-size: 32px;">
|
<p style="font-size: 32px;">
|
||||||
¥ {{ amount }}
|
¥ {{ amount }}
|
||||||
@@ -74,7 +74,6 @@ import {
|
|||||||
, cashierPay,
|
, cashierPay,
|
||||||
generateAuthUrl,
|
generateAuthUrl,
|
||||||
getCashierInfo,
|
getCashierInfo,
|
||||||
getMchName,
|
|
||||||
} from '@/views/daxpay/channel/ChannelCashier.api'
|
} from '@/views/daxpay/channel/ChannelCashier.api'
|
||||||
|
|
||||||
import { CashierTypeEnum } from '@/enums/daxpay/DaxPayEnum'
|
import { CashierTypeEnum } from '@/enums/daxpay/DaxPayEnum'
|
||||||
@@ -82,7 +81,7 @@ import router from '@/router'
|
|||||||
import { useKeyboard } from '@/hooks/daxpay/useKeyboard'
|
import { useKeyboard } from '@/hooks/daxpay/useKeyboard'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const { mchNo, appId } = route.params
|
const { appId } = route.params
|
||||||
const { code } = route.query
|
const { code } = route.query
|
||||||
|
|
||||||
const show = ref<boolean>(false)
|
const show = ref<boolean>(false)
|
||||||
@@ -91,12 +90,10 @@ const loading = ref<boolean>(false)
|
|||||||
const cashierInfo = ref<ChannelCashierConfigResult>({})
|
const cashierInfo = ref<ChannelCashierConfigResult>({})
|
||||||
const amount = ref<string>('0')
|
const amount = ref<string>('0')
|
||||||
const description = ref<string>('')
|
const description = ref<string>('')
|
||||||
const mchName = ref<string>('')
|
|
||||||
const openId = ref<string>('')
|
const openId = ref<string>('')
|
||||||
|
|
||||||
// 认证参数
|
// 认证参数
|
||||||
const authParam = ref<CashierAuthParam>({
|
const authParam = ref<CashierAuthParam>({
|
||||||
mchNo: mchNo as string,
|
|
||||||
appId: appId as string,
|
appId: appId as string,
|
||||||
cashierType: CashierTypeEnum.WECHAT_PAY,
|
cashierType: CashierTypeEnum.WECHAT_PAY,
|
||||||
})
|
})
|
||||||
@@ -138,11 +135,6 @@ function initData() {
|
|||||||
}).catch((res) => {
|
}).catch((res) => {
|
||||||
router.push({ name: 'ErrorResult', query: { msg: res.message } })
|
router.push({ name: 'ErrorResult', query: { msg: res.message } })
|
||||||
})
|
})
|
||||||
getMchName(mchNo as string).then(({ data }) => {
|
|
||||||
mchName.value = data
|
|
||||||
}).catch((res) => {
|
|
||||||
router.push({ name: 'ErrorResult', query: { msg: res.message } })
|
|
||||||
})
|
|
||||||
auth(authParam.value).then(({ data }) => {
|
auth(authParam.value).then(({ data }) => {
|
||||||
openId.value = data.openId as string
|
openId.value = data.openId as string
|
||||||
}).catch((res) => {
|
}).catch((res) => {
|
||||||
@@ -167,7 +159,6 @@ function pay() {
|
|||||||
openId: openId.value,
|
openId: openId.value,
|
||||||
cashierType: CashierTypeEnum.WECHAT_PAY,
|
cashierType: CashierTypeEnum.WECHAT_PAY,
|
||||||
description: description.value,
|
description: description.value,
|
||||||
mchNo,
|
|
||||||
} as CashierPayParam
|
} as CashierPayParam
|
||||||
cashierPay(from)
|
cashierPay(from)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
|
Reference in New Issue
Block a user