页面框架体系重新调整
This commit is contained in:
		
							
								
								
									
										10
									
								
								bin/serve.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								bin/serve.js
									
									
									
									
									
								
							| @@ -56,20 +56,20 @@ const start = () => { | ||||
|   chalkTag.info('开始生成pages.json...') | ||||
|   let json = { | ||||
|     easycom: { | ||||
|       "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" | ||||
|       "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue", | ||||
|       "^(Ai|V)(.*)": "@/components/$1$2.vue" | ||||
|     }, | ||||
|     pages: [ | ||||
|       {path: 'pages/loading'}, | ||||
|       {path: 'pages/login'}, | ||||
|       {path: 'pages/mainEntry', style: {navigationBarTitleText: "村微产品应用库"}} | ||||
|       {path: 'pages/login'} | ||||
|     ], | ||||
|     globalStyle: { | ||||
|       pageOrientation: "auto", | ||||
|       navigationStyle: "custom" | ||||
|     } | ||||
|   } | ||||
|   findApp('src/utils', file => { | ||||
|     if (/.*\\.+\\App[^\\]+\.vue/g.test(file)) { | ||||
|   findApp('src/apps', file => { | ||||
|     if (/.*\\.+\\App[^\\]+\\[^\\]+\.vue/g.test(file)) { | ||||
|       let app = { | ||||
|         name: file.replace(/.*\\([^\\]+).vue/g, '$1'), | ||||
|         path: file.replace(/^src\\(.*).vue/g, '$1').replace(/\\/g, '/') | ||||
|   | ||||
| @@ -48,6 +48,7 @@ body { | ||||
|  | ||||
| uni-page-body { | ||||
|   // min-height: 100%; | ||||
|   min-height: 100vh; | ||||
|   background: #f5f5f5; | ||||
|   position: relative; | ||||
| } | ||||
|   | ||||
| @@ -1,20 +1,19 @@ | ||||
| <template> | ||||
|   <div class="AppInterview"> | ||||
|     <template v-if="!showDetail"> | ||||
|       <ai-top-fixed> | ||||
|     <AiTopFixed> | ||||
|       <div flex> | ||||
|           <ai-date placeholder="日期选择" mode="range" @change="handleDateSearch"/> | ||||
|         <AiDate placeholder="日期选择" mode="range" @change="handleDateSearch"/> | ||||
|         <u-search placeholder="请输入标题" :show-action="false" v-model="search.title" @search="current=1,getList()"/> | ||||
|       </div> | ||||
|       </ai-top-fixed> | ||||
|     </AiTopFixed> | ||||
|     <template v-if="list.length>0"> | ||||
|         <ai-card :ref="'aiCard' + index" v-for="(e,index) in list" :key="index" @click.native="goDetail(e.id,1)"> | ||||
|       <AiCard :ref="'aiCard' + index" v-for="(e,index) in list" :key="index" @click.native="goDetail(e.id,1)"> | ||||
|         <template #custom> | ||||
|           <div flex> | ||||
|             <b class="fill">{{ e.title }}</b> | ||||
|           </div> | ||||
|           <div flex v-if="!!e.fileList" class="wrap" @click.stop> | ||||
|               <ai-image v-for="(op,i) in e.fileList.slice(0,3)" :src="op.accessUrl" preview :key="i"/> | ||||
|             <AiImage v-for="(op,i) in e.fileList.slice(0,3)" :src="op.accessUrl" preview :key="i"/> | ||||
|           </div> | ||||
|           <div class="bottom">{{ e.createTime }}</div> | ||||
|         </template> | ||||
| @@ -22,7 +21,7 @@ | ||||
|           <div class="menu" @tap.stop="goDetail(e.id)">编辑</div> | ||||
|           <div class="menu" @tap.stop="handleDelete(e.id, index)">删除</div> | ||||
|         </template> | ||||
|         </ai-card> | ||||
|       </AiCard> | ||||
|       <u-loadmore :status="loadmore" color="#999" font-size="24" | ||||
|                   margin-top="32" margin-bottom="80"/> | ||||
|     </template> | ||||
| @@ -30,23 +29,14 @@ | ||||
|       <image src="https://cdn.cunwuyun.cn/wxAdmin/img/message.png"/> | ||||
|       <p>您还未添加过入户调查走访<br>点击<b>新增按钮</b>试试吧~</p> | ||||
|     </div> | ||||
|       <ai-fixed-btn> | ||||
|     <AiFixedBtn> | ||||
|       <div class="addBtn iconfont iconfont-iconfangda" @tap="gotoAdd()"/> | ||||
|       </ai-fixed-btn> | ||||
|     </template> | ||||
|     <interview-detail v-else/> | ||||
|     </AiFixedBtn> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| import AiSelect from "../../components/AiSelect"; | ||||
| import AiTopFixed from "../../components/AiTopFixed"; | ||||
| import AiCard from "../../components/AiCard"; | ||||
| import AiImage from "../../components/AiImage"; | ||||
| import AiDate from "../../components/AiDate"; | ||||
| import AiFixedBtn from "../../components/AiFixedBtn"; | ||||
| import InterviewDetail from "./interviewDetail"; | ||||
| import AiBack from "../../components/AiBack"; | ||||
| import qs from "query-string" | ||||
|  | ||||
| export default { | ||||
|   name: "AppInterview", | ||||
| @@ -54,7 +44,6 @@ export default { | ||||
|   inject: { | ||||
|     root: {} | ||||
|   }, | ||||
|   components: {AiBack, InterviewDetail, AiFixedBtn, AiDate, AiImage, AiCard, AiTopFixed, AiSelect}, | ||||
|   data() { | ||||
|     return { | ||||
|       search: {title: ""}, | ||||
| @@ -66,25 +55,9 @@ export default { | ||||
|   computed: { | ||||
|     loadmore() { | ||||
|       return this.pages <= this.current ? 'loading ' : 'nomore' | ||||
|     }, | ||||
|     showDetail() { | ||||
|       return this.$route.hash == "#add" | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
|     emitShow() { | ||||
|       document.title = "调查走访" | ||||
|       if (this.showDetail) { | ||||
|         document.title = this.$route.query.detail ? "走访详情" : "新增走访" | ||||
|       } else { | ||||
|         this.current = 1; | ||||
|         this.getList() | ||||
|       } | ||||
|     }, | ||||
|     emitReachBottom() { | ||||
|       this.current++; | ||||
|       this.getList() | ||||
|     }, | ||||
|     getList() { | ||||
|       this.$http.post('/app/appinterview/list-xcx', null, { | ||||
|         params: { | ||||
| @@ -102,10 +75,10 @@ export default { | ||||
|     goDetail(id, readonly) { | ||||
|       let query = {id} | ||||
|       readonly && (query.detail = 1) | ||||
|       this.root.goto({hash: "#add", query}) | ||||
|       uni.navigateTo({url: `./interviewDetail?${qs.stringify(query)}`}) | ||||
|     }, | ||||
|     gotoAdd() { | ||||
|       this.root.goto({hash: "#add"}) | ||||
|       uni.navigateTo({url: `./interviewDetail`}) | ||||
|     }, | ||||
|     handleDelete(ids, index) { | ||||
|       this.$refs[`aiCard${index}`][0].handleClose() | ||||
| @@ -126,7 +99,16 @@ export default { | ||||
|       this.current = 1 | ||||
|       this.getList() | ||||
|     } | ||||
|   } | ||||
|   }, | ||||
|   onShow() { | ||||
|     document.title = "调查走访" | ||||
|     this.current = 1; | ||||
|     this.getList() | ||||
|   }, | ||||
|   onReachBottom() { | ||||
|     this.current++; | ||||
|     this.getList() | ||||
|   }, | ||||
| } | ||||
| </script> | ||||
|  | ||||
|   | ||||
| @@ -1,25 +0,0 @@ | ||||
| const install = function (Vue) { | ||||
|   if (install.installed) return | ||||
|   // 遍历注册全局组件 | ||||
|   let apps = [] | ||||
|   let contexts = require.context('.', true, /\.(\/.+)\/App[^\/]+\.vue$/) | ||||
|   if (contexts) { | ||||
|     contexts.keys().map(e => { | ||||
|       if (contexts(e).default) { | ||||
|         apps.push(contexts(e).default) | ||||
|         Vue.component(contexts(e).default.name, contexts(e).default) | ||||
|       } | ||||
|     }) | ||||
|   } | ||||
|   return Promise.resolve(apps) | ||||
| } | ||||
|  | ||||
| // 判断是否是直接引入文件 | ||||
| if (typeof window !== 'undefined' && window.Vue) { | ||||
|   install(window.Vue) | ||||
| } | ||||
|  | ||||
| export default { | ||||
|   // 导出的对象必须具有 install,才能被 Vue.use() 方法安装 | ||||
|   install | ||||
| } | ||||
| @@ -43,5 +43,14 @@ export default { | ||||
|   }, | ||||
|   formatName: (name) => { | ||||
|     return Array.from(name)?.slice(-2)?.toString() || ""; | ||||
|   }, | ||||
|   loading: title => { | ||||
|     uni.showLoading({ | ||||
|       title: title ? title : '加载中', | ||||
|       mask: true | ||||
|     }) | ||||
|   }, | ||||
|   hideLoading: () => { | ||||
|     uni.hideLoading() | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -47,8 +47,8 @@ export default { | ||||
|       } else if (this.custom) { | ||||
|         this.$emit("back") | ||||
|       } else if (this.custom) { | ||||
|       } else this.root.goto({}, () => { | ||||
|         if (this.eventName != '') { | ||||
|       } else uni.navigateBack({ | ||||
|         success: () => { | ||||
|           uni.$emit(this.eventName, this.data) | ||||
|         } | ||||
|       }) | ||||
|   | ||||
| @@ -4,7 +4,6 @@ import store from './store'; | ||||
| import axios from './common/axios'; | ||||
| import utils from './common/util'; | ||||
| import ui from 'uview-ui' | ||||
| import apps from './apps/index' | ||||
|  | ||||
| const loading = title => { | ||||
|   uni.showLoading({ | ||||
| @@ -21,7 +20,6 @@ Vue.prototype.$loading = loading | ||||
| Vue.prototype.$hideLoading = hideLoading | ||||
|  | ||||
| Vue.use(ui) | ||||
| Vue.use(apps) | ||||
| Vue.config.productionTip = false; | ||||
| Vue.prototype.$store = store; | ||||
| //初始化接口工具类 | ||||
|   | ||||
| @@ -47,8 +47,7 @@ export default { | ||||
|       }) | ||||
|     }, | ||||
|     handleGotoApp(app) { | ||||
|       console.log(app) | ||||
|       uni.navigateTo({url: `./mainEntry?app=${app.key}`}) | ||||
|       uni.navigateTo({url: `/apps${app.path}`}) | ||||
|     }, | ||||
|     handleLogin() { | ||||
|       uni.navigateTo({url: "./login"}) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user