Files
dvcp_v2_wxcp_app/src/pages/loading.vue

128 lines
2.8 KiB
Vue
Raw Normal View History

2021-11-15 10:29:05 +08:00
<template>
<section class="loading">
<!-- <div class="iconfont iconfont-iconWeChat"/>-->
<!-- <div class="iconfont iconfont-iconjuminxinxi"/>-->
<!-- <div class="iconfont iconfont-iconLogo"/>-->
<ai-result v-if="result.tips" v-bind="result"/>
2021-11-15 15:53:44 +08:00
<input v-if="!!$route.query.code" class="codeText" :value="$route.query.code"/>
<input class="codeText" v-model="search" placeholder="搜索要查找的应用"/>
2021-11-15 15:53:44 +08:00
<div flex class="appsPane wrap">
2022-06-13 17:48:22 +08:00
<div class="item" flex v-for="app in appsList" :key="app.id" @tap="handleGotoApp(app)">
<b v-text="app.label"/>
<u-tag v-if="app.project" :text="app.project" mode="dark" shape="circle" size="mini"/>
<div class="appName fill" v-text="app.name"/>
</div>
2021-11-15 15:53:44 +08:00
</div>
2021-11-15 10:29:05 +08:00
</section>
2021-12-08 18:01:40 +08:00
</template>
2021-11-15 10:29:05 +08:00
<script>
2022-07-04 15:48:17 +08:00
import {mapActions, mapState} from 'vuex'
2021-11-15 10:29:05 +08:00
import AiResult from "../components/AiResult";
2022-01-26 10:15:03 +08:00
import AiSelect from "../components/AiSelect";
2021-11-15 10:29:05 +08:00
export default {
name: 'loading',
2022-01-26 10:15:03 +08:00
components: {AiSelect, AiResult},
2021-11-15 10:29:05 +08:00
inject: ['root'],
computed: {
2022-07-04 15:48:17 +08:00
...mapState(['apps']),
appsList() {
2022-07-04 15:48:17 +08:00
let {search} = this
2022-03-10 14:01:30 +08:00
return this.apps.filter(e => {
2022-06-13 17:48:22 +08:00
if (/\/project\//.test(e.libPath)) {
e.project = e.libPath.replace(/.*project\/([^\/]+)\/.+/, '$1')
2022-06-13 09:57:52 +08:00
}
2022-07-04 15:48:17 +08:00
return e
2022-06-08 10:30:50 +08:00
}).filter(e => !!search ? e.label?.indexOf(search) > -1 : true) || []
},
2021-11-15 10:29:05 +08:00
currentApp() {
return this.apps.find(e => e.key == this.$route.query.app) || {}
}
},
data() {
return {
2021-11-17 17:13:52 +08:00
result: {},
search: ""
2021-11-15 10:29:05 +08:00
}
},
methods: {
2021-11-23 16:07:39 +08:00
...mapActions(['agentSign']),
2021-11-30 14:39:24 +08:00
handleGotoApp(app) {
2022-05-30 18:46:49 +08:00
uni.navigateTo({url: `${app.libPath}`})
2022-01-28 16:49:59 +08:00
},
2021-11-15 10:29:05 +08:00
},
2021-11-23 16:07:39 +08:00
onLoad() {
this.agentSign(this.$route.query)
},
2021-11-23 14:58:51 +08:00
onShow() {
this.result = {
tips: "欢迎进入开发应用",
}
2021-11-15 10:29:05 +08:00
}
}
</script>
<style lang="scss" scoped>
.loading {
height: 100%;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
& > span {
font-size: 36px;
}
.codeText {
font-size: 24px;
margin-top: 16px;
padding: 4px 0;
width: 100%;
text-align: center;
background: #ccc;
}
.codeBtn {
width: 180px;
text-align: center;
cursor: pointer;
font-size: 24px;
background: $uni-color-warning;
color: #fff;
padding: 8px;
margin-top: 16px;
border-radius: 8px;
font-weight: normal;
}
.appsPane {
justify-content: center;
margin-top: 16px;
2022-06-13 17:48:22 +08:00
.item {
width: 100%;
font-size: 28px;
padding: 0 32px;
height: 64px;
border-bottom: 1px solid #ddd;
&:nth-of-type(2n) {
background: rgba(#26f, .02);
}
}
2021-11-15 10:29:05 +08:00
b {
cursor: pointer;
2022-06-13 17:48:22 +08:00
margin-right: 16px;
display: block;
}
2022-06-13 09:57:52 +08:00
2022-06-13 17:48:22 +08:00
.appName {
text-align: right;
2021-11-15 10:29:05 +08:00
}
}
}
</style>