开发环境同步
This commit is contained in:
		| @@ -60,7 +60,8 @@ const start = () => { | |||||||
|     }, |     }, | ||||||
|     pages: [ |     pages: [ | ||||||
|       {path: 'pages/loading'}, |       {path: 'pages/loading'}, | ||||||
|       {path: 'pages/login'} |       {path: 'pages/login'}, | ||||||
|  |       {path: 'pages/mainEntry', style: {navigationBarTitleText: "村微产品应用库"}} | ||||||
|     ], |     ], | ||||||
|     globalStyle: { |     globalStyle: { | ||||||
|       pageOrientation: "auto", |       pageOrientation: "auto", | ||||||
|   | |||||||
| @@ -4,8 +4,10 @@ import store from './store'; | |||||||
| import axios from './common/axios'; | import axios from './common/axios'; | ||||||
| import utils from './common/util'; | import utils from './common/util'; | ||||||
| import ui from 'uview-ui' | import ui from 'uview-ui' | ||||||
|  | import apps from './apps/index' | ||||||
|  |  | ||||||
| Vue.use(ui) | Vue.use(ui) | ||||||
|  | Vue.use(apps) | ||||||
| Vue.config.productionTip = false; | Vue.config.productionTip = false; | ||||||
| Vue.prototype.$store = store; | Vue.prototype.$store = store; | ||||||
| //初始化接口工具类 | //初始化接口工具类 | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ | |||||||
|     <input v-if="!!$route.query.code" class="codeText" :value="$route.query.code"/> |     <input v-if="!!$route.query.code" class="codeText" :value="$route.query.code"/> | ||||||
|     <div class="codeBtn" @click="handleLogin">去登录</div> |     <div class="codeBtn" @click="handleLogin">去登录</div> | ||||||
|     <div flex class="appsPane wrap"> |     <div flex class="appsPane wrap"> | ||||||
|       <b v-for="app in apps" :key="app.key" @tap="redirectTo(app.path)">{{ app.name }}</b> |       <b v-for="app in apps" :key="app.key" @tap="handleGotoApp(app)">{{ app.name }}</b> | ||||||
|     </div> |     </div> | ||||||
|   </section> |   </section> | ||||||
| </template>0 | </template>0 | ||||||
| @@ -46,6 +46,10 @@ export default { | |||||||
|         } |         } | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|  |     handleGotoApp(app) { | ||||||
|  |       console.log(app) | ||||||
|  |       uni.navigateTo({url: `./mainEntry?app=${app.key}`}) | ||||||
|  |     }, | ||||||
|     handleLogin() { |     handleLogin() { | ||||||
|       uni.navigateTo({url: "./login"}) |       uni.navigateTo({url: "./login"}) | ||||||
|     }, |     }, | ||||||
|   | |||||||
							
								
								
									
										43
									
								
								src/pages/mainEntry.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								src/pages/mainEntry.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,43 @@ | |||||||
|  | <template> | ||||||
|  |   <section class="mainEntry"> | ||||||
|  |     <component ref="CurrentEntry" v-if="app" :is="app"/> | ||||||
|  |     <div v-else> | ||||||
|  |       <AiResult tips="应用建设中.." status="error" btn="返回主页" :btn-tap="back"/> | ||||||
|  |     </div> | ||||||
|  |   </section> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  | export default { | ||||||
|  |   name: "mainEntry", | ||||||
|  |   inject: {root: {}}, | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       app: "" | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   methods: { | ||||||
|  |     back() { | ||||||
|  |       // uni.reLaunch({url:""}) | ||||||
|  |       this.root.goto({path: "/pages/loading"}) | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   onLoad(params) { | ||||||
|  |     this.app = params.app || "" | ||||||
|  |   }, | ||||||
|  |   onShow() { | ||||||
|  |     this.app = this.$route.query.app || "" | ||||||
|  |     this.$nextTick(() => { | ||||||
|  |       this.$refs.CurrentEntry?.emitShow?.() | ||||||
|  |     }) | ||||||
|  |   }, | ||||||
|  |   onReachBottom() { | ||||||
|  |     this.$refs.CurrentEntry?.emitReachBottom?.() | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | .mainEntry { | ||||||
|  | } | ||||||
|  | </style> | ||||||
		Reference in New Issue
	
	Block a user