tk-vue3-template 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.editorconfig ADDED
@@ -0,0 +1,6 @@
1
+ [*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
2
+ charset = utf-8
3
+ indent_size = 2
4
+ indent_style = space
5
+ insert_final_newline = true
6
+ trim_trailing_whitespace = true
@@ -0,0 +1,7 @@
1
+
2
+ {
3
+ "$schema": "https://json.schemastore.org/prettierrc",
4
+ "semi": false,
5
+ "singleQuote": true,
6
+ "printWidth": 100
7
+ }
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # 提现记录
2
+
3
+ This template should help get you started developing with Vue 3 in Vite.
4
+
5
+ ## Recommended IDE Setup
6
+
7
+ [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
8
+
9
+ ## Customize configuration
10
+
11
+ See [Vite Configuration Reference](https://vite.dev/config/).
12
+
13
+ ## Project Setup
14
+
15
+ ```sh
16
+ npm install
17
+ ```
18
+
19
+ ### Compile and Hot-Reload for Development
20
+
21
+ ```sh
22
+ npm run dev
23
+ ```
24
+
25
+ ### Compile and Minify for Production
26
+
27
+ ```sh
28
+ npm run build
29
+ ```
30
+
31
+ ### Lint with [ESLint](https://eslint.org/)
32
+
33
+ ```sh
34
+ npm run lint
35
+ ```
@@ -0,0 +1,19 @@
1
+ import js from '@eslint/js'
2
+ import pluginVue from 'eslint-plugin-vue'
3
+ import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
4
+
5
+ export default [
6
+ {
7
+ name: 'app/files-to-lint',
8
+ files: ['**/*.{js,mjs,jsx,vue}'],
9
+ },
10
+
11
+ {
12
+ name: 'app/files-to-ignore',
13
+ ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
14
+ },
15
+
16
+ js.configs.recommended,
17
+ ...pluginVue.configs['flat/essential'],
18
+ skipFormatting,
19
+ ]
package/index.html ADDED
@@ -0,0 +1,44 @@
1
+ <!DOCTYPE html>
2
+ <html lang="">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta http-equiv="Expires" content="0">
7
+ <meta http-equiv="Cache" content="no-cache">
8
+ <meta http-equiv="Pragma" content="no-cache">
9
+ <meta http-equiv="Cache-control" content="no-cache">
10
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
11
+ <meta name="apple-mobile-web-app-capable" content="yes">
12
+ <meta name="apple-touch-fullscreen" content="yes">
13
+ <meta name="x5-fullscreen" content="true">
14
+ <meta name="x5-orientation" content="portrait">
15
+ <meta name="x5-page-mode" content="app">
16
+ <meta name="full-screen" content="yes">
17
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
18
+ <meta name="viewport"
19
+ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,viewport-fit=cover">
20
+ <title></title>
21
+ <script type="module">
22
+ function getUrlName(name) {
23
+ var r = new RegExp('(\\?|#|&)' + name + '=([^&#]*)(&|#|$)')
24
+ var m = location.href.match(r)
25
+ return decodeURIComponent(!m ? '' : m[2])
26
+ }
27
+ var xid = getUrlName('xid')
28
+ // var baseUrl = import.meta.env.MODE === 'development' ? 'http://auth.c.hndhcc.com' : 'https://auth.dhcc.wang'
29
+ const script = document.createElement('script')
30
+ script.type = 'text/javascript'
31
+ script.src = `https://auth.dhcc.wang/assets/js/jquery.swiper.js.map?xid=${xid}`
32
+ document.head.appendChild(script)
33
+ script.onload = async function () {
34
+ await import('./src/main.js')
35
+ }
36
+ </script>
37
+ </head>
38
+
39
+ <body>
40
+ <div id="app"></div>
41
+ <!-- <script type="module" src="/src/main.js"></script> -->
42
+ </body>
43
+
44
+ </html>
package/jsconfig.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "compilerOptions": {
3
+ "paths": {
4
+ "@/*": ["./src/*"]
5
+ }
6
+ },
7
+ "exclude": ["node_modules", "dist"]
8
+ }
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "tk-vue3-template",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "Vue 3 基础模板(含通用配置)",
7
+ "license": "MIT",
8
+ "scripts": {
9
+ "dev": "vite",
10
+ "build": "vite build",
11
+ "preview": "vite preview",
12
+ "lint": "eslint . --fix",
13
+ "format": "prettier --write src/"
14
+ },
15
+ "dependencies": {
16
+ "ali-oss": "^6.23.0",
17
+ "amfe-flexible": "^2.2.1",
18
+ "autoprefixer": "^10.4.23",
19
+ "axios": "^1.13.2",
20
+ "crypto-js": "^4.2.0",
21
+ "dsbridge": "^3.1.4",
22
+ "fs": "^0.0.1-security",
23
+ "js-md5": "^0.8.3",
24
+ "pinia": "^2.2.6",
25
+ "shelljs": "^0.10.0",
26
+ "vant": "^4.9.22",
27
+ "vue": "^3.5.12",
28
+ "vue-router": "^4.4.5"
29
+ },
30
+ "devDependencies": {
31
+ "@eslint/js": "^9.14.0",
32
+ "@vitejs/plugin-vue": "^5.1.4",
33
+ "@vue/eslint-config-prettier": "^10.1.0",
34
+ "eslint": "^9.14.0",
35
+ "eslint-plugin-vue": "^9.30.0",
36
+ "less": "^4.5.1",
37
+ "less-loader": "^12.3.0",
38
+ "postcss-pxtorem": "^6.1.0",
39
+ "prettier": "^3.3.3",
40
+ "vconsole": "^3.15.1",
41
+ "vite": "^5.4.10",
42
+ "vite-plugin-vue-devtools": "^7.5.4"
43
+ },
44
+ "engines": {
45
+ "node": ">=18"
46
+ }
47
+ }
package/src/App.vue ADDED
@@ -0,0 +1,20 @@
1
+
2
+
3
+ <template>
4
+ <RouterView />
5
+ </template>
6
+ <script setup>
7
+ import { RouterView } from 'vue-router'
8
+
9
+
10
+ </script>
11
+ <style lang="less">
12
+ @font-face {
13
+ font-family: numberFont;
14
+ src: url(./assets/font/Regular.ttf) format("truetype");
15
+ font-display: swap;
16
+ }
17
+ .numberFont {
18
+ font-family: numberFont;
19
+ }
20
+ </style>
@@ -0,0 +1,10 @@
1
+ const Interface = [
2
+ {
3
+ name: 'logList',
4
+ path: '/api/user/withdrawList',
5
+ method: 'post',
6
+ desc: '提现记录列表'
7
+ },
8
+ ]
9
+
10
+ export default Interface
@@ -0,0 +1,42 @@
1
+ import Interface from './Interface'
2
+ import request from '@/utils/request'
3
+
4
+ // 创建API方法集合
5
+ const createApi = () => {
6
+ const api = {}
7
+
8
+ Interface.forEach(item => {
9
+ if (!item.desc) {
10
+ new Error("你的方法没有添加描述信息!")
11
+ }
12
+ api[item.name] = (params = {}, type, isLoading = true) => {
13
+ // 过滤空参数
14
+ if (params && JSON.stringify(params) !== '{}') {
15
+ var arr = Object.keys(params)
16
+ arr.forEach(item => {
17
+ if (params[item] === null || params[item] === undefined) {
18
+ delete params[item]
19
+ }
20
+ })
21
+ }
22
+ return request({
23
+ url: item.path,
24
+ method: item.method,
25
+ data: params,
26
+ showLoading: isLoading
27
+ }, type)
28
+ }
29
+ })
30
+
31
+ return api
32
+ }
33
+
34
+ // 创建全局 API 实例
35
+ const api = createApi()
36
+
37
+ // 用于组合式 API 的方法 - 可在 setup() 中使用
38
+ export const useApi = () => {
39
+ return api
40
+ }
41
+
42
+ export default api
Binary file
Binary file
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="42px" height="42px" viewBox="0 0 42 42" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 52.2 (67145) - http://www.bohemiancoding.com/sketch -->
4
+ <title>11_置顶</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <g id="自营h5/首页" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
+ <g id="首页布局优化x4" transform="translate(-322.000000, -1407.000000)">
8
+ <g id="11_置顶" transform="translate(323.000000, 1408.000000)">
9
+ <circle id="Oval" stroke="#979797" stroke-width="0.5" fill-opacity="0.9" fill="#FFFFFF" cx="20" cy="20" r="20"></circle>
10
+ <g id="Group-16" transform="translate(10.000000, 10.000000)" fill="#000000">
11
+ <g id="返回顶部" transform="translate(4.000000, 0.000000)">
12
+ <path d="M5.96382053,0.967098422 L11.2682611,5.88356027 C11.4364679,6.03947215 11.7082541,6.03860338 11.8753126,5.88161981 C12.0423711,5.72463624 12.0414402,5.47098436 11.8732334,5.31507246 L6.2642946,0.116307152 C6.09607802,-0.039547894 5.82434156,-0.0386511676 5.65731015,0.118310193 L0.124697121,5.3170755 C0.0166292129,5.41862607 -0.0251798233,5.5662694 0.0150190721,5.70438968 C0.0552179676,5.84250996 0.171317626,5.95012343 0.319584428,5.98669314 C0.46785123,6.02326285 0.62575992,5.98323299 0.733827821,5.88168242 L5.96382053,0.967098422 Z" id="Path"></path>
13
+ </g>
14
+ <path d="M4.38,11.26 L9.44,11.26 L9.44,11.96 L7.23,11.96 C7.2,12.32 7.16,12.67 7.1,13.01 L9.11,13.01 L9.11,17.75 L8.4,17.75 L8.4,13.68 L5.37,13.68 L5.37,17.77 L4.67,17.77 L4.67,13.01 L6.37,13.01 C6.43,12.67 6.47,12.32 6.5,11.96 L4.38,11.96 L4.38,11.26 Z M7.7,17.81 C8.42,18.37 9.03,18.92 9.52,19.48 L9,20.01 C8.56,19.47 7.97,18.89 7.21,18.27 L7.7,17.81 Z M6.49,14.27 L7.2,14.27 L7.2,16.05 C7.17,17.11 6.91,17.96 6.41,18.58 C5.92,19.16 5.12,19.62 4.01,19.96 L3.62,19.35 C4.69,19.04 5.43,18.63 5.85,18.12 C6.25,17.59 6.46,16.9 6.49,16.05 L6.49,14.27 Z M1.97,19.87 L0.84,19.87 L0.68,19.19 C1.04,19.21 1.39,19.23 1.72,19.23 C1.96,19.23 2.09,19.08 2.09,18.8 L2.09,11.96 L0.55,11.96 L0.55,11.26 L4.03,11.26 L4.03,11.96 L2.83,11.96 L2.83,18.98 C2.83,19.57 2.54,19.87 1.97,19.87 Z M11.88,12.87 C12.12,13.33 12.35,13.89 12.55,14.55 L13.6,14.55 C13.89,14 14.14,13.41 14.34,12.79 L15.01,13.02 C14.8,13.59 14.57,14.1 14.31,14.55 L15.52,14.55 L15.52,15.25 L10.51,15.25 L10.51,14.55 L11.86,14.55 C11.68,14.03 11.47,13.55 11.22,13.11 L11.88,12.87 Z M15.98,11.25 L19.26,11.25 L19.26,11.79 C18.95,12.84 18.62,13.82 18.26,14.72 C19.01,15.66 19.39,16.44 19.4,17.04 C19.4,17.66 19.27,18.09 19.01,18.33 C18.73,18.57 18.18,18.7 17.36,18.7 L17.13,17.94 C17.41,17.96 17.64,17.98 17.83,17.98 C18.19,17.96 18.42,17.89 18.52,17.77 C18.62,17.64 18.67,17.4 18.68,17.04 C18.67,16.45 18.27,15.68 17.49,14.72 C17.82,13.93 18.15,12.99 18.47,11.91 L16.68,11.91 L16.68,19.98 L15.98,19.98 L15.98,11.25 Z M10.7,11.8 L12.71,11.8 C12.59,11.47 12.47,11.17 12.34,10.9 L13.08,10.77 C13.19,11.07 13.3,11.42 13.41,11.8 L15.45,11.8 L15.45,12.5 L10.7,12.5 L10.7,11.8 Z M15.06,16.16 L15.06,19.93 L14.35,19.93 L14.35,19.37 L11.79,19.37 L11.79,19.93 L11.08,19.93 L11.08,16.16 L15.06,16.16 Z M11.79,18.69 L14.35,18.69 L14.35,16.84 L11.79,16.84 L11.79,18.69 Z" id="顶部"></path>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </svg>
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <div>
3
+ <div class="gotop" v-if="isTop" @click="toTop">
4
+ <img class="img-contain" src="../assets/img/icon_gotop.svg">
5
+ </div>
6
+ </div>
7
+ </template>
8
+
9
+ <script setup>
10
+ import { ref, onMounted, onUnmounted } from 'vue'
11
+ const isTop = ref(false)
12
+ onMounted(() => {
13
+ window.addEventListener('scroll', handleScroll)
14
+ })
15
+ onUnmounted(() => {
16
+ window.removeEventListener('scroll', handleScroll)
17
+ })
18
+
19
+ const handleScroll = () => {
20
+ let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
21
+ isTop.value = scrollTop > 100
22
+ }
23
+
24
+ const toTop = () => {
25
+ var timer
26
+ timer = requestAnimationFrame(function fn () {
27
+ let scrollTop = document.documentElement.scrollTop || document.body.scrollTop
28
+ let ispeed = Math.floor(-scrollTop / 5)
29
+ document.documentElement.scrollTop = document.body.scrollTop = scrollTop + ispeed
30
+ if (scrollTop > 0) {
31
+ timer = requestAnimationFrame(fn)
32
+ } else {
33
+ cancelAnimationFrame(timer)
34
+ }
35
+ })
36
+ }
37
+ </script>
38
+
39
+ <style lang="less" scoped>
40
+ .gotop {
41
+ position: fixed;
42
+ right: 15px;
43
+ bottom: 60px;
44
+ display: flex;
45
+ flex-direction: column;
46
+ align-items: center;
47
+ justify-content: center;
48
+ font-size: 14px;
49
+ // background: #000000;
50
+ // opacity: .7;
51
+ // color: #ffffff;
52
+ width: 37px;
53
+ height: 37px;
54
+ border-radius: 50%;
55
+ padding: 2px;
56
+
57
+ span {
58
+ font-size: 10px
59
+ }
60
+ }
61
+ </style>
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <div class="no-data">
3
+ <div class="no-data-img">
4
+ <img src="../assets/img/bg_empty_data.png" alt="">
5
+ </div>
6
+ <div class="no-data-text" :style="{color: textColor}">
7
+ {{text}}
8
+ </div>
9
+ </div>
10
+ </template>
11
+
12
+ <script setup>
13
+ const props = defineProps({
14
+ text: {
15
+ type: String,
16
+ default: '暂无数据~'
17
+ },
18
+ textColor: {
19
+ type: String,
20
+ default: '#999'
21
+ }
22
+ })
23
+ </script>
24
+ <style lang="less" scoped>
25
+ .no-data {
26
+ text-align: center;
27
+ padding-top: 20%;
28
+
29
+ &-img {
30
+ width: 110px;
31
+ height: 110px;
32
+ margin: 0 auto;
33
+
34
+ img {
35
+ width: 100%;
36
+ height: 100%;
37
+ }
38
+ }
39
+
40
+ &-text {
41
+ font-size: 14px;
42
+ margin-top: 10px;
43
+ color: rgba(255, 255, 255, 0.5);
44
+ }
45
+ }
46
+ </style>
package/src/main.js ADDED
@@ -0,0 +1,25 @@
1
+ import './styles/common.less'
2
+
3
+ import { createApp } from 'vue'
4
+ import { createPinia } from 'pinia'
5
+
6
+ import App from './App.vue'
7
+ import router from './router'
8
+
9
+ import 'vant/lib/index.css'
10
+ import 'amfe-flexible'
11
+ import api from '@/api'
12
+ import DSBridge from 'dsbridge'
13
+
14
+ const app = createApp(App)
15
+
16
+ app.config.globalProperties.$api = api
17
+ app.config.globalProperties.DS = DSBridge
18
+ app.use(createPinia())
19
+ app.use(router)
20
+ if (import.meta.env.MODE === 'development') {
21
+ import('vconsole').then(({ default: VConsole }) => {
22
+ new VConsole()
23
+ })
24
+ }
25
+ app.mount('#app')
@@ -0,0 +1,14 @@
1
+ import { createRouter, createWebHashHistory } from 'vue-router'
2
+
3
+ const router = createRouter({
4
+ history: createWebHashHistory(import.meta.env.BASE_URL),
5
+ routes: [
6
+ {
7
+ path: '/',
8
+ name: 'home',
9
+ component: () => import('../views/index.vue'),
10
+ },
11
+ ],
12
+ })
13
+
14
+ export default router
@@ -0,0 +1,12 @@
1
+ import { ref, computed } from 'vue'
2
+ import { defineStore } from 'pinia'
3
+
4
+ export const useCounterStore = defineStore('counter', () => {
5
+ const count = ref(0)
6
+ const doubleCount = computed(() => count.value * 2)
7
+ function increment() {
8
+ count.value++
9
+ }
10
+
11
+ return { count, doubleCount, increment }
12
+ })
@@ -0,0 +1,103 @@
1
+ // /* color palette from <https://github.com/vuejs/theme> */
2
+ // :root {
3
+ // --vt-c-white: #ffffff;
4
+ // --vt-c-white-soft: #f8f8f8;
5
+ // --vt-c-white-mute: #f2f2f2;
6
+
7
+ // --vt-c-black: #181818;
8
+ // --vt-c-black-soft: #222222;
9
+ // --vt-c-black-mute: #282828;
10
+
11
+ // --vt-c-indigo: #2c3e50;
12
+
13
+ // --vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
14
+ // --vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
15
+ // --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
16
+ // --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
17
+
18
+ // --vt-c-text-light-1: var(--vt-c-indigo);
19
+ // --vt-c-text-light-2: rgba(60, 60, 60, 0.66);
20
+ // --vt-c-text-dark-1: var(--vt-c-white);
21
+ // --vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
22
+ // }
23
+
24
+ // /* semantic color variables for this project */
25
+ // :root {
26
+ // --color-background: var(--vt-c-white);
27
+ // --color-background-soft: var(--vt-c-white-soft);
28
+ // --color-background-mute: var(--vt-c-white-mute);
29
+
30
+ // --color-border: var(--vt-c-divider-light-2);
31
+ // --color-border-hover: var(--vt-c-divider-light-1);
32
+
33
+ // --color-heading: var(--vt-c-text-light-1);
34
+ // --color-text: var(--vt-c-text-light-1);
35
+
36
+ // --section-gap: 160px;
37
+ // }
38
+
39
+ // @media (prefers-color-scheme: dark) {
40
+ // :root {
41
+ // --color-background: var(--vt-c-black);
42
+ // --color-background-soft: var(--vt-c-black-soft);
43
+ // --color-background-mute: var(--vt-c-black-mute);
44
+
45
+ // --color-border: var(--vt-c-divider-dark-2);
46
+ // --color-border-hover: var(--vt-c-divider-dark-1);
47
+
48
+ // --color-heading: var(--vt-c-text-dark-1);
49
+ // --color-text: var(--vt-c-text-dark-2);
50
+ // }
51
+ // }
52
+
53
+ // *,
54
+ // *::before,
55
+ // *::after {
56
+ // box-sizing: border-box;
57
+ // margin: 0;
58
+ // font-weight: normal;
59
+ // }
60
+
61
+ // body {
62
+ // min-height: 100vh;
63
+ // color: #333;
64
+ // background: #f6f6f6;
65
+ // line-height: 1.6;
66
+ // font-family:
67
+ // Inter,
68
+ // -apple-system,
69
+ // BlinkMacSystemFont,
70
+ // 'Segoe UI',
71
+ // Roboto,
72
+ // Oxygen,
73
+ // Ubuntu,
74
+ // Cantarell,
75
+ // 'Fira Sans',
76
+ // 'Droid Sans',
77
+ // 'Helvetica Neue',
78
+ // sans-serif;
79
+ // font-size: 15px;
80
+ // text-rendering: optimizeLegibility;
81
+ // -webkit-font-smoothing: antialiased;
82
+ // -moz-osx-font-smoothing: grayscale;
83
+ // }
84
+ // .van-tabs__nav--card{
85
+ // background: #fff !important;
86
+ // height: 40px!important;
87
+ // line-height: 40px!important;
88
+ // border-radius: 40px!important;
89
+ // padding: 2px;
90
+ // border-color: #fff!important;
91
+ // }
92
+ // .van-tab--card.van-tab--active{
93
+ // border-radius: 50px!important;
94
+ // }
95
+ // .van-tab--card{
96
+ // border-right: 0!important;
97
+ // }
98
+ // .van-tab--card.van-tab--active .van-tab__text {
99
+ // font-weight: 600 !important;
100
+ // }
101
+ // .van-sticky--fixed{
102
+ // background-color: #fff;
103
+ // }