提交 4f933850 编写于 作者: DCloud_JSON's avatar DCloud_JSON 提交者: study夏羽

- 修复微信小程序绑定手机号失败的问题

上级 2f8d4f4f
此差异已折叠。
{
"prompt" : "template"
}
{
"prompt" : "template"
}
此差异已折叠。
<template>
<refresh @refresh="refresh" @pullingdown="onpullingdown" :display="showRefresh ? 'show' : 'hide'">
<view class="refreshBox">
<!-- 可以自己添加图片路径或base64实现图片 <image class="refreshImg" :src="config[state].img" mode="widthFix" resize="cover"></image> -->
<text class="refreshText">{{config[state].text}}</text>
</view>
</refresh>
</template>
<script>
export default {
data() {
return {
showRefresh:false,
state:0
}
},
methods:{
onpullingdown({pullingDistance,viewHeight}) {
if(pullingDistance < viewHeight){
this.state = 0
}else{
this.state = 1
}
},
refresh(){
// console.log('refresh');
this.showRefresh = true
this.state = 2
this.$emit('refresh')
}
},
watch: {
loading(loading, oldValue) {
if(!loading){
this.showRefresh = false
this.state = 3
}
}
},
props: {
loading: {
type:Boolean,
default(){
return false
}
},
config: {
type: Array,
default(){
return [
{
text:"继续下拉执行刷新",
img:""//可以自己添加图片路径或base64实现图片
},
{
text:"释放立即刷新",
img:""//可以自己添加图片路径或base64实现图片
},
{
text:"正在疯狂的加载中",
img:""//可以自己添加图片路径或base64实现图片
},
{
text:"加载成功",
img:""//可以自己添加图片路径或base64实现图片
}
]
}
},
},
}
</script>
<style lang="scss" scoped>
.refreshBox{
width: 750rpx;
height: 50px;
justify-content: center;
align-items: center;
flex-direction: row;
/* #ifndef APP-PLUS */
margin-top: -50px;
/* #endif */
}
.refreshImg{
width: 55rpx;
height: 55rpx;
z-index: 111;
}
.refreshText{
font-size: 26rpx;
color: #999999;
padding-left: 6rpx;
}
</style>
<template>
<refresh @refresh="refresh" @pullingdown="onpullingdown" :display="showRefresh ? 'show' : 'hide'">
<view class="refreshBox">
<!-- 可以自己添加图片路径或base64实现图片 <image class="refreshImg" :src="config[state].img" mode="widthFix" resize="cover"></image> -->
<text class="refreshText">{{config[state].text}}</text>
</view>
</refresh>
</template>
<script>
export default {
data() {
return {
showRefresh:false,
state:0
}
},
methods:{
onpullingdown({pullingDistance,viewHeight}) {
if(pullingDistance < viewHeight){
this.state = 0
}else{
this.state = 1
}
},
refresh(){
// console.log('refresh');
this.showRefresh = true
this.state = 2
this.$emit('refresh')
}
},
watch: {
loading(loading, oldValue) {
if(!loading){
this.showRefresh = false
this.state = 3
}
}
},
props: {
loading: {
type:Boolean,
default(){
return false
}
},
config: {
type: Array,
default(){
return [
{
text:"继续下拉执行刷新",
img:""//可以自己添加图片路径或base64实现图片
},
{
text:"释放立即刷新",
img:""//可以自己添加图片路径或base64实现图片
},
{
text:"正在疯狂的加载中",
img:""//可以自己添加图片路径或base64实现图片
},
{
text:"加载成功",
img:""//可以自己添加图片路径或base64实现图片
}
]
}
},
},
}
</script>
<style lang="scss" scoped>
.refreshBox{
width: 750rpx;
height: 50px;
justify-content: center;
align-items: center;
flex-direction: row;
/* #ifndef APP-PLUS */
margin-top: -50px;
/* #endif */
}
.refreshImg{
width: 55rpx;
height: 55rpx;
z-index: 111;
}
.refreshText{
font-size: 26rpx;
color: #999999;
padding-left: 6rpx;
}
</style>
......@@ -4,7 +4,7 @@
<checkbox :checked="isAgree" style="transform: scale(0.7);" />
<text>{{$t('common.agree')}}</text>
</checkbox-group>
<view v-if="agreements" class="item" v-for="(agreement,index) in agreements" :key="index">
<view class="item" v-for="(agreement,index) in agreements" :key="index">
<text class="agreement" @click="navigateTo(agreement)">{{agreement.title}}</text>
<text class="hint" v-if="hasAnd(agreements,index)">&</text>
</view>
......@@ -16,7 +16,7 @@
name:"uni-agreements",
computed:{
agreements(){
return getApp({allowDefault: true}).globalData.config.about.agreements||[]
return getApp().globalData.config.about.agreements||[]
}
},
methods:{
......
......@@ -71,7 +71,7 @@
},
bindMobileByMpWeixin(e) {
console.log(e.detail);
if(e.errMsg == "getPhoneNumber:ok"){
if(e.detail.errMsg == "getPhoneNumber:ok"){
uniCloud.callFunction({
name: "uni-id-cf",
data: {
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>
\ No newline at end of file
{
"name" : "uni-starter",
"appid" : "__UNI__EC87F46",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* 模块配置 */
"modules" : {},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios打包配置 */
"ios" : {},
/* SDK配置 */
"sdkConfigs" : {}
}
"name": "uni-starter",
"appid": "请点击重新获取",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
"app-plus": {
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
"modules": {
},
"mp-alipay" : {
"usingComponents" : true
"distribute": {
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
"ios": {
},
"sdkConfigs": {
}
}
},
"quickapp": {
},
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
}
"usingComponents": true,
"permission": {
"scope.userLocation": {
"desc": "用于提供应用算法支持"
}
}
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion": "2",
"_spaceID": ""
}
\ No newline at end of file
{
"id": "uni-starter",
"displayName": "uni-starter",
"version": "1.2.6",
"version": "1.2.7",
"description": "云端一体应用快速开发基本项目模版",
"keywords": [
"login",
"登录",
"搜索",
"uni-id实例",
"留言板"
],
"login",
"登录",
"搜索",
"uni-id实例",
"留言板"
],
"repository": "https://gitcode.net/dcloud/uni-starter",
"engines": {
"HBuilderX": "^3.2.6"
},
"dcloudext": {
"category": [
"uniCloud",
"云端一体项目模板"
],
"sale": {
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
......@@ -35,7 +31,8 @@
"data": "无",
"permissions": "无"
},
"npmurl": ""
"npmurl": "",
"type": "unicloud-template-project"
},
"uni_modules": {
"dependencies": [
......@@ -85,7 +82,5 @@
}
}
},
"dependencies": {
"@jest/test-sequencer": "^27.5.1"
}
"dependencies": {}
}
<template>
<view>
<web-view v-if="url" :src="url"></web-view>
</view>
</template>
<script>
export default {
onLoad({url,title}) {
if(url.substring(0, 4) != 'http'){
uni.showModal({
title:"错误",
content: '不是一个有效的网站链接,'+'"'+url+'"',
showCancel: false,
confirmText:"知道了",
complete: () => {
uni.navigateBack()
}
});
title = "页面路径错误"
}else{
console.log(url,title);
this.url = url;
}
if(title){
uni.setNavigationBarTitle({title});
}
},
data() {
return {
url:null
};
}
}
</script>
<style lang="scss">
</style>
<template>
<view>
<web-view v-if="url" :src="url"></web-view>
</view>
</template>
<script>
export default {
onLoad({url,title}) {
if(url.substring(0, 4) != 'http'){
uni.showModal({
title:"错误",
content: '不是一个有效的网站链接,'+'"'+url+'"',
showCancel: false,
confirmText:"知道了",
complete: () => {
uni.navigateBack()
}
});
title = "页面路径错误"
}else{
console.log(url,title);
this.url = url;
}
if(title){
uni.setNavigationBarTitle({title});
}
},
data() {
return {
url:null
};
}
}
</script>
<style lang="scss">
</style>
此差异已折叠。
......@@ -2,8 +2,7 @@
<view class="center">
<uni-sign-in ref="signIn"></uni-sign-in>
<view class="userInfo" @click.capture="toUserInfo">
<cloud-image width="150rpx" height="150rpx" v-if="userInfo.avatar_file&&userInfo.avatar_file.url"
:src="userInfo.avatar_file.url"></cloud-image>
<cloud-image width="150rpx" height="150rpx" v-if="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>
<view class="logo-title">
<text class="uer-name" v-if="hasLogin">{{userInfo.nickname||userInfo.username||userInfo.mobile}}</text>
......@@ -45,11 +44,9 @@
const db = uniCloud.database();
export default {
// #ifdef APP
onBackPress({
from
}) {
if (from == 'backbutton') {
this.$nextTick(function() {
onBackPress({from}) {
if(from=='backbutton'){
this.$nextTick(function(){
uniShare.hide()
})
return uniShare.isShow;
......@@ -97,7 +94,7 @@
},
//#endif
{
"title": this.$t('mine.readArticles'),
"title":this.$t('mine.readArticles'),
"to": '/pages/ucenter/read-news-log/read-news-log',
"icon": "flag"
},
......@@ -139,16 +136,14 @@
"style": "solid", // 边框样式
"radius": "100%" // 边框圆角,支持百分比
}
},
uniToken:''
}
}
},
onLoad() {
// console.log(313,this.userInfo,this.hasLogin);
console.log("this.appVersion: ",this.appVersion);
//#ifdef APP-PLUS
this.ucenterList[this.ucenterList.length - 2].unshift({
title: this.$t('mine.checkUpdate'), // this.this.$t('mine.checkUpdate')"检查更新"
title:this.$t('mine.checkUpdate'),// this.this.$t('mine.checkUpdate')"检查更新"
rightText: this.appVersion.version + '-' + this.appVersion.versionCode,
event: 'checkVersion',
icon: 'loop',
......@@ -156,10 +151,6 @@
})
//#endif
},
onReady() {
this.uniToken = uni.getStorageSync('uni_id_token')
console.log("uniToken: ", this.uniToken);
},
computed: {
...mapGetters({
userInfo: 'user/info',
......@@ -168,12 +159,12 @@
// #ifdef APP-PLUS
,
appVersion() {
return getApp({allowDefault: true}).appVersion
return getApp().appVersion
}
// #endif
,
appConfig() {
return getApp({allowDefault: true}).globalData.config
return getApp().globalData.config
}
},
methods: {
......@@ -186,11 +177,9 @@
})
},
signIn() { //普通签到
console.log('app---普通签到');
this.$refs.signIn.open()
},
signInByAd() { //看激励视频广告签到
console.log('app---看激励视频广告签到');
signInByAd(){ //看激励视频广告签到
this.$refs.signIn.showRewardedVideoAd()
},
/**
......@@ -221,7 +210,7 @@
tapGrid(index) {
uni.showToast({
// title: '你点击了,第' + (index + 1) + '个',
title: this.$t('mine.clicked') + " " + (index + 1),
title: this.$t('mine.clicked') + " " + (index + 1) ,
icon: 'none'
});
},
......@@ -248,7 +237,7 @@
/**
* 获取积分信息
*/
async getScore() {
getScore() {
if (!this.userInfo) return uni.showToast({
title: this.$t('mine.checkScore'),
icon: 'none'
......@@ -256,7 +245,7 @@
uni.showLoading({
mask: true
})
return await db.collection("uni-id-scores")
db.collection("uni-id-scores")
.where('"user_id" == $env.uid')
.field('score,balance')
.orderBy("create_date", "desc")
......@@ -266,23 +255,19 @@
console.log(res);
const data = res.result.data[0];
let msg = '';
msg = data ? (this.$t('mine.currentScore') + data.balance) : this.$t('mine.noScore');
msg = data ? (this.$t('mine.currentScore')+ data.balance) : this.$t('mine.noScore');
uni.showToast({
title: msg,
icon: 'none'
});
return data
}).catch((reason) => {
console.log(reason, '这是失败的操作');
return reason
}).finally((e) => {
}).finally(()=>{
uni.hideLoading()
console.log("e: ", e);
return e
})
},
async share() {
let {result} = await uniCloud.callFunction({
let {
result
} = await uniCloud.callFunction({
name: 'uni-id-cf',
data: {
action: 'getUserInviteCode'
......@@ -370,7 +355,6 @@
page {
background-color: #f8f8f8;
}
/* #endif*/
.center {
......
......@@ -30,27 +30,27 @@ export default {
2.visitor:白名单模式。枚举游客可访问的页面。
* 注意:黑名单与白名单模式二选一
*/
"needLogin" : [
// {pattern:/^\/pages\/list.*/}, //支持正则表达式
// "/uni_modules/uni-news-favorite/pages/uni-news-favorite/list",
// "/uni_modules/uni-feedback/pages/uni-feedback/add"
],
// "visitor" : [
// "/",//注意入口页必须直接写 "/"
// {"pattern":/^\/pages\/list.*/}, //支持正则表达式
// {"pattern":/^\/pages\/ucenter\/login-page.*/},
// "/pages/common/webview/webview",
// "/pages/grid/grid",
// "/pages/ucenter/ucenter",
// "/pages/ucenter/about/about",
// "/pages/ucenter/settings/settings"
// "needLogin" : [
// {pattern:/^\/pages\/list.*/}, //支持正则表达式
// "/uni_modules/uni-news-favorite/pages/uni-news-favorite/list",
// "/uni_modules/uni-feedback/pages/uni-feedback/add"
// ],
"visitor" : [
"/",//注意入口页必须直接写 "/"
{"pattern":/^\/pages\/list.*/}, //支持正则表达式
{"pattern":/^\/pages\/ucenter\/login-page.*/},
"/pages/common/webview/webview",
"/pages/grid/grid",
"/pages/ucenter/ucenter",
"/pages/ucenter/about/about",
"/pages/ucenter/settings/settings"
],
/*
login:配置登录类型与优先级
未列举到的,或设备环境不支持的选项,将被隐藏。如果你需要在不同平台有不同的配置,直接用条件编译即可
根据数组的第0项,决定登录方式的第一优先级。
*/
"login": ["username", "univerify", "weixin", "smsCode", "apple"],
"login": ["weixin","univerify","username", "smsCode", "apple"]
},
//关于应用
"about": {
......@@ -65,11 +65,11 @@ export default {
//政策协议
"agreements": [{
"title": "用户服务协议", //如果开启了多语言国际化,本配置将失效。请在 lang/en.js 和 lang/zh-Hans.js中配置
"url": "https://ask.dcloud.net.cn/protocol.html" //对应的网络链接
"url": "请填写用户服务协议链接" //对应的网络链接
},
{
"title": "隐私政策", //如果开启了多语言国际化,本配置将失效。请在 lang/en.js 和 lang/zh-Hans.js中配置
"url": "https://ask.dcloud.net.cn/protocol.html" //对应的网络链接
"url": "请填写隐私政策链接" //对应的网络链接
}
],
//应用的链接,用于分享到第三方平台和生成关于我们页的二维码
......
## 1.0.0(2021-07-12)
第一版发布
## 1.0.0(2021-07-12)
第一版发布
{
"id": "json-gps",
"displayName": "地理位置获取方法,支持在onShow生命周期使用集成权限判断和引导开启(包括设备权限和应用权限)",
"version": "1.0.0",
"description": "支持在onShow生命周期使用集成权限判断和引导开启(包括设备权限和应用权限)的地理位置获取方法",
"keywords": [
"权限引导"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"JS SDK",
"通用 SDK"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "插件不采集任何数据",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "y",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
{
"id": "json-gps",
"displayName": "地理位置获取方法,支持在onShow生命周期使用集成权限判断和引导开启(包括设备权限和应用权限)",
"version": "1.0.0",
"description": "支持在onShow生命周期使用集成权限判断和引导开启(包括设备权限和应用权限)的地理位置获取方法",
"keywords": [
"权限引导"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"JS SDK",
"通用 SDK"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "插件不采集任何数据",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "y",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}
\ No newline at end of file
## 1.0.2(2021-05-20)
修复IOS提示不准确,无摄像头权限提示了无法访问相册
## 1.0.1(2021-05-20)
新增文档和示例代码
## 1.0.0(2021-05-20)
第一版本发布
## 1.0.2(2021-05-20)
修复IOS提示不准确,无摄像头权限提示了无法访问相册
## 1.0.1(2021-05-20)
新增文档和示例代码
## 1.0.0(2021-05-20)
第一版本发布
export default function(){
//当应用无访问摄像头/相册权限,引导跳到设置界面
uni.addInterceptor('chooseImage', {
fail(e) { // 失败回调拦截 更多拦截器用法 [详情](https://uniapp.dcloud.io/api/interceptor?id=addinterceptor)
console.log(e);
if (uni.getSystemInfoSync().platform == "android" && e.errMsg == 'chooseImage:fail No Permission') {
if (e.code === 11) {
uni.showModal({
title: "无法访问摄像头",
content: "当前无摄像头访问权限,建议前往设置",
confirmText: "前往设置",
success(e) {
if (e.confirm) {
gotoAppPermissionSetting()
}
}
});
} else {
uni.showModal({
title: "无法访问相册",
content: "当前无系统相册访问权限,建议前往设置",
confirmText: "前往设置",
success(e) {
if (e.confirm) {
gotoAppPermissionSetting()
}
}
});
}
} else if (e.errCode === 2&&e.errMsg == "chooseImage:fail No filming permission") {
console.log('e.errMsg === 2 ios无法拍照权限 ');
// 注:e.errCode === 8 ios无从相册选择图片的权限 api已内置无需自己用拦截器实现
uni.showModal({
title: "无法访问摄像头",
content: "当前无摄像头访问权限,建议前往设置",
confirmText: "前往设置",
success(e) {
if (e.confirm) {
gotoAppPermissionSetting()
}
}
});
}
}
})
//跳转到**应用**的权限页面 参考来源:https://ext.dcloud.net.cn/plugin?id=594
function gotoAppPermissionSetting() {
if (uni.getSystemInfoSync().platform == "ios") {
var UIApplication = plus.ios.import("UIApplication");
var application2 = UIApplication.sharedApplication();
var NSURL2 = plus.ios.import("NSURL");
var setting2 = NSURL2.URLWithString("app-settings:");
application2.openURL(setting2);
plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2);
} else {
var Intent = plus.android.importClass("android.content.Intent");
var Settings = plus.android.importClass("android.provider.Settings");
var Uri = plus.android.importClass("android.net.Uri");
var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri);
mainActivity.startActivity(intent);
}
}
export default function(){
//当应用无访问摄像头/相册权限,引导跳到设置界面
uni.addInterceptor('chooseImage', {
fail(e) { // 失败回调拦截 更多拦截器用法 [详情](https://uniapp.dcloud.io/api/interceptor?id=addinterceptor)
console.log(e);
if (uni.getSystemInfoSync().platform == "android" && e.errMsg == 'chooseImage:fail No Permission') {
if (e.code === 11) {
uni.showModal({
title: "无法访问摄像头",
content: "当前无摄像头访问权限,建议前往设置",
confirmText: "前往设置",
success(e) {
if (e.confirm) {
gotoAppPermissionSetting()
}
}
});
} else {
uni.showModal({
title: "无法访问相册",
content: "当前无系统相册访问权限,建议前往设置",
confirmText: "前往设置",
success(e) {
if (e.confirm) {
gotoAppPermissionSetting()
}
}
});
}
} else if (e.errCode === 2&&e.errMsg == "chooseImage:fail No filming permission") {
console.log('e.errMsg === 2 ios无法拍照权限 ');
// 注:e.errCode === 8 ios无从相册选择图片的权限 api已内置无需自己用拦截器实现
uni.showModal({
title: "无法访问摄像头",
content: "当前无摄像头访问权限,建议前往设置",
confirmText: "前往设置",
success(e) {
if (e.confirm) {
gotoAppPermissionSetting()
}
}
});
}
}
})
//跳转到**应用**的权限页面 参考来源:https://ext.dcloud.net.cn/plugin?id=594
function gotoAppPermissionSetting() {
if (uni.getSystemInfoSync().platform == "ios") {
var UIApplication = plus.ios.import("UIApplication");
var application2 = UIApplication.sharedApplication();
var NSURL2 = plus.ios.import("NSURL");
var setting2 = NSURL2.URLWithString("app-settings:");
application2.openURL(setting2);
plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2);
} else {
var Intent = plus.android.importClass("android.content.Intent");
var Settings = plus.android.importClass("android.provider.Settings");
var Uri = plus.android.importClass("android.net.Uri");
var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri);
mainActivity.startActivity(intent);
}
}
}
\ No newline at end of file
{
"id": "json-interceptor-chooseImage",
"displayName": "拦截器应用示例 — 图片选择",
"version": "1.0.2",
"description": "当选择图片遇到权限问题时引导用户快捷打开系统设置",
"keywords": [
"interceptor,拦截器,相册权限"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"JS SDK",
"通用 SDK"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "n",
"Android Browser": "n",
"微信浏览器(Android)": "n",
"QQ浏览器(Android)": "n"
},
"H5-pc": {
"Chrome": "n",
"IE": "n",
"Edge": "n",
"Firefox": "n",
"Safari": "n"
},
"小程序": {
"微信": "n",
"阿里": "n",
"百度": "n",
"字节跳动": "n",
"QQ": "n"
},
"快应用": {
"华为": "n",
"联盟": "n"
}
}
}
}
{
"id": "json-interceptor-chooseImage",
"displayName": "拦截器应用示例 — 图片选择",
"version": "1.0.2",
"description": "当选择图片遇到权限问题时引导用户快捷打开系统设置",
"keywords": [
"interceptor,拦截器,相册权限"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"JS SDK",
"通用 SDK"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "n",
"Android Browser": "n",
"微信浏览器(Android)": "n",
"QQ浏览器(Android)": "n"
},
"H5-pc": {
"Chrome": "n",
"IE": "n",
"Edge": "n",
"Firefox": "n",
"Safari": "n"
},
"小程序": {
"微信": "n",
"阿里": "n",
"百度": "n",
"字节跳动": "n",
"QQ": "n"
},
"快应用": {
"华为": "n",
"联盟": "n"
}
}
}
}
}
\ No newline at end of file
## 1.4.5(2022-02-25)
- 修复 条件编译 nvue 不支持的 css 样式
## 1.4.4(2022-02-25)
- 修复 条件编译 nvue 不支持的 css 样式
## 1.4.3(2021-09-22)
- 修复 startDate、 endDate 属性失效的 bug
## 1.4.2(2021-08-24)
......
{
"id": "uni-calendar",
"displayName": "uni-calendar 日历",
"version": "1.4.5",
"version": "1.4.3",
"description": "日历组件",
"keywords": [
"uni-ui",
......
module.exports = {
"image-captcha":{
"width": 150, //图片宽度
"height": 44, //图片高度
"background": "#FFFAE8", //验证码背景色,设置空字符`''`不使用背景颜色
// "size": 4, //验证码长度,最多 6 个字符
// "noise": 4, //验证码干扰线条数
// "color": false, //字体是否使用随机颜色,当设置`background`后恒为`true`
// "fontSize": 40, //字体大小
// "ignoreChars": '', //忽略那些字符
// "mathExpr": false, //是否使用数学表达式
// "mathMin": 1, //表达式所使用的最小数字
// "mathMax": 9, //表达式所使用的最大数字
// "mathOperator": '' //表达式所使用的运算符,支持 `+`、`-`。不传随机使用
// "expiresDate":180 //验证码过期时间(s)
}
module.exports = {
"image-captcha":{
"width": 150, //图片宽度
"height": 44, //图片高度
"background": "#FFFAE8", //验证码背景色,设置空字符`''`不使用背景颜色
// "size": 4, //验证码长度,最多 6 个字符
// "noise": 4, //验证码干扰线条数
// "color": false, //字体是否使用随机颜色,当设置`background`后恒为`true`
// "fontSize": 40, //字体大小
// "ignoreChars": '', //忽略那些字符
// "mathExpr": false, //是否使用数学表达式
// "mathMin": 1, //表达式所使用的最小数字
// "mathMax": 9, //表达式所使用的最大数字
// "mathOperator": '' //表达式所使用的运算符,支持 `+`、`-`。不传随机使用
// "expiresDate":180 //验证码过期时间(s)
}
}
\ No newline at end of file
{
"id": "3796",
"name": "DataPicker",
"desc": "数据驱动的picker选择器",
"url": "data-picker",
"type": "表单组件",
"edition": "0.0.8",
"suffix": "vue",
"module": ["uni-data-picker","uni-data-pickerview","uni-load-more"],
"path": "https://ext.dcloud.net.cn/plugin?id=3796",
"update_log": ["- 优化 增加下拉箭头"]
}
{
"id": "3796",
"name": "DataPicker",
"desc": "数据驱动的picker选择器",
"url": "data-picker",
"type": "表单组件",
"edition": "0.0.8",
"suffix": "vue",
"module": ["uni-data-picker","uni-data-pickerview","uni-load-more"],
"path": "https://ext.dcloud.net.cn/plugin?id=3796",
"update_log": ["- 优化 增加下拉箭头"]
}
## 2.2.4(2022-03-31)
- 修复 Vue3 下动态赋值,单选类型未响应的 bug
## 2.2.3(2022-03-28)
- 修复 Vue3 下动态赋值未响应的 bug
## 2.2.2(2021-12-10)
- 修复 clear-icon 属性在小程序平台不生效的 bug
## 2.2.1(2021-12-10)
......
{
"id": "uni-datetime-picker",
"displayName": "uni-datetime-picker 日期选择器",
"version": "2.2.4",
"version": "2.2.2",
"description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择",
"keywords": [
"uni-datetime-picker",
......
## 1.0.15(2022-05-11)
- loginBySms、bindMobileBySms新增防刷机制(当短信验证码输入错误2次以上,弹出图形验证码进行人机校验)
- 更改loginLog为uniIdLog 记录各类uni-id操作,并新增action字段记录操作的行为名称
- register新增校验图形验证码逻辑
## 1.0.14(2022-01-26)
- 修复 uni-admin 的 'registerUser' 接口,注册用户含有多余字段 uid
## 1.0.13(2022-01-26)
- 新增逻辑:调用logout接口后刷新设备信息中token的有效期
## 1.0.12(2022-01-24)
- 优化设备信息存储逻辑
- 新增刷新设备信息token有效期的API `renewDeviceTokenExpired`
## 1.0.11(2022-01-19)
- 新增 getNeedCaptcha 接口
- 优化 调整 login 接口的代码结构
## 1.0.10(2022-01-08)
- 修复 限制只有 admin 用户可管理用户标签(不支持非 admin 用户操作managerMultiTag 接口)
## 1.0.9(2021-12-01)
- 新增 uni-admin 用户标签管理接口 managerTags
## 1.0.8(2021-11-29)
新增 `closeAccount`注销账号
## 1.0.7(2021-10-20)
新增bindMobileByMpWeixin,一键获取微信绑定的手机号
## 1.0.6(2021-09-23)
修复微信登录成功后没有添加日志的问题
## 1.0.5(2021-08-10)
- 修复登录成功后响应体包含userInfo.password的问题
- 新增微信登录成功后,自动获取用户的微信昵称和头像完善用户个人资料
## 1.0.4(2021-07-31)
- 修复 登录日志在登录失败时不写入记录的 bug
- 修复 写入记录登录是未传递 type 参数的 bug
## 1.0.3(2021-07-02)
- 框架设定非 admin 不能创建用户, 用户可自定义
## 1.0.2(2021-07-01)
- 发送短信验证码api,默认注释掉:虚拟发送短信验证码的代码块。
- 统一action名称为驼峰法
## 1.0.1(2021-06-28)
修复resetPwdBySmsCode接口,未注册过的用户也能调用的问题
## 1.0.0(2021-06-21)
## 1.0.15(2022-05-11)
- loginBySms、bindMobileBySms新增防刷机制(当短信验证码输入错误2次以上,弹出图形验证码进行人机校验)
- 更改loginLog为uniIdLog 记录各类uni-id操作,并新增action字段记录操作的行为名称
- register新增校验图形验证码逻辑
## 1.0.14(2022-01-26)
- 修复 uni-admin 的 'registerUser' 接口,注册用户含有多余字段 uid
## 1.0.13(2022-01-26)
- 新增逻辑:调用logout接口后刷新设备信息中token的有效期
## 1.0.12(2022-01-24)
- 优化设备信息存储逻辑
- 新增刷新设备信息token有效期的API `renewDeviceTokenExpired`
## 1.0.11(2022-01-19)
- 新增 getNeedCaptcha 接口
- 优化 调整 login 接口的代码结构
## 1.0.10(2022-01-08)
- 修复 限制只有 admin 用户可管理用户标签(不支持非 admin 用户操作managerMultiTag 接口)
## 1.0.9(2021-12-01)
- 新增 uni-admin 用户标签管理接口 managerTags
## 1.0.8(2021-11-29)
新增 `closeAccount`注销账号
## 1.0.7(2021-10-20)
新增bindMobileByMpWeixin,一键获取微信绑定的手机号
## 1.0.6(2021-09-23)
修复微信登录成功后没有添加日志的问题
## 1.0.5(2021-08-10)
- 修复登录成功后响应体包含userInfo.password的问题
- 新增微信登录成功后,自动获取用户的微信昵称和头像完善用户个人资料
## 1.0.4(2021-07-31)
- 修复 登录日志在登录失败时不写入记录的 bug
- 修复 写入记录登录是未传递 type 参数的 bug
## 1.0.3(2021-07-02)
- 框架设定非 admin 不能创建用户, 用户可自定义
## 1.0.2(2021-07-01)
- 发送短信验证码api,默认注释掉:虚拟发送短信验证码的代码块。
- 统一action名称为驼峰法
## 1.0.1(2021-06-28)
修复resetPwdBySmsCode接口,未注册过的用户也能调用的问题
## 1.0.0(2021-06-21)
1.0.0版发布
\ No newline at end of file
{
"name": "uni-id-cf-123",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"uni-captcha": "file:../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha",
"uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center",
"uni-id": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id"
}
}
{
"name": "uni-id-cf-123",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"uni-captcha": "file:../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha",
"uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center",
"uni-id": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id"
}
}
{
"name": "uni-id",
"version": "3.3.17",
"description": "uni-id for uniCloud",
"main": "index.js",
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id",
"repository": {
"type": "git",
"url": "git+https://gitee.com/dcloud/uni-id.git"
},
"author": "",
"license": "Apache-2.0",
"dependencies": {
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
{
"name": "uni-id",
"version": "3.3.17",
"description": "uni-id for uniCloud",
"main": "index.js",
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id",
"repository": {
"type": "git",
"url": "git+https://gitee.com/dcloud/uni-id.git"
},
"author": "",
"license": "Apache-2.0",
"dependencies": {
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
}
\ No newline at end of file
var nvMask,nvImageMenu;
export default {
show({list,cancelText},callback){
console.log(789789879);
if(!list){
list = [{
"img":"/static/sharemenu/wechatfriend.png",
"text":"图标文字"
}]
}
//以下为计算菜单的nview绘制布局,为固定算法,使用者无关关心
var screenWidth = plus.screen.resolutionWidth
//以360px宽度屏幕为例,上下左右边距及2排按钮边距留25像素,图标宽度55像素,同行图标间的间距在360宽的屏幕是30px,但需要动态计算,以此原则计算4列图标分别的left位置
//图标下的按钮文字距离图标5像素,文字大小12像素
//底部取消按钮高度固定为44px
//TODO 未处理横屏和pad,这些情况6个图标应该一排即可
var margin = 20,
iconWidth = 60,
icontextSpace = 5,
textHeight = 12
var left1 = margin / 360 * screenWidth
var iconSpace = (screenWidth - (left1 * 2) - (iconWidth * 4)) / 3 //屏幕宽度减去左右留白间距,再减去4个图标的宽度,就是3个同行图标的间距
if (iconSpace <= 5) { //屏幕过窄时,缩小边距和图标大小,再算一次
margin = 15
iconWidth = 40
left1 = margin / 360 * screenWidth
iconSpace = (screenWidth - (left1 * 2) - (iconWidth * 4)) / 3 //屏幕宽度减去左右留白间距,再减去4个图标的宽度,就是3个同行图标的间距
}
var left2 = left1 + iconWidth + iconSpace
var left3 = left1 + (iconWidth + iconSpace) * 2
var left4 = left1 + (iconWidth + iconSpace) * 3
var top1 = left1
var top2 = top1 + iconWidth + icontextSpace + textHeight + left1
const TOP = {top1,top2}, LEFT = {left1,left2,left3,left4};
nvMask = new plus.nativeObj.View("nvMask", { //先创建遮罩层
top: '0px',
left: '0px',
height: '100%',
width: '100%',
backgroundColor: 'rgba(0,0,0,0.2)'
});
nvMask.addEventListener("click", function() { //处理遮罩层点击
nvMask.hide();
nvImageMenu.hide();
})
nvImageMenu = new plus.nativeObj.View("nvImageMenu", { //创建底部图标菜单
bottom: '0px',
left: '0px',
height: (iconWidth + textHeight + 2 * margin)*Math.ceil(list.length/4) +44+'px',//'264px',
width: '100%',
backgroundColor: 'rgb(255,255,255)'
});
let myList = []
list.forEach((item,i)=>{
myList.push({
tag: 'img',
src: item.img,
position: {
top: TOP['top'+( parseInt(i/4) +1)],
left: LEFT['left'+(1+i%4)],
width: iconWidth,
height: iconWidth
}
})
myList.push({
tag: 'font',
text: item.text,
textStyles: {
size: textHeight
},
position: {
top: TOP['top'+(parseInt(i/4)+1)] + iconWidth + icontextSpace,
left: LEFT['left'+(1+i%4)],
width: iconWidth,
height: textHeight
}
})
})
//绘制底部图标菜单的内容
nvImageMenu.draw([
{
tag: 'rect',//菜单顶部的分割灰线
color: '#e7e7e7',
position: {
top: '0px',
height: '1px'
}
},
{
tag: 'font',
text: cancelText,//底部取消按钮的文字
textStyles: {
size: '14px'
},
position: {
bottom: '0px',
height: '44px'
}
},
{
tag: 'rect',//底部取消按钮的顶部边线
color: '#e7e7e7',
position: {
bottom: '45px',
height: '1px'
}
},
...myList
])
nvMask.show()
nvImageMenu.show() //5+应支持从底部向上弹出的动画
nvImageMenu.addEventListener("click",e=>{ //处理底部图标菜单的点击事件,根据点击位置触发不同的逻辑
// console.log("click menu"+JSON.stringify(e));
if (e.screenY > plus.screen.resolutionHeight - 44) { //点击了底部取消按钮
nvMask.hide();
nvImageMenu.hide();
} else if (e.clientX < 5 || e.clientX > screenWidth - 5 || e.clientY < 5) {
//屏幕左右边缘5像素及菜单顶部5像素不处理点击
} else { //点击了图标按钮
var iClickIndex = -1 //点击的图标按钮序号,第一个图标按钮的index为0
var iRow = e.clientY < (top2 - (left1 / 2)) ? 0 : 1
var iCol = -1
if (e.clientX < (left2 - (iconSpace / 2))) {
iCol = 0
} else if (e.clientX < (left3 - (iconSpace / 2))) {
iCol = 1
} else if (e.clientX < (left4 - (iconSpace / 2))) {
iCol = 2
} else {
iCol = 3
}
if (iRow == 0) {
iClickIndex = iCol
} else {
iClickIndex = iCol + 4
}
// console.log("点击按钮的序号: " + iClickIndex);
// if (iClickIndex >= 0 && iClickIndex <= 5) { //处理具体的点击逻辑,此处也可以自行定义逻辑。如果增减了按钮,此处也需要跟着修改
// }
callback(iClickIndex)
this.hide()
}
})
/* nvImageMenu.addEventListener("touchstart", function(e) {
if (e.screenY > (plus.screen.resolutionHeight - 44)) {
//TODO 这里可以处理按下背景变灰的效果
}
})
nvImageMenu.addEventListener("touchmove", function(e) {
//TODO 这里可以处理按下背景变灰的效果
if (e.screenY > plus.screen.resolutionHeight - 44) {}
})
nvImageMenu.addEventListener("touchend", function(e) {
//TODO 这里可以处理释放背景恢复的效果
})
*/
},
hide(){
nvMask.hide()
nvImageMenu.hide()
}
var nvMask,nvImageMenu;
export default {
show({list,cancelText},callback){
console.log(789789879);
if(!list){
list = [{
"img":"/static/sharemenu/wechatfriend.png",
"text":"图标文字"
}]
}
//以下为计算菜单的nview绘制布局,为固定算法,使用者无关关心
var screenWidth = plus.screen.resolutionWidth
//以360px宽度屏幕为例,上下左右边距及2排按钮边距留25像素,图标宽度55像素,同行图标间的间距在360宽的屏幕是30px,但需要动态计算,以此原则计算4列图标分别的left位置
//图标下的按钮文字距离图标5像素,文字大小12像素
//底部取消按钮高度固定为44px
//TODO 未处理横屏和pad,这些情况6个图标应该一排即可
var margin = 20,
iconWidth = 60,
icontextSpace = 5,
textHeight = 12
var left1 = margin / 360 * screenWidth
var iconSpace = (screenWidth - (left1 * 2) - (iconWidth * 4)) / 3 //屏幕宽度减去左右留白间距,再减去4个图标的宽度,就是3个同行图标的间距
if (iconSpace <= 5) { //屏幕过窄时,缩小边距和图标大小,再算一次
margin = 15
iconWidth = 40
left1 = margin / 360 * screenWidth
iconSpace = (screenWidth - (left1 * 2) - (iconWidth * 4)) / 3 //屏幕宽度减去左右留白间距,再减去4个图标的宽度,就是3个同行图标的间距
}
var left2 = left1 + iconWidth + iconSpace
var left3 = left1 + (iconWidth + iconSpace) * 2
var left4 = left1 + (iconWidth + iconSpace) * 3
var top1 = left1
var top2 = top1 + iconWidth + icontextSpace + textHeight + left1
const TOP = {top1,top2}, LEFT = {left1,left2,left3,left4};
nvMask = new plus.nativeObj.View("nvMask", { //先创建遮罩层
top: '0px',
left: '0px',
height: '100%',
width: '100%',
backgroundColor: 'rgba(0,0,0,0.2)'
});
nvMask.addEventListener("click", function() { //处理遮罩层点击
nvMask.hide();
nvImageMenu.hide();
})
nvImageMenu = new plus.nativeObj.View("nvImageMenu", { //创建底部图标菜单
bottom: '0px',
left: '0px',
height: (iconWidth + textHeight + 2 * margin)*Math.ceil(list.length/4) +44+'px',//'264px',
width: '100%',
backgroundColor: 'rgb(255,255,255)'
});
let myList = []
list.forEach((item,i)=>{
myList.push({
tag: 'img',
src: item.img,
position: {
top: TOP['top'+( parseInt(i/4) +1)],
left: LEFT['left'+(1+i%4)],
width: iconWidth,
height: iconWidth
}
})
myList.push({
tag: 'font',
text: item.text,
textStyles: {
size: textHeight
},
position: {
top: TOP['top'+(parseInt(i/4)+1)] + iconWidth + icontextSpace,
left: LEFT['left'+(1+i%4)],
width: iconWidth,
height: textHeight
}
})
})
//绘制底部图标菜单的内容
nvImageMenu.draw([
{
tag: 'rect',//菜单顶部的分割灰线
color: '#e7e7e7',
position: {
top: '0px',
height: '1px'
}
},
{
tag: 'font',
text: cancelText,//底部取消按钮的文字
textStyles: {
size: '14px'
},
position: {
bottom: '0px',
height: '44px'
}
},
{
tag: 'rect',//底部取消按钮的顶部边线
color: '#e7e7e7',
position: {
bottom: '45px',
height: '1px'
}
},
...myList
])
nvMask.show()
nvImageMenu.show() //5+应支持从底部向上弹出的动画
nvImageMenu.addEventListener("click",e=>{ //处理底部图标菜单的点击事件,根据点击位置触发不同的逻辑
// console.log("click menu"+JSON.stringify(e));
if (e.screenY > plus.screen.resolutionHeight - 44) { //点击了底部取消按钮
nvMask.hide();
nvImageMenu.hide();
} else if (e.clientX < 5 || e.clientX > screenWidth - 5 || e.clientY < 5) {
//屏幕左右边缘5像素及菜单顶部5像素不处理点击
} else { //点击了图标按钮
var iClickIndex = -1 //点击的图标按钮序号,第一个图标按钮的index为0
var iRow = e.clientY < (top2 - (left1 / 2)) ? 0 : 1
var iCol = -1
if (e.clientX < (left2 - (iconSpace / 2))) {
iCol = 0
} else if (e.clientX < (left3 - (iconSpace / 2))) {
iCol = 1
} else if (e.clientX < (left4 - (iconSpace / 2))) {
iCol = 2
} else {
iCol = 3
}
if (iRow == 0) {
iClickIndex = iCol
} else {
iClickIndex = iCol + 4
}
// console.log("点击按钮的序号: " + iClickIndex);
// if (iClickIndex >= 0 && iClickIndex <= 5) { //处理具体的点击逻辑,此处也可以自行定义逻辑。如果增减了按钮,此处也需要跟着修改
// }
callback(iClickIndex)
this.hide()
}
})
/* nvImageMenu.addEventListener("touchstart", function(e) {
if (e.screenY > (plus.screen.resolutionHeight - 44)) {
//TODO 这里可以处理按下背景变灰的效果
}
})
nvImageMenu.addEventListener("touchmove", function(e) {
//TODO 这里可以处理按下背景变灰的效果
if (e.screenY > plus.screen.resolutionHeight - 44) {}
})
nvImageMenu.addEventListener("touchend", function(e) {
//TODO 这里可以处理释放背景恢复的效果
})
*/
},
hide(){
nvMask.hide()
nvImageMenu.hide()
}
}
\ No newline at end of file
{
"id": "uni-image-menu",
"displayName": "uni-image-menu",
"version": "1.0.0",
"description": "uni-image-menu",
"keywords": [
"uni-image-menu"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"JS SDK",
"JS SDK"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
{
"id": "uni-image-menu",
"displayName": "uni-image-menu",
"version": "1.0.0",
"description": "uni-image-menu",
"keywords": [
"uni-image-menu"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"JS SDK",
"JS SDK"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}
\ No newline at end of file
# uni-image-menu
使用示例:
```
import uniImageMenu from 'uni_modules/uni-image-menu/js_sdk/uni-image-menu.js';
uniImageMenu.show({
list:[{
"img": "/static/sharemenu/wechatfriend.png",
"text": "微信好友"
},
{
"img": "/static/sharemenu/wechatmoments.png",
"text": "微信朋友圈"
}],
cancelText:param.cancelText
}, e => {
console.log(e)
})
# uni-image-menu
使用示例:
```
import uniImageMenu from 'uni_modules/uni-image-menu/js_sdk/uni-image-menu.js';
uniImageMenu.show({
list:[{
"img": "/static/sharemenu/wechatfriend.png",
"text": "微信好友"
},
{
"img": "/static/sharemenu/wechatmoments.png",
"text": "微信朋友圈"
}],
cancelText:param.cancelText
}, e => {
console.log(e)
})
```
\ No newline at end of file
## 1.3.5(2022-05-24)
- 新增 stat 属性 ,可开启统计title 上报 ,仅使用了title 属性且项目开启了uni统计生效
## 1.3.4(2022-01-24)
- 更新 组件示例
## 1.3.3(2022-01-24)
......
{
"id": "uni-nav-bar",
"displayName": "uni-nav-bar 自定义导航栏",
"version": "1.3.5",
"version": "1.3.4",
"description": "自定义导航栏组件,主要用于头部导航。",
"keywords": [
"uni-ui",
......
## 1.7.9(2022-04-02)
- 修复 弹出层内部无法滚动的bug
## 1.7.8(2022-03-28)
- 修复 小程序中高度错误的bug
## 1.7.7(2022-03-17)
- 修复 快速调用open出现问题的Bug
## 1.7.6(2022-02-14)
- 修复 safeArea 属性不能设置为false的bug
## 1.7.5(2022-01-19)
......
{
"id": "uni-popup",
"displayName": "uni-popup 弹出层",
"version": "1.7.9",
"version": "1.7.6",
"description": " Popup 组件,提供常用的弹层",
"keywords": [
"uni-ui",
......
此差异已折叠。
......@@ -6,7 +6,7 @@
> 代码块: `uSearchBar`
搜索栏组件
评分组件
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-search-bar)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
......
## 1.0.5(2021-12-09)
修复插件没自动安装依赖的`uni-popup``uni-icons`组件的问题
## 1.0.4(2021-11-29)
修复在某些情况下,签到不连续7天,也获得60积分的问题
## 1.0.3(2021-11-20)
新增支持看激励视频广告签到
## 1.0.2(2021-08-25)
修复时区问题
## 1.0.1(2021-08-23)
调整签到逻辑,支持查出积分的收入支出历史记录
## 1.0.0(2021-08-05)
1.0.0版本发布
## 1.0.5(2021-12-09)
修复插件没自动安装依赖的`uni-popup``uni-icons`组件的问题
## 1.0.4(2021-11-29)
修复在某些情况下,签到不连续7天,也获得60积分的问题
## 1.0.3(2021-11-20)
新增支持看激励视频广告签到
## 1.0.2(2021-08-25)
修复时区问题
## 1.0.1(2021-08-23)
调整签到逻辑,支持查出积分的收入支出历史记录
## 1.0.0(2021-08-05)
1.0.0版本发布
此差异已折叠。
此差异已折叠。
{
"id": "uni-ui",
"displayName": "uni-ui",
"version": "1.4.16",
"description": "uni-ui 是基于uni-app的、全端兼容的、高性能UI框架",
"version": "1.4.11",
"description": "uni-ui 是一个基于uni-app全端兼容的高性能UI框架",
"keywords": [
"uni-ui",
"uniui",
......
此差异已折叠。
// "文件路径" : {"键名":"改成什么"}
{
"/manifest.json": {
"appid": "请点击重新获取" ,//清空appid
"appid": "请点击重新获取",
"mp-weixin" : {
"appid" : ""
},
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册