From 001ce67b4931ddec75dc1feb82fa86c1caa1351c Mon Sep 17 00:00:00 2001 From: linju-json Date: Thu, 29 Jul 2021 15:06:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BB=91=E5=AE=9A=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E5=8F=B7=E7=A0=81=E9=A1=B5=E9=9D=A2=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 40 ++--- README.md | 3 + changelog.md | 2 + common/appInit.js | 12 +- main.js | 45 +++-- package.json | 2 +- pages.json | 4 +- pages/grid/grid.vue | 55 +++--- pages/list/list.nvue | 1 - pages/ucenter/ucenter.vue | 2 +- .../userinfo/bind-mobile/bind-mobile.vue | 14 +- pages/ucenter/userinfo/userinfo.vue | 6 +- uni_modules/json-gps/js_sdk/gps.js | 2 +- uni_modules/uni-badge/changelog.md | 30 ++-- .../components/uni-badge/uni-badge.vue | 3 - uni_modules/uni-badge/package.json | 166 +++++++++--------- uni_modules/uni-badge/readme.md | 2 +- .../cloudfunctions/uni-id-cf/index.js | 5 - .../uni-list-item/uni-list-item.vue | 3 +- 19 files changed, 202 insertions(+), 195 deletions(-) diff --git a/App.vue b/App.vue index db2944ae..71ce47c1 100644 --- a/App.vue +++ b/App.vue @@ -5,36 +5,36 @@ globalData: { searchText: '', appVersion: {}, - config:{} + config: {} }, onLaunch: function() { console.log('App Launch') initApp(); // #ifdef APP-PLUS //checkIsAgree(); APP端暂时先用原生默认生成的。目前,自定义方式启动vue界面时,原生层已经请求了部分权限这并不符合国家的法规 - // #endif - - // #ifdef H5 - // checkIsAgree(); 默认不开启。目前全球,仅欧盟国家有网页端同意隐私权限的需要。如果需要 // #endif - + + // #ifdef H5 + // checkIsAgree(); 默认不开启。目前全球,仅欧盟国家有网页端同意隐私权限的需要。如果需要 + // #endif + // #ifdef APP-PLUS - //idfa有需要的用户在应用首次启动时自己获取存储到storage中 - //https://ask.dcloud.net.cn/article/36107 - /*if(~plus.storage.getItem('idfa')){ - plus.device.getInfo({//需要勾选IDFA - success:function(e){ - console.log('idfa = '+JSON.stringify(e.idfa)); - }, - fail:function(e){ - console.log('getDeviceInfo failed: '+JSON.stringify(e)); - } - }); - }*/ + //idfa有需要的用户在应用首次启动时自己获取存储到storage中 + //https://ask.dcloud.net.cn/article/36107 + /*if(~plus.storage.getItem('idfa')){ + plus.device.getInfo({//需要勾选IDFA + success:function(e){ + console.log('idfa = '+JSON.stringify(e.idfa)); + }, + fail:function(e){ + console.log('getDeviceInfo failed: '+JSON.stringify(e)); + } + }); + }*/ // #endif }, onShow: function() { - console.log('App Show') + console.log('App Show') }, onHide: function() { console.log('App Hide') @@ -44,4 +44,4 @@ + diff --git a/README.md b/README.md index 226a9857..ca085285 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,9 @@ uni-starter + uniCloud admin,提供了用户端和管理端的基础模板, "login": ["username","smsCode","univerify", "weixin", "apple"], } ``` +*** 注意:首页需要强制登陆才能访问的场景 +- 这种情况不由路由控制。而是uni-starter的callFunction拦截器,根据响应体决定是否跳转到登陆页。 +- uni-starter框架不能将登陆页面设置为首页,否则由拦截器实现的路由管理将生效。 #### 2.登录配置详解 - 使用方式:在 `uni-starter.config.js`->`router`->`login`下完全列举你需要的登录方式。这里支持用[条件编译](https://uniapp.dcloud.io/platform?id=%e6%9d%a1%e4%bb%b6%e7%bc%96%e8%af%91)因此你可以配置在不同平台下拥有的登录方式。 diff --git a/changelog.md b/changelog.md index 9056ff7b..a41ade25 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,5 @@ +## 1.0.42(2021-07-29) +新增绑定手机号码页面前端校验 ## 1.0.41(2021-07-27) 1. 支持vue3.0 2. 去掉App.vue全局样式,避免与非flex布局的页面样式冲突 diff --git a/common/appInit.js b/common/appInit.js index cbd76ca8..1c8ee4d9 100644 --- a/common/appInit.js +++ b/common/appInit.js @@ -298,7 +298,8 @@ export default async function() { visitor, login } - } = uniStarterConfig //需要登录的页面 + } = uniStarterConfig //需要登录的页面 + let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]; list.forEach(item => { //用遍历的方式分别为,uni.navigateTo,uni.redirectTo,uni.reLaunch,uni.switchTab这4个路由方法添加拦截器 uni.addInterceptor(item, { @@ -310,7 +311,7 @@ export default async function() { //获取要跳转的页面路径(url去掉"?"和"?"后的参数) url = e.url.split('?')[0], //获取要前往的页面路径(即url去掉"?"和"?"后的参数) - pages = getCurrentPages(), + pages = getCurrentPages(), fromUrl = pages[pages.length - 1].route; @@ -341,7 +342,7 @@ export default async function() { } return url != item }) - console.log({pass}) + // console.log({pass}) } if (visitor&&!inLoginPage) { pass = visitor.some((item) => { @@ -350,7 +351,7 @@ export default async function() { } return url == item }) - console.log({pass}) + // console.log({pass}) } if (!pass && (token == '' || tokenExpired)) { @@ -377,7 +378,8 @@ export default async function() { } } }) - }) + }) + // #ifdef APP-PLUS // 监听并提示设备网络状态变化 uni.onNetworkStatusChange(res => { diff --git a/main.js b/main.js index 02e10ad2..bf6de880 100644 --- a/main.js +++ b/main.js @@ -1,21 +1,28 @@ -import App from './App' -import store from './store' +import App from './App' +import store from './store' -// #ifndef VUE3 -import Vue from 'vue' -Vue.config.productionTip = false -Vue.prototype.$store = store -App.mpType = 'app' -const app = new Vue({ - store, - ...App -}) -app.$mount() -// #endif + +// #ifndef VUE3 +import Vue from 'vue' +Vue.config.productionTip = false +Vue.prototype.$store = store +App.mpType = 'app' +const app = new Vue({ + store, + ...App +}) +app.$mount() +// #endif -// #ifdef VUE3 -import { createApp } from 'vue' -const app = createApp(App,{}) -app.use(store) -app.mount('#app') -// #endif \ No newline at end of file + +// #ifdef VUE3 +import { + createSSRApp +} from 'vue' + +export function createApp() { + const app = createSSRApp(App) + app.use(store) + return {app} +} +// #endif diff --git a/package.json b/package.json index a77a4171..3a2f077f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "id": "uni-starter", "displayName": "uni-starter", - "version": "1.0.41", + "version": "1.0.42", "description": "云端一体应用快速开发基本项目模版", "keywords": [ "login", diff --git a/pages.json b/pages.json index 5664ca2a..3f3c0e86 100644 --- a/pages.json +++ b/pages.json @@ -158,8 +158,8 @@ } }, { "path": "pages/ucenter/invite/invite", - "style": { - "navigationStyle":"custom", + "style": { + "navigationStyle": "custom", "enablePullDownRefresh": false } diff --git a/pages/grid/grid.vue b/pages/grid/grid.vue index 0f3f0f6f..7d65de92 100644 --- a/pages/grid/grid.vue +++ b/pages/grid/grid.vue @@ -2,21 +2,26 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -67,8 +72,7 @@ /** * banner加载后触发的回调 */ - load(data) { - + onqueryload(data) { }, changeSwiper(e) { this.current = e.detail.current @@ -90,21 +94,6 @@ }); } // 其余业务处理 - }, - /** - * banner数据过滤 - */ - bannerFormate(bannerList, loading) { - if (loading) return []; - if (bannerList.length > 0) return bannerList; - // 无数据添加默认值 - let list = [{ - "_id": -1, - "bannerfile": "/static/grid/empty.png", - "open_url": "https://www.dcloud.io/", - "title": "内容 A", - }] - return list; } } } @@ -176,7 +165,7 @@ padding: 15px 0; } - .swiper-image { + .banner-image { width: 750rpx; height: 400rpx; } diff --git a/pages/list/list.nvue b/pages/list/list.nvue index 5cc6f3c0..e51fe8d1 100644 --- a/pages/list/list.nvue +++ b/pages/list/list.nvue @@ -8,7 +8,6 @@ - diff --git a/pages/ucenter/ucenter.vue b/pages/ucenter/ucenter.vue index f6114a7e..0fd27f8a 100644 --- a/pages/ucenter/ucenter.vue +++ b/pages/ucenter/ucenter.vue @@ -1,7 +1,7 @@ - +