Skip to content

πŸ–– GoCaptcha of UniApp, which implements click mode, slider mode, drag-drop mode and rotation mode.

License

Notifications You must be signed in to change notification settings

wenlng/go-captcha-uni

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Go Captcha

Behavior Captcha Of UniApp


English | δΈ­ζ–‡


⭐️ If it helps you, please give a star.

Poster




URL Index

Name Desc
document GoCaptcha Document
online demo GoCaptcha Online Demo
go-captcha-example Golang + Web + APP Example
go-captcha-assets Golang Asset File
go-captcha Golang Captcha
go-captcha-jslib Javascript Captcha
go-captcha-vue Vue Captcha
go-captcha-react React Captcha
go-captcha-angular Angular Captcha
go-captcha-svelte Svelte Captcha
go-captcha-solid Solid Captcha
go-captcha-uni UniApp Captcha
...

Install

1、Use HBuilderX Import

2、Download ZIP Import

3、Dependency Tool Install

yarn add go-captcha-uni
# or
npm install go-captcha-uni
# or
pnpm install go-captcha-uni

Use Component

  <go-captcha-uni  type="click"
                   :data="clickCaptData"
                   :config="clickCaptConfig"
                   :theme="clickThemeColor"
                   @event-click="clickEvents"
                   @event-confirm="confirmEvents"
                   @event-refresh="refreshEvents"
                   @event-close="closeEvents"/>

Click Mode

<go-captcha-uni
  type="click"  
  :config="{}"
  :theme="{}"
  :data="{}"
  ref="domRef"
/>

<script>
  // call methods
  const domRef = ref(null)
  domRef.value.clear()
  domRef.value.refresh()
</script>
// config = {}
interface Config {
  width?: number;
  height?: number;
  thumbWidth?: number;
  thumbHeight?: number;
  verticalPadding?: number;
  horizontalPadding?: number;
  showTheme?: boolean;
  title?: string;
  buttonText?: string;
  iconSize?: number;
  dotSize?: number;
}

// data = {}
interface Data {
  image: string;
  thumb: string;
}

// theme = {}
interface Theme {
  textColor?: string; // '#ffffff'
  bgColor?: string;
  btnColor?: string;
  btnDisabledColor?: string;
  btnBgColor?: string;
  btnBorderColor?: string;
  activeColor?: string;
  borderColor?: string;
  iconColor?: string;
  loadingIconColor?: string;
  bodyBgColor?: string;

  dotColor?: string;
  dotBgColor?: string;
  dotBorderColor?: string;
}

// @events
interface _ {
  '@event-click'?: (x: number, y: number) => void;
  '@event-refresh'?: () => void;
  '@event-close'?: () => void;
  '@event-confirm'?: (dots: Array<ClickDot>, reset:() => void) => boolean;
}

// export component method
interface ExportMethods {
  reset: () => void,
  clear: () => void,
  refresh: () => void,
  close: () => void,
}

Slide Mode

<go-captcha-uni
    type="slide"
    :config="{}"
    :theme="{}"
    :data="{}"
    ref="domRef"
/>

<script>
// call methods
const domRef = ref(null)
domRef.value.clear()
domRef.value.refresh()
</script>
// config = {}
interface Config {
  width?: number;
  height?: number;
  thumbWidth?: number;
  thumbHeight?: number;
  verticalPadding?: number;
  horizontalPadding?: number;
  showTheme?: boolean;
  title?: string;
  iconSize?: number;
  scope ?: boolean;
}

// data = {}
interface Data {
  thumbX: number;
  thumbY: number;
  thumbWidth: number;
  thumbHeight: number;
  image: string;
  thumb: string;
}
// theme = {}
interface Theme {
  textColor?: string; // '#ffffff'
  bgColor?: string;
  borderColor?: string;
  iconColor?: string;
  dragBarColor?: string;
  dragBgColor?: string;
  dragIconColor?: string;
  loadingIconColor?: string;
  bodyBgColor?: string;
}

// @events
interface _ {
  move?: (x: number, y: number) => void;
  refresh?: () => void;
  close?: () => void;
  confirm?: (point: SlidePoint, reset:() => void) => boolean;
}

// export component method
interface ExportMethods {
  reset: () => void,
  clear: () => void,
  refresh: () => void,
  close: () => void,
}

Drag-Drop Mode

<go-captcha-uni
    type="drag"
    :config="{}"
    :theme="{}"
    :data="{}"
    ref="domRef"
/>

<script>
// call methods
const domRef = ref(null)
domRef.value.clear()
domRef.value.refresh()
</script>
// config = {}
interface Config {
  width?: number;
  height?: number;
  thumbWidth?: number;
  thumbHeight?: number;
  verticalPadding?: number;
  horizontalPadding?: number;
  showTheme?: boolean;
  title?: string;
  iconSize?: number;
  scope ?: boolean;
}

// data = {}
interface Data {
  thumbX: number;
  thumbY: number;
  thumbWidth: number;
  thumbHeight: number;
  image: string;
  thumb: string;
}

// theme = {}
interface Theme {
  textColor?: string; // '#ffffff'
  bgColor?: string;
  borderColor?: string;
  iconColor?: string;
  loadingIconColor?: string;
  bodyBgColor?: string;
}

// @events
interface _ {
  '@event-move'?: (x: number, y: number) => void;
  '@event-refresh'?: () => void;
  '@event-close'?: () => void;
  '@event-confirm'?: (point: SlideRegionPoint, reset:() => void) => boolean;
}

// export component method
interface ExportMethods {
  reset: () => void,
  clear: () => void,
  refresh: () => void,
  close: () => void,
}

Rotation Mode

<go-captcha-uni
    type="rotate"
    :config="{}"
    :theme="{}"
    :data="{}"
    ref="domRef"
/>

<script>
// call methods
const domRef = ref(null)
domRef.value.clear()
domRef.value.refresh()
</script>
// config = {}
interface Config {
  width?: number;
  height?: number;
  thumbWidth?: number;
  thumbHeight?: number;
  verticalPadding?: number;
  horizontalPadding?: number;
  showTheme?: boolean;
  title?: string;
  iconSize?: number;
  scope ?: boolean;
}

// data = {}
interface Data {
  angle: number;
  image: string;
  thumb: string;
}

// theme = {}
interface Theme {
  textColor?: string; // '#ffffff'
  bgColor?: string;
  borderColor?: string;
  iconColor?: string;
  dragBarColor?: string;
  dragBgColor?: string;
  dragIconColor?: string;
  roundColor?: string;
  loadingIconColor?: string;
  bodyBgColor?: string;
}

// @events
interface _ {
  '@event-rotate'?: (angle: number) => void;
  '@event-refresh'?: () => void;
  '@event-close'?: () => void;
  '@event-confirm'?: (angle: number, reset:() => void) => boolean;
}

// export component method
interface ExportMethods {
  reset: () => void,
  clear: () => void,
  refresh: () => void,
  close: () => void,
}

Button

<go-captcha-uni
    type="button"
    :config="{}"
    :theme="{}"
    :data="{}"
/>
// config = {}
interface Config {
  width?: number;
  height?: number;
  verticalPadding?: number;
  horizontalPadding?: number;
}

// data = {}
interface Data {
  disabled?: boolean;
  type?: "default" | "warn" | "error" | "success"
}

// theme = {}
interface Theme {
  textColor?: string; // '#ffffff'
  bgColor?: string;
  btnColor?: string;
  btnDisabledColor?: string;
  btnBgColor?: string;
  btnBorderColor?: string;
  activeColor?: string;
  borderColor?: string;
  iconColor?: string;
  loadingIconColor?: string;
  bodyBgColor?: string;

  dotColor?: string;
  dotBgColor?: string;
  dotBorderColor?: string;
}

// @events
interface _ {
  '@event-click'?: () => {}
}