Commit bbb010f2 by Jaxon

refactor: 调整eslint规则,格式化aus-app

1 parent 064099dd
Showing 115 changed files with 1499 additions and 1260 deletions
module.exports = { module.exports = {
presets: [ presets: [
'@vue/cli-plugin-babel/preset' "@vue/cli-plugin-babel/preset"
] ]
} };
/// <reference types='@dcloudio/types' /> // / <reference types='@dcloudio/types' />
import 'vue' import "vue";
declare module '@vue/runtime-core' { declare module "@vue/runtime-core" {
type Hooks = App.AppInstance & Page.PageInstance; type Hooks = App.AppInstance & Page.PageInstance;
interface ComponentCustomOptions extends Hooks { type ComponentCustomOptions = Hooks;
}
} }
import {AxiosResponse, AxiosStatic} from 'axios'; import { AxiosResponse, AxiosStatic } from "axios";
import dayjs,{Dayjs} from 'dayjs'; import { AccountInfo } from "lib/src/entity/account/domain/AccountInfo";
import { AccountProfile } from "lib/src/entity/account/domain/AccountProfile";
// region 前端扩展导入包 // region 前端扩展导入包
import {Account} from "lib/src/entity/account/entity/Account"; import { Account } from "lib/src/entity/account/entity/Account";
import {AccountTag} from "lib/src/entity/account/entity/AccountTag"; import { AccountTag } from "lib/src/entity/account/entity/AccountTag";
import {AccountProfile} from "lib/src/entity/account/domain/AccountProfile";
import {Page} from "autumn-vue/lib/core/page/Page";
import {AccountInfo} from "lib/src/entity/account/domain/AccountInfo";
// endregion // endregion
/** /**
* 个人账户(Account) PI接口 * 个人账户(Account) PI接口
* @author gonglei * @author gonglei
* @since 2025-10-13 12:18:11 * @since 2025-10-13 12:18:11
*/ */
export class AccountController{ export const AccountController= {
/** /**
*/ */
static certifyAccount(axios:AxiosStatic, certification: any): Promise<AxiosResponse<Account>> { certifyAccount(axios:AxiosStatic, certification: any): Promise<AxiosResponse<Account>> {
return axios.post('account/certifyAccount', certification); return axios.post("account/certifyAccount", certification);
} },
/** /**
* 根据id查询用户分组 * 根据id查询用户分组
* @param groupId * @param groupId
* @return AccountTag * @return AccountTag
*/ */
static getAccountGroupById(axios:AxiosStatic, groupId: number): Promise<AxiosResponse<AccountTag>> { getAccountGroupById(axios:AxiosStatic, groupId: number): Promise<AxiosResponse<AccountTag>> {
return axios.get('account/getAccountGroupById', {params: {groupId: groupId}}); return axios.get("account/getAccountGroupById", { params: { groupId } });
} },
/** /**
* 查询个人账户信息 * 查询个人账户信息
* @param account * @param account
* @return AccountInfo * @return AccountInfo
*/ */
static getAccountInfo(axios:AxiosStatic): Promise<AxiosResponse<AccountInfo>> { getAccountInfo(axios:AxiosStatic): Promise<AxiosResponse<AccountInfo>> {
return axios.get('account/getAccountInfo'); return axios.get("account/getAccountInfo");
} },
/** /**
* 根据id查询个人账户 * 根据id查询个人账户
* @param account * @param account
* @return AccountProfile * @return AccountProfile
*/ */
static getAccountProfile(axios:AxiosStatic): Promise<AxiosResponse<AccountProfile>> { getAccountProfile(axios:AxiosStatic): Promise<AxiosResponse<AccountProfile>> {
return axios.get('account/getAccountProfile'); return axios.get("account/getAccountProfile");
} },
/** /**
*/ */
static getLoginAccount(axios:AxiosStatic): Promise<AxiosResponse<Account>> { getLoginAccount(axios:AxiosStatic): Promise<AxiosResponse<Account>> {
return axios.get('account/getLoginAccount'); return axios.get("account/getLoginAccount");
} },
/** /**
*/ */
static updateAccountAvatar(axios:AxiosStatic, accountInfo: any): Promise<AxiosResponse<Account>> { updateAccountAvatar(axios:AxiosStatic, accountInfo: any): Promise<AxiosResponse<Account>> {
return axios.post('account/updateAccountAvatar', accountInfo); return axios.post("account/updateAccountAvatar", accountInfo);
} },
/** /**
*/ */
static updateAccountCityCode(axios:AxiosStatic, cityCode: string): Promise<AxiosResponse<string>> { updateAccountCityCode(axios:AxiosStatic, cityCode: string): Promise<AxiosResponse<string>> {
return axios.post('account/updateAccountCityCode', null, {params: {cityCode: cityCode}}); return axios.post("account/updateAccountCityCode", null, { params: { cityCode } });
} },
/** /**
* 修改个人账户 * 修改个人账户
* @param account * @param account
* @return Account * @return Account
*/ */
static updateAccountInfo(axios:AxiosStatic, accountInfo: any): Promise<AxiosResponse<Account>> { updateAccountInfo(axios:AxiosStatic, accountInfo: any): Promise<AxiosResponse<Account>> {
return axios.post('account/updateAccountInfo', accountInfo); return axios.post("account/updateAccountInfo", accountInfo);
} },
/** /**
*/ */
static updateAccountNickName(axios:AxiosStatic, accountInfo: any): Promise<AxiosResponse<Account>> { updateAccountNickName(axios:AxiosStatic, accountInfo: any): Promise<AxiosResponse<Account>> {
return axios.post('account/updateAccountNickName', accountInfo); return axios.post("account/updateAccountNickName", accountInfo);
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { AxiosResponse, AxiosStatic } from "axios";
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包 // region 前端扩展导入包
import {Agreement} from "lib/src/entity/business/entity/Agreement"; import { Agreement } from "lib/src/entity/business/entity/Agreement";
// endregion // endregion
/** /**
* 协议管理(Agreement) PI接口 * 协议管理(Agreement) PI接口
* @author gonglei * @author gonglei
* @since 2025-10-13 12:18:11 * @since 2025-10-13 12:18:11
*/ */
export class AgreementController{ export const AgreementController= {
/** /**
* 根据id查询协议管理 * 根据id查询协议管理
* @param agreementKey * @param agreementKey
* @return Agreement * @return Agreement
*/ */
static getAgreementByKey(axios:AxiosStatic, agreementKey: any): Promise<AxiosResponse<Agreement>> { getAgreementByKey(axios:AxiosStatic, agreementKey: any): Promise<AxiosResponse<Agreement>> {
return axios.get('agreement/getAgreementByKey', {params: {agreementKey: agreementKey}}); return axios.get("agreement/getAgreementByKey", { params: { agreementKey } });
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { AxiosResponse, AxiosStatic } from "axios";
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包 // region 前端扩展导入包
import {Appeal} from "lib/src/entity/auction/entity/Appeal"; import { Appeal } from "lib/src/entity/auction/entity/Appeal";
// endregion // endregion
/** /**
* 申诉(Appeal) PI接口 * 申诉(Appeal) PI接口
* @author gonglei * @author gonglei
* @since 2025-10-13 12:18:11 * @since 2025-10-13 12:18:11
*/ */
export class AppealController{ export const AppealController= {
/** /**
* 新增申诉 * 新增申诉
* @param appeal * @param appeal
* @return Appeal * @return Appeal
*/ */
static addAppeal(axios:AxiosStatic, appeal: any): Promise<AxiosResponse<Appeal>> { addAppeal(axios:AxiosStatic, appeal: any): Promise<AxiosResponse<Appeal>> {
return axios.post('appeal/addAppeal', appeal); return axios.post("appeal/addAppeal", appeal);
} },
/** /**
* 根据id查询申诉 * 根据id查询申诉
* @param appealId * @param appealId
* @return Appeal * @return Appeal
*/ */
static getAppealById(axios:AxiosStatic, appealId: number): Promise<AxiosResponse<Appeal>> { getAppealById(axios:AxiosStatic, appealId: number): Promise<AxiosResponse<Appeal>> {
return axios.get('appeal/getAppealById', {params: {appealId: appealId}}); return axios.get("appeal/getAppealById", { params: { appealId } });
} },
/** /**
*/ */
static getAppealByOrderId(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<Appeal>> { getAppealByOrderId(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<Appeal>> {
return axios.get('appeal/getAppealByOrderId', {params: {orderId: orderId}}); return axios.get("appeal/getAppealByOrderId", { params: { orderId } });
} },
/** /**
* 分页查询申诉 * 分页查询申诉
* @param pagination * @param pagination
* @return Page * @return Page
*/ */
static pageAppeal(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Appeal>>> { pageAppeal(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Appeal>>> {
return axios.post('appeal/pageAppeal', pagination); return axios.post("appeal/pageAppeal", pagination);
} },
static PAGE_APPEAL = 'appeal/pageAppeal'; PAGE_APPEAL : "appeal/pageAppeal",
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import type { Page } from "autumn-vue/lib/core/page/Page";
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包 // region 前端扩展导入包
import type {Auction} from "lib/src/entity/auction/entity/Auction"; import type { Auction } from "lib/src/entity/auction/entity/Auction";
import type {AuctionVehicle} from "lib/src/entity/auction/entity/AuctionVehicle"; import type { AuctionVehicle } from "lib/src/entity/auction/entity/AuctionVehicle";
import type {Page} from "autumn-vue/lib/core/page/Page";
import { AxiosResponse, AxiosStatic } from "axios";
// endregion // endregion
/** /**
* 拍卖场次(Auction) PI接口 * 拍卖场次(Auction) PI接口
* @author gonglei * @author gonglei
* @since 2025-10-13 12:18:11 * @since 2025-10-13 12:18:11
*/ */
export class AuctionController{ export const AuctionController= {
/** /**
* 根据id查询拍卖场次 * 根据id查询拍卖场次
* @param auctionId * @param auctionId
* @return Auction * @return Auction
*/ */
static getAuctionById(axios:AxiosStatic, auctionId: number): Promise<AxiosResponse<Auction>> { getAuctionById(axios:AxiosStatic, auctionId: number): Promise<AxiosResponse<Auction>> {
return axios.get('auction/getAuctionById', {params: {auctionId: auctionId}}); return axios.get("auction/getAuctionById", { params: { auctionId } });
} },
/** /**
* 根据id查询拍卖车辆 * 根据id查询拍卖车辆
* @param aucvehId * @param aucvehId
* @return AuctionVehicle * @return AuctionVehicle
*/ */
static getAuctionVehicleById(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<AuctionVehicle>> { getAuctionVehicleById(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<AuctionVehicle>> {
return axios.get('auction/getAuctionVehicleById', {params: {aucvehId: aucvehId}}); return axios.get("auction/getAuctionVehicleById", { params: { aucvehId } });
} },
/** /**
* 根据id查询拍卖车辆详情 * 根据id查询拍卖车辆详情
...@@ -38,9 +38,9 @@ export class AuctionController{ ...@@ -38,9 +38,9 @@ export class AuctionController{
* @param account * @param account
* @return AuctionVehicle * @return AuctionVehicle
*/ */
static getAuctionVehicleDetailById(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<AuctionVehicle>> { getAuctionVehicleDetailById(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<AuctionVehicle>> {
return axios.get('auction/getAuctionVehicleDetailById', {params: {aucvehId: aucvehId}}); return axios.get("auction/getAuctionVehicleDetailById", { params: { aucvehId } });
} },
/** /**
* 分页查询暗拍卖车辆 * 分页查询暗拍卖车辆
...@@ -48,33 +48,33 @@ export class AuctionController{ ...@@ -48,33 +48,33 @@ export class AuctionController{
* @param account * @param account
* @return Page * @return Page
*/ */
static pageDarkAuctionVehicle(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<AuctionVehicle>>> { pageDarkAuctionVehicle(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<AuctionVehicle>>> {
return axios.post('auction/pageDarkAuctionVehicle', pagination); return axios.post("auction/pageDarkAuctionVehicle", pagination);
} },
static PAGE_DARK_AUCTION_VEHICLE = 'auction/pageDarkAuctionVehicle'; PAGE_DARK_AUCTION_VEHICLE : "auction/pageDarkAuctionVehicle",
/** /**
* 分页查询明拍卖场次 * 分页查询明拍卖场次
* @param pagination * @param pagination
* @return Page * @return Page
*/ */
static pageLightAuction(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Auction>>> { pageLightAuction(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Auction>>> {
return axios.post('auction/pageLightAuction', pagination); return axios.post("auction/pageLightAuction", pagination);
} },
static PAGE_LIGHT_AUCTION = 'auction/pageLightAuction'; PAGE_LIGHT_AUCTION : "auction/pageLightAuction",
/** /**
* 分页查询拍卖车辆 * 分页查询拍卖车辆
* @param pagination * @param pagination
* @return Page * @return Page
*/ */
static pageLightAuctionVehicle(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<AuctionVehicle>>> { pageLightAuctionVehicle(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<AuctionVehicle>>> {
return axios.post('auction/pageLightAuctionVehicle', pagination); return axios.post("auction/pageLightAuctionVehicle", pagination);
} },
static PAGE_LIGHT_AUCTION_VEHICLE = 'auction/pageLightAuctionVehicle'; PAGE_LIGHT_AUCTION_VEHICLE : "auction/pageLightAuctionVehicle",
/** /**
* 首页随机排序拍卖车辆 * 首页随机排序拍卖车辆
...@@ -82,11 +82,11 @@ export class AuctionController{ ...@@ -82,11 +82,11 @@ export class AuctionController{
* @param account * @param account
* @return Page * @return Page
*/ */
static pageRandomAuctionVehicle(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<AuctionVehicle>>> { pageRandomAuctionVehicle(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<AuctionVehicle>>> {
return axios.post('auction/pageRandomAuctionVehicle', pagination); return axios.post("auction/pageRandomAuctionVehicle", pagination);
} },
static PAGE_RANDOM_AUCTION_VEHICLE = 'auction/pageRandomAuctionVehicle'; PAGE_RANDOM_AUCTION_VEHICLE : "auction/pageRandomAuctionVehicle",
/** /**
* 搜索拍卖车辆 * 搜索拍卖车辆
...@@ -94,12 +94,12 @@ export class AuctionController{ ...@@ -94,12 +94,12 @@ export class AuctionController{
* @param account * @param account
* @return Page * @return Page
*/ */
static searchAuctionVehicle(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<AuctionVehicle>>> { searchAuctionVehicle(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<AuctionVehicle>>> {
return axios.post('auction/searchAuctionVehicle', pagination); return axios.post("auction/searchAuctionVehicle", pagination);
} },
static SEARCH_AUCTION_VEHICLE = 'auction/searchAuctionVehicle'; SEARCH_AUCTION_VEHICLE : "auction/searchAuctionVehicle",
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios';
import dayjs,{Dayjs} from 'dayjs'; import { Page } from "autumn-vue/lib/core/page/Page";
import { AxiosResponse, AxiosStatic } from "axios";
// region 前端扩展导入包 // region 前端扩展导入包
import {AuctionOrder} from "lib/src/entity/auction/entity/AuctionOrder"; import { AuctionOrder } from "lib/src/entity/auction/entity/AuctionOrder";
import type {AuctionOrder_OrderState} from "lib/src/entity/auction/entity/AuctionOrder"; import { Contract } from "lib/src/entity/auction/entity/Contract";
import {Page} from "autumn-vue/lib/core/page/Page";
import {Contract} from "lib/src/entity/auction/entity/Contract";
// endregion // endregion
/** /**
* 拍卖订单(AuctionOrder) PI接口 * 拍卖订单(AuctionOrder) PI接口
* @author gonglei * @author gonglei
* @since 2025-10-13 12:18:11 * @since 2025-10-13 12:18:11
*/ */
export class AuctionOrderController{ export const AuctionOrderController= {
/** /**
* 发起E签宝合国签署流程 * 发起E签宝合国签署流程
* @param signOrder * @param signOrder
* @return Contract * @return Contract
*/ */
static esignAuctionOrderContract(axios:AxiosStatic, signOrder: any): Promise<AxiosResponse<Contract>> { esignAuctionOrderContract(axios:AxiosStatic, signOrder: any): Promise<AxiosResponse<Contract>> {
return axios.post('order/esignAuctionOrderContract', signOrder); return axios.post("order/esignAuctionOrderContract", signOrder);
} },
/** /**
* 根据id查询拍卖订单 * 根据id查询拍卖订单
* @param orderId * @param orderId
* @return AuctionOrder * @return AuctionOrder
*/ */
static getAuctionOrderById(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<AuctionOrder>> { getAuctionOrderById(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<AuctionOrder>> {
return axios.get('order/getAuctionOrderById', {params: {orderId: orderId}}); return axios.get("order/getAuctionOrderById", { params: { orderId } });
} },
/** /**
* 取消拍卖订单 * 取消拍卖订单
* @param vehicleId * @param vehicleId
* @return int * @return int
*/ */
static getAuctionOrderByVehicleId(axios:AxiosStatic, vehicleId: number): Promise<AxiosResponse<number>> { getAuctionOrderByVehicleId(axios:AxiosStatic, vehicleId: number): Promise<AxiosResponse<number>> {
return axios.get('order/getAuctionOrderByVehicleId', {params: {vehicleId: vehicleId}}); return axios.get("order/getAuctionOrderByVehicleId", { params: { vehicleId } });
} },
/** /**
*/ */
static getAuctionOrderDetailById(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<AuctionOrder>> { getAuctionOrderDetailById(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<AuctionOrder>> {
return axios.get('order/getAuctionOrderDetailById', {params: {orderId: orderId}}); return axios.get("order/getAuctionOrderDetailById", { params: { orderId } });
} },
/** /**
* 查询订单状态,用于轮循操作 * 查询订单状态,用于轮循操作
* @param orderId * @param orderId
* @return AuctionOrder.OrderState * @return AuctionOrder.OrderState
*/ */
static getAuctionOrderStateById(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<AuctionOrder.OrderState>> { getAuctionOrderStateById(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<AuctionOrder.OrderState>> {
return axios.get('order/getAuctionOrderStateById', {params: {orderId: orderId}}); return axios.get("order/getAuctionOrderStateById", { params: { orderId } });
} },
/** /**
*/ */
static getContractsByOrderId(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<Contract[]>> { getContractsByOrderId(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<Contract[]>> {
return axios.get('order/getContractsByOrderId', {params: {orderId: orderId}}); return axios.get("order/getContractsByOrderId", { params: { orderId } });
} },
/** /**
*/ */
static getLatestAuctionOrders(axios:AxiosStatic): Promise<AxiosResponse<AuctionOrder[]>> { getLatestAuctionOrders(axios:AxiosStatic): Promise<AxiosResponse<AuctionOrder[]>> {
return axios.get('order/getLatestAuctionOrders'); return axios.get("order/getLatestAuctionOrders");
} },
/** /**
* 分页查询拍卖订单 * 分页查询拍卖订单
* @param pagination * @param pagination
* @return Page * @return Page
*/ */
static pageAuctionOrder(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<AuctionOrder>>> { pageAuctionOrder(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<AuctionOrder>>> {
return axios.post('order/pageAuctionOrder', pagination); return axios.post("order/pageAuctionOrder", pagination);
} },
static PAGE_AUCTION_ORDER = 'order/pageAuctionOrder'; PAGE_AUCTION_ORDER : "order/pageAuctionOrder",
/** /**
* 上传过户资料 * 上传过户资料
...@@ -86,10 +85,10 @@ export class AuctionOrderController{ ...@@ -86,10 +85,10 @@ export class AuctionOrderController{
* @return AuctionOrder * @return AuctionOrder
* @throws FieldException * @throws FieldException
*/ */
static uploadTransferAuctionOrder(axios:AxiosStatic, auctionOrder: any): Promise<AxiosResponse<AuctionOrder>> { uploadTransferAuctionOrder(axios:AxiosStatic, auctionOrder: any): Promise<AxiosResponse<AuctionOrder>> {
return axios.post('order/uploadTransferAuctionOrder', auctionOrder); return axios.post("order/uploadTransferAuctionOrder", auctionOrder);
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { AxiosResponse, AxiosStatic } from "axios";
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包 // region 前端扩展导入包
import {BankAccount} from "lib/src/entity/finance/entity/BankAccount"; import { BankAccount } from "lib/src/entity/finance/entity/BankAccount";
// endregion // endregion
/** /**
* 银行账户(BankAccount) PI接口 * 银行账户(BankAccount) PI接口
* @author gonglei * @author gonglei
* @since 2025-10-19 11:05:09 * @since 2025-10-19 11:05:09
*/ */
export class BankAccountController{ export const BankAccountController= {
/** /**
* 根据id查询银行账户 * 根据id查询银行账户
* @param accountId * @param accountId
* @return BankAccount * @return BankAccount
*/ */
static getBankAccountById(axios:AxiosStatic, accountId: number): Promise<AxiosResponse<BankAccount>> { getBankAccountById(axios:AxiosStatic, accountId: number): Promise<AxiosResponse<BankAccount>> {
return axios.get('bankAccount/getBankAccountById', {params: {accountId: accountId}}); return axios.get("bankAccount/getBankAccountById", { params: { accountId } });
} },
/** /**
* 查询全部启用$银行账户 * 查询全部启用$银行账户
* @return BankAccount * @return BankAccount
*/ */
static getEnableBankAccount(axios:AxiosStatic, accountType: any): Promise<AxiosResponse<BankAccount>> { getEnableBankAccount(axios:AxiosStatic, accountType: any): Promise<AxiosResponse<BankAccount>> {
return axios.get('bankAccount/getEnableBankAccount', {params: {accountType: accountType}}); return axios.get("bankAccount/getEnableBankAccount", { params: { accountType } });
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { Page } from "autumn-vue/lib/core/page/Page";
import dayjs,{Dayjs} from 'dayjs'; import { AxiosResponse, AxiosStatic } from "axios";
// region 前端扩展导入包 // region 前端扩展导入包
import {Bid} from "lib/src/entity/auction/entity/Bid"; import { Bid } from "lib/src/entity/auction/entity/Bid";
import {Page} from "autumn-vue/lib/core/page/Page";
// endregion // endregion
/** /**
* 投标竞价(Bid) PI接口 * 投标竞价(Bid) PI接口
* @author gonglei * @author gonglei
* @since 2025-10-13 12:18:11 * @since 2025-10-13 12:18:11
*/ */
export class BidController{ export const BidController= {
/** /**
* 新增投标竞价 * 新增投标竞价
* @param bidRequest * @param bidRequest
* @return Bid * @return Bid
*/ */
static addBid(axios:AxiosStatic, bidRequest: any): Promise<AxiosResponse<Bid>> { addBid(axios:AxiosStatic, bidRequest: any): Promise<AxiosResponse<Bid>> {
return axios.post('bid/addBid', bidRequest); return axios.post("bid/addBid", bidRequest);
} },
/** /**
* 根据id查询投标竞价 * 根据id查询投标竞价
* @param bidId * @param bidId
* @return Bid * @return Bid
*/ */
static getBidById(axios:AxiosStatic, bidId: number): Promise<AxiosResponse<Bid>> { getBidById(axios:AxiosStatic, bidId: number): Promise<AxiosResponse<Bid>> {
return axios.get('bid/getBidById', {params: {bidId: bidId}}); return axios.get("bid/getBidById", { params: { bidId } });
} },
/** /**
*/ */
static getBidsByAuctionVehicle(axios:AxiosStatic, aucvehId: number, auctionType: any): Promise<AxiosResponse<Bid[]>> { getBidsByAuctionVehicle(axios:AxiosStatic, aucvehId: number, auctionType: any): Promise<AxiosResponse<Bid[]>> {
return axios.get('bid/getBidsByAuctionVehicle', {params: {aucvehId: aucvehId,auctionType: auctionType}}); return axios.get("bid/getBidsByAuctionVehicle", { params: { aucvehId, auctionType } });
} },
/** /**
*/ */
static getLastedBidByLoginAccount(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<Bid>> { getLastedBidByLoginAccount(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<Bid>> {
return axios.get('bid/getLastedBidByLoginAccount', {params: {aucvehId: aucvehId}}); return axios.get("bid/getLastedBidByLoginAccount", { params: { aucvehId } });
} },
/** /**
* 分页查询投标竞价 * 分页查询投标竞价
* @param pagination * @param pagination
* @return Page * @return Page
*/ */
static pageBid(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Bid>>> { pageBid(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Bid>>> {
return axios.post('bid/pageBid', pagination); return axios.post("bid/pageBid", pagination);
} },
static PAGE_BID = 'bid/pageBid'; PAGE_BID : "bid/pageBid",
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { AxiosResponse, AxiosStatic } from "axios";
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包 // region 前端扩展导入包
import {Carousel} from "lib/src/entity/business/entity/Carousel"; import { Carousel } from "lib/src/entity/business/entity/Carousel";
// endregion // endregion
/** /**
* 轮播图(Carousel) PI接口 * 轮播图(Carousel) PI接口
* @author gonglei * @author gonglei
* @since 2025-10-13 12:18:11 * @since 2025-10-13 12:18:11
*/ */
export class CarouselController{ export const CarouselController= {
/** /**
* 分页查询轮播图 * 分页查询轮播图
* @return List * @return List
*/ */
static getMiniappCarouselByDate(axios:AxiosStatic): Promise<AxiosResponse<Carousel[]>> { getMiniappCarouselByDate(axios:AxiosStatic): Promise<AxiosResponse<Carousel[]>> {
return axios.get('carousel/getMiniappCarouselByDate'); return axios.get("carousel/getMiniappCarouselByDate");
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { AxiosResponse, AxiosStatic } from "axios";
import dayjs, {Dayjs} from 'dayjs'; import { BusinessConfig } from "lib/src/entity/business/domain/BusinessConfig";
import { DarkBidPriceRange } from "lib/src/entity/business/domain/DarkBidPriceRange";
// region 前端扩展导入包 // region 前端扩展导入包
import {LightBidPriceRange} from "lib/src/entity/business/domain/LightBidPriceRange"; import { LightBidPriceRange } from "lib/src/entity/business/domain/LightBidPriceRange";
import {BusinessConfig} from "lib/src/entity/business/domain/BusinessConfig";
import {DarkBidPriceRange} from "lib/src/entity/business/domain/DarkBidPriceRange";
// endregion // endregion
/** /**
*/ */
export class ConfigController { export const ConfigController = {
/** /**
* 查询SystemConfig * 查询SystemConfig
* @return BusinessConfig * @return BusinessConfig
*/ */
static getBusinessConfig(axios: AxiosStatic): Promise<AxiosResponse<BusinessConfig>> { getBusinessConfig(axios: AxiosStatic): Promise<AxiosResponse<BusinessConfig>> {
return axios.get('config/getBusinessConfig'); return axios.get("config/getBusinessConfig");
} },
/** /**
*/ */
static getDarkBidPriceRange(axios: AxiosStatic): Promise<AxiosResponse<DarkBidPriceRange>> { getDarkBidPriceRange(axios: AxiosStatic): Promise<AxiosResponse<DarkBidPriceRange>> {
return axios.get('config/getDarkBidPriceRange'); return axios.get("config/getDarkBidPriceRange");
} },
/** /**
*/ */
static getLightBidPriceRange(axios: AxiosStatic): Promise<AxiosResponse<LightBidPriceRange>> { getLightBidPriceRange(axios: AxiosStatic): Promise<AxiosResponse<LightBidPriceRange>> {
return axios.get('config/getLightBidPriceRange'); return axios.get("config/getLightBidPriceRange");
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { Diction } from "autumn-vue/lib/core/dictionary/Diction";
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包 // region 前端扩展导入包
import {Dictionary} from "autumn-vue/lib/core/dictionary/Dictionary"; import { Dictionary } from "autumn-vue/lib/core/dictionary/Dictionary";
import {Diction} from "autumn-vue/lib/core/dictionary/Diction"; import { AxiosResponse, AxiosStatic } from "axios";
// endregion // endregion
/** /**
* 字典表(Dictionary) 控制层 * 字典表(Dictionary) 控制层
* @author gonglei * @author gonglei
* @since 2022-04-18 16:06:57 * @since 2022-04-18 16:06:57
*/ */
export class DictionaryController{ export const DictionaryController= {
/** /**
* 查询全部启用字典表 * 查询全部启用字典表
* @param dictionaryName * @param dictionaryName
* @return List * @return List
*/ */
static getDictionariesByName(axios:AxiosStatic, dictionaryName: string): Promise<AxiosResponse<Dictionary[]>> { getDictionariesByName(axios:AxiosStatic, dictionaryName: string): Promise<AxiosResponse<Dictionary[]>> {
return axios.get('dictionary/getDictionariesByName', {params: {dictionaryName: dictionaryName}}); return axios.get("dictionary/getDictionariesByName", { params: { dictionaryName } });
} },
/** /**
* 查询租户下简单字典表 * 查询租户下简单字典表
* @param dictionaryName * @param dictionaryName
* @return List * @return List
*/ */
static getEnabledDictionsByName(axios:AxiosStatic, dictionaryName: string): Promise<AxiosResponse<Diction[]>> { getEnabledDictionsByName(axios:AxiosStatic, dictionaryName: string): Promise<AxiosResponse<Diction[]>> {
return axios.get('dictionary/getEnabledDictionsByName', {params: {dictionaryName: dictionaryName}}); return axios.get("dictionary/getEnabledDictionsByName", { params: { dictionaryName } });
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { AxiosResponse, AxiosStatic } from "axios";
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包 // region 前端扩展导入包
// endregion // endregion
/** /**
*/ */
export class ESignController{ export const ESignController= {
/** /**
* E签宝回调 * E签宝回调
* @param signMissionComplete * @param signMissionComplete
* @return String * @return String
*/ */
static notify(axios:AxiosStatic, signMissionComplete: any): Promise<AxiosResponse<string>> { notify(axios:AxiosStatic, signMissionComplete: any): Promise<AxiosResponse<string>> {
return axios.post('/esign/notify', signMissionComplete); return axios.post("/esign/notify", signMissionComplete);
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { Page } from "autumn-vue/lib/core/page/Page";
import dayjs,{Dayjs} from 'dayjs'; import { AxiosResponse, AxiosStatic } from "axios";
// region 前端扩展导入包 // region 前端扩展导入包
import {Favorite} from "lib/src/entity/account/entity/Favorite"; import { Favorite } from "lib/src/entity/account/entity/Favorite";
import {Page} from "autumn-vue/lib/core/page/Page";
// endregion // endregion
/** /**
* 收藏(Favorite) PI接口 * 收藏(Favorite) PI接口
* @author gonglei * @author gonglei
* @since 2025-10-13 12:18:11 * @since 2025-10-13 12:18:11
*/ */
export class FavoriteController{ export const FavoriteController= {
/** /**
* 根据id查询收藏 * 根据id查询收藏
* @param aucvehId * @param aucvehId
* @return int * @return int
*/ */
static getFavoriteCountByAucvehId(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<number>> { getFavoriteCountByAucvehId(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<number>> {
return axios.get('favorite/getFavoriteCountByAucvehId', {params: {aucvehId: aucvehId}}); return axios.get("favorite/getFavoriteCountByAucvehId", { params: { aucvehId } });
} },
/** /**
* 分页查询收藏 * 分页查询收藏
* @param pagination * @param pagination
* @return Page * @return Page
*/ */
static pageFavorite(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Favorite>>> { pageFavorite(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Favorite>>> {
return axios.post('favorite/pageFavorite', pagination); return axios.post("favorite/pageFavorite", pagination);
} },
static PAGE_FAVORITE = 'favorite/pageFavorite'; PAGE_FAVORITE : "favorite/pageFavorite",
/** /**
* 删除收藏 * 删除收藏
* @param aucvehId * @param aucvehId
* @return int * @return int
*/ */
static removeFavoriteById(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<number>> { removeFavoriteById(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<number>> {
return axios.delete('favorite/removeFavoriteById', {params: {aucvehId: aucvehId}}); return axios.delete("favorite/removeFavoriteById", { params: { aucvehId } });
} },
/** /**
* 新增收藏 * 新增收藏
* @param aucvehId * @param aucvehId
* @return boolean * @return boolean
*/ */
static toggleFavorite(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<boolean>> { toggleFavorite(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<boolean>> {
return axios.post('favorite/toggleFavorite', null, {params: {aucvehId: aucvehId}}); return axios.post("favorite/toggleFavorite", null, { params: { aucvehId } });
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { AxiosResponse, AxiosStatic } from "axios";
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包 // region 前端扩展导入包
// endregion // endregion
/** /**
*/ */
export class GscApiController{ export const GscApiController= {
/** /**
*/ */
static getCarBrandComplete(axios:AxiosStatic): Promise<AxiosResponse<string>> { getCarBrandComplete(axios:AxiosStatic): Promise<AxiosResponse<string>> {
return axios.get('gsc/getCarBrandComplete'); return axios.get("gsc/getCarBrandComplete");
} },
/** /**
*/ */
static getCarTypeList(axios:AxiosStatic, csId: string): Promise<AxiosResponse<string>> { getCarTypeList(axios:AxiosStatic, csId: string): Promise<AxiosResponse<string>> {
return axios.get('gsc/getCarTypeList', {params: {csId: csId}}); return axios.get("gsc/getCarTypeList", { params: { csId } });
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios';
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包 // region 前端扩展导入包
import Authenticity from "autumn-vue/lib/core/security/Authenticity"; import Authenticity from "autumn-vue/lib/core/security/Authenticity";
import { AxiosResponse, AxiosStatic } from "axios";
// endregion // endregion
/** /**
*/ */
export class LoginController{ export const LoginController= {
/** /**
* 个人账户修改手机原号码校验 * 个人账户修改手机原号码校验
...@@ -16,9 +15,9 @@ export class LoginController{ ...@@ -16,9 +15,9 @@ export class LoginController{
* @return String * @return String
* @throws FieldException * @throws FieldException
*/ */
static checkSmsCode(axios:AxiosStatic, loginRequest: any): Promise<AxiosResponse<string>> { checkSmsCode(axios:AxiosStatic, loginRequest: any): Promise<AxiosResponse<string>> {
return axios.post('/api/checkSmsCode', loginRequest); return axios.post("/api/checkSmsCode", loginRequest);
} },
/** /**
* 个人账户修改手机新号码校验 * 个人账户修改手机新号码校验
...@@ -28,15 +27,15 @@ export class LoginController{ ...@@ -28,15 +27,15 @@ export class LoginController{
* @return boolean * @return boolean
* @throws FieldException * @throws FieldException
*/ */
static checkSmsCodeByNewMobile(axios:AxiosStatic, loginRequest: any): Promise<AxiosResponse<boolean>> { checkSmsCodeByNewMobile(axios:AxiosStatic, loginRequest: any): Promise<AxiosResponse<boolean>> {
return axios.post('/api/checkSmsCodeByNewMobile', loginRequest); return axios.post("/api/checkSmsCodeByNewMobile", loginRequest);
} },
/** /**
*/ */
static doLogin(axios:AxiosStatic): Promise<AxiosResponse<Authenticity>> { doLogin(axios:AxiosStatic): Promise<AxiosResponse<Authenticity>> {
return axios.post('/api/login', null); return axios.post("/api/login", null);
} },
/** /**
* 个人账户中绑定微信号 * 个人账户中绑定微信号
...@@ -45,19 +44,19 @@ export class LoginController{ ...@@ -45,19 +44,19 @@ export class LoginController{
* @return boolean * @return boolean
* @throws FieldException * @throws FieldException
*/ */
static getQrCodeStatus(axios:AxiosStatic, ticket: string): Promise<AxiosResponse<boolean>> { getQrCodeStatus(axios:AxiosStatic, ticket: string): Promise<AxiosResponse<boolean>> {
return axios.get('/api/getQrCodeStatus', {params: {ticket: ticket}}); return axios.get("/api/getQrCodeStatus", { params: { ticket } });
} },
/** /**
* <pre> * <pre>
小程序手机号登录 小程序手机号登录
</pre> </pre>
*/ */
static phone(axios:AxiosStatic, maLoginRequest: any): Promise<AxiosResponse<AccountInfo>> { phone(axios:AxiosStatic, maLoginRequest: any): Promise<AxiosResponse<AccountInfo>> {
return axios.post('/api//ma/{appid}/phoneLogin', maLoginRequest); return axios.post("/api//ma/{appid}/phoneLogin", maLoginRequest);
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import type { WxPayUnifiedOrderV3Result } from "lib/src/domain/WxPayUnifiedOrderV3Result";
import dayjs,{Dayjs} from 'dayjs';
import { AxiosResponse, AxiosStatic } from "axios";
// region 前端扩展导入包 // region 前端扩展导入包
import {ResponseEntity} from "lib/src/domain/ResponseEntity";
import type {WxPayUnifiedOrderV3Result} from "lib/src/domain/WxPayUnifiedOrderV3Result";
// endregion // endregion
/** /**
*/ */
export class RechargeController{ export const RechargeController= {
/** /**
* 充值接口 * 充值接口
...@@ -17,18 +16,18 @@ export class RechargeController{ ...@@ -17,18 +16,18 @@ export class RechargeController{
* @param account * @param account
* @return WxPayUnifiedOrderV3Result.JsapiResult * @return WxPayUnifiedOrderV3Result.JsapiResult
*/ */
static addRecharge(axios:AxiosStatic, recharge: any): Promise<AxiosResponse<WxPayUnifiedOrderV3Result.JsapiResult>> { addRecharge(axios:AxiosStatic, recharge: any): Promise<AxiosResponse<WxPayUnifiedOrderV3Result.JsapiResult>> {
return axios.post('recharge/addRecharge', recharge); return axios.post("recharge/addRecharge", recharge);
} },
/** /**
* 调用统一下单接口(JSAPI) * 调用统一下单接口(JSAPI)
详见:https://pay.weixin.qq.com/doc/v3/merchant/4012791856 详见:https://pay.weixin.qq.com/doc/v3/merchant/4012791856
*/ */
static createOrder(axios:AxiosStatic, request: any): Promise<AxiosResponse<WxPayUnifiedOrderV3Result.JsapiResult>> { createOrder(axios:AxiosStatic, request: any): Promise<AxiosResponse<WxPayUnifiedOrderV3Result.JsapiResult>> {
return axios.post('recharge/createOrder', request); return axios.post("recharge/createOrder", request);
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { Page } from "autumn-vue/lib/core/page/Page";
import dayjs,{Dayjs} from 'dayjs'; import { AxiosResponse, AxiosStatic } from "axios";
// region 前端扩展导入包 // region 前端扩展导入包
import {ReleaseOrder} from "lib/src/entity/auction/entity/ReleaseOrder"; import { ReleaseOrder } from "lib/src/entity/auction/entity/ReleaseOrder";
import {Page} from "autumn-vue/lib/core/page/Page";
// endregion // endregion
/** /**
* 解押订单(ReleaseOrder) PI接口 * 解押订单(ReleaseOrder) PI接口
* @author gonglei * @author gonglei
* @since 2025-10-13 12:18:11 * @since 2025-10-13 12:18:11
*/ */
export class ReleaseOrderController{ export const ReleaseOrderController= {
/** /**
* 根据id查询解押订单 * 根据id查询解押订单
* @param orderId * @param orderId
* @return ReleaseOrder * @return ReleaseOrder
*/ */
static getReleaseOrderById(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<ReleaseOrder>> { getReleaseOrderById(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<ReleaseOrder>> {
return axios.get('order/getReleaseOrderById', {params: {orderId: orderId}}); return axios.get("order/getReleaseOrderById", { params: { orderId } });
} },
/** /**
* 分页查询解押订单 * 分页查询解押订单
* @param pagination * @param pagination
* @return Page * @return Page
*/ */
static pageReleaseOrder(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<ReleaseOrder>>> { pageReleaseOrder(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<ReleaseOrder>>> {
return axios.post('order/pageReleaseOrder', pagination); return axios.post("order/pageReleaseOrder", pagination);
} },
static PAGE_RELEASE_ORDER = 'order/pageReleaseOrder'; PAGE_RELEASE_ORDER : "order/pageReleaseOrder",
/** /**
* 修改解押订单 * 修改解押订单
* @param releaseOrder * @param releaseOrder
* @return ReleaseOrder * @return ReleaseOrder
*/ */
static updateReleaseOrder(axios:AxiosStatic, releaseOrder: any): Promise<AxiosResponse<ReleaseOrder>> { updateReleaseOrder(axios:AxiosStatic, releaseOrder: any): Promise<AxiosResponse<ReleaseOrder>> {
return axios.post('order/updateReleaseOrder', releaseOrder); return axios.post("order/updateReleaseOrder", releaseOrder);
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { AxiosResponse, AxiosStatic } from "axios";
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包 // region 前端扩展导入包
// endregion // endregion
/** /**
* @author kepler * @author kepler
*/ */
export class StorageController{ export const StorageController= {
/** /**
*/ */
static uploadAudio(axios:AxiosStatic, file: any, directory: string): Promise<AxiosResponse<FileInfo>> { uploadAudio(axios:AxiosStatic, file: any, directory: string): Promise<AxiosResponse<FileInfo>> {
return axios.post('upload/uploadAudio', null, {params: {file: file,directory: directory}}); return axios.post("upload/uploadAudio", null, { params: { file, directory } });
} },
/** /**
* 富文本图片上传 * 富文本图片上传
...@@ -22,10 +21,10 @@ export class StorageController{ ...@@ -22,10 +21,10 @@ export class StorageController{
* @return Map * @return Map
* @throws FileStorageException * @throws FileStorageException
*/ */
static uploadPasteImage(axios:AxiosStatic, file: any): Promise<AxiosResponse<any>> { uploadPasteImage(axios:AxiosStatic, file: any): Promise<AxiosResponse<any>> {
return axios.post('upload/uploadRichTextImage', null, {params: {file: file}}); return axios.post("upload/uploadRichTextImage", null, { params: { file } });
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { Page } from "autumn-vue/lib/core/page/Page";
import dayjs,{Dayjs} from 'dayjs'; import { AxiosResponse, AxiosStatic } from "axios";
// region 前端扩展导入包 // region 前端扩展导入包
import {VehicleBrowserHistory} from "lib/src/entity/track/entity/VehicleBrowserHistory"; import { VehicleBrowserHistory } from "lib/src/entity/track/entity/VehicleBrowserHistory";
import {Page} from "autumn-vue/lib/core/page/Page";
// endregion // endregion
/** /**
*/ */
export class TrackController{ export const TrackController= {
/** /**
*/ */
static pageVehicleBrowserHistory(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<VehicleBrowserHistory>>> { pageVehicleBrowserHistory(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<VehicleBrowserHistory>>> {
return axios.post('track/pageVehicleBrowserHistory', pagination); return axios.post("track/pageVehicleBrowserHistory", pagination);
} },
static PAGE_VEHICLE_BROWSER_HISTORY = 'track/pageVehicleBrowserHistory'; PAGE_VEHICLE_BROWSER_HISTORY : "track/pageVehicleBrowserHistory",
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import type { WxPayUnifiedOrderV3Result } from "lib/src/domain/WxPayUnifiedOrderV3Result";
import dayjs,{Dayjs} from 'dayjs';
import { Page } from "autumn-vue/lib/core/page/Page";
import { AxiosResponse, AxiosStatic } from "axios";
import { TransactionStat } from "lib/src/entity/finance/domain/TransactionStat";
import { OrderTransaction } from "lib/src/entity/finance/entity/OrderTransaction";
// region 前端扩展导入包 // region 前端扩展导入包
import {Transaction} from "lib/src/entity/finance/entity/Transaction"; import { Transaction } from "lib/src/entity/finance/entity/Transaction";
import {TransactionStat} from "lib/src/entity/finance/domain/TransactionStat";
import {Page} from "autumn-vue/lib/core/page/Page";
import {OrderTransaction} from "lib/src/entity/finance/entity/OrderTransaction";
import type {WxPayUnifiedOrderV3Result} from "lib/src/domain/WxPayUnifiedOrderV3Result";
// endregion // endregion
/** /**
* 交易明细(Transaction) PI接口 * 交易明细(Transaction) PI接口
* @author gonglei * @author gonglei
* @since 2025-10-13 12:18:11 * @since 2025-10-13 12:18:11
*/ */
export class TransactionController{ export const TransactionController= {
/** /**
* 新增订单交易 * 新增订单交易
* @param orderTransaction * @param orderTransaction
* @return OrderTransaction * @return OrderTransaction
*/ */
static addOrderTransaction(axios:AxiosStatic, orderTransaction: any): Promise<AxiosResponse<OrderTransaction>> { addOrderTransaction(axios:AxiosStatic, orderTransaction: any): Promise<AxiosResponse<OrderTransaction>> {
return axios.post('transaction/addOrderTransaction', orderTransaction); return axios.post("transaction/addOrderTransaction", orderTransaction);
} },
/** /**
* 根据id查询交易明细 * 根据id查询交易明细
* @return TransactionStat * @return TransactionStat
*/ */
static getTransactionStat(axios:AxiosStatic): Promise<AxiosResponse<TransactionStat>> { getTransactionStat(axios:AxiosStatic): Promise<AxiosResponse<TransactionStat>> {
return axios.get('transaction/getTransactionStat'); return axios.get("transaction/getTransactionStat");
} },
/** /**
* 分页查询交易明细 * 分页查询交易明细
* @param pagination * @param pagination
* @return Page * @return Page
*/ */
static pageTransaction(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Transaction>>> { pageTransaction(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Transaction>>> {
return axios.post('transaction/pageTransaction', pagination); return axios.post("transaction/pageTransaction", pagination);
} },
static PAGE_TRANSACTION = 'transaction/pageTransaction'; PAGE_TRANSACTION : "transaction/pageTransaction",
/** /**
* 微信支付接口 * 微信支付接口
...@@ -50,10 +50,10 @@ export class TransactionController{ ...@@ -50,10 +50,10 @@ export class TransactionController{
* @param account * @param account
* @return WxPayUnifiedOrderV3Result.JsapiResult * @return WxPayUnifiedOrderV3Result.JsapiResult
*/ */
static payOrderTransaction(axios:AxiosStatic, orderTransaction: any): Promise<AxiosResponse<WxPayUnifiedOrderV3Result.JsapiResult>> { payOrderTransaction(axios:AxiosStatic, orderTransaction: any): Promise<AxiosResponse<WxPayUnifiedOrderV3Result.JsapiResult>> {
return axios.post('transaction/payOrderTransaction', orderTransaction); return axios.post("transaction/payOrderTransaction", orderTransaction);
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios'; import { Page } from "autumn-vue/lib/core/page/Page";
import dayjs,{Dayjs} from 'dayjs'; import { AxiosResponse, AxiosStatic } from "axios";
// region 前端扩展导入包 // region 前端扩展导入包
import {Withdraw} from "lib/src/entity/finance/entity/Withdraw"; import { Withdraw } from "lib/src/entity/finance/entity/Withdraw";
import {Page} from "autumn-vue/lib/core/page/Page";
// endregion // endregion
/** /**
* 提现申请(Withdraw) PI接口 * 提现申请(Withdraw) PI接口
* @author gonglei * @author gonglei
* @since 2025-10-13 12:18:11 * @since 2025-10-13 12:18:11
*/ */
export class WithdrawController{ export const WithdrawController= {
/** /**
* 新增提现申请 * 新增提现申请
* @param withdraw * @param withdraw
* @return Withdraw * @return Withdraw
*/ */
static addWithdraw(axios:AxiosStatic, withdraw: any): Promise<AxiosResponse<Withdraw>> { addWithdraw(axios:AxiosStatic, withdraw: any): Promise<AxiosResponse<Withdraw>> {
return axios.post('withdraw/addWithdraw', withdraw); return axios.post("withdraw/addWithdraw", withdraw);
} },
/** /**
* 根据id查询提现申请 * 根据id查询提现申请
* @param withdrawId * @param withdrawId
* @return Withdraw * @return Withdraw
*/ */
static getWithdrawById(axios:AxiosStatic, withdrawId: number): Promise<AxiosResponse<Withdraw>> { getWithdrawById(axios:AxiosStatic, withdrawId: number): Promise<AxiosResponse<Withdraw>> {
return axios.get('withdraw/getWithdrawById', {params: {withdrawId: withdrawId}}); return axios.get("withdraw/getWithdrawById", { params: { withdrawId } });
} },
/** /**
*/ */
static getWithdrawsByWaitUserConfirm(axios:AxiosStatic): Promise<AxiosResponse<Withdraw[]>> { getWithdrawsByWaitUserConfirm(axios:AxiosStatic): Promise<AxiosResponse<Withdraw[]>> {
return axios.get('withdraw/getWithdrawsByWaitUserConfirm'); return axios.get("withdraw/getWithdrawsByWaitUserConfirm");
} },
/** /**
*/ */
static getWxPayMchId(axios:AxiosStatic): Promise<AxiosResponse<string>> { getWxPayMchId(axios:AxiosStatic): Promise<AxiosResponse<string>> {
return axios.get('withdraw/getWxPayMchId'); return axios.get("withdraw/getWxPayMchId");
} },
/** /**
* 分页查询提现申请 * 分页查询提现申请
* @param pagination * @param pagination
* @return Page * @return Page
*/ */
static pageWithdraw(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Withdraw>>> { pageWithdraw(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Withdraw>>> {
return axios.post('withdraw/pageWithdraw', pagination); return axios.post("withdraw/pageWithdraw", pagination);
} },
static PAGE_WITHDRAW = 'withdraw/pageWithdraw'; PAGE_WITHDRAW : "withdraw/pageWithdraw",
/** /**
*/ */
static updateWithdrawStateById(axios:AxiosStatic, withdrawId: number): Promise<AxiosResponse<number>> { updateWithdrawStateById(axios:AxiosStatic, withdrawId: number): Promise<AxiosResponse<number>> {
return axios.post('withdraw/updateWithdrawStateById', null, {params: {withdrawId: withdrawId}}); return axios.post("withdraw/updateWithdrawStateById", null, { params: { withdrawId } });
} },
// region 前端扩展代码区 // region 前端扩展代码区
// endregion // endregion
} };
import {AxiosResponse, AxiosStatic} from 'axios';
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包 // region 前端扩展导入包
// endregion // endregion
/** /* eslint-disable */
*/
export class WxpayController{ export class WxpayController{
// region 前端扩展代码区 // region 前端扩展代码区
......
import {AuthenticationManager} from "autumn-vue/lib/core/security/AuthenticationManager"; import { DefaultTokenInterceptor } from "autumn-vue/lib/core/http/DefaultTokenInterceptor";
import { AuthenticationManager } from "autumn-vue/lib/core/security/AuthenticationManager";
import {DefaultTokenInterceptor} from "autumn-vue/lib/core/http/DefaultTokenInterceptor"; import { AccountInfo } from "lib/src/entity/account/domain/AccountInfo";
import {AccountInfo} from "lib/src/entity/account/domain/AccountInfo";
export class AuthService { export class AuthService {
/** /**
* TOKEN存储KEY * TOKEN存储KEY
*/ */
public static readonly TOKEN = 'token'; public static readonly TOKEN = "token";
private token: string;
private accountInfo: AccountInfo = null; private accountInfo: AccountInfo = null;
private token: string;
constructor() { constructor() {
this.loadStorageToken(); this.loadStorageToken();
this.loadStorageAuthentication(); this.loadStorageAuthentication();
} }
/** deleteAuthentication(): void {
* 更新TOKEN this.accountInfo = null;
*/ uni.removeStorageSync(DefaultTokenInterceptor.AUTHORIZATION);
updateToken(token: string): void {
this.token = token;
uni.setStorageSync(AuthenticationManager.TOKEN, token);
}
/**
* 删除TOKEN
*/
removeToken() {
this.token = null;
uni.removeStorageSync(AuthenticationManager.TOKEN);
}
/**
* 判断是否登录
*/
isLogin(): boolean {
if (this.token) {
return this.getAuthentication() != null;
} else {
return false;
}
} }
getAuthentication(): AccountInfo | null { getAuthentication(): AccountInfo | null {
...@@ -58,12 +34,6 @@ export class AuthService { ...@@ -58,12 +34,6 @@ export class AuthService {
return uni.getStorageSync(AuthenticationManager.TOKEN); return uni.getStorageSync(AuthenticationManager.TOKEN);
} }
deleteAuthentication(): void {
this.accountInfo = null;
uni.removeStorageSync(DefaultTokenInterceptor.AUTHORIZATION);
}
/** /**
* 获取TOKEN * 获取TOKEN
*/ */
...@@ -71,9 +41,16 @@ export class AuthService { ...@@ -71,9 +41,16 @@ export class AuthService {
return this.token; return this.token;
} }
saveAuthentication(authentication: AccountInfo): void { /**
this.accountInfo = authentication; * 判断是否登录
uni.setStorageSync(DefaultTokenInterceptor.AUTHORIZATION, JSON.stringify(authentication)); */
isLogin(): boolean {
if (this.token) {
return this.getAuthentication() != null;
} else {
return false;
}
} }
loadStorageAuthentication(): Promise<any> { loadStorageAuthentication(): Promise<any> {
...@@ -91,9 +68,31 @@ export class AuthService { ...@@ -91,9 +68,31 @@ export class AuthService {
return Promise.resolve(this.accountInfo); return Promise.resolve(this.accountInfo);
} }
loadStorageToken(): Promise<any> { loadStorageToken(): Promise<any> {
this.token = uni.getStorageSync(AuthenticationManager.TOKEN); this.token = uni.getStorageSync(AuthenticationManager.TOKEN);
// console.log('本地存储的token : ' + this.token); // console.log('本地存储的token : ' + this.token);
return Promise.resolve(this.token); return Promise.resolve(this.token);
} }
/**
* 删除TOKEN
*/
removeToken() {
this.token = null;
uni.removeStorageSync(AuthenticationManager.TOKEN);
}
saveAuthentication(authentication: AccountInfo): void {
this.accountInfo = authentication;
uni.setStorageSync(DefaultTokenInterceptor.AUTHORIZATION, JSON.stringify(authentication));
}
/**
* 更新TOKEN
*/
updateToken(token: string): void {
this.token = token;
uni.setStorageSync(AuthenticationManager.TOKEN, token);
}
} }
import CryptoJS from 'crypto-js'; // 引入 crypto-js import CryptoJS from "crypto-js"; // 引入 crypto-js
import {AccountInfo} from "lib/src/entity/account/domain/AccountInfo";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { AccountInfo } from "lib/src/entity/account/domain/AccountInfo";
/* eslint-disable */
export class BurialPoint { export class BurialPoint {
private static readonly baseUrl = "https://scrm.glsx.com.cn/rop-scrm-clue/router";
private static readonly appkey = "48e5e13229b82c1b4e6e8c96151f0637"; private static readonly appkey = "48e5e13229b82c1b4e6e8c96151f0637";
private static readonly secret = "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b"; private static readonly baseUrl = "https://scrm.glsx.com.cn/rop-scrm-clue/router";
private static readonly method = "clue.api.burial.point.record.batch.insert"; private static readonly method = "clue.api.burial.point.record.batch.insert";
private static readonly secret = "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b";
public static async burialPoint(accountInfo: AccountInfo, eventCode: string, business_id: string, pagePath: string, eventType: number = 0): Promise<void> { public static async burialPoint(accountInfo: AccountInfo, eventCode: string, business_id: string, pagePath: string, eventType: number = 0): Promise<void> {
if (!accountInfo) { if (!accountInfo) {
return; return;
} }
// 构建请求参数 // 构建请求参数
const params: Record<string, string | number> = {}; const params: Record<string, number | string> = {};
let userType = 11; let userType = 11;
if (accountInfo.accountType === 'PERSON') { if (accountInfo.accountType === "PERSON") {
userType = 12; userType = 12;
} else if (accountInfo.accountType === 'COMPANY') { } else if (accountInfo.accountType === "COMPANY") {
userType = 13; userType = 13;
} }
// 第一条记录 // 第一条记录
params['recordList[0].loginAccount'] = accountInfo.accountName; params["recordList[0].loginAccount"] = accountInfo.accountName;
params['recordList[0].userType'] = userType; params["recordList[0].userType"] = userType;
params['recordList[0].uuid'] = accountInfo.accountId; params["recordList[0].uuid"] = accountInfo.accountId;
params['recordList[0].systemSource'] = 6; params["recordList[0].systemSource"] = 6;
params['recordList[0].phoneNumber'] = accountInfo.mobile; params["recordList[0].phoneNumber"] = accountInfo.mobile;
params['recordList[0].scene'] = 8; params["recordList[0].scene"] = 8;
params['recordList[0].eventTime'] = dayjs().format('YYYY-MM-DD HH:mm:ss'); params["recordList[0].eventTime"] = dayjs().format("YYYY-MM-DD HH:mm:ss");
params['recordList[0].eventType'] = eventType; params["recordList[0].eventType"] = eventType;
params['recordList[0].prePagePath'] = '/'; params["recordList[0].prePagePath"] = "/";
params['recordList[0].pagePath'] = pagePath; params["recordList[0].pagePath"] = pagePath;
params['recordList[0].eventCode'] = eventCode; params["recordList[0].eventCode"] = eventCode;
params['recordList[0].batchId'] = this.generateUUID(); params["recordList[0].batchId"] = this.generateUUID();
params['recordList[0].businessParam'] = '{}'; params["recordList[0].businessParam"] = "{}";
params['recordList[0].business_id'] = business_id; params["recordList[0].business_id"] = business_id;
// 第二条记录 // 第二条记录
// params['recordList[1].loginAccount'] = ['xxx02']; // params['recordList[1].loginAccount'] = ['xxx02'];
// params['recordList[1].phoneNumber'] = ['13000000000']; // params['recordList[1].phoneNumber'] = ['13000000000'];
...@@ -61,69 +62,39 @@ export class BurialPoint { ...@@ -61,69 +62,39 @@ export class BurialPoint {
BurialPoint.secret BurialPoint.secret
); );
console.log(postRes); console.log(postRes);
} catch (e) {
console.error(`批量插入埋点失败:${(e as Error).message}`);
}
}
// 核心修改:使用 crypto-js 实现 SHA1 加密(适配小程序)
private static getSHA1Digest(data: string): string {
// 用 crypto-js 计算 SHA1,并返回十六进制字符串
return CryptoJS.SHA1(data).toString();
}
// 签名方法(无需异步,因为 crypto-js 是同步的)
public static sign(
paramValues: Record<string, string | number>,
secret: string
): string {
try {
let paramNames: string[] = Object.keys(paramValues);
paramNames.sort(); // 参数名排序
// 构建签名字符串(secret + 排序后的参数名和值 + secret)
let sb = secret;
paramNames.forEach(paramName => {
sb += paramName + paramValues[paramName];
});
sb += secret;
// 计算 SHA1 并转为大写(保持和 Java 一致)
const sha1Hex = this.getSHA1Digest(sb);
return sha1Hex.toUpperCase();
} catch (error) { } catch (error) {
throw new Error(`签名生成失败: ${(error as Error).message}`); console.error(`批量插入埋点失败:${(error as Error).message}`);
} }
} }
// 发送请求(使用微信小程序的 wx.request 替代 axios,避免兼容问题) // 发送请求(使用微信小程序的 wx.request 替代 axios,避免兼容问题)
public static async post( public static async post(
url: string, url: string,
params: Record<string, string | number>, params: Record<string, number | string>,
appKey: string, appKey: string,
secret: string secret: string
): Promise<string> { ): Promise<string> {
// 过滤空值参数 // 过滤空值参数
const filteredParams: Record<string, string | number> = {}; const filteredParams: Record<string, number | string> = {};
Object.entries(params).forEach(([key, value]) => { Object.entries(params).forEach(([ key, value ]) => {
if (value) { if (value) {
filteredParams[key] = value; filteredParams[key] = value;
} }
}); });
// 转换为单值 Map 用于签名 // 转换为单值 Map 用于签名
const singleValueMap: Record<string, string | number> = {}; const singleValueMap: Record<string, number | string> = {};
Object.entries(filteredParams).forEach(([key, values]) => { Object.entries(filteredParams).forEach(([ key, values ]) => {
singleValueMap[key] = values; singleValueMap[key] = values;
}); });
// 生成签名 // 生成签名
const sign = this.sign(singleValueMap, secret); const sign = this.sign(singleValueMap, secret);
filteredParams['sign'] = sign; filteredParams.sign = sign;
// 转换为 FormData 格式(小程序中用 object 模拟表单提交) // 转换为 FormData 格式(小程序中用 object 模拟表单提交)
const formData: Record<string, string | number> = {}; const formData: Record<string, number | string> = {};
Object.entries(filteredParams).forEach(([key, values]) => { Object.entries(filteredParams).forEach(([ key, values ]) => {
// 多值参数取第一个(和 Java 保持一致) // 多值参数取第一个(和 Java 保持一致)
formData[key] = values; formData[key] = values;
}); });
...@@ -131,11 +102,11 @@ export class BurialPoint { ...@@ -131,11 +102,11 @@ export class BurialPoint {
// 使用微信小程序的 wx.request 发送 POST 请求 // 使用微信小程序的 wx.request 发送 POST 请求
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.request({ wx.request({
url: url, url,
method: 'POST', method: "POST",
data: formData, data: formData,
header: { header: {
'Content-Type': 'application/x-www-form-urlencoded' // 表单提交格式 "Content-Type": "application/x-www-form-urlencoded" // 表单提交格式
}, },
success: (res) => { success: (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
...@@ -161,27 +132,57 @@ export class BurialPoint { ...@@ -161,27 +132,57 @@ export class BurialPoint {
): Promise<string> { ): Promise<string> {
const url = `${baseUrl}?method=${method}`; const url = `${baseUrl}?method=${method}`;
const params: Record<string, string[]> = { const params: Record<string, string[]> = {
'appKey': [appKey], "appKey": [ appKey ],
'v': ['1.0.0'], "v": [ "1.0.0" ],
'timestamp': [Date.now().toString()], "timestamp": [ Date.now().toString() ],
'method': [method], "method": [ method ],
'format': ['json'], "format": [ "json" ],
'locale': ['zh_CN'] "locale": [ "zh_CN" ]
}; };
// 合并用户参数 // 合并用户参数
Object.entries(paramsMap).forEach(([key, values]) => { Object.entries(paramsMap).forEach(([ key, values ]) => {
params[key] = values; params[key] = values;
}); });
return this.post(url, params, appKey, secret); return this.post(url, params, appKey, secret);
} }
// 签名方法(无需异步,因为 crypto-js 是同步的)
public static sign(
paramValues: Record<string, number | string>,
secret: string
): string {
try {
const paramNames: string[] = Object.keys(paramValues);
paramNames.sort(); // 参数名排序
// 构建签名字符串(secret + 排序后的参数名和值 + secret)
let sb = secret;
paramNames.forEach(paramName => {
sb += paramName + paramValues[paramName];
});
sb += secret;
// 计算 SHA1 并转为大写(保持和 Java 一致)
const sha1Hex = this.getSHA1Digest(sb);
return sha1Hex.toUpperCase();
} catch (error) {
throw new Error(`签名生成失败: ${(error as Error).message}`);
}
}
// 生成 UUID(适配小程序) // 生成 UUID(适配小程序)
private static generateUUID(): string { private static generateUUID(): string {
return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, (c) => { return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replaceAll(/[xy]/g, (c) => {
const r = Math.random() * 16 | 0; const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8); const v = c === "x" ? r : (r & 0x3 | 0x8);
return v.toString(16); return v.toString(16);
}).replace(/-/g, ''); }).replaceAll("-", "");
}
// 核心修改:使用 crypto-js 实现 SHA1 加密(适配小程序)
private static getSHA1Digest(data: string): string {
// 用 crypto-js 计算 SHA1,并返回十六进制字符串
return CryptoJS.SHA1(data).toString();
} }
} }
...@@ -10,13 +10,13 @@ export function maskNumberStr(str: string): string { ...@@ -10,13 +10,13 @@ export function maskNumberStr(str: string): string {
const firstDigitMatch = str.match(/\d/); const firstDigitMatch = str.match(/\d/);
// 无任何数字时,返回原字符串 // 无任何数字时,返回原字符串
if (!firstDigitMatch) return str; if (!firstDigitMatch) return str;
const firstDigitIndex = firstDigitMatch.index!; const firstDigitIndex = firstDigitMatch.index ?? 0;
const firstDigit = firstDigitMatch[0]; const firstDigit = firstDigitMatch[0];
// 步骤2:分割字符串为三部分:前缀(第一个数字前的内容)、第一个数字、后缀(第一个数字后的内容) // 步骤2:分割字符串为三部分:前缀(第一个数字前的内容)、第一个数字、后缀(第一个数字后的内容)
const prefix = str.slice(0, firstDigitIndex); // 前缀(可能包含正负号、空格等) const prefix = str.slice(0, firstDigitIndex); // 前缀(可能包含正负号、空格等)
const suffix = str.slice(firstDigitIndex + 1); // 第一个数字后的所有内容 const suffix = str.slice(firstDigitIndex + 1); // 第一个数字后的所有内容
// 步骤3:处理后缀:将后缀中的所有数字替换为*,小数点保留 // 步骤3:处理后缀:将后缀中的所有数字替换为*,小数点保留
const maskedSuffix = suffix.replace(/\d/g, '*'); const maskedSuffix = suffix.replaceAll(/\d/g, "*");
// 步骤4:拼接结果 // 步骤4:拼接结果
return `${prefix}${firstDigit}${maskedSuffix}`; return `${prefix}${firstDigit}${maskedSuffix}`;
} }
...@@ -25,6 +25,6 @@ export function maskNumberStr(str: string): string { ...@@ -25,6 +25,6 @@ export function maskNumberStr(str: string): string {
* 中国大陆身份证号码正则表达式 * 中国大陆身份证号码正则表达式
* 支持:18位(含最后一位校验码,支持X/x)、15位(旧版,纯数字) * 支持:18位(含最后一位校验码,支持X/x)、15位(旧版,纯数字)
*/ */
export const ID_CARD_REGEX = /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/; export const ID_CARD_REGEX = /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[12]\d|30|31)\d{3}[\dX]$/i;
export const ID_CARD_18_REGEX = /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[0-9Xx]$/; export const ID_CARD_18_REGEX = /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[0-9X]$/i;
import type {CarType} from "lib/src/domain/VehicleType"; import type { CarType } from "lib/src/domain/VehicleType";
import dayjs from "dayjs"; import dayjs from "dayjs";
export class SearchQuery { export class SearchQuery {
cityCode: string | null; ageRange = [ 0, 0 ];
tag: string | null; /**
* 变速箱类型
*/
bxslxs: string[] = [];
carTypes: CarType[] | null; carTypes: CarType[] | null;
priceRange = [0, 0]; cityCode: null | string;
vehicleClass: { name: string, url: string, activeUrl: string } [] = []; /**
* 排量
*/
displacementRange = [ 0, 0 ];
overallRating: { name: string, value: number } | null; /**
* 排放标准(3-国3/4-国4/5-国5/6-国6)
*/
emissionStandards: number [] = [];
/** /**
* 变速箱类型 * 车身颜色
*/ */
bxslxs: string[] = []; exteriorColor: { color: string; name: string, }[] = [];
/** /**
* 燃料形式(汽油/柴油等) * 燃料形式(汽油/柴油等)
*/ */
rlxs: string | null; mileageRange = [ 0, 0 ];
ageRange = [0, 0]; overallRating: null | { name: string, value: number };
mileageRange = [0, 0]; priceRange = [ 0, 0 ];
/** rlxs: null | string;
* 过户次数
*/
transferCount: number | null;
/** seats: number[] = [];
* 排量
*/ tag: null | string;
displacementRange = [0, 0];
/** /**
* 排放标准(3-国3/4-国4/5-国5/6-国6) * 过户次数
*/ */
emissionStandards: number [] = []; transferCount: null | number;
/** /**
* 车辆性质 * 车辆性质
*/ */
usageTypes: { name: string, value: number } [] = []; usageTypes: { name: string, value: number } [] = [];
/** vehicleClass: { activeUrl: string; name: string, url: string, } [] = [];
* 车身颜色
*/
exteriorColor: { name: string, color: string }[] = [];
seats: number[] = []; isNotEmpty(): boolean {
return (this.cityCode || this.tag || (this.carTypes && this.carTypes.length > 0) || (this.priceRange && this.priceRange[1] > 0) || this.vehicleClass.length > 0
|| this.overallRating || this.bxslxs.length > 0 || this.rlxs || (this.ageRange && this.ageRange[1] > 0) || (this.mileageRange && this.mileageRange[1] > 0) || this.transferCount || this.transferCount == 0
|| (this.displacementRange && this.displacementRange[1] > 0)
|| this.emissionStandards.length > 0
|| this.usageTypes.length > 0 || this.exteriorColor.length > 0 || (this.seats.length > 0));
}
reset(): void { reset(): void {
this.cityCode = null; this.cityCode = null;
...@@ -64,7 +73,7 @@ export class SearchQuery { ...@@ -64,7 +73,7 @@ export class SearchQuery {
this.carTypes = null; this.carTypes = null;
this.priceRange = [0, 0]; this.priceRange = [ 0, 0 ];
this.vehicleClass = null; this.vehicleClass = null;
...@@ -81,9 +90,9 @@ export class SearchQuery { ...@@ -81,9 +90,9 @@ export class SearchQuery {
this.rlxs = null; this.rlxs = null;
this.ageRange = [0, 0]; this.ageRange = [ 0, 0 ];
this.mileageRange = [0, 0]; this.mileageRange = [ 0, 0 ];
/** /**
* 过户次数 * 过户次数
...@@ -93,7 +102,7 @@ export class SearchQuery { ...@@ -93,7 +102,7 @@ export class SearchQuery {
/** /**
* 排量 * 排量
*/ */
this.displacementRange = [0, 0]; this.displacementRange = [ 0, 0 ];
/** /**
* 排放标准(3-国3/4-国4/5-国5/6-国6) * 排放标准(3-国3/4-国4/5-国5/6-国6)
...@@ -116,7 +125,7 @@ export class SearchQuery { ...@@ -116,7 +125,7 @@ export class SearchQuery {
setQueryForm(queryForm: any): void { setQueryForm(queryForm: any): void {
console.log(queryForm); console.log(queryForm);
queryForm.cityCode = this.cityCode; queryForm.cityCode = this.cityCode;
if (this.tag !== '不限') { if (this.tag !== "不限") {
queryForm.tags = this.tag; queryForm.tags = this.tag;
} else { } else {
queryForm.tags = null; queryForm.tags = null;
...@@ -131,9 +140,9 @@ export class SearchQuery { ...@@ -131,9 +140,9 @@ export class SearchQuery {
if (this.priceRange && this.priceRange[1] > 0) { if (this.priceRange && this.priceRange[1] > 0) {
if (this.priceRange[1] < 50) { if (this.priceRange[1] < 50) {
queryForm.startingBidPrice = [this.priceRange[0] * 10000, this.priceRange[1] * 10000]; queryForm.startingBidPrice = [ this.priceRange[0] * 10_000, this.priceRange[1] * 10_000 ];
} else { } else {
queryForm.startingBidPrice = [this.priceRange[0] * 10000, 99999 * 10000]; queryForm.startingBidPrice = [ this.priceRange[0] * 10_000, 99_999 * 10_000 ];
} }
} else { } else {
queryForm.startingBidPrice = null; queryForm.startingBidPrice = null;
...@@ -148,18 +157,18 @@ export class SearchQuery { ...@@ -148,18 +157,18 @@ export class SearchQuery {
// 计算车龄 // 计算车龄
if (this.ageRange && this.ageRange[1] > 0) { if (this.ageRange && this.ageRange[1] > 0) {
const today = dayjs(); const today = dayjs();
const start = today.add(-this.ageRange[1], 'years').format('YYYY-MM-DD'); const start = today.add(-this.ageRange[1], "years").format("YYYY-MM-DD");
const end = today.add(-this.ageRange[0], 'years').format('YYYY-MM-DD'); const end = today.add(-this.ageRange[0], "years").format("YYYY-MM-DD");
queryForm.productionDate = [start, end]; queryForm.productionDate = [ start, end ];
} else { } else {
queryForm.productionDate = null; queryForm.productionDate = null;
} }
if (this.mileageRange && this.mileageRange[1] > 0) { if (this.mileageRange && this.mileageRange[1] > 0) {
if (this.mileageRange[1] < 30) { if (this.mileageRange[1] < 30) {
queryForm.mileage = [this.mileageRange[0] * 10000, this.mileageRange[1] * 10000]; queryForm.mileage = [ this.mileageRange[0] * 10_000, this.mileageRange[1] * 10_000 ];
} else { } else {
queryForm.mileage = [this.mileageRange[0] * 10000, 9990000]; queryForm.mileage = [ this.mileageRange[0] * 10_000, 9_990_000 ];
} }
} else { } else {
queryForm.mileage = null; queryForm.mileage = null;
...@@ -169,7 +178,7 @@ export class SearchQuery { ...@@ -169,7 +178,7 @@ export class SearchQuery {
if (this.displacementRange[1] < 5) { if (this.displacementRange[1] < 5) {
queryForm.displacement = this.displacementRange; queryForm.displacement = this.displacementRange;
} else { } else {
queryForm.displacement = [this.displacementRange[0], 999]; queryForm.displacement = [ this.displacementRange[0], 999 ];
} }
} else { } else {
queryForm.displacement = null; queryForm.displacement = null;
...@@ -182,12 +191,4 @@ export class SearchQuery { ...@@ -182,12 +191,4 @@ export class SearchQuery {
} }
isNotEmpty(): boolean {
return (this.cityCode || this.tag || (this.carTypes && this.carTypes.length > 0) || (this.priceRange && this.priceRange[1] > 0) || this.vehicleClass.length > 0
|| this.overallRating || this.bxslxs.length > 0 || this.rlxs || (this.ageRange && this.ageRange[1] > 0) || (this.mileageRange && this.mileageRange[1] > 0) || this.transferCount || this.transferCount == 0
|| (this.displacementRange && this.displacementRange[1] > 0)
|| this.emissionStandards.length > 0
|| this.usageTypes.length > 0 || this.exteriorColor.length > 0 || (this.seats.length > 0));
}
} }
import type {FileInfo} from "autumn-vue/lib/core/bean/FileInfo"; import type { FileInfo } from "autumn-vue/lib/core/bean/FileInfo";
/** /**
* 文件上传 * 文件上传
...@@ -10,22 +10,22 @@ export function uploadFiles(tempFile: any, url: string, token: string): Promise< ...@@ -10,22 +10,22 @@ export function uploadFiles(tempFile: any, url: string, token: string): Promise<
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: url, url,
filePath: tempFile.path, filePath: tempFile.path,
name: 'file', name: "file",
file: tempFile, file: tempFile,
header: {'Authorization': 'Bearer ' + token}, header: { "Authorization": `Bearer ${ token}` },
success: res => { success: res => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
const file = JSON.parse(res.data); const file = JSON.parse(res.data);
resolve(file); resolve(file);
} else { } else {
reject(null); reject(new Error(`Upload failed with status code: ${res.statusCode}`));
} }
}, },
fail: (e) => { fail: (e) => {
//console.log('失败', e); // console.log('失败', e);
reject(null); reject(new Error(`Upload failed: ${e.errMsg}`));
} }
}); });
}); });
......
import {pinyin} from "pinyin-pro"; import { areaList } from "@vant/area-data";
import {areaList} from '@vant/area-data'; import { pinyin } from "pinyin-pro";
// 1. 工具函数:中文转拼音(全拼,小写) // 1. 工具函数:中文转拼音(全拼,小写)
function getPinyin(text: string): string { function getPinyin(text: string): string {
// 配置:type='array' 输出全拼,tone='none' 无声调 // 配置:type='array' 输出全拼,tone='none' 无声调
const pinyins = pinyin(text, {type: 'array', toneType: 'none'}); const pinyins = pinyin(text, { type: "array", toneType: "none" });
return pinyins.flat().join('').toLowerCase(); return pinyins.flat().join("").toLowerCase();
} }
// 2. 工具函数:获取拼音首字母(大写) // 2. 工具函数:获取拼音首字母(大写)
function getFirstLetter(pinyinStr: string): string { function getFirstLetter(pinyinStr: string): string {
if (!pinyinStr) return '#'; // 非拼音字符归为# if (!pinyinStr) return "#"; // 非拼音字符归为#
return pinyinStr.charAt(0).toUpperCase(); return pinyinStr.charAt(0).toUpperCase();
} }
...@@ -37,15 +37,15 @@ export function getCitiesData() { ...@@ -37,15 +37,15 @@ export function getCitiesData() {
const sortedLetters = Object.keys(grouped).sort(); // 按字母A-Z排序 const sortedLetters = Object.keys(grouped).sort(); // 按字母A-Z排序
const cityData = sortedLetters.map(letter => grouped[letter]); const cityData = sortedLetters.map(letter => grouped[letter]);
const result = { const result = {
indexList: ['常用/历史地址', ...sortedLetters], indexList: [ "常用/历史地址", ...sortedLetters ],
cityList: [ cityList: [
[ [
{name: '北京', value: 'beijing'}, { name: "北京", value: "beijing" },
{name: '上海', value: 'shanghai'}, { name: "上海", value: "shanghai" },
{name: '广州', value: 'guangzhou'}, { name: "广州", value: "guangzhou" },
{name: '深圳', value: 'shenghai'}, { name: "深圳", value: "shenghai" },
], ],
...cityData] ...cityData ]
}; };
return result; return result;
} }
...@@ -73,9 +73,9 @@ export function getIndexedCities(): Record<string, Array<City>> { ...@@ -73,9 +73,9 @@ export function getIndexedCities(): Record<string, Array<City>> {
return grouped; return grouped;
} }
export function getCityCodeByName(cityName: string): string | null { export function getCityCodeByName(cityName: string): null | string {
if (['北京', '上海', '广州', '深圳'].includes(cityName)) { if ([ "上海", "北京", "广州", "深圳" ].includes(cityName)) {
cityName = cityName + "市"; cityName = `${cityName }市`;
} }
const cityList = areaList.city_list; const cityList = areaList.city_list;
// 遍历对象的所有key // 遍历对象的所有key
......
import dayjs, {Dayjs} from "dayjs"; import { areaList } from "@vant/area-data";
import {areaList} from '@vant/area-data'; import dayjs, { Dayjs } from "dayjs";
export default { export default {
// 处理没有数据的占位 // 处理没有数据的占位
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
} }
return cities; return cities;
}, },
formatCityLabels(cityCodes: string[], separator = '/'): string { formatCityLabels(cityCodes: string[], separator = "/"): string {
const cities = this.formatCities(cityCodes); const cities = this.formatCities(cityCodes);
return cities.join(separator); return cities.join(separator);
}, },
...@@ -40,67 +40,67 @@ export default { ...@@ -40,67 +40,67 @@ export default {
}, },
// 图片预览页面公共方法处理 // 图片预览页面公共方法处理
openPreviewPage() { openPreviewPage() {
//监听组件显示 (隐藏TabBar和NavigationBar,隐藏video原生组件) // 监听组件显示 (隐藏TabBar和NavigationBar,隐藏video原生组件)
uni.hideTabBar() uni.hideTabBar();
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: '#000000', // 设置前景色为黑色 frontColor: "#000000", // 设置前景色为黑色
backgroundColor: '#000000', // 设置背景色为黑色 backgroundColor: "#000000", // 设置背景色为黑色
}) });
}, },
// 图片预览页面公共方法处理 // 图片预览页面公共方法处理
closePreviewPage() { closePreviewPage() {
uni.showTabBar() uni.showTabBar();
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: '#000000', // 设置前景色为白色 frontColor: "#000000", // 设置前景色为白色
backgroundColor: '#ffffff', // 设置背景色为黑色 backgroundColor: "#ffffff", // 设置背景色为黑色
}) });
}, },
formatDateTimeNoSecond(date: string | Dayjs): string | Dayjs { formatDateTimeNoSecond(date: Dayjs | string): Dayjs | string {
if (date) { if (date) {
return dayjs(date).format('YYYY-MM-DD HH:mm'); return dayjs(date).format("YYYY-MM-DD HH:mm");
} else { } else {
return '-'; return "-";
} }
}, },
formatDate(date: string | Dayjs): string | Dayjs { formatDate(date: Dayjs | string): Dayjs | string {
if (date) { if (date) {
return dayjs(date).format('YYYY-MM-DD'); return dayjs(date).format("YYYY-MM-DD");
} else { } else {
return date; return date;
} }
}, },
formatDateTimeNoDay(date: string | Dayjs): string | Dayjs { formatDateTimeNoDay(date: Dayjs | string): Dayjs | string {
if (date) { if (date) {
return dayjs(date).format('YYYY-MM'); return dayjs(date).format("YYYY-MM");
} else { } else {
return date; return date;
} }
}, },
hasUnitFormatDate(date: string | Dayjs): string | Dayjs { hasUnitFormatDate(date: Dayjs | string): Dayjs | string {
if (date) { if (date) {
return dayjs(date).format('YYYY' + '年' + 'MM' + '月'); return dayjs(date).format("YYYY" + "年" + "MM" + "月");
} else { } else {
return date; return date;
} }
}, },
// 图片自适应 // 图片自适应
imgHandle(html: string) { imgHandle(html: string) {
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) { let newContent = html.replaceAll(/<img[^>]*>/gi, (match, capture) => {
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, ''); match = match.replaceAll(/style="[^"]+"/gi, "").replaceAll(/style='[^']+'/gi, "");
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, ''); match = match.replaceAll(/width="[^"]+"/gi, "").replaceAll(/width='[^']+'/gi, "");
match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, ''); match = match.replaceAll(/height="[^"]+"/gi, "").replaceAll(/height='[^']+'/gi, "");
return match; return match;
}); });
newContent = newContent.replace(/style="[^"]+"/gi, function (match, capture) { newContent = newContent.replaceAll(/style="[^"]+"/gi, (match, capture) => {
match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi, 'max-width:100%;'); match = match.replaceAll(/width:[^;]+;/gi, "max-width:100%;").replaceAll(/width:[^;]+;/gi, "max-width:100%;");
return match; return match;
}); });
newContent = newContent.replace(/<br[^>]*\/>/gi, ''); newContent = newContent.replaceAll(/<br[^>]*\/>/gi, "");
newContent = newContent.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;margin:10px 0;"'); newContent = newContent.replaceAll(/<img/gi, '<img style="max-width:100%;height:auto;display:block;margin:10px 0;"');
return newContent; return newContent;
}, },
dateTimeFormatter(value: string) { dateTimeFormatter(value: string) {
return dayjs(value).format('YYYY-MM-DD HH:mm:ss'); return dayjs(value).format("YYYY-MM-DD HH:mm:ss");
}, },
// 查看前多少天 // 查看前多少天
...@@ -110,28 +110,28 @@ export default { ...@@ -110,28 +110,28 @@ export default {
const currentDate = new Date(); const currentDate = new Date();
// 获取前七天的日期 // 获取前七天的日期
const previousDates = []; const previousDates = [];
for (var i = num; i >= 0; i--) { for (let i = num; i >= 0; i--) {
var previousDate = new Date(currentDate); const previousDate = new Date(currentDate);
previousDate.setDate(currentDate.getDate() - i); previousDate.setDate(currentDate.getDate() - i);
previousDates.push(previousDate); previousDates.push(previousDate);
} }
// 格式化日期 // 格式化日期
const formattedDates = previousDates.map(function (date) { const formattedDates = previousDates.map((date) => {
var year = date.getFullYear(); const year = date.getFullYear();
var month = (date.getMonth() + 1).toString().padStart(2, '0'); const month = (date.getMonth() + 1).toString().padStart(2, "0");
var day = date.getDate().toString().padStart(2, '0'); const day = date.getDate().toString().padStart(2, "0");
// 加上8小时的偏移量 // 加上8小时的偏移量
date.setHours(date.getHours() + 8); date.setHours(date.getHours() + 8);
var hours = (date.getHours() < 10 ? '0' : '') + date.getHours(); const hours = (date.getHours() < 10 ? "0" : "") + date.getHours();
var minutes = (date.getMinutes() < 10 ? '0' : '') + date.getMinutes(); const minutes = (date.getMinutes() < 10 ? "0" : "") + date.getMinutes();
var seconds = (date.getSeconds() < 10 ? '0' : '') + date.getSeconds(); const seconds = (date.getSeconds() < 10 ? "0" : "") + date.getSeconds();
if (cutoffSeconds) { if (cutoffSeconds) {
// 工作台 我的任务日期选择需要添加上 时分秒 // 工作台 我的任务日期选择需要添加上 时分秒
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds; return `${year }-${ month }-${ day } ${ hours }:${ minutes }:${ seconds}`;
} else { } else {
return year + '-' + month + '-' + day; return `${year }-${ month }-${ day}`;
} }
}); });
return formattedDates; return formattedDates;
} }
} };
const modulesFilesEn: any = import.meta.glob("./en/*.ts", {eager: true}); const modulesFilesEn: any = import.meta.glob("./en/*.ts", { eager: true });
const modulesEn: any = {}; const modulesEn: any = {};
for (const path in modulesFilesEn) { for (const path in modulesFilesEn) {
...@@ -8,7 +8,7 @@ for (const path in modulesFilesEn) { ...@@ -8,7 +8,7 @@ for (const path in modulesFilesEn) {
} }
// 批量引入中文 // 批量引入中文
const modulesFilesZhCN: any = import.meta.glob("./zh_cn/*.ts", {eager: true}); const modulesFilesZhCN: any = import.meta.glob("./zh_cn/*.ts", { eager: true });
const modulesZhCN: any = {}; const modulesZhCN: any = {};
for (const path in modulesFilesZhCN) { for (const path in modulesFilesZhCN) {
modulesFilesZhCN[path].default; modulesFilesZhCN[path].default;
......
export default { export default {
entity: { entity: {
vehicle: { vehicle: {
ownerType: {1: '个人', 2: '单位'}, ownerType: { 1: "个人", 2: "单位" },
usageType: {1: '非营运', 2: '营运', 3: '营转非'}, usageType: { 1: "非营运", 2: "营运", 3: "营转非" },
overallRating: {1: '优', 2: '良', 3: '中', 4: '差'}, overallRating: { 1: "优", 2: "良", 3: "中", 4: "差" },
sunroof: {1: '无天窗', 2: '普通天窗', 3: '全景天窗'}, sunroof: { 1: "无天窗", 2: "普通天窗", 3: "全景天窗" },
} }
}, },
} };
...@@ -281,4 +281,4 @@ export default { ...@@ -281,4 +281,4 @@ export default {
"AUTHMODE": "-" "AUTHMODE": "-"
} }
} }
}
\ No newline at end of file \ No newline at end of file
};
\ No newline at end of file \ No newline at end of file
import {Component, Prop, Vue} from "vue-facing-decorator"; import { Component, Prop, Vue } from "vue-facing-decorator";
import {AuctionVehicle} from "lib/src/entity/auction/entity/AuctionVehicle";
import { AuthService } from "@/common/AuthService";
import { BurialPoint } from "@/common/BurialPoint";
import { maskNumberStr } from "@/common/CommonUtils";
import dayjs from "dayjs"; import dayjs from "dayjs";
import {Vehicle} from "lib/src/entity/vehicle/entity/Vehicle"; import { AuctionVehicle } from "lib/src/entity/auction/entity/AuctionVehicle";
import {BurialPoint} from "@/common/BurialPoint"; import { Vehicle } from "lib/src/entity/vehicle/entity/Vehicle";
import {AuthService} from "@/common/AuthService";
import {maskNumberStr} from "@/common/CommonUtils";
@Component({}) @Component({})
export default class AbstractVehicleItem extends Vue { export default class AbstractVehicleItem extends Vue {
@Prop({type: Object, required: true}) @Prop({ type: Object, required: true })
auctionVehicle: AuctionVehicle; auctionVehicle: AuctionVehicle;
get productionYear(): number {
return dayjs(this.vehicle.coreSpecs.productionDate as string).year();
}
get mileage(): string {
return (this.vehicle.baseInfo.mileage / 10000).toFixed(2);
}
get vehicle(): Vehicle {
return this.auctionVehicle.vehicle;
}
get licensePlate(): string {
return this.vehicle.baseInfo?.licensePlate.substring(0, 2);
}
get ageLess1Year(): boolean { get ageLess1Year(): boolean {
return dayjs().add(-1, 'years').isBefore(dayjs(this.vehicle.coreSpecs.productionDate as string)); return dayjs().add(-1, "years").isBefore(dayjs(this.vehicle.coreSpecs.productionDate as string));
} }
get efficient(): boolean { get efficient(): boolean {
return (this.vehicle.coreSpecs.vehicleClass === '小型车' || this.vehicle.coreSpecs.vehicleClass === '紧凑型车'); return (this.vehicle.coreSpecs.vehicleClass === "小型车" || this.vehicle.coreSpecs.vehicleClass === "紧凑型车");
}
/**
* 只剩下5分钟拍卖结束倒计时
*/
get endRemaining() {
// const now = dayjs();
// const endTime = dayjs(this.auctionVehicle.auctionEndTime as string);
// return endTime.diff(now);
return this.auctionVehicle.bidEndRemaining;
} }
get hasBidPrivilege(): boolean { get hasBidPrivilege(): boolean {
const authService: AuthService = this.$auth as AuthService; const authService: AuthService = this.$auth as AuthService;
if (authService.isLogin() && authService.getAuthentication().accountType !== 'COMMON') { if (authService.isLogin() && authService.getAuthentication().accountType !== "COMMON") {
return true; return true;
} else { } else {
return false; return false;
} }
} }
get maskBidPrice(): string { get licensePlate(): string {
return maskNumberStr((this.vehicle.startingBidPrice / 10000).toFixed(2)); return this.vehicle.baseInfo?.licensePlate.slice(0, 2);
} }
get maskBidPrice(): string {
return maskNumberStr((this.vehicle.startingBidPrice / 10_000).toFixed(2));
}
viewCarDetail() { get mileage(): string {
BurialPoint.burialPoint(this.$auth.getAuthentication(), 'auction_home_vehiclecard_click', this.auctionVehicle.aucvehId.toString(), '/module/auction/AuctionVehiclePage'); return (this.vehicle.baseInfo.mileage / 10_000).toFixed(2);
uni.navigateTo({url: '/module/auction/AuctionVehiclePage?aucvehId=' + this.auctionVehicle.aucvehId});
} }
/** /**
* 是否小于24小时开拍 * 预览倒计时
*/ */
get previewLessThen24h(): boolean { get previewCountDown(): number {
// const now = dayjs(); // const now = dayjs();
// const startTime = dayjs(this.auctionVehicle.auctionStartTime as string); // const startTime = dayjs(this.auctionVehicle.auctionStartTime as string);
// return (startTime.diff(now) <= 24 * 60 * 60 * 1000); // return startTime.diff(now);
return this.auctionVehicle.bidStartRemaining;
return (this.auctionVehicle.bidStartRemaining <= 24 * 60 * 60 * 1000);
} }
/** /**
* 预览倒计时 * 是否小于24小时开拍
*/ */
get previewCountDown(): number { get previewLessThen24h(): boolean {
// const now = dayjs(); // const now = dayjs();
// const startTime = dayjs(this.auctionVehicle.auctionStartTime as string); // const startTime = dayjs(this.auctionVehicle.auctionStartTime as string);
// return startTime.diff(now); // return (startTime.diff(now) <= 24 * 60 * 60 * 1000);
return this.auctionVehicle.bidStartRemaining;
return (this.auctionVehicle.bidStartRemaining <= 24 * 60 * 60 * 1000);
} }
/** /**
...@@ -81,17 +79,12 @@ export default class AbstractVehicleItem extends Vue { ...@@ -81,17 +79,12 @@ export default class AbstractVehicleItem extends Vue {
get previewStatus(): string { get previewStatus(): string {
const now = dayjs(); const now = dayjs();
const startTime = dayjs(this.auctionVehicle.auctionStartTime as string); const startTime = dayjs(this.auctionVehicle.auctionStartTime as string);
return startTime.format('YYYY/MM/DD HH:mm'); return startTime.format("YYYY/MM/DD HH:mm");
} }
// /** get productionYear(): number {
// * 拍卖中显示状态信息 return dayjs(this.vehicle.coreSpecs.productionDate as string).year();
// */ }
// get auctionStatus(): string {
// const now = dayjs();
// const endTime = dayjs(this.auctionVehicle.auctionEndTime as string);
// return '剩余 ' + dayjs.duration(endTime.diff(now)).format('HH:mm:ss');
// }
/** /**
* 是否只剩下5分钟拍卖结束 * 是否只剩下5分钟拍卖结束
...@@ -104,21 +97,29 @@ export default class AbstractVehicleItem extends Vue { ...@@ -104,21 +97,29 @@ export default class AbstractVehicleItem extends Vue {
return this.auctionVehicle.bidEndRemaining < 5 * 60 * 1000; return this.auctionVehicle.bidEndRemaining < 5 * 60 * 1000;
} }
/** // /**
* 只剩下5分钟拍卖结束倒计时 // * 拍卖中显示状态信息
*/ // */
get endRemaining() { // get auctionStatus(): string {
// const now = dayjs(); // const now = dayjs();
// const endTime = dayjs(this.auctionVehicle.auctionEndTime as string); // const endTime = dayjs(this.auctionVehicle.auctionEndTime as string);
// return endTime.diff(now); // return '剩余 ' + dayjs.duration(endTime.diff(now)).format('HH:mm:ss');
return this.auctionVehicle.bidEndRemaining; // }
get vehicle(): Vehicle {
return this.auctionVehicle.vehicle;
}
countDownBidEnd(): void {
this.auctionVehicle.auctionState = "SOLD";
} }
countDownBidStart(): void { countDownBidStart(): void {
this.auctionVehicle.auctionState = 'AUCTIONING'; this.auctionVehicle.auctionState = "AUCTIONING";
} }
countDownBidEnd(): void { viewCarDetail() {
this.auctionVehicle.auctionState = 'SOLD'; BurialPoint.burialPoint(this.$auth.getAuthentication(), "auction_home_vehiclecard_click", this.auctionVehicle.aucvehId.toString(), "/module/auction/AuctionVehiclePage");
uni.navigateTo({ url: `/module/auction/AuctionVehiclePage?aucvehId=${ this.auctionVehicle.aucvehId}` });
} }
} }
<template> <template>
<view v-if="auctionVehicle" class="car-item" @click="viewCarDetail()"> <view v-if="auctionVehicle"
class="car-item"
@click="viewCarDetail()">
<vehicle-cover-wrapper :auction-vehicle="auctionVehicle"></vehicle-cover-wrapper> <vehicle-cover-wrapper :auction-vehicle="auctionVehicle"></vehicle-cover-wrapper>
<view class="car-info"> <view class="car-info">
<text class="car-name">【{{ licensePlate }}】{{ vehicle.baseInfo.carSeriesName }} {{ vehicle.baseInfo.carTypeName }}</text> <text class="car-name">【{{ licensePlate }}】{{ vehicle.baseInfo.carSeriesName }} {{ vehicle.baseInfo.carTypeName }}</text>
<text class="car-specs">{{ productionYear }}年 | {{ mileage }}万公里</text> <text class="car-specs">{{ productionYear }}年 | {{ mileage }}万公里</text>
<view class="car-features"> <view class="car-features">
<text class="feature-item" v-if="vehicle.ownership.transferCount===0">零次过户</text> <text v-if="vehicle.ownership.transferCount === 0" class="feature-item">零次过户</text>
<text class="feature-item" v-if="vehicle.baseInfo.mileage<10000&&ageLess1Year">准新车</text> <text v-if="vehicle.baseInfo.mileage < 10000 && ageLess1Year" class="feature-item">准新车</text>
<text class="feature-item" v-if="vehicle.ownership.ownerType===1">个人车</text> <text v-if="vehicle.ownership.ownerType === 1" class="feature-item">个人车</text>
<text class="feature-item">{{ vehicle.ownership.registrationDate.substring(0, 4) }}年上牌</text> <text class="feature-item">{{ vehicle.ownership.registrationDate.substring(0, 4) }}年上牌</text>
<text class="feature-item" v-if="efficient">省油代步</text> <text v-if="efficient" class="feature-item">省油代步</text>
<text class="feature-item" v-if="vehicle.coreSpecs.rlxs==='纯电动'">新能源</text> <text v-if="vehicle.coreSpecs.rlxs === '纯电动'" class="feature-item">新能源</text>
</view> </view>
<view class="car-price-container"> <view class="car-price-container">
<image src="/static/images/auction/auction-tool.png" class="auction-icon" mode="aspectFit"></image> <image class="auction-icon"
<text class="car-price" v-if="hasBidPrivilege">{{ $filters.formatNumber(vehicle.startingBidPrice / 10000) }}</text> mode="aspectFit"
<text class="car-price" v-else>{{ maskBidPrice }}</text> src="/static/images/auction/auction-tool.png">
</image>
<text v-if="hasBidPrivilege" class="car-price">{{ $filters.formatNumber(vehicle.startingBidPrice / 10000) }}</text>
<text v-else class="car-price">{{ maskBidPrice }}</text>
<text class="car-price car-price-unit">万</text> <text class="car-price car-price-unit">万</text>
<text class="car-price car-price-unit" v-if="auctionVehicle.auctionState==='AUCTIONING'">竞价中...</text> <text v-if="auctionVehicle.auctionState === 'AUCTIONING'" class="car-price car-price-unit">竞价中...</text>
<text class="price-label" v-else-if="auctionVehicle.auctionState==='PREVIEW'">起拍</text> <text v-else-if="auctionVehicle.auctionState === 'PREVIEW'" class="price-label">起拍</text>
<text class="price-label" v-else>已结束</text> <text v-else class="price-label">已结束</text>
</view> </view>
</view> </view>
<view class="favorite-button" v-if="showFavorite" @click.stop="toggleFavorite()"> <view v-if="showFavorite"
<van-image v-if="auctionVehicle.favorite" use-error-slot width="26" fit="cover" height="26" src="/static/images/auction/favorite.png"></van-image> class="favorite-button"
<van-image v-else use-error-slot width="26" fit="cover" height="26" src="/static/images/auction/un_favorite.png"></van-image> @click.stop="toggleFavorite()">
<van-image v-if="auctionVehicle.favorite"
fit="cover"
height="26"
src="/static/images/auction/favorite.png"
use-error-slot
width="26">
</van-image>
<van-image v-else
fit="cover"
height="26"
src="/static/images/auction/un_favorite.png"
use-error-slot
width="26">
</van-image>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Prop, Vue} from 'vue-facing-decorator'; import { Component, Prop } from "vue-facing-decorator";
import {AuctionVehicle} from "lib/src/entity/auction/entity/AuctionVehicle";
import dayjs from "dayjs"; import { FavoriteController } from "@/api/FavoriteController";
import {FavoriteController} from "@/api/FavoriteController";
import {FileInfo} from "autumn-vue/lib/core/bean/FileInfo";
import {Vehicle} from "lib/src/entity/vehicle/entity/Vehicle";
import AbstractVehicleItem from "@/components/AbstractVehicleItem"; import AbstractVehicleItem from "@/components/AbstractVehicleItem";
import VehicleCoverWrapper from "@/components/VehicleCoverWrapper.vue"; import VehicleCoverWrapper from "@/components/VehicleCoverWrapper.vue";
import {AuthService} from "@/common/AuthService";
@Component({ @Component({
components: {VehicleCoverWrapper} components: { VehicleCoverWrapper }
}) })
export default class AuctionVehicleItem extends AbstractVehicleItem { export default class AuctionVehicleItem extends AbstractVehicleItem {
@Prop({type: Boolean, required: false, default: true}) @Prop({ type: Boolean, required: false, default: true })
showFavorite: boolean; showFavorite: boolean;
...@@ -52,16 +67,16 @@ export default class AuctionVehicleItem extends AbstractVehicleItem { ...@@ -52,16 +67,16 @@ export default class AuctionVehicleItem extends AbstractVehicleItem {
toggleFavorite(): void { toggleFavorite(): void {
if (!this.$auth.isLogin()) { if (!this.$auth.isLogin()) {
uni.showToast({ uni.showToast({
title: '请先登录', complete: function () { title: "请先登录", complete () {
uni.reLaunch({url: '/pages/LoginPage'}); uni.reLaunch({ url: "/pages/LoginPage" });
} }
}); });
} }
uni.showLoading({title: '正在收藏中', mask: true}); uni.showLoading({ title: "正在收藏中", mask: true });
FavoriteController.toggleFavorite(this.axios, this.auctionVehicle.aucvehId).then((res) => { FavoriteController.toggleFavorite(this.axios, this.auctionVehicle.aucvehId).then((res) => {
this.auctionVehicle.favorite = res.data; this.auctionVehicle.favorite = res.data;
setTimeout(() => { setTimeout(() => {
uni.showToast({title: this.auctionVehicle.favorite ? '收藏成功' : '取消收藏 '}); uni.showToast({ title: this.auctionVehicle.favorite ? "收藏成功" : "取消收藏 " });
}, 300); }, 300);
}).finally(() => uni.hideLoading()); }).finally(() => uni.hideLoading());
} }
...@@ -77,38 +92,38 @@ export default class AuctionVehicleItem extends AbstractVehicleItem { ...@@ -77,38 +92,38 @@ export default class AuctionVehicleItem extends AbstractVehicleItem {
/* 车辆项样式 */ /* 车辆项样式 */
.car-item { .car-item {
position: relative;
display: flex; display: flex;
//background-color: #fff;
border-radius: 8px;
padding: 1px; padding: 1px;
position: relative;
margin-bottom: 10px; margin-bottom: 10px;
//background-color: #fff;
border-radius: 8px;
} }
.car-info { .car-info {
flex: 1;
margin-left: 10px;
display: flex; display: flex;
flex: 1;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
margin-left: 10px;
} }
.car-name { .car-name {
max-width: 245px;
overflow: hidden;
text-overflow: ellipsis;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #333;
line-height: 1.4; line-height: 1.4;
overflow: hidden; color: #333;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis;
max-width: 245px;
} }
.car-specs { .car-specs {
margin-top: 4px;
font-size: 12px; font-size: 12px;
color: #666; color: #666;
margin-top: 4px;
} }
.car-features { .car-features {
...@@ -120,19 +135,19 @@ export default class AuctionVehicleItem extends AbstractVehicleItem { ...@@ -120,19 +135,19 @@ export default class AuctionVehicleItem extends AbstractVehicleItem {
.feature-item { .feature-item {
font-size: 10px;
color: #999;
border: 1px solid #f0f0f0;
//border-color: #f5f5f5; //border-color: #f5f5f5;
//background-color: #f5f5f5; //background-color: #f5f5f5;
padding: 2px 6px; padding: 2px 6px;
font-size: 10px;
color: #999;
border: 1px solid #f0f0f0;
border-radius: 2px; border-radius: 2px;
} }
.car-price-container { .car-price-container {
display: flex; display: flex;
align-items: center;
gap: 4px; gap: 4px;
align-items: center;
margin-top: 4px; margin-top: 4px;
} }
...@@ -143,8 +158,8 @@ export default class AuctionVehicleItem extends AbstractVehicleItem { ...@@ -143,8 +158,8 @@ export default class AuctionVehicleItem extends AbstractVehicleItem {
.car-price { .car-price {
font-size: 16px; font-size: 16px;
color: #ff4d4f;
font-weight: 500; font-weight: 500;
color: #ff4d4f;
} }
.car-price-unit { .car-price-unit {
......
import {Component, Ref, Vue} from "vue-facing-decorator"; import { Component, Ref, Vue } from "vue-facing-decorator";
import CustomNavBar from "@/components/CustomNavBar.vue";
import OrderVehicleItem from "@/module/order/OrderVehicleItem.vue"; import { SignOrder } from "lib/src/entity/auction/domain/SignOrder";
import {SignOrder} from "lib/src/entity/auction/domain/SignOrder"; import { AuctionOrder } from "lib/src/entity/auction/entity/AuctionOrder";
import {AuctionOrder} from "lib/src/entity/auction/entity/AuctionOrder";
@Component({ @Component({
components: {} components: {}
}) })
export default class SignOrderPage extends Vue { export default class SignOrderPage extends Vue {
orderId: number = 0;
order: AuctionOrder = null;
@Ref() @Ref()
contractPopup: any; contractPopup: any;
signOrder: SignOrder = null; order: AuctionOrder = null;
orderId: number = 0;
rules = { rules = {
accountName: { accountName: {
rules: [{required: true, errorMessage: '请输入真实姓名'}] rules: [ { required: true, errorMessage: "请输入真实姓名" } ]
}, },
mobile: { mobile: {
rules: [{required: true, errorMessage: '请输入手机号码'}] rules: [ { required: true, errorMessage: "请输入手机号码" } ]
}, },
idCard: { idCard: {
rules: [{required: true, errorMessage: '请输入身份证号码'}, { rules: [ { required: true, errorMessage: "请输入身份证号码" }, {
pattern: /(^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}$)/, pattern: /(^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9X]$)|(^[1-9]\d{7}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}$)/i,
errorMessage: '请输入正确的身份证号码' errorMessage: "请输入正确的身份证号码"
}] } ]
} }
}; };
signOrder: SignOrder = null;
cancel(): void { cancel(): void {
this.contractPopup.close(); this.contractPopup.close();
} }
......
<template> <template>
<view class="car-image-wrapper"> <view class="car-image-wrapper">
<van-image use-error-slot width="120" fit="cover" radius="16rpx" height="90" :src="vehicle.cover?.url"></van-image> <van-image fit="cover"
<view class="light-status light-preview" v-if="auctionVehicle.auctionState==='PREVIEW'"> height="90"
radius="16rpx"
:src="vehicle.cover?.url"
use-error-slot
width="120">
</van-image>
<view v-if="auctionVehicle.auctionState === 'PREVIEW'" class="light-status light-preview">
等待竞价 等待竞价
</view> </view>
<template v-else-if="auctionVehicle.auctionState==='AUCTIONING'"> <template v-else-if="auctionVehicle.auctionState === 'AUCTIONING'">
<view class="light-status"> <view class="light-status">
竞价中 竞价中
</view> </view>
</template> </template>
<template v-else> <template v-else>
<image src="/static/images/close.png" class="close-icon" mode="aspectFit"></image> <image class="close-icon"
mode="aspectFit"
src="/static/images/close.png">
</image>
</template> </template>
<!-- <template v-if="auctionVehicle.auction.auctionType==='DARK'">--> <!-- <template v-if="auctionVehicle.auction.auctionType==='DARK'">-->
...@@ -25,20 +34,29 @@ ...@@ -25,20 +34,29 @@
<!-- </template>--> <!-- </template>-->
<view class="car-tags"> <view class="car-tags">
<view class="tag-item"> <view class="tag-item">
<template v-if="auctionVehicle.auctionState==='PREVIEW'"> <template v-if="auctionVehicle.auctionState === 'PREVIEW'">
<template v-if="previewLessThen24h"> <template v-if="previewLessThen24h">
<van-count-down class="white-small-count-down" :time="previewCountDown" format="HH:mm:ss 后开拍" @finish="countDownBidStart"/> <van-count-down class="white-small-count-down"
format="HH:mm:ss 后开拍"
:time="previewCountDown"
@finish="countDownBidStart" />
</template> </template>
<template v-else> <template v-else>
{{ previewStatus }} {{ previewStatus }}
</template> </template>
</template> </template>
<template v-if="auctionVehicle.auctionState==='AUCTIONING'"> <template v-if="auctionVehicle.auctionState === 'AUCTIONING'">
<template v-if="remaining5m"> <template v-if="remaining5m">
<van-count-down class="white-small-count-down" :time="endRemaining" format="距离结束 mm:ss" @finish="countDownBidEnd"/> <van-count-down class="white-small-count-down"
format="距离结束 mm:ss"
:time="endRemaining"
@finish="countDownBidEnd" />
</template> </template>
<template v-else> <template v-else>
<van-count-down class="white-small-count-down" :time="endRemaining" format="距离结束 HH:mm:ss" @finish="countDownBidEnd"/> <van-count-down class="white-small-count-down"
format="距离结束 HH:mm:ss"
:time="endRemaining"
@finish="countDownBidEnd" />
</template> </template>
</template> </template>
</view> </view>
...@@ -46,23 +64,22 @@ ...@@ -46,23 +64,22 @@
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Prop, Vue} from "vue-facing-decorator"; import { Component } from "vue-facing-decorator";
import AbstractVehicleItem from "@/components/AbstractVehicleItem"; import AbstractVehicleItem from "@/components/AbstractVehicleItem";
@Component({ @Component({
components: {} components: {}
}) })
export default class VehicleCoverWrapper extends AbstractVehicleItem { export default class VehicleCoverWrapper extends AbstractVehicleItem {}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.car-image-wrapper { .car-image-wrapper {
position: relative;
min-width: 120px; min-width: 120px;
height: 90px; height: 90px;
position: relative;
} }
.car-image { .car-image {
...@@ -73,30 +90,30 @@ export default class VehicleCoverWrapper extends AbstractVehicleItem { ...@@ -73,30 +90,30 @@ export default class VehicleCoverWrapper extends AbstractVehicleItem {
.car-tags { .car-tags {
position: absolute; position: absolute;
bottom: 0;
width: 100%; width: 100%;
text-align: center; text-align: center;
bottom: 0;
background-color: #00000080; background-color: #00000080;
border-radius: 0 0 12px 12px; border-radius: 0 0 12px 12px;
//opacity: 0.5; //opacity: 0.5;
} }
.tag-item { .tag-item {
color: #fff;
font-size: 10px;
position: relative; position: relative;
bottom: 1px; bottom: 1px;
font-size: 10px;
color: #fff;
} }
.light-status { .light-status {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
border-radius: 8px 0px 10px 0px; padding: 2px 4px;
background: linear-gradient(228.31deg, #F23204CC 0%, #FF9F82CC 100%);
font-size: 10px; font-size: 10px;
color: #fff; color: #fff;
padding: 2px 4px; background: linear-gradient(228.31deg, #F23204CC 0%, #FF9F82CC 100%);
border-radius: 8px 0 10px;
} }
.light-preview { .light-preview {
......
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
</text> </text>
<template v-if="searchQuery?.vehicleClass && searchQuery?.vehicleClass.length > 0"> <template v-if="searchQuery?.vehicleClass && searchQuery?.vehicleClass.length > 0">
<text v-for="item in searchQuery?.vehicleClass" <text v-for="(item,index) in searchQuery?.vehicleClass"
:key="index"
class="filter-tag" class="filter-tag"
@click="clearVehicleClassFilter(item)"> @click="clearVehicleClassFilter(item)">
{{ item.name }} X {{ item.name }} X
...@@ -41,7 +42,8 @@ ...@@ -41,7 +42,8 @@
</text> </text>
<template v-if="searchQuery?.bxslxs && searchQuery?.bxslxs.length > 0"> <template v-if="searchQuery?.bxslxs && searchQuery?.bxslxs.length > 0">
<text v-for="bxslx in searchQuery?.bxslxs" <text v-for="(bxslx,index) in searchQuery?.bxslxs"
:key="index"
class="filter-tag" class="filter-tag"
@click="clearBxslxFilter(bxslx)"> @click="clearBxslxFilter(bxslx)">
{{ bxslx }} X {{ bxslx }} X
...@@ -102,7 +104,8 @@ ...@@ -102,7 +104,8 @@
</text> </text>
<template v-if="searchQuery?.emissionStandards && searchQuery?.emissionStandards.length > 0"> <template v-if="searchQuery?.emissionStandards && searchQuery?.emissionStandards.length > 0">
<text v-for="item in searchQuery?.emissionStandards" <text v-for="(item,index) in searchQuery?.emissionStandards"
:key="index"
class="filter-tag" class="filter-tag"
@click="clearEmissionStandardFilter(item)"> @click="clearEmissionStandardFilter(item)">
国{{ item }} X 国{{ item }} X
...@@ -110,7 +113,8 @@ ...@@ -110,7 +113,8 @@
</template> </template>
<template v-if="searchQuery?.usageTypes && searchQuery?.usageTypes.length > 0"> <template v-if="searchQuery?.usageTypes && searchQuery?.usageTypes.length > 0">
<text v-for="item in searchQuery?.usageTypes" <text v-for="(item,index) in searchQuery?.usageTypes"
:key="index"
class="filter-tag" class="filter-tag"
@click="clearUsageTypeFilter(item)"> @click="clearUsageTypeFilter(item)">
{{ item.name }} X {{ item.name }} X
...@@ -118,14 +122,16 @@ ...@@ -118,14 +122,16 @@
</template> </template>
<template v-if="searchQuery?.exteriorColor && searchQuery?.exteriorColor.length > 0"> <template v-if="searchQuery?.exteriorColor && searchQuery?.exteriorColor.length > 0">
<text v-for="item in searchQuery?.exteriorColor" <text v-for="(item,index) in searchQuery?.exteriorColor"
:key="index"
class="filter-tag" class="filter-tag"
@click="clearColorFilter(item)"> @click="clearColorFilter(item)">
{{ item.name }} X {{ item.name }} X
</text> </text>
</template> </template>
<template v-if="searchQuery?.seats && searchQuery?.seats.length > 0"> <template v-if="searchQuery?.seats && searchQuery?.seats.length > 0">
<text v-for="seat in searchQuery?.seats" <text v-for="(seat,index) in searchQuery?.seats"
:key="index"
class="filter-tag" class="filter-tag"
@click="clearSeatFilter(seat)"> @click="clearSeatFilter(seat)">
{{ seat }}座 X {{ seat }}座 X
...@@ -133,7 +139,8 @@ ...@@ -133,7 +139,8 @@
</template> </template>
<text v-for="carType in searchQuery?.carTypes" <text v-for="(carType,index) in searchQuery?.carTypes"
:key="index"
class="filter-tag" class="filter-tag"
@click="clearCarTypeFilter(carType)"> @click="clearCarTypeFilter(carType)">
{{ carType.name }} X {{ carType.name }} X
...@@ -167,7 +174,7 @@ export default class SearchQueryFilter extends Vue { ...@@ -167,7 +174,7 @@ export default class SearchQueryFilter extends Vue {
searchQuery: SearchQuery; searchQuery: SearchQuery;
clearAllFilters(): void { clearAllFilters(): void {
this.$emit("clear-all"); this.$emit("clearAll");
} }
clearBxslxFilter(bxslx: string) { clearBxslxFilter(bxslx: string) {
......
...@@ -2,13 +2,20 @@ ...@@ -2,13 +2,20 @@
<view> <view>
<view class="price-container"> <view class="price-container">
<van-row :gutter="12"> <van-row :gutter="12">
<van-col span="8" v-for="price in priceRanges" :key="price.label"> <van-col v-for="price in priceRanges"
<view class="price-text" :class="{active:selectedPrice?.label===price.label}" @click="selectPrice(price)">{{ price.label }}</view> :key="price.label"
span="8">
<view class="price-text"
:class="{active:selectedPrice?.label === price.label}"
@click="selectPrice(price)">
{{ price.label }}
</view>
</van-col> </van-col>
</van-row> </van-row>
</view> </view>
<view class="price-range"> <view class="price-range">
<view class="price-title">价格 <view class="price-title">
价格
<text style="font-size: 12px;color: #676D7D;">(万元)</text> <text style="font-size: 12px;color: #676D7D;">(万元)</text>
</view> </view>
<view class="slider-ranges"> <view class="slider-ranges">
...@@ -19,24 +26,42 @@ ...@@ -19,24 +26,42 @@
<text>80</text> <text>80</text>
<text>不限</text> <text>不限</text>
</view> </view>
<van-slider :value="priceRange" :min="0" :max="100" :step="1" :bar-height="5" active-color="#185EFE" range @change="onSliderChange" use-button-slot> <van-slider active-color="#185EFE"
<view class="slider-button" slot="left-button"> :bar-height="5"
:max="100"
:min="0"
range
:step="1"
use-button-slot
:value="priceRange"
@change="onSliderChange">
<template #left-button>
<view class="slider-button">
<view class="arrow-down"></view> <view class="arrow-down"></view>
</view> </view>
<view class="slider-button" slot="right-button"> </template>
<template #right-button>
<view class="slider-button">
<view class="arrow-down"></view> <view class="arrow-down"></view>
</view> </view>
</template>
</van-slider> </van-slider>
</view> </view>
<view style="padding: 5px 16px;"> <view style="padding: 5px 16px;">
<van-row gutter="12"> <van-row gutter="12">
<van-col span="12"> <van-col span="12">
<van-button type="default" block round @click="onReset"> <van-button block
round
type="default"
@click="onReset">
重置 重置
</van-button> </van-button>
</van-col> </van-col>
<van-col span="12"> <van-col span="12">
<van-button type="primary" block round @click="onConfirm"> <van-button block
round
type="primary"
@click="onConfirm">
查看 查看
</van-button> </van-button>
</van-col> </van-col>
...@@ -46,44 +71,44 @@ ...@@ -46,44 +71,44 @@
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Vue, Component} from 'vue-facing-decorator'; import { Component, Vue } from "vue-facing-decorator";
@Component({}) @Component({})
export default class VehiclePriceRangeFilter extends Vue { export default class VehiclePriceRangeFilter extends Vue {
priceRange = [ 0, 0 ];
priceRanges = [ priceRanges = [
{label: '不限价格', min: 0, max: 99999}, { label: "不限价格", min: 0, max: 99_999 },
{label: '0-3万', min: 0, max: 3}, { label: "0-3万", min: 0, max: 3 },
{label: '3-5万', min: 3, max: 5}, { label: "3-5万", min: 3, max: 5 },
{label: '5-10万', min: 5, max: 10}, { label: "5-10万", min: 5, max: 10 },
{label: '10-20万', min: 10, max: 20}, { label: "10-20万", min: 10, max: 20 },
{label: '20-30万', min: 20, max: 30}, { label: "20-30万", min: 20, max: 30 },
{label: '30-50万', min: 30, max: 50}, { label: "30-50万", min: 30, max: 50 },
{label: '50-100万', min: 50, max: 100}, { label: "50-100万", min: 50, max: 100 },
{label: '100万以上', min: 100, max: 99999} { label: "100万以上", min: 100, max: 99_999 }
]; ];
priceRange = [0, 0];
selectedPrice: any = null; selectedPrice: any = null;
selectPrice(price: any): void { onConfirm(): void {
this.selectedPrice = price; this.$emit("priceChange", { min: this.priceRange[0], max: this.priceRange[1] });
this.priceRange = [price.min, price.max];
} }
onSliderChange(event: any): void { onReset(): void {
this.selectedPrice = null; this.selectedPrice = null;
this.priceRange = event.detail; this.priceRange = [ 0, 0 ];
this.onConfirm();
} }
onReset(): void { onSliderChange(event: any): void {
this.selectedPrice = null; this.selectedPrice = null;
this.priceRange = [0, 0]; this.priceRange = event.detail;
this.onConfirm();
} }
onConfirm(): void { selectPrice(price: any): void {
this.$emit('priceChange', {min: this.priceRange[0], max: this.priceRange[1]}); this.selectedPrice = price;
this.priceRange = [ price.min, price.max ];
} }
} }
</script> </script>
...@@ -91,37 +116,37 @@ export default class VehiclePriceRangeFilter extends Vue { ...@@ -91,37 +116,37 @@ export default class VehiclePriceRangeFilter extends Vue {
<style scoped lang="scss"> <style scoped lang="scss">
.price-container { .price-container {
margin: 0 12px;
padding: 0 12px; padding: 0 12px;
margin: 0 12px;
} }
.price-text { .price-text {
padding: 12px;
margin-bottom: 12px;
//width: 100%; //width: 100%;
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #333333; color: #333;
border-radius: 4px;
background: #F8F9FC;
padding: 12px;
text-align: center; text-align: center;
margin-bottom: 12px; background: #F8F9FC;
border-radius: 4px;
} }
.price-text.active { .price-text.active {
background: #F5F9FF;
color: #185EFE; color: #185EFE;
background: #F5F9FF;
} }
.price-range { .price-range {
margin: 0 12px 12px 12px; padding: 0 16px 18px;
padding: 0 16px 18px 16px; margin: 0 12px 12px;
} }
.price-title { .price-title {
margin-bottom: 16px;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
color: #141E34; color: #141E34;
margin-bottom: 16px;
} }
......
/// <reference types="vite/client" /> // / <reference types="vite/client" />
declare module '*.vue' { declare module "*.vue" {
import {DefineComponent} from 'vue' import { DefineComponent } from "vue";
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types // eslint-disable-next-line
const component: DefineComponent<{}, {}, any> const component: DefineComponent<{}, {}, any>;
export default component export default component;
} }
/** /**
* 自定义类型申明 * 自定义类型申明
*/ */
declare module '@vue/runtime-core' { declare module "@vue/runtime-core" {
interface ComponentCustomProperties { interface ComponentCustomProperties {
$filters: any, $filters: any,
$auth: AuthService, $auth: AuthService,
......
import {createSSRApp} from "vue"; import type { AxiosStatic } from "axios";
import App from "./App.vue";
import {createI18n, useI18n} from "vue-i18n"; import { createSSRApp } from "vue";
import "./main.scss"; import { createI18n, useI18n } from "vue-i18n";
import { AuthService } from "@/common/AuthService";
import { BurialPoint } from "@/common/BurialPoint";
import { CustomTokenInterceptor } from "@/common/CustomTokenInterceptor";
import filterValueData from "@/common/filters";
// import "./components/uni-plate-input/uni-plate-input.css"; // import "./components/uni-plate-input/uni-plate-input.css";
import messages from '@/common/i18n/index'; import messages from "@/common/i18n/index";
import type {AxiosStatic} from "axios"; import store from "@/store";
import axios from "axios"; import axios from "axios";
import filterValueData from "@/common/filters"; import mpAdapter from "axios-miniprogram-adapter";
import uviewPlus from 'uview-plus';
import {AuthService} from "@/common/AuthService";
import dayjs from "dayjs"; import dayjs from "dayjs";
import duration from "dayjs/plugin/duration"; import duration from "dayjs/plugin/duration";
import {CustomTokenInterceptor} from "@/common/CustomTokenInterceptor"; import uviewPlus from "uview-plus";
import store from "@/store";
import mpAdapter from 'axios-miniprogram-adapter'
import {BurialPoint} from "@/common/BurialPoint";
/// <reference types="@dcloudio/types" /> // 引入 uni 类型 import App from "./App.vue";
import "./main.scss";
// / <reference types="@dcloudio/types" /> // 引入 uni 类型
const i18n = createI18n({ const i18n = createI18n({
locale: 'zh-cn', locale: "zh-cn",
legacy: false, legacy: false,
globalInjection: true, globalInjection: true,
fallbackLocale: 'zh-cn', fallbackLocale: "zh-cn",
messages: messages messages
}); });
const systemI18n = { const systemI18n = {
setup() { setup() {
const {locale, t} = useI18n(); const { locale, t } = useI18n();
return {locale, t}; return { locale, t };
} }
}; };
dayjs.extend(duration); dayjs.extend(duration);
export function createApp() { export function createApp() {
let apiUrl = import.meta.env.VITE_APP_API_URL; const apiUrl = import.meta.env.VITE_APP_API_URL;
let baseUrl = import.meta.env.VITE_APP_API_BASE_URL; const baseUrl = import.meta.env.VITE_APP_API_BASE_URL;
console.log('baseUrl', apiUrl); console.log("baseUrl", apiUrl);
const authService: AuthService = new AuthService(); const authService: AuthService = new AuthService();
// authService.deleteAuthentication(); // authService.deleteAuthentication();
...@@ -50,7 +54,7 @@ export function createApp() { ...@@ -50,7 +54,7 @@ export function createApp() {
const originalSwitchTab = uni.switchTab; const originalSwitchTab = uni.switchTab;
const originalNavigateBack = uni.navigateBack; const originalNavigateBack = uni.navigateBack;
// 重写 navigateTo(打开新页面) // 重写 navigateTo(打开新页面)
uni.navigateTo = (options: UniApp.NavigateToOptions) => { uni.navigateTo = (options: UniApp.NavigateToOptions) => {
const fromPage = getCurrentPages().slice(-1)[0]; // 当前页面 const fromPage = getCurrentPages().slice(-1)[0]; // 当前页面
const toPage = options.url; // 目标页面路径 const toPage = options.url; // 目标页面路径
...@@ -58,46 +62,48 @@ export function createApp() { ...@@ -58,46 +62,48 @@ export function createApp() {
return originalNavigateTo.call(uni, options); // 执行原始跳转 return originalNavigateTo.call(uni, options); // 执行原始跳转
}; };
// 重写 redirectTo(关闭当前页,打开新页面) // 重写 redirectTo(关闭当前页,打开新页面)
uni.redirectTo = (options: UniApp.RedirectToOptions) => { uni.redirectTo = (options: UniApp.RedirectToOptions) => {
const fromPage = getCurrentPages().slice(-1)[0]; const fromPage = getCurrentPages().slice(-1)[0];
const toPage = options.url; const toPage = options.url;
return originalRedirectTo.call(uni, options); return originalRedirectTo.call(uni, options);
}; };
// 重写 switchTab(切换底部 tab) // 重写 switchTab(切换底部 tab)
uni.switchTab = (options: UniApp.SwitchTabOptions) => { uni.switchTab = (options: UniApp.SwitchTabOptions) => {
const fromPage = getCurrentPages().slice(-1)[0]; const fromPage = getCurrentPages().slice(-1)[0];
const toPage = options.url as string; const toPage = options.url as string;
// 埋点 // 埋点
switch (toPage) { switch (toPage) {
case 'pages/tabbar/HomePage': case "pages/tabbar/AuctionPage": {
BurialPoint.burialPoint(authService.getAuthentication(), 'auction_nav_hometab_click', '0', toPage); BurialPoint.burialPoint(authService.getAuthentication(), "auction_nav_auctiontab_click", "0", toPage);
break; break;
case 'pages/tabbar/AuctionPage': }
BurialPoint.burialPoint(authService.getAuthentication(), 'auction_nav_auctiontab_click', '0', toPage); case "pages/tabbar/HomePage": {
BurialPoint.burialPoint(authService.getAuthentication(), "auction_nav_hometab_click", "0", toPage);
break; break;
case 'pages/tabbar/ProfilePage': }
BurialPoint.burialPoint(authService.getAuthentication(), 'auction_nav_mytab_click', '0', toPage); case "pages/tabbar/ProfilePage": {
BurialPoint.burialPoint(authService.getAuthentication(), "auction_nav_mytab_click", "0", toPage);
break; break;
} }
}
return originalSwitchTab.call(uni, options); return originalSwitchTab.call(uni, options);
}; };
// // 重写 navigateBack(返回上一页) // // 重写 navigateBack(返回上一页)
// uni.navigateBack = function (options: UniApp.NavigateBackOptions) { // uni.navigateBack = function (options: UniApp.NavigateBackOptions) {
// const fromPage = getCurrentPages().slice(-1)[0]; // const fromPage = getCurrentPages().slice(-1)[0];
// const delta = options.delta || 1; // const delta = options.delta || 1;
// const toPageIndex = getCurrentPages().length - 1 - delta; // const toPageIndex = getCurrentPages().length - 1 - delta;
// const toPage = toPageIndex >= 0 ? getCurrentPages()[toPageIndex].route : '首页'; // const toPage = toPageIndex >= 0 ? getCurrentPages()[toPageIndex].route : '首页';
// console.log(`从 ${fromPage.route} 返回至 ${toPage}(返回层级:${delta})`); // console.log(`从 ${fromPage.route} 返回至 ${toPage}(返回层级:${delta})`);
// return originalNavigateBack.call(this, options); // return originalNavigateBack.call(this, options);
// }; // };
const axiosInstance = axios.create({ const axiosInstance = axios.create({
timeout: 1000 * 60, baseURL: apiUrl, headers: {}, timeout: 1000 * 60, baseURL: apiUrl, headers: {},
// @ts-ignore
adapter: mpAdapter adapter: mpAdapter
}); });
const tokenInterceptor: CustomTokenInterceptor = new CustomTokenInterceptor(axiosInstance, authService); const tokenInterceptor: CustomTokenInterceptor = new CustomTokenInterceptor(axiosInstance, authService);
......
...@@ -5,20 +5,22 @@ ...@@ -5,20 +5,22 @@
<!-- 等待图标 --> <!-- 等待图标 -->
<view class="waiting-icon-container"> <view class="waiting-icon-container">
<view class="waiting-icon"> <view class="waiting-icon">
<image :src="imageUrl" class="state-image"></image> <image class="state-image" :src="imageUrl"></image>
</view> </view>
</view> </view>
<!-- 审核状态文字 --> <!-- 审核状态文字 -->
<view class="status-text-container" v-if="account?.certifiedState==='CERTIFICATING'"> <view v-if="account?.certifiedState === 'CERTIFICATING'" class="status-text-container">
<text class="status-title">资料审核中</text> <text class="status-title">资料审核中</text>
<view class="status-desc">我们将于<span style="color:#007FFF ">3个工作日内</span>进行审核,审核结果会以短信的形式通知,请您耐心等待</view> <view class="status-desc">
我们将于<span style="color:#007FFF ">3个工作日内</span>进行审核,审核结果会以短信的形式通知,请您耐心等待
</view> </view>
<view class="status-text-container" v-if="account?.certifiedState==='CERTIFY_FAILED'"> </view>
<view v-if="account?.certifiedState === 'CERTIFY_FAILED'" class="status-text-container">
<text class="status-title">审核失败</text> <text class="status-title">审核失败</text>
<text class="status-desc">很抱歉,您的认证信息中有部分信息未能通过审批,请重新上传资料</text> <text class="status-desc">很抱歉,您的认证信息中有部分信息未能通过审批,请重新上传资料</text>
</view> </view>
<view class="status-text-container" v-if="account?.certifiedState==='CERTIFIED'"> <view v-if="account?.certifiedState === 'CERTIFIED'" class="status-text-container">
<text class="status-title">审核成功</text> <text class="status-title">审核成功</text>
<text class="status-desc">审核通过,开启您的省赚车商之旅</text> <text class="status-desc">审核通过,开启您的省赚车商之旅</text>
</view> </view>
...@@ -26,20 +28,40 @@ ...@@ -26,20 +28,40 @@
<!-- 返回按钮 --> <!-- 返回按钮 -->
<view class="button-container"> <view class="button-container">
<template v-if="account?.certifiedState==='CERTIFY_FAILED'"> <template v-if="account?.certifiedState === 'CERTIFY_FAILED'">
<van-button type="primary" round @click="navigateTo" block>重新上传</van-button> <van-button block
<van-button type="default" plain hairline round @click="navigateToHome" block>返回</van-button> round
type="primary"
@click="navigateTo">
重新上传
</van-button>
<van-button block
hairline
plain
round
type="default"
@click="navigateToHome">
返回
</van-button>
</template> </template>
<van-button v-else type="info" hairline round @click="navigateToHome" block>返回</van-button> <van-button v-else
block
hairline
round
type="info"
@click="navigateToHome">
返回
</van-button>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Vue} from "vue-facing-decorator"; import { Component, Vue } from "vue-facing-decorator";
import {onLoad, onShow} from "@dcloudio/uni-app";
import {AccountController} from "@/api/AccountController"; import { AccountController } from "@/api/AccountController";
import {Account} from "lib/src/entity/account/entity/Account"; import { onLoad, onShow } from "@dcloudio/uni-app";
import { Account } from "lib/src/entity/account/entity/Account";
@Component({ @Component({
components: {} components: {}
...@@ -49,6 +71,24 @@ export default class CertificationResult extends Vue { ...@@ -49,6 +71,24 @@ export default class CertificationResult extends Vue {
account: Account = null; account: Account = null;
// eslint-disable-next-line
get imageUrl(): string {
switch (this.account?.certifiedState) {
case "CERTIFICATING": {
return "/static/images/account/certifition/auditing@2x.png";
}
case "CERTIFIED": {
return "/static/images/account/certifition/success@2x.png";
}
case "CERTIFY_FAILED": {
return "/static/images/account/certifition/fail@2x.png";
}
case "UNCERTIFIED": {
return "/static/images/account/certifition/success@2x.png";
}
}
}
created(): void { created(): void {
onLoad((option) => { onLoad((option) => {
AccountController.getLoginAccount(this.axios).then(res => { AccountController.getLoginAccount(this.axios).then(res => {
...@@ -56,52 +96,38 @@ export default class CertificationResult extends Vue { ...@@ -56,52 +96,38 @@ export default class CertificationResult extends Vue {
}); });
}); });
// 每次都加载 // 每次都加载
onShow((option) => { onShow((option) => {});
});
} }
// 返回上一页 // 返回上一页
navigateTo() { navigateTo() {
if (this.account.accountType === 'COMMON') { if (this.account.accountType === "COMMON") {
uni.navigateTo({url: '/module/account/PersonCertificationPage'}); uni.navigateTo({ url: "/module/account/PersonCertificationPage" });
} else if (this.account.accountType === 'PERSON') { } else if (this.account.accountType === "PERSON") {
uni.navigateTo({url: '/module/account/CompanyCertificationPage'}); uni.navigateTo({ url: "/module/account/CompanyCertificationPage" });
}
}
get imageUrl(): string {
switch (this.account?.certifiedState) {
case "CERTIFICATING":
return "/static/images/account/certifition/auditing@2x.png"
case "CERTIFIED":
return "/static/images/account/certifition/success@2x.png"
case "CERTIFY_FAILED":
return "/static/images/account/certifition/fail@2x.png"
case "UNCERTIFIED":
return "/static/images/account/certifition/success@2x.png"
} }
} }
// 返回首页 // 返回首页
navigateToHome() { navigateToHome() {
uni.switchTab({url: '/pages/tabbar/ProfilePage'}); uni.switchTab({ url: "/pages/tabbar/ProfilePage" });
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.submit-result-container { .submit-result-container {
min-height: 100vh;
background-color: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
min-height: 100vh;
background-color: #fff;
} }
/* 内容区域样式 */ /* 内容区域样式 */
.content-container { .content-container {
flex: 1;
display: flex; display: flex;
flex: 1;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
//justify-content: center; //justify-content: center;
...@@ -130,23 +156,23 @@ export default class CertificationResult extends Vue { ...@@ -130,23 +156,23 @@ export default class CertificationResult extends Vue {
/* 状态文字样式 */ /* 状态文字样式 */
.status-text-container { .status-text-container {
text-align: center;
margin-bottom: 50px;
padding: 0 20px; padding: 0 20px;
margin-bottom: 50px;
text-align: center;
} }
.status-title { .status-title {
display: block;
margin-bottom: 15px;
font-size: 20px; font-size: 20px;
font-weight: 500; font-weight: 500;
color: #333; color: #333;
display: block;
margin-bottom: 15px;
} }
.status-desc { .status-desc {
font-size: 14px; font-size: 14px;
color: #666;
line-height: 1.6; line-height: 1.6;
color: #666;
} }
/* 按钮样式 */ /* 按钮样式 */
......
<template> <template>
<view class="dealer-application-container"> <view class="dealer-application-container">
<uni-forms ref="form" :model="formData" :rules="rules"> <uni-forms ref="form"
:model="formData"
:rules="rules">
<!-- 营业执照上传部分 --> <!-- 营业执照上传部分 -->
<view class="form-section"> <view class="form-section">
...@@ -11,9 +13,14 @@ ...@@ -11,9 +13,14 @@
</view> </view>
<view class="license-upload"> <view class="license-upload">
<uni-file-picker fileMediatype="image" @select="selectFile" :limit="1" file-extname="png,jpg,jpeg"> <uni-file-picker file-extname="png,jpg,jpeg"
file-mediatype="image"
:limit="1"
@select="selectFile">
<view class="license-placeholder"> <view class="license-placeholder">
<uni-icons type="plus" size="40" color="#ccc"/> <uni-icons color="#ccc"
size="40"
type="plus" />
<text class="license-upload-text">上传营业执照</text> <text class="license-upload-text">上传营业执照</text>
</view> </view>
</uni-file-picker> </uni-file-picker>
...@@ -28,21 +35,30 @@ ...@@ -28,21 +35,30 @@
<uni-forms-item label="" name="bankAccount"> <uni-forms-item label="" name="bankAccount">
<view class="form-item"> <view class="form-item">
<text class="label-text">银行卡号</text> <text class="label-text">银行卡号</text>
<uni-easyinput v-model="formData.bankAccount" placeholder="请输入银行卡号" :maxlength="32" :inputBorder="false"/> <uni-easyinput v-model="formData.bankAccount"
:input-border="false"
:maxlength="32"
placeholder="请输入银行卡号" />
</view> </view>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="" name="bank"> <uni-forms-item label="" name="bank">
<view class="form-item"> <view class="form-item">
<text class="label-text">开户行</text> <text class="label-text">开户行</text>
<uni-easyinput v-model="formData.bank" placeholder="请输入开户行" :maxlength="32" :inputBorder="false"/> <uni-easyinput v-model="formData.bank"
:input-border="false"
:maxlength="32"
placeholder="请输入开户行" />
</view> </view>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="" name="bankMobile"> <uni-forms-item label="" name="bankMobile">
<view class="form-item"> <view class="form-item">
<text class="label-text">银行预留号码</text> <text class="label-text">银行预留号码</text>
<uni-easyinput v-model="formData.bankMobile" placeholder="请输入银行预留号码" :maxlength="11" :inputBorder="false"/> <uni-easyinput v-model="formData.bankMobile"
:input-border="false"
:maxlength="11"
placeholder="请输入银行预留号码" />
</view> </view>
</uni-forms-item> </uni-forms-item>
</view> </view>
...@@ -50,18 +66,25 @@ ...@@ -50,18 +66,25 @@
<!-- 提交按钮 --> <!-- 提交按钮 -->
<view class="submit-button-container"> <view class="submit-button-container">
<van-button type="primary" round @click="submitForm" block>提交</van-button> <van-button block
round
type="primary"
@click="submitForm">
提交
</van-button>
</view> </view>
</uni-forms> </uni-forms>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Vue} from 'vue-facing-decorator'; import type { FileInfo } from "autumn-vue/lib/core/bean/FileInfo";
import {Certification} from "lib/src/entity/account/domain/Certification";
import {onLoad} from "@dcloudio/uni-app"; import { Component, Vue } from "vue-facing-decorator";
import {AccountController} from "@/api/AccountController";
import type {FileInfo} from "autumn-vue/lib/core/bean/FileInfo"; import { AccountController } from "@/api/AccountController";
import {AuthService} from "@/common/AuthService"; import { AuthService } from "@/common/AuthService";
import { onLoad } from "@dcloudio/uni-app";
import { Certification } from "lib/src/entity/account/domain/Certification";
@Component({}) @Component({})
export default class CompanyCertificationPage extends Vue { export default class CompanyCertificationPage extends Vue {
...@@ -70,25 +93,24 @@ export default class CompanyCertificationPage extends Vue { ...@@ -70,25 +93,24 @@ export default class CompanyCertificationPage extends Vue {
// 6226091234567890123 // 6226091234567890123
rules = { rules = {
bankAccount: { bankAccount: {
rules: [{required: true, errorMessage: '请输入银行卡号'}, { rules: [ { required: true, errorMessage: "请输入银行卡号" }, {
pattern: /^\d{13,19}$/, pattern: /^\d{13,19}$/,
errorMessage: '请输入正确的银行卡号' errorMessage: "请输入正确的银行卡号"
}] } ]
}, },
bank: { bank: {
rules: [{required: true, errorMessage: '请输入开户行'}] rules: [ { required: true, errorMessage: "请输入开户行" } ]
}, },
bankMobile: { bankMobile: {
rules: [ rules: [
{required: true, errorMessage: '请输入银行预留号码'}, { required: true, errorMessage: "请输入银行预留号码" },
{pattern: /^1[3-9]\d{9}$/, errorMessage: '请输入正确的手机号码'} { pattern: /^1[3-9]\d{9}$/, errorMessage: "请输入正确的手机号码" }
] ]
}, },
}; };
created(): void { created(): void {
onLoad((option) => { onLoad((option) => {});
});
this.formData = new Certification(); this.formData = new Certification();
} }
...@@ -109,57 +131,57 @@ export default class CompanyCertificationPage extends Vue { ...@@ -109,57 +131,57 @@ export default class CompanyCertificationPage extends Vue {
} }
} }
// 提交表单
submitForm() {
this.$refs.form.validate().then(() => {
// 检查是否上传了所有必要的图片
if (!this.formData.businessLicense) {
uni.showToast({ title: "请上传营业执照", icon: "none" });
return;
}
// 模拟提交数据
uni.showLoading({ title: "提交中...", mask: true });
AccountController.certifyAccount(this.axios, this.formData).then(response => {
uni.showToast({ title: "提交成功", icon: "success" });
// 提交成功后可以跳转到其他页面
uni.reLaunch({ url: "/module/account/CertificationResult" });
}).finally(() => {
uni.hideLoading();
});
}).catch((error: any) => {
console.log("表单验证失败", error);
});
}
uploadFiles(tempFile: any): Promise<FileInfo> { uploadFiles(tempFile: any): Promise<FileInfo> {
this.onload = true; this.addEventListener("load", true);
const authService: AuthService = this.$auth; const authService: AuthService = this.$auth;
let action = 'upload/uploadImage?directory=account/certification'; const action = "upload/uploadImage?directory=account/certification";
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: this.$apiUrl + action, url: this.$apiUrl + action,
filePath: tempFile.path, filePath: tempFile.path,
name: 'file', name: "file",
file: tempFile, file: tempFile,
header: {'Authorization': 'Bearer ' + authService.getToken()}, header: { "Authorization": `Bearer ${ authService.getToken()}` },
success: res => { success: res => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
const file = JSON.parse(res.data); const file = JSON.parse(res.data);
resolve(file); resolve(file);
} else { } else {
reject(null); reject(new Error(`Upload failed with status code: ${ res.statusCode}`));
} }
}, },
fail: (e) => { fail: (e) => {
//console.log('失败', e); // console.log('失败', e);
this.onload = false; this.addEventListener("load", false);
reject(null); reject(new Error(`Upload failed: ${ e?.errMsg || "Unknown error"}`));
} }
}); });
}); });
} }
// 提交表单
submitForm() {
this.$refs.form.validate().then(() => {
// 检查是否上传了所有必要的图片
if (!this.formData.businessLicense) {
uni.showToast({title: '请上传营业执照', icon: 'none'});
return;
}
// 模拟提交数据
uni.showLoading({title: '提交中...', mask: true});
AccountController.certifyAccount(this.axios, this.formData).then(response => {
uni.showToast({title: '提交成功', icon: 'success'});
// 提交成功后可以跳转到其他页面
uni.reLaunch({url: '/module/account/CertificationResult'});
}).finally(() => {
uni.hideLoading();
});
}).catch((error: any) => {
console.log('表单验证失败', error);
});
}
} }
</script> </script>
...@@ -186,8 +208,8 @@ export default class CompanyCertificationPage extends Vue { ...@@ -186,8 +208,8 @@ export default class CompanyCertificationPage extends Vue {
.dealer-application-container { .dealer-application-container {
min-height: 100vh; min-height: 100vh;
background-color: #f5f5f5;
padding-bottom: 30px; padding-bottom: 30px;
background-color: #f5f5f5;
} }
...@@ -197,23 +219,23 @@ export default class CompanyCertificationPage extends Vue { ...@@ -197,23 +219,23 @@ export default class CompanyCertificationPage extends Vue {
} }
.form-section { .form-section {
background-color: #fff;
margin-bottom: 10px;
padding: 15px; padding: 15px;
margin-bottom: 10px;
background-color: #fff;
} }
.section-title { .section-title {
display: block;
margin-bottom: 10px;
font-size: 18px; font-size: 18px;
font-weight: 500; font-weight: 500;
color: #333; color: #333;
margin-bottom: 10px;
display: block;
} }
.section-tip { .section-tip {
display: flex; display: flex;
align-items: center;
gap: 5px; gap: 5px;
align-items: center;
margin-bottom: 15px; margin-bottom: 15px;
} }
...@@ -223,24 +245,24 @@ export default class CompanyCertificationPage extends Vue { ...@@ -223,24 +245,24 @@ export default class CompanyCertificationPage extends Vue {
} }
.section-desc { .section-desc {
display: block;
margin-bottom: 15px;
font-size: 12px; font-size: 12px;
color: #666; color: #666;
margin-bottom: 15px;
display: block;
} }
/* 表单项目样式 */ /* 表单项目样式 */
.form-item { .form-item {
display: flex; display: flex;
align-items: center;
gap: 10px; gap: 10px;
align-items: center;
} }
.label-text { .label-text {
flex-shrink: 0;
width: 90px;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
width: 90px;
flex-shrink: 0;
} }
.uni-input { .uni-input {
...@@ -255,11 +277,11 @@ export default class CompanyCertificationPage extends Vue { ...@@ -255,11 +277,11 @@ export default class CompanyCertificationPage extends Vue {
} }
.tip-item { .tip-item {
font-size: 12px;
color: #666;
display: block; display: block;
margin-bottom: 5px; margin-bottom: 5px;
font-size: 12px;
line-height: 1.4; line-height: 1.4;
color: #666;
} }
.license-upload { .license-upload {
...@@ -268,21 +290,21 @@ export default class CompanyCertificationPage extends Vue { ...@@ -268,21 +290,21 @@ export default class CompanyCertificationPage extends Vue {
} }
.license-placeholder { .license-placeholder {
width: 200px;
height: 150px;
border: 1px dashed #ddd;
border-radius: 8px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 200px;
height: 150px;
background-color: #fafafa; background-color: #fafafa;
border: 1px dashed #ddd;
border-radius: 8px;
} }
.license-upload-text { .license-upload-text {
margin-top: 10px;
font-size: 14px; font-size: 14px;
color: #999; color: #999;
margin-top: 10px;
} }
/* 提交按钮样式 */ /* 提交按钮样式 */
......
<template> <template>
<view> <view>
<view class="custom-cell"> <view class="custom-cell">
<van-field v-if="accountInfo" :value="accountInfo.nickName" placeholder="请输入昵称" :border="false" input-align="left" :maxlength="32" @change="changeNickName"/> <van-field v-if="accountInfo"
:border="false"
input-align="left"
:maxlength="32"
placeholder="请输入昵称"
:value="accountInfo.nickName"
@change="changeNickName" />
</view> </view>
<!-- 提交按钮 --> <!-- 提交按钮 -->
<view class="bottom-action-bar"> <view class="bottom-action-bar">
<van-button type="primary" round @click="submitForm" block>保存</van-button> <van-button block
round
type="primary"
@click="submitForm">
保存
</van-button>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Vue} from 'vue-facing-decorator'; import { Component, Vue } from "vue-facing-decorator";
import {onLoad, onShow} from "@dcloudio/uni-app";
import {AccountController} from "@/api/AccountController"; import { AccountController } from "@/api/AccountController";
import {AccountInfo} from "lib/src/entity/account/domain/AccountInfo"; import { onLoad, onShow } from "@dcloudio/uni-app";
import {Account} from "lib/src/entity/account/entity/Account"; import { AccountInfo } from "lib/src/entity/account/domain/AccountInfo";
import { Account } from "lib/src/entity/account/entity/Account";
@Component({}) @Component({})
export default class EditAccountNickName extends Vue { export default class EditAccountNickName extends Vue {
accountInfo: AccountInfo = null; accountInfo: AccountInfo = null;
changeNickName(e: any) {
this.accountInfo.nickName = e.detail;
}
created(): void { created(): void {
onLoad((option) => { onLoad((option) => {
AccountController.getAccountInfo(this.axios).then(res => { AccountController.getAccountInfo(this.axios).then(res => {
this.accountInfo = res.data; this.accountInfo = res.data;
}); });
}); });
onShow((option) => { onShow((option) => {});
});
}
changeNickName(e: any) {
this.accountInfo.nickName = e.detail;
} }
submitForm(): void { submitForm(): void {
...@@ -40,8 +51,8 @@ export default class EditAccountNickName extends Vue { ...@@ -40,8 +51,8 @@ export default class EditAccountNickName extends Vue {
account.nickName = this.accountInfo.nickName; account.nickName = this.accountInfo.nickName;
AccountController.updateAccountNickName(this.axios, account).then(res => { AccountController.updateAccountNickName(this.axios, account).then(res => {
uni.showToast({ uni.showToast({
title: '保存成功', title: "保存成功",
icon: 'none' icon: "none"
}); });
}); });
} }
...@@ -51,13 +62,12 @@ export default class EditAccountNickName extends Vue { ...@@ -51,13 +62,12 @@ export default class EditAccountNickName extends Vue {
<style scoped lang="scss"> <style scoped lang="scss">
.custom-cell { .custom-cell {
margin: 16px;
height: 48px; height: 48px;
opacity: 1; margin: 16px;
border-radius: 8px; background: #FFF;
background: #FFFFFF;
border: 1px solid #E7EBF4; border: 1px solid #E7EBF4;
border-radius: 8px;
opacity: 1;
} }
......
<template> <template>
<view> <view>
<van-cell-group> <van-cell-group>
<van-cell title="头像" title-width="50" is-link custom-class="custom-cell" custom-style="display: flex;margin: 16px 0; align-items: center; height: 80px;"> <van-cell custom-class="custom-cell"
<view style="width: 300px;float: right;text-align: right"> custom-style="display: flex;margin: 16px 0; align-items: center; height: 80px;"
<uni-file-picker disable-preview :del-icon="false" fileMediatype="image" :image-styles="imageStyles" :listStyles="listStyles" @select="selectFile($event)" is-link
:auto-upload="true" title="头像"
:limit="1" file-extname="png,jpg,jpeg"> title-width="50">
<view style="width: 300px;float: right;text-align: right"> <view style="float: right;width: 300px;text-align: right">
<van-image round width="62" height="62" style="width: 300px;float: right;text-align: right;margin-right: 5px" :src="avatarUrl"/> <uni-file-picker :auto-upload="true"
:del-icon="false"
disable-preview
file-extname="png,jpg,jpeg"
file-mediatype="image"
:image-styles="imageStyles"
:limit="1"
:list-styles="listStyles"
@select="selectFile($event)">
<view style="float: right;width: 300px;text-align: right">
<van-image height="62"
round
:src="avatarUrl"
style="float: right;width: 300px;margin-right: 5px;text-align: right"
width="62" />
</view> </view>
</uni-file-picker> </uni-file-picker>
</view> </view>
</van-cell> </van-cell>
<!-- <van-field label="昵称" v-if="accountInfo" :value="accountInfo.nickName" placeholder="请输入昵称" :border="false" input-align="right" :maxlength="32" @change="changeNickName"/>--> <!-- <van-field label="昵称" v-if="accountInfo" :value="accountInfo.nickName" placeholder="请输入昵称" :border="false" input-align="right" :maxlength="32" @change="changeNickName"/>-->
<van-cell title="昵称" :value="accountInfo?.nickName" :border="true" custom-class="custom-cell" is-link @click="editNickName"/> <van-cell :border="true"
<van-cell title="竞拍地点" :value="$filters.formatCityLabel(accountInfo?.cityCode)" is-link @click="openChangeCity" custom-class="custom-cell" custom-class="custom-cell"
custom-style="display: flex; align-items: center; height: 60px;"/> is-link
title="昵称"
:value="accountInfo?.nickName"
@click="editNickName" />
<van-cell custom-class="custom-cell"
custom-style="display: flex; align-items: center; height: 60px;"
is-link
title="竞拍地点"
:value="$filters.formatCityLabel(accountInfo?.cityCode)"
@click="openChangeCity" />
</van-cell-group> </van-cell-group>
<!-- 提交按钮 --> <!-- 提交按钮 -->
<view class="bottom-action-bar"> <view class="bottom-action-bar">
<van-button type="primary" round @click="logout" block>退出</van-button> <van-button block
round
type="primary"
@click="logout">
退出
</van-button>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Vue} from "vue-facing-decorator"; import type { City } from "@/common/china_areas";
import {onLoad, onShow} from "@dcloudio/uni-app";
import {AccountController} from "@/api/AccountController"; import { Component, Vue } from "vue-facing-decorator";
import {AccountInfo} from "lib/src/entity/account/domain/AccountInfo";
import {uploadFiles} from "@/common/UploadHelper"; import { AccountController } from "@/api/AccountController";
import {AuthService} from "@/common/AuthService"; import { AuthService } from "@/common/AuthService";
import {Mutation} from "vuex-facing-decorator"; import { uploadFiles } from "@/common/UploadHelper";
import type {City} from "@/common/china_areas"; import { onLoad, onShow } from "@dcloudio/uni-app";
import {Account} from "lib/src/entity/account/entity/Account"; import { AccountInfo } from "lib/src/entity/account/domain/AccountInfo";
import { Account } from "lib/src/entity/account/entity/Account";
import { Mutation } from "vuex-facing-decorator";
@Component({ @Component({
components: {} components: {}
...@@ -55,6 +85,14 @@ export default class EditAccountPage extends Vue { ...@@ -55,6 +85,14 @@ export default class EditAccountPage extends Vue {
dividline: false dividline: false
}; };
get avatarUrl(): string {
if (this.accountInfo?.avatar && this.accountInfo.avatar?.url) {
return this.accountInfo.avatar.url;
} else {
return "/static/images/profile/avatar.png";
}
}
created(): void { created(): void {
onLoad((option) => { onLoad((option) => {
AccountController.getAccountInfo(this.axios).then(res => { AccountController.getAccountInfo(this.axios).then(res => {
...@@ -68,42 +106,36 @@ export default class EditAccountPage extends Vue { ...@@ -68,42 +106,36 @@ export default class EditAccountPage extends Vue {
}); });
} }
async selectFile(e: any) {
const tempFiles = e.tempFiles; editNickName(): void {
const authService: AuthService = this.$auth; uni.navigateTo({
const url = this.$apiUrl + 'upload/uploadImage?directory=account/avatar'; url: "/module/account/EditAccountNickName"
if (tempFiles && tempFiles.length > 0) {
const fileInfos = [];
for (const tempFile of tempFiles) {
const fileInfo = await uploadFiles(tempFile, url, authService.getToken());
if (fileInfo) {
fileInfos.push(fileInfo);
}
}
if (fileInfos.length > 0) {
this.accountInfo.avatar = fileInfos[0];
const account = new Account();
account.avatar = this.accountInfo.avatar;
AccountController.updateAccountAvatar(this.axios, account).then(res => {
}); });
} }
}
}
get avatarUrl(): string { logout(): void {
if (this.accountInfo?.avatar && this.accountInfo.avatar?.url) { const authService = this.$auth as AuthService;
return this.accountInfo.avatar.url; uni.showModal({
} else { title: "提示",
return '/static/images/profile/avatar.png'; content: "您确定要退出吗?",
success (res) {
if (res.confirm) {
authService.removeToken();
authService.deleteAuthentication();
uni.switchTab({ url: "/pages/tabbar/ProfilePage" });
} else if (res.cancel) {
console.log("用户点击取消");
// 执行其他操作
} }
} }
});
}
openChangeCity(): void { openChangeCity(): void {
const that = this; const that = this;
uni.navigateTo({ uni.navigateTo({
url: '/pages/LocationCityPage', events: { url: "/pages/LocationCityPage", events: {
onReturnData: function (city: City) { onReturnData (city: City) {
if (city) { if (city) {
that.accountInfo.cityCode = city.code; that.accountInfo.cityCode = city.code;
AccountController.updateAccountCityCode(that.axios, city.code).then((res) => { AccountController.updateAccountCityCode(that.axios, city.code).then((res) => {
...@@ -115,43 +147,37 @@ export default class EditAccountPage extends Vue { ...@@ -115,43 +147,37 @@ export default class EditAccountPage extends Vue {
}); });
} }
editNickName(): void { async selectFile(e: any) {
uni.navigateTo({ const tempFiles = e.tempFiles;
url: '/module/account/EditAccountNickName' const authService: AuthService = this.$auth;
}); const url = `${this.$apiUrl }upload/uploadImage?directory=account/avatar`;
if (tempFiles && tempFiles.length > 0) {
const fileInfos = [];
for (const tempFile of tempFiles) {
const fileInfo = await uploadFiles(tempFile, url, authService.getToken());
if (fileInfo) {
fileInfos.push(fileInfo);
} }
}
logout(): void { if (fileInfos.length > 0) {
const authService = this.$auth as AuthService; this.accountInfo.avatar = fileInfos[0];
uni.showModal({ const account = new Account();
title: '提示', account.avatar = this.accountInfo.avatar;
content: '您确定要退出吗?', AccountController.updateAccountAvatar(this.axios, account).then(res => {});
success: function (res) {
if (res.confirm) {
authService.removeToken();
authService.deleteAuthentication();
uni.switchTab({url: '/pages/tabbar/ProfilePage'});
} else if (res.cancel) {
console.log('用户点击取消');
// 执行其他操作
} }
} }
});
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.custom-cell {
}
.bottom-action-bar { .bottom-action-bar {
position: fixed; position: fixed;
right: 0;
bottom: 16px; bottom: 16px;
left: 0; left: 0;
right: 0;
height: 60px; height: 60px;
background-color: #fff;
padding: 0 15px; padding: 0 15px;
background-color: #fff;
} }
</style> </style>
<template> <template>
<view class="car-detail-container"> <view class="car-detail-container">
<view class="search-results-container"> <view class="search-results-container">
<uni-table :border="false" :stripe="false" width="100%" emptyText="暂无参拍记录"> <uni-table :border="false"
empty-text="暂无参拍记录"
:stripe="false"
width="100%">
<!-- 表头行 --> <!-- 表头行 -->
<uni-tr> <uni-tr>
<uni-th width="20%" align="center">竞价号</uni-th> <uni-th align="center" width="20%">
<uni-th width="20%" align="center">出价 竞价号
</uni-th>
<uni-th align="center" width="20%">
出价
<text style="font-size: 10px">(万元)</text> <text style="font-size: 10px">(万元)</text>
</uni-th> </uni-th>
<uni-th width="40%" align="center">出价时间</uni-th> <uni-th align="center" width="40%">
<uni-th width="20%" align="center">状态</uni-th> 出价时间
</uni-th>
<uni-th align="center" width="20%">
状态
</uni-th>
</uni-tr> </uni-tr>
<!-- 表格数据行 --> <!-- 表格数据行 -->
<uni-tr v-if="bids.length>0" v-for="(bid, index) in bids" :key="index"> <template v-if="bids.length > 0">
<uni-td :class="{active:bid.account.accountId===accountId}"> <uni-tr v-for="(bid, index) in bids"
<text v-if="bid.account.accountId===accountId">
:key="index">
<uni-td :class="{active:bid.account.accountId === accountId}">
<text v-if="bid.account.accountId === accountId">
我的出价 我的出价
</text> </text>
<text v-else> <text v-else>
{{ bid.bidCode.substring(bid.bidCode.length - 6, bid.bidCode.length) }} {{ bid.bidCode.substring(bid.bidCode.length - 6, bid.bidCode.length) }}
</text> </text>
</uni-td> </uni-td>
<uni-td align="right" :class="{active:bid.account.accountId===accountId}">{{ $filters.formatNumber(bid.bidPrice / 10000) }}</uni-td> <uni-td align="right" :class="{active:bid.account.accountId === accountId}">
<uni-td :class="{active:bid.account.accountId===accountId}">{{ bid.createTime }}</uni-td> {{ $filters.formatNumber(bid.bidPrice / 10000) }}
<uni-td :class="{active:bid.account.accountId===accountId}"> </uni-td>
<uni-td :class="{active:bid.account.accountId === accountId}">
{{ bid.createTime }}
</uni-td>
<uni-td :class="{active:bid.account.accountId === accountId}">
<text v-if="index === 0 " style="color: #185EFE"> <text v-if="index === 0 " style="color: #185EFE">
生效 生效
</text> </text>
...@@ -32,31 +49,37 @@ ...@@ -32,31 +49,37 @@
</text> </text>
</uni-td> </uni-td>
</uni-tr> </uni-tr>
</template>
</uni-table> </uni-table>
<van-empty v-if="bids.length===0" image="/static/images/empty.png" description="暂无参拍记录"/> <van-empty v-if="bids.length === 0"
description="暂无参拍记录"
image="/static/images/empty.png" />
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Vue} from "vue-facing-decorator"; import type { Auction_AuctionType } from "lib/src/entity/auction/entity/Auction";
import {onLoad, onShow} from "@dcloudio/uni-app";
import {Bid} from "lib/src/entity/auction/entity/Bid"; import { Component, Vue } from "vue-facing-decorator";
import {BidController} from "@/api/BidController";
import type {Auction_AuctionType} from "lib/src/entity/auction/entity/Auction"; import { BidController } from "@/api/BidController";
import {AuthService} from "@/common/AuthService"; import { AuthService } from "@/common/AuthService";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { Bid } from "lib/src/entity/auction/entity/Bid";
@Component({ @Component({
components: {} components: {}
}) })
export default class AuctionBidPage extends Vue { export default class AuctionBidPage extends Vue {
aucvehId: number; accountId: number;
auctionType: Auction_AuctionType; auctionType: Auction_AuctionType;
aucvehId: number;
bids: Bid[] = []; bids: Bid[] = [];
accountId: number;
created(): void { created(): void {
const that = this; const that = this;
...@@ -67,8 +90,7 @@ export default class AuctionBidPage extends Vue { ...@@ -67,8 +90,7 @@ export default class AuctionBidPage extends Vue {
this.loadData(); this.loadData();
}); });
// 每次都加载 // 每次都加载
onShow((option) => { onShow((option) => {});
});
} }
loadData() { loadData() {
...@@ -86,9 +108,9 @@ export default class AuctionBidPage extends Vue { ...@@ -86,9 +108,9 @@ export default class AuctionBidPage extends Vue {
} }
::v-deep .uni-table-th { ::v-deep .uni-table-th {
background-color: #F6F9FF !important; /* 表头背景色(蓝色示例) */
color: #333333 !important;
font-weight: 500; /* 文字加粗(可选) */ font-weight: 500; /* 文字加粗(可选) */
color: #333 !important;
background-color: #F6F9FF !important; /* 表头背景色(蓝色示例) */
border-bottom: none; border-bottom: none;
} }
...@@ -113,6 +135,6 @@ export default class AuctionBidPage extends Vue { ...@@ -113,6 +135,6 @@ export default class AuctionBidPage extends Vue {
::v-deep .uni-table__header, ::v-deep .uni-table__header,
::v-deep .uni-table__body { ::v-deep .uni-table__body {
width: 100% !important; width: 100% !important;
color: #333333 !important; color: #333 !important;
} }
</style> </style>
<template> <template>
<view class="page-container"> <view class="page-container">
<view class="bg-image" :style="{ backgroundImage:`url(${backgroundImageUrl})` }"></view> <view class="bg-image" :style="{ backgroundImage:`url(${backgroundImageUrl})` }"></view>
<custom-nav-bar :title="auction?.auctionName" :show-back="true" :status-bar-height="statusBarHeight"></custom-nav-bar> <custom-nav-bar :show-back="true"
<view class="header" :style="{ top: statusBarHeight+44 + 'px' }"> :status-bar-height="statusBarHeight"
:title="auction?.auctionName">
</custom-nav-bar>
<view class="header" :style="{ top: `${statusBarHeight + 44 }px` }">
<!-- 筛选和排序区域 --> <!-- 筛选和排序区域 -->
<van-dropdown-menu> <van-dropdown-menu>
<van-dropdown-item title="排序" :value="sortOption" :options="sortOptions" @change="onTimeSortChange"/> <van-dropdown-item :options="sortOptions"
<van-dropdown-item title="品牌" use-before-toggle @before-toggle="filterByBrand"/> title="排序"
<van-dropdown-item title="车价" id="priceFilterItem" :style="{display: priceShow?'block' : 'none'}" @open="priceShow=true" @close="priceShow=false"> :value="sortOption"
<vehicle-price-range-filter @priceChange="onPriceChange"></vehicle-price-range-filter> @change="onTimeSortChange" />
<van-dropdown-item title="品牌"
use-before-toggle
@before-toggle="filterByBrand" />
<van-dropdown-item id="priceFilterItem"
:style="{display: priceShow ? 'block' : 'none'}"
title="车价"
@close="priceShow = false"
@open="priceShow = true">
<vehicle-price-range-filter @price-change="onPriceChange"></vehicle-price-range-filter>
</van-dropdown-item> </van-dropdown-item>
<van-dropdown-item title="筛选" use-before-toggle @before-toggle="moreFilter"/> <van-dropdown-item title="筛选"
use-before-toggle
@before-toggle="moreFilter" />
</van-dropdown-menu> </van-dropdown-menu>
<search-query-filter :search-query="searchQuery" @clear-all="clearAllFilters" @change="pageFilterReload"></search-query-filter> <search-query-filter :search-query="searchQuery"
@change="pageFilterReload"
@clear-all="clearAllFilters">
</search-query-filter>
</view> </view>
<view class="auction-session-container" :style="{ paddingTop: statusBarHeight+filterHeight + 'px' }"> <view class="auction-session-container" :style="{ paddingTop: `${statusBarHeight + filterHeight }px` }">
<!-- 车辆列表 --> <!-- 车辆列表 -->
<scroll-view class="scroll-content" scroll-y :refresher-enabled="true" :refresher-triggered="loading" @scrolltolower="doInfinite()" @refresherrefresh="pageReload"> <scroll-view class="scroll-content"
:refresher-enabled="true"
:refresher-triggered="loading"
scroll-y
@refresherrefresh="pageReload"
@scrolltolower="doInfinite()">
<view class="car-list"> <view class="car-list">
<template v-if="contents.length>0" v-for="(car, index) in contents" :key="index"> <template v-if="contents.length > 0">
<auction-vehicle-item :auction-vehicle="car"></auction-vehicle-item> <auction-vehicle-item v-for="(car, index) in contents"
:key="index"
:auction-vehicle="car">
</auction-vehicle-item>
</template> </template>
<van-empty class="search-empty" v-else image="/static/images/empty_2.png" width="100" height="100" description="未找到相关车源,为你推荐以下车源"/> <van-empty v-else
class="search-empty"
description="未找到相关车源,为你推荐以下车源"
height="100"
image="/static/images/empty_2.png"
width="100" />
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component} from "vue-facing-decorator";
import {onLoad, onShow} from "@dcloudio/uni-app"; import { Component } from "vue-facing-decorator";
import type {AuctionVehicle} from "lib/src/entity/auction/entity/AuctionVehicle";
import {Auction} from "lib/src/entity/auction/entity/Auction"; import { AuctionController } from "@/api/AuctionController";
import {AuctionController} from "@/api/AuctionController";
import {PaginationComponent} from "autumn-vue/lib/core/page/PaginationComponent";
import {Operator, Order} from "autumn-vue/lib/core/page/Pagination";
import AuctionVehicleItem from "@/components/AuctionVehicleItem.vue"; import AuctionVehicleItem from "@/components/AuctionVehicleItem.vue";
import CustomNavBar from "@/components/CustomNavBar.vue"; import CustomNavBar from "@/components/CustomNavBar.vue";
import {BACKGROUND_IMAGE_1} from "@/static/ResourceConstants";
import {SearchQuery} from "@/common/SearchQuery";
import AuctionVehicleFilter from "@/components/filter/AuctionVehicleFilter"; import AuctionVehicleFilter from "@/components/filter/AuctionVehicleFilter";
import SearchQueryFilter from "@/components/filter/SearchQueryFilter.vue"; import SearchQueryFilter from "@/components/filter/SearchQueryFilter.vue";
import VehiclePriceRangeFilter from "@/components/filter/VehiclePriceRangeFilter.vue"; import VehiclePriceRangeFilter from "@/components/filter/VehiclePriceRangeFilter.vue";
import { BACKGROUND_IMAGE_1 } from "@/static/ResourceConstants";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { Order } from "autumn-vue/lib/core/page/Pagination";
import { Auction } from "lib/src/entity/auction/entity/Auction";
@Component({ @Component({
components: {VehiclePriceRangeFilter, SearchQueryFilter, CustomNavBar, AuctionVehicleItem} components: { VehiclePriceRangeFilter, SearchQueryFilter, CustomNavBar, AuctionVehicleItem }
}) })
export default class AuctionSessionPage extends AuctionVehicleFilter { export default class AuctionSessionPage extends AuctionVehicleFilter {
auctionId: number;
auction: Auction = null; auction: Auction = null;
statusBarHeight = 0;// 用于接收头部总高度,设置内容区 padding auctionId: number;
backgroundImageUrl = BACKGROUND_IMAGE_1; backgroundImageUrl = BACKGROUND_IMAGE_1;
sortOption = 0;
sortOptions = [ sortOptions = [
{text: '上架时间由近到远', value: 0}, { text: "上架时间由近到远", value: 0 },
{text: '里程由短到长', value: 1}, { text: "里程由短到长", value: 1 },
{text: '里程由长到短', value: 2}, { text: "里程由长到短", value: 2 },
{text: '车龄由小到大', value: 3}, { text: "车龄由小到大", value: 3 },
{text: '车龄由大到小', value: 4}, { text: "车龄由大到小", value: 4 },
]; ];
sortOption = 0; statusBarHeight = 0;// 用于接收头部总高度,设置内容区 padding
get filterHeight(): number {
return this.searchQuery != null ? 120 : 85;
}
created(): void { created(): void {
this.init(this.axios, AuctionController.PAGE_LIGHT_AUCTION_VEHICLE); this.init(this.axios, AuctionController.PAGE_LIGHT_AUCTION_VEHICLE);
...@@ -84,38 +117,39 @@ export default class AuctionSessionPage extends AuctionVehicleFilter { ...@@ -84,38 +117,39 @@ export default class AuctionSessionPage extends AuctionVehicleFilter {
}); });
} }
loadAuctionVehicles() {
AuctionController.getAuctionById(this.axios, this.auctionId).then(res => {
this.auction = res.data;
uni.setNavigationBarTitle({ title: this.auction.auctionName });
});
}
onTimeSortChange(detail: any): void { onTimeSortChange(detail: any): void {
console.log(detail); console.log(detail);
this.sortOption = detail.detail; this.sortOption = detail.detail;
switch (this.sortOption) { switch (this.sortOption) {
case 0: case 0: {
this.pagination.setDefaultSort('auctionStartTime', Order.desc); this.pagination.setDefaultSort("auctionStartTime", Order.desc);
break; break;
case 1: }
this.pagination.setDefaultSort('vehicle.baseInfo.mileage', Order.asc); case 1: {
break; this.pagination.setDefaultSort("vehicle.baseInfo.mileage", Order.asc);
case 2:
this.pagination.setDefaultSort('vehicle.baseInfo.mileage', Order.desc);
break; break;
case 3: }
this.pagination.setDefaultSort('vehicle.coreSpecs.productionDate', Order.desc); case 2: {
this.pagination.setDefaultSort("vehicle.baseInfo.mileage", Order.desc);
break; break;
case 4: }
this.pagination.setDefaultSort('vehicle.coreSpecs.productionDate', Order.asc); case 3: {
this.pagination.setDefaultSort("vehicle.coreSpecs.productionDate", Order.desc);
break; break;
} }
this.pageReload(); case 4: {
this.pagination.setDefaultSort("vehicle.coreSpecs.productionDate", Order.asc);
break;
} }
get filterHeight(): number {
return this.searchQuery != null ? 120 : 85;
} }
this.pageReload();
loadAuctionVehicles() {
AuctionController.getAuctionById(this.axios, this.auctionId).then(res => {
this.auction = res.data;
uni.setNavigationBarTitle({title: this.auction.auctionName});
});
} }
} }
...@@ -123,23 +157,23 @@ export default class AuctionSessionPage extends AuctionVehicleFilter { ...@@ -123,23 +157,23 @@ export default class AuctionSessionPage extends AuctionVehicleFilter {
<style lang="scss" scoped> <style lang="scss" scoped>
.auction-session-container { .auction-session-container {
background-color: #ffffff; background-color: #fff;
} }
.filter-sort-bar { .filter-sort-bar {
display: flex; display: flex;
background-color: #fff;
padding: 6px 16px;
height: 56px; height: 56px;
padding: 6px 16px;
background-color: #fff;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
.filter-item { .filter-item {
display: flex; display: flex;
flex: 1;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex: 1;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
} }
...@@ -149,10 +183,10 @@ export default class AuctionSessionPage extends AuctionVehicleFilter { ...@@ -149,10 +183,10 @@ export default class AuctionSessionPage extends AuctionVehicleFilter {
} }
.car-list { .car-list {
padding: 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 10px; gap: 10px;
padding: 10px;
} }
.separator { .separator {
......
...@@ -3,7 +3,11 @@ ...@@ -3,7 +3,11 @@
<view class="bg-image" :style="{ backgroundImage:`url(${backgroundImageUrl})` }"></view> <view class="bg-image" :style="{ backgroundImage:`url(${backgroundImageUrl})` }"></view>
<view class="dialog-body"> <view class="dialog-body">
<view class="dialog-icon"> <view class="dialog-icon">
<van-image width="100" height="100" fit="cover" src="/static/images/order/payment.png"></van-image> <van-image fit="cover"
height="100"
src="/static/images/order/payment.png"
width="100">
</van-image>
</view> </view>
<view class="dialog-header"> <view class="dialog-header">
恭喜你中拍成功 恭喜你中拍成功
...@@ -12,16 +16,29 @@ ...@@ -12,16 +16,29 @@
<text>请尽快签署购车协议,并支付款项以锁定车辆</text> <text>请尽快签署购车协议,并支付款项以锁定车辆</text>
</view> </view>
<view class="dialog-footer"> <view class="dialog-footer">
<van-button type="default" round block style="margin-bottom: 10px" @click="$emit('close')">知道了</van-button> <van-button block
<van-button type="primary" hairline round block @click="signContract">去签署购车协议</van-button> round
style="margin-bottom: 10px"
type="default"
@click="$emit('close')">
知道了
</van-button>
<van-button block
hairline
round
type="primary"
@click="signContract">
去签署购车协议
</van-button>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Prop, Vue} from "vue-facing-decorator"; import { Component, Prop, Vue } from "vue-facing-decorator";
import {BACKGROUND_IMAGE_2} from "@/static/ResourceConstants";
import { BACKGROUND_IMAGE_2 } from "@/static/ResourceConstants";
@Component({ @Component({
components: {} components: {}
...@@ -29,13 +46,13 @@ import {BACKGROUND_IMAGE_2} from "@/static/ResourceConstants"; ...@@ -29,13 +46,13 @@ import {BACKGROUND_IMAGE_2} from "@/static/ResourceConstants";
export default class BidSuccessDialog extends Vue { export default class BidSuccessDialog extends Vue {
backgroundImageUrl = BACKGROUND_IMAGE_2; backgroundImageUrl = BACKGROUND_IMAGE_2;
@Prop({type: Number, required: true}) @Prop({ type: Number, required: true })
orderId: number; orderId: number;
signContract(): void { signContract(): void {
this.$emit('close'); this.$emit("close");
uni.navigateTo({ uni.navigateTo({
url: '/module/order/contract/ContractPage?orderId=' + this.orderId url: `/module/order/contract/ContractPage?orderId=${ this.orderId}`
}); });
} }
} }
...@@ -45,6 +62,7 @@ export default class BidSuccessDialog extends Vue { ...@@ -45,6 +62,7 @@ export default class BidSuccessDialog extends Vue {
.dialog-container { .dialog-container {
//height: 200px; //height: 200px;
//min-height: 100vh; //min-height: 100vh;
/* 避免内容被顶部导航栏遮挡(可选) */ /* 避免内容被顶部导航栏遮挡(可选) */
//padding-top: var(--status-bar-height); //padding-top: var(--status-bar-height);
//box-sizing: border-box; //box-sizing: border-box;
...@@ -77,15 +95,15 @@ export default class BidSuccessDialog extends Vue { ...@@ -77,15 +95,15 @@ export default class BidSuccessDialog extends Vue {
font-size: 13px; font-size: 13px;
font-weight: 400; font-weight: 400;
line-height: 18.2px; line-height: 18.2px;
color: #333333; color: #333;
} }
} }
.dialog-footer { .dialog-footer {
margin-top: 20px;
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 3px;; gap: 3px;
margin-top: 20px;;
} }
</style> </style>
<template> <template>
<text class="recommend-search" v-if="visible">为您推荐</text> <text v-if="visible" class="recommend-search">为您推荐</text>
<view class="car-list" v-if="visible"> <view v-if="visible" class="car-list">
<template v-for="(car, index) in contents" :key="index"> <template v-for="(car, index) in contents" :key="index">
<auction-vehicle-item :auction-vehicle="car"></auction-vehicle-item> <auction-vehicle-item :auction-vehicle="car"></auction-vehicle-item>
</template> </template>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Prop} from "vue-facing-decorator"; import { Component, Prop } from "vue-facing-decorator";
import {PaginationComponent} from "autumn-vue/lib/core/page/PaginationComponent";
import {AuctionVehicle} from "lib/src/entity/auction/entity/AuctionVehicle"; import { AuctionController } from "@/api/AuctionController";
import {AuctionController} from "@/api/AuctionController";
import AuctionVehicleItem from "@/components/AuctionVehicleItem.vue"; import AuctionVehicleItem from "@/components/AuctionVehicleItem.vue";
import {onLoad} from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import { PaginationComponent } from "autumn-vue/lib/core/page/PaginationComponent";
import { AuctionVehicle } from "lib/src/entity/auction/entity/AuctionVehicle";
@Component({ @Component({
components: {AuctionVehicleItem} components: { AuctionVehicleItem }
}) })
export default class RecommendSearchVehicles extends PaginationComponent<AuctionVehicle> { export default class RecommendSearchVehicles extends PaginationComponent<AuctionVehicle> {
@Prop({type: Boolean, default: false}) @Prop({ type: Boolean, default: false })
visible: boolean; visible: boolean;
get contents(): AuctionVehicle[] {
return this.pagination.content;
}
created(): void { created(): void {
this.init(this.axios, AuctionController.PAGE_RANDOM_AUCTION_VEHICLE); this.init(this.axios, AuctionController.PAGE_RANDOM_AUCTION_VEHICLE);
this.buildQueryForm({}); this.buildQueryForm({});
...@@ -29,10 +34,6 @@ export default class RecommendSearchVehicles extends PaginationComponent<Auction ...@@ -29,10 +34,6 @@ export default class RecommendSearchVehicles extends PaginationComponent<Auction
this.pageReload(); this.pageReload();
}); });
} }
get contents(): AuctionVehicle[] {
return this.pagination.content;
}
} }
</script> </script>
...@@ -42,11 +43,11 @@ export default class RecommendSearchVehicles extends PaginationComponent<Auction ...@@ -42,11 +43,11 @@ export default class RecommendSearchVehicles extends PaginationComponent<Auction
} }
.recommend-search { .recommend-search {
margin-left: 12px;
font-size: 18px; font-size: 18px;
font-weight: 500; font-weight: 500;
letter-spacing: 0px;
line-height: 25.2px; line-height: 25.2px;
margin-left: 12px; color: #333;
color: #333333; letter-spacing: 0;
} }
</style> </style>
<template> <template>
<view class="album-container" v-if="auctionVehicle"> <view v-if="auctionVehicle" class="album-container">
<template v-for="fileSubtype in fileSubtypes"> <template v-for="(fileSubtype) in fileSubtypes">
<view class="album-item" v-if="getFileInfos(fileSubtype.id).length>0"> <view v-if="getFileInfos(fileSubtype.id).length > 0"
:key="fileSubtype.id"
class="album-item">
<text class="album-title">{{ fileSubtype.name }}({{ getFileInfos(fileSubtype.id).length }})</text> <text class="album-title">{{ fileSubtype.name }}({{ getFileInfos(fileSubtype.id).length }})</text>
<view class="album"> <view class="album">
<up-album :urls="getFileInfos(fileSubtype.id)" :multiple-size="116" :keyName="fileSubtype.name"></up-album> <up-album :key-name="fileSubtype.name"
:multiple-size="116"
:urls="getFileInfos(fileSubtype.id)">
</up-album>
</view> </view>
</view> </view>
</template> </template>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Vue} from 'vue-facing-decorator'; import { Component, Vue } from "vue-facing-decorator";
import {onLoad, onShow} from "@dcloudio/uni-app";
import {AuctionController} from "@/api/AuctionController"; import { AuctionController } from "@/api/AuctionController";
import {AuctionVehicle} from "lib/src/entity/auction/entity/AuctionVehicle"; import { onLoad, onShow } from "@dcloudio/uni-app";
import {FileInfo} from "autumn-vue/lib/core/bean/FileInfo"; import { FileInfo } from "autumn-vue/lib/core/bean/FileInfo";
import {VEHICLE_FILE_SUB_TYPES} from "lib/src/domain/VehicleType"; import { VEHICLE_FILE_SUB_TYPES } from "lib/src/domain/VehicleType";
import { AuctionVehicle } from "lib/src/entity/auction/entity/AuctionVehicle";
@Component({}) @Component({})
export default class VehicleAlbum extends Vue { export default class VehicleAlbum extends Vue {
aucvehId: number;
auctionVehicle: AuctionVehicle = null; auctionVehicle: AuctionVehicle = null;
aucvehId: number;
fileSubtypes = VEHICLE_FILE_SUB_TYPES; fileSubtypes = VEHICLE_FILE_SUB_TYPES;
photos = {
albumWidth: 0,
urls2: [
"https://picsum.photos/800/600?random=20",
"https://picsum.photos/800/600?random=12", "https://picsum.photos/800/600?random=21", "https://picsum.photos/800/600?random=10",
"https://picsum.photos/800/600?random=20",
],
};
get albums(): FileInfo[] {
return this.auctionVehicle?.vehicle?.albums;
}
created(): void { created(): void {
const that = this; const that = this;
onLoad((option) => { onLoad((option) => {
this.aucvehId = option.aucvehId; this.aucvehId = option.aucvehId;
this.loadData(); this.loadData();
}); });
onShow((option) => { onShow((option) => {});
});
}
loadData(): void {
AuctionController.getAuctionVehicleDetailById(this.axios, this.aucvehId).then(res => {
this.auctionVehicle = res.data;
});
}
get albums(): FileInfo[] {
return this.auctionVehicle?.vehicle?.albums;
} }
getFileInfos(fileSubtype: string): string[] { getFileInfos(fileSubtype: string): string[] {
...@@ -64,14 +71,11 @@ export default class VehicleAlbum extends Vue { ...@@ -64,14 +71,11 @@ export default class VehicleAlbum extends Vue {
} }
} }
photos = { loadData(): void {
albumWidth: 0, AuctionController.getAuctionVehicleDetailById(this.axios, this.aucvehId).then(res => {
urls2: [ this.auctionVehicle = res.data;
'https://picsum.photos/800/600?random=20', });
'https://picsum.photos/800/600?random=12', 'https://picsum.photos/800/600?random=21', 'https://picsum.photos/800/600?random=10', }
'https://picsum.photos/800/600?random=20',
],
};
} }
</script> </script>
...@@ -79,22 +83,22 @@ export default class VehicleAlbum extends Vue { ...@@ -79,22 +83,22 @@ export default class VehicleAlbum extends Vue {
<style scoped lang="scss"> <style scoped lang="scss">
.album-container { .album-container {
min-height: 100vh; min-height: 100vh;
background-color: #000000; background-color: #000;
} }
.album-item { .album-item {
padding: 12px;
width: 100%; width: 100%;
padding: 12px;
} }
.album-title { .album-title {
padding-bottom: 24px;
font-size: 16px; font-size: 16px;
color: #fff; color: #fff;
padding-bottom: 24px;
} }
.album { .album {
padding-top: 16px;
width: 100%; width: 100%;
padding-top: 16px;
} }
</style> </style>
<template> <template>
<van-index-bar :index-list="indexList"> <van-index-bar :index-list="indexList">
<template v-for="(letter) in indexList" :key="letter"> <template v-for="(letter) in indexList" :key="letter">
<van-index-anchor :index="letter">{{ letter }}</van-index-anchor> <van-index-anchor :index="letter">
{{ letter }}
</van-index-anchor>
<van-cell v-for="brand in getBrandsByLetter(letter)" :key="brand.id"> <van-cell v-for="brand in getBrandsByLetter(letter)" :key="brand.id">
<template slot="title"> <template #title>
<div class="brand-cell" @click="bindClick(brand)"> <div class="brand-cell" @click="bindClick(brand)">
<image class="brand-image" :src="brand.logoUrl" mode="aspectFill"/> <image class="brand-image"
mode="aspectFill"
:src="brand.logoUrl" />
{{ brand.name }} {{ brand.name }}
</div> </div>
</template> </template>
...@@ -14,38 +18,62 @@ ...@@ -14,38 +18,62 @@
</van-index-bar> </van-index-bar>
<!-- 普通弹窗 --> <!-- 普通弹窗 -->
<uni-popup ref="popup" background-color="#fff"> <uni-popup ref="popup" background-color="#fff">
<view class="popup-content" v-if="selectedBrand"> <view v-if="selectedBrand" class="popup-content">
<div class="brand-cell" style="padding: 12px 16px;"> <div class="brand-cell" style="padding: 12px 16px;">
<image class="brand-image" :src="selectedBrand.logoUrl" mode="aspectFill"/> <image class="brand-image"
mode="aspectFill"
:src="selectedBrand.logoUrl" />
{{ selectedBrand.name }} {{ selectedBrand.name }}
</div> </div>
<scroll-view class="scroll-content" scroll-y> <scroll-view class="scroll-content" scroll-y>
<!-- 车型选择 --> <!-- 车型选择 -->
<van-checkbox-group v-if="selectedCarSeries" :value="selectedCarTypes" @change="onChangeCarType"> <van-checkbox-group v-if="selectedCarSeries"
:value="selectedCarTypes"
@change="onChangeCarType">
<van-cell-group> <van-cell-group>
<van-cell v-for="(carType,index) in selectedCarSeries.childs" :key="carType.id" @click="onCarTypeClick($event)" <van-cell v-for="(carType,index) in selectedCarSeries.childs"
:title="carType.name" class="brand-cell" :class="{'brand-active':selectedCarTypes.includes(carType)}" value-class="value-class" clickable :data-index="index"> :key="carType.id"
<van-checkbox :class="'checkboxes-'+index" :name="carType" @click.stop="onCheckboxClick($event)"></van-checkbox> class="brand-cell"
:class="{'brand-active':selectedCarTypes.includes(carType)}"
clickable
:data-index="index"
:title="carType.name"
value-class="value-class"
@click="onCarTypeClick($event)">
<van-checkbox :class="`checkboxes-${index}`"
:name="carType"
@click.stop="onCheckboxClick($event)">
</van-checkbox>
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
</van-checkbox-group> </van-checkbox-group>
<!-- 车系选择 --> <!-- 车系选择 -->
<uni-list v-else> <uni-list v-else>
<template v-for="carSeries in selectedBrand.childs"> <uni-list-item v-for="(carSeries,index) in selectedBrand.childs"
<uni-list-item :title="carSeries.name" clickable showArrow @click="selectCarSeries(carSeries)"></uni-list-item> :key="index"
</template> clickable
show-arrow
:title="carSeries.name"
@click="selectCarSeries(carSeries)">
</uni-list-item>
</uni-list> </uni-list>
</scroll-view> </scroll-view>
<view style="padding: 12px 16px;"> <view style="padding: 12px 16px;">
<van-row gutter="12"> <van-row gutter="12">
<van-col span="9"> <van-col span="9">
<van-button type="default" block round @click="cancel"> <van-button block
round
type="default"
@click="cancel">
返回 返回
</van-button> </van-button>
</van-col> </van-col>
<van-col span="15"> <van-col span="15">
<van-button type="primary" block round @click="onSelect"> <van-button block
round
type="primary"
@click="onSelect">
确定({{ selectedCarTypes.length }}个车型) 确定({{ selectedCarTypes.length }}个车型)
</van-button> </van-button>
</van-col> </van-col>
...@@ -56,17 +84,19 @@ ...@@ -56,17 +84,19 @@
</uni-popup> </uni-popup>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Ref, Vue} from "vue-facing-decorator"; import type { CarType } from "lib/src/domain/VehicleType";
import {onLoad, onShow} from "@dcloudio/uni-app";
import {GscApiController} from "@/api/GscApiController"; import { Component, Ref, Vue } from "vue-facing-decorator";
import type {CarType} from "lib/src/domain/VehicleType";
import { GscApiController } from "@/api/GscApiController";
import { onLoad, onShow } from "@dcloudio/uni-app";
type Brand = { type Brand = {
childs: Brand[];
id: string; id: string;
letter: string, letter: string,
name: string;
logoUrl: string; logoUrl: string;
childs: Brand[]; name: string;
selected: boolean; selected: boolean;
} }
@Component({ @Component({
...@@ -77,10 +107,10 @@ export default class CarTypesFilter extends Vue { ...@@ -77,10 +107,10 @@ export default class CarTypesFilter extends Vue {
brands: Brand[] = []; brands: Brand[] = [];
indexList: string[] = [ indexList: string[] = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', "A", "B", "C", "D", "E", "F", "G",
'H', 'I', 'J', 'K', 'L', 'M', 'N', "H", "I", "J", "K", "L", "M", "N",
'O', 'P', 'Q', 'R', 'S', 'T', "O", "P", "Q", "R", "S", "T",
'U', 'V', 'W', 'X', 'Y', 'Z' "U", "V", "W", "X", "Y", "Z"
]; ];
@Ref @Ref
...@@ -88,20 +118,34 @@ export default class CarTypesFilter extends Vue { ...@@ -88,20 +118,34 @@ export default class CarTypesFilter extends Vue {
selectedBrand: Brand = null; selectedBrand: Brand = null;
selectedCarSeries: any = null;
selectedCarTypes: CarType[] = []; selectedCarTypes: CarType[] = [];
selectedCarSeries: any = null; bindClick(brand: any): void {
this.selectedBrand = brand;
this.selectedCarSeries = null;
this.popup.open("right");
}
cancel() {
this.selectedCarSeries = null;
}
created(): void { created(): void {
onLoad((option) => { onLoad((option) => {
this.loadData(); this.loadData();
}); });
onShow(options => { onShow(options => {});
}); }
getBrandsByLetter(letter: string): Brand[] {
return this.brands.filter(brand => brand.letter === letter);
} }
loadData(): void { loadData(): void {
const cacheBrands = uni.getStorageSync('cacheBrands'); const cacheBrands = uni.getStorageSync("cacheBrands");
console.debug(cacheBrands); console.debug(cacheBrands);
if (cacheBrands && cacheBrands.length > 0) { if (cacheBrands && cacheBrands.length > 0) {
this.brands = cacheBrands; this.brands = cacheBrands;
...@@ -109,55 +153,40 @@ export default class CarTypesFilter extends Vue { ...@@ -109,55 +153,40 @@ export default class CarTypesFilter extends Vue {
GscApiController.getCarBrandComplete(this.axios).then(res => { GscApiController.getCarBrandComplete(this.axios).then(res => {
const brandRes: any = res.data; const brandRes: any = res.data;
this.brands = brandRes.data.carinfos; this.brands = brandRes.data.carinfos;
uni.setStorageSync('cacheBrands', this.brands); uni.setStorageSync("cacheBrands", this.brands);
}); });
} }
} }
getBrandsByLetter(letter: string): Brand[] {
return this.brands.filter(brand => brand.letter === letter);
}
bindClick(brand: any): void {
this.selectedBrand = brand;
this.selectedCarSeries = null;
this.popup.open('right');
}
onChangeCarType(event: any): void {
this.selectedCarTypes = event.detail;
console.log(this.selectedCarTypes);
}
onCarTypeClick(event: any) { onCarTypeClick(event: any) {
// if (carType.selected === true) { // if (carType.selected === true) {
// carType.selected = false; // carType.selected = false;
// } else { // } else {
// carType.selected = true; // carType.selected = true;
// } // }
const {index} = event.currentTarget.dataset; const { index } = event.currentTarget.dataset;
const checkbox = this.selectComponent(`.checkboxes-${index}`); const checkbox = this.selectComponent(`.checkboxes-${index}`);
checkbox.toggle(); checkbox.toggle();
} }
onCheckboxClick(event: any): void { onChangeCarType(event: any): void {
event.stopPropagation(); this.selectedCarTypes = event.detail;
console.log(this.selectedCarTypes);
} }
selectCarSeries(carSeries: any) { onCheckboxClick(event: any): void {
this.selectedCarTypes = []; event.stopPropagation();
this.selectedCarSeries = carSeries;
} }
onSelect(): void { onSelect(): void {
const eventChannel = this.getOpenerEventChannel(); const eventChannel = this.getOpenerEventChannel();
eventChannel.emit('onReturnData', this.selectedCarTypes); eventChannel.emit("onReturnData", this.selectedCarTypes);
uni.navigateBack(); uni.navigateBack();
} }
cancel() { selectCarSeries(carSeries: any) {
this.selectedCarSeries = null; this.selectedCarTypes = [];
this.selectedCarSeries = carSeries;
} }
} }
</script> </script>
...@@ -170,8 +199,8 @@ export default class CarTypesFilter extends Vue { ...@@ -170,8 +199,8 @@ export default class CarTypesFilter extends Vue {
.brand-cell { .brand-cell {
display: flex; display: flex;
align-items: center;
gap: 8px; gap: 8px;
align-items: center;
} }
.brand-image { .brand-image {
......
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!