feat(custom): 大转盘第一版
This commit is contained in:
@@ -6,21 +6,6 @@ import { argv } from "yargs";
|
|||||||
|
|
||||||
const { robot = 1, desc } = argv;
|
const { robot = 1, desc } = argv;
|
||||||
|
|
||||||
const CIPluginOptFn = async () => {
|
|
||||||
/**
|
|
||||||
* @typedef { import("@tarojs/plugin-mini-ci").CIOptions } CIOptions
|
|
||||||
* @type {CIOptions}
|
|
||||||
*/
|
|
||||||
return {
|
|
||||||
weapp: {
|
|
||||||
appid: process.env.TARO_APP_ID,
|
|
||||||
privateKeyPath: process.env.TARO_APP_KEY,
|
|
||||||
robot,
|
|
||||||
},
|
|
||||||
desc,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
projectName: "taroApp",
|
projectName: "taroApp",
|
||||||
date: "2023-8-13",
|
date: "2023-8-13",
|
||||||
@@ -38,7 +23,26 @@ const config = {
|
|||||||
},
|
},
|
||||||
sourceRoot: "src",
|
sourceRoot: "src",
|
||||||
outputRoot: "dist",
|
outputRoot: "dist",
|
||||||
plugins: ["@tarojs/plugin-html", ["@tarojs/plugin-mini-ci", CIPluginOptFn]],
|
plugins: [
|
||||||
|
"@tarojs/plugin-html",
|
||||||
|
[
|
||||||
|
"@tarojs/plugin-mini-ci",
|
||||||
|
() => {
|
||||||
|
/**
|
||||||
|
* @typedef { import("@tarojs/plugin-mini-ci").CIOptions } CIOptions
|
||||||
|
* @type {CIOptions}
|
||||||
|
*/
|
||||||
|
return {
|
||||||
|
weapp: {
|
||||||
|
appid: process.env.TARO_APP_ID,
|
||||||
|
privateKeyPath: process.env.TARO_APP_KEY,
|
||||||
|
robot,
|
||||||
|
},
|
||||||
|
desc,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
defineConstants: {},
|
defineConstants: {},
|
||||||
copy: {
|
copy: {
|
||||||
patterns: [],
|
patterns: [],
|
||||||
|
|||||||
226
package.json
226
package.json
@@ -1,115 +1,115 @@
|
|||||||
{
|
{
|
||||||
"name": "jdt-user",
|
"name": "jdt-user",
|
||||||
"version": "3.0.10",
|
"version": "3.0.10",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "",
|
"description": "",
|
||||||
"templateInfo": {
|
"templateInfo": {
|
||||||
"name": "jdt-user",
|
"name": "jdt-user",
|
||||||
"typescript": true,
|
"typescript": true,
|
||||||
"css": "sass"
|
"css": "sass"
|
||||||
},
|
},
|
||||||
"taroConfig": {
|
"taroConfig": {
|
||||||
"version": "3.0.10"
|
"version": "3.0.10"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:weapp": "taro build --type weapp",
|
"build:weapp": "taro build --type weapp",
|
||||||
"build:test": "taro build --type weapp --mode test",
|
"build:test": "taro build --type weapp --mode test",
|
||||||
"build:swan": "taro build --type swan",
|
"build:swan": "taro build --type swan",
|
||||||
"build:alipay": "taro build --type alipay",
|
"build:alipay": "taro build --type alipay",
|
||||||
"build:tt": "taro build --type tt",
|
"build:tt": "taro build --type tt",
|
||||||
"build:h5": "taro build --type h5",
|
"build:h5": "taro build --type h5",
|
||||||
"build:rn": "taro build --type rn",
|
"build:rn": "taro build --type rn",
|
||||||
"build:qq": "taro build --type qq",
|
"build:qq": "taro build --type qq",
|
||||||
"build:jd": "taro build --type jd",
|
"build:jd": "taro build --type jd",
|
||||||
"build:quickapp": "taro build --type quickapp",
|
"build:quickapp": "taro build --type quickapp",
|
||||||
"dev:weapp": "taro build --type weapp --watch",
|
"dev:weapp": "taro build --type weapp --watch",
|
||||||
"dev:swan": "npm run build:swan -- --watch",
|
"dev:swan": "npm run build:swan -- --watch",
|
||||||
"dev:alipay": "npm run build:alipay -- --watch",
|
"dev:alipay": "npm run build:alipay -- --watch",
|
||||||
"dev:tt": "npm run build:tt -- --watch",
|
"dev:tt": "npm run build:tt -- --watch",
|
||||||
"dev:h5": "npm run build:h5 -- --watch",
|
"dev:h5": "npm run build:h5 -- --watch",
|
||||||
"dev:rn": "npm run build:rn -- --watch",
|
"dev:rn": "npm run build:rn -- --watch",
|
||||||
"dev:qq": "npm run build:qq -- --watch",
|
"dev:qq": "npm run build:qq -- --watch",
|
||||||
"dev:jd": "npm run build:jd -- --watch",
|
"dev:jd": "npm run build:jd -- --watch",
|
||||||
"dev:quickapp": "npm run build:quickapp -- --watch",
|
"dev:quickapp": "npm run build:quickapp -- --watch",
|
||||||
"lint": "eslint --ext .ts,.vue .",
|
"lint": "eslint --ext .ts,.vue .",
|
||||||
"lint:fix": "eslint --fix --ext .ts,.vue .",
|
"lint:fix": "eslint --fix --ext .ts,.vue .",
|
||||||
"lint:staged": "lint-staged",
|
"lint:staged": "lint-staged",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"cz": "cz",
|
"cz": "cz",
|
||||||
"lf": "npx prettier --write --end-of-line lf .",
|
"lf": "npx prettier --write --end-of-line lf .",
|
||||||
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
|
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
|
||||||
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
|
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"last 3 versions",
|
"last 3 versions",
|
||||||
"Android >= 4.1",
|
"Android >= 4.1",
|
||||||
"ios >= 8"
|
"ios >= 8"
|
||||||
],
|
],
|
||||||
"author": "",
|
"author": "",
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.{ts,vue}": [
|
"*.{ts,vue}": [
|
||||||
"eslint --ext .ts,.vue .",
|
"eslint --ext .ts,.vue .",
|
||||||
"npx prettier --write --end-of-line lf ."
|
"npx prettier --write --end-of-line lf ."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"commitizen": {
|
"commitizen": {
|
||||||
"path": "node_modules/cz-customizable"
|
"path": "node_modules/cz-customizable"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.23.5",
|
"@babel/runtime": "^7.23.5",
|
||||||
"@nutui/icons-vue-taro": "^0.0.9",
|
"@nutui/icons-vue-taro": "^0.0.9",
|
||||||
"@nutui/nutui-taro": "^4.2.4",
|
"@nutui/nutui-taro": "^4.2.7",
|
||||||
"@qiun/vue-ucharts": "2.5.0-20230101",
|
"@qiun/vue-ucharts": "2.5.0-20230101",
|
||||||
"@tarojs/components": "3.6.20",
|
"@tarojs/components": "3.6.22",
|
||||||
"@tarojs/helper": "3.6.20",
|
"@tarojs/helper": "3.6.22",
|
||||||
"@tarojs/plugin-framework-vue3": "3.6.20",
|
"@tarojs/plugin-framework-vue3": "3.6.22",
|
||||||
"@tarojs/plugin-html": "3.6.20",
|
"@tarojs/plugin-html": "3.6.22",
|
||||||
"@tarojs/plugin-platform-alipay": "3.6.20",
|
"@tarojs/plugin-platform-alipay": "3.6.22",
|
||||||
"@tarojs/plugin-platform-h5": "3.6.20",
|
"@tarojs/plugin-platform-h5": "3.6.22",
|
||||||
"@tarojs/plugin-platform-jd": "3.6.20",
|
"@tarojs/plugin-platform-jd": "3.6.22",
|
||||||
"@tarojs/plugin-platform-qq": "3.6.20",
|
"@tarojs/plugin-platform-qq": "3.6.22",
|
||||||
"@tarojs/plugin-platform-swan": "3.6.20",
|
"@tarojs/plugin-platform-swan": "3.6.22",
|
||||||
"@tarojs/plugin-platform-tt": "3.6.20",
|
"@tarojs/plugin-platform-tt": "3.6.22",
|
||||||
"@tarojs/plugin-platform-weapp": "3.6.20",
|
"@tarojs/plugin-platform-weapp": "3.6.22",
|
||||||
"@tarojs/runtime": "3.6.20",
|
"@tarojs/runtime": "3.6.22",
|
||||||
"@tarojs/shared": "3.6.20",
|
"@tarojs/shared": "3.6.22",
|
||||||
"@tarojs/taro": "3.6.20",
|
"@tarojs/taro": "3.6.22",
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"pinia": "^2.1.7",
|
"pinia": "^2.1.7",
|
||||||
"vue": "^3.3.9"
|
"vue": "^3.3.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.23.5",
|
"@babel/core": "^7.23.5",
|
||||||
"@commitlint/cli": "^18.4.3",
|
"@commitlint/cli": "^18.4.3",
|
||||||
"@commitlint/config-conventional": "^18.4.3",
|
"@commitlint/config-conventional": "^18.4.3",
|
||||||
"@tarojs/cli": "3.6.20",
|
"@tarojs/cli": "3.6.22",
|
||||||
"@tarojs/plugin-mini-ci": "3.6.20",
|
"@tarojs/plugin-mini-ci": "3.6.22",
|
||||||
"@tarojs/taro-loader": "3.6.20",
|
"@tarojs/taro-loader": "3.6.22",
|
||||||
"@tarojs/webpack5-runner": "3.6.20",
|
"@tarojs/webpack5-runner": "3.6.22",
|
||||||
"@types/node": "^18.19.1",
|
"@types/node": "^18.19.1",
|
||||||
"@types/webpack-env": "^1.18.4",
|
"@types/webpack-env": "^1.18.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
||||||
"@typescript-eslint/parser": "^6.13.1",
|
"@typescript-eslint/parser": "^6.13.1",
|
||||||
"@vue/babel-plugin-jsx": "^1.1.5",
|
"@vue/babel-plugin-jsx": "^1.1.5",
|
||||||
"@vue/compiler-sfc": "^3.3.9",
|
"@vue/compiler-sfc": "^3.3.9",
|
||||||
"babel-preset-taro": "3.6.20",
|
"babel-preset-taro": "3.6.22",
|
||||||
"commitizen": "^4.3.0",
|
"commitizen": "^4.3.0",
|
||||||
"css-loader": "3.4.2",
|
"css-loader": "3.4.2",
|
||||||
"cz-customizable": "^7.0.0",
|
"cz-customizable": "^7.0.0",
|
||||||
"eslint": "^8.55.0",
|
"eslint": "^8.55.0",
|
||||||
"eslint-config-taro": "3.6.20",
|
"eslint-config-taro": "3.6.22",
|
||||||
"eslint-plugin-vue": "^9.19.2",
|
"eslint-plugin-vue": "^9.19.2",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"lint-staged": "^15.1.0",
|
"lint-staged": "^15.1.0",
|
||||||
"style-loader": "1.3.0",
|
"style-loader": "1.3.0",
|
||||||
"stylelint": "9.3.0",
|
"stylelint": "9.3.0",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typescript": "^4.9.5",
|
"typescript": "^4.9.5",
|
||||||
"unplugin-vue-components": "^0.23.0",
|
"unplugin-vue-components": "^0.23.0",
|
||||||
"vue-loader": "^17.3.1",
|
"vue-loader": "^17.3.1",
|
||||||
"webpack": "^5.89.0"
|
"webpack": "^5.89.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
18026
pnpm-lock.yaml
generated
18026
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@
|
|||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from "@tarojs/taro";
|
||||||
import { userSign } from "@/api/user";
|
import { userSign } from "@/api/user";
|
||||||
|
import { debounce } from "@/utils";
|
||||||
|
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
|
|
||||||
@@ -32,7 +33,7 @@ const toSign = async () => {
|
|||||||
:close-on-click-overlay="false"
|
:close-on-click-overlay="false"
|
||||||
>
|
>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view @click.stop="toSign">
|
<view @click.stop="debounce(toSign)">
|
||||||
<image class="image" src="../static/index/poppBg.png" />
|
<image class="image" src="../static/index/poppBg.png" />
|
||||||
</view>
|
</view>
|
||||||
<view @click.stop="show = false">
|
<view @click.stop="show = false">
|
||||||
|
|||||||
@@ -53,3 +53,44 @@ export function parseQueryString(url: string) {
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param rdix 随机因子
|
||||||
|
* @param length 取的长度
|
||||||
|
* @param isAddStr 是否限制随机结果中的长度,不允许输出长度
|
||||||
|
* @returns String
|
||||||
|
*/
|
||||||
|
export function getUid(rdix = 1, length = 12, isAddStr = false) {
|
||||||
|
return Math.floor(
|
||||||
|
Math.random() * rdix * Math.floor(Math.random() * Date.now())
|
||||||
|
)
|
||||||
|
.toString(isAddStr ? 16 : 10)
|
||||||
|
.substring(0, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
防抖
|
||||||
|
防抖原理:在一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
|
||||||
|
@param {Function} func 要执行的回调函数
|
||||||
|
@param {Number} wait 延迟的时间
|
||||||
|
@param{Boolean} immediate 是否要立即执行
|
||||||
|
*/
|
||||||
|
var timeout: any = getUid(1);
|
||||||
|
export function debounce(func: Function, wait = 500, immediate = false) {
|
||||||
|
// 清除定时器
|
||||||
|
if (timeout !== null) clearTimeout(timeout);
|
||||||
|
// 立即执行,此类情况一般用不到
|
||||||
|
if (immediate) {
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
timeout = null;
|
||||||
|
}, wait);
|
||||||
|
typeof func === "function" && func();
|
||||||
|
} else {
|
||||||
|
// 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
|
||||||
|
timeout = getUid(1);
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
typeof func === "function" && func();
|
||||||
|
}, wait);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user