first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
/cypress/videos/
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -0,0 +1,40 @@
# vuevitets
This template should help get you started developing with Vue 3 in Vite.
## Recommended IDE Setup
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
## Type Support for `.vue` Imports in TS
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
1. Disable the built-in TypeScript Extension
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
## Customize configuration
See [Vite Configuration Reference](https://vitejs.dev/config/).
## Project Setup
```sh
npm install
```
### Compile and Hot-Reload for Development
```sh
npm run dev
```
### Type-Check, Compile and Minify for Production
```sh
npm run build
```

View File

@@ -0,0 +1,45 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}
declare module 'vue' {
export interface GlobalComponents {
Header: typeof import('./src/components/header.vue')['default']
Item: typeof import('./src/components/item.vue')['default']
Page: typeof import('./src/components/page.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
Swiper: typeof import('./src/components/swiper.vue')['default']
Tabbar: typeof import('./src/components/tabbar.vue')['default']
VanActionBar: typeof import('vant/es')['ActionBar']
VanActionBarButton: typeof import('vant/es')['ActionBarButton']
VanActionBarIcon: typeof import('vant/es')['ActionBarIcon']
VanButton: typeof import('vant/es')['Button']
VanCard: typeof import('vant/es')['Card']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanCheckbox: typeof import('vant/es')['Checkbox']
VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup']
VanCol: typeof import('vant/es')['Col']
VanField: typeof import('vant/es')['Field']
VanGrid: typeof import('vant/es')['Grid']
VanGridItem: typeof import('vant/es')['GridItem']
VanIcon: typeof import('vant/es')['Icon']
VanImage: typeof import('vant/es')['Image']
VanNavBar: typeof import('vant/es')['NavBar']
VanRow: typeof import('vant/es')['Row']
VanSearch: typeof import('vant/es')['Search']
VanStepper: typeof import('vant/es')['Stepper']
VanSubmitBar: typeof import('vant/es')['SubmitBar']
VanSwipe: typeof import('vant/es')['Swipe']
VanSwipeItem: typeof import('vant/es')['SwipeItem']
VanTab: typeof import('vant/es')['Tab']
VanTabbar: typeof import('vant/es')['Tabbar']
VanTabbarItem: typeof import('vant/es')['TabbarItem']
VanTabs: typeof import('vant/es')['Tabs']
VanTextEllipsis: typeof import('vant/es')['TextEllipsis']
VanTreeSelect: typeof import('vant/es')['TreeSelect']
}
}

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

View File

@@ -0,0 +1,37 @@
{
"name": "vuevitets",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "run-p type-check build-only",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
},
"dependencies": {
"axios": "^1.4.0",
"jsencrypt": "^3.3.2",
"lib-flexible": "^0.3.2",
"node-rsa": "^1.1.1",
"pinia": "^2.1.4",
"vant": "^4.6.0",
"vue": "^3.3.4",
"vue-router": "^4.2.2",
"vuex": "^4.0.2"
},
"devDependencies": {
"@tsconfig/node18": "^2.0.1",
"@types/node": "^18.16.17",
"@types/node-rsa": "^1.1.1",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/tsconfig": "^0.4.0",
"less": "^4.1.3",
"npm-run-all": "^4.1.5",
"typescript": "~5.0.4",
"unplugin-vue-components": "^0.25.1",
"vite": "^4.3.9",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vue-tsc": "^1.6.5"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,20 @@
<template>
<RouterView v-slot="{ Component, route }">
<KeepAlive>
<component :is="Component" :key="route.name" v-if="route.meta.keepAlive" />
</KeepAlive>
<component :is="Component" :key="route.name" v-if="!route.meta.keepAlive" />
</RouterView>
</template>
<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import { onMounted, reactive, toRefs } from "vue";
</script>
<style lang="less">
@import "@pub/clear.less";
@import "@pub/reset.less";
</style>

View File

@@ -0,0 +1,89 @@
import axios, { AxiosResponse } from "axios";
import { config } from "@/config";
import { resultType } from "@/types/res/result";
import { showLoadingToast, closeToast, showFailToast } from 'vant';
import 'vant/es/toast/style';
import { VagueOject } from "@/types/common";
interface requestParams {
url: string,
data: VagueOject,
header: VagueOject
}
const instance = axios.create({
baseURL: config.checkEnvironment(),
timeout: 10000,
headers: {
"Content-Type": "application/json",
"token":localStorage.getItem("token") == null ? "" : localStorage.getItem("token")
}
});
instance.interceptors.request.use(
function (config) {
showLoadingToast({
duration: 0,
forbidClick: true,
message: '加载中....',
})
return config;
},
function (error) {
return Promise.reject(error);
}
);
instance.interceptors.response.use(
function (response) {
closeToast()
return ResponseCodeCheck(response.data)
},
function (error) {
return Promise.reject(error);
}
);
const ResponseCodeCheck = (response: resultType<any>) => {
console.log("response",response)
switch (response.status) {
case 200:
return response.result
break;
case 404:
showFailToast({
message: response.message
});
throw new Error(response.message)
break;
case 500:
showFailToast({
message: response.message,
onClose: () => {
location.href = "/#/user"
}
});
throw new Error(response.message)
break;
default:
break;
}
}
export const GET = async <T>(params: requestParams): Promise<T> => {
return await instance.get<T>(params.url, {
params: params.data,
headers: params.header
})
}
export const POST = async <T>(params: requestParams): Promise<T> => {
console.log("params",params)
return await instance.post<T>(params.url, params.data, {
headers:params.header
})
}

View File

@@ -0,0 +1,17 @@
.car {
/deep/ .van-checkbox {
padding-left: 10px;
.van-checkbox__label {
flex: 1;
}
}
.van-card {
background: #fff;
padding-left: 0;
}
.van-submit-bar {
bottom: 50px;
}
}

View File

@@ -0,0 +1,30 @@
.home {
.search_top {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
position: fixed;
z-index: 9;
left: 0;
top: 0;
img {
width: 25px;
margin: 0 auto;
}
.van-search {
width: 85%;
/deep/ .van-search__content {
border-radius: 25px;
}
}
}
.grid_text {
color: #646566;
font-size: 0.32rem;
line-height: 1.5;
word-break: break-all;
}
}

View File

@@ -0,0 +1,92 @@
.info {
.action_icon {
position: fixed;
top: 5px;
z-index: 4;
width: 35px;
height: 35px;
border-radius: 100%;
background: #00000030;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.van-icon-arrow-left {
left: 15px;
}
.van-icon-share-o {
right: 15px;
}
.noback {
color: #000;
background: rgba(255,255,255,0);
}
.hidden {
/deep/ .van-tabs__nav {
display: none;
}
}
.back {
position: fixed;
height: 44px;
top: 0;
left: 0;
right: 0;
z-index: 1;
}
/deep/ .van-tabs {
.van-tabs__nav {
justify-content: center;
background: #fff0;
.van-tab {
flex: none !important;
}
}
.van-sticky {
position: fixed;
width: 100%;
z-index: 2;
}
}
.info_content {
padding: 0.4rem;
border-bottom: 0.13333rem solid #f7f7f7;
.title {
font-size: 0.56rem;
color: #3c3c3c;
margin-bottom: 0.26667rem
}
.cont {
color: rgba(0, 0, 0, 0.54);
font-size: 0.33333rem;
line-height: 0.5rem;
}
.price {
margin-top: 0.26667rem;
color: #ff6700;
font-size: 0.53333rem;
}
}
.item {
padding: 0 15px;
height: 50px;
display: flex;
align-items: center;
.van-col {
&:last-child {
text-align: right;
}
}
}
}

View File

@@ -0,0 +1,81 @@
.me{
.head{
background-image: url("../../../../public/img/me_back.png");
background-size: cover;
width: 100%;
height: 166px;
.head_div{
width: 100%;
height: 90px;
display: flex;
justify-content: right;
align-items: center;
.head_Setup{
width: 20px;
height: 20px;
margin-right: 15px;
}
}
.head_div1{
display: flex;
align-items: center;
.head_avatar{
width: 50px;
height: 50px;
border-radius: 25px;
margin-left: 20px;
}
.head_text{
font-size: 16px;
margin-left: 10px;
}
}
}
.metype{
display: flex;
justify-content: space-between;
padding: 20px 20px;
.metype_li{
text-align: center;
.metype_img{
width: 39px;
height: 39px;
}
.metype_text{
margin-top: 10px;
}
}
}
.melist{
margin-top: 20px;
.melist_li{
display: flex;
align-items: center;
padding: 16px 10px;
border-bottom: 1px solid #e7e0e09f;
.melist_img{
width: 20px;
height: 20px;
}
.melist_text{
margin-left: 10px;
}
}
}
}

View File

@@ -0,0 +1,23 @@
.search{
.listone{
.sea{
font-size: 15px;
}
.qwe{
display: flex;
.listtui{
display: flex !important;
.text{
padding: 1px;
border: 1px solid;
font-size: 16px;
margin-right: 2px;
}
}
}
}
}

View File

@@ -0,0 +1,10 @@
.type{
.van-tree-select{
height: calc(100vh - 95px)!important
}
.van-sidebar-item van-tree-select__nav-item{
width: 90px !important;
}
}

View File

@@ -0,0 +1,26 @@
.user {
width: 100%;
height: 100vh;
background-image: url(../../../../public/img/user_beiji.png);
background-size: cover;
/deep/.van-tabs__wrap {
padding-bottom: 15px;
}
/deep/.van-tabs__nav {
background: none;
}
.userbutt_div {
display: flex;
justify-content: center;
.userbutt {
width: 90%;
margin: auto;
margin-top: 10px;
}
}
}

View File

@@ -0,0 +1,2 @@
@import "../pub/mixins.less";
@import "../pub/vars.less";

View File

@@ -0,0 +1,406 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
body {
font-size: 0;
}
html {
line-height: 1;
-webkit-text-size-adjust: 100%;
/* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body,
ul,
li,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
padding: 0;
list-style: none;
}
::-webkit-scrollbar {
width: 0;
height: 0;
}
.content {
margin-top: 1rem;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box;
/* 1 */
height: 0;
/* 1 */
overflow: visible;
/* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
text-decoration: none;
color: #000;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none;
/* 1 */
text-decoration: underline;
/* 2 */
text-decoration: underline dotted;
/* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
width: 100%;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 1 */
line-height: 1.15;
/* 1 */
margin: 0;
/* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input {
/* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select {
/* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box;
/* 1 */
color: inherit;
/* 2 */
display: table;
/* 1 */
max-width: 100%;
/* 1 */
padding: 0;
/* 3 */
white-space: normal;
/* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield;
/* 1 */
outline-offset: -2px;
/* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
/* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

View File

@@ -0,0 +1,51 @@
.line (@position: "left") {
border-@{position}: 1px solid #8d8d8d;
}
.clearfix() {
&:after,
&:before {
content: " ";
display: table;
}
&:after {
clear: both;
}
}
// No Scrollbar
.no-scrollbar() {
&::-webkit-scrollbar {
display: none !important;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
opacity: 0 !important;
}
}
.ellipsis() {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-wrap: break-word;
}
.flex(@align: center, @justify: center) {
display: flex;
align-items: @align;
justify-content: @justify;
}
//超出显示省略号
.ellipsis() {
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
white-space: nowrap; //溢出不换行
}

View File

@@ -0,0 +1,304 @@
@red50: #ffebee;
@red100: #ffcdd2;
@red200: #ef9a9a;
@red300: #e57373;
@red400: #ef5350;
@red500: #f44336;
@red600: #e53935;
@red700: #d32f2f;
@red800: #c62828;
@red900: #b71c1c;
@redA100: #ff8a80;
@redA200: #ff5252;
@redA400: #ff1744;
@redA700: #d50000;
@red: @red500;
@pink50: #fce4ec;
@pink100: #f8bbd0;
@pink200: #f48fb1;
@pink300: #f06292;
@pink400: #ec407a;
@pink500: #e91e63;
@pink600: #d81b60;
@pink700: #c2185b;
@pink800: #ad1457;
@pink900: #880e4f;
@pinkA100: #ff80ab;
@pinkA200: #ff4081;
@pinkA400: #f50057;
@pinkA700: #c51162;
@pink: @pink500;
@purple50: #f3e5f5;
@purple100: #e1bee7;
@purple200: #ce93d8;
@purple300: #ba68c8;
@purple400: #ab47bc;
@purple500: #9c27b0;
@purple600: #8e24aa;
@purple700: #7b1fa2;
@purple800: #6a1b9a;
@purple900: #4a148c;
@purpleA100: #ea80fc;
@purpleA200: #e040fb;
@purpleA400: #d500f9;
@purpleA700: #aa00ff;
@purple: @purple500;
@deepPurple50: #ede7f6;
@deepPurple100: #d1c4e9;
@deepPurple200: #b39ddb;
@deepPurple300: #9575cd;
@deepPurple400: #7e57c2;
@deepPurple500: #673ab7;
@deepPurple600: #5e35b1;
@deepPurple700: #512da8;
@deepPurple800: #4527a0;
@deepPurple900: #311b92;
@deepPurpleA100: #b388ff;
@deepPurpleA200: #7c4dff;
@deepPurpleA400: #651fff;
@deepPurpleA700: #6200ea;
@deepPurple: @deepPurple500;
@indigo50: #e8eaf6;
@indigo100: #c5cae9;
@indigo200: #9fa8da;
@indigo300: #7986cb;
@indigo400: #5c6bc0;
@indigo500: #3f51b5;
@indigo600: #3949ab;
@indigo700: #303f9f;
@indigo800: #283593;
@indigo900: #1a237e;
@indigoA100: #8c9eff;
@indigoA200: #536dfe;
@indigoA400: #3d5afe;
@indigoA700: #304ffe;
@indigo: @indigo500;
@blue50: #e3f2fd;
@blue100: #bbdefb;
@blue200: #90caf9;
@blue300: #64b5f6;
@blue400: #42a5f5;
@blue500: #2196f3;
@blue600: #1e88e5;
@blue700: #1976d2;
@blue800: #1565c0;
@blue900: #0d47a1;
@blueA100: #82b1ff;
@blueA200: #448aff;
@blueA400: #2979ff;
@blueA700: #2962ff;
@blue: @blue500;
@lightBlue50: #e1f5fe;
@lightBlue100: #b3e5fc;
@lightBlue200: #81d4fa;
@lightBlue300: #4fc3f7;
@lightBlue400: #29b6f6;
@lightBlue500: #03a9f4;
@lightBlue600: #039be5;
@lightBlue700: #0288d1;
@lightBlue800: #0277bd;
@lightBlue900: #01579b;
@lightBlueA100: #80d8ff;
@lightBlueA200: #40c4ff;
@lightBlueA400: #00b0ff;
@lightBlueA700: #0091ea;
@lightBlue: @lightBlue500;
@cyan50: #e0f7fa;
@cyan100: #b2ebf2;
@cyan200: #80deea;
@cyan300: #4dd0e1;
@cyan400: #26c6da;
@cyan500: #00bcd4;
@cyan600: #00acc1;
@cyan700: #0097a7;
@cyan800: #00838f;
@cyan900: #006064;
@cyanA100: #84ffff;
@cyanA200: #18ffff;
@cyanA400: #00e5ff;
@cyanA700: #00b8d4;
@cyan: @cyan500;
@teal50: #e0f2f1;
@teal100: #b2dfdb;
@teal200: #80cbc4;
@teal300: #4db6ac;
@teal400: #26a69a;
@teal500: #009688;
@teal600: #00897b;
@teal700: #00796b;
@teal800: #00695c;
@teal900: #004d40;
@tealA100: #a7ffeb;
@tealA200: #64ffda;
@tealA400: #1de9b6;
@tealA700: #00bfa5;
@teal: @teal500;
@green50: #e8f5e9;
@green100: #c8e6c9;
@green200: #a5d6a7;
@green300: #81c784;
@green400: #66bb6a;
@green500: #4caf50;
@green600: #43a047;
@green700: #388e3c;
@green800: #2e7d32;
@green900: #1b5e20;
@greenA100: #b9f6ca;
@greenA200: #69f0ae;
@greenA400: #00e676;
@greenA700: #00c853;
@green: @green500;
@lightGreen50: #f1f8e9;
@lightGreen100: #dcedc8;
@lightGreen200: #c5e1a5;
@lightGreen300: #aed581;
@lightGreen400: #9ccc65;
@lightGreen500: #8bc34a;
@lightGreen600: #7cb342;
@lightGreen700: #689f38;
@lightGreen800: #558b2f;
@lightGreen900: #33691e;
@lightGreenA100: #ccff90;
@lightGreenA200: #b2ff59;
@lightGreenA400: #76ff03;
@lightGreenA700: #64dd17;
@lightGreen: @lightGreen500;
@lime50: #f9fbe7;
@lime100: #f0f4c3;
@lime200: #e6ee9c;
@lime300: #dce775;
@lime400: #d4e157;
@lime500: #cddc39;
@lime600: #c0ca33;
@lime700: #afb42b;
@lime800: #9e9d24;
@lime900: #827717;
@limeA100: #f4ff81;
@limeA200: #eeff41;
@limeA400: #c6ff00;
@limeA700: #aeea00;
@lime: @lime500;
@yellow50: #fffde7;
@yellow100: #fff9c4;
@yellow200: #fff59d;
@yellow300: #fff176;
@yellow400: #ffee58;
@yellow500: #ffeb3b;
@yellow600: #fdd835;
@yellow700: #fbc02d;
@yellow800: #f9a825;
@yellow900: #f57f17;
@yellowA100: #ffff8d;
@yellowA200: #ffff00;
@yellowA400: #ffea00;
@yellowA700: #ffd600;
@yellow: @yellow500;
@amber50: #fff8e1;
@amber100: #ffecb3;
@amber200: #ffe082;
@amber300: #ffd54f;
@amber400: #ffca28;
@amber500: #ffc107;
@amber600: #ffb300;
@amber700: #ffa000;
@amber800: #ff8f00;
@amber900: #ff6f00;
@amberA100: #ffe57f;
@amberA200: #ffd740;
@amberA400: #ffc400;
@amberA700: #ffab00;
@amber: @amber500;
@orange50: #fff3e0;
@orange100: #ffe0b2;
@orange200: #ffcc80;
@orange300: #ffb74d;
@orange400: #ffa726;
@orange500: #ff9800;
@orange600: #fb8c00;
@orange700: #f57c00;
@orange800: #ef6c00;
@orange900: #e65100;
@orangeA100: #ffd180;
@orangeA200: #ffab40;
@orangeA400: #ff9100;
@orangeA700: #ff6d00;
@orange: @orange500;
@deepOrange50: #fbe9e7;
@deepOrange100: #ffccbc;
@deepOrange200: #ffab91;
@deepOrange300: #ff8a65;
@deepOrange400: #ff7043;
@deepOrange500: #ff5722;
@deepOrange600: #f4511e;
@deepOrange700: #e64a19;
@deepOrange800: #d84315;
@deepOrange900: #bf360c;
@deepOrangeA100: #ff9e80;
@deepOrangeA200: #ff6e40;
@deepOrangeA400: #ff3d00;
@deepOrangeA700: #dd2c00;
@deepOrange: @deepOrange500;
@brown50: #efebe9;
@brown100: #d7ccc8;
@brown200: #bcaaa4;
@brown300: #a1887f;
@brown400: #8d6e63;
@brown500: #795548;
@brown600: #6d4c41;
@brown700: #5d4037;
@brown800: #4e342e;
@brown900: #3e2723;
@brown: @brown500;
@blueGrey50: #eceff1;
@blueGrey100: #cfd8dc;
@blueGrey200: #b0bec5;
@blueGrey300: #90a4ae;
@blueGrey400: #78909c;
@blueGrey500: #607d8b;
@blueGrey600: #546e7a;
@blueGrey700: #455a64;
@blueGrey800: #37474f;
@blueGrey900: #263238;
@blueGrey: @blueGrey500;
@grey50: #fafafa;
@grey100: #f5f5f5;
@grey200: #eeeeee;
@grey300: #e0e0e0;
@grey400: #bdbdbd;
@grey500: #9e9e9e;
@grey600: #757575;
@grey700: #616161;
@grey800: #424242;
@grey900: #212121;
@grey: @grey500;
@black: #000000;
@white: #ffffff;
@transparent: rgba(0, 0, 0, 0);
@fullBlack: rgba(0, 0, 0, 1);
@darkBlack: rgba(0, 0, 0, 0.87);
@lightBlack: rgba(0, 0, 0, 0.54);
@minBlack: rgba(0, 0, 0, 0.26);
@faintBlack: rgba(0, 0, 0, 0.12);
@fullWhite: rgba(255, 255, 255, 1);
@darkWhite: rgba(255, 255, 255, 0.87);
@lightWhite: rgba(255, 255, 255, 0.54);

View File

@@ -0,0 +1,15 @@
<template>
<h1 class="header">
头部 {{ title }}
<slot></slot>
</h1>
</template>
<script lang="ts" setup>
defineProps<{
title: string
}>()
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,42 @@
<template>
<van-row>
<van-col span="12" v-for="item, index in list" :key="index" @click="push({ name: 'info', query: { id: item.wares_id } })">
<van-image :src="Array.isArray(item.wares_masterimg)?item.wares_masterimg[1]:item.wares_masterimg"></van-image>
<div class="title">{{ item.wares_title }}</div>
<div v-if="boor" class="pice">{{ item.wares_oldprice }}</div>
</van-col>
</van-row>
</template>
<script lang="ts" setup>
import { useRouterAction } from "@/utils/router";
const { push } = useRouterAction()
import { IndexType,ClassType } from "@/types/res/home";
withDefaults(defineProps<{
list: ClassType[] | IndexType[],
boor:boolean
}>(), {
list: () => [],
boor:true // trun 显示 false 隐藏 默认为true
})
</script>
<style lang="less" scoped>
.van-col {
margin-top: 15px;
}
.title {
font-size: 0.37333rem;
color: #000;
font-weight: 600;
text-align: center;
}
.pice {
color: #ea625b;
font-size: 0.37333rem;
margin-top: 0.13333rem;
text-align: center;
}
</style>

View File

@@ -0,0 +1,20 @@
<template>
<div class="page" :style="{ marginTop: `${top}px`, marginBottom: `${bottom}px` }">
<slot></slot>
</div>
</template>
<script lang="ts" setup>
import { reactive, ref } from "vue";
withDefaults(defineProps<{
top: number,
bottom: number
}>(), {
top: 45,
bottom: 50
})
</script>
<style lang="less" scoped></style>

View File

@@ -0,0 +1,27 @@
<template>
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe-item v-for="item, index in list" :key="index">
<slot :item="item" :index="index"></slot>
<!-- <img :src="typeof item == 'string' ? item : item.url " alt=""> -->
</van-swipe-item>
</van-swipe>
</template>
<script setup lang="ts">
import { VagueOject } from "@/types/common";
withDefaults(defineProps<{
list: VagueOject[] | string[]
}>(), {
list: () => []
})
</script>
<style lang="less" scoped>
.van-swipe {
img {
width: 100%;
}
}
</style>

View File

@@ -0,0 +1,15 @@
<template>
<van-tabbar v-model="active" route>
<van-tabbar-item icon="home-o" to="/home">首页</van-tabbar-item>
<van-tabbar-item icon="apps-o" to="/type">分类</van-tabbar-item>
<van-tabbar-item icon="shopping-cart-o" to="/car">购物车</van-tabbar-item>
<van-tabbar-item icon="friends-o" to="/me">我的</van-tabbar-item>
</van-tabbar>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref } from "vue";
const active = ref(0)
</script>
<style></style>

View File

@@ -0,0 +1,55 @@
import { VagueOject } from "@/types/common";
interface ConfigType {
devBaseUrl: string;
prodBaseUrl: string;
apiList: VagueOject;
checkEnvironment(): string;
rsaPublicKey: string;
}
export const config: ConfigType = {
devBaseUrl: "http://127.0.0.1:9090",
//devBaseUrl: "http://192.168.31.100:9090",
prodBaseUrl: "http://127.0.0.1:3000/api/json/prod",
apiList: {
index: "/home/index",//首页
info: "/home/info",
addCar: "/car/addCar",
getCarList: "/car/getCarList",
checkCar: "/car/checkCar",
deleteCar: "/car/deleteCar",
updateCarNum: "/car/updateCarNum",
submitCar: "/car/submitCar",
allOrder: "/order/allOrder",
buyOrder: "/order/buyOrder",
userlogin:"/user/login",//用户登录
useradd:"/user/add",//用户注册
orderallOrder:"/order/allOrder",//我的分类
userlike:"/user/like",//收藏
search: "/home/search",//搜索接口,
activity: "/home/activity",//轮播图下分类
list: "/type/list",//分类页面
likeList: "/user/likeList",//我的页面 收藏
},
checkEnvironment() {
let url: string = ""
switch (import.meta.env.MODE) {
case "development":
url = this.devBaseUrl
break;
case "production":
url = this.prodBaseUrl
break;
}
return url;
},
rsaPublicKey: `-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9eo8WIbWS5Yql06imlhrW0ZXh
faivPavdULvYLIxIKyUaOwMPFrPuHqqBNGnYOpiPHAKL+zxk2j4u+6jhB6VK1SOD
ccSLxIRxd0HmSDS+hBzYRf4vKc8BLlhMrYhnLmcxCc+PJIIa4DfCZnu8FfQlu/5L
ljjpYN9kHOpHAT+xpQIDAQAB
-----END PUBLIC KEY-----
`
}

View File

@@ -0,0 +1,25 @@
import "lib-flexible"
import { createApp } from 'vue'
import App from './App.vue'
import tabbar from './components/tabbar.vue'
import page from './components/page.vue'
import swiper from './components/swiper.vue'
import item from './components/item.vue'
import router from './router'
import { createPinia } from 'pinia'
// import { store, key } from '@/state'
const app = createApp(App)
const pinia = createPinia()
app.component(item)
app.component(swiper)
app.component(tabbar)
app.component(page)
app.use(router)
app.use(pinia)
app.mount('#app')

View File

@@ -0,0 +1,16 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import { routerPath } from './path'
const router = createRouter({
history: createWebHashHistory(import.meta.env.BASE_URL),
routes: routerPath,
scrollBehavior (to, from, savedPosition) {
if (to.name == "info") {
return { top: 0 }
} else {
return savedPosition != null ? savedPosition : false
}
}
})
export default router

View File

@@ -0,0 +1,100 @@
import { RouteRecordRaw } from 'vue-router'
export const routerPath = [
{
path: '/',
name: 'layout',
component: () => import('../views/Layout.vue'),
children: [
{
path: 'home',
name: 'home',
component: () => import('../views/Home.vue'),
meta: {
keepAlive: true,
},
},
{
path: 'me',
name: 'me',
component: () => import('../views/Me.vue'),
meta: {
keepAlive: false,
},
},
{
path: 'type',
name: 'type',
component: () => import('../views/Type.vue'),
meta: {
keepAlive: false,
},
},
{
path: 'car',
name: 'car',
component: () => import('../views/Car.vue'),
meta: {
keepAlive: false,
},
}
]
},
{
path: '/search',
name: 'search',
component: () => import('../views/Search.vue'),
meta: {
keepAlive: false,
},
},
//首页分类
{
path: '/classification',
name: 'classification',
component: () => import('../views/classification.vue'),
meta: {
keepAlive: false,
},
},
//收藏
{
path: '/likes',
name: 'likes',
component: () => import('../views/likes.vue'),
meta: {
keepAlive: false,
},
},
{
path: '/info',
name: 'info',
component: () => import('../views/Info.vue'),
meta: {
keepAlive: false,
},
},
{
path: '/order',
name: 'order',
component: () => import('../views/Order.vue'),
meta: {
keepAlive: false,
},
},{
path: '/user',
name: 'user',
component: () => import('../views/User.vue'),
meta: {
keepAlive: false,
},
},{
path: '/metype',
name: 'metype',
component: () => import('../views/Metype.vue'),
meta: {
keepAlive: false,
},
},
];

View File

@@ -0,0 +1,20 @@
import { index, info ,search,activity,likeList,list } from "@/serve/home";
import { allOrder, buyOrder} from "@/serve/order";
import { addCar, getCarList, submitCar, updateCarNum, checkCar, deleteCar } from "@/serve/car";
import { usermethod ,userlike,useradd,orderallOrder} from "@/serve/user";
export {
index, info,search,activity,likeList,list,
addCar, getCarList, checkCar,
deleteCar, updateCarNum, submitCar,
allOrder, buyOrder,
usermethod,userlike,useradd,orderallOrder
}
// export const home = {
// notice
// }

View File

@@ -0,0 +1,63 @@
import { POST } from "@/api";
import { config } from "@/config";
import { VagueOject } from "@/types/common";
import { CarType } from "@/types/res/car";
export const addCar = async (data: VagueOject = {}, header: VagueOject = {}): Promise<void> => {
return await POST<void>({
url: config.apiList.addCar,
data,
header
})
}
export const submitCar = async (data: VagueOject = {}, header: VagueOject = {}): Promise<void> => {
return await POST<void>({
url: config.apiList.submitCar,
data,
header
})
}
export const updateCarNum = async (data: VagueOject = {}, header: VagueOject = {}): Promise<void> => {
return await POST<void>({
url: config.apiList.updateCarNum,
data,
header
})
}
export const getCarList = async (data: VagueOject = {}, header: VagueOject = {}): Promise<CarType[]> => {
let res = await POST<CarType[]>({
url: config.apiList.getCarList,
data,
header
})
if (Array.isArray(res)) {
res.forEach(v => {
v.wares_masterimg = JSON.parse(<string>v.wares_masterimg)
})
} else {
res = []
}
return res;
}
export const checkCar = async (data: VagueOject = {}, header: VagueOject = {}): Promise<{ isAddCar: boolean }> => {
return await POST<{ isAddCar: boolean }>({
url: config.apiList.checkCar,
data,
header
})
}
export const deleteCar = async (data: VagueOject = {}, header: VagueOject = {}): Promise<any> => {
return await POST<any>({
url: config.apiList.deleteCar,
data,
header
})
}

View File

@@ -0,0 +1,8 @@
POST http://127.0.0.1:9090/user/login HTTP/1.1
content-type: application/json
{
name:"bmy",
pwd:"1234567890"
}

View File

@@ -0,0 +1,92 @@
import { GET, POST } from "@/api";
import { config } from "@/config";
import { VagueOject } from "@/types/common";
import { IndexType,ClassType } from "@/types/res/home";
export const index = async (data: VagueOject = {}, header: VagueOject = {}): Promise<IndexType[]> => {
let res = await POST<IndexType[]>({
url: config.apiList.index,
data,
header
})
res.forEach(v => {
v.wares_masterimg = JSON.parse(<string>v.wares_masterimg)
})
return res;
}
export const info = async (data: VagueOject = {}, header: VagueOject = {}): Promise<IndexType> => {
let res = await POST<IndexType>({
url: config.apiList.info,
data,
header
})
res.wares_masterimg = JSON.parse(<string>res.wares_masterimg)
res.wares_infoimg = JSON.parse(<string>res.wares_infoimg)
return res;
}
export const search = async (data: VagueOject = {}, header: VagueOject = {}): Promise<IndexType[]> => {
let res = await POST<IndexType[]>({
url: config.apiList.search,
data,
header
})
res.forEach(e => {
e.wares_masterimg = JSON.parse(<string>e.wares_masterimg)
e.wares_infoimg = JSON.parse(<string>e.wares_infoimg)
});
return res;
}
export const activity = async (data: VagueOject = {}, header: VagueOject = {}): Promise<IndexType[]> => {
let res = await POST<IndexType[]>({
url: config.apiList.activity,
data,
header
})
res.forEach(e => {
e.wares_masterimg = JSON.parse(<string>e.wares_masterimg)
e.wares_infoimg = JSON.parse(<string>e.wares_infoimg)
});
// console.log(res);
// res.wares_masterimg = JSON.parse(<string>res.wares_masterimg)
// res.wares_infoimg = JSON.parse(<string>res.wares_infoimg)
return res;
}
//首页分类
export const likeList = async (data: VagueOject = {}, header: VagueOject = {}): Promise<IndexType[]> => {
let res = await POST<IndexType[]>({
url: config.apiList.likeList,
data,
header
})
res.forEach(e => {
e.wares_masterimg = JSON.parse(<string>e.wares_masterimg)
e.wares_infoimg = JSON.parse(<string>e.wares_infoimg)
});
// console.log('收藏',res);
// res.wares_masterimg = JSON.parse(<string>res.wares_masterimg)
// res.wares_infoimg = JSON.parse(<string>res.wares_infoimg)
return res;
}
//分类页面
export const list = async (data: VagueOject = {}, header: VagueOject = {}): Promise<ClassType[]> => {
let res = await POST<ClassType[]>({
url: config.apiList.list,
data,
header
})
// res.wares_masterimg = JSON.parse(<string>res.wares_masterimg)
// res.wares_infoimg = JSON.parse(<string>res.wares_infoimg)
return res;
}

View File

@@ -0,0 +1,28 @@
import { POST } from "@/api";
import { config } from "@/config";
import { VagueOject } from "@/types/common";
import { OrderType } from "@/types/res/order";
export const allOrder = async (data: VagueOject = {}, header: VagueOject = {}): Promise<OrderType[]> => {
let res = await POST<OrderType[]>({
url: config.apiList.allOrder,
data,
header
})
res.forEach(v => {
v.wares_masterimg = JSON.parse(<string>v.wares_masterimg)
})
return res
}
export const buyOrder = async (data: VagueOject = {}, header: VagueOject = {}): Promise<void> => {
return await POST<void>({
url: config.apiList.buyOrder,
data,
header
})
}

View File

@@ -0,0 +1,76 @@
import { POST } from "@/api";
import { config } from "@/config";
import { VagueOject, typee } from "@/types/common";
import { OrderType } from "@/types/res/order";
import { IndexType } from "@/types/res/home";
//登录
export const usermethod = async (data: VagueOject = {}, header: VagueOject = {}): Promise<string> => {
return await POST<string>({
url: config.apiList.userlogin,
data,
header
})
}
//收藏
export const userlike = async (data: VagueOject = {}, header: VagueOject = {}): Promise<any> => {
return await POST<any>({
url: config.apiList.userlike,
data,
header
})
}
//注册
export const useradd = async (data: VagueOject = {}, header: VagueOject = {}): Promise<any> => {
return await POST<any>({
url: config.apiList.useradd,
data,
header
})
}
export const orderallOrder = async (data: VagueOject = {}, header: VagueOject = {}): Promise<typee[]> => {
let res = await POST<typee[]>({
url: config.apiList.orderallOrder,
data,
header
})
console.log("res", res)
// @ts-ignore
// res.forEach((v)=>{
// v.wares_masterimg=JSON.parse(<string>v.wares_masterimg)
// v.wares_infoimg= JSON.parse(<string>v.wares_infoimg)
// })
if (!res.length == 0) {
res.forEach((v) => {
v.wares_masterimg = JSON.parse(<string>v.wares_masterimg)
v.wares_infoimg = JSON.parse(<string>v.wares_infoimg)
})
console.log(5555)
} else {
console.log(1111)
}
return res;
// let res = await POST<IndexType[]>({
// url: config.apiList.index,
// data,
// header
// })
// res.forEach(v => {
// v.wares_masterimg = JSON.parse(<string>v.wares_masterimg)
// })
}

View File

@@ -0,0 +1,23 @@
import { defineStore } from "pinia"
import { computed, reactive } from "vue"
import { getCarList } from "@/serve/_";
import { CarType } from "@/types/res/car";
export const useCarStore = defineStore('car', () => {
const state: {
carList: CarType[]
} = reactive({
carList: []
})
const carArr = computed(() => {
return state.carList
})
let PostCarList = async () => {
state.carList = await getCarList()
}
return { carArr, PostCarList }
})

View File

@@ -0,0 +1,15 @@
import { defineStore } from "pinia"
import { ref, computed } from "vue"
export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
const get_count = computed(() => {
return count.value
})
function increment(num: number) {
count.value += num
}
return { get_count, increment }
})

View File

@@ -0,0 +1,553 @@
/**
* 覆盖axios get post 请求返回数据不合理的地方
*/
declare module "axios" {
// TypeScript Version: 4.7
export type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
interface RawAxiosHeaders {
[key: string]: AxiosHeaderValue;
}
type MethodsHeaders = Partial<{
[Key in Method as Lowercase<Key>]: AxiosHeaders;
} & { common: AxiosHeaders }>;
type AxiosHeaderMatcher = (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean;
export class AxiosHeaders {
constructor(
headers?: RawAxiosHeaders | AxiosHeaders
);
[key: string]: any;
set(headerName?: string, value?: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
set(headers?: RawAxiosHeaders | AxiosHeaders, rewrite?: boolean): AxiosHeaders;
get(headerName: string, parser: RegExp): RegExpExecArray | null;
get(headerName: string, matcher?: true | AxiosHeaderMatcher): AxiosHeaderValue;
has(header: string, matcher?: true | AxiosHeaderMatcher): boolean;
delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
clear(matcher?: AxiosHeaderMatcher): boolean;
normalize(format: boolean): AxiosHeaders;
concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
toJSON(asStrings?: boolean): RawAxiosHeaders;
static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
static accessor(header: string | string[]): AxiosHeaders;
static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
getContentType(parser?: RegExp): RegExpExecArray | null;
getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
getContentLength(parser?: RegExp): RegExpExecArray | null;
getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
getAccept(parser?: RegExp): RegExpExecArray | null;
getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
hasAccept(matcher?: AxiosHeaderMatcher): boolean;
setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
getUserAgent(parser?: RegExp): RegExpExecArray | null;
getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
getContentEncoding(parser?: RegExp): RegExpExecArray | null;
getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
getAuthorization(parser?: RegExp): RegExpExecArray | null;
getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
[Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
}
type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization';
type ContentType = AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream';
export type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
} & {
'Content-Type': ContentType
}>;
export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control' | 'Content-Encoding';
type RawCommonResponseHeaders = {
[Key in CommonResponseHeadersList]: AxiosHeaderValue;
} & {
"set-cookie": string[];
};
export type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
export type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
export interface AxiosRequestTransformer {
(this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
}
export interface AxiosResponseTransformer {
(this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any;
}
export interface AxiosAdapter {
(config: InternalAxiosRequestConfig): AxiosPromise;
}
export interface AxiosBasicCredentials {
username: string;
password: string;
}
export interface AxiosProxyConfig {
host: string;
port: number;
auth?: {
username: string;
password: string;
};
protocol?: string;
}
export enum HttpStatusCode {
Continue = 100,
SwitchingProtocols = 101,
Processing = 102,
EarlyHints = 103,
Ok = 200,
Created = 201,
Accepted = 202,
NonAuthoritativeInformation = 203,
NoContent = 204,
ResetContent = 205,
PartialContent = 206,
MultiStatus = 207,
AlreadyReported = 208,
ImUsed = 226,
MultipleChoices = 300,
MovedPermanently = 301,
Found = 302,
SeeOther = 303,
NotModified = 304,
UseProxy = 305,
Unused = 306,
TemporaryRedirect = 307,
PermanentRedirect = 308,
BadRequest = 400,
Unauthorized = 401,
PaymentRequired = 402,
Forbidden = 403,
NotFound = 404,
MethodNotAllowed = 405,
NotAcceptable = 406,
ProxyAuthenticationRequired = 407,
RequestTimeout = 408,
Conflict = 409,
Gone = 410,
LengthRequired = 411,
PreconditionFailed = 412,
PayloadTooLarge = 413,
UriTooLong = 414,
UnsupportedMediaType = 415,
RangeNotSatisfiable = 416,
ExpectationFailed = 417,
ImATeapot = 418,
MisdirectedRequest = 421,
UnprocessableEntity = 422,
Locked = 423,
FailedDependency = 424,
TooEarly = 425,
UpgradeRequired = 426,
PreconditionRequired = 428,
TooManyRequests = 429,
RequestHeaderFieldsTooLarge = 431,
UnavailableForLegalReasons = 451,
InternalServerError = 500,
NotImplemented = 501,
BadGateway = 502,
ServiceUnavailable = 503,
GatewayTimeout = 504,
HttpVersionNotSupported = 505,
VariantAlsoNegotiates = 506,
InsufficientStorage = 507,
LoopDetected = 508,
NotExtended = 510,
NetworkAuthenticationRequired = 511,
}
export type Method =
| 'get' | 'GET'
| 'delete' | 'DELETE'
| 'head' | 'HEAD'
| 'options' | 'OPTIONS'
| 'post' | 'POST'
| 'put' | 'PUT'
| 'patch' | 'PATCH'
| 'purge' | 'PURGE'
| 'link' | 'LINK'
| 'unlink' | 'UNLINK';
export type ResponseType =
| 'arraybuffer'
| 'blob'
| 'document'
| 'json'
| 'text'
| 'stream';
export type responseEncoding =
| 'ascii' | 'ASCII'
| 'ansi' | 'ANSI'
| 'binary' | 'BINARY'
| 'base64' | 'BASE64'
| 'base64url' | 'BASE64URL'
| 'hex' | 'HEX'
| 'latin1' | 'LATIN1'
| 'ucs-2' | 'UCS-2'
| 'ucs2' | 'UCS2'
| 'utf-8' | 'UTF-8'
| 'utf8' | 'UTF8'
| 'utf16le' | 'UTF16LE';
export interface TransitionalOptions {
silentJSONParsing?: boolean;
forcedJSONParsing?: boolean;
clarifyTimeoutError?: boolean;
}
export interface GenericAbortSignal {
readonly aborted: boolean;
onabort?: ((...args: any) => any) | null;
addEventListener?: (...args: any) => any;
removeEventListener?: (...args: any) => any;
}
export interface FormDataVisitorHelpers {
defaultVisitor: SerializerVisitor;
convertValue: (value: any) => any;
isVisitable: (value: any) => boolean;
}
export interface SerializerVisitor {
(
this: GenericFormData,
value: any,
key: string | number,
path: null | Array<string | number>,
helpers: FormDataVisitorHelpers
): boolean;
}
export interface SerializerOptions {
visitor?: SerializerVisitor;
dots?: boolean;
metaTokens?: boolean;
indexes?: boolean | null;
}
// tslint:disable-next-line
export interface FormSerializerOptions extends SerializerOptions {
}
export interface ParamEncoder {
(value: any, defaultEncoder: (value: any) => any): any;
}
export interface CustomParamsSerializer {
(params: Record<string, any>, options?: ParamsSerializerOptions): string;
}
export interface ParamsSerializerOptions extends SerializerOptions {
encode?: ParamEncoder;
serialize?: CustomParamsSerializer;
}
type MaxUploadRate = number;
type MaxDownloadRate = number;
type BrowserProgressEvent = any;
export interface AxiosProgressEvent {
loaded: number;
total?: number;
progress?: number;
bytes: number;
rate?: number;
estimated?: number;
upload?: boolean;
download?: boolean;
event?: BrowserProgressEvent;
}
type Milliseconds = number;
type AxiosAdapterName = 'xhr' | 'http' | string;
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
export interface AxiosRequestConfig<D = any> {
url?: string;
method?: Method | string;
baseURL?: string;
transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
params?: any;
paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
data?: D;
timeout?: Milliseconds;
timeoutErrorMessage?: string;
withCredentials?: boolean;
adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
auth?: AxiosBasicCredentials;
responseType?: ResponseType;
responseEncoding?: responseEncoding | string;
xsrfCookieName?: string;
xsrfHeaderName?: string;
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
maxContentLength?: number;
validateStatus?: ((status: number) => boolean) | null;
maxBodyLength?: number;
maxRedirects?: number;
maxRate?: number | [MaxUploadRate, MaxDownloadRate];
beforeRedirect?: (options: Record<string, any>, responseDetails: { headers: Record<string, string> }) => void;
socketPath?: string | null;
transport?: any;
httpAgent?: any;
httpsAgent?: any;
proxy?: AxiosProxyConfig | false;
cancelToken?: CancelToken;
decompress?: boolean;
transitional?: TransitionalOptions;
signal?: GenericAbortSignal;
insecureHTTPParser?: boolean;
env?: {
FormData?: new (...args: any[]) => object;
};
formSerializer?: FormSerializerOptions;
family?: 4 | 6 | undefined;
lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: string, family: number) => void) => void) |
((hostname: string, options: object) => Promise<[address: string, family: number] | string>);
}
// Alias
export type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
export interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
headers: AxiosRequestHeaders;
}
export interface HeadersDefaults {
common: RawAxiosRequestHeaders;
delete: RawAxiosRequestHeaders;
get: RawAxiosRequestHeaders;
head: RawAxiosRequestHeaders;
post: RawAxiosRequestHeaders;
put: RawAxiosRequestHeaders;
patch: RawAxiosRequestHeaders;
options?: RawAxiosRequestHeaders;
purge?: RawAxiosRequestHeaders;
link?: RawAxiosRequestHeaders;
unlink?: RawAxiosRequestHeaders;
}
export interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
headers: HeadersDefaults;
}
export interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
}
export interface AxiosResponse<T = any, D = any> {
data: T;
status: number;
statusText: string;
headers: RawAxiosResponseHeaders | AxiosResponseHeaders;
config: InternalAxiosRequestConfig<D>;
request?: any;
}
export class AxiosError<T = unknown, D = any> extends Error {
constructor(
message?: string,
code?: string,
config?: InternalAxiosRequestConfig<D>,
request?: any,
response?: AxiosResponse<T, D>
);
config?: InternalAxiosRequestConfig<D>;
code?: string;
request?: any;
response?: AxiosResponse<T, D>;
isAxiosError: boolean;
status?: number;
toJSON: () => object;
cause?: Error;
static from<T = unknown, D = any>(
error: Error | unknown,
code?: string,
config?: InternalAxiosRequestConfig<D>,
request?: any,
response?: AxiosResponse<T, D>,
customProps?: object,
): AxiosError<T, D>;
static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION";
static readonly ERR_NETWORK = "ERR_NETWORK";
static readonly ERR_DEPRECATED = "ERR_DEPRECATED";
static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
static readonly ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
static readonly ERR_INVALID_URL = "ERR_INVALID_URL";
static readonly ERR_CANCELED = "ERR_CANCELED";
static readonly ECONNABORTED = "ECONNABORTED";
static readonly ETIMEDOUT = "ETIMEDOUT";
}
export class CanceledError<T> extends AxiosError<T> {
}
export type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
export interface CancelStatic {
new(message?: string): Cancel;
}
export interface Cancel {
message: string | undefined;
}
export interface Canceler {
(message?: string, config?: AxiosRequestConfig, request?: any): void;
}
export interface CancelTokenStatic {
new(executor: (cancel: Canceler) => void): CancelToken;
source(): CancelTokenSource;
}
export interface CancelToken {
promise: Promise<Cancel>;
reason?: Cancel;
throwIfRequested(): void;
}
export interface CancelTokenSource {
token: CancelToken;
cancel: Canceler;
}
export interface AxiosInterceptorOptions {
synchronous?: boolean;
runWhen?: (config: InternalAxiosRequestConfig) => boolean;
}
export interface AxiosInterceptorManager<V> {
use(onFulfilled?: ((value: V) => V | Promise<V>) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions): number;
eject(id: number): void;
clear(): void;
}
export class Axios {
constructor(config?: AxiosRequestConfig);
defaults: AxiosDefaults;
interceptors: {
request: AxiosInterceptorManager<InternalAxiosRequestConfig>;
response: AxiosInterceptorManager<AxiosResponse>;
};
getUri(config?: AxiosRequestConfig): string;
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<T>;
delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
head<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
options<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<T>;
put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
patch<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
postForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
putForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
patchForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
}
export interface AxiosInstance extends Axios {
<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
defaults: Omit<AxiosDefaults, 'headers'> & {
headers: HeadersDefaults & {
[key: string]: AxiosHeaderValue
}
};
}
export interface GenericFormData {
append(name: string, value: any, options?: any): any;
}
export interface GenericHTMLFormElement {
name: string;
method: string;
submit(): void;
}
export function toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData;
export function formToJSON(form: GenericFormData | GenericHTMLFormElement): object;
export function isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;
export function spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
export function isCancel(value: any): value is Cancel;
export function all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
export interface AxiosStatic extends AxiosInstance {
create(config?: CreateAxiosDefaults): AxiosInstance;
Cancel: CancelStatic;
CancelToken: CancelTokenStatic;
Axios: typeof Axios;
AxiosError: typeof AxiosError;
HttpStatusCode: typeof HttpStatusCode;
readonly VERSION: string;
isCancel: typeof isCancel;
all: typeof all;
spread: typeof spread;
isAxiosError: typeof isAxiosError;
toFormData: typeof toFormData;
formToJSON: typeof formToJSON;
CanceledError: typeof CanceledError;
AxiosHeaders: typeof AxiosHeaders;
}
declare const axios: AxiosStatic;
export default axios;
}

View File

@@ -0,0 +1,51 @@
export type VagueOject = { [key: string]: string };
export interface typee {
goods_id: number
goods_num
:
number
goods_price
:
string
goods_status
:
number
goods_totalprice
:
string
user_id
:
number
wares_activity
:
string
wares_conf
:
string
wares_id
:
number
wares_info
:
string
wares_infoimg
: string | string[]
wares_masterimg
: string | string[]
wares_nowprice
:
string
wares_oldprice
:
string
wares_stock
:
string
wares_title
:
string
wares_type
:
string
}

View File

@@ -0,0 +1,7 @@
import { IndexType } from "@/types/res/home";
export interface CarType extends IndexType {
car_id: number;
car_num: number;
user_id: number;
}

View File

@@ -0,0 +1,19 @@
export interface IndexType {
wares_activity?: string
wares_conf?: string[]
wares_id?: number
wares_info?: string
wares_infoimg?: string | string[]
wares_masterimg?: string | string[]
wares_nowprice?: string
wares_oldprice?: string
wares_stock?: string
wares_title?: string
wares_type?: string
}
export interface ClassType {
wares_id: number
wares_masterimg: string | string[]
wares_title: string
}

View File

@@ -0,0 +1,14 @@
export interface IndexType {
wares_activity?: string
wares_conf?: string[]
wares_id?: number
wares_info?: string
wares_infoimg?: string | string[]
wares_masterimg?: string | string[]
wares_nowprice?: string
wares_oldprice?: string
wares_stock?: string
wares_title?: string
wares_type?: string
result?:string[]
}

View File

@@ -0,0 +1,11 @@
import { IndexType } from "@/types/res/home";
export interface OrderType extends IndexType {
goods_id: number
goods_num: number
goods_price: string
goods_status: number
goods_totalprice: string
user_id: number
}

View File

@@ -0,0 +1,5 @@
export interface resultType<T extends any> {
status: number,
message: string,
result: T
}

View File

@@ -0,0 +1,6 @@
declare module '*.vue' {
// import Vue from 'vue'
export default ComputedOptions
// export default Vue
}

View File

@@ -0,0 +1,13 @@
import { Store } from 'vuex'
declare module '@vue/runtime-core' {
// 声明自己的 store state
interface State {
count: number
}
// 为 `this.$store` 提供类型声明
interface ComponentCustomProperties {
$store: Store<State>
}
}

View File

@@ -0,0 +1,45 @@
// class Utils {
// isPhone(phone) {
// let myreg = /^1[3-9]\d{9}$/;
// return myreg.test(phone)
// }
// // 密码中必须包含大小写 字母、数字、特称字符,至少6个字符,最多20个字符;
// checkPwd(pwd) {
// // 这个正则有问题,自己找个
// let pwdRegex = /(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[`~!@#$%^&*()-=_+;':",./<>?])(?=\S+$).{6,32}/;
// return pwdRegex.test(pwd)
// }
// setItem(key, value) {
// localStorage.setItem(
// key,
// value.constructor == Object || value.constructor == Array
// ? JSON.stringify(value)
// : value
// )
// }
// getItem(key) {
// return localStorage.getItem(key) == null ? false : JSON.parse(localStorage.getItem(key))
// }
// }
export const setItem=(key:string,value:any):void=>{
localStorage.setItem(
key,
value.constructor == Object || value.constructor == Array
? JSON.stringify(value)
: value
)
}
export const getItem=(key:string):[]|{}=>{
return localStorage.getItem(key) == null ? false : JSON.parse(<string>localStorage.getItem(key))
}
export const isPhone =(phone:string):boolean=> {
let myreg = /^1[3-9]\d{9}$/;
return myreg.test(phone)
}

View File

@@ -0,0 +1,3 @@
export const md5 = () => {
console.log("md5");
}

View File

@@ -0,0 +1,25 @@
import { useRouter, RouteLocationRaw, useRoute } from 'vue-router'
export function useRouterAction() {
const userRouter = useRouter()
function push(to: RouteLocationRaw){
userRouter.push(to)
}
function replace(to: RouteLocationRaw){
userRouter.replace(to)
}
function back(){
userRouter.back()
}
function route() {
return useRoute()
}
return {
push, replace, route, back
}
}

View File

@@ -0,0 +1,16 @@
// import NodeRSA from "node-rsa";
import NodeRSA from 'jsencrypt'
import {config} from "@/config";
import {VagueOject} from "@/types/common";
const rsa = new NodeRSA()
rsa.setPublicKey(config.rsaPublicKey);
export const PublicKeyEncryption = (text: VagueOject): string => {
return <string>rsa.encrypt(JSON.stringify(text))
}
export const PublicKeyDecrypt = (text: string) => {
console.log("text: ", rsa.decrypt(text));
// return JSON.parse(<string>rsa.decrypt(text))
}

View File

@@ -0,0 +1,140 @@
<template>
<div class="car">
<van-nav-bar fixed title="购物车" :right-text="state.status ? '编辑' : '完成'" left-arrow @click-left="back()"
@click-right="onClickRight" />
<page class="car" :bottom="100">
<van-checkbox-group v-if="carStore.carArr.length != 0" v-model="state.youSelectItem" ref="checkboxGroup"
@change="youSelect">
<van-checkbox :name="item.car_id" v-for="item, index in carStore.carArr" :key="index">
<van-card :num="item.car_num" :price="item.wares_oldprice" :title="item.wares_title"
:thumb="item.wares_masterimg && item.wares_masterimg[0]">
<template #footer>
<div @click.stop="">
<van-stepper :name="item.car_id" @change="upCarNum" v-model="item.car_num" />
</div>
</template>
<template #desc>
<van-text-ellipsis :content="item.wares_info" />
</template>
</van-card>
</van-checkbox>
</van-checkbox-group>
<div v-else>暂无数据</div>
</page>
<van-submit-bar :price="totalMoney">
<van-checkbox @click="SelectList" v-model="state.select">全选</van-checkbox>
<template #button>
<van-button v-if="state.status" round type="warning" @click="buyCar">买买买</van-button>
<van-button v-else round type="danger" @click="deleteCar">删 除</van-button>
</template>
</van-submit-bar>
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref, computed, onUnmounted, getCurrentInstance } from "vue";
import { useCarStore } from "@/state/car";
import { useRouterAction } from "@/utils/router";
import { deleteCar as deleteCarItem, updateCarNum, submitCar } from "@/serve/_";
const carStore = useCarStore()
const { back, push } = useRouterAction()
const checkboxGroup = ref();
const state: {
select: boolean,
status: boolean,
youSelectItem: number[]
} = reactive({
select: false,
status: true, // true 显示编辑 false 显示完成
youSelectItem: []
})
onMounted(async () => {
if (carStore.carArr.length == 0) {
await carStore.PostCarList()
}
})
let totalMoney = computed(() => {
let money = 0
carStore.carArr.forEach(v => {
state.youSelectItem.forEach(j => {
if (v.car_id == j) {
money += Number(v.wares_oldprice && v.wares_oldprice) * v.car_num
}
})
})
return money * 100
})
let youSelect = () => {
if (state.youSelectItem.length != carStore.carArr.length) {
state.select = false
}
}
let buyCar = async () => {
let params: Object[] = []
// {"waresid":113,"goodsnum":2,"goodsprice":1000}
carStore.carArr.forEach(v => {
state.youSelectItem.forEach(j => {
if (v.car_id == j) {
params.push({
waresid: v.wares_id,
goodsnum: v.car_num,
goodsprice: v.wares_oldprice
})
}
})
})
await submitCar({
carList: JSON.stringify(params)
})
push({ name: "order" });
}
let upCarNum = async (value: string, detail: { name: string }) => {
await updateCarNum({
carid: detail.name,
quantity: value
})
}
let SelectList = () => {
if (state.select) {
checkboxGroup.value.toggleAll(true)
} else {
checkboxGroup.value.toggleAll()
}
}
let deleteCar = async () => {
await deleteCarItem({
carid: JSON.stringify(state.youSelectItem)
})
setTimeout(async () => {
await carStore.PostCarList()
}, 1000)
}
let onClickRight = () => {
state.status = !state.status
}
let onClickLeft = () => { }
</script>
<style lang="less" scoped>
@import "@page/Car.less";
</style>

View File

@@ -0,0 +1,107 @@
<template>
<div class="home">
<div class="search_top">
<img src="/img/logo.png" alt="">
<van-search @focus="push('/search')" show-action placeholder="请输入搜索关键词">
<template #action>
<van-icon name="friends-o" size="20" />
</template>
</van-search>
</div>
<page :top="54">
<swiper :list="state.swiper">
<template v-slot="{ item }">
<img :src="item.url" alt="">
</template>
</swiper>
<!-- classification -->
<van-grid :border="false" :column-num="4">
<van-grid-item v-for="item, index in state.gridList" :key="index" @click="push({ name: 'classification', query: { id: item.id } })">
<template #icon>
<van-image width="31" height="31" :src="item.img"></van-image>
</template>
<template #text>
<p class="grid_text">{{ item.text }}</p>
</template>
</van-grid-item>
</van-grid>
<van-row>
<van-col span="12">
<img src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/32b5d24417b673008f386592c4d17046.jpg?thumb=1&w=358&h=508"
alt="">
</van-col>
<van-col span="12">
<van-row>
<van-col span="24">
<img
src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/1480d862e1f5a41e5adae8c030eef511.jpg?thumb=1&w=358&h=252"
alt="">
</van-col>
<van-col span="24">
<img
src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/1480d862e1f5a41e5adae8c030eef511.jpg?thumb=1&w=358&h=252"
alt="">
</van-col>
</van-row>
</van-col>
</van-row>
<van-row>
<van-col span="24">
<img src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/3ca39ff880dfbcbc0e45314782c39fff.jpg?thumb=1&w=720&h=280"
alt="">
</van-col>
</van-row>
<item :list="state.arr"></item>
</page>
</div>
</template>
<script setup lang="ts">
import { index } from "@/serve/_";
import { useRouterAction } from "@/utils/router";
const { push } = useRouterAction()
import { IndexType } from "@/types/res/home";
import { onMounted, reactive, toRefs } from "vue";
interface state {
swiper: { id: number, url: string }[],
gridList: { id: number, text: string, img: string }[],
arr: IndexType[]
}
const state: state = reactive({
swiper: [
{ id: 1, url: "https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/f5008839c212fa55a475af26dca8e80f.jpg?thumb=1&w=720&h=360" },
{ id: 2, url: "https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/f5008839c212fa55a475af26dca8e80f.jpg?thumb=1&w=720&h=360" }
],
gridList: [
{ id: 1, text: '限时白嫖', img: '/img/type_1.png' },
{ id: 2, text: '新品推荐', img: '/img/type_2.png' },
{ id: 3, text: '低价高配', img: '/img/type_3.png' },
{ id: 4, text: '超值特卖', img: '/img/type_4.png' },
],
arr: []
})
onMounted(() => {
getNotice()
})
let getNotice = async () => {
state.arr = await index();
console.log(state.arr );
}
</script>
<style lang="less" scoped>@import "@page/Home.less";</style>

View File

@@ -0,0 +1,149 @@
<template>
<div class="info">
<page :top="0">
<van-icon class="action_icon" @click="back()" :class="state.isShow ? 'noback' : ''" name="arrow-left" />
<van-icon class="action_icon" :class="state.isShow ? 'noback' : ''" name="share-o" />
<div class="back" :style="{ background: `rgba(255,255,255,${state.opacity})` }"></div>
<van-tabs ref="tabs" :class="state.isShow ? 'show' : 'hidden'" fixed color="#ff5934" line-width="15"
v-model:active="state.active" scrollspy sticky>
<van-tab title="商品">
<swiper :list="state.info.wares_masterimg">
<template v-slot="{ item, index }">
<img @click="showBigImg(<string[]>state.info.wares_masterimg, index)" :src="item" alt="">
</template>
</swiper>
<div class="info_content">
<div class="title">{{ state.info.wares_title }}</div>
<div class="cont">{{ state.info.wares_info }}</div>
<div class="price">¥{{ state.info.wares_oldprice }}</div>
</div>
<van-row class="item">
<van-col span="6">已选</van-col>
<van-col span="12">全网公开版,碳纤黑,6+128...</van-col>
<van-col span="6">
<span>x1</span>
<van-icon name="arrow" />
</van-col>
</van-row>
</van-tab>
<van-tab title="详情">
<van-image @click="showBigImg(<string[]>state.info.wares_infoimg, index)"
v-for="item, index in state.info.wares_infoimg" :key="index" :src="item"></van-image>
</van-tab>
</van-tabs>
</page>
<van-action-bar>
<van-action-bar-icon :color="state.isHavese" @click="collect" icon="star-o" text="收藏" />
<van-action-bar-icon :to="{ name: 'car' }" icon="cart-o" text="购物车" :badge="carArr.length" />
<van-action-bar-button :disabled="state.isHave" type="warning" text="加入购物车" @click="addCarShop" />
<van-action-bar-button type="danger" text="立即购买" />
</van-action-bar>
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref, onUnmounted, getCurrentInstance } from "vue";
import { showImagePreview, showToast } from 'vant';
import { storeToRefs } from 'pinia'
import { info, addCar, checkCar,userlike } from "@/serve/_";
import { IndexType } from "@/types/res/home";
import { useRouterAction } from "@/utils/router";
import { useCarStore } from "@/state/car";
const tabs = ref()
const { carArr } = storeToRefs(useCarStore())
const { PostCarList } = useCarStore()
const { route ,back} = useRouterAction()
const state: {
isHave: boolean,
isHavese:string,
active: number,
opacity: number,
isShow: boolean,
info: IndexType,
id: string
} = reactive({
isHave: false,
isHavese:"#323233",
active: 0,
opacity: 0,
isShow: false,
info: {},
id: <string>route().query.id
})
onMounted(() => {
// store.increment(200)
// console.log("store: ",store.get_count);
checkIsHave()
PostCarList();
window.addEventListener("scroll", rollBackground)
getInfo()
})
onUnmounted(() => {
window.removeEventListener("scroll", rollBackground)
})
let checkIsHave = async () => {
state.isHave = (await checkCar({
waresid: state.id
})).isAddCar
console.log("state.isHave: ", state.isHave);
}
// 添加购物车
let addCarShop = async () => {
await addCar({
waresid: state.id
});
state.isHave = true
PostCarList();
showToast('添加成功');
}
let getInfo = async () => {
state.info = await info({
id: state.id
});
console.log(state.info);
}
let showBigImg = (arr: string[], index: number) => {
showImagePreview({
images: arr,
startPosition: index,
});
}
const rollBackground = () => {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
state.opacity = scrollTop / 414
if (state.opacity > 0.2) {
state.isShow = true
tabs.value.resize()
} else {
state.isShow = false
}
}
const collect =async ()=>{
let dd= await userlike({
shopid:<string><unknown>state.info.wares_id
})
state.isHavese="#cdc30d"
showToast('收藏成功');
}
</script>
<style lang="less" scoped>
@import "@page/Info.less";
</style>

View File

@@ -0,0 +1,21 @@
<template>
<div class="layout">
<RouterView v-slot="{ Component, route }">
<KeepAlive>
<component :is="Component" :key="route.name" v-if="route.meta.keepAlive" />
</KeepAlive>
<component :is="Component" :key="route.name" v-if="!route.meta.keepAlive" />
</RouterView>
<tabbar></tabbar>
</div>
</template>
<script setup lang="ts">
import includeName from '@/router/path'
import { RouterLink, RouterView } from 'vue-router'
</script>
<style></style>

View File

@@ -0,0 +1,112 @@
<template>
<page class="me" :top="0">
<div class="head">
<div class="head_div">
<img src="../../public/img/me_settin_2.png" class="head_Setup">
</div>
<div class="head_div1">
<img class="head_avatar" src="../../public/img/wxPay/useravater.png">
<div class="head_text">
编码猿Code
</div>
</div>
</div>
<ul class="metype">
<li class="metype_li" v-for=" v, index in metype" :key="index"
@click="push({ name: 'metype', query: { id: v.typeid } })">
<img class="metype_img" :src="v.typeurl">
<div class="metype_text">{{ v.typeext }}</div>
</li>
</ul>
<ul class="melist">
<li class="melist_li" v-for="v, index in melist" :key="index" @click="listmethon(v.listid)">
<img class="melist_img" :src="v.listurl">
<div class="melist_text">{{ v.listtext }}</div>
</li>
</ul>
</page>
</template>
<script setup lang="ts">
import { usermethod, userlike, useradd } from "@/serve/_";
import { setItem, isPhone } from "@/utils/index";
import { showSuccessToast, showFailToast } from 'vant';
import { useRouterAction } from "@/utils/router";
const { back, push } = useRouterAction()
import { onMounted, reactive, ref, computed, onUnmounted, getCurrentInstance } from "vue";
const metype: {
typeext: string,
typeurl: string,
typeid: number
}[] = [
{
typeext: "全部订单",
typeurl: "../../public/img/me_1.png",
typeid: -1
},
{
typeext: "待付款",
typeurl: "../../public/img/me_2.png",
typeid: 0
},
{
typeext: "代发货",
typeurl: "../../public/img/me_3.png",
typeid: 1
},
{
typeext: "待收货",
typeurl: "../../public/img/me_4.png",
typeid: 2
},
{
typeext: "退款/售后",
typeurl: "../../public/img/me_5.png",
typeid: 3
}
]
const melist: {
listurl: string,
listtext: string,
listid: number
}[] = [
{
listurl: "../../public/img/me_address.png",
listtext: "收货地址",
listid: 1
}, {
listurl: "../../public/img/me_like.png",
listtext: "我的收藏",
listid: 2
}, {
listurl: "../../public/img/me_settin_2.png",
listtext: "我的设置",
listid: 3
},
]
const listmethon = (id: number) => {
switch (id) {
case 1:
break;
case 2:
//我的收藏 改 name:
push({ name: "likes" })
break;
case 3:
break;
default:
break;
}
}
</script>
<style scoped lang="less">
@import "@page/me.less";
</style>

View File

@@ -0,0 +1,94 @@
<template>
<page class="Metype" :top="0" :bottom="0">
<van-nav-bar title="订单状态" left-text="返回" left-arrow @click-left="back()" />
<van-tabs v-model:active="wdtypeid.id" @click-tab="typemethod(wdtypeid.id)">
<van-tab v-for="v, i in typelist" :key="i" :title="v.title">
<img src="../../public/img/noLogin.png" v-if="typelist[wdtypeid.id].conster.length== null">
<div>
<van-card v-for="v, i in typelist[wdtypeid.id].conster" @click="push({ name: 'info', query: { id: v.wares_id } })" :key="i" :num="v.goods_num" :price="v.goods_price" :desc="v.wares_info" :title="v.wares_title"
:thumb="v.wares_infoimg[0]" >
<template #footer>
<div>总计:{{v.goods_totalprice }}</div>
</template>
</van-card>
</div>
</van-tab>
</van-tabs>
</page>
</template>
<script setup lang="ts">
import { useRouterAction } from "@/utils/router";
import { orderallOrder } from "@/serve/_";
import { VagueOject ,typee} from "@/types/common";
import { onMounted, ref, reactive } from "vue";
const { route,push,back } = useRouterAction()
const wdtypeid: { id: number } = reactive({ id: 0 })
const typelist: {
title: string,
id: string,
conster:any[]
}[] = reactive([{
title: "全部订单",
id: "-1",
conster: []
}, {
title: "待付款",
id: "0",
conster: []
}, {
title: "待发货",
id: "1",
conster: []
}, {
title: "待收款",
id: "2",
conster: []
}, {
title: "退款/售后",
id: "3",
conster: []
},
])
onMounted(async () => {
wdtypeid.id = Number(route().query.id) + 1
typelist[wdtypeid.id].conster= await orderallOrder({
status: (wdtypeid.id - 1).toString()
})
console.log(typelist)
})
//点击添加
const typemethod = async (id: number) => {
console.log("id", typelist[id].conster.length == 0)
if (typelist[id].conster.length == 0) {
typelist[id].conster = await orderallOrder({
status: (id - 1).toString()
})
console.log(555)
console.log(typelist)
} else {
console.log(666)
}
console.log(typelist)
}
const onClickLeft = () => {
}
console.log(route().query.id)
</script>
<style scoped lang="less" ></style>

View File

@@ -0,0 +1,118 @@
<template>
<div class="order">
<van-nav-bar fixed title="购物车" left-arrow @click-left="back()" />
<page>
<div class="order-list">
<!--代付款订单列表-->
<van-card v-for="(item, index) in state.waitPayOrderList" :num="item.goods_num" :key="index"
:price="item.wares_nowprice" :desc="item.wares_info" :title="item.wares_title"
:thumb="item.wares_masterimg && item.wares_masterimg[0]" />
<van-cell-group>
<van-cell title="配送方式" value="顺丰配送货(免运费)" />
<van-cell title="发票类型" value="电子发票" />
<van-cell title="优惠券" value="无" />
</van-cell-group>
<van-cell-group title="支付方式" v-model="select">
<van-cell title="微信支付">
<template #icon>
<img src="/img/pay_wx.png" alt="微信支付">
</template>
<template #right-icon>
<van-radio disabled></van-radio>
</template>
</van-cell>
<van-cell title="支付宝支付">
<template #icon>
<img src="/img/pay_zfb2.png" alt="支付宝支付">
</template>
<template #right-icon>
<van-radio name="1" disabled></van-radio>
</template>
</van-cell>
<van-cell title="花呗分期">
<template #icon>
<img src="/img/pay_antinstalment.png" alt="花呗分期">
</template>
<template #right-icon>
<van-radio disabled></van-radio>
</template>
</van-cell>
<van-cell title="银联支付">
<template #icon>
<img src="/img/pay_yl1.png" alt="银联支付">
</template>
<template #right-icon>
<van-radio disabled></van-radio>
</template>
</van-cell>
</van-cell-group>
</div>
<!--底部固定的付款按钮-->
<van-submit-bar :price="TotalMoney" button-text="去付款" @submit="GoPlay" />
</page>
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref, computed, onUnmounted, getCurrentInstance } from "vue";
import { useRouterAction } from "@/utils/router";
import { allOrder, buyOrder } from "@/serve/_";
import { OrderType } from "@/types/res/order";
const { back, push } = useRouterAction()
const select = ref(0)
const state: {
waitPayOrderList: OrderType[]
} = reactive({
waitPayOrderList: []
})
onMounted(() => {
getAllOrder()
})
let TotalMoney = computed(() => {
let total: number = 0
state.waitPayOrderList.forEach(v => {
total += Number(v.goods_totalprice)
})
return total * 100
})
let GoPlay = async () => {
await buyOrder({
goodsid: JSON.stringify(state.waitPayOrderList.map(v => {
return v.goods_id
}))
})
push({ name: "orderStatus" });
}
let getAllOrder = async () => {
state.waitPayOrderList = await allOrder({
status: '0'
})
console.log(state.waitPayOrderList);
}
</script>
<style lang="less" scoped>
.van-cell img {
width: 0.8rem;
margin-right: 0.26667rem;
}
</style>

View File

@@ -0,0 +1,90 @@
<template>
<page class="me" :bottom="0">
<van-nav-bar fixed title="搜索" left-arrow @click-left="back()" />
<div class="search">
<van-search v-model="state.value" show-action placeholder="请输入搜索关键词" @click="onClickButton">
<template #action>
<div @click="onSearch">搜索</div>
</template>
</van-search>
<div class="listone">
<div class="sea">热门搜索</div>
<div class="qwe" v-if="state.searchlist.length == 0">
<div class="listtui" v-for="item, index in state.tuijian" :key="index">
<div class="text" @click="onsearcha(item.text)"> {{ item.text }}</div>
</div>
</div>
<item v-else :list="state.searchlist"></item>
</div>
</div>
</page>
</template>
<script setup lang="ts">
import { onMounted, reactive, } from "vue";
import { useRouterAction } from "@/utils/router";
import { search } from "@/serve/_";
const { back, push } = useRouterAction()
import { showToast } from 'vant';
import { IndexType } from "@/types/res/home";
import { Key } from "node-rsa";
//定义变量
const state: {
value: string,//搜索框的关键字
searchlist: [] | IndexType,//接口请求到的字段
tuijian: []
} = reactive({
value: '',
searchlist: [],
tuijian: [
{ text: "华为" },
{ text: "小米" },
{ text: "iphone" },
{ text: "荣耀" },
]
})
onMounted(() => {
// console.log("搜索");
})
// 点击搜索或回车执行的方法
let onSearch = async () => {
state.searchlist = await search({
keyword: state.value
});
console.log("value", state.value);
console.log("res", state.searchlist);
}
// 点击取消执行的方法
let onClickButton = () => {
state.searchlist = []
}
let onsearcha = async (v) => {
state.searchlist = await search({
keyword: v
});
console.log("chuangaaaaaa", v);
}
</script>
<style lang="less" scoped>
@import "@page/search.less";
</style>

View File

@@ -0,0 +1,84 @@
<template>
<page class="type">
<van-nav-bar fixed title="分类" left-arrow @click-left="back()" />
<van-tree-select @click-nav="ontype" v-model:main-active-index="state.activeIndex" :items="state.items">
<template #content>
<item :list="state.indeslist"></item>
</template>
</van-tree-select>
</page>
</template>
<script setup lang="ts">
import { onMounted, reactive } from "vue";
import { useRouterAction } from "@/utils/router";
import { list } from "@/serve/_";
const { back, push } = useRouterAction()
// import { showToast } from 'vant';
import { ClassType } from "@/types/res/home";
//定义变量
interface StateItem {
id:string;
text:string
}
const state: {
activeIndex: number,//搜索框的关键字
items: StateItem[],
indeslist: ClassType[],//接口请求到的字段
typename:string
} = reactive({
activeIndex: 0,
items: [
{ id: '1', text: '小米' },
{ id: '2', text: '魅族' },
{ id: '3', text: '华为' },
{ id: '4', text: 'iphone' },
{ id: '5', text: '三星' },
{ id: '6', text: '锤子' },
{ id: '7', text: '诺基亚' },
],
indeslist: [],
typename:'小米'
})
onMounted(() => {
getlist()
})
let getlist = async () => {
state.indeslist = await list({
typename: state.typename
});
console.log("dsadadsdasdsa", state.indeslist);
}
//点击调不同的值
let ontype = async (index:number) => {
state.indeslist = await list({
typename: state.items[index].text
});
console.log("点击",state.items[index].text);
console.log("dsadadsdasdsa", state.indeslist);
}
</script>
<style lang="less" scoped>
@import "@page/type.less";
</style>

View File

@@ -0,0 +1,131 @@
<template>
<page class="user" :top="0" :bottom="0">
<div style="padding-top: 80px;width: 100%;">
<van-tabs v-model="user.index">
<van-tab title="登录">
<van-cell-group inset>
<!-- 输入任意文本 -->
<van-field v-model="user.login.loginname" :clearable="true" :maxlength="10" label-width="35px"
label="账号" />
<!-- 输入密码-->
<van-field v-model="user.login.loginpassw" :clearable="true" :maxlength="15" label-width="35px"
type="password" label="密码" />
</van-cell-group>
<div class="userbutt_div">
<van-button @click="loginmethod()" class="userbutt" round type="success">登 录</van-button>
</div>
</van-tab>
<van-tab title="注册">
<van-cell-group inset>
<!-- 输入账号-->
<van-field v-model="user.enroll.enrollname" :clearable="true" :maxlength="10" label-width="45px"
label="账号" />
<!-- 输入密码-->
<van-field v-model="user.enroll.enrollpassw" :clearable="true" :maxlength="15" label-width="45px"
type="password" label="密码" />
<van-field v-model="user.enroll.enrollphone" type="tel" :clearable="true" :maxlength="11"
label-width="45px" label="手机号" />
</van-cell-group>
<div class="userbutt_div">
<van-button @click="enrollmethod()" class="userbutt" round type="success">注 册</van-button>
</div>
</van-tab>
</van-tabs>
</div>
</page>
</template>
<script setup lang="ts">
import { usermethod, userlike, useradd } from "@/serve/_";
import { setItem, isPhone } from "@/utils/index";
import { useRouterAction } from "@/utils/router";
import { showSuccessToast, showFailToast } from 'vant';
const { back, push } = useRouterAction()
import { onMounted, reactive, ref, computed, onUnmounted, getCurrentInstance } from "vue";
const user: {
index: number,
login: {
loginname: string,
loginpassw: string
},
enroll: {
enrollname: string,
enrollpassw: string,
enrollphone: string
}
} = reactive({
index: 0,
login: {
loginname: "",
loginpassw: ""
},
enroll: {
enrollname: "",
enrollpassw: "",
enrollphone: ""
}
})
onMounted(() => {
})
//登录
let loginmethod = async () => {
if (user.login.loginname != "" && user.login.loginpassw != "") {
let res = await usermethod({
name: user.login.loginname,
pwd: user.login.loginpassw
},)
if (res.length >= 0) {
showSuccessToast('登录成功');
setItem("token", res);//添加token
push({ name: "home" })
}
}else{
showFailToast('账号或密码错误');
}
}
//注册
let enrollmethod = async () => {
let ssa = isPhone(user.enroll.enrollphone)
if (ssa == true && user.enroll.enrollname != "" && user.enroll.enrollpassw != "") {
let ress = await useradd({
name: user.enroll.enrollname,
pwd: user.enroll.enrollpassw,
phone: (user.enroll.enrollphone).toString()
},)//用户注册
let res = await usermethod({
name: user.enroll.enrollname,
pwd: user.enroll.enrollpassw
},)
//跳到首页
showSuccessToast('注册成功');
setItem("token", res);//添加token
push({ name: "home" })
}else{
showFailToast('手机号或账号密码错误');
}
}
</script>
<style scoped lang="less">
@import "@page/user.less";
</style>

View File

@@ -0,0 +1,48 @@
<template>
<div class="classlist">
<van-nav-bar fixed title="分类" left-arrow @click-left="back()" />
<page class="classlist" >
<item :list="state.classlist"></item>
</page>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, reactive } from "vue";
import { useRouterAction } from "@/utils/router";
import { activity } from "@/serve/_";
const { back, push } = useRouterAction()
import { IndexType } from "@/types/res/home";
const { route } = useRouterAction()
//定义变量
const state: {
value: string,//搜索框的关键字
classlist: [] | IndexType,//接口请求到的字段
} = reactive({
value: '',
classlist: []
})
onMounted(async () => {
getactivity()
console.log(route().query.id)
})
let getactivity = async () => {
state.classlist = await activity({
id: String(route().query.id)
});
console.log('请求到的接口数据', state.classlist);
}
</script>
<style scoped lang="less">
@import "@page/me.less";
</style>

View File

@@ -0,0 +1,57 @@
<template>
<page class="like" :top="46" :bottom="0">
<van-nav-bar fixed title="我的收藏" left-arrow @click-left="back()" />
<div class="likes">
<!-- <div v-if="state.likeList!=null">没有数据</div> -->
<item :list="state.likeList"></item>
</div>
</page>
</template>
<script setup lang="ts">
import { onMounted, reactive, } from "vue";
import { useRouterAction } from "@/utils/router";
import { likeList } from "@/serve/_";
const { back, push } = useRouterAction()
// import { showToast } from 'vant';
import { IndexType } from "@/types/res/likes";
//定义变量
const state: {
value: string,//搜索框的关键字
likeList: [] | IndexType,//接口请求到的字段
} = reactive({
value: '',
likeList: []
})
onMounted(() => {
getlikeList()
// console.log("搜索");
})
// 点击搜索或回车执行的方法
let getlikeList = async () => {
state.likeList = await likeList({
// keyword: state.value
});
console.log("res", state.likeList);
}
// 点击取消执行的方法
let onCancel = () => {
console.log("value", "取消");
}
</script>
<style lang="less" scoped>@import "@page/search.less";</style>

View File

@@ -0,0 +1,17 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": [
"src/**/*",
"src/**/*.vue"
],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"types": ["vite/client"],
"verbatimModuleSyntax": false,
"composite": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}

View File

@@ -0,0 +1,11 @@
{
"files": [],
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "./tsconfig.app.json"
}
]
}

View File

@@ -0,0 +1,15 @@
{
"extends": "@tsconfig/node18/tsconfig.json",
"include": [
"vite.config.*",
"vitest.config.*",
"cypress.config.*",
"nightwatch.conf.*",
"playwright.config.*"
],
"compilerOptions": {
"composite": true,
"module": "ESNext",
"types": ["node"]
}
}

Some files were not shown because too many files have changed in this diff Show More