mirror of
https://gitee.com/bootx/dax-pay-h5.git
synced 2025-10-14 14:10:26 +00:00
eslint解决
This commit is contained in:
@@ -5,7 +5,8 @@ VITE_PORT=9100
|
||||
VITE_PUBLIC_PATH=/
|
||||
|
||||
# 跨域代理,可以配置多个,请注意不要换行
|
||||
VITE_PROXY=[["/server","http://localhost:19999"]]
|
||||
VITE_PROXY=[["/server","http://daxpay-api.test.yibeiguangnian.cn/"]]
|
||||
# VITE_PROXY=[["/server","https://pay1.bootx.cn/"]]
|
||||
|
||||
# API 接口地址
|
||||
VITE_GLOB_API_URL=
|
||||
|
@@ -1,19 +1,19 @@
|
||||
// axios配置 可自行根据项目进行更改,只需更改该文件即可,其他文件可以不动
|
||||
import type { AxiosResponse } from "axios";
|
||||
import axios from "axios";
|
||||
import { showDialog, showFailToast } from "vant";
|
||||
import { VAxios } from "./Axios";
|
||||
import type { AxiosTransform } from "./axiosTransform";
|
||||
import { checkStatus } from "./checkStatus";
|
||||
import { formatRequestDate, joinTimestamp } from "./helper";
|
||||
import type { CreateAxiosOptions, RequestOptions } from "./types";
|
||||
import { ContentTypeEnum, RequestEnum, ResultEnum } from "@/enums/httpEnum";
|
||||
import { useGlobSetting } from "@/hooks/setting";
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import axios from 'axios'
|
||||
import { showDialog, showFailToast } from 'vant'
|
||||
import { VAxios } from './Axios'
|
||||
import type { AxiosTransform } from './axiosTransform'
|
||||
import { checkStatus } from './checkStatus'
|
||||
import { formatRequestDate, joinTimestamp } from './helper'
|
||||
import type { CreateAxiosOptions, RequestOptions } from './types'
|
||||
import { ContentTypeEnum, RequestEnum, ResultEnum } from '@/enums/httpEnum'
|
||||
import { useGlobSetting } from '@/hooks/setting'
|
||||
|
||||
import { isString } from "@/utils/is/";
|
||||
import { deepMerge, isUrl } from "@/utils";
|
||||
import { setObjToUrlParams } from "@/utils/urlUtils";
|
||||
import type { Result } from "#/axios";
|
||||
import { isString } from '@/utils/is/'
|
||||
import { deepMerge, isUrl } from '@/utils'
|
||||
import { setObjToUrlParams } from '@/utils/urlUtils'
|
||||
import type { Result } from '#/axios'
|
||||
|
||||
const globSetting = useGlobSetting()
|
||||
const urlPrefix = globSetting.urlPrefix
|
||||
@@ -55,7 +55,7 @@ const transform: AxiosTransform = {
|
||||
throw new Error('请求出错,请稍候重试')
|
||||
}
|
||||
// 这里 code,result,message为 后台统一的字段,需要修改为项目自己的接口返回格式
|
||||
const { code, msg, data } = result
|
||||
const { code, msg } = result
|
||||
// 请求成功
|
||||
const hasSuccess = result && Reflect.has(result, 'code') && code === ResultEnum.SUCCESS
|
||||
// 是否显示提示信息
|
||||
@@ -83,6 +83,7 @@ const transform: AxiosTransform = {
|
||||
}
|
||||
|
||||
// 接口请求成功,直接返回相应结果
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if (code == ResultEnum.SUCCESS) {
|
||||
return result
|
||||
}
|
||||
@@ -99,8 +100,7 @@ const transform: AxiosTransform = {
|
||||
config.url = `${urlPrefix}${config.url}`
|
||||
}
|
||||
|
||||
if (!isUrlStr && apiUrl && isString(apiUrl)) {
|
||||
}
|
||||
if (!isUrlStr && apiUrl && isString(apiUrl)) { /* empty */ }
|
||||
const params = config.params || {}
|
||||
const data = config.data || false
|
||||
if (config.method?.toUpperCase() === RequestEnum.GET) {
|
||||
@@ -116,6 +116,7 @@ const transform: AxiosTransform = {
|
||||
}
|
||||
else {
|
||||
if (!isString(params)) {
|
||||
// eslint-disable-next-line ts/no-unused-expressions
|
||||
formatDate && formatRequestDate(params)
|
||||
if (
|
||||
Reflect.has(config, 'data')
|
||||
@@ -165,8 +166,8 @@ const transform: AxiosTransform = {
|
||||
title: '网络异常',
|
||||
message: '请检查您的网络连接是否正常',
|
||||
})
|
||||
.then(() => {})
|
||||
.catch(() => {})
|
||||
.then(() => { })
|
||||
.catch(() => { })
|
||||
return Promise.reject(error)
|
||||
}
|
||||
}
|
||||
|
@@ -34,14 +34,12 @@
|
||||
<h2>请选择支付方式</h2>
|
||||
<div class="payGoupList">
|
||||
<div
|
||||
v-for="item in orderAndConfig.groupConfigs[0].items"
|
||||
:key="item.id"
|
||||
class="payMethodsItem"
|
||||
v-for="item in orderAndConfig.groupConfigs[0].items" :key="item.id" class="payMethodsItem"
|
||||
@click="payTypeClick(item)"
|
||||
>
|
||||
<div class="itemType">
|
||||
<img v-if="item.icon == 'wechat'" src="@/assets/images/new_wx_pay.png" alt="">
|
||||
<img v-if="item.icon == 'alipay'" src="@/assets/images/zfb_pay.png" alt="">
|
||||
<img v-if="item.icon === 'wechat'" src="@/assets/images/new_wx_pay.png" alt="">
|
||||
<img v-if="item.icon === 'alipay'" src="@/assets/images/zfb_pay.png" alt="">
|
||||
<!-- <img src="@/assets/images/quick_pay.png" alt=""> -->
|
||||
<p>{{ item.name }}</p>
|
||||
<span v-if="item.recommend"> 推荐</span>
|
||||
@@ -73,7 +71,7 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, reactive, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import type { OrderAndConfig } from '@/views/daxpay/cashier/Cashier.api'
|
||||
import type { OrderAndConfig, payConfig } from '@/views/daxpay/cashier/Cashier.api'
|
||||
import { getOrderAndConfig, payOrder } from '@/views/daxpay/cashier/Cashier.api'
|
||||
|
||||
const route = useRoute()
|
||||
@@ -130,6 +128,7 @@ function getMinter() {
|
||||
watch(
|
||||
() => orderTime.totalTme,
|
||||
(newValue) => {
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if (newValue == 0) {
|
||||
router.replace('/PayExcessTime')
|
||||
}
|
||||
@@ -195,6 +194,7 @@ function init() {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5%;
|
||||
|
||||
.cash_topBox {
|
||||
height: 30%;
|
||||
background-color: #ffffff;
|
||||
@@ -204,26 +204,32 @@ function init() {
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding-bottom: 1.875rem;
|
||||
|
||||
.payPrice {
|
||||
margin-bottom: 1.25rem;
|
||||
display: flex;
|
||||
gap: 0.425rem;
|
||||
font-size: 2rem;
|
||||
|
||||
.unit {
|
||||
transform: translateY(0.125rem) scale(1, 0.8);
|
||||
}
|
||||
}
|
||||
|
||||
.excessTime {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.3125rem;
|
||||
|
||||
.exTitle {
|
||||
color: #9fa1a2;
|
||||
margin-right: 0.3125rem;
|
||||
}
|
||||
|
||||
.point {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.number {
|
||||
display: block;
|
||||
background-color: #ffece8;
|
||||
@@ -231,25 +237,30 @@ function init() {
|
||||
padding: 0.1875rem;
|
||||
}
|
||||
}
|
||||
|
||||
.payMessItem {
|
||||
display: flex;
|
||||
gap: 0.5125rem;
|
||||
color: #9fa1a2;
|
||||
}
|
||||
}
|
||||
|
||||
.cash_bodyBox {
|
||||
height: 68.5%;
|
||||
font-weight: 600;
|
||||
background-color: #ffffff;
|
||||
padding: 0.9375rem 1.625rem;
|
||||
position: relative;
|
||||
|
||||
h2 {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.payGoupList {
|
||||
width: 100%;
|
||||
overflow: scroll;
|
||||
height: calc(100% - 6.9375rem);
|
||||
|
||||
.payMethodsItem {
|
||||
height: 3.75rem;
|
||||
line-height: 3.75rem;
|
||||
@@ -258,14 +269,17 @@ function init() {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.itemType {
|
||||
display: flex;
|
||||
gap: 0.625rem;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
}
|
||||
|
||||
span {
|
||||
border: 1px solid #3882c2;
|
||||
color: #3882c2;
|
||||
@@ -275,6 +289,7 @@ function init() {
|
||||
border-radius: 0.3125rem;
|
||||
}
|
||||
}
|
||||
|
||||
.selectBox {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
@@ -282,6 +297,7 @@ function init() {
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
border: 1px solid #ccc;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -289,6 +305,7 @@ function init() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.payBtnBox {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
@@ -303,10 +320,12 @@ function init() {
|
||||
line-height: 3.25rem;
|
||||
border-radius: 0.625rem;
|
||||
}
|
||||
|
||||
.noSelect {
|
||||
background-color: #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
/* loading */
|
||||
.loadingMask {
|
||||
position: fixed;
|
||||
@@ -320,6 +339,7 @@ function init() {
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
z-index: 99;
|
||||
border-radius: 0 0 0.2rem 0.2rem;
|
||||
|
||||
.content {
|
||||
position: absolute;
|
||||
width: 15rem;
|
||||
@@ -336,28 +356,34 @@ function init() {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.loadingImg {
|
||||
width: 1.6rem;
|
||||
height: 1.6rem;
|
||||
margin-top: 2rem;
|
||||
animation: 1.6s linear ratate infinite;
|
||||
}
|
||||
|
||||
.loadingTxt {
|
||||
font-size: 1.125rem;
|
||||
color: #22242e;
|
||||
margin-top: 1.2rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
@keyframes ratate {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
40% {
|
||||
transform: rotate(144deg);
|
||||
}
|
||||
|
||||
80% {
|
||||
transform: rotate(288deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
|
@@ -1,22 +1,32 @@
|
||||
<template>
|
||||
<div class="payFail">
|
||||
<div class="payLogo">
|
||||
<img src="@/assets/images/fail1.png" alt="" />
|
||||
<img src="@/assets/images/fail1.png" alt="">
|
||||
<p>支付失败</p>
|
||||
<span>订单超时自动关闭,请重新发起支付</span>
|
||||
</div>
|
||||
<div class="payPrice">
|
||||
<span class="unit">¥</span>
|
||||
<div class="price">793.21</div>
|
||||
<div class="price">
|
||||
793.21
|
||||
</div>
|
||||
</div>
|
||||
<div class="payMessBox">
|
||||
<div class="payMessItem">
|
||||
<div class="itemTitle">支付标题</div>
|
||||
<div class="itemContent">商业版 1288 预购版</div>
|
||||
<div class="itemTitle">
|
||||
支付标题
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
商业版 1288 预购版
|
||||
</div>
|
||||
</div>
|
||||
<div class="payMessItem">
|
||||
<div class="itemTitle">订单编号</div>
|
||||
<div class="itemContent">20708483506</div>
|
||||
<div class="itemTitle">
|
||||
订单编号
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
20708483506
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,14 +34,14 @@
|
||||
关闭
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
<script setup lang="ts">
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.payFail {
|
||||
<style scoped lang="less">
|
||||
.payFail {
|
||||
padding: 3.5rem 0rem;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
@@ -41,78 +51,84 @@ import { useRoute, useRouter } from "vue-router";
|
||||
align-items: center;
|
||||
gap: 3rem;
|
||||
position: relative;
|
||||
|
||||
.payLogo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.25rem;
|
||||
align-items: center;
|
||||
img{
|
||||
|
||||
img {
|
||||
width: 3.125rem;
|
||||
height: 3.125rem;
|
||||
}
|
||||
p{
|
||||
font-size:1.5rem;
|
||||
|
||||
p {
|
||||
font-size: 1.5rem;
|
||||
color: #e74e4e;
|
||||
font-weight: 700;
|
||||
}
|
||||
span{
|
||||
font-size:.75rem;
|
||||
|
||||
span {
|
||||
font-size: 0.75rem;
|
||||
letter-spacing: 2px;
|
||||
font-size: .875rem;
|
||||
font-size: 0.875rem;
|
||||
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
.payPrice{
|
||||
|
||||
.payPrice {
|
||||
display: flex;
|
||||
gap: .315rem;
|
||||
gap: 0.315rem;
|
||||
align-items: center;
|
||||
|
||||
.unit{
|
||||
font-size:.75rem;
|
||||
transform: translateY(.525rem);
|
||||
.unit {
|
||||
font-size: 0.75rem;
|
||||
transform: translateY(0.525rem);
|
||||
}
|
||||
.price{
|
||||
font-size:2rem;
|
||||
|
||||
.price {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
.payMessBox{
|
||||
|
||||
.payMessBox {
|
||||
width: 100%;
|
||||
padding: 0px 1.25rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: .625rem;
|
||||
.payMessItem{
|
||||
gap: 0.625rem;
|
||||
|
||||
.payMessItem {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.itemTitle{
|
||||
font-size:1rem;
|
||||
|
||||
.itemTitle {
|
||||
font-size: 1rem;
|
||||
color: #797d81;
|
||||
}
|
||||
.itemContent{
|
||||
font-size:1rem;
|
||||
|
||||
.itemContent {
|
||||
font-size: 1rem;
|
||||
font-weight: 500;
|
||||
font-size: "微软雅黑";
|
||||
font-size: '微软雅黑';
|
||||
}
|
||||
}
|
||||
}
|
||||
.payBtnBox{
|
||||
|
||||
.payBtnBox {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background-color: #e74e4e;
|
||||
color: #fff;
|
||||
height: 3.25rem;
|
||||
position: absolute;
|
||||
bottom:3.75rem;
|
||||
bottom: 3.75rem;
|
||||
text-align: center;
|
||||
line-height: 3.25rem;
|
||||
border-radius:.625rem;
|
||||
border-radius: 0.625rem;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user