提交 78a1788c 编写于 作者: DCloud_JSON's avatar DCloud_JSON

1. 支持vue3.0 2. 去掉App.vue全局样式,避免与非flex布局的页面样式冲突

上级 ae8b3826
## 1.0.41(2021-07-27)
1. 支持vue3.0
2. 去掉App.vue全局样式,避免与非flex布局的页面样式冲突
## 1.0.40(2021-07-22)
1. 调整使用正则表达式配置强制登陆功能的写法,解决在小程序端的兼容问题。
2. 新增签到功能(培养用户习惯,提升用户粘性)。支持:每日签到奖励、周期性连续7日签到,奖励翻倍。
......
view,
scroll-view,
text,
image,
switch,
navigator,
icons {
display: flex !important;
box-sizing: border-box;
flex-direction: column;
}
scroll-view {
-webkit-overflow-scrolling: touch;
}
......@@ -303,7 +303,6 @@ export default async function() {
list.forEach(item => { //用遍历的方式分别为,uni.navigateTo,uni.redirectTo,uni.reLaunch,uni.switchTab这4个路由方法添加拦截器
uni.addInterceptor(item, {
invoke(e) { // 调用前拦截
// console.log(e);
//获取用户的token
const token = uni.getStorageSync('uni_id_token'),
//token是否已失效
......
......@@ -45,7 +45,13 @@
</script>
<style lang="scss" scoped>
@import '@/common/all-flex.css';
/* #ifndef APP-NVUE */
view{
display: flex;
box-sizing: border-box;
flex-direction: column;
}
/* #endif */
.root{
flex-direction: row;
align-items: center;
......
......@@ -343,7 +343,13 @@
</script>
<style lang="scss" scoped>
@import '@/common/all-flex.css';
/* #ifndef APP-NVUE */
view{
display: flex;
box-sizing: border-box;
flex-direction: column;
}
/* #endif */
.quick-login-box {
flex-direction: row;
width: 750rpx;
......
......@@ -118,7 +118,13 @@
</script>
<style lang="scss" scoped>
@import '@/common/all-flex.css';
/* #ifndef APP-NVUE */
view{
display: flex;
box-sizing: border-box;
flex-direction: column;
}
/* #endif */
.short-code-btn {
width: 200rpx;
height: 85rpx;
......
{
"name" : "uni-starter",
"appid" : "__UNI__03B096E",
"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" : "暂不同意"
"name": "uni-starter",
"appid": "请点击重新获取",
"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" : {},
"Push" : {}
},
"distribute" : {
"android" : {
"permissions" : [
"compatible": {
"ignoreVersion": true
},
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
"modules": {
"Fingerprint": {
},
"Share": {
},
"OAuth": {
},
"FaceID": {
},
"Push": {
}
},
"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\"/>",
......@@ -55,66 +60,79 @@
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
"ios" : {
"capabilities" : {
"entitlements" : {
"com.apple.developer.associated-domains" : [ "applinks:static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com" ]
"abiFilters": [
"armeabi-v7a",
"arm64-v8a",
"x86"
]
},
"ios": {
"capabilities": {
"entitlements": {
"com.apple.developer.associated-domains": [
"applinks:static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com"
]
}
}
},
"sdkConfigs" : {
"oauth" : {
"apple" : {},
"weixin" : {
"appid" : "wxffdd8fa6ec4ef2a0",
"appsecret" : "",
"UniversalLinks" : "https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com/uni-universallinks/__UNI__03B096E"
},
"univerify" : {}
},
"ad" : {},
"share" : {
"weixin" : {
"appid" : "wxffdd8fa6ec4ef2a0",
"UniversalLinks" : "https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com/uni-universallinks/__UNI__03B096E"
"sdkConfigs": {
"oauth": {
"apple": {
},
"weixin": {
"appid": "wxffdd8fa6ec4ef2a0",
"appsecret": "",
"UniversalLinks": "https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com/uni-universallinks/__UNI__03B096E"
},
"univerify": {
}
},
"ad": {
},
"share": {
"weixin": {
"appid": "wxffdd8fa6ec4ef2a0",
"UniversalLinks": "https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com/uni-universallinks/__UNI__03B096E"
}
},
"geolocation" : {},
"push" : {
"unipush" : {}
"geolocation": {
},
"payment" : {}
"push": {
"unipush": {
}
},
"nvueLaunchMode" : ""
"payment": {
}
}
},
"nvueLaunchMode": ""
},
"quickapp": {
},
"quickapp" : {},
"mp-weixin" : {
"appid" : "wx81dbb061d2258234",
"setting" : {
"urlCheck" : false,
"es6" : false
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false,
"es6": false
},
"usingComponents" : true,
"betterScopedSlots" : true
"usingComponents": true,
"betterScopedSlots": true
},
"mp-alipay" : {
"usingComponents" : true
"mp-alipay": {
"usingComponents": true
},
"mp-baidu" : {
"usingComponents" : true
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao" : {
"usingComponents" : true
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics" : {
"enable" : false
"uniStatistics": {
"enable": false
},
"h5" : {
"template" : ""
"h5": {
"template": ""
},
"_spaceID" : "76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e",
"vueVersion" : "2"
"_spaceID": "",
"vueVersion": "2"
}
\ No newline at end of file
{
"id": "uni-starter",
"displayName": "uni-starter",
"version": "1.0.40",
"version": "1.0.41",
"description": "云端一体应用快速开发基本项目模版",
"keywords": [
"login",
......
......@@ -184,6 +184,9 @@
/* #ifndef APP-PLUS */
z-index: 9;
/* #endif */
/* #ifdef MP-WEIXIN */
width: 580rpx;
/* #endif */
}
.show-refresh-tip {
......
......@@ -19,42 +19,47 @@
</view>
</template>
<script>
import uniShare from '@/uni_modules/uni-share/js_sdk/uni-share.js';
import uniShare from '@/uni_modules/uni-share/js_sdk/uni-share.js';
export default {
onLoad() {
// #ifdef APP-PLUS
this.version = plus.runtime.version
// #endif
},
computed:{
uniStarterConfig(){
computed: {
uniStarterConfig() {
console.log(getApp());
return getApp().globalData.config
}
},
data() {
return {
version:"V1.0.0",
year:"2020",
about:{}
version: "V1.0.0",
year: "2020",
about: {}
};
},
created() {
this.about = this.uniStarterConfig.about
uni.setNavigationBarTitle({
title:'关于'+this.about.appName
title: '关于' + this.about.appName
})
this.year = (new Date).getFullYear()
},
onNavigationBarButtonTap() {
let {download,appName,slogan,logo} = this.about
let {
download,
appName,
slogan,
logo
} = this.about
uniShare({
content: { //公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
type: 0,
href: download,
title: appName,
summary: slogan,
imageUrl: logo+'?x-oss-process=image/resize,m_fill,h_100,w_100' //压缩图片解决,在ios端分享图过大导致的图片失效问题
imageUrl: logo + '?x-oss-process=image/resize,m_fill,h_100,w_100' //压缩图片解决,在ios端分享图过大导致的图片失效问题
},
menus: [{
"img": "/static/app-plus/sharemenu/wechatfriend.png",
......@@ -102,10 +107,13 @@ import uniShare from '@/uni_modules/uni-share/js_sdk/uni-share.js';
console.log(e);
})
},
methods:{
navigateTo({url,title}){
methods: {
navigateTo({
url,
title
}) {
uni.navigateTo({
url: '/pages/common/webview/webview?url='+url+'&title='+title,
url: '/pages/common/webview/webview?url=' + url + '&title=' + title,
success: res => {},
fail: () => {},
complete: () => {}
......@@ -115,55 +123,71 @@ import uniShare from '@/uni_modules/uni-share/js_sdk/uni-share.js';
}
</script>
<style lang="scss" scoped>
@import '@/common/all-flex.css';
.about {
/* #ifndef APP-NVUE */
view {
display: flex;
box-sizing: border-box;
flex-direction: column;
}
/* #endif */
.about {
width: 750upx;
flex-direction: column;
}
.box {
}
.box {
margin-top: 100px;
flex-direction: column;
justify-content: center;
align-items: center;
}
.logoImg{
}
.logoImg {
margin-bottom: 10upx;
width:160upx;
height:160upx;
width: 160upx;
height: 160upx;
border-radius: 15px;
}
.tip{
font-size:24rpx;
}
.tip {
font-size: 24rpx;
margin-top: 10px;
}
.appName{
}
.appName {
margin-top: 20px;
font-size:42rpx;
font-size: 42rpx;
font-weight: 500;
}
.qrcode{
}
.qrcode {
margin-top: 50px;
}
.copyright {
}
.copyright {
width: 750upx;
font-size:32rpx;
font-size: 32rpx;
flex-direction: column;
justify-content: center;
align-items: center;
bottom:20px;
bottom: 20px;
left: 0;
position: fixed;
}
.agreement-box{
}
.agreement-box {
justify-content: center;
}
.agreement {
color:#2285ff;
font-size:26rpx;
}
.hint {
}
.agreement {
color: #2285ff;
font-size: 26rpx;
}
.hint {
text-align: center;
color:#999999;
font-size:26rpx;
}
color: #999999;
font-size: 26rpx;
}
</style>
@import '@/common/all-flex.css';
/* #ifndef APP-NVUE */
view {
display: flex;
box-sizing: border-box;
flex-direction: column;
}
.content {
/* #endif */
.content {
padding: 0 50rpx;
width: 750rpx;
flex: 1;
}
}
.input-box {
.input-box {
padding: 0 15px;
margin-bottom: 10px;
background-color: #F8F8F8;
border-radius: 6px;
font-size: 28rpx;
}
}
.get-code {
.get-code {
margin: 0;
margin-top: 15px;
background-color: #007aff;
color: #FFFFFF;
}
}
.input-box,
.get-code {
.input-box,
.get-code {
height: 45px;
line-height: 45px;
}
}
.title {
.title {
text-align: center;
padding-bottom: 5px;
}
}
.tip {
.tip {
color: #666666;
font-size: 26rpx;
margin: 6px 0;
}
}
.easyinput {
.easyinput {
background-color: #F8F8F8;
border-radius: 6rpx;
}
}
.send-btn {
.send-btn {
width: 100%;
margin-top: 15px;
border-radius: 6rpx;
}
}
.link {
.link {
color: #04498c;
}
}
......@@ -109,7 +109,13 @@
</script>
<style lang="scss" scoped>
@import '@/common/all-flex.css';
/* #ifndef APP-NVUE */
view{
display: flex;
box-sizing: border-box;
flex-direction: column;
}
/* #endif */
@import url("../common/login-page.css");
.quickLogin {
width: 650rpx;
......
......@@ -3,10 +3,11 @@
<!-- 顶部文字 -->
<text class="tit">请输入验证码</text>
<text class="tip">{{tipText}}</text>
<uni-forms>
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-easyinput type="number" class="easyinput" :inputBorder="false"
v-model="code" maxlength="6" placeholder="请输入验证码">
<template slot="right">
<template v-slot:right>
<uni-send-sms-code :phone="phone" ref="sendSmsCode"></uni-send-sms-code>
</template>
</uni-easyinput>
......
......@@ -240,7 +240,6 @@
border: none;
border-radius: 0;
}
/* #endif */
.content {
/* #ifndef APP-NVUE */
......
......@@ -60,8 +60,7 @@
}
],
ucenterList: [
[
{
[{
"title": '签到有奖',
"event": 'signIn',
"icon": "compose"
......@@ -85,7 +84,7 @@
"icon": "paperplane"
}
// #ifdef APP-PLUS
,{
, {
"title": '分销推荐',
"event": 'share',
"icon": "redo"
......@@ -155,7 +154,7 @@
url: "/pages/ucenter/settings/settings"
})
},
signIn(){ //签到
signIn() { //签到
this.$refs.signIn.open()
},
/**
......@@ -233,7 +232,9 @@
})
},
async share() {
let {result} = await uniCloud.callFunction({
let {
result
} = await uniCloud.callFunction({
name: 'uni-id-cf',
data: {
action: 'getUserInviteCode'
......@@ -256,7 +257,8 @@
`/#/pages/ucenter/invite/invite?code=uniInvitationCode:${myInviteCode}`,
title: appName,
summary: slogan,
imageUrl: logo + '?x-oss-process=image/resize,m_fill,h_100,w_100' //压缩图片解决,在ios端分享图过大导致的图片失效问题
imageUrl: logo +
'?x-oss-process=image/resize,m_fill,h_100,w_100' //压缩图片解决,在ios端分享图过大导致的图片失效问题
},
menus: [{
"img": "/static/app-plus/sharemenu/wechatfriend.png",
......@@ -310,8 +312,13 @@
</script>
<style lang="scss" scoped>
@import '@/common/all-flex.css';
/* #ifndef APP-PLUS-NVUE */
/* #ifndef APP-NVUE */
view {
display: flex;
box-sizing: border-box;
flex-direction: column;
}
page {
background-color: #f8f8f8;
}
......
......@@ -266,7 +266,13 @@
}
</script>
<style lang="scss" scoped>
@import '@/common/all-flex.css';
/* #ifndef APP-NVUE */
view {
display: flex;
box-sizing: border-box;
flex-direction: column;
}
/* #endif */
.item {
width: 750rpx;
flex-direction: row;
......
{
"passwordSecret": "passwordSecret-demo",
"tokenSecret": "tokenSecret-demo",
"tokenExpiresIn": 7200,
"tokenExpiresThreshold": 600,
"passwordErrorLimit": 6,
"bindTokenToDevice": false,
"passwordErrorRetryTime": 3600,
"autoSetInviteCode": false,
"forceInviteCode": false,
"app-plus": {
"tokenExpiresIn": 2592000,
"oauth": {
"weixin": {
"appid": "填写来源微信开放平台https://open.weixin.qq.com/创建的应用的appid",
"appsecret": "填写来源微信开放平台https://open.weixin.qq.com/创建的应用的appsecret"
},
"apple": {
"bundleId": "苹果开发者后台获取的bundleId"
}
}
},
"mp-weixin": {
"oauth": {
"weixin": {
"appid": "微信小程序登录所用的appid、appsecret需要在对应的小程序管理控制台获取",
"appsecret": "微信小程序后台获取的appsecret"
}
}
},
"mp-alipay": {
"oauth": {
"alipay": {
"appid": "支付宝小程序登录用到的appid、privateKey请参考支付宝小程序的文档进行设置或者获取,https://opendocs.alipay.com/open/291/105971#LDsXr",
"privateKey": "支付宝小程序登录用到的appid、privateKey请参考支付宝小程序的文档进行设置或者获取,https://opendocs.alipay.com/open/291/105971#LDsXr"
}
}
},
"service": {
"sms": {
"name": "应用名称,对应短信模版的name",
"codeExpiresIn": 300,
"smsKey": "短信密钥key,开通短信服务处可以看到",
"smsSecret": "短信密钥secret,开通短信服务处可以看到"
},
"univerify": {
"appid": "当前应用的appid,使用云函数URL化,此项必须配置",
"apiKey": "apiKey 和 apiSecret 在开发者中心获取,开发者中心:https://dev.dcloud.net.cn/uniLogin/index?type=0,文档:https://ask.dcloud.net.cn/article/37965",
"apiSecret": ""
}
}
}
\ No newline at end of file
......@@ -92,18 +92,24 @@ export default {
uploadFile
},
props: {
value: {
// #ifdef VUE3
modelValue: {
type: [Array, Object],
default() {
return []
}
},
modelValue: {
// #endif
// #ifndef VUE3
value: {
type: [Array, Object],
default() {
return []
}
},
// #endif
disabled: {
type: Boolean,
default: false
......@@ -131,10 +137,6 @@ export default {
type: String,
default: 'grid'
},
// inputUrl: {
// type: Boolean,
// default: false
// },
// 选择文件类型 image/video/all
fileMediatype: {
type: String,
......@@ -189,18 +191,23 @@ export default {
}
},
watch: {
// #ifndef VUE3
value: {
handler(newVal) {
this.setValue(newVal)
},
immediate: true
},
// #endif
// #ifdef VUE3
modelValue:{
handler(newVal) {
this.setValue(newVal)
},
immediate: true
}
},
// #endif
},
data() {
return {
......@@ -281,7 +288,9 @@ export default {
data = this.backObject(newFils)
}
this.formItem && this.formItem.setValue(data)
if(newFils.length) this.files = newFils
if(newFils.length){
this.files = newFils
}
},
/**
* 获取父元素实例
......@@ -388,11 +397,10 @@ export default {
if (this.limitLength - this.files.length <= 0) break
files[i].uuid = Date.now()
let filedata = await this.getFileData(files[i], this.fileMediatype)
filedata.file = files[i]
filedata.progress = 0
filedata.status = 'ready'
this.files.push(filedata)
currentData.push(filedata)
currentData.push({...filedata,file:files[i]})
}
this.$emit('select', {
tempFiles: currentData,
......@@ -570,7 +578,6 @@ export default {
uuid: files.uuid,
extname: extname || '',
cloudPath: files.cloudPath,
file:files.file,
fileType: files.fileType,
url: files.path || files.path,
size: files.size, //单位是字节
......@@ -648,7 +655,12 @@ export default {
} else {
data = this.backObject(this.files)
}
// #ifdef VUE3
this.$emit('update:modelValue',data)
// #endif
// #ifndef VUE3
this.$emit('input', data)
// #endif
},
backObject(files) {
let newFilesData = JSON.parse(JSON.stringify(files))
......
......@@ -248,11 +248,11 @@ exports.main = async (event, context) => {
break;
case 'sendSmsCode':
/* -开始- 测试期间,为节约资源。统一虚拟短信验证码为: 123456;开启以下代码块即可 */
// return uniID.setVerifyCode({
// mobile: params.mobile,
// code: '123456',
// type: params.type
// })
return uniID.setVerifyCode({
mobile: params.mobile,
code: '123456',
type: params.type
})
/* -结束- */
// 简单限制一下客户端调用频率
......
......@@ -188,7 +188,7 @@
border-radius: 100px;
height: 50rpx;
line-height: 50rpx;
justify-content: center;
text-align: center;
width: 50rpx;
margin-bottom: 6rpx;
}
......
......@@ -4,7 +4,9 @@
"appid": "请点击重新获取" ,//清空appid
"mp-weixin" : {
"appid" : ""
}
},
"_spaceID" : "",
"vueVersion" : "2"
},
"/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json": {
"tokenExpiresIn": 7200,
......
......@@ -115,5 +115,6 @@
"h5" : {
"template" : ""
},
"_spaceID" : "76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e"
"_spaceID" : "76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e",
"vueVersion" : "2"
}
......@@ -44,9 +44,9 @@
"smsSecret": "短信密钥secret,开通短信服务处可以看到"
},
"univerify": {
"appid": "__UNI__03B096E",
"apiKey": "3fc28519d90d74173bcecf2daf4ffcc4",
"apiSecret": "dd793e5bc4b372ce932f35bbb4c5d61b"
"appid": "当前应用的appid,使用云函数URL化,此项必须配置",
"apiKey": "apiKey 和 apiSecret 在开发者中心获取,开发者中心:https://dev.dcloud.net.cn/uniLogin/index?type=0,文档:https://ask.dcloud.net.cn/article/37965",
"apiSecret": ""
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册