细化产品库

This commit is contained in:
aixianling
2022-01-26 10:15:03 +08:00
parent 95d6ae0090
commit 409cf69fd5

View File

@@ -6,6 +6,9 @@
<ai-result v-if="result.tips" v-bind="result"/> <ai-result v-if="result.tips" v-bind="result"/>
<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>
<u-radio-group v-model="currentLib" @change="getApps">
<u-radio v-for="(op,i) in libs" :key="i" :name="op.dir">{{ op.label }}</u-radio>
</u-radio-group>
<input class="codeText" v-model="search" placeholder="搜索要查找的应用"/> <input class="codeText" v-model="search" placeholder="搜索要查找的应用"/>
<div flex class="appsPane wrap"> <div flex class="appsPane wrap">
<b v-for="app in appsList" :key="app.key" @tap="handleGotoApp(app)">{{ app.name }}</b> <b v-for="app in appsList" :key="app.key" @tap="handleGotoApp(app)">{{ app.name }}</b>
@@ -16,10 +19,11 @@
<script> <script>
import {mapActions, mapState} from 'vuex' import {mapActions, mapState} from 'vuex'
import AiResult from "../components/AiResult"; import AiResult from "../components/AiResult";
import AiSelect from "../components/AiSelect";
export default { export default {
name: 'loading', name: 'loading',
components: {AiResult}, components: {AiSelect, AiResult},
inject: ['root'], inject: ['root'],
computed: { computed: {
...mapState(['token', 'openUser', 'user']), ...mapState(['token', 'openUser', 'user']),
@@ -35,6 +39,11 @@ export default {
return { return {
result: {}, result: {},
apps: [], apps: [],
libs: [
{label: "通用版", dir: "apps"},
{label: "上架版", dir: "sass"},
],
currentLib: "apps",
search: "" search: ""
} }
}, },
@@ -60,8 +69,8 @@ export default {
}, },
getApps() { getApps() {
this.apps = [] this.apps = []
let applications = require.context('../apps', true, /\.(\/.+)\/App[^\/]+\.vue$/) let applications = this.currentLib == "apps" ? require.context('../apps', true, /\.(\/.+)\/App[^\/]+\.vue$/) :
console.log(applications.keys()) this.currentLib == "sass" ? require.context('../sass', true, /\.(\/.+)\/App[^\/]+\.vue$/) : null
applications.keys().map(path => { applications.keys().map(path => {
if (applications(path).default) { if (applications(path).default) {
let {name: key, appName: name} = applications(path).default let {name: key, appName: name} = applications(path).default