-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
唐道勇
authored and
唐道勇
committed
Jan 5, 2022
1 parent
02d6d01
commit 16e62e2
Showing
13 changed files
with
2,149 additions
and
450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Ref } from 'vue'; | ||
declare const _sfc_main: import("vue").DefineComponent<{ | ||
/** | ||
* placeholder提示文字 | ||
*/ | ||
placeholder: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
/** | ||
* 验证通过提示文字 | ||
*/ | ||
confirmText: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
}, { | ||
props: Readonly<{ | ||
onDragSuccess: (() => any) | undefined; | ||
placeholder: string; | ||
confirmText: string; | ||
}>; | ||
emit: (event: "dragSuccess") => void; | ||
dragDivRef: Ref<HTMLElement | null>; | ||
dragMoveRef: Ref<HTMLElement | null>; | ||
beginClientLeft: Ref<number>; | ||
mouseMoveStatus: Ref<boolean>; | ||
maxwidth: Ref<number>; | ||
confirmWords: Ref<string>; | ||
confirmSuccess: Ref<boolean>; | ||
dragBgStyle: { | ||
width: string; | ||
}; | ||
dragStyle: { | ||
left: string; | ||
}; | ||
dragTextStyle: { | ||
color: string; | ||
}; | ||
dragMousedown: (e: MouseEvent) => void; | ||
dragMousemove: (e: MouseEvent) => void; | ||
dragMoseUp: (e: MouseEvent) => void; | ||
dragSuccess: () => void; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { | ||
/** | ||
* 验证通过回调 | ||
*/ | ||
dragSuccess: () => true; | ||
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
placeholder?: unknown; | ||
confirmText?: unknown; | ||
} & { | ||
placeholder: string; | ||
confirmText: string; | ||
} & {}> & { | ||
onDragSuccess?: (() => any) | undefined; | ||
}, { | ||
placeholder: string; | ||
confirmText: string; | ||
}>; | ||
export default _sfc_main; |
134 changes: 134 additions & 0 deletions
134
@types/components/dwWechatLogin/src/DwWechatLogin.vue.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
declare const _sfc_main: import("vue").DefineComponent<{ | ||
/** | ||
* 非必传,默认值为false | ||
* true:手机点击确认登录后可以在 iframe 内跳转到 redirect_uri | ||
* false:手机点击确认登录后可以在 top window 跳转到 redirect_uri。 | ||
*/ | ||
self_redirect: { | ||
type: BooleanConstructor; | ||
default: boolean; | ||
}; | ||
/** | ||
* 必传 | ||
* 应用唯一标识,在微信开放平台提交应用审核通过后获得 | ||
*/ | ||
appid: { | ||
type: StringConstructor; | ||
}; | ||
/** | ||
* 必传 | ||
* 应用授权作用域,拥有多个作用域用逗号(,)分隔,网页应用目前仅填写snsapi_login即可 | ||
*/ | ||
scope: { | ||
type: StringConstructor; | ||
}; | ||
/** | ||
* 必传 | ||
* 重定向地址,需要进行UrlEncode | ||
*/ | ||
redirect_uri: { | ||
type: StringConstructor; | ||
}; | ||
/** | ||
* 非必传,建议传 | ||
* 用于保持请求和回调的状态,授权请求后原样带回给第三方。该参数可用于防止csrf攻击(跨站请求伪造攻击),建议第三方带上该参数,可设置为简单的随机数加session进行校验 | ||
*/ | ||
state: { | ||
type: StringConstructor; | ||
}; | ||
/** | ||
* 非必传 | ||
* 提供"black"、"white"可选,默认为黑色文字描述。详见文档底部FAQ | ||
*/ | ||
style: { | ||
type: StringConstructor; | ||
}; | ||
/** | ||
* 非必传 | ||
* 自定义样式链接,第三方可根据实际需求覆盖默认样式。详见文档底部FAQ | ||
*/ | ||
href: { | ||
type: StringConstructor; | ||
}; | ||
styletype: { | ||
type: StringConstructor; | ||
}; | ||
sizetype: { | ||
type: StringConstructor; | ||
}; | ||
bgcolor: { | ||
type: StringConstructor; | ||
}; | ||
rst: { | ||
type: StringConstructor; | ||
}; | ||
/** | ||
* 非必传 | ||
* iframe的宽度,默认300px | ||
*/ | ||
iframeWidth: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
/** | ||
* 非必传 | ||
* iframe的高度,默认300px | ||
*/ | ||
iframeHeight: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
}, { | ||
prop: Readonly<{ | ||
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined; | ||
self_redirect: boolean; | ||
appid: string | undefined; | ||
scope: string | undefined; | ||
redirect_uri: string | undefined; | ||
state: string | undefined; | ||
style: string | undefined; | ||
href: string | undefined; | ||
styletype: string | undefined; | ||
sizetype: string | undefined; | ||
bgcolor: string | undefined; | ||
rst: string | undefined; | ||
iframeWidth: number; | ||
iframeHeight: number; | ||
}>; | ||
hidden: import("vue").ComputedRef<boolean>; | ||
loginSrc: import("vue").ComputedRef<string>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
self_redirect?: unknown; | ||
appid?: unknown; | ||
scope?: unknown; | ||
redirect_uri?: unknown; | ||
state?: unknown; | ||
style?: unknown; | ||
href?: unknown; | ||
styletype?: unknown; | ||
sizetype?: unknown; | ||
bgcolor?: unknown; | ||
rst?: unknown; | ||
iframeWidth?: unknown; | ||
iframeHeight?: unknown; | ||
} & { | ||
self_redirect: boolean; | ||
iframeWidth: number; | ||
iframeHeight: number; | ||
} & { | ||
appid?: string | undefined; | ||
scope?: string | undefined; | ||
redirect_uri?: string | undefined; | ||
state?: string | undefined; | ||
style?: string | undefined; | ||
href?: string | undefined; | ||
styletype?: string | undefined; | ||
sizetype?: string | undefined; | ||
bgcolor?: string | undefined; | ||
rst?: string | undefined; | ||
}>, { | ||
self_redirect: boolean; | ||
iframeWidth: number; | ||
iframeHeight: number; | ||
}>; | ||
export default _sfc_main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { App } from 'vue'; | ||
import DwWechatLogin from './dwWechatLogin/src/DwWechatLogin.vue'; | ||
import DwDragVerify from './dwDragVerify/src/DwDragVerify.vue'; | ||
declare const install: (app: App) => void; | ||
export { DwWechatLogin, DwDragVerify }; | ||
export default install; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* @Author: matiastang | ||
* @Date: 2022-01-05 17:28:59 | ||
* @LastEditors: matiastang | ||
* @LastEditTime: 2022-01-05 17:28:59 | ||
* @FilePath: /dw-vue-components/RollupBuild/rollup.config.js | ||
* @Description: | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// @use '../../../src/common/css/index.scss' as *; | ||
@import '../../../src/common/css/index.scss'; | ||
.drag-verify { | ||
position: relative; | ||
background-color: #f8f8f8; | ||
width: 100%; | ||
height: 52px; | ||
line-height: 52px; | ||
text-align: center; | ||
border: 1px solid $borderColor; | ||
box-sizing: border-box; | ||
.handler { | ||
width: 50px; | ||
height: 50px; | ||
cursor: move; | ||
position: absolute; | ||
top: 0px; | ||
left: 0px; | ||
} | ||
.handler_bg { | ||
background: #fff | ||
url('data:image/png;base64,iVBORw0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gDQqXK0ia/0I17wJiPmQNTNBEAgMlQIWiQA2vgWw7QppBekGxsAjIiEUSBNnsBDWEAY9mEFgMMgBk00E0iZtA7AHEctDQ58MRuA6wlLgGFMoMpIG1QFeGwAIxGZo8GUhIysmwQGSAZgwHaEZhICIzOaBkJkqyM0CAAQDGx279Jf50AAAAAABJRU5ErkJggg==') | ||
no-repeat center; | ||
} | ||
.drag_bg { | ||
background-color: #7ac23c; | ||
height: 50px; | ||
width: 0px; | ||
} | ||
.drag_text { | ||
position: absolute; | ||
color: #8c8c8c; | ||
top: 0px; | ||
width: 100%; | ||
text-align: center; | ||
-moz-user-select: none; | ||
-webkit-user-select: none; | ||
user-select: none; | ||
-o-user-select: none; | ||
-ms-user-select: none; | ||
font-size: fontSize(16px); | ||
@include defaultFont; | ||
} | ||
|
||
.slidetounlock { | ||
background: -webkit-gradient( | ||
linear, | ||
left top, | ||
right top, | ||
color-stop(0, #4d4d4d), | ||
color-stop(0.4, #4d4d4d), | ||
color-stop(0.5, #fff), | ||
color-stop(0.6, #4d4d4d), | ||
color-stop(1, #4d4d4d) | ||
); | ||
-webkit-background-clip: text; | ||
-webkit-text-fill-color: transparent; | ||
animation: slidetounlock 3s infinite; | ||
-webkit-animation: slidetounlock 3s infinite; | ||
-webkit-text-size-adjust: none; | ||
} | ||
@keyframes slidetounlock { | ||
0% { | ||
background-position: -200px 0; | ||
} | ||
100% { | ||
background-position: 200px 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.dw-wechat-login-container { | ||
width: 300px; | ||
height: 400px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
.dw-wechat-login-qrcode { | ||
border: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* @Author: matiastang | ||
* @Date: 2022-01-05 15:57:32 | ||
* @LastEditors: matiastang | ||
* @LastEditTime: 2022-01-05 17:24:35 | ||
* @FilePath: /dw-vue-components/gulpfile.ts/tasks/vueTheme.ts | ||
* @Description: vue提取样式 | ||
*/ | ||
import gulp, { src, dest, series, parallel } from 'gulp' | ||
import dartSass from 'sass' | ||
import gulpSass from 'gulp-sass' | ||
const sass = gulpSass(dartSass) | ||
import autoprefixer from 'gulp-autoprefixer' | ||
// import cssmin from 'gulp-cssmin' | ||
import del from 'del' | ||
import minimist from 'minimist' | ||
|
||
// 打包配置 | ||
const config = { | ||
input: '../../components/dwWechatLogin/src/', | ||
output: '../../dist/theme-default', | ||
} | ||
// 复制字体 | ||
const copy_font = () => { | ||
gulp.src([`${config.input}fonts/*`, `!${config.input}fonts/*.css`]).pipe( | ||
dest(`${config.output}/fonts`) | ||
) | ||
} | ||
// 压缩font 里的 CSS | ||
// exports.minifontCss = () => | ||
// src(`${config.input}fonts/*.css`) | ||
// .pipe(cssmin()) | ||
// .pipe(dest(`${config.output}/fonts`)) | ||
// 删除之前css打包文件 | ||
const vue_theme_clear = (cb: () => void) => { | ||
del(['./dist/css']) | ||
cb() | ||
} | ||
|
||
// 编译 SCSS | ||
// const compile = () => | ||
// src([`${input}*.less`, ...['base', 'variable'].map((name) => `!${input}${name}.less`)]) | ||
// .pipe(less()) | ||
// .pipe( | ||
// autoprefixer({ | ||
// overrideBrowserslist: ['last 2 versions'], | ||
// }) | ||
// ) | ||
// .pipe(cssmin()) | ||
// .pipe(dest(output)) | ||
// exports.build = series(clean, parallel(compile, copyfont, minifontCss)) | ||
|
||
const vue_build_theme = (cb: () => void) => { | ||
const argv = minimist(process.argv.slice(2)) | ||
const inPath = argv.in || './components' | ||
if (!inPath) { | ||
console.error(`vue_build_theme指令需要添加输入路径in`) | ||
cb() | ||
return | ||
} | ||
const outPath = argv.out || './dist/css' | ||
if (!outPath) { | ||
console.error(`vue_build_theme指令需要添加输出路径out`) | ||
cb() | ||
return | ||
} | ||
gulp.src(['./src/common/css/theme.scss', `${inPath}/**/*.scss`]) | ||
// .pipe(sass.sync({ outputStyle: 'compressed' }).on('error', sass.logError)) | ||
.pipe(sass.sync().on('error', sass.logError)) | ||
.pipe(autoprefixer()) | ||
// .pipe(cssmin()) | ||
.pipe(gulp.dest(outPath)) | ||
cb() | ||
} | ||
|
||
const vue_clear_build = gulp.series(vue_theme_clear, vue_build_theme) | ||
|
||
export { vue_theme_clear, vue_build_theme, vue_clear_build } |
Oops, something went wrong.