提交 4880ca5a 编写于 作者: DCloud_JSON's avatar DCloud_JSON

- 新增 使用uni-id-pages的账号信息的状态管理功能

上级 27c252ad
## 2.0.4(2022-09-21)
- 新增 使用uni-id-pages的账号信息的状态管理功能
## 2.0.3(2022-09-20) ## 2.0.3(2022-09-20)
- 更新 依赖的`uni-ui`组件为最新版本(注意:该版本的`uni-form`相关组件将自定义节点设置成[虚拟节点](https://uniapp.dcloud.net.cn/tutorial/vue-api.html#%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE))) - 更新 依赖的`uni-ui`组件为最新版本(注意:该版本的`uni-form`相关组件将自定义节点设置成[虚拟节点](https://uniapp.dcloud.net.cn/tutorial/vue-api.html#%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE)))
- 更新 依赖的`uni_module`-> `uni-id-pages`为 v1.0.19版 修复 小程序端,使用将自定义节点设置成虚拟节点的uni-ui组件,导致的样式错乱问题 - 更新 依赖的`uni_module`-> `uni-id-pages`为 v1.0.19版 修复 小程序端,使用将自定义节点设置成虚拟节点的uni-ui组件,导致的样式错乱问题
......
> 插件来源:[https://ext.dcloud.net.cn/plugin?id=1287](https://ext.dcloud.net.cn/plugin?id=1287)
##### 以下是作者写的插件介绍:
# uQRCode
### 云函数版二维码生成插件explain-qrcode现已发布,URL化后一句代码即可生成,有网就有二维码,100%生成成功,不会因为平台差异,设备差异导致生成失败,无需在前端做适配和兼容,极力推荐。插件地址:[explain-qrcode云函数二维码生成](https://ext.dcloud.net.cn/plugin?id=3359)
uQRCode 生成方式简单,可扩展性高,如有复杂需求可通过自定义组件或修改源码完成需求。已测试H5、微信小程序、iPhoneXsMax真机。
本示例项目中的自定义组件旨在抛砖引玉,有其他需求的朋友可自行扩展,自定义组件参考 ``/components/uni-qrcode/uni-qrcode.vue`` ,自定义组件使用案例参考 ``/pages/component/qrcode/qrcode.vue``
联系方式:QQ540000228。
最近一次用于更新代码的 HBuilder X 版本为 2.8.11。
### 二维码
**什么是QR码**
QR码属于矩阵式二维码中的一个种类,由DENSO(日本电装)公司开发,由JIS和ISO将其标准化。
**QR码的特点**
一是高速读取(QR就是取自“Quick Response”的首字母),通过摄像头从拍摄到解码到显示内容也就三秒左右,对摄像的角度也没有什么要求;
二是高容量、高密度,理论上内容经过压缩处理后可以存7089个数字,4296个字母和数字混合字符,2953个8位字节数据,1817个汉字;
三是支持纠错处理,按照QR码的标准文档说明,QR码的纠错分为4个级别,分别是:
- level L : 最大 7% 的错误能够被纠正;
- level M : 最大 15% 的错误能够被纠正;
- level Q : 最大 25% 的错误能够被纠正;
- level H : 最大 30% 的错误能够被纠正;
四是结构化,看似无规则的图形,其实对区域有严格的定义。
更多二维码介绍及原理:[https://blog.csdn.net/jason_ldh/article/details/11801355](https://blog.csdn.net/jason_ldh/article/details/11801355)
### 使用方式
``script`` 中引用组件
```javascript
import uQRCode from '@/common/uqrcode.js'
```
``template`` 中创建 ``<canvas></canvas>``
```html
<canvas canvas-id="qrcode" style="width: 354px;height: 354px;" ></canvas>
```
``script`` 中调用 ``make()`` 方法
```javascript
export default {
methods: {
async make() {
// 回调方式
uQRCode.make({
canvasId: 'qrcode',
componentInstance: this,
text: 'uQRCode',
size: 354,
margin: 10,
backgroundColor: '#ffffff',
foregroundColor: '#000000',
fileType: 'jpg',
errorCorrectLevel: uQRCode.errorCorrectLevel.H,
success: res => {
console.log(res)
}
})
// Promise
uQRCode.make({
canvasId: 'qrcode',
componentInstance: this,
text: 'uQRCode',
size: 354,
margin: 10,
backgroundColor: '#ffffff',
foregroundColor: '#000000',
fileType: 'jpg',
errorCorrectLevel: uQRCode.errorCorrectLevel.H
}).then(res => {
console.log(res)
})
// 同步等待
var res = await uQRCode.make({
canvasId: 'qrcode',
componentInstance: this,
text: 'uQRCode',
size: 354,
margin: 10,
backgroundColor: '#ffffff',
foregroundColor: '#000000',
fileType: 'jpg',
errorCorrectLevel: uQRCode.errorCorrectLevel.H
})
console.log(res)
}
}
}
```
### 属性说明
|属性名|说明|
|---|:---|
|errorCorrectLevel|纠错等级,包含 `errorCorrectLevel.L``errorCorrectLevel.M``errorCorrectLevel.Q``errorCorrectLevel.H` 四个级别,`L`: 最大 7% 的错误能够被纠正;`M`: 最大 15% 的错误能够被纠正;`Q`: 最大 25% 的错误能够被纠正;`H`: 最大 30% 的错误能够被纠正。|
|defaults|二维码生成参数的默认值。|
### 方法说明
|方法名|说明|
|---|:---|
|[make](#makeoptions)|生成二维码。|
### make(options)
生成二维码
**options参数说明:**
|参数|类型|必填|说明|
|---|---|---|:---|
|canvasId|String|是|画布标识,传入 `<canvas></canvas>``canvas-id`|
|componentInstance|Object|否|自定义组件实例 `this` ,表示在这个自定义组件下查找拥有 `canvas-id``<canvas></canvas>` ,如果省略,则不在任何自定义组件内查找|
|text|String|是|二维码内容|
|size|Number|否|画布尺寸大小,请与 `<canvas></canvas>` 所设 `width``height` 保持一致(默认:`354`)|
|margin|Number|否|边距,二维码实际尺寸会根据所设边距值进行缩放调整(默认:`0`)|
|backgroundColor|String|否|背景色,若设置为透明背景, `fileType` 需设置为 `'png'` , 然后设置背景色为 `'rgba(255,255,255,0)'` 即可(默认:`'#ffffff'`)|
|foregroundColor|String|否|前景色(默认:`'#000000'`)|
|fileType|String|否|输出图片的类型,只支持 `'jpg'``'png'`(默认:`'png'`)|
|errorCorrectLevel|Number|否|纠错等级,参考属性说明 `errorCorrectLevel`(默认:`errorCorrectLevel.H`)|
### 使用建议
canvas在二维码生成中请当做一个生成工具来看待,它的作用仅是绘制出二维码。应把生成回调得到的资源保存并使用,显示用image图片组件,原因是方便操作,例如调整大小,或是H5端长按保存或识别,所以canvas应将它放在看不见的地方。不能用`display:none;overflow:hidden;`隐藏,否则生成空白。这里推荐canvas的隐藏样式代码
```html
<style>
.canvas-hide {
/* 1 */
position: fixed;
right: 100vw;
bottom: 100vh;
/* 2 */
z-index: -9999;
/* 3 */
opacity: 0;
}
</style>
```
### 常见问题
**二维码生成不完整**
canvas宽高必须和size一致,并且size的单位是px,如果canvas的单位是rpx,那么不同设备屏幕分辨率不一样,rpx转换成px后的画布尺寸不足以放下全部内容,实际绘制图案超出,就会出现不完整的情况。
**如何扫码跳转指定网页**
text参数直接放入完整的网页地址即可,例如:`https://ext.dcloud.net.cn/plugin?id=1287`。微信客户端不能是ip地址。
**小程序、APP报错**
canvas不支持放在 `slot` 插槽,请尽量放在模板根节点,也就是第一个 `<view></view>` 标签里面
**H5长按识别**
canvas无法长按识别,长按识别需要是图片才行,所以只需将回调过来的资源用image组件显示即可。
### Tips
- 示例项目中的图片采集于互联网,仅作为案例展示,不作为广告/商业,如有侵权,请告知删除。下载使用的用户,请勿把示例项目中的图片应用到你的项目。
\ No newline at end of file
<template>
<view>
<canvas :id="cid" :canvas-id="cid" :style="{width: `${size}px`, height: `${size}px`}" />
</view>
</template>
<script>
import uQRCode from './uqrcode.js'
export default {
props: {
cid: {
type: String,
default(){
return Date.now()+Math.random()+'';
}
},
text: {
type: String,
required: true
},
size: {
type: Number,
default: uni.upx2px(200)
},
margin: {
type: Number,
default: 0
},
backgroundColor: {
type: String,
default: '#ffffff'
},
foregroundColor: {
type: String,
default: '#000000'
},
backgroundImage: {
type: String
},
logo: {
type: String
},
makeOnLoad: {
type: Boolean,
default: false
}
},
data() {
return {
}
},
mounted() {
if (this.makeOnLoad) {
this.make()
}
},
methods: {
async make() {
var options = {
canvasId: this.cid,
componentInstance: this,
text: this.text,
size: this.size,
margin: this.margin,
backgroundColor: this.backgroundImage ? 'rgba(255,255,255,0)' : this.backgroundColor,
foregroundColor: this.foregroundColor
}
var filePath = await this.makeSync(options)
if (this.backgroundImage) {
filePath = await this.drawBackgroundImageSync(filePath)
}
if (this.logo) {
filePath = await this.drawLogoSync(filePath)
}
this.makeComplete(filePath)
},
makeComplete(filePath) {
this.$emit('makeComplete', filePath)
},
drawBackgroundImage(options) {
var ctx = uni.createCanvasContext(this.cid, this)
ctx.drawImage(this.backgroundImage, 0, 0, this.size, this.size)
ctx.drawImage(options.filePath, 0, 0, this.size, this.size)
ctx.draw(false, () => {
uni.canvasToTempFilePath({
canvasId: this.cid,
success: res => {
options.success && options.success(res.tempFilePath)
},
fail: error => {
options.fail && options.fail(error)
}
}, this)
})
},
async drawBackgroundImageSync(filePath) {
return new Promise((resolve, reject) => {
this.drawBackgroundImage({
filePath: filePath,
success: res => {
resolve(res)
},
fail: error => {
reject(error)
}
})
})
},
fillRoundRect(ctx, r, x, y, w, h) {
ctx.save()
ctx.translate(x, y)
ctx.beginPath()
ctx.arc(w - r, h - r, r, 0, Math.PI / 2)
ctx.lineTo(r, h)
ctx.arc(r, h - r, r, Math.PI / 2, Math.PI)
ctx.lineTo(0, r)
ctx.arc(r, r, r, Math.PI, Math.PI * 3 / 2)
ctx.lineTo(w - r, 0)
ctx.arc(w - r, r, r, Math.PI * 3 / 2, Math.PI * 2)
ctx.lineTo(w, h - r)
ctx.closePath()
ctx.setFillStyle('#ffffff')
ctx.fill()
ctx.restore()
},
drawLogo(options) {
var ctx = uni.createCanvasContext(this.cid, this)
ctx.drawImage(options.filePath, 0, 0, this.size, this.size)
var logoSize = this.size / 4
var logoX = this.size / 2 - logoSize / 2
var logoY = logoX
var borderSize = logoSize + 10
var borderX = this.size / 2 - borderSize / 2
var borderY = borderX
var borderRadius = 5
this.fillRoundRect(ctx, borderRadius, borderX, borderY, borderSize, borderSize)
ctx.drawImage(this.logo, logoX, logoY, logoSize, logoSize)
ctx.draw(false, () => {
uni.canvasToTempFilePath({
canvasId: this.cid,
success: res => {
options.success && options.success(res.tempFilePath)
},
fail: error => {
options.fail && options.fail(error)
}
}, this)
})
},
async drawLogoSync(filePath) {
return new Promise((resolve, reject) => {
this.drawLogo({
filePath: filePath,
success: res => {
resolve(res)
},
fail: error => {
reject(error)
}
})
})
},
async makeSync(options) {
return new Promise((resolve, reject) => {
uQRCode.make({
canvasId: options.canvasId,
componentInstance: options.componentInstance,
text: options.text,
size: options.size,
margin: options.margin,
backgroundColor: options.backgroundColor,
foregroundColor: options.foregroundColor,
success: res => {
resolve(res)
},
fail: error => {
reject(error)
}
})
})
}
}
}
</script>
此差异已折叠。
<template>
<view class="uni-section" nvue>
<view v-if="type" class="uni-section__head">
<view :class="type" class="uni-section__head-tag" />
</view>
<view class="uni-section__content">
<text :class="{'distraction':!subTitle}" class="uni-section__content-title">{{ title }}</text>
<text v-if="subTitle" class="uni-section__content-sub">{{ subTitle }}</text>
</view>
<slot />
</view>
</template>
<script>
/**
* Section 标题栏
* @description 标题栏
* @property {String} type = [line|circle] 标题装饰类型
* @value line 竖线
* @value circle 圆形
* @property {String} title 主标题
* @property {String} subTitle 副标题
*/
export default {
name: 'UniSection',
props: {
type: {
type: String,
default: ''
},
title: {
type: String,
default: ''
},
subTitle: {
type: String,
default: ''
}
},
data() {
return {}
},
watch: {
title(newVal) {
if (uni.report && newVal !== '') {
uni.report('title', newVal)
}
}
},
methods: {
onClick() {
this.$emit('click')
}
}
}
</script>
<style lang="scss" scoped>
.uni-section {
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
margin-top: 10px;
flex-direction: row;
align-items: center;
padding: 0 10px;
height: 50px;
background-color: $uni-bg-color-grey;
/* #ifdef APP-NVUE */
// border-bottom-color: $uni-border-color;
// border-bottom-style: solid;
// border-bottom-width: 0.5px;
/* #endif */
font-weight: normal;
}
/* #ifndef APP-NVUE */
// .uni-section:after {
// position: absolute;
// bottom: 0;
// right: 0;
// left: 0;
// height: 1px;
// content: '';
// -webkit-transform: scaleY(.5);
// transform: scaleY(.5);
// background-color: $uni-border-color;
// }
/* #endif */
.uni-section__head {
flex-direction: row;
justify-content: center;
align-items: center;
margin-right: 10px;
}
.line {
height: 15px;
background-color: $uni-text-color-disable;
border-radius: 5px;
width: 3px;
}
.circle {
width: 8px;
height: 8px;
border-top-right-radius: 50px;
border-top-left-radius: 50px;
border-bottom-left-radius: 50px;
border-bottom-right-radius: 50px;
background-color: $uni-text-color-disable;
}
.uni-section__content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
flex: 1;
color: $uni-text-color;
}
.uni-section__content-title {
font-size: $uni-font-size-base;
color: $uni-text-color;
}
.distraction {
flex-direction: row;
align-items: center;
}
.uni-section__content-sub {
font-size: $uni-font-size-sm;
color: $uni-text-color-grey;
}
</style>
{ {
"id": "uni-starter", "id": "uni-starter",
"displayName": "uni-starter", "displayName": "uni-starter",
"version": "2.0.3", "version": "2.0.4",
"description": "云端一体应用快速开发基本项目模版", "description": "云端一体应用快速开发基本项目模版",
"keywords": [ "keywords": [
"login", "login",
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
"engines": { "engines": {
"HBuilderX": "^3.2.6" "HBuilderX": "^3.2.6"
}, },
"dcloudext": { "dcloudext": {
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
}, },
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "", "npmurl": "",
"type": "unicloud-template-project" "type": "unicloud-template-project"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [ "dependencies": [
"uni-id-pages" "uni-id-pages"
], ],
"encrypt": [], "encrypt": [],
...@@ -67,8 +67,8 @@ ...@@ -67,8 +67,8 @@
"阿里": "u", "阿里": "u",
"百度": "u", "百度": "u",
"字节跳动": "u", "字节跳动": "u",
"QQ": "u", "QQ": "u",
"京东": "u" "京东": "u"
}, },
"快应用": { "快应用": {
"华为": "u", "华为": "u",
...@@ -81,5 +81,7 @@ ...@@ -81,5 +81,7 @@
} }
} }
}, },
"dependencies": {} "dependencies": {
"qrcodejs2": "^0.0.2"
}
} }
...@@ -122,13 +122,13 @@ ...@@ -122,13 +122,13 @@
"style": { "style": {
"navigationBarTitleText": "注销账号" "navigationBarTitleText": "注销账号"
} }
}, },
{ {
"path": "uni_modules/uni-id-pages/pages/userinfo/userinfo", "path": "uni_modules/uni-id-pages/pages/userinfo/userinfo",
"style": { "style": {
"navigationBarTitleText": "个人资料" "navigationBarTitleText": "个人资料"
} }
},{ }, {
"path": "uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile", "path": "uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile",
"style": { "style": {
"navigationBarTitleText": "绑定手机号码" "navigationBarTitleText": "绑定手机号码"
...@@ -175,33 +175,30 @@ ...@@ -175,33 +175,30 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarTitleText": "修改密码" "navigationBarTitleText": "修改密码"
} }
}, {
"path": "uni_modules/uni-id-pages/pages/register/register-by-email",
"style": {
"navigationBarTitleText": "邮箱验证码注册"
}
}, {
"path": "uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email",
"style": {
"navigationBarTitleText": "通过邮箱重置密码"
}
}, {
"path": "uni_modules/uni-id-pages/pages/register/register-admin",
"style": {
"enablePullDownRefresh": false,
"navigationBarTitleText": "注册管理员账号"
}
} }
,{ ],
"path": "uni_modules/uni-id-pages/pages/register/register-by-email", "globalStyle": {
"style": { // #ifdef H5
"navigationBarTitleText": "邮箱验证码注册" "h5": {
} "titleNView": false
} },
,{ // #endif
"path": "uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email",
"style": {
"navigationBarTitleText": "通过邮箱重置密码"
}
}
,{
"path": "uni_modules/uni-id-pages/pages/register/register-admin",
"style": {
"enablePullDownRefresh": false,
"navigationBarTitleText": "注册管理员账号"
}
}
],
"globalStyle": {
// #ifdef H5
"h5": {
"titleNView":false
},
// #endif
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-starter", "navigationBarTitleText": "uni-starter",
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
...@@ -245,12 +242,12 @@ ...@@ -245,12 +242,12 @@
"selectedIconPath": "static/tabbar/me_active.png", "selectedIconPath": "static/tabbar/me_active.png",
"text": "我的" "text": "我的"
}] }]
}, },
"uniIdRouter": { "uniIdRouter": {
"loginPage": "uni_modules/uni-id-pages/pages/login/login-withoutpwd", "loginPage": "uni_modules/uni-id-pages/pages/login/login-withoutpwd",
"needLogin": [ "needLogin": [
"/uni_modules/uni-id-pages/pages/userinfo/userinfo" "/uni_modules/uni-id-pages/pages/userinfo/userinfo"
], ],
"resToLogin": true "resToLogin": true
} }
} }
...@@ -2,39 +2,39 @@ ...@@ -2,39 +2,39 @@
<view class="warp"> <view class="warp">
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<status-bar /> <status-bar />
<!-- #endif --> <!-- #endif -->
<!-- banner --> <!-- banner -->
<unicloud-db ref="bannerdb" v-slot:default="{data, loading, error, options}" collection="opendb-banner" <unicloud-db ref="bannerdb" v-slot:default="{data, loading, error, options}" collection="opendb-banner"
field="_id,bannerfile,open_url,title" @load="onqueryload"> field="_id,bannerfile,open_url,title" @load="onqueryload">
<!-- 当无banner数据时显示占位图 --> <!-- 当无banner数据时显示占位图 -->
<image v-if="!(loading||data.length)" class="banner-image" src="/static/grid/empty.png" mode="aspectFill" :draggable="false" /> <image v-if="!(loading||data.length)" class="banner-image" src="/static/grid/empty.png" mode="aspectFill" :draggable="false" />
<uni-swiper-dot v-else class="uni-swiper-dot-box" @clickItem="clickItem" :info="data" <uni-swiper-dot v-else class="uni-swiper-dot-box" @clickItem="clickItem" :info="data"
:current="current" field="content"> :current="current" field="content">
<swiper class="swiper-box" @change="changeSwiper" :current="swiperDotIndex"> <swiper class="swiper-box" @change="changeSwiper" :current="swiperDotIndex">
<swiper-item v-for="(item, index) in data" :key="item._id"> <swiper-item v-for="(item, index) in data" :key="item._id">
<view class="swiper-item" @click="clickBannerItem(item)"> <view class="swiper-item" @click="clickBannerItem(item)">
<image class="banner-image" :src="item.bannerfile.url" mode="aspectFill" :draggable="false" /> <image class="banner-image" :src="item.bannerfile.url" mode="aspectFill" :draggable="false" />
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
</uni-swiper-dot> </uni-swiper-dot>
</unicloud-db> </unicloud-db>
<!-- 宫格 --> <!-- 宫格 -->
<uni-section :title="$t('grid.grid')" style="margin: 0;" type="line"></uni-section> <uni-section :title="$t('grid.grid')" style="margin: 0;" type="line"></uni-section>
<view class="example-body"> <view class="example-body">
<uni-grid :column="3" :highlight="true" @change="change"> <uni-grid :column="3" :highlight="true" @change="change">
<template v-for="(item,i) in gridList"> <template v-for="(item,i) in gridList">
<uni-grid-item :index="i" :key="i" <uni-grid-item :index="i" :key="i"
v-if="i<3 || i>2&&i<6&&hasLogin || i>5&&uniIDHasRole('admin')" v-if="i<3 || i>2&&i<6&&hasLogin || i>5&&uniIDHasRole('admin')"
> >
<view class="grid-item-box" style="background-color: #fff;"> <view class="grid-item-box" style="background-color: #fff;">
<!-- <image :src="'/static/grid/c'+(i+1)+'.png'" class="image" mode="aspectFill" /> --> <!-- <image :src="'/static/grid/c'+(i+1)+'.png'" class="image" mode="aspectFill" /> -->
<text class="big-number">{{i+1}}</text> <text class="big-number">{{i+1}}</text>
<text class="text">{{item}}</text> <text class="text">{{item}}</text>
</view> </view>
</uni-grid-item> </uni-grid-item>
</template> </template>
</uni-grid> </uni-grid>
</view> </view>
...@@ -51,25 +51,25 @@ ...@@ -51,25 +51,25 @@
return { return {
gridList: [], gridList: [],
current: 0, current: 0,
swiperDotIndex: 0, swiperDotIndex: 0,
hasLogin:false hasLogin:false
} }
}, },
onShow() { onShow() {
this.hasLogin = uniCloud.getCurrentUserInfo().tokenExpired > Date.now() this.hasLogin = uniCloud.getCurrentUserInfo().tokenExpired > Date.now()
}, },
onLoad() { onLoad() {
let gridList = [] let gridList = []
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
gridList.push( this.$t('grid.visibleToAll') ) gridList.push( this.$t('grid.visibleToAll') )
} }
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
gridList.push( this.$t('grid.invisibleToTourists') ) gridList.push( this.$t('grid.invisibleToTourists') )
} }
for (var i = 0; i < 3; i++) { for (var i = 0; i < 3; i++) {
gridList.push( this.$t('grid.adminVisible') ) gridList.push( this.$t('grid.adminVisible') )
} }
this.gridList = gridList this.gridList = gridList
}, },
methods: { methods: {
change(e) { change(e) {
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
/** /**
* banner加载后触发的回调 * banner加载后触发的回调
*/ */
onqueryload(data) { onqueryload(data) {
}, },
changeSwiper(e) { changeSwiper(e) {
this.current = e.detail.current this.current = e.detail.current
...@@ -151,13 +151,13 @@ ...@@ -151,13 +151,13 @@
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
} }
.big-number{ .big-number{
font-size: 50rpx; font-size: 50rpx;
font-weight: 700; font-weight: 700;
font-stretch: condensed; font-stretch: condensed;
font-style:oblique; font-style:oblique;
} }
.text { .text {
text-align: center; text-align: center;
...@@ -210,16 +210,16 @@ ...@@ -210,16 +210,16 @@
} }
/* #ifndef APP-NVUE || VUE3*/ /* #ifndef APP-NVUE || VUE3*/
/deep/ ::v-deep
/* #endif */ /* #endif */
.uni-searchbar__box { .uni-searchbar__box {
border-width: 0; border-width: 0;
} }
/* #ifndef APP-NVUE || VUE3 */ /* #ifndef APP-NVUE || VUE3 */
/deep/ ::v-deep
/* #endif */ /* #endif */
.uni-input-placeholder { .uni-input-placeholder {
font-size: 28rpx; font-size: 28rpx;
} }
</style> </style>
...@@ -378,7 +378,7 @@ ...@@ -378,7 +378,7 @@
/* #ifdef APP-PLUS */ /* #ifdef APP-PLUS */
/* #ifndef APP-NVUE || VUE3*/ /* #ifndef APP-NVUE || VUE3*/
/deep/ ::v-deep
/* #endif */ /* #endif */
.uni-searchbar { .uni-searchbar {
padding-left: 0; padding-left: 0;
...@@ -387,14 +387,14 @@ ...@@ -387,14 +387,14 @@
/* #endif */ /* #endif */
/* #ifndef APP-NVUE || VUE3*/ /* #ifndef APP-NVUE || VUE3*/
/deep/ ::v-deep
/* #endif */ /* #endif */
.uni-searchbar__box { .uni-searchbar__box {
border-width: 0; border-width: 0;
} }
/* #ifndef APP-NVUE || VUE3 */ /* #ifndef APP-NVUE || VUE3 */
/deep/ ::v-deep
/* #endif */ /* #endif */
.uni-input-placeholder { .uni-input-placeholder {
font-size: 28rpx; font-size: 28rpx;
......
...@@ -4,8 +4,11 @@ ...@@ -4,8 +4,11 @@
<image class="logoImg" :src="about.logo"></image> <image class="logoImg" :src="about.logo"></image>
<text class="tip appName">{{about.appName}}</text> <text class="tip appName">{{about.appName}}</text>
<text class="tip">Version {{version}}</text> <text class="tip">Version {{version}}</text>
<!--Sansnn-uQRCode组件来源,插件市场:https://ext.dcloud.net.cn/plugin?id=1287 微调后--> <view class="qrcode">
<Sansnn-uQRCode :text="about.download" :makeOnLoad="true" class="qrcode"></Sansnn-uQRCode> <!--uqrcode 组件来源,插件Sansnn-uQRCode 链接地址:https://ext.dcloud.net.cn/plugin?id=1287-->
<uqrcode :size="100" canvas-id="qrcode" :value="about.download"></uqrcode>
</view>
<text class="tip">{{$t('about.sacnQR')}} {{about.appName}} {{$t('about.client')}}</text> <text class="tip">{{$t('about.sacnQR')}} {{about.appName}} {{$t('about.client')}}</text>
</view> </view>
<view class="copyright"> <view class="copyright">
...@@ -20,11 +23,15 @@ ...@@ -20,11 +23,15 @@
</template> </template>
<script> <script>
// #ifdef APP // #ifdef APP
import UniShare from '@/uni_modules/uni-share/js_sdk/uni-share.js'; import UniShare from '@/uni_modules/uni-share/js_sdk/uni-share.js';
const uniShare = new UniShare() const uniShare = new UniShare()
// #endif // #endif
import uniIdPagesConfig from '@/uni_modules/uni-id-pages/config.js'; import uniIdPagesConfig from '@/uni_modules/uni-id-pages/config.js';
import uqrcode from "@/uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode"
export default { export default {
components:{
uqrcode
},
// #ifdef APP // #ifdef APP
onBackPress({from}) { onBackPress({from}) {
if(from=='backbutton'){ if(from=='backbutton'){
...@@ -74,7 +81,7 @@ ...@@ -74,7 +81,7 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.$t('about.about')+ " " + this.about.appName title: this.$t('about.about')+ " " + this.about.appName
}) })
this.year = (new Date).getFullYear() this.year = (new Date).getFullYear()
}, },
onNavigationBarButtonTap() { onNavigationBarButtonTap() {
let { let {
...@@ -154,7 +161,7 @@ ...@@ -154,7 +161,7 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
view { view{
display: flex; display: flex;
box-sizing: border-box; box-sizing: border-box;
flex-direction: column; flex-direction: column;
...@@ -193,9 +200,14 @@ ...@@ -193,9 +200,14 @@
font-weight: 500; font-weight: 500;
} }
.qrcode { .qrcode ,.qrcode .uqrcode{
margin-top: 60rpx; margin: 10px 0;
} width: 100px;
height: 100px;
/* #ifndef APP-NVUE */
display: block;
/* #endif */
}
.copyright { .copyright {
font-size: 32rpx; font-size: 32rpx;
......
<template> <template>
<view class="content"> <view class="content">
<!-- 功能列表 --> <!-- 功能列表 -->
<uni-list class="mt10" :border="false"> <uni-list class="mt10" :border="false">
<uni-list-item :title="$t('settings.userInfo')" to="/uni_modules/uni-id-pages/pages/userinfo/userinfo" link="navigateTo"></uni-list-item> <uni-list-item :title="$t('settings.userInfo')" to="/uni_modules/uni-id-pages/pages/userinfo/userinfo" link="navigateTo"></uni-list-item>
<uni-list-item v-if="userInfo.mobile" :title="$t('settings.changePassword')" :to="'/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve?phoneNumber='+ userInfo.mobile" link="navigateTo"></uni-list-item> <uni-list-item v-if="userInfo.mobile" :title="$t('settings.changePassword')" :to="'/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve?phoneNumber='+ userInfo.mobile" link="navigateTo"></uni-list-item>
</uni-list> </uni-list>
...@@ -27,24 +27,27 @@ ...@@ -27,24 +27,27 @@
</template> </template>
<script> <script>
import pushServer from './dc-push/push.js'; import pushServer from './dc-push/push.js';
import common from '@/uni_modules/uni-id-pages/common/common.js'; import {
store,
mutations
} from '@/uni_modules/uni-id-pages/common/store.js'
export default { export default {
data() { data() {
return { return {
pushServer:pushServer, pushServer:pushServer,
supportMode:[], supportMode:[],
pushIsOn:"wait", pushIsOn:"wait",
currentLanguage:"", currentLanguage:"",
userInfo:{} userInfo:{}
} }
}, },
computed: { computed: {
hasLogin(){ hasLogin(){
return uniCloud.getCurrentUserInfo().tokenExpired > Date.now() return store.hasLogin
}, },
i18nEnable(){ i18nEnable(){
return getApp().globalData.config.i18n.enable return getApp().globalData.config.i18n.enable
} }
}, },
onLoad() { onLoad() {
...@@ -63,9 +66,9 @@ ...@@ -63,9 +66,9 @@
console.log(err); console.log(err);
} }
}) })
// #endif // #endif
}, },
onShow() { onShow() {
// 检查手机端获取推送是否开启 // 检查手机端获取推送是否开启
//#ifdef APP-PLUS //#ifdef APP-PLUS
setTimeout(()=>{ setTimeout(()=>{
...@@ -73,16 +76,16 @@ ...@@ -73,16 +76,16 @@
},300) },300)
//#endif //#endif
}, },
methods: { methods: {
async changeLoginState(){ async changeLoginState(){
if(this.hasLogin){ if(this.hasLogin){
await common.logout() await mutations.logout()
}else{ }else{
uni.redirectTo({ uni.redirectTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withoutpwd', url: '/uni_modules/uni-id-pages/pages/login/login-withoutpwd',
}); });
} }
}, },
/** /**
* 开始生物认证 * 开始生物认证
*/ */
...@@ -219,10 +222,10 @@ ...@@ -219,10 +222,10 @@
language = globalData.locale = 'en' language = globalData.locale = 'en'
} }
uni.setStorageSync('CURRENT_LANG', language) uni.setStorageSync('CURRENT_LANG', language)
getApp().globalData.$i18n.locale = language getApp().globalData.$i18n.locale = language
this.currentLanguage = res.tapIndex?'简体中文':'English' this.currentLanguage = res.tapIndex?'简体中文':'English'
if(uni.setLocale){ if(uni.setLocale){
uni.setLocale(language) uni.setLocale(language)
} }
uni.reLaunch({ uni.reLaunch({
url: '/pages/list/list', url: '/pages/list/list',
...@@ -290,10 +293,10 @@ ...@@ -290,10 +293,10 @@
margin-top: 10px; margin-top: 10px;
} }
/* #ifndef APP-NVUE || VUE3 */ /* #ifndef APP-NVUE || VUE3 */
.content /deep/ .uni-list { .content ::v-deep .uni-list {
background-color: #F9F9F9; background-color: #F9F9F9;
} }
.content /deep/ .uni-list-item--disabled,.list-item { .content ::v-deep .uni-list-item--disabled,.list-item {
height: 50px; height: 50px;
margin-bottom: 1px; margin-bottom: 1px;
} }
......
<template> <template>
<view class="center"> <view class="center">
<uni-sign-in ref="signIn"></uni-sign-in> <uni-sign-in ref="signIn"></uni-sign-in>
<view class="userInfo" @click.capture="toUserInfo"> <view class="userInfo" @click.capture="toUserInfo">
<cloud-image width="150rpx" height="150rpx" v-if="hasLogin&&userInfo.avatar_file&&userInfo.avatar_file.url" :src="userInfo.avatar_file.url"></cloud-image> <cloud-image width="150rpx" height="150rpx" v-if="hasLogin&&userInfo.avatar_file&&userInfo.avatar_file.url" :src="userInfo.avatar_file.url"></cloud-image>
<image v-else class="logo-img" src="@/static/uni-center/defaultAvatarUrl.png"></image> <image v-else class="logo-img" src="@/static/uni-center/defaultAvatarUrl.png"></image>
...@@ -37,7 +37,11 @@ ...@@ -37,7 +37,11 @@
import UniShare from '@/uni_modules/uni-share/js_sdk/uni-share.js'; import UniShare from '@/uni_modules/uni-share/js_sdk/uni-share.js';
const uniShare = new UniShare() const uniShare = new UniShare()
// #endif // #endif
const db = uniCloud.database(); const db = uniCloud.database();
import {
store,
mutations
} from '@/uni_modules/uni-id-pages/common/store.js'
export default { export default {
// #ifdef APP // #ifdef APP
onBackPress({from}) { onBackPress({from}) {
...@@ -132,9 +136,7 @@ ...@@ -132,9 +136,7 @@
"style": "solid", // 边框样式 "style": "solid", // 边框样式
"radius": "100%" // 边框圆角,支持百分比 "radius": "100%" // 边框圆角,支持百分比
} }
}, }
userInfo:{},
hasLogin:false
} }
}, },
onLoad() { onLoad() {
...@@ -149,21 +151,13 @@ ...@@ -149,21 +151,13 @@
//#endif //#endif
}, },
onShow() { onShow() {
this.hasLogin = uniCloud.getCurrentUserInfo().tokenExpired > Date.now()
if(this.hasLogin){
this.getUserInfo()
}
}, },
computed: { computed: {
test:{ userInfo() {
get(){ return store.userInfo
console.log(this._test,Date.now()); },
this._test = Date.now() hasLogin(){
return '' return store.hasLogin
},
set(){
}
}, },
// #ifdef APP-PLUS // #ifdef APP-PLUS
appVersion() { appVersion() {
...@@ -175,19 +169,6 @@ ...@@ -175,19 +169,6 @@
} }
}, },
methods: { methods: {
getUserInfo(e) {
const db = uniCloud.database();
db.collection('uni-id-users').where("'_id' == $cloudEnv_uid").field('mobile,nickname,avatar_file').get().then(res => {
console.log({res});
this.userInfo = res.result.data[0]
console.log('this.userInfo', this.userInfo);
}).catch(e => {
this.userInfo = {}
console.log(e.message, e.errCode);
}).finally(e => {
// console.log(e);
})
},
toSettings() { toSettings() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/ucenter/settings/settings" url: "/pages/ucenter/settings/settings"
......
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
//口号 //口号
"slogan": "云端一体应用快速开发模版", "slogan": "云端一体应用快速开发模版",
//应用的链接,用于分享到第三方平台和生成关于我们页的二维码 //应用的链接,用于分享到第三方平台和生成关于我们页的二维码
"download": "", "download": "https://itunes.apple.com/cn/app/hello-uni-app/id1417078253?mt=8",
//version //version
"version":"1.0.0" //用于非app端显示,app端自动获取 "version":"1.0.0" //用于非app端显示,app端自动获取
}, },
......
## 3.5.1(2022-08-11)
v3.5.1
修复vue3引入报错;
修复vue导出临时文件失败;
修复在其他dom元素更新时,可能导致二维码重新渲染;
修复size重新赋值导致组件偏移、闪烁。
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
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
class FillStylePattern {
constructor(img, pattern) {
this._style = pattern;
this._img = img;
}
}
export default FillStylePattern;
\ No newline at end of file
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
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
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
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
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
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
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;
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
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
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
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
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
export function getTransferedObjectUUID(name, id) {
return `${name.toLowerCase()}-${id}`;
}
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
## 1.0.4(2022-09-21)
- 新增 支持使用阿里云固定IP获取微信公众号H5凭据 access_token、ticket,开发者需要在微信公众平台配置阿里云固定IP,[固定IP详情](https://uniapp.dcloud.net.cn/uniCloud/cf-functions.html#aliyun-eip)
## 1.0.3(2022-09-06) ## 1.0.3(2022-09-06)
- 修复 过期时间问题,容错 AccessToken 默认 fallback 逻辑,当微信服务器没有返回过期时间时设置为2小时后过期 - 修复 过期时间问题,容错 AccessToken 默认 fallback 逻辑,当微信服务器没有返回过期时间时设置为2小时后过期
## 1.0.2(2022-09-02) ## 1.0.2(2022-09-02)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册