提交 8ad12b25 编写于 作者: DCloud_JSON's avatar DCloud_JSON

升级用户头像上传的裁切功能,app端为原生裁剪其他端保持原来方式。数据表字段改用avatar_file存储file对象方便做图片的回显。

上级 6afa1052
......@@ -5,7 +5,10 @@
在这个模板基础之上快速填充自己的业务,即可很快完成一个应用。
地址:[https://codechina.csdn.net/dcloud/uni-starter.git](https://codechina.csdn.net/dcloud/uni-starter.git)
##### 演示效果
![](https://vkceyugu.cdn.bspapp.com/VKCEYUGU-f184e7c3-1912-41b2-b81f-435d1b37c7b4/0625ae17-1262-45cb-a713-cdbf02df5c0a.png)
> h5版演示链接:[https://uni-starter.dcloud.net.cn](https://uni-starter.dcloud.net.cn)
#### 视频教程:
<a target="_blank" href="https://www.bilibili.com/video/BV17p4y1a71x?p=11">
<img src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-f184e7c3-1912-41b2-b81f-435d1b37c7b4/71d310a5-ef69-4ca5-88c8-9a3abf8fb8e3.png" alt="腾讯课堂uniCloud视频教程" style="width: 70%;">
......@@ -33,16 +36,18 @@ uni-starter + uniCloud admin,提供了用户端和管理端的基础模板,
<img src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e/e03ad65d-11bb-4697-81b2-d13af42f0441.jpg" />
### uni-starter集成的功能包括:
1. 个人中心:登录注册(含用户名密码登录、手机号验证码登录、app一键登录、微信登录、Apple登录、微信小程序登录)、修改密码、忘记密码、头像更换、昵称修改、积分查看、指纹绑定、退出登录
2. 设置:App更新(整包升级、wgt升级、强制升级,后台搭配uniCloud admin的升级中心插件管理)、权限引导(app)、推送开关(app)、清除缓存(app)、用户协议、隐私协议(app)、问题与反馈、分享推荐、关于
3. 启动引导:iOS初次启动被用户禁止网络权限后引导开启、Android弹出隐私协议后再申请权限
4. 首页集成banner(后台搭配uniCloud admin的banner插件管理)、搜索、列表、详情、分享,均为云端一体。实际使用中将clientDB的表名更改为自己业务表名即可
5. 首页采用nvue,fast编译模式,加快App端启动速度
6. 内置联网失败的重试页面(不是错误弹框,页面有重试按钮)、更漂亮的分享菜单页面
7. 内置拦截器:
1. 个人中心:登录注册(含用户名密码登录、手机号验证码登录、app一键登录、微信登录、Apple登录、微信小程序登录)、修改密码、忘记密码、头像更换(集成图片裁剪)、昵称修改、积分查看、指纹绑定、退出登录
2. 设置:App更新(整包升级、wgt升级、强制升级,后台搭配uniCloud admin的升级中心插件管理)、权限引导(app)、推送开关(app)、指纹解锁(app)、人脸解锁(app)、清除缓存(app)、用户协议、隐私协议、问题与反馈、分享推荐、关于
3. 启动引导:iOS初次启动被用户禁止网络权限后引导开启、Android弹出隐私协议后再申请权限
4. 权限引导:应用无访问摄像头/相册权限,引导跳到设置界面
5. 首页集成banner(后台搭配uniCloud admin的banner插件管理)、搜索、列表、详情、分享,均为云端一体。实际使用中将clientDB的表名更改为自己业务表名即可
6. 首页采用nvue,fast编译模式,加快App端启动速度
7. 内置联网失败的重试页面(不是错误弹框,页面有重试按钮)、更漂亮的分享菜单页面
8. 内置拦截器:
- 页面路由拦截,配置需强制登录的页面;打开时检测,如果token无效就自动跳转到登录页
- 优雅实现:自动引导打开`选择图片`所需要的权限。当调用`uni.chooseImage`时检测到无权限自动开启引导。并不是在每次调用接口时处理这类问题,你可以参考该例子做更多该类场景的处理。uni-starter也会持续完善
8. h5版在页面顶部引导用户`点击下载App`
9. h5版在页面顶部引导用户`点击下载App`
10. 营销裂变:点击“分销推荐”,生成带用户inviteCode参数的应用下载页(H5)。被邀请人打开下载页面点击下载,设备剪贴板的内容会被设置为邀请者的inviteCode。被邀请人下载app之后通过任何方式登陆(含:注册并登陆),uni-starter框架会自动获取设备剪切板中的inviteCode提交到服务端绑定关联关系。
### 功能模块介绍
#### 1. 拦截器与路由守卫
......
......@@ -35,6 +35,8 @@
"OAuth": {
},
"FaceID": {
},
"Push": {
}
},
"distribute": {
......@@ -74,6 +76,8 @@
"appid": "wxffdd8fa6ec4ef2a0",
"appsecret": "",
"UniversalLinks": ""
},
"univerify": {
}
},
"ad": {
......
<template>
<view class="pages">
<view class="pages">
<!-- #ifndef H5 -->
<statusBar></statusBar>
<!-- #endif -->
......@@ -12,7 +12,7 @@
<!-- 基于 uni-list 的页面布局 -->
<uni-list class="uni-list" :border="false" :bounce="true" :alwaysScrollableVertical="true"
:style="{height:listHight}">
<uni-list-item :to="'./detail?id='+item._id+'&title='+item.title" v-for="(item,index) in data"
<uni-list-item :to="'/pages/list/detail?id='+item._id+'&title='+item.title" v-for="(item,index) in data"
:key="index">
<!-- 通过header插槽定义列表左侧图片 -->
<template v-slot:header>
......
......@@ -73,10 +73,11 @@
// title: JSON.stringify(e),
// icon: 'none'
// });
uni.hideToast()
/* 以下临时解决setClipboardData h5端样式和键盘弹出端错误解决方案,后续会直接内置*/
document.getElementById("#clipboard").style.top = '-999px';
uni.hideKeyboard()
}
})
}
......
//这是应用的配置页面,App.vue挂载到getApp().globalData.config
module.exports = {
"h5": {
"url": "https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com", // 前端网页托管的域名
"url": "https://uni-starter.dcloud.net.cn/", // 前端网页托管的域名
// 在h5端全局悬浮引导用户下载app的功能 更多自定义要求在/common/openApp.js中修改
"openApp": {
//点击悬浮下载栏后打开的网页链接
"openUrl": 'https://sj.qq.com/myapp/detail.htm?apkName=com.tencent.android.qqdownloader&info=6646FD239A6EBA9E2DEE5DFC7E18D867',
"openUrl": '/#/pages/ucenter/invite/invite',
//左侧显示的应用名称
"appname": 'uni-starter',
//应用的图标
......
{
"bsonType": "object",
"required": ["name"],
"permission": {
"read": true,
"create": false,
"update": false,
"delete": false
},
"properties": {
"_id": {
"description": "ID,系统自动生成"
},
"parent_id": {
"bsonType": "string",
"description": "父级部门ID",
"parentKey": "_id"
},
"name": {
"bsonType": "string",
"description": "部门名称",
"title": "部门名称",
"trim": "both"
},
"level": {
"bsonType": "int",
"description": "部门层级,为提升检索效率而作的冗余设计"
},
"sort": {
"bsonType": "int",
"description": "部门在当前层级下的顺序,由小到大",
"title": "显示顺序"
},
"manager_uid": {
"bsonType": "string",
"description": "部门主管的userid, 参考`uni-id-users` 表",
"foreignKey": "uni-id-users._id"
},
"create_date": {
"bsonType": "timestamp",
"description": "部门创建时间",
"forceDefaultValue": {
"$env": "now"
}
}
}
}
......@@ -25,7 +25,7 @@
</view>
<view class="text-item confirm">
<button class="btn-privacy" type="primary" @click="agree">同意</button>
<button class="btn-privacy btn-disagree" v-if="isAndroid" @click="disagree">暂不使用</button>
<button class="btn-privacy btn-disagree" @click="disagree">暂不使用</button>
</view>
<view class="exit-area">
......@@ -38,11 +38,9 @@ import {about} from '@/uni-starter.config.js';
export default {
data() {
return {
isAndroid: false
}
},
onLoad() {
this.isAndroid = (uni.getSystemInfoSync().platform === 'android');
this._canBack = false;
},
onBackPress() {
......
export default function(){
if (uni.getSystemInfoSync().platform == "android") {
let userprotocol = uni.getStorageSync('userprotocol') || false;
if(!userprotocol){
uni.navigateTo({
url:'uni_modules/uni-agree/pages/uni-agree/uni-agree',
animationType:"none"
})
}
console.log(uni.getSystemInfoSync().platform)
let userprotocol = uni.getStorageSync('userprotocol');
console.log('userprotocol',userprotocol);
if(!userprotocol){
uni.navigateTo({
url:'uni_modules/uni-agree/pages/uni-agree/uni-agree',
animationType:"none"
})
}
}
\ No newline at end of file
// "文件路径" : {"键名":"改成什么"}
{
"/manifest.json": {
"appid": "请点击重新获取" //清空appid
"appid": "请点击重新获取" ,//清空appid
"mp-weixin" : {
"appid" : ""
}
},
"/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json": {
"tokenExpiresIn": 7200,
......
{
"name": "uni-starter",
"appid": "__UNI__E5373F7",
"description": "云端一体应用快速开发模版",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
"app-plus": {
"privacy": {
"prompt": "template",
"template": {
"title": "服务协议和隐私政策",
"message": "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://ask.dcloud.net.cn/protocol.html\">《服务协议》</a>和<a href=\"https://ask.dcloud.net.cn/protocol.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept": "同意",
"buttonRefuse": "暂不同意"
}
},
"compatible": {
"ignoreVersion": true
},
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
"modules": {
"Fingerprint": {
},
"Share": {
},
"OAuth": {
},
"FaceID": {
}
},
"distribute": {
"android": {
"permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.USE_FINGERPRINT\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters": [
"armeabi-v7a",
"arm64-v8a",
"x86"
]
},
"ios": {
},
"sdkConfigs": {
"oauth": {
"apple": {
},
"weixin": {
"appid": "wxffdd8fa6ec4ef2a0",
"appsecret": "",
"UniversalLinks": ""
}
"name" : "uni-starter",
"appid" : "__UNI__7D0D57D",
"description" : "云端一体应用快速开发模版",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
"privacy" : {
"prompt" : "template",
"template" : {
"title" : "服务协议和隐私政策",
"message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://ask.dcloud.net.cn/protocol.html\">《服务协议》</a>和<a href=\"https://ask.dcloud.net.cn/protocol.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept" : "同意",
"buttonRefuse" : "暂不同意"
}
},
"ad": {
"compatible" : {
"ignoreVersion" : true
},
"share": {
"weixin": {
"appid": "wxffdd8fa6ec4ef2a0",
"UniversalLinks": ""
}
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"geolocation": {
"modules" : {
"Fingerprint" : {},
"Share" : {},
"OAuth" : {},
"FaceID" : {},
"Push" : {}
},
"push": {
"unipush": {
}
"distribute" : {
"android" : {
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.USE_FINGERPRINT\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
"ios" : {},
"sdkConfigs" : {
"oauth" : {
"apple" : {},
"weixin" : {
"appid" : "wxffdd8fa6ec4ef2a0",
"appsecret" : "",
"UniversalLinks" : ""
},
"univerify" : {}
},
"ad" : {},
"share" : {
"weixin" : {
"appid" : "wxffdd8fa6ec4ef2a0",
"UniversalLinks" : ""
}
},
"geolocation" : {},
"push" : {
"unipush" : {}
},
"payment" : {}
}
},
"payment": {
}
}
"nvueLaunchMode" : ""
},
"quickapp" : {},
"mp-weixin" : {
"appid" : "wx81dbb061d2258234",
"setting" : {
"urlCheck" : false,
"es6" : false
},
"usingComponents" : true,
"betterScopedSlots" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"nvueLaunchMode": ""
},
"quickapp": {
},
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false,
"es6": false
"uniStatistics" : {
"enable" : false
},
"usingComponents": true,
"betterScopedSlots": true
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"h5": {
"template": ""
}
}
\ No newline at end of file
"h5" : {
"template" : ""
}
}
......@@ -24,7 +24,7 @@
"oauth": {
"weixin": {
"appid": "wx81dbb061d2258234",
"appsecret": "73be6e8b8b31b7b0783fe448cc1fe820"
"appsecret": "04478a5719d0ae70c7e3023bc8078410"
}
}
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册