提交 f8b09f09 作者: 方治民

feat: 添加 FirstUI 组件,更新文档,更新 index 首页

上级 e7f64ac1
......@@ -17,3 +17,7 @@ unpackage
types/auto-imports.d.ts
src/api/services/api.d.ts
src/static/**
src/components/firstui/**
src/uni_modules/**
......@@ -11,3 +11,7 @@
manifest.json
types/auto-imports.d.ts
src/static/**
src/components/firstui/**
src/uni_modules/**
......@@ -2,3 +2,6 @@
/public/*
public/*
example/*
src/static/**
src/components/firstui/**
src/uni_modules/**
......@@ -26,11 +26,9 @@
- [x] [changelog](https://www.cnblogs.com/mengfangui/p/12634845.html)
- [x] 完善网络请求相关配置
- [x] 集成 [Pont](https://github.com/alibaba/pont)
- [ ] 适配上传/下载接口的自动化生成模板(包装 uni.uploadFile 与 uni.downloadFile 方法实现)
- [x] 集成 [Pinia](https://pinia.vuejs.org/)
- [x] 集成 [vue-i18n](https://github.com/intlify/vue-i18n-next)
- [ ] 完善页面主体布局
- [ ] 设计模块化权限控制
- [x] UI 组件集成 [FirstUI-UniApp](https://gitlab.yiring.com/open/first-ui)
- [ ] 适配上传/下载接口的自动化生成模板(包装 uni.uploadFile 与 uni.downloadFile 方法实现)
- [ ] 接入 [消息推送](https://uniapp.dcloud.net.cn/unipush.html)
- [ ] 接入 [APP 升级中心](https://uniapp.dcloud.net.cn/uniCloud/upgrade-center.html)
- [x] 跟进官方更新进度,将 uni-app 依赖升级到 3.0 正式版,[日志](https://uniapp.dcloud.io/release.html)
import type { Plugin } from 'vite'
import colors from 'picocolors'
import { configUniPlugin } from './uni'
import { configAutoImportPlugin } from './autoImport'
import pkg from '../../package.json'
......@@ -7,12 +8,11 @@ export function createVitePlugins(viteEnv: ViteEnv) {
const { VITE_GLOB_APP_NAME, VITE_GLOB_APP_DESCRIPTION, VITE_GLOB_API_URL, VITE_GLOB_API_URL_PREFIX } = viteEnv
// 以红色字体输出信息
const color = '\x1b[91m'
console.log()
console.log(color, `APP 版本: v${pkg.version}`)
console.log(color, `APP 名称: ${VITE_GLOB_APP_NAME}`)
console.log(color, `APP 描述: ${VITE_GLOB_APP_DESCRIPTION}`)
console.log(color, `API Doc: ${VITE_GLOB_API_URL}${VITE_GLOB_API_URL_PREFIX}/doc.html`)
console.log(colors.red(`APP 版本: v${pkg.version}`))
console.log(colors.red(`APP 名称: ${VITE_GLOB_APP_NAME}`))
console.log(colors.red(`APP 描述: ${VITE_GLOB_APP_DESCRIPTION}`))
console.log(colors.red(`API Doc: ${VITE_GLOB_API_URL}${VITE_GLOB_API_URL_PREFIX}/doc.html`))
console.log()
// plugins
......
......@@ -11,8 +11,8 @@
### UI
<!-- prettier-ignore -->
-[FirstUI](https://doc.firstui.cn/docs/introduce.html),公司购买的 UI 组件库,可下载示例项目运行查看 [FirstUI-UniApp](https://gitlab.yiring.com/open/first-ui)
- [uni-ui@vue3](https://github.com/dcloudio/uni-ui)
- 备选方案: [uView](https://uviewui.com/), 由于尚未完成 Vue3 的适配, 暂不推荐使用
### Tools
......
......@@ -63,19 +63,19 @@
}
},
"dependencies": {
"@dcloudio/uni-app": "^3.0.0-alpha-3050020220622002",
"@dcloudio/uni-app-plus": "^3.0.0-alpha-3050020220622002",
"@dcloudio/uni-components": "^3.0.0-alpha-3050020220622002",
"@dcloudio/uni-h5": "^3.0.0-alpha-3050020220622002",
"@dcloudio/uni-mp-alipay": "^3.0.0-alpha-3050020220622002",
"@dcloudio/uni-mp-baidu": "^3.0.0-alpha-3050020220622002",
"@dcloudio/uni-mp-kuaishou": "^3.0.0-alpha-3050020220622002",
"@dcloudio/uni-mp-lark": "^3.0.0-alpha-3050020220622002",
"@dcloudio/uni-mp-qq": "^3.0.0-alpha-3050020220622002",
"@dcloudio/uni-mp-toutiao": "^3.0.0-alpha-3050020220622002",
"@dcloudio/uni-mp-weixin": "^3.0.0-alpha-3050020220622002",
"@dcloudio/uni-quickapp-webview": "^3.0.0-alpha-3050020220622002",
"@vueuse/core": "^8.7.4",
"@dcloudio/uni-app": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-app-plus": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-components": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-h5": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-mp-alipay": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-mp-baidu": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-mp-kuaishou": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-mp-lark": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-mp-qq": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-mp-toutiao": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-mp-weixin": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-quickapp-webview": "^3.0.0-alpha-3050120220704001",
"@vueuse/core": "^8.7.5",
"axios": "^0.26.1",
"dayjs": "^1.11.3",
"lodash-es": "^4.17.21",
......@@ -87,32 +87,33 @@
"vue-types": "^4.1.1"
},
"devDependencies": {
"@commitlint/cli": "^17.0.2",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^16.2.4",
"@dcloudio/types": "^3.0.6",
"@dcloudio/uni-automator": "^3.0.0-alpha-3050020220622002",
"@dcloudio/uni-cli-shared": "^3.0.0-alpha-3050020220622002",
"@dcloudio/types": "^3.0.7",
"@dcloudio/uni-automator": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-cli-shared": "^3.0.0-alpha-3050120220704001",
"@dcloudio/uni-helper-json": "^1.0.13",
"@dcloudio/vite-plugin-uni": "^3.0.0-alpha-3050020220622002",
"@dcloudio/vite-plugin-uni": "^3.0.0-alpha-3050120220704001",
"@types/lodash-es": "^4.17.6",
"@types/mockjs": "^1.0.6",
"@types/prettier": "^2.6.3",
"@types/qs": "^6.9.7",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"@typescript-eslint/eslint-plugin": "^5.30.4",
"@typescript-eslint/parser": "^5.30.4",
"commitizen": "^4.2.4",
"conventional-changelog-cli": "^2.2.2",
"cz-conventional-changelog": "^3.3.0",
"dotenv": "^16.0.1",
"eslint": "^8.18.0",
"eslint": "^8.19.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.1.1",
"husky": "^7.0.4",
"less": "^4.1.3",
"lint-staged": "^13.0.2",
"lint-staged": "^13.0.3",
"npm-run-all": "^4.1.5",
"pont-engine": "^1.3.1",
"picocolors": "^1.0.0",
"pont-engine": "^1.3.2",
"postcss": "^8.4.14",
"postcss-html": "^1.4.1",
"postcss-less": "^6.0.0",
......@@ -128,8 +129,8 @@
"stylus": "^0.56.0",
"typescript": "^4.7.4",
"unplugin-auto-import": "^0.7.2",
"vite": "^2.9.12",
"vue-eslint-parser": "^9.0.2"
"vite": "^2.9.13",
"vue-eslint-parser": "^9.0.3"
},
"engines": {
"node": "^12 || >=14"
......
......@@ -8,4 +8,12 @@ module.exports = {
proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict',
endOfLine: 'lf',
overrides: [
{
files: ['*.yml', '*.yaml'],
options: {
tabWidth: 2,
},
},
],
}
......@@ -12,10 +12,17 @@
})
</script>
<style>
<style lang="less">
/* common css */
/* #ifndef APP-PLUS-NVUE */
/* uni.css - 通用组件、模板样式库,可以当作一套ui库应用 */
@import './common/uni.css';
/* #endif */
/*每个页面公共css */
@import './common/fui-app.css';
@import './components/firstui/fui-theme/fui-theme.css';
// 全局样式
@import './common/public.less';
</style>
This source diff could not be displayed because it is too large. You can view the blob instead.
/* #ifndef APP-NVUE */
page {
background-color: var(--fui-bg-color-grey, #f1f4fa);
font-size: 32rpx;
font-weight: 500;
color: var(--fui-color-title, #181818);
font-family: -apple-system-font, 'Helvetica Neue', Helvetica, sans-serif;
}
/* #endif */
.fui-section__title {
font-size: 32rpx;
line-height: 32rpx;
font-weight: 600;
margin-bottom: 32rpx;
padding-left: 16rpx;
position: relative;
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
/* #ifdef APP-NVUE */
border-left: 2px solid #465cff;
/* #endif */
}
/* #ifndef APP-NVUE */
.fui-section__title:not(:first-child) {
margin-top: 96rpx;
}
.fui-page__title image {
width: 48rpx;
height: 48rpx;
margin-left: 16rpx;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.fui-section__title::after {
content: '';
position: absolute;
width: 2px;
height: 100%;
background: #465cff;
border-radius: 2px;
left: 0;
top: 0;
}
::-webkit-scrollbar {
width: 0 !important;
height: 0 !important;
color: transparent !important;
display: none;
}
.fui-ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
/* #endif */
.fui-vip__icon {
width: 48rpx;
height: 48rpx;
margin-left: 16rpx;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.fui-page__spacing {
padding-left: 32rpx;
padding-right: 32rpx;
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
}
.fui-page__hd {
/* #ifndef APP-NVUE */
width: 100%;
box-sizing: border-box;
/* #endif */
padding: 52rpx 32rpx;
}
.fui-page__bd {
/* #ifndef APP-NVUE */
width: 100%;
/* #endif */
padding-bottom: 64rpx;
}
.fui-page__title {
text-align: left;
font-size: 36rpx;
font-weight: 600;
}
.fui-page__desc {
margin-top: 8rpx;
color: #b2b2b2;
text-align: left;
font-size: 28rpx;
font-weight: 400;
/* #ifndef APP-NVUE */
word-break: break-all;
/* #endif */
}
.fui-color__primary {
color: #465cff;
}
.fui-wrap {
/* #ifndef APP-NVUE */
width: 100%;
display: flex;
box-sizing: border-box;
/* #endif */
flex-direction: column;
}
/* Flex布局 */
.fui-flex {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
}
.fui-flex__center {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
}
.fui-flex__between {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.fui-flex__reverse {
flex-direction: row-reverse;
}
.fui-align__center {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
align-items: center;
flex-direction: row;
}
.fui-flex__column {
flex-direction: column !important;
}
.fui-flex__1 {
flex: 1;
}
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 156 16 26 019 5,身份证尾号:503 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
const fui = {
toast: function (text: string) {
text &&
uni.showToast({
title: text,
icon: 'none',
duration: 2000,
})
},
modal: function (
title: string,
content: string,
callback: Function,
showCancel: boolean,
confirmColor: string,
confirmText: string,
) {
uni.showModal({
title: title,
content: content,
showCancel: showCancel || false,
// #ifndef MP-TOUTIAO
cancelColor: '#7F7F7F',
confirmColor: confirmColor || '#465CFF',
// #endif
confirmText: confirmText || '确定',
success(res) {
if (res.confirm) {
callback && callback(true)
} else {
callback && callback(false)
}
},
fail(err) {
console.log(err)
},
})
},
href(url: string, isMain: boolean) {
if (isMain) {
uni.switchTab({
url: url,
})
} else {
uni.navigateTo({
url: url,
})
}
},
jsonp: function (url: string, callback: Function, callbackname: string) {
// #ifdef H5
window[callbackname] = callback
const script = document.createElement('script')
script.src = url
script.type = 'text/javascript'
document.head.appendChild(script)
document.head.removeChild(script)
// #endif
},
resUrl: function () {
return 'https://res.firstui.cn/static/images'
},
}
export default fui
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 15 6 1 62 60 19 5,身份证尾号: 50 37 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import http from '@/components/firstui/fui-request'
//初始化请求配置项
http.create({
host: 'https://ffa.firstui.cn',
header: {
// 'content-type': 'application/x-www-form-urlencoded'
},
})
//请求拦截
http.interceptors.request.use((config) => {
//请求之前可在请求头中加入token等信息
const token = uni.getStorageSync('firstui_token') || 'testToken'
if (config.header) {
config.header['token'] = token
} else {
config.header = {
token: token,
}
}
return config
})
//响应拦截
http.interceptors.response.use((response) => {
//TODO
return response
})
export default http
.example-page {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
// ================ mapbox-gl ================
// 自定义 popup 内容样式
.mapboxgl-popup-content {
box-shadow: 0 1px 5px #6e6e6e !important;
}
.mapboxgl-popup-content .mapboxgl-custom-popup {
position: relative;
}
.mapboxgl-custom-popup .popup-title {
font-weight: bold;
}
.mapboxgl-ctrl-group:not(:empty) {
box-shadow: 0 0 6px #000 !important;
}
.mapboxgl-ctrl-group button {
display: flex !important;
overflow: visible !important;
}
.mapboxgl-ctrl-logo {
display: none !important;
}
.mapboxgl-ctrl-bottom-left {
display: flex;
bottom: 0;
left: 2px;
}
.mapboxgl-ctrl-lnglat {
background: rgb(0 0 0 / 40%);
color: white;
line-height: 2em;
padding: 0 10px;
}
// 覆盖全屏控件的图标
.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon {
background-image: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"%3E%3Cpath fill="currentColor" d="M3.75 3a.75.75 0 0 0-.75.75V5.5a.5.5 0 0 1-1 0V3.75C2 2.784 2.784 2 3.75 2H5.5a.5.5 0 0 1 0 1H3.75ZM10 2.5a.5.5 0 0 1 .5-.5h1.75c.966 0 1.75.784 1.75 1.75V5.5a.5.5 0 0 1-1 0V3.75a.75.75 0 0 0-.75-.75H10.5a.5.5 0 0 1-.5-.5ZM2.5 10a.5.5 0 0 1 .5.5v1.75c0 .414.336.75.75.75H5.5a.5.5 0 0 1 0 1H3.75A1.75 1.75 0 0 1 2 12.25V10.5a.5.5 0 0 1 .5-.5Zm11 0a.5.5 0 0 1 .5.5v1.75A1.75 1.75 0 0 1 12.25 14H10.5a.5.5 0 0 1 0-1h1.75a.75.75 0 0 0 .75-.75V10.5a.5.5 0 0 1 .5-.5Z"%2F%3E%3C%2Fsvg%3E') !important;
}
.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon {
background-image: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"%3E%3Cpath fill="currentColor" d="M11 4a1 1 0 0 0 1 1h1.5a.5.5 0 0 1 0 1H12a2 2 0 0 1-2-2V2.5a.5.5 0 0 1 1 0V4Zm0 8a1 1 0 0 1 1-1h1.5a.5.5 0 0 0 0-1H12a2 2 0 0 0-2 2v1.5a.5.5 0 0 0 1 0V12Zm-7-1a1 1 0 0 1 1 1v1.5a.5.5 0 0 0 1 0V12a2 2 0 0 0-2-2H2.5a.5.5 0 0 0 0 1H4Zm1-7a1 1 0 0 1-1 1H2.5a.5.5 0 0 0 0 1H4a2 2 0 0 0 2-2V2.5a.5.5 0 0 0-1 0V4Z"%2F%3E%3C%2Fsvg%3E') !important;
}
.mapboxgl-ctrl .mapboxgl-ctrl-reset-button .mapboxgl-ctrl-icon {
background-image: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"%3E%3Cpath fill="currentColor" d="M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3s-3 1.331-3 3s1.329 3 3 3z"%2F%3E%3Cpath fill="currentColor" d="M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219a9.053 9.053 0 0 0-2.43-2.43a8.95 8.95 0 0 0-3.219-1.355a9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053a7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725a7.11 7.11 0 0 1-.644 1.188a7.2 7.2 0 0 1-.858 1.039a7.028 7.028 0 0 1-3.536 1.907a7.13 7.13 0 0 1-2.822 0a6.961 6.961 0 0 1-2.503-1.054a7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034a9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183a9.014 9.014 0 0 0 3.218-1.355a8.886 8.886 0 0 0 1.331-1.099a9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"%2F%3E%3C%2Fsvg%3E') !important;
}
/* stylelint-disable-next-line selector-no-vendor-prefix */
.mapboxgl-map:-webkit-full-screen {
.mapboxgl-ctrl-bottom-left {
bottom: 0;
}
}
// 自定义图层控制器样式
.mapboxgl-ctrl button.-active svg {
color: #4264fb;
}
.mapboxgl-ctrl-layer-button {
position: relative;
.mapboxgl-ctrl-layer-wrap {
display: none;
justify-items: center;
align-items: center;
position: absolute;
right: 40px;
padding: 10px;
border-radius: 3px;
box-shadow: 0 0 3px #333;
background-color: #fff;
.mapboxgl-ctrl-layer {
width: 60px;
height: 60px;
display: flex;
justify-content: center;
border: 2px solid #fff;
position: relative;
&.active {
border-color: #3385ff;
}
img {
width: 100%;
height: 100%;
}
span {
display: inline-flex;
justify-content: center;
background-color: rgb(0 0 0 / 60%);
color: white;
position: absolute;
bottom: 0;
width: 100%;
}
}
}
&.-active .mapboxgl-ctrl-layer-wrap {
display: flex;
}
}
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 5 616 26 0 195,身份证尾号:50 3 7 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<view class="fui-alert__wrap" :class="[background?'':('fui-alert__'+type)]"
:style="{background:background || getColor(type),borderRadius:radius,paddingTop:padding[0] || 0,paddingRight:padding[1]||0,paddingBottom:padding[2] || padding[0]||0,paddingLeft:padding[3] || padding[1]||0,marginTop:marginTop+'rpx',marginBottom:marginBottom+'rpx'}">
<view class="fui-alert__shrink" @tap.stop="leftClick">
<slot></slot>
<icon :type="type" :size="iconSize" :color="iconColor" v-if="!isLeft && type && type!=='true'"></icon>
</view>
<view class="fui-alert__content"
:class="{'fui-text__p-left':(!isLeft && type && type!=='true') || (spacing && isLeft),'fui-text__p-right':closable}"
@tap.stop="onClick">
<text class="fui-alert__text" :style="{fontSize:size,color:color}" v-if="title">{{title}}</text>
<text class="fui-alert__text fui-desc__padding" :class="{'fui-alert__single':single}"
:style="{fontSize:descSize,color:descColor}" v-if="desc">{{desc}}</text>
<slot name="content"></slot>
</view>
<view class="fui-alert__shrink">
<slot name="right"></slot>
</view>
<icon @tap.stop="close" type="cancel" :size="closeSize" :color="closeColor" v-if="closable"
:class="{'fui-alert__icon-close':desc}">
</icon>
</view>
</template>
<script>
export default {
name: "fui-alert",
emits: ['leftClick', 'click', 'close'],
props: {
//info, success, warn, waiting,clear
type: {
type: String,
default: ''
},
//背景色,如果设置type对应颜色失效
background: {
type: String,
default: ''
},
//padding值:[上,右,下,左]
padding: {
type: Array,
default () {
return ['20rpx', '32rpx']
}
},
//margin-top值,单位rpx
marginTop: {
type: [Number, String],
default: 0
},
//margin-bottom值,单位rpx
marginBottom: {
type: [Number, String],
default: 0
},
//圆角
radius: {
type: String,
default: '16rpx'
},
//icon颜色
iconColor: {
type: String,
default: '#fff'
},
//icon字体大小,px
iconSize: {
type: Number,
default: 22
},
closable: {
type: Boolean,
default: false
},
closeColor: {
type: String,
default: '#fff'
},
//关闭icon字体大小,px
closeSize: {
type: Number,
default: 22
},
//是否自定义左侧内容,默认图标失效
isLeft: {
type: Boolean,
default: false
},
//内容是否与图标之间有间隔,isLeft为true时生效
spacing: {
type: Boolean,
default: false
},
title: {
type: String,
default: ''
},
color: {
type: String,
default: '#fff'
},
size: {
type: String,
default: '14px'
},
desc: {
type: String,
default: ''
},
descColor: {
type: String,
default: '#fff'
},
descSize: {
type: String,
default: '12px'
},
//描述文字单行展示,超出隐藏
single: {
type: Boolean,
default: false
}
},
methods: {
getColor(type) {
const color = "#465CFF"
const colors = {
'success': '#09BE4F',
'warn': '#FFB703',
'clear': '#FF2B2B'
}
return colors[type] ? colors[type] : color;
},
leftClick() {
this.$emit('leftClick', {})
},
onClick() {
this.$emit('click', {})
},
close() {
this.$emit('close', {})
}
}
}
</script>
<style scoped>
.fui-alert__wrap {
/* #ifdef APP-NVUE */
flex: 1;
/* #endif */
/* #ifndef APP-NVUE */
display: flex;
width: 100%;
box-sizing: border-box;
/* #endif */
flex-direction: row;
align-items: center;
position: relative;
}
/* #ifndef APP-NVUE */
.fui-alert__info,
.fui-alert__waiting {
background-color: var(--fui-color-primary, #465CFF) !important;
}
.fui-alert__success {
background-color: var(--fui-color-success, #09BE4F) !important;
}
.fui-alert__warn {
background-color: var(--fui-color-warning, #FFB703) !important;
}
.fui-alert__clear {
background-color: var(--fui-color-danger, #FF2B2B) !important;
}
/* #endif */
.fui-alert__shrink {
/* #ifndef APP-NVUE */
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
/* #endif */
}
.fui-alert__content {
flex: 1;
flex-direction: column;
/* #ifndef APP-NVUE */
overflow: hidden;
/* #endif */
}
.fui-alert__text {
/* #ifndef APP-NVUE */
word-break: break-all;
display: block;
box-sizing: border-box;
/* #endif */
}
.fui-desc__padding {
padding-top: 3px;
}
.fui-text__p-left {
padding-left: 20rpx;
}
.fui-text__p-right {
padding-right: 60rpx;
}
.fui-alert__single {
/* #ifdef APP-NVUE */
lines: 1;
/* #endif */
/* #ifndef APP-NVUE */
display: block;
width: 100%;
white-space: nowrap;
/* #endif */
flex-direction: row;
overflow: hidden;
text-overflow: ellipsis;
}
.fui-alert__icon-close {
position: absolute;
right: 30rpx;
top: 16rpx;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
</style>
\ No newline at end of file
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1561 62 6 01 9 5,身份证尾号: 50 37 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<view class="fui-popup__animation" :class="[ani.in]" :style="'transform:' + transform + ';' + stylesObject"
@tap="change" v-if="isShow" ref="fui_ani">
<slot></slot>
</view>
</template>
<script>
// #ifdef APP-NVUE
const animation = uni.requireNativePlugin('animation');
// #endif
export default {
name: 'fui-animation',
emits: ['click', 'change'],
props: {
//是否显示
show: {
type: Boolean,
default: false
},
/*
过渡动画类型
['fade,'slide-top','slide-right','slide-bottom','slide-left','zoom-in','zoom-out']
*/
animationType: {
type: Array,
default () {
return [];
}
},
duration: {
type: Number,
default: 300
},
//styles 组件样式,同 css 样式
styles: {
type: Object,
default () {
return {
position: 'fixed',
bottom: 0,
top: 0,
left: 0,
right: 0,
// #ifndef APP-NVUE
display: 'flex',
// #endif
'justify-content': 'center',
'align-items': 'center'
};
}
}
},
data() {
return {
isShow: false,
transform: '',
ani: {
in: '',
active: ''
}
};
},
watch: {
show: {
handler(newVal) {
if (newVal) {
this.open();
} else {
this.close();
}
},
immediate: true
}
},
computed: {
stylesObject() {
let styles = {
...this.styles,
'transition-duration': this.duration / 1000 + 's'
};
let transfrom = '';
for (let i in styles) {
let line = this.toLine(i);
transfrom += line + ':' + styles[i] + ';';
}
return transfrom;
}
},
methods: {
change() {
this.$emit('click', {
detail: this.isShow
});
},
open() {
clearTimeout(this.timer);
this.isShow = true;
this.transform = '';
this.ani.in = '';
for (let i in this.getTranfrom(false)) {
if (i === 'opacity') {
this.ani.in = 'fui-popup__fade-out';
} else {
this.transform += `${this.getTranfrom(false)[i]} `;
}
}
this.$nextTick(() => {
setTimeout(() => {
this._animation(true);
}, 50);
});
},
close(type) {
clearTimeout(this.timer);
this._animation(false);
},
_animation(type) {
let styles = this.getTranfrom(type);
// #ifdef APP-NVUE
if (!this.$refs['fui_ani']) return;
animation.transition(
this.$refs['fui_ani'].ref, {
styles,
duration: this.duration, //ms
timingFunction: 'ease',
needLayout: false,
delay: 0 //ms
},
() => {
if (!type) {
this.isShow = false;
}
this.$emit('change', {
detail: this.isShow
});
}
);
// #endif
// #ifndef APP-NVUE
this.transform = '';
for (let i in styles) {
if (i === 'opacity') {
this.ani.in = `fui-popup__fade-${type ? 'in' : 'out'}`;
} else {
this.transform += `${styles[i]} `;
}
}
this.timer = setTimeout(() => {
if (!type) {
this.isShow = false;
}
this.$emit('change', {
detail: this.isShow
});
}, this.duration);
// #endif
},
getTranfrom(type) {
let styles = {
transform: ''
};
this.animationType.forEach(mode => {
switch (mode) {
case 'fade':
styles.opacity = type ? 1 : 0;
break;
case 'slide-top':
styles.transform += `translateY(${type ? '0' : '-100%'}) `;
break;
case 'slide-right':
styles.transform += `translateX(${type ? '0' : '100%'}) `;
break;
case 'slide-bottom':
styles.transform += `translateY(${type ? '0' : '100%'}) `;
break;
case 'slide-left':
styles.transform += `translateX(${type ? '0' : '-100%'}) `;
break;
case 'zoom-in':
styles.transform += `scale(${type ? 1 : 0.8}) `;
break;
case 'zoom-out':
styles.transform += `scale(${type ? 1 : 1.2}) `;
break;
}
});
return styles;
},
toLine(name) {
return name.replace(/([A-Z])/g, '-$1').toLowerCase();
}
}
};
</script>
<style scoped>
.fui-popup__animation {
transition-timing-function: ease;
transition-duration: 0.3s;
transition-property: transform, opacity;
position: relative;
z-index: 99;
}
.fui-popup__fade-out {
opacity: 0;
}
.fui-popup__fade-in {
opacity: 1;
}
</style>
\ No newline at end of file
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 5 6 16 26 0195,身份证尾号:5 037 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<view class="fui-autograph__wrap" :style="{ width: w + 'px', height:h + 'px',background:background }"
ref="fui_gcanvas_ag">
<!-- #ifdef APP-NVUE -->
<gcanvas @touchstart="onTouchstart" @touchmove="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel"
:ref="canvasId" :style="{ width: w + 'px', height:h + 'px' }">
</gcanvas>
<!-- #endif -->
<!-- #ifndef APP-NVUE || MP-TOUTIAO-->
<canvas :disable-scroll="!completed" :canvas-id="canvasId" :id="canvasId" @touchstart="onTouchstart"
@touchmove="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel"
:style="{width:w+'px',height:h+'px'}" @mousedown="mousedown" @mousemove="mousemove" @mouseup="mouseup"
@mouseleave="mouseleave"></canvas>
<!-- #endif -->
<!-- #ifdef MP-TOUTIAO -->
<canvas :disable-scroll="!completed" :canvas-id="canvasId" :id="canvasId" @touchstart="onTouchstart"
@touchmove.stop.prevent="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel"
:style="{width:w+'px',height:h+'px'}"></canvas>
<!-- #endif -->
</view>
</template>
<script>
// #ifdef APP-NVUE
import {
enable,
WeexBridge
} from './gcanvas/index.js';
const dom = weex.requireModule('dom')
// #endif
// #ifdef MP-WEIXIN
const canvasId = `fui_ag_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif
export default {
name: "fui-autograph",
emits: ['ready'],
props: {
width: {
type: [Number, String],
default: 0
},
height: {
type: [Number, String],
default: 400
},
background: {
type: String,
default: '#ffffff'
},
//px
lineWidth: {
type: [Number, String],
default: 5
},
color: {
type: String,
default: '#181818'
},
tips: {
type: String,
default: '请签名!'
}
},
watch: {
width(val) {
if (val) {
this.w = uni.upx2px(Number(val))
}
},
height(val) {
if (val) {
this.h = uni.upx2px(Number(val))
}
}
},
data() {
// #ifndef MP-WEIXIN
const canvasId = `fui_ag_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif
return {
// #ifdef APP-NVUE
isAndroid: true,
nTop: 0,
nLeft: 0,
// #endif
canvasId:canvasId,
w: 300,
h: 200,
completed: false,
autograph: false
};
},
created() {
let sys = uni.getSystemInfoSync()
// #ifdef APP-NVUE
this.isAndroid = sys.platform.toLocaleLowerCase() === "android";
// #endif
this.w = this.width == 0 ? sys.windowWidth : uni.upx2px(Number(this.width));
this.h = uni.upx2px(Number(this.height) || 400)
this.ctx = null;
this.touchs = null;
},
mounted() {
setTimeout(() => {
// #ifdef APP-NVUE
let ganvas = this.$refs[this.canvasId];
/*通过元素引用获取canvas对象*/
let canvasObj = enable(ganvas, {
bridge: WeexBridge
});
/*获取绘图所需的上下文,暂不支持3d*/
this.ctx = canvasObj.getContext('2d');
if (!this.isAndroid) {
this.getDom()
}
// #endif
// #ifndef APP-NVUE
this.ctx = uni.createCanvasContext(this.canvasId, this)
// #endif
// #ifdef MP-BAIDU
this.redraw()
// #endif
this.$emit('ready', {
canvasId: this.canvasId
})
}, 50)
},
// #ifndef VUE3
beforeDestroy() {
this.ctx = null;
this.touchs = null;
},
// #endif
// #ifdef VUE3
beforeUnmount() {
this.ctx = null;
this.touchs = null;
},
// #endif
methods: {
// #ifdef APP-NVUE
getDom() {
dom.getComponentRect(this.$refs['fui_gcanvas_ag'], option => {
if (option && option.result && option.size) {
this.nTop = option.size.top
this.nLeft = option.size.left
}
})
},
// #endif
isPC() {
var userAgentInfo = navigator.userAgent;
var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
var flag = true;
for (let v = 0; v < Agents.length - 1; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = false;
break;
}
}
return flag;
},
onTouchstart(e) {
if (this.completed) return;
let point = {};
// #ifndef APP-NVUE
point = {
x: e.touches[0].x,
y: e.touches[0].y
};
// #endif
// #ifdef APP-NVUE
point = {
x: e.touches[0].pageX - this.nLeft,
y: e.touches[0].pageY - this.nTop
};
// #endif
this.ctx.setStrokeStyle(this.color);
this.ctx.setLineWidth(this.lineWidth);
this.ctx.setLineCap('round');
this.touchs = [point];
},
mousedown(e) {
// #ifdef H5
if (!this.isPC() || this.completed) return;
let point = {
x: e.pageX - e.target.offsetLeft,
y: e.pageY - e.target.offsetTop
};
this.ctx.setStrokeStyle(this.color);
this.ctx.setLineWidth(this.lineWidth);
this.ctx.setLineCap('round');
this.touchs = [point];
// #endif
},
onTouchmove(e) {
if (this.completed) return;
let point = null;
// #ifndef APP-NVUE
point = {
x: e.touches[0].x,
y: e.touches[0].y
};
// #endif
// #ifdef APP-NVUE
//changedTouches
point = {
x: e.touches[0].pageX - this.nLeft,
y: e.touches[0].pageY - this.nTop
};
// #endif
point && this.touchs.push(point)
if (this.touchs.length >= 2) {
this.startDraw();
}
},
mousemove(e) {
// #ifdef H5
if (!this.isPC() || this.completed || !this.touchs) return;
let point = {
x: e.pageX - e.target.offsetLeft,
y: e.pageY - e.target.offsetTop
};
this.touchs.push(point)
if (this.touchs.length >= 2) {
this.startDraw();
}
// #endif
},
onTouchend(e) {
if (this.completed) return;
this.touchs = null
},
mouseup(e) {
// #ifdef H5
if (!this.isPC() || this.completed) return;
this.touchs = null
// #endif
},
mouseleave(e) {
// #ifdef H5
if (!this.isPC() || this.completed) return;
this.touchs = null
// #endif
},
onTouchCancel(e) {
if (this.completed) return;
// console.log('touchCancel:', e)
},
startDraw() {
this.autograph = true;
const point1 = this.touchs[0];
const point2 = this.touchs[1];
this.touchs.shift();
this.ctx.moveTo(point1.x, point1.y);
this.ctx.lineTo(point2.x, point2.y);
this.ctx.stroke();
this.ctx.draw(true);
},
//重新绘制
redraw() {
this.completed = false;
this.touchs = null;
this.autograph = false;
this.ctx.clearRect(0, 0, this.w, this.h);
this.ctx.beginPath()
this.ctx.draw();
},
drawComplete(callback) {
if (!this.autograph && this.tips && this.tips !== true && this.tips !== 'true') {
uni.showToast({
title: this.tips,
icon: 'none'
});
return;
}
this.completed = true;
const platform = uni.getSystemInfoSync().platform;
let time = 50;
if (platform === 'android') {
time = 200;
}
setTimeout(() => {
// #ifdef MP-ALIPAY
this.ctx.toTempFilePath({
success: res => {
callback && callback(res.apFilePath)
},
fail: err => {
callback && callback(false)
}
});
// #endif
// #ifndef MP-ALIPAY || APP-NVUE
uni.canvasToTempFilePath({
x: 0,
y: 0,
canvasId: this.canvasId,
fileType: 'png',
quality: 1,
success: function(res) {
callback && callback(res.tempFilePath)
},
fail() {
callback && callback(false)
}
}, this)
// #endif
// #ifdef APP-NVUE
this.ctx.toTempFilePath(
0,
0,
this.w * 2,
this.h * 2,
this.w * 2,
this.h * 2,
"png",
1,
function(res) {
callback && callback(res.tempFilePath)
},
function() {
callback && callback(false)
}
)
// #endif
}, time)
}
}
}
</script>
<style scoped></style>
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1561 626 0 1 95,身份证尾号: 5 0 375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
const isWeex = typeof WXEnvironment !== 'undefined';
const isWeexIOS = isWeex && /ios/i.test(WXEnvironment.platform);
const isWeexAndroid = isWeex && !isWeexIOS;
import GLmethod from '../context-webgl/GLmethod';
const GCanvasModule =
(typeof weex !== 'undefined' && weex.requireModule) ? (weex.requireModule('gcanvas')) :
(typeof __weex_require__ !== 'undefined') ? (__weex_require__('@weex-module/gcanvas')) : {};
let isDebugging = false;
let isComboDisabled = false;
const logCommand = (function () {
const methodQuery = [];
Object.keys(GLmethod).forEach(key => {
methodQuery[GLmethod[key]] = key;
})
const queryMethod = (id) => {
return methodQuery[parseInt(id)] || 'NotFoundMethod';
}
const logCommand = (id, cmds) => {
const mId = cmds.split(',')[0];
const mName = queryMethod(mId);
console.log(`=== callNative - componentId:${id}; method: ${mName}; cmds: ${cmds}`);
}
return logCommand;
})();
function joinArray(arr, sep) {
let res = '';
for (let i = 0; i < arr.length; i++) {
if (i !== 0) {
res += sep;
}
res += arr[i];
}
return res;
}
const commandsCache = {}
const GBridge = {
callEnable: (ref, configArray) => {
commandsCache[ref] = [];
return GCanvasModule.enable({
componentId: ref,
config: configArray
});
},
callEnableDebug: () => {
isDebugging = true;
},
callEnableDisableCombo: () => {
isComboDisabled = true;
},
callSetContextType: function (componentId, context_type) {
GCanvasModule.setContextType(context_type, componentId);
},
callReset: function(id){
GCanvasModule.resetComponent && canvasModule.resetComponent(componentId);
},
render: isWeexIOS ? function (componentId) {
return GCanvasModule.extendCallNative({
contextId: componentId,
type: 0x60000001
});
} : function (componentId) {
return callGCanvasLinkNative(componentId, 0x60000001, 'render');
},
render2d: isWeexIOS ? function (componentId, commands, callback) {
if (isDebugging) {
console.log('>>> >>> render2d ===');
console.log('>>> commands: ' + commands);
}
GCanvasModule.render([commands, callback?true:false], componentId, callback);
} : function (componentId, commands,callback) {
if (isDebugging) {
console.log('>>> >>> render2d ===');
console.log('>>> commands: ' + commands);
}
callGCanvasLinkNative(componentId, 0x20000001, commands);
if(callback){
callback();
}
},
callExtendCallNative: isWeexIOS ? function (componentId, cmdArgs) {
throw 'should not be here anymore ' + cmdArgs;
} : function (componentId, cmdArgs) {
throw 'should not be here anymore ' + cmdArgs;
},
flushNative: isWeexIOS ? function (componentId) {
const cmdArgs = joinArray(commandsCache[componentId], ';');
commandsCache[componentId] = [];
if (isDebugging) {
console.log('>>> >>> flush native ===');
console.log('>>> commands: ' + cmdArgs);
}
const result = GCanvasModule.extendCallNative({
"contextId": componentId,
"type": 0x60000000,
"args": cmdArgs
});
const res = result && result.result;
if (isDebugging) {
console.log('>>> result: ' + res);
}
return res;
} : function (componentId) {
const cmdArgs = joinArray(commandsCache[componentId], ';');
commandsCache[componentId] = [];
if (isDebugging) {
console.log('>>> >>> flush native ===');
console.log('>>> commands: ' + cmdArgs);
}
const result = callGCanvasLinkNative(componentId, 0x60000000, cmdArgs);
if (isDebugging) {
console.log('>>> result: ' + result);
}
return result;
},
callNative: function (componentId, cmdArgs, cache) {
if (isDebugging) {
logCommand(componentId, cmdArgs);
}
commandsCache[componentId].push(cmdArgs);
if (!cache || isComboDisabled) {
return GBridge.flushNative(componentId);
} else {
return undefined;
}
},
texImage2D(componentId, ...args) {
if (isWeexIOS) {
if (args.length === 6) {
const [target, level, internalformat, format, type, image] = args;
GBridge.callNative(
componentId,
GLmethod.texImage2D + ',' + 6 + ',' + target + ',' + level + ',' + internalformat + ',' + format + ',' + type + ',' + image.src
)
} else if (args.length === 9) {
const [target, level, internalformat, width, height, border, format, type, image] = args;
GBridge.callNative(
componentId,
GLmethod.texImage2D + ',' + 9 + ',' + target + ',' + level + ',' + internalformat + ',' + width + ',' + height + ',' + border + ',' +
+ format + ',' + type + ',' + (image ? image.src : 0)
)
}
} else if (isWeexAndroid) {
if (args.length === 6) {
const [target, level, internalformat, format, type, image] = args;
GCanvasModule.texImage2D(componentId, target, level, internalformat, format, type, image.src);
} else if (args.length === 9) {
const [target, level, internalformat, width, height, border, format, type, image] = args;
GCanvasModule.texImage2D(componentId, target, level, internalformat, width, height, border, format, type, (image ? image.src : 0));
}
}
},
texSubImage2D(componentId, target, level, xoffset, yoffset, format, type, image) {
if (isWeexIOS) {
if (arguments.length === 8) {
GBridge.callNative(
componentId,
GLmethod.texSubImage2D + ',' + 6 + ',' + target + ',' + level + ',' + xoffset + ',' + yoffset, + ',' + format + ',' + type + ',' + image.src
)
}
} else if (isWeexAndroid) {
GCanvasModule.texSubImage2D(componentId, target, level, xoffset, yoffset, format, type, image.src);
}
},
bindImageTexture(componentId, src, imageId) {
GCanvasModule.bindImageTexture([src, imageId], componentId);
},
perloadImage([url, id], callback) {
GCanvasModule.preLoadImage([url, id], function (image) {
image.url = url;
image.id = id;
callback(image);
});
},
measureText(text, fontStyle, componentId) {
return GCanvasModule.measureText([text, fontStyle], componentId);
},
getImageData (componentId, x, y, w, h, callback) {
GCanvasModule.getImageData([x, y,w,h],componentId,callback);
},
putImageData (componentId, data, x, y, w, h, callback) {
GCanvasModule.putImageData([x, y,w,h,data],componentId,callback);
},
toTempFilePath(componentId, x, y, width, height, destWidth, destHeight, fileType, quality, callback){
GCanvasModule.toTempFilePath([x, y, width,height, destWidth, destHeight, fileType, quality], componentId, callback);
}
}
export default GBridge;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1561 62 6 0 1 9 5,身份证尾号: 50 37 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStyleLinearGradient {
constructor(x0, y0, x1, y1) {
this._start_pos = { _x: x0, _y: y0 };
this._end_pos = { _x: x1, _y: y1 };
this._stop_count = 0;
this._stops = [0, 0, 0, 0, 0];
}
addColorStop = function (pos, color) {
if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) {
this._stops[this._stop_count] = { _pos: pos, _color: color };
this._stop_count++;
}
}
}
export default FillStyleLinearGradient;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1561626 0 1 95,身份证尾号:503 7 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStylePattern {
constructor(img, pattern) {
this._style = pattern;
this._img = img;
}
}
export default FillStylePattern;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 56 1626 0 1 9 5,身份证尾号:5 0 37 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStyleRadialGradient {
constructor(x0, y0, r0, x1, y1, r1) {
this._start_pos = { _x: x0, _y: y0, _r: r0 };
this._end_pos = { _x: x1, _y: y1, _r: r1 };
this._stop_count = 0;
this._stops = [0, 0, 0, 0, 0];
}
addColorStop(pos, color) {
if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) {
this._stops[this._stop_count] = { _pos: pos, _color: color };
this._stop_count++;
}
}
}
export default FillStyleRadialGradient;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 5 616 26 0 1 95,身份证尾号:50 37 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
export default class WebGLActiveInfo {
className = 'WebGLActiveInfo';
constructor({
type, name, size
}) {
this.type = type;
this.name = name;
this.size = size;
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 5 6 162 6 0 1 95,身份证尾号: 50 375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import {getTransferedObjectUUID} from './classUtils';
const name = 'WebGLBuffer';
function uuid(id) {
return getTransferedObjectUUID(name, id);
}
export default class WebGLBuffer {
className = name;
constructor(id) {
this.id = id;
}
static uuid = uuid;
uuid() {
return uuid(this.id);
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 5616 26 0 195,身份证尾号:50 3 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import {getTransferedObjectUUID} from './classUtils';
const name = 'WebGLFrameBuffer';
function uuid(id) {
return getTransferedObjectUUID(name, id);
}
export default class WebGLFramebuffer {
className = name;
constructor(id) {
this.id = id;
}
static uuid = uuid;
uuid() {
return uuid(this.id);
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1561 6 26 019 5,身份证尾号:5 0 37 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
export default {
"DEPTH_BUFFER_BIT": 256,
"STENCIL_BUFFER_BIT": 1024,
"COLOR_BUFFER_BIT": 16384,
"POINTS": 0,
"LINES": 1,
"LINE_LOOP": 2,
"LINE_STRIP": 3,
"TRIANGLES": 4,
"TRIANGLE_STRIP": 5,
"TRIANGLE_FAN": 6,
"ZERO": 0,
"ONE": 1,
"SRC_COLOR": 768,
"ONE_MINUS_SRC_COLOR": 769,
"SRC_ALPHA": 770,
"ONE_MINUS_SRC_ALPHA": 771,
"DST_ALPHA": 772,
"ONE_MINUS_DST_ALPHA": 773,
"DST_COLOR": 774,
"ONE_MINUS_DST_COLOR": 775,
"SRC_ALPHA_SATURATE": 776,
"FUNC_ADD": 32774,
"BLEND_EQUATION": 32777,
"BLEND_EQUATION_RGB": 32777,
"BLEND_EQUATION_ALPHA": 34877,
"FUNC_SUBTRACT": 32778,
"FUNC_REVERSE_SUBTRACT": 32779,
"BLEND_DST_RGB": 32968,
"BLEND_SRC_RGB": 32969,
"BLEND_DST_ALPHA": 32970,
"BLEND_SRC_ALPHA": 32971,
"CONSTANT_COLOR": 32769,
"ONE_MINUS_CONSTANT_COLOR": 32770,
"CONSTANT_ALPHA": 32771,
"ONE_MINUS_CONSTANT_ALPHA": 32772,
"BLEND_COLOR": 32773,
"ARRAY_BUFFER": 34962,
"ELEMENT_ARRAY_BUFFER": 34963,
"ARRAY_BUFFER_BINDING": 34964,
"ELEMENT_ARRAY_BUFFER_BINDING": 34965,
"STREAM_DRAW": 35040,
"STATIC_DRAW": 35044,
"DYNAMIC_DRAW": 35048,
"BUFFER_SIZE": 34660,
"BUFFER_USAGE": 34661,
"CURRENT_VERTEX_ATTRIB": 34342,
"FRONT": 1028,
"BACK": 1029,
"FRONT_AND_BACK": 1032,
"TEXTURE_2D": 3553,
"CULL_FACE": 2884,
"BLEND": 3042,
"DITHER": 3024,
"STENCIL_TEST": 2960,
"DEPTH_TEST": 2929,
"SCISSOR_TEST": 3089,
"POLYGON_OFFSET_FILL": 32823,
"SAMPLE_ALPHA_TO_COVERAGE": 32926,
"SAMPLE_COVERAGE": 32928,
"NO_ERROR": 0,
"INVALID_ENUM": 1280,
"INVALID_VALUE": 1281,
"INVALID_OPERATION": 1282,
"OUT_OF_MEMORY": 1285,
"CW": 2304,
"CCW": 2305,
"LINE_WIDTH": 2849,
"ALIASED_POINT_SIZE_RANGE": 33901,
"ALIASED_LINE_WIDTH_RANGE": 33902,
"CULL_FACE_MODE": 2885,
"FRONT_FACE": 2886,
"DEPTH_RANGE": 2928,
"DEPTH_WRITEMASK": 2930,
"DEPTH_CLEAR_VALUE": 2931,
"DEPTH_FUNC": 2932,
"STENCIL_CLEAR_VALUE": 2961,
"STENCIL_FUNC": 2962,
"STENCIL_FAIL": 2964,
"STENCIL_PASS_DEPTH_FAIL": 2965,
"STENCIL_PASS_DEPTH_PASS": 2966,
"STENCIL_REF": 2967,
"STENCIL_VALUE_MASK": 2963,
"STENCIL_WRITEMASK": 2968,
"STENCIL_BACK_FUNC": 34816,
"STENCIL_BACK_FAIL": 34817,
"STENCIL_BACK_PASS_DEPTH_FAIL": 34818,
"STENCIL_BACK_PASS_DEPTH_PASS": 34819,
"STENCIL_BACK_REF": 36003,
"STENCIL_BACK_VALUE_MASK": 36004,
"STENCIL_BACK_WRITEMASK": 36005,
"VIEWPORT": 2978,
"SCISSOR_BOX": 3088,
"COLOR_CLEAR_VALUE": 3106,
"COLOR_WRITEMASK": 3107,
"UNPACK_ALIGNMENT": 3317,
"PACK_ALIGNMENT": 3333,
"MAX_TEXTURE_SIZE": 3379,
"MAX_VIEWPORT_DIMS": 3386,
"SUBPIXEL_BITS": 3408,
"RED_BITS": 3410,
"GREEN_BITS": 3411,
"BLUE_BITS": 3412,
"ALPHA_BITS": 3413,
"DEPTH_BITS": 3414,
"STENCIL_BITS": 3415,
"POLYGON_OFFSET_UNITS": 10752,
"POLYGON_OFFSET_FACTOR": 32824,
"TEXTURE_BINDING_2D": 32873,
"SAMPLE_BUFFERS": 32936,
"SAMPLES": 32937,
"SAMPLE_COVERAGE_VALUE": 32938,
"SAMPLE_COVERAGE_INVERT": 32939,
"COMPRESSED_TEXTURE_FORMATS": 34467,
"DONT_CARE": 4352,
"FASTEST": 4353,
"NICEST": 4354,
"GENERATE_MIPMAP_HINT": 33170,
"BYTE": 5120,
"UNSIGNED_BYTE": 5121,
"SHORT": 5122,
"UNSIGNED_SHORT": 5123,
"INT": 5124,
"UNSIGNED_INT": 5125,
"FLOAT": 5126,
"DEPTH_COMPONENT": 6402,
"ALPHA": 6406,
"RGB": 6407,
"RGBA": 6408,
"LUMINANCE": 6409,
"LUMINANCE_ALPHA": 6410,
"UNSIGNED_SHORT_4_4_4_4": 32819,
"UNSIGNED_SHORT_5_5_5_1": 32820,
"UNSIGNED_SHORT_5_6_5": 33635,
"FRAGMENT_SHADER": 35632,
"VERTEX_SHADER": 35633,
"MAX_VERTEX_ATTRIBS": 34921,
"MAX_VERTEX_UNIFORM_VECTORS": 36347,
"MAX_VARYING_VECTORS": 36348,
"MAX_COMBINED_TEXTURE_IMAGE_UNITS": 35661,
"MAX_VERTEX_TEXTURE_IMAGE_UNITS": 35660,
"MAX_TEXTURE_IMAGE_UNITS": 34930,
"MAX_FRAGMENT_UNIFORM_VECTORS": 36349,
"SHADER_TYPE": 35663,
"DELETE_STATUS": 35712,
"LINK_STATUS": 35714,
"VALIDATE_STATUS": 35715,
"ATTACHED_SHADERS": 35717,
"ACTIVE_UNIFORMS": 35718,
"ACTIVE_ATTRIBUTES": 35721,
"SHADING_LANGUAGE_VERSION": 35724,
"CURRENT_PROGRAM": 35725,
"NEVER": 512,
"LESS": 513,
"EQUAL": 514,
"LEQUAL": 515,
"GREATER": 516,
"NOTEQUAL": 517,
"GEQUAL": 518,
"ALWAYS": 519,
"KEEP": 7680,
"REPLACE": 7681,
"INCR": 7682,
"DECR": 7683,
"INVERT": 5386,
"INCR_WRAP": 34055,
"DECR_WRAP": 34056,
"VENDOR": 7936,
"RENDERER": 7937,
"VERSION": 7938,
"NEAREST": 9728,
"LINEAR": 9729,
"NEAREST_MIPMAP_NEAREST": 9984,
"LINEAR_MIPMAP_NEAREST": 9985,
"NEAREST_MIPMAP_LINEAR": 9986,
"LINEAR_MIPMAP_LINEAR": 9987,
"TEXTURE_MAG_FILTER": 10240,
"TEXTURE_MIN_FILTER": 10241,
"TEXTURE_WRAP_S": 10242,
"TEXTURE_WRAP_T": 10243,
"TEXTURE": 5890,
"TEXTURE_CUBE_MAP": 34067,
"TEXTURE_BINDING_CUBE_MAP": 34068,
"TEXTURE_CUBE_MAP_POSITIVE_X": 34069,
"TEXTURE_CUBE_MAP_NEGATIVE_X": 34070,
"TEXTURE_CUBE_MAP_POSITIVE_Y": 34071,
"TEXTURE_CUBE_MAP_NEGATIVE_Y": 34072,
"TEXTURE_CUBE_MAP_POSITIVE_Z": 34073,
"TEXTURE_CUBE_MAP_NEGATIVE_Z": 34074,
"MAX_CUBE_MAP_TEXTURE_SIZE": 34076,
"TEXTURE0": 33984,
"TEXTURE1": 33985,
"TEXTURE2": 33986,
"TEXTURE3": 33987,
"TEXTURE4": 33988,
"TEXTURE5": 33989,
"TEXTURE6": 33990,
"TEXTURE7": 33991,
"TEXTURE8": 33992,
"TEXTURE9": 33993,
"TEXTURE10": 33994,
"TEXTURE11": 33995,
"TEXTURE12": 33996,
"TEXTURE13": 33997,
"TEXTURE14": 33998,
"TEXTURE15": 33999,
"TEXTURE16": 34000,
"TEXTURE17": 34001,
"TEXTURE18": 34002,
"TEXTURE19": 34003,
"TEXTURE20": 34004,
"TEXTURE21": 34005,
"TEXTURE22": 34006,
"TEXTURE23": 34007,
"TEXTURE24": 34008,
"TEXTURE25": 34009,
"TEXTURE26": 34010,
"TEXTURE27": 34011,
"TEXTURE28": 34012,
"TEXTURE29": 34013,
"TEXTURE30": 34014,
"TEXTURE31": 34015,
"ACTIVE_TEXTURE": 34016,
"REPEAT": 10497,
"CLAMP_TO_EDGE": 33071,
"MIRRORED_REPEAT": 33648,
"FLOAT_VEC2": 35664,
"FLOAT_VEC3": 35665,
"FLOAT_VEC4": 35666,
"INT_VEC2": 35667,
"INT_VEC3": 35668,
"INT_VEC4": 35669,
"BOOL": 35670,
"BOOL_VEC2": 35671,
"BOOL_VEC3": 35672,
"BOOL_VEC4": 35673,
"FLOAT_MAT2": 35674,
"FLOAT_MAT3": 35675,
"FLOAT_MAT4": 35676,
"SAMPLER_2D": 35678,
"SAMPLER_CUBE": 35680,
"VERTEX_ATTRIB_ARRAY_ENABLED": 34338,
"VERTEX_ATTRIB_ARRAY_SIZE": 34339,
"VERTEX_ATTRIB_ARRAY_STRIDE": 34340,
"VERTEX_ATTRIB_ARRAY_TYPE": 34341,
"VERTEX_ATTRIB_ARRAY_NORMALIZED": 34922,
"VERTEX_ATTRIB_ARRAY_POINTER": 34373,
"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING": 34975,
"IMPLEMENTATION_COLOR_READ_TYPE": 35738,
"IMPLEMENTATION_COLOR_READ_FORMAT": 35739,
"COMPILE_STATUS": 35713,
"LOW_FLOAT": 36336,
"MEDIUM_FLOAT": 36337,
"HIGH_FLOAT": 36338,
"LOW_INT": 36339,
"MEDIUM_INT": 36340,
"HIGH_INT": 36341,
"FRAMEBUFFER": 36160,
"RENDERBUFFER": 36161,
"RGBA4": 32854,
"RGB5_A1": 32855,
"RGB565": 36194,
"DEPTH_COMPONENT16": 33189,
"STENCIL_INDEX8": 36168,
"DEPTH_STENCIL": 34041,
"RENDERBUFFER_WIDTH": 36162,
"RENDERBUFFER_HEIGHT": 36163,
"RENDERBUFFER_INTERNAL_FORMAT": 36164,
"RENDERBUFFER_RED_SIZE": 36176,
"RENDERBUFFER_GREEN_SIZE": 36177,
"RENDERBUFFER_BLUE_SIZE": 36178,
"RENDERBUFFER_ALPHA_SIZE": 36179,
"RENDERBUFFER_DEPTH_SIZE": 36180,
"RENDERBUFFER_STENCIL_SIZE": 36181,
"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE": 36048,
"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME": 36049,
"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL": 36050,
"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE": 36051,
"COLOR_ATTACHMENT0": 36064,
"DEPTH_ATTACHMENT": 36096,
"STENCIL_ATTACHMENT": 36128,
"DEPTH_STENCIL_ATTACHMENT": 33306,
"NONE": 0,
"FRAMEBUFFER_COMPLETE": 36053,
"FRAMEBUFFER_INCOMPLETE_ATTACHMENT": 36054,
"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT": 36055,
"FRAMEBUFFER_INCOMPLETE_DIMENSIONS": 36057,
"FRAMEBUFFER_UNSUPPORTED": 36061,
"FRAMEBUFFER_BINDING": 36006,
"RENDERBUFFER_BINDING": 36007,
"MAX_RENDERBUFFER_SIZE": 34024,
"INVALID_FRAMEBUFFER_OPERATION": 1286,
"UNPACK_FLIP_Y_WEBGL": 37440,
"UNPACK_PREMULTIPLY_ALPHA_WEBGL": 37441,
"CONTEXT_LOST_WEBGL": 37442,
"UNPACK_COLORSPACE_CONVERSION_WEBGL": 37443,
"BROWSER_DEFAULT_WEBGL": 37444
};
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:15 6 16 2 60 1 95,身份证尾号:5 0 3 7 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
let i = 1;
const GLmethod = {};
GLmethod.activeTexture = i++; //1
GLmethod.attachShader = i++;
GLmethod.bindAttribLocation = i++;
GLmethod.bindBuffer = i++;
GLmethod.bindFramebuffer = i++;
GLmethod.bindRenderbuffer = i++;
GLmethod.bindTexture = i++;
GLmethod.blendColor = i++;
GLmethod.blendEquation = i++;
GLmethod.blendEquationSeparate = i++; //10
GLmethod.blendFunc = i++;
GLmethod.blendFuncSeparate = i++;
GLmethod.bufferData = i++;
GLmethod.bufferSubData = i++;
GLmethod.checkFramebufferStatus = i++;
GLmethod.clear = i++;
GLmethod.clearColor = i++;
GLmethod.clearDepth = i++;
GLmethod.clearStencil = i++;
GLmethod.colorMask = i++; //20
GLmethod.compileShader = i++;
GLmethod.compressedTexImage2D = i++;
GLmethod.compressedTexSubImage2D = i++;
GLmethod.copyTexImage2D = i++;
GLmethod.copyTexSubImage2D = i++;
GLmethod.createBuffer = i++;
GLmethod.createFramebuffer = i++;
GLmethod.createProgram = i++;
GLmethod.createRenderbuffer = i++;
GLmethod.createShader = i++; //30
GLmethod.createTexture = i++;
GLmethod.cullFace = i++;
GLmethod.deleteBuffer = i++;
GLmethod.deleteFramebuffer = i++;
GLmethod.deleteProgram = i++;
GLmethod.deleteRenderbuffer = i++;
GLmethod.deleteShader = i++;
GLmethod.deleteTexture = i++;
GLmethod.depthFunc = i++;
GLmethod.depthMask = i++; //40
GLmethod.depthRange = i++;
GLmethod.detachShader = i++;
GLmethod.disable = i++;
GLmethod.disableVertexAttribArray = i++;
GLmethod.drawArrays = i++;
GLmethod.drawArraysInstancedANGLE = i++;
GLmethod.drawElements = i++;
GLmethod.drawElementsInstancedANGLE = i++;
GLmethod.enable = i++;
GLmethod.enableVertexAttribArray = i++; //50
GLmethod.flush = i++;
GLmethod.framebufferRenderbuffer = i++;
GLmethod.framebufferTexture2D = i++;
GLmethod.frontFace = i++;
GLmethod.generateMipmap = i++;
GLmethod.getActiveAttrib = i++;
GLmethod.getActiveUniform = i++;
GLmethod.getAttachedShaders = i++;
GLmethod.getAttribLocation = i++;
GLmethod.getBufferParameter = i++; //60
GLmethod.getContextAttributes = i++;
GLmethod.getError = i++;
GLmethod.getExtension = i++;
GLmethod.getFramebufferAttachmentParameter = i++;
GLmethod.getParameter = i++;
GLmethod.getProgramInfoLog = i++;
GLmethod.getProgramParameter = i++;
GLmethod.getRenderbufferParameter = i++;
GLmethod.getShaderInfoLog = i++;
GLmethod.getShaderParameter = i++; //70
GLmethod.getShaderPrecisionFormat = i++;
GLmethod.getShaderSource = i++;
GLmethod.getSupportedExtensions = i++;
GLmethod.getTexParameter = i++;
GLmethod.getUniform = i++;
GLmethod.getUniformLocation = i++;
GLmethod.getVertexAttrib = i++;
GLmethod.getVertexAttribOffset = i++;
GLmethod.isBuffer = i++;
GLmethod.isContextLost = i++; //80
GLmethod.isEnabled = i++;
GLmethod.isFramebuffer = i++;
GLmethod.isProgram = i++;
GLmethod.isRenderbuffer = i++;
GLmethod.isShader = i++;
GLmethod.isTexture = i++;
GLmethod.lineWidth = i++;
GLmethod.linkProgram = i++;
GLmethod.pixelStorei = i++;
GLmethod.polygonOffset = i++; //90
GLmethod.readPixels = i++;
GLmethod.renderbufferStorage = i++;
GLmethod.sampleCoverage = i++;
GLmethod.scissor = i++;
GLmethod.shaderSource = i++;
GLmethod.stencilFunc = i++;
GLmethod.stencilFuncSeparate = i++;
GLmethod.stencilMask = i++;
GLmethod.stencilMaskSeparate = i++;
GLmethod.stencilOp = i++; //100
GLmethod.stencilOpSeparate = i++;
GLmethod.texImage2D = i++;
GLmethod.texParameterf = i++;
GLmethod.texParameteri = i++;
GLmethod.texSubImage2D = i++;
GLmethod.uniform1f = i++;
GLmethod.uniform1fv = i++;
GLmethod.uniform1i = i++;
GLmethod.uniform1iv = i++;
GLmethod.uniform2f = i++; //110
GLmethod.uniform2fv = i++;
GLmethod.uniform2i = i++;
GLmethod.uniform2iv = i++;
GLmethod.uniform3f = i++;
GLmethod.uniform3fv = i++;
GLmethod.uniform3i = i++;
GLmethod.uniform3iv = i++;
GLmethod.uniform4f = i++;
GLmethod.uniform4fv = i++;
GLmethod.uniform4i = i++; //120
GLmethod.uniform4iv = i++;
GLmethod.uniformMatrix2fv = i++;
GLmethod.uniformMatrix3fv = i++;
GLmethod.uniformMatrix4fv = i++;
GLmethod.useProgram = i++;
GLmethod.validateProgram = i++;
GLmethod.vertexAttrib1f = i++; //new
GLmethod.vertexAttrib2f = i++; //new
GLmethod.vertexAttrib3f = i++; //new
GLmethod.vertexAttrib4f = i++; //new //130
GLmethod.vertexAttrib1fv = i++; //new
GLmethod.vertexAttrib2fv = i++; //new
GLmethod.vertexAttrib3fv = i++; //new
GLmethod.vertexAttrib4fv = i++; //new
GLmethod.vertexAttribPointer = i++;
GLmethod.viewport = i++;
export default GLmethod;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 5 6 16 260 1 95,身份证尾号:5 03 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
const GLtype = {};
[
"GLbitfield",
"GLboolean",
"GLbyte",
"GLclampf",
"GLenum",
"GLfloat",
"GLint",
"GLintptr",
"GLsizei",
"GLsizeiptr",
"GLshort",
"GLubyte",
"GLuint",
"GLushort"
].sort().map((typeName, i) => GLtype[typeName] = 1 >> (i + 1));
export default GLtype;
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 5 6 1 626 01 95,身份证尾号: 5 03 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import {getTransferedObjectUUID} from './classUtils';
const name = 'WebGLProgram';
function uuid(id) {
return getTransferedObjectUUID(name, id);
}
export default class WebGLProgram {
className = name;
constructor(id) {
this.id = id;
}
static uuid = uuid;
uuid() {
return uuid(this.id);
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 5 61 62 6 0 19 5,身份证尾号: 5 037 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import {getTransferedObjectUUID} from './classUtils';
const name = 'WebGLRenderBuffer';
function uuid(id) {
return getTransferedObjectUUID(name, id);
}
export default class WebGLRenderbuffer {
className = name;
constructor(id) {
this.id = id;
}
static uuid = uuid;
uuid() {
return uuid(this.id);
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1561 62 6 01 9 5,身份证尾号:5 03 7 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import {getTransferedObjectUUID} from './classUtils';
const name = 'WebGLShader';
function uuid(id) {
return getTransferedObjectUUID(name, id);
}
export default class WebGLShader {
className = name;
constructor(id, type) {
this.id = id;
this.type = type;
}
static uuid = uuid;
uuid() {
return uuid(this.id);
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:15 6 1 6260 1 9 5,身份证尾号: 5 03 7 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
export default class WebGLShaderPrecisionFormat {
className = 'WebGLShaderPrecisionFormat';
constructor({
rangeMin, rangeMax, precision
}) {
this.rangeMin = rangeMin;
this.rangeMax = rangeMax;
this.precision = precision;
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 5616 2 60 19 5,身份证尾号:50 3 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import {getTransferedObjectUUID} from './classUtils';
const name = 'WebGLTexture';
function uuid(id) {
return getTransferedObjectUUID(name, id);
}
export default class WebGLTexture {
className = name;
constructor(id, type) {
this.id = id;
this.type = type;
}
static uuid = uuid;
uuid() {
return uuid(this.id);
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:15616 26 01 9 5,身份证尾号: 5 0 37 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import {getTransferedObjectUUID} from './classUtils';
const name = 'WebGLUniformLocation';
function uuid(id) {
return getTransferedObjectUUID(name, id);
}
export default class WebGLUniformLocation {
className = name;
constructor(id, type) {
this.id = id;
this.type = type;
}
static uuid = uuid;
uuid() {
return uuid(this.id);
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:15 616 26 01 95,身份证尾号: 5 0375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
export function getTransferedObjectUUID(name, id) {
return `${name.toLowerCase()}-${id}`;
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 5 61 62601 95,身份证尾号:5 03 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import GContext2D from '../context-2d/RenderingContext';
import GContextWebGL from '../context-webgl/RenderingContext';
export default class GCanvas {
// static GBridge = null;
id = null;
_needRender = true;
constructor(id, { disableAutoSwap }) {
this.id = id;
this._disableAutoSwap = disableAutoSwap;
if (disableAutoSwap) {
this._swapBuffers = () => {
GCanvas.GBridge.render(this.id);
}
}
}
getContext(type) {
let context = null;
if (type.match(/webgl/i)) {
context = new GContextWebGL(this);
context.componentId = this.id;
if (!this._disableAutoSwap) {
const render = () => {
if (this._needRender) {
GCanvas.GBridge.render(this.id);
this._needRender = false;
}
}
setInterval(render, 16);
}
GCanvas.GBridge.callSetContextType(this.id, 1); // 0 for 2d; 1 for webgl
} else if (type.match(/2d/i)) {
context = new GContext2D(this);
context.componentId = this.id;
// const render = ( callback ) => {
//
// const commands = context._drawCommands;
// context._drawCommands = '';
//
// GCanvas.GBridge.render2d(this.id, commands, callback);
// this._needRender = false;
// }
// //draw方法触发
// context._flush = render;
// //setInterval(render, 16);
GCanvas.GBridge.callSetContextType(this.id, 0);
} else {
throw new Error('not supported context ' + type);
}
return context;
}
reset() {
GCanvas.GBridge.callReset(this.id);
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 15 6 1 6 26 01 95,身份证尾号: 50 37 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
let incId = 1;
const noop = function () { };
class GImage {
static GBridge = null;
constructor() {
this._id = incId++;
this._width = 0;
this._height = 0;
this._src = undefined;
this._onload = noop;
this._onerror = noop;
this.complete = false;
}
get width() {
return this._width;
}
set width(v) {
this._width = v;
}
get height() {
return this._height;
}
set height(v) {
this._height = v;
}
get src() {
return this._src;
}
set src(v) {
if (v.startsWith('//')) {
v = 'http:' + v;
}
this._src = v;
GImage.GBridge.perloadImage([this._src, this._id], (data) => {
if (typeof data === 'string') {
data = JSON.parse(data);
}
if (data.error) {
var evt = { type: 'error', target: this };
this.onerror(evt);
} else {
this.complete = true;
this.width = typeof data.width === 'number' ? data.width : 0;
this.height = typeof data.height === 'number' ? data.height : 0;
var evt = { type: 'load', target: this };
this.onload(evt);
}
});
}
addEventListener(name, listener) {
if (name === 'load') {
this.onload = listener;
} else if (name === 'error') {
this.onerror = listener;
}
}
removeEventListener(name, listener) {
if (name === 'load') {
this.onload = noop;
} else if (name === 'error') {
this.onerror = noop;
}
}
get onload() {
return this._onload;
}
set onload(v) {
this._onload = v;
}
get onerror() {
return this._onerror;
}
set onerror(v) {
this._onerror = v;
}
}
export default GImage;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 56 16 2 6 0195,身份证尾号:50 3 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
export function ArrayBufferToBase64 (buffer) {
var binary = '';
var bytes = new Uint8ClampedArray(buffer);
for (var len = bytes.byteLength, i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i]);
}
return btoa(binary);
}
export function Base64ToUint8ClampedArray(base64String) {
const padding = '='.repeat((4 - base64String.length % 4) % 4);
const base64 = (base64String + padding)
.replace(/\-/g, '+')
.replace(/_/g, '/');
const rawData = atob(base64);
const outputArray = new Uint8ClampedArray(rawData.length);
for (let i = 0; i < rawData.length; ++i) {
outputArray[i] = rawData.charCodeAt(i);
}
return outputArray;
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 156 1 62 60195,身份证尾号: 50 375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import GCanvas from './env/canvas';
import GImage from './env/image';
import GWebGLRenderingContext from './context-webgl/RenderingContext';
import GContext2D from './context-2d/RenderingContext';
import GBridgeWeex from './bridge/bridge-weex';
export let Image = GImage;
export let WeexBridge = GBridgeWeex;
export function enable(el, {
bridge,
debug,
disableAutoSwap,
disableComboCommands
} = {}) {
const GBridge = GImage.GBridge = GCanvas.GBridge = GWebGLRenderingContext.GBridge = GContext2D.GBridge = bridge;
GBridge.callEnable(el.ref, [
0, // renderMode: 0--RENDERMODE_WHEN_DIRTY, 1--RENDERMODE_CONTINUOUSLY
-1, // hybridLayerType: 0--LAYER_TYPE_NONE 1--LAYER_TYPE_SOFTWARE 2--LAYER_TYPE_HARDWARE
false, // supportScroll
false, // newCanvasMode
1, // compatible
'white', // clearColor
false // sameLevel: newCanvasMode = true && true => GCanvasView and Webview is same level
]);
if (debug === true) {
GBridge.callEnableDebug();
}
if (disableComboCommands) {
GBridge.callEnableDisableCombo();
}
var canvas = new GCanvas(el.ref, {
disableAutoSwap
});
let pixelRatio = uni.getSystemInfoSync().pixelRatio;
canvas.width = el.style.width * pixelRatio;
canvas.height = el.style.height * pixelRatio;
return canvas;
};
\ No newline at end of file
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 5 61626 0 195,身份证尾号: 5 0375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<view class="fui-avatar__wrap" :class="[width?'':'fui-avatar__size-'+size,radius===-1?'fui-avatar__'+shape:'']"
:style="wrapStyles" @tap="handleClick">
<image class="fui-avatar__img" :style="styles"
:class="[radius===-1?'fui-avatar__'+shape:'',width?'':'fui-avatar__size-'+size]" :src="src" :mode="mode"
v-if="src" :webp="webp" :lazy-load="lazyLoad"></image>
<text class="fui-avatar__text" :class="[width?'':'fui-avatar__text-'+size]" v-if="!src && text"
:style="textStyles">{{text}}</text>
<slot></slot>
</view>
</template>
<script>
export default {
name: "fui-avatar",
emits: ['click'],
props: {
src: {
type: String,
default: ''
},
mode: {
type: String,
default: 'widthFix'
},
//微信小程序、百度小程序、字节跳动小程序
//图片懒加载。只针对page与scroll-view下的image有效
lazyLoad: {
type: Boolean,
default: true
},
//默认不解析 webP 格式,只支持网络资源 微信小程序2.9.0
webp: {
type: Boolean,
default: false
},
background: {
type: String,
default: '#D1D1D1'
},
//small(64)、middle(96)、large(128)
size: {
type: String,
default: 'middle'
},
//图片宽度,设置大于0的数值生效,默认使用size
width: {
type: [Number, String],
default: 0
},
//默认等宽,设置图大于0的数值且设置了图片宽度生效
height: {
type: [Number, String],
default: 0
},
//指定头像的形状,可选值为 circle、square
shape: {
type: String,
default: 'circle'
},
//图片圆角值,默认使用shape,当设置大于等于0的数值,shape失效
radius: {
type: [Number, String],
default: -1
},
//没有src时可以使用文本代替
text: {
type: String,
default: ''
},
color: {
type: String,
default: '#fff'
},
//默认使用size下字体大小
fontSize: {
type: [Number, String],
default: 0
},
fontWeight: {
type: [Number, String],
default: 600
},
marginRight: {
type: [Number, String],
default: 0
},
marginBottom: {
type: [Number, String],
default: 0
},
//在列表中的索引值
index: {
type: Number,
default: 0
},
//其他参数
params: {
type: [Number, String],
default: 0
}
},
computed: {
wrapStyles() {
return `background:${this.background};margin-right:${this.marginRight}rpx;margin-bottom:${this.marginBottom}rpx;${this.styles}`
},
styles() {
let styles = '';
if (this.width) {
styles = `width:${this.width}rpx;height:${this.height || this.width}rpx;`
}
if (this.radius !== -1) {
styles += `border-radius:${this.radius}rpx;`
}
return styles;
},
textStyles() {
let styles = `color:${this.color};font-weight:${this.fontWeight};`;
if (this.fontSize) {
styles += `font-size:${this.fontSize}rpx;`
}
return styles;
}
},
methods: {
handleClick() {
this.$emit('click', {
index: this.index,
params: this.params
})
}
}
}
</script>
<style scoped>
.fui-avatar__wrap {
position: relative;
/* #ifndef APP-NVUE */
display: inline-flex;
overflow: hidden;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
}
.fui-avatar__img {
flex: 1;
/* #ifndef APP-NVUE */
display: block;
object-fit: cover;
/* #endif */
}
.fui-avatar__text {
flex: 1;
/* #ifndef APP-NVUE */
display: block;
white-space: nowrap;
box-sizing: border-box;
/* #endif */
/* #ifdef APP-NVUE */
lines: 1;
/* #endif */
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
}
.fui-avatar__size-small {
width: 64rpx !important;
height: 64rpx !important;
}
.fui-avatar__text-small {
font-size: 32rpx !important;
}
.fui-avatar__size-middle {
width: 96rpx !important;
height: 96rpx !important;
}
.fui-avatar__text-middle {
font-size: 44rpx !important;
}
.fui-avatar__size-large {
width: 128rpx !important;
height: 128rpx !important;
}
.fui-avatar__text-large {
font-size: 56rpx !important;
}
.fui-avatar__circle {
/* #ifdef APP-NVUE */
border-radius: 500px !important;
/* #endif */
/* #ifndef APP-NVUE */
border-radius: 50% !important;
/* #endif */
}
.fui-avatar__square {
border-radius: 8rpx !important;
}
</style>
\ No newline at end of file
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:156 1 6 2 601 95,身份证尾号: 50 375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<!-- #ifdef APP-NVUE -->
<view ref="fui_bd_ani" class="fui-backdrop__wrap"
:style="{background:background,position:absolute?'absolute':'fixed',width:absolute && full ?winWidth+'px':'100%',height:absolute && full ?winHeight+'px':'100%'}"
@tap.stop="handleClick">
<slot></slot>
</view>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<view class="fui-backdrop__wrap" :class="{'fui-backdrop__bg':!background,'fui-backdrop__show':show}"
:style="{background:background,position:absolute?'absolute':'fixed',zIndex:zIndex}" @tap.stop="handleClick">
<slot></slot>
</view>
<!-- #endif -->
</template>
<script>
// #ifdef APP-NVUE
const animation = uni.requireNativePlugin('animation');
// #endif
export default {
name: "fui-backdrop",
emits: ['click'],
props: {
show: {
type: Boolean,
default: false
},
background: {
type: String,
// #ifdef APP-NVUE
default: 'rgba(0, 0, 0, 0.6)',
// #endif
// #ifndef APP-NVUE
default: ''
// #endif
},
//是否绝对定位,默认固定定位fixed
absolute: {
type: Boolean,
default: false
},
//absolute定位且组件在根目录下时是否铺满屏幕,仅nvue有效
full: {
type: Boolean,
default: false
},
zIndex: {
type: Number,
default: 999
},
closable: {
type: Boolean,
default: false
}
},
// #ifdef APP-NVUE
watch: {
show(val) {
if (val) {
this.openAni()
} else {
this.closeAni()
}
}
},
mounted() {
this.$nextTick(() => {
if (this.show) {
this._ani(true)
} else {
this._aniHidden(this.show)
}
})
},
data() {
return {
winWidth: 300,
winHeight: 600
}
},
created() {
let sys = uni.getSystemInfoSync()
this.winWidth = sys.windowWidth
this.winHeight = sys.windowHeight
},
// #endif
methods: {
// #ifdef APP-NVUE
openAni() {
this._aniHidden(true, () => {
this._ani(true)
})
},
closeAni(type) {
this._ani(false, () => {
this._aniHidden(false)
});
},
_ani(type, callback) {
let styles = {
opacity: type ? 1 : 0
};
if (!this.$refs['fui_bd_ani']) return;
animation.transition(
this.$refs['fui_bd_ani'].ref, {
styles,
duration: 200, //ms
timingFunction: 'ease-in',
needLayout: false,
delay: 0 //ms
},
() => {
callback && callback()
}
);
},
_aniHidden(isShow, callback) {
if (!this.$refs['fui_bd_ani']) return;
let styles = {
transform: isShow ? 'translateX(0px)' : 'translateX(-1500px)'
};
animation.transition(
this.$refs['fui_bd_ani'].ref, {
styles,
duration: 0,
needLayout: false,
delay: 0
},
() => {
callback && callback()
}
);
},
// #endif
handleClick() {
if (this.closable && this.show) {
this.$emit('click')
}
}
}
}
</script>
<style scoped>
.fui-backdrop__wrap {
left: 0;
right: 0;
top: 0;
bottom: 0;
/* #ifndef APP-NVUE */
display: flex;
visibility: hidden;
transition: all 0.3s;
/* #endif */
align-items: center;
justify-content: center;
opacity: 0;
}
/* #ifndef APP-NVUE */
.fui-backdrop__bg {
background: var(--fui-bg-color-mask, rgba(0, 0, 0, 0.6)) !important;
}
.fui-backdrop__show {
visibility: visible !important;
opacity: 1 !important;
}
/* #endif */
</style>
\ No newline at end of file
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:156 1 6 2 60195,身份证尾号:5 03 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<view class="fui-backtop__wrap"
:style="{width:width+'rpx',height:width+'rpx',borderRadius:isNvue?width+'rpx':'50%' ,bottom: bottom + 'rpx', right: right + 'rpx',background:background }"
v-if="isShow && visible" @tap.stop="goBacktop">
<fui-icon :name="name" :size="52" :color="color" v-if="!custom"></fui-icon>
<slot></slot>
</view>
</template>
<script>
//非easycom模式取消注释引入字体组件,按实际路径进行调整
// import fuiIcon from "@/components/firstui/fui-icon/fui-icon"
export default {
name: "fui-backtop",
emits: ['click'],
// components:{
// fuiIcon
// },
props: {
scrollTop: {
type: [Number, String]
},
targetRef: {
type: String,
default: ''
},
threshold: {
type: [Number, String],
default: 320
},
width: {
type: [Number, String],
default: 80
},
bottom: {
type: [Number, String],
default: 160
},
right: {
type: [Number, String],
default: 40
},
background: {
type: String,
default: '#FFFFFF'
},
name: {
type: String,
default: 'top'
},
color: {
type: String,
default: '#333333'
},
custom: {
type: Boolean,
default: false
}
},
watch: {
scrollTop(newValue, oldValue) {
this.scrollChange();
}
},
data() {
let isNvue = false;
// #ifdef APP-NVUE
isNvue = true;
// #endif
return {
isNvue: isNvue,
isShow: false,
visible: true
};
},
methods: {
goBacktop: function() {
// #ifndef APP-NVUE
//防止fixed元素先消失再显示
this.visible = false;
uni.pageScrollTo({
scrollTop: 0,
duration: 120
});
setTimeout(() => {
this.visible = true;
}, 220);
// #endif
// #ifdef APP-NVUE
if (this.targetRef) {
dom.scrollToElement(this.targetRef, {});
}
// #endif
this.$emit('click', {})
},
scrollChange() {
let show = this.scrollTop > this.threshold;
if ((show && this.isShow) || (!show && !this.isShow)) return;
this.isShow = show;
}
}
}
</script>
<style scoped>
.fui-backtop__wrap {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
position: fixed;
z-index: 888;
box-shadow: 0 0 6px rgb(0 0 0 / 12%);
justify-content: center;
align-items: center;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
</style>
\ No newline at end of file
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 56 16 260 195,身份证尾号:503 7 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<text
:class="[dot?'fui-badge__dot':'fui-badge__wrap',background?'':('fui-badge__bg-'+type),absolute?'fui-badge__absolute':'',scaleRatio!=1 && isNvue?'fui-badge__trans-origin':'',!background && type==='white'?'fui-badge__text-color':'']"
:style="{top:absolute?top:'auto',right:absolute?right:'auto',zoom:scaleRatio,transform:isNvue?`scale(${scaleRatio})`:'scale(1)',marginTop:marginTop+'rpx',marginLeft:marginLeft+'rpx',marginRight:marginRight+'rpx',width:width,color:color,background:background}"
@tap="handleClick" v-if="showValue || dot">{{dot?'':showValue}}</text>
</template>
<script>
export default {
name: "fui-badge",
emits: ['click'],
props: {
value: {
type: [Number, String],
default: ''
},
max: {
type: [Number, String],
default: -1
},
//类型:primary,success,warning,danger,purple,white
type: {
type: String,
default: 'primary'
},
//背景色,如果设置背景则type失效
background: {
type: String,
default: ''
},
//字体颜色
color: {
type: String,
default: '#FFFFFF'
},
//是否显示为圆点
dot: {
type: Boolean,
default: false
},
//margin-top值,单位rpx
marginTop: {
type: [Number, String],
default: 0
},
//margin-left值,单位rpx
marginLeft: {
type: [Number, String],
default: 0
},
//margin-right值,单位rpx
marginRight: {
type: [Number, String],
default: 0
},
//是否绝对定位
absolute: {
type: Boolean,
default: false
},
top: {
type: String,
default: '-8rpx'
},
right: {
type: String,
default: '-18rpx'
},
//缩放比例
scaleRatio: {
type: Number,
default: 1
}
},
data() {
let isNvue = false;
// #ifdef APP-NVUE
isNvue = true;
// #endif
return {
isNvue: isNvue,
width: 0,
showValue: ''
};
},
watch: {
value(val) {
this.getWidth()
}
},
mounted() {
this.getWidth()
},
methods: {
getWidth() {
let max = Number(this.max)
let val = Number(this.value)
let value = ''
if (isNaN(val) || max === -1) {
value = this.value
} else {
value = val > max ? `${max}+` : val
}
this.showValue = value;
this.width = this.dot ? '8px' : ((String(value).length * 16 + 21) + 'rpx')
},
handleClick() {
this.$emit('click');
}
}
}
</script>
<style scoped>
.fui-badge__wrap {
height: 36rpx;
padding: 0 12rpx;
color: #FFFFFF;
font-size: 24rpx;
line-height: 36rpx;
border-radius: 100px;
/* #ifndef APP-NVUE */
min-width: 36rpx !important;
display: flex;
box-sizing: border-box;
white-space: nowrap;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
z-index: 10;
}
.fui-badge__dot {
height: 8px !important;
width: 8px !important;
/* #ifdef APP-NVUE */
border-radius: 100px;
/* #endif */
/* #ifndef APP-NVUE */
display: inline-block;
/* #endif */
/* #ifndef APP-NVUE */
border-radius: 50%;
/* #endif */
z-index: 10;
}
/* #ifndef APP-NVUE */
.fui-badge__bg-primary {
background-color: var(--fui-color-primary, #465CFF) !important;
}
.fui-badge__bg-success {
background-color: var(--fui-color-success, #09BE4F) !important;
}
.fui-badge__bg-warning {
background-color: var(--fui-color-warning, #FFB703) !important;
}
.fui-badge__bg-danger {
background-color: var(--fui-color-danger, #FF2B2B) !important;
}
.fui-badge__bg-purple {
background-color: var(--fui-color-purple, #6831FF) !important;
}
.fui-badge__bg-white {
background-color: var(--fui-color-white, #FFFFFF) !important;
}
.fui-badge__text-color {
color: var(--fui-color-danger, #FF2B2B) !important;
}
/* #endif */
/* #ifdef APP-NVUE */
.fui-badge__bg-primary {
background-color: #465CFF !important;
}
.fui-badge__bg-success {
background-color: #09BE4F !important;
}
.fui-badge__bg-warning {
background-color: #FFB703 !important;
}
.fui-badge__bg-danger {
background-color: #FF2B2B !important;
}
.fui-badge__bg-purple {
background-color: #6831FF !important;
}
.fui-badge__bg-white {
background-color: #FFFFFF !important;
}
.fui-badge__text-color {
color: #FF2B2B !important;
}
.fui-badge__trans-origin {
transform-origin: center center;
}
/* #endif */
.fui-badge__absolute {
position: absolute;
}
</style>
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 5 6162 60 1 95,身份证尾号: 5037 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
/*
* Copyright (c) 2014 Johannes Mittendorfer (http://johannes-mittendorfer.com)
* Licensed under the MIT License (LICENSE.txt).
*
* Version 2.1.1
* Build 2014-10-07
*/
var EAN13, pluginName;
pluginName = null;
"use strict";
EAN13 = (function() {
EAN13.prototype.settings = {};
EAN13.prototype.init = function() {
var checkDigit, code;
if (this.number.length === 12) {
checkDigit = this.generateCheckDigit(this.number);
this.number += checkDigit;
}
if (this.number.length === 13) {
if (this.validate()) {
this.settings.onValid.call();
} else {
this.settings.onInvalid.call();
}
code = this.getCode();
return this.draw(code);
} else {
return this.settings.onError.call();
}
};
EAN13.prototype.getCode = function() {
var c_encoding, code, countries, i, parts, raw_number, x, y, z;
x = ["0001101", "0011001", "0010011", "0111101", "0100011", "0110001", "0101111", "0111011", "0110111", "0001011"];
y = ["0100111", "0110011", "0011011", "0100001", "0011101", "0111001", "0000101", "0010001", "0001001", "0010111"];
z = ["1110010", "1100110", "1101100", "1000010", "1011100", "1001110", "1010000", "1000100", "1001000", "1110100"];
countries = ["xxxxxx", "xxyxyy", "xxyyxy", "xxyyyx", "xyxxyy", "xyyxxy", "xyyyxx", "xyxyxy", "xyxyyx", "xyyxyx"];
code = "";
c_encoding = countries[parseInt(this.number.substr(0, 1), 10)].split("");
raw_number = this.number.substr(1);
parts = raw_number.split("");
i = 0;
while (i < 6) {
if (c_encoding[i] === "x") {
code += x[parts[i]];
} else {
code += y[parts[i]];
}
i++;
}
i = 6;
while (i < 12) {
code += z[parts[i]];
i++;
}
return code;
};
EAN13.prototype.clear = function(context) {
return context.clearRect(0, 0, this.settings.width, this.settings.height);
};
EAN13.prototype.draw = function(code) {
var border_height, chars, context, height, i, item_width, layout, left, lines, offset, prefix, width, x, _i, _ref;
layout = {
prefix_offset: 0.06,
font_stretch: 0.073,
border_line_height_number: 0.9,
border_line_height: 1,
line_height: 0.9,
font_size: 0.15,
font_y: 1.03,
text_offset: 4.5
};
width = (this.settings.prefix ? this.settings.width - (this.settings.width * layout.prefix_offset) : this.settings.width);
if (this.settings.number) {
border_height = layout.border_line_height_number * this.settings.height;
height = layout.line_height * border_height;
} else {
border_height = layout.border_line_height * this.settings.height;
height = border_height;
}
item_width = width / 95;
if (this.ctx) {
context = this.ctx;
this.clear(context);
context.setFillStyle(this.settings.color);
left = this.settings.number && this.settings.prefix ? this.settings.width * layout.prefix_offset : 0;
lines = code.split("");
context.fillRect(left, 0, item_width, border_height);
left = left + item_width * 2;
context.fillRect(left, 0, item_width, border_height);
left = left + item_width;
i = 0;
while (i < 42) {
if (lines[i] === "1") {
context.fillRect(left, 0, Math.floor(item_width) + 1, height);
}
left = left + item_width;
i++;
}
left = left + item_width;
context.fillRect(left, 0, item_width, border_height);
left = left + item_width * 2;
context.fillRect(left, 0, item_width, border_height);
left = left + item_width * 2;
i = 42;
while (i < 84) {
if (lines[i] === "1") {
context.fillRect(left, 0, Math.floor(item_width) + 1, height);
}
left = left + item_width;
i++;
}
context.fillRect(left, 0, item_width, border_height);
left = left + item_width * 2;
context.fillRect(left, 0, item_width, border_height);
if (this.settings.number) {
context.setFontSize(layout.font_size * height + "px monospace");
prefix = this.number.substr(0, 1);
if (this.settings.prefix) {
context.fillText(prefix, 0, border_height * layout.font_y);
}
offset = item_width * layout.text_offset + (this.settings.prefix ? layout.prefix_offset * this.settings.width : 0);
chars = this.number.substr(1, 6).split("");
chars.forEach(function(value, key) {
context.fillText(value, offset, border_height * layout.font_y);
return offset += layout.font_stretch * width;
});
offset = 49 * item_width + (this.settings.prefix ? layout.prefix_offset * this.settings.width : 0) + layout.text_offset;
chars = this.number.substr(7).split("")
chars.forEach(function(value, key) {
context.fillText(value, offset, border_height * layout.font_y);
return offset += layout.font_stretch * width;
});
}
if (this.settings.debug) {
for (x = _i = 0, _ref = item_width * 2; _ref > 0 ? _i <= width : _i >= width; x = _i += _ref) {
context.beginPath();
context.rect(x, height * 0.4, item_width, height * 0.1);
context.setFillStyle('red');
context.fill();
}
}
context.draw()
return this.settings.onSuccess.call();
} else {
return this.settings.onError.call();
}
};
EAN13.prototype.generateCheckDigit = function(number) {
var chars, counter;
counter = 0;
chars = number.split("");
chars.forEach(function(value, key) {
if (key % 2 === 0) {
return counter += parseInt(value, 10);
} else {
return counter += 3 * parseInt(value, 10);
}
});
return 10 - (counter % 10) % 10;
};
EAN13.prototype.validate = function() {
return parseInt(this.number.slice(-1), 10) === this.generateCheckDigit(this.number.slice(0, -1));
};
function EAN13(number, options, ctx) {
var option;
this.number = number;
this.ctx = ctx
this.settings = {
width: 200,
height: 100,
number: true,
prefix: true,
color: "black",
debug: false,
onValid: function() {},
onInvalid: function() {},
onSuccess: function() {},
onError: function() {}
};
if (options) {
for (option in options) {
this.settings[option] = options[option];
}
}
this._name = pluginName;
this.init();
}
return EAN13;
})();
export default EAN13;
\ No newline at end of file
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 561 62 601 95,身份证尾号: 5 0 375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<!-- #ifdef APP-NVUE -->
<gcanvas @longpress="longtap" @touchstart="touchstart" @touchend="touchend" :ref="canvasId"
:style="{ width: w + 'px', height:h + 'px' }">
</gcanvas>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<canvas :canvas-id="canvasId" :id="canvasId" :style="{width:w+'px',height:h+'px'}" @longtap="longtap"
@touchstart="touchstart" @touchend="touchend"></canvas>
<!-- #endif -->
</template>
<script>
import barcode from './barcode.js'
// #ifdef APP-NVUE
import {
enable,
WeexBridge
} from './gcanvas/index.js';
// #endif
const defalutOptions = {
number: true,
prefix: true,
color: '#181818',
debug: false,
onValid() {},
onInvalid() {},
onSuccess() {},
onError() {}
}
// #ifdef MP-WEIXIN
const canvasId = `fui_bc_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif
export default {
name: "fui-barcode",
emits: ['ready', 'longclick', 'touchStart', 'touchEnd'],
props: {
width: {
type: [Number, String],
default: 480
},
height: {
type: [Number, String],
default: 200
},
value: {
type: String,
default: ''
}
},
data() {
// #ifndef MP-WEIXIN
const canvasId = `fui_bc_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif
return {
canvasId,
defalutOptions,
w: 240,
h: 100
};
},
watch: {
width(val) {
this.w = uni.upx2px(val || 480)
},
height(val) {
this.h = uni.upx2px(val || 200)
}
},
created() {
this.w = uni.upx2px(this.width || 480)
this.h = uni.upx2px(this.height || 200)
this.ctx = null;
},
mounted() {
setTimeout(() => {
this.$emit('ready', {
canvasId: this.canvasId
})
}, 50)
},
// #ifndef VUE3
beforeDestroy() {
this.ctx = null;
},
// #endif
// #ifdef VUE3
beforeUnmount() {
this.ctx = null;
},
// #endif
methods: {
draw(options = {}) {
if (!this.ctx) {
// #ifdef APP-NVUE
let ganvas = this.$refs[this.canvasId];
/*通过元素引用获取canvas对象*/
let canvasObj = enable(ganvas, {
bridge: WeexBridge
});
/*获取绘图所需的上下文,暂不支持3d*/
this.ctx = canvasObj.getContext('2d');
// #endif
// #ifndef APP-NVUE
this.ctx = uni.createCanvasContext(this.canvasId, this)
// #endif
}
const opts = Object.assign({}, this.defalutOptions, options)
new barcode(this.value, Object.assign({
width: this.w,
height: this.h
}, opts), this.ctx)
},
longtap() {
this.$emit('longclick', {})
},
touchstart() {
this.$emit('touchStart', {})
},
touchend() {
this.$emit('touchEnd', {})
}
}
}
</script>
<style scoped></style>
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 56 1 6 2 601 95,身份证尾号: 503 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
const isWeex = typeof WXEnvironment !== 'undefined';
const isWeexIOS = isWeex && /ios/i.test(WXEnvironment.platform);
const isWeexAndroid = isWeex && !isWeexIOS;
import GLmethod from '../context-webgl/GLmethod';
const GCanvasModule =
(typeof weex !== 'undefined' && weex.requireModule) ? (weex.requireModule('gcanvas')) :
(typeof __weex_require__ !== 'undefined') ? (__weex_require__('@weex-module/gcanvas')) : {};
let isDebugging = false;
let isComboDisabled = false;
const logCommand = (function () {
const methodQuery = [];
Object.keys(GLmethod).forEach(key => {
methodQuery[GLmethod[key]] = key;
})
const queryMethod = (id) => {
return methodQuery[parseInt(id)] || 'NotFoundMethod';
}
const logCommand = (id, cmds) => {
const mId = cmds.split(',')[0];
const mName = queryMethod(mId);
console.log(`=== callNative - componentId:${id}; method: ${mName}; cmds: ${cmds}`);
}
return logCommand;
})();
function joinArray(arr, sep) {
let res = '';
for (let i = 0; i < arr.length; i++) {
if (i !== 0) {
res += sep;
}
res += arr[i];
}
return res;
}
const commandsCache = {}
const GBridge = {
callEnable: (ref, configArray) => {
commandsCache[ref] = [];
return GCanvasModule.enable({
componentId: ref,
config: configArray
});
},
callEnableDebug: () => {
isDebugging = true;
},
callEnableDisableCombo: () => {
isComboDisabled = true;
},
callSetContextType: function (componentId, context_type) {
GCanvasModule.setContextType(context_type, componentId);
},
callReset: function(id){
GCanvasModule.resetComponent && canvasModule.resetComponent(componentId);
},
render: isWeexIOS ? function (componentId) {
return GCanvasModule.extendCallNative({
contextId: componentId,
type: 0x60000001
});
} : function (componentId) {
return callGCanvasLinkNative(componentId, 0x60000001, 'render');
},
render2d: isWeexIOS ? function (componentId, commands, callback) {
if (isDebugging) {
console.log('>>> >>> render2d ===');
console.log('>>> commands: ' + commands);
}
GCanvasModule.render([commands, callback?true:false], componentId, callback);
} : function (componentId, commands,callback) {
if (isDebugging) {
console.log('>>> >>> render2d ===');
console.log('>>> commands: ' + commands);
}
callGCanvasLinkNative(componentId, 0x20000001, commands);
if(callback){
callback();
}
},
callExtendCallNative: isWeexIOS ? function (componentId, cmdArgs) {
throw 'should not be here anymore ' + cmdArgs;
} : function (componentId, cmdArgs) {
throw 'should not be here anymore ' + cmdArgs;
},
flushNative: isWeexIOS ? function (componentId) {
const cmdArgs = joinArray(commandsCache[componentId], ';');
commandsCache[componentId] = [];
if (isDebugging) {
console.log('>>> >>> flush native ===');
console.log('>>> commands: ' + cmdArgs);
}
const result = GCanvasModule.extendCallNative({
"contextId": componentId,
"type": 0x60000000,
"args": cmdArgs
});
const res = result && result.result;
if (isDebugging) {
console.log('>>> result: ' + res);
}
return res;
} : function (componentId) {
const cmdArgs = joinArray(commandsCache[componentId], ';');
commandsCache[componentId] = [];
if (isDebugging) {
console.log('>>> >>> flush native ===');
console.log('>>> commands: ' + cmdArgs);
}
const result = callGCanvasLinkNative(componentId, 0x60000000, cmdArgs);
if (isDebugging) {
console.log('>>> result: ' + result);
}
return result;
},
callNative: function (componentId, cmdArgs, cache) {
if (isDebugging) {
logCommand(componentId, cmdArgs);
}
commandsCache[componentId].push(cmdArgs);
if (!cache || isComboDisabled) {
return GBridge.flushNative(componentId);
} else {
return undefined;
}
},
texImage2D(componentId, ...args) {
if (isWeexIOS) {
if (args.length === 6) {
const [target, level, internalformat, format, type, image] = args;
GBridge.callNative(
componentId,
GLmethod.texImage2D + ',' + 6 + ',' + target + ',' + level + ',' + internalformat + ',' + format + ',' + type + ',' + image.src
)
} else if (args.length === 9) {
const [target, level, internalformat, width, height, border, format, type, image] = args;
GBridge.callNative(
componentId,
GLmethod.texImage2D + ',' + 9 + ',' + target + ',' + level + ',' + internalformat + ',' + width + ',' + height + ',' + border + ',' +
+ format + ',' + type + ',' + (image ? image.src : 0)
)
}
} else if (isWeexAndroid) {
if (args.length === 6) {
const [target, level, internalformat, format, type, image] = args;
GCanvasModule.texImage2D(componentId, target, level, internalformat, format, type, image.src);
} else if (args.length === 9) {
const [target, level, internalformat, width, height, border, format, type, image] = args;
GCanvasModule.texImage2D(componentId, target, level, internalformat, width, height, border, format, type, (image ? image.src : 0));
}
}
},
texSubImage2D(componentId, target, level, xoffset, yoffset, format, type, image) {
if (isWeexIOS) {
if (arguments.length === 8) {
GBridge.callNative(
componentId,
GLmethod.texSubImage2D + ',' + 6 + ',' + target + ',' + level + ',' + xoffset + ',' + yoffset, + ',' + format + ',' + type + ',' + image.src
)
}
} else if (isWeexAndroid) {
GCanvasModule.texSubImage2D(componentId, target, level, xoffset, yoffset, format, type, image.src);
}
},
bindImageTexture(componentId, src, imageId) {
GCanvasModule.bindImageTexture([src, imageId], componentId);
},
perloadImage([url, id], callback) {
GCanvasModule.preLoadImage([url, id], function (image) {
image.url = url;
image.id = id;
callback(image);
});
},
measureText(text, fontStyle, componentId) {
return GCanvasModule.measureText([text, fontStyle], componentId);
},
getImageData (componentId, x, y, w, h, callback) {
GCanvasModule.getImageData([x, y,w,h],componentId,callback);
},
putImageData (componentId, data, x, y, w, h, callback) {
GCanvasModule.putImageData([x, y,w,h,data],componentId,callback);
},
toTempFilePath(componentId, x, y, width, height, destWidth, destHeight, fileType, quality, callback){
GCanvasModule.toTempFilePath([x, y, width,height, destWidth, destHeight, fileType, quality], componentId, callback);
}
}
export default GBridge;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 56 1626 019 5,身份证尾号: 5037 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStyleLinearGradient {
constructor(x0, y0, x1, y1) {
this._start_pos = { _x: x0, _y: y0 };
this._end_pos = { _x: x1, _y: y1 };
this._stop_count = 0;
this._stops = [0, 0, 0, 0, 0];
}
addColorStop = function (pos, color) {
if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) {
this._stops[this._stop_count] = { _pos: pos, _color: color };
this._stop_count++;
}
}
}
export default FillStyleLinearGradient;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 5616 2601 9 5,身份证尾号:50 37 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStylePattern {
constructor(img, pattern) {
this._style = pattern;
this._img = img;
}
}
export default FillStylePattern;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1561 6260 19 5,身份证尾号: 5 0375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStyleRadialGradient {
constructor(x0, y0, r0, x1, y1, r1) {
this._start_pos = { _x: x0, _y: y0, _r: r0 };
this._end_pos = { _x: x1, _y: y1, _r: r1 };
this._stop_count = 0;
this._stops = [0, 0, 0, 0, 0];
}
addColorStop(pos, color) {
if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) {
this._stops[this._stop_count] = { _pos: pos, _color: color };
this._stop_count++;
}
}
}
export default FillStyleRadialGradient;
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 561626 0 1 9 5,身份证尾号: 50 375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
export default class WebGLActiveInfo {
className = 'WebGLActiveInfo';
constructor({
type, name, size
}) {
this.type = type;
this.name = name;
this.size = size;
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 56 1 6 26 01 9 5,身份证尾号:5 0 37 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import {getTransferedObjectUUID} from './classUtils';
const name = 'WebGLBuffer';
function uuid(id) {
return getTransferedObjectUUID(name, id);
}
export default class WebGLBuffer {
className = name;
constructor(id) {
this.id = id;
}
static uuid = uuid;
uuid() {
return uuid(this.id);
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:15 61 62 60 1 9 5,身份证尾号:5037 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import {getTransferedObjectUUID} from './classUtils';
const name = 'WebGLFrameBuffer';
function uuid(id) {
return getTransferedObjectUUID(name, id);
}
export default class WebGLFramebuffer {
className = name;
constructor(id) {
this.id = id;
}
static uuid = uuid;
uuid() {
return uuid(this.id);
}
}
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 56 16 26 0 19 5,身份证尾号:5 037 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
export default {
"DEPTH_BUFFER_BIT": 256,
"STENCIL_BUFFER_BIT": 1024,
"COLOR_BUFFER_BIT": 16384,
"POINTS": 0,
"LINES": 1,
"LINE_LOOP": 2,
"LINE_STRIP": 3,
"TRIANGLES": 4,
"TRIANGLE_STRIP": 5,
"TRIANGLE_FAN": 6,
"ZERO": 0,
"ONE": 1,
"SRC_COLOR": 768,
"ONE_MINUS_SRC_COLOR": 769,
"SRC_ALPHA": 770,
"ONE_MINUS_SRC_ALPHA": 771,
"DST_ALPHA": 772,
"ONE_MINUS_DST_ALPHA": 773,
"DST_COLOR": 774,
"ONE_MINUS_DST_COLOR": 775,
"SRC_ALPHA_SATURATE": 776,
"FUNC_ADD": 32774,
"BLEND_EQUATION": 32777,
"BLEND_EQUATION_RGB": 32777,
"BLEND_EQUATION_ALPHA": 34877,
"FUNC_SUBTRACT": 32778,
"FUNC_REVERSE_SUBTRACT": 32779,
"BLEND_DST_RGB": 32968,
"BLEND_SRC_RGB": 32969,
"BLEND_DST_ALPHA": 32970,
"BLEND_SRC_ALPHA": 32971,
"CONSTANT_COLOR": 32769,
"ONE_MINUS_CONSTANT_COLOR": 32770,
"CONSTANT_ALPHA": 32771,
"ONE_MINUS_CONSTANT_ALPHA": 32772,
"BLEND_COLOR": 32773,
"ARRAY_BUFFER": 34962,
"ELEMENT_ARRAY_BUFFER": 34963,
"ARRAY_BUFFER_BINDING": 34964,
"ELEMENT_ARRAY_BUFFER_BINDING": 34965,
"STREAM_DRAW": 35040,
"STATIC_DRAW": 35044,
"DYNAMIC_DRAW": 35048,
"BUFFER_SIZE": 34660,
"BUFFER_USAGE": 34661,
"CURRENT_VERTEX_ATTRIB": 34342,
"FRONT": 1028,
"BACK": 1029,
"FRONT_AND_BACK": 1032,
"TEXTURE_2D": 3553,
"CULL_FACE": 2884,
"BLEND": 3042,
"DITHER": 3024,
"STENCIL_TEST": 2960,
"DEPTH_TEST": 2929,
"SCISSOR_TEST": 3089,
"POLYGON_OFFSET_FILL": 32823,
"SAMPLE_ALPHA_TO_COVERAGE": 32926,
"SAMPLE_COVERAGE": 32928,
"NO_ERROR": 0,
"INVALID_ENUM": 1280,
"INVALID_VALUE": 1281,
"INVALID_OPERATION": 1282,
"OUT_OF_MEMORY": 1285,
"CW": 2304,
"CCW": 2305,
"LINE_WIDTH": 2849,
"ALIASED_POINT_SIZE_RANGE": 33901,
"ALIASED_LINE_WIDTH_RANGE": 33902,
"CULL_FACE_MODE": 2885,
"FRONT_FACE": 2886,
"DEPTH_RANGE": 2928,
"DEPTH_WRITEMASK": 2930,
"DEPTH_CLEAR_VALUE": 2931,
"DEPTH_FUNC": 2932,
"STENCIL_CLEAR_VALUE": 2961,
"STENCIL_FUNC": 2962,
"STENCIL_FAIL": 2964,
"STENCIL_PASS_DEPTH_FAIL": 2965,
"STENCIL_PASS_DEPTH_PASS": 2966,
"STENCIL_REF": 2967,
"STENCIL_VALUE_MASK": 2963,
"STENCIL_WRITEMASK": 2968,
"STENCIL_BACK_FUNC": 34816,
"STENCIL_BACK_FAIL": 34817,
"STENCIL_BACK_PASS_DEPTH_FAIL": 34818,
"STENCIL_BACK_PASS_DEPTH_PASS": 34819,
"STENCIL_BACK_REF": 36003,
"STENCIL_BACK_VALUE_MASK": 36004,
"STENCIL_BACK_WRITEMASK": 36005,
"VIEWPORT": 2978,
"SCISSOR_BOX": 3088,
"COLOR_CLEAR_VALUE": 3106,
"COLOR_WRITEMASK": 3107,
"UNPACK_ALIGNMENT": 3317,
"PACK_ALIGNMENT": 3333,
"MAX_TEXTURE_SIZE": 3379,
"MAX_VIEWPORT_DIMS": 3386,
"SUBPIXEL_BITS": 3408,
"RED_BITS": 3410,
"GREEN_BITS": 3411,
"BLUE_BITS": 3412,
"ALPHA_BITS": 3413,
"DEPTH_BITS": 3414,
"STENCIL_BITS": 3415,
"POLYGON_OFFSET_UNITS": 10752,
"POLYGON_OFFSET_FACTOR": 32824,
"TEXTURE_BINDING_2D": 32873,
"SAMPLE_BUFFERS": 32936,
"SAMPLES": 32937,
"SAMPLE_COVERAGE_VALUE": 32938,
"SAMPLE_COVERAGE_INVERT": 32939,
"COMPRESSED_TEXTURE_FORMATS": 34467,
"DONT_CARE": 4352,
"FASTEST": 4353,
"NICEST": 4354,
"GENERATE_MIPMAP_HINT": 33170,
"BYTE": 5120,
"UNSIGNED_BYTE": 5121,
"SHORT": 5122,
"UNSIGNED_SHORT": 5123,
"INT": 5124,
"UNSIGNED_INT": 5125,
"FLOAT": 5126,
"DEPTH_COMPONENT": 6402,
"ALPHA": 6406,
"RGB": 6407,
"RGBA": 6408,
"LUMINANCE": 6409,
"LUMINANCE_ALPHA": 6410,
"UNSIGNED_SHORT_4_4_4_4": 32819,
"UNSIGNED_SHORT_5_5_5_1": 32820,
"UNSIGNED_SHORT_5_6_5": 33635,
"FRAGMENT_SHADER": 35632,
"VERTEX_SHADER": 35633,
"MAX_VERTEX_ATTRIBS": 34921,
"MAX_VERTEX_UNIFORM_VECTORS": 36347,
"MAX_VARYING_VECTORS": 36348,
"MAX_COMBINED_TEXTURE_IMAGE_UNITS": 35661,
"MAX_VERTEX_TEXTURE_IMAGE_UNITS": 35660,
"MAX_TEXTURE_IMAGE_UNITS": 34930,
"MAX_FRAGMENT_UNIFORM_VECTORS": 36349,
"SHADER_TYPE": 35663,
"DELETE_STATUS": 35712,
"LINK_STATUS": 35714,
"VALIDATE_STATUS": 35715,
"ATTACHED_SHADERS": 35717,
"ACTIVE_UNIFORMS": 35718,
"ACTIVE_ATTRIBUTES": 35721,
"SHADING_LANGUAGE_VERSION": 35724,
"CURRENT_PROGRAM": 35725,
"NEVER": 512,
"LESS": 513,
"EQUAL": 514,
"LEQUAL": 515,
"GREATER": 516,
"NOTEQUAL": 517,
"GEQUAL": 518,
"ALWAYS": 519,
"KEEP": 7680,
"REPLACE": 7681,
"INCR": 7682,
"DECR": 7683,
"INVERT": 5386,
"INCR_WRAP": 34055,
"DECR_WRAP": 34056,
"VENDOR": 7936,
"RENDERER": 7937,
"VERSION": 7938,
"NEAREST": 9728,
"LINEAR": 9729,
"NEAREST_MIPMAP_NEAREST": 9984,
"LINEAR_MIPMAP_NEAREST": 9985,
"NEAREST_MIPMAP_LINEAR": 9986,
"LINEAR_MIPMAP_LINEAR": 9987,
"TEXTURE_MAG_FILTER": 10240,
"TEXTURE_MIN_FILTER": 10241,
"TEXTURE_WRAP_S": 10242,
"TEXTURE_WRAP_T": 10243,
"TEXTURE": 5890,
"TEXTURE_CUBE_MAP": 34067,
"TEXTURE_BINDING_CUBE_MAP": 34068,
"TEXTURE_CUBE_MAP_POSITIVE_X": 34069,
"TEXTURE_CUBE_MAP_NEGATIVE_X": 34070,
"TEXTURE_CUBE_MAP_POSITIVE_Y": 34071,
"TEXTURE_CUBE_MAP_NEGATIVE_Y": 34072,
"TEXTURE_CUBE_MAP_POSITIVE_Z": 34073,
"TEXTURE_CUBE_MAP_NEGATIVE_Z": 34074,
"MAX_CUBE_MAP_TEXTURE_SIZE": 34076,
"TEXTURE0": 33984,
"TEXTURE1": 33985,
"TEXTURE2": 33986,
"TEXTURE3": 33987,
"TEXTURE4": 33988,
"TEXTURE5": 33989,
"TEXTURE6": 33990,
"TEXTURE7": 33991,
"TEXTURE8": 33992,
"TEXTURE9": 33993,
"TEXTURE10": 33994,
"TEXTURE11": 33995,
"TEXTURE12": 33996,
"TEXTURE13": 33997,
"TEXTURE14": 33998,
"TEXTURE15": 33999,
"TEXTURE16": 34000,
"TEXTURE17": 34001,
"TEXTURE18": 34002,
"TEXTURE19": 34003,
"TEXTURE20": 34004,
"TEXTURE21": 34005,
"TEXTURE22": 34006,
"TEXTURE23": 34007,
"TEXTURE24": 34008,
"TEXTURE25": 34009,
"TEXTURE26": 34010,
"TEXTURE27": 34011,
"TEXTURE28": 34012,
"TEXTURE29": 34013,
"TEXTURE30": 34014,
"TEXTURE31": 34015,
"ACTIVE_TEXTURE": 34016,
"REPEAT": 10497,
"CLAMP_TO_EDGE": 33071,
"MIRRORED_REPEAT": 33648,
"FLOAT_VEC2": 35664,
"FLOAT_VEC3": 35665,
"FLOAT_VEC4": 35666,
"INT_VEC2": 35667,
"INT_VEC3": 35668,
"INT_VEC4": 35669,
"BOOL": 35670,
"BOOL_VEC2": 35671,
"BOOL_VEC3": 35672,
"BOOL_VEC4": 35673,
"FLOAT_MAT2": 35674,
"FLOAT_MAT3": 35675,
"FLOAT_MAT4": 35676,
"SAMPLER_2D": 35678,
"SAMPLER_CUBE": 35680,
"VERTEX_ATTRIB_ARRAY_ENABLED": 34338,
"VERTEX_ATTRIB_ARRAY_SIZE": 34339,
"VERTEX_ATTRIB_ARRAY_STRIDE": 34340,
"VERTEX_ATTRIB_ARRAY_TYPE": 34341,
"VERTEX_ATTRIB_ARRAY_NORMALIZED": 34922,
"VERTEX_ATTRIB_ARRAY_POINTER": 34373,
"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING": 34975,
"IMPLEMENTATION_COLOR_READ_TYPE": 35738,
"IMPLEMENTATION_COLOR_READ_FORMAT": 35739,
"COMPILE_STATUS": 35713,
"LOW_FLOAT": 36336,
"MEDIUM_FLOAT": 36337,
"HIGH_FLOAT": 36338,
"LOW_INT": 36339,
"MEDIUM_INT": 36340,
"HIGH_INT": 36341,
"FRAMEBUFFER": 36160,
"RENDERBUFFER": 36161,
"RGBA4": 32854,
"RGB5_A1": 32855,
"RGB565": 36194,
"DEPTH_COMPONENT16": 33189,
"STENCIL_INDEX8": 36168,
"DEPTH_STENCIL": 34041,
"RENDERBUFFER_WIDTH": 36162,
"RENDERBUFFER_HEIGHT": 36163,
"RENDERBUFFER_INTERNAL_FORMAT": 36164,
"RENDERBUFFER_RED_SIZE": 36176,
"RENDERBUFFER_GREEN_SIZE": 36177,
"RENDERBUFFER_BLUE_SIZE": 36178,
"RENDERBUFFER_ALPHA_SIZE": 36179,
"RENDERBUFFER_DEPTH_SIZE": 36180,
"RENDERBUFFER_STENCIL_SIZE": 36181,
"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE": 36048,
"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME": 36049,
"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL": 36050,
"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE": 36051,
"COLOR_ATTACHMENT0": 36064,
"DEPTH_ATTACHMENT": 36096,
"STENCIL_ATTACHMENT": 36128,
"DEPTH_STENCIL_ATTACHMENT": 33306,
"NONE": 0,
"FRAMEBUFFER_COMPLETE": 36053,
"FRAMEBUFFER_INCOMPLETE_ATTACHMENT": 36054,
"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT": 36055,
"FRAMEBUFFER_INCOMPLETE_DIMENSIONS": 36057,
"FRAMEBUFFER_UNSUPPORTED": 36061,
"FRAMEBUFFER_BINDING": 36006,
"RENDERBUFFER_BINDING": 36007,
"MAX_RENDERBUFFER_SIZE": 34024,
"INVALID_FRAMEBUFFER_OPERATION": 1286,
"UNPACK_FLIP_Y_WEBGL": 37440,
"UNPACK_PREMULTIPLY_ALPHA_WEBGL": 37441,
"CONTEXT_LOST_WEBGL": 37442,
"UNPACK_COLORSPACE_CONVERSION_WEBGL": 37443,
"BROWSER_DEFAULT_WEBGL": 37444
};
\ No newline at end of file
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 5 616 2 60 1 95,身份证尾号:5 0 3 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
let i = 1;
const GLmethod = {};
GLmethod.activeTexture = i++; //1
GLmethod.attachShader = i++;
GLmethod.bindAttribLocation = i++;
GLmethod.bindBuffer = i++;
GLmethod.bindFramebuffer = i++;
GLmethod.bindRenderbuffer = i++;
GLmethod.bindTexture = i++;
GLmethod.blendColor = i++;
GLmethod.blendEquation = i++;
GLmethod.blendEquationSeparate = i++; //10
GLmethod.blendFunc = i++;
GLmethod.blendFuncSeparate = i++;
GLmethod.bufferData = i++;
GLmethod.bufferSubData = i++;
GLmethod.checkFramebufferStatus = i++;
GLmethod.clear = i++;
GLmethod.clearColor = i++;
GLmethod.clearDepth = i++;
GLmethod.clearStencil = i++;
GLmethod.colorMask = i++; //20
GLmethod.compileShader = i++;
GLmethod.compressedTexImage2D = i++;
GLmethod.compressedTexSubImage2D = i++;
GLmethod.copyTexImage2D = i++;
GLmethod.copyTexSubImage2D = i++;
GLmethod.createBuffer = i++;
GLmethod.createFramebuffer = i++;
GLmethod.createProgram = i++;
GLmethod.createRenderbuffer = i++;
GLmethod.createShader = i++; //30
GLmethod.createTexture = i++;
GLmethod.cullFace = i++;
GLmethod.deleteBuffer = i++;
GLmethod.deleteFramebuffer = i++;
GLmethod.deleteProgram = i++;
GLmethod.deleteRenderbuffer = i++;
GLmethod.deleteShader = i++;
GLmethod.deleteTexture = i++;
GLmethod.depthFunc = i++;
GLmethod.depthMask = i++; //40
GLmethod.depthRange = i++;
GLmethod.detachShader = i++;
GLmethod.disable = i++;
GLmethod.disableVertexAttribArray = i++;
GLmethod.drawArrays = i++;
GLmethod.drawArraysInstancedANGLE = i++;
GLmethod.drawElements = i++;
GLmethod.drawElementsInstancedANGLE = i++;
GLmethod.enable = i++;
GLmethod.enableVertexAttribArray = i++; //50
GLmethod.flush = i++;
GLmethod.framebufferRenderbuffer = i++;
GLmethod.framebufferTexture2D = i++;
GLmethod.frontFace = i++;
GLmethod.generateMipmap = i++;
GLmethod.getActiveAttrib = i++;
GLmethod.getActiveUniform = i++;
GLmethod.getAttachedShaders = i++;
GLmethod.getAttribLocation = i++;
GLmethod.getBufferParameter = i++; //60
GLmethod.getContextAttributes = i++;
GLmethod.getError = i++;
GLmethod.getExtension = i++;
GLmethod.getFramebufferAttachmentParameter = i++;
GLmethod.getParameter = i++;
GLmethod.getProgramInfoLog = i++;
GLmethod.getProgramParameter = i++;
GLmethod.getRenderbufferParameter = i++;
GLmethod.getShaderInfoLog = i++;
GLmethod.getShaderParameter = i++; //70
GLmethod.getShaderPrecisionFormat = i++;
GLmethod.getShaderSource = i++;
GLmethod.getSupportedExtensions = i++;
GLmethod.getTexParameter = i++;
GLmethod.getUniform = i++;
GLmethod.getUniformLocation = i++;
GLmethod.getVertexAttrib = i++;
GLmethod.getVertexAttribOffset = i++;
GLmethod.isBuffer = i++;
GLmethod.isContextLost = i++; //80
GLmethod.isEnabled = i++;
GLmethod.isFramebuffer = i++;
GLmethod.isProgram = i++;
GLmethod.isRenderbuffer = i++;
GLmethod.isShader = i++;
GLmethod.isTexture = i++;
GLmethod.lineWidth = i++;
GLmethod.linkProgram = i++;
GLmethod.pixelStorei = i++;
GLmethod.polygonOffset = i++; //90
GLmethod.readPixels = i++;
GLmethod.renderbufferStorage = i++;
GLmethod.sampleCoverage = i++;
GLmethod.scissor = i++;
GLmethod.shaderSource = i++;
GLmethod.stencilFunc = i++;
GLmethod.stencilFuncSeparate = i++;
GLmethod.stencilMask = i++;
GLmethod.stencilMaskSeparate = i++;
GLmethod.stencilOp = i++; //100
GLmethod.stencilOpSeparate = i++;
GLmethod.texImage2D = i++;
GLmethod.texParameterf = i++;
GLmethod.texParameteri = i++;
GLmethod.texSubImage2D = i++;
GLmethod.uniform1f = i++;
GLmethod.uniform1fv = i++;
GLmethod.uniform1i = i++;
GLmethod.uniform1iv = i++;
GLmethod.uniform2f = i++; //110
GLmethod.uniform2fv = i++;
GLmethod.uniform2i = i++;
GLmethod.uniform2iv = i++;
GLmethod.uniform3f = i++;
GLmethod.uniform3fv = i++;
GLmethod.uniform3i = i++;
GLmethod.uniform3iv = i++;
GLmethod.uniform4f = i++;
GLmethod.uniform4fv = i++;
GLmethod.uniform4i = i++; //120
GLmethod.uniform4iv = i++;
GLmethod.uniformMatrix2fv = i++;
GLmethod.uniformMatrix3fv = i++;
GLmethod.uniformMatrix4fv = i++;
GLmethod.useProgram = i++;
GLmethod.validateProgram = i++;
GLmethod.vertexAttrib1f = i++; //new
GLmethod.vertexAttrib2f = i++; //new
GLmethod.vertexAttrib3f = i++; //new
GLmethod.vertexAttrib4f = i++; //new //130
GLmethod.vertexAttrib1fv = i++; //new
GLmethod.vertexAttrib2fv = i++; //new
GLmethod.vertexAttrib3fv = i++; //new
GLmethod.vertexAttrib4fv = i++; //new
GLmethod.vertexAttribPointer = i++;
GLmethod.viewport = i++;
export default GLmethod;
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论