eslint解决

This commit is contained in:
ren
2025-03-29 09:55:01 +08:00
parent acbf61d85b
commit 44d2c6cd66
4 changed files with 177 additions and 133 deletions

View File

@@ -5,7 +5,8 @@ VITE_PORT=9100
VITE_PUBLIC_PATH=/ 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 接口地址 # API 接口地址
VITE_GLOB_API_URL= VITE_GLOB_API_URL=

View File

@@ -1,19 +1,19 @@
// axios配置 可自行根据项目进行更改,只需更改该文件即可,其他文件可以不动 // axios配置 可自行根据项目进行更改,只需更改该文件即可,其他文件可以不动
import type { AxiosResponse } from "axios"; import type { AxiosResponse } from 'axios'
import axios from "axios"; import axios from 'axios'
import { showDialog, showFailToast } from "vant"; import { showDialog, showFailToast } from 'vant'
import { VAxios } from "./Axios"; import { VAxios } from './Axios'
import type { AxiosTransform } from "./axiosTransform"; import type { AxiosTransform } from './axiosTransform'
import { checkStatus } from "./checkStatus"; import { checkStatus } from './checkStatus'
import { formatRequestDate, joinTimestamp } from "./helper"; import { formatRequestDate, joinTimestamp } from './helper'
import type { CreateAxiosOptions, RequestOptions } from "./types"; import type { CreateAxiosOptions, RequestOptions } from './types'
import { ContentTypeEnum, RequestEnum, ResultEnum } from "@/enums/httpEnum"; import { ContentTypeEnum, RequestEnum, ResultEnum } from '@/enums/httpEnum'
import { useGlobSetting } from "@/hooks/setting"; import { useGlobSetting } from '@/hooks/setting'
import { isString } from "@/utils/is/"; import { isString } from '@/utils/is/'
import { deepMerge, isUrl } from "@/utils"; import { deepMerge, isUrl } from '@/utils'
import { setObjToUrlParams } from "@/utils/urlUtils"; import { setObjToUrlParams } from '@/utils/urlUtils'
import type { Result } from "#/axios"; import type { Result } from '#/axios'
const globSetting = useGlobSetting() const globSetting = useGlobSetting()
const urlPrefix = globSetting.urlPrefix const urlPrefix = globSetting.urlPrefix
@@ -55,7 +55,7 @@ const transform: AxiosTransform = {
throw new Error('请求出错,请稍候重试') throw new Error('请求出错,请稍候重试')
} }
// 这里 coderesultmessage为 后台统一的字段,需要修改为项目自己的接口返回格式 // 这里 coderesultmessage为 后台统一的字段,需要修改为项目自己的接口返回格式
const { code, msg, data } = result const { code, msg } = result
// 请求成功 // 请求成功
const hasSuccess = result && Reflect.has(result, 'code') && code === ResultEnum.SUCCESS 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) { if (code == ResultEnum.SUCCESS) {
return result return result
} }
@@ -99,8 +100,7 @@ const transform: AxiosTransform = {
config.url = `${urlPrefix}${config.url}` config.url = `${urlPrefix}${config.url}`
} }
if (!isUrlStr && apiUrl && isString(apiUrl)) { if (!isUrlStr && apiUrl && isString(apiUrl)) { /* empty */ }
}
const params = config.params || {} const params = config.params || {}
const data = config.data || false const data = config.data || false
if (config.method?.toUpperCase() === RequestEnum.GET) { if (config.method?.toUpperCase() === RequestEnum.GET) {
@@ -116,6 +116,7 @@ const transform: AxiosTransform = {
} }
else { else {
if (!isString(params)) { if (!isString(params)) {
// eslint-disable-next-line ts/no-unused-expressions
formatDate && formatRequestDate(params) formatDate && formatRequestDate(params)
if ( if (
Reflect.has(config, 'data') Reflect.has(config, 'data')
@@ -165,8 +166,8 @@ const transform: AxiosTransform = {
title: '网络异常', title: '网络异常',
message: '请检查您的网络连接是否正常', message: '请检查您的网络连接是否正常',
}) })
.then(() => {}) .then(() => { })
.catch(() => {}) .catch(() => { })
return Promise.reject(error) return Promise.reject(error)
} }
} }

View File

@@ -34,14 +34,12 @@
<h2>请选择支付方式</h2> <h2>请选择支付方式</h2>
<div class="payGoupList"> <div class="payGoupList">
<div <div
v-for="item in orderAndConfig.groupConfigs[0].items" v-for="item in orderAndConfig.groupConfigs[0].items" :key="item.id" class="payMethodsItem"
:key="item.id"
class="payMethodsItem"
@click="payTypeClick(item)" @click="payTypeClick(item)"
> >
<div class="itemType"> <div class="itemType">
<img v-if="item.icon == 'wechat'" src="@/assets/images/new_wx_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 v-if="item.icon === 'alipay'" src="@/assets/images/zfb_pay.png" alt="">
<!-- <img src="@/assets/images/quick_pay.png" alt=""> --> <!-- <img src="@/assets/images/quick_pay.png" alt=""> -->
<p>{{ item.name }}</p> <p>{{ item.name }}</p>
<span v-if="item.recommend"> 推荐</span> <span v-if="item.recommend"> 推荐</span>
@@ -73,7 +71,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, onUnmounted, reactive, ref } from 'vue' import { onMounted, onUnmounted, reactive, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router' 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' import { getOrderAndConfig, payOrder } from '@/views/daxpay/cashier/Cashier.api'
const route = useRoute() const route = useRoute()
@@ -130,6 +128,7 @@ function getMinter() {
watch( watch(
() => orderTime.totalTme, () => orderTime.totalTme,
(newValue) => { (newValue) => {
// eslint-disable-next-line eqeqeq
if (newValue == 0) { if (newValue == 0) {
router.replace('/PayExcessTime') router.replace('/PayExcessTime')
} }
@@ -195,6 +194,7 @@ function init() {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1.5%; gap: 1.5%;
.cash_topBox { .cash_topBox {
height: 30%; height: 30%;
background-color: #ffffff; background-color: #ffffff;
@@ -204,26 +204,32 @@ function init() {
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
padding-bottom: 1.875rem; padding-bottom: 1.875rem;
.payPrice { .payPrice {
margin-bottom: 1.25rem; margin-bottom: 1.25rem;
display: flex; display: flex;
gap: 0.425rem; gap: 0.425rem;
font-size: 2rem; font-size: 2rem;
.unit { .unit {
transform: translateY(0.125rem) scale(1, 0.8); transform: translateY(0.125rem) scale(1, 0.8);
} }
} }
.excessTime { .excessTime {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.3125rem; gap: 0.3125rem;
.exTitle { .exTitle {
color: #9fa1a2; color: #9fa1a2;
margin-right: 0.3125rem; margin-right: 0.3125rem;
} }
.point { .point {
font-weight: 700; font-weight: 700;
} }
.number { .number {
display: block; display: block;
background-color: #ffece8; background-color: #ffece8;
@@ -231,25 +237,30 @@ function init() {
padding: 0.1875rem; padding: 0.1875rem;
} }
} }
.payMessItem { .payMessItem {
display: flex; display: flex;
gap: 0.5125rem; gap: 0.5125rem;
color: #9fa1a2; color: #9fa1a2;
} }
} }
.cash_bodyBox { .cash_bodyBox {
height: 68.5%; height: 68.5%;
font-weight: 600; font-weight: 600;
background-color: #ffffff; background-color: #ffffff;
padding: 0.9375rem 1.625rem; padding: 0.9375rem 1.625rem;
position: relative; position: relative;
h2 { h2 {
margin-bottom: 1.25rem; margin-bottom: 1.25rem;
} }
.payGoupList { .payGoupList {
width: 100%; width: 100%;
overflow: scroll; overflow: scroll;
height: calc(100% - 6.9375rem); height: calc(100% - 6.9375rem);
.payMethodsItem { .payMethodsItem {
height: 3.75rem; height: 3.75rem;
line-height: 3.75rem; line-height: 3.75rem;
@@ -258,14 +269,17 @@ function init() {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.itemType { .itemType {
display: flex; display: flex;
gap: 0.625rem; gap: 0.625rem;
align-items: center; align-items: center;
img { img {
width: 1.25rem; width: 1.25rem;
height: 1.25rem; height: 1.25rem;
} }
span { span {
border: 1px solid #3882c2; border: 1px solid #3882c2;
color: #3882c2; color: #3882c2;
@@ -275,6 +289,7 @@ function init() {
border-radius: 0.3125rem; border-radius: 0.3125rem;
} }
} }
.selectBox { .selectBox {
width: 1.25rem; width: 1.25rem;
height: 1.25rem; height: 1.25rem;
@@ -282,6 +297,7 @@ function init() {
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
border: 1px solid #ccc; border: 1px solid #ccc;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
@@ -289,6 +305,7 @@ function init() {
} }
} }
} }
.payBtnBox { .payBtnBox {
width: 90%; width: 90%;
margin: 0 auto; margin: 0 auto;
@@ -303,10 +320,12 @@ function init() {
line-height: 3.25rem; line-height: 3.25rem;
border-radius: 0.625rem; border-radius: 0.625rem;
} }
.noSelect { .noSelect {
background-color: #ccc; background-color: #ccc;
} }
} }
/* loading */ /* loading */
.loadingMask { .loadingMask {
position: fixed; position: fixed;
@@ -320,6 +339,7 @@ function init() {
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
z-index: 99; z-index: 99;
border-radius: 0 0 0.2rem 0.2rem; border-radius: 0 0 0.2rem 0.2rem;
.content { .content {
position: absolute; position: absolute;
width: 15rem; width: 15rem;
@@ -336,28 +356,34 @@ function init() {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
.loadingImg { .loadingImg {
width: 1.6rem; width: 1.6rem;
height: 1.6rem; height: 1.6rem;
margin-top: 2rem; margin-top: 2rem;
animation: 1.6s linear ratate infinite; animation: 1.6s linear ratate infinite;
} }
.loadingTxt { .loadingTxt {
font-size: 1.125rem; font-size: 1.125rem;
color: #22242e; color: #22242e;
margin-top: 1.2rem; margin-top: 1.2rem;
margin-bottom: 2rem; margin-bottom: 2rem;
} }
@keyframes ratate { @keyframes ratate {
0% { 0% {
transform: rotate(0deg); transform: rotate(0deg);
} }
40% { 40% {
transform: rotate(144deg); transform: rotate(144deg);
} }
80% { 80% {
transform: rotate(288deg); transform: rotate(288deg);
} }
100% { 100% {
transform: rotate(360deg); transform: rotate(360deg);
} }

View File

@@ -1,118 +1,134 @@
<template> <template>
<div class="payFail"> <div class="payFail">
<div class="payLogo"> <div class="payLogo">
<img src="@/assets/images/fail1.png" alt="" /> <img src="@/assets/images/fail1.png" alt="">
<p>支付失败</p> <p>支付失败</p>
<span>订单超时自动关闭请重新发起支付</span> <span>订单超时自动关闭请重新发起支付</span>
</div> </div>
<div class="payPrice"> <div class="payPrice">
<span class="unit"></span> <span class="unit"></span>
<div class="price">793.21</div> <div class="price">
</div> 793.21
<div class="payMessBox">
<div class="payMessItem">
<div class="itemTitle">支付标题</div>
<div class="itemContent">商业版 1288 预购版</div>
</div>
<div class="payMessItem">
<div class="itemTitle">订单编号</div>
<div class="itemContent">20708483506</div>
</div>
</div>
<div class="payBtnBox">
关闭
</div> </div>
</div> </div>
</template> <div class="payMessBox">
<div class="payMessItem">
<script setup lang="ts"> <div class="itemTitle">
import { useRoute, useRouter } from "vue-router"; 支付标题
</div>
<div class="itemContent">
商业版 1288 预购版
</div>
</div>
<div class="payMessItem">
<div class="itemTitle">
订单编号
</div>
<div class="itemContent">
20708483506
</div>
</div>
</div>
<div class="payBtnBox">
关闭
</div>
</div>
</template>
<script setup lang="ts">
import { useRoute, useRouter } from 'vue-router'
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.payFail { .payFail {
padding: 3.5rem 0rem; padding: 3.5rem 0rem;
width: 100%; width: 100%;
height: 100vh; height: 100vh;
background-color: #fff; background-color: #fff;
display: flex;
flex-direction: column;
align-items: center;
gap: 3rem;
position: relative;
.payLogo {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1.25rem;
align-items: center; align-items: center;
gap: 3rem;
position: relative; img {
.payLogo { width: 3.125rem;
display: flex; height: 3.125rem;
flex-direction: column;
gap: 1.25rem;
align-items: center;
img{
width: 3.125rem;
height: 3.125rem;
}
p{
font-size:1.5rem;
color: #e74e4e;
font-weight: 700;
}
span{
font-size:.75rem;
letter-spacing: 2px;
font-size: .875rem;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
} }
.payPrice{
display: flex; p {
gap: .315rem; font-size: 1.5rem;
align-items: center; color: #e74e4e;
font-weight: 700;
.unit{
font-size:.75rem;
transform: translateY(.525rem);
}
.price{
font-size:2rem;
font-weight: 700;
}
} }
.payMessBox{
width: 100%; span {
padding: 0px 1.25rem; font-size: 0.75rem;
display: flex; letter-spacing: 2px;
flex-direction: column; font-size: 0.875rem;
gap: .625rem; font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
.payMessItem{
width: 100%;
display: flex;
justify-content: space-between;
.itemTitle{
font-size:1rem;
color: #797d81;
}
.itemContent{
font-size:1rem;
font-weight: 500;
font-size: "微软雅黑";
}
}
} }
.payBtnBox{
width: 90%;
margin: 0 auto;
background-color: #e74e4e;
color: #fff;
height: 3.25rem;
position: absolute;
bottom:3.75rem;
text-align: center;
line-height: 3.25rem;
border-radius:.625rem;
}
} }
</style>
.payPrice {
display: flex;
gap: 0.315rem;
align-items: center;
.unit {
font-size: 0.75rem;
transform: translateY(0.525rem);
}
.price {
font-size: 2rem;
font-weight: 700;
}
}
.payMessBox {
width: 100%;
padding: 0px 1.25rem;
display: flex;
flex-direction: column;
gap: 0.625rem;
.payMessItem {
width: 100%;
display: flex;
justify-content: space-between;
.itemTitle {
font-size: 1rem;
color: #797d81;
}
.itemContent {
font-size: 1rem;
font-weight: 500;
font-size: '微软雅黑';
}
}
}
.payBtnBox {
width: 90%;
margin: 0 auto;
background-color: #e74e4e;
color: #fff;
height: 3.25rem;
position: absolute;
bottom: 3.75rem;
text-align: center;
line-height: 3.25rem;
border-radius: 0.625rem;
}
}
</style>