提交 8607deb4 编写于 作者: DCloud_JSON's avatar DCloud_JSON

修复内测用户反馈的,微信小程序端全局变量赋值时机问题(临时修复方案,后续会从框架角度升级)

上级 07eeb384
......@@ -5,4 +5,5 @@ node_modules
uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/config.json
uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json
pages/grid/banner.json
pages/list/list.json
\ No newline at end of file
pages/list/list.json
manifest.json
\ No newline at end of file
<script>
import initApp from '@/common/appInit.js';
import initApp from '@/common/appInit.js';
import checkIsAgree from '@/uni_modules/uni-agree/utils/uni-agree.js';
export default {
globalData: {
......@@ -8,8 +8,10 @@
config:{}
},
onLaunch: function() {
console.log('App Launch')
initApp();
console.log('App Launch')
initApp();
// #ifdef APP-PLUS
//checkIsAgree(); 暂时先用默认生成的,自定义的等待原生支持后实现。因为启动vue界面时已经,请求了部分权限这并不符合国家的法规
// #endif
......
import baseappConfig from '@/baseapp.config.js';
//应用初始化页
import baseappConfig from '@/baseapp.config.js';
// #ifdef APP-PLUS
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
import callCheckVersion from '@/uni_modules/uni-upgrade-center-app/utils/call-check-version';
// #endif
export default function() {
export default function() {
setTimeout(()=>{
// baseappConfig挂载到getApp().
const app = getApp({allowDefault: true})
app.globalData.config = baseappConfig;
},30)
// 初始化appVersion(仅app生效)
initAppVersion();
// baseappConfig挂载到getApp().
getApp({allowDefault: true}).globalData.config = baseappConfig;
/*
这里应用拦截器实现了,路由拦截。当应用无访问摄像头/相册权限,引导跳到设置界面
1.添加拦截器说明如下:
......
......@@ -110,11 +110,11 @@
"appid" : "wx07597007230e3702",
"setting" : {
"urlCheck" : false,
"es6" : false
"es6" : true
},
"usingComponents" : true
"usingComponents" : true ,
"betterScopedSlots" : true
},
// "betterScopedSlots" : true
"mp-alipay" : {
"usingComponents" : true
},
......
......@@ -2,7 +2,7 @@
"id": "uniCloud-base-app",
"displayName": "baseApp",
"version": "1.0.0",
"description": "云端一体项目基础功能示例",
"description": "集成了商用项目开发常见功能的项目模板",
"keywords": [
"baseApp",
"login",
......@@ -20,7 +20,7 @@
"dcloudext": {
"category": [
"uniCloud",
"云端一体项目基础功能示例"
"集成了商用项目开发常见功能的项目模板"
],
"sale": {
"regular": {
......
<template>
<view>
<!-- #ifdef APP-PLUS -->
<!-- #ifndef H5 -->
<uni-nav-bar :border="false"></uni-nav-bar>
<!-- #endif -->
<!-- 搜索功能 -->
......@@ -19,13 +19,13 @@
<template v-else>
<uni-list-item class="get-data-state" v-if="data.length===0&&pagination.current===1">
<template slot="body">
<view slot="body">
<!-- 数据为空 当前页码为1,且正在加载中;这里为了演示,更加直观的表达内部逻辑。商用项目建议将这部分封装为组件,更好的让业务逻辑与功能分离-->
<uni-load-more v-if="loading" status="loading"></uni-load-more>
<template v-else>
<text class="get-data-state-text">内容为空</text>
</template>
</template>
</view>
</uni-list-item>
<uni-list-item :to="'./detail?id='+item._id+'&title='+item.title"
v-for="(item,index) in data" :key="index">
......@@ -84,7 +84,9 @@
this.listHight = 'auto'
// #endif
cdbRef = this.$refs.udb
console.log(cdbRef);
console.log(cdbRef);
console.log(9527,getApp().globalData);
},
onShow() {
this.keyword = getApp().globalData.searchText
......
......@@ -8,13 +8,13 @@
</view>
</view>
<uni-grid class="grid" :column="5" :showBorder="false" :square="true">
<uni-grid-item class="item" v-for="(item,index) in gridList" @click.native="tapGrid(index)">
<uni-grid-item class="item" v-for="(item,index) in gridList" @click.native="tapGrid(index)" :key="index">
<uni-icons class="icon" color="#5d5e64" :type="item.icon" size="28"></uni-icons>
<text class="text">{{item.text}}</text>
</uni-grid-item>
</uni-grid>
<uni-list class="center-list" v-for="(sublist , index) in ucenterList">
<uni-list-item v-for="item in sublist" :title="item.title" link :rightText="item.rightText"
<uni-list class="center-list" v-for="(sublist , index) in ucenterList" :key="index">
<uni-list-item v-for="(item,i) in sublist" :title="item.title" link :rightText="item.rightText" :key="i"
:clickable="true" :to="item.to" @click="ucenterListClick(item)">
<view v-if="item.showBadge" class="item-footer" slot="footer">
<text class="item-footer-text">{{item.rightText}}</text>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册