产品库自动化,自动根据pages下的内容生成pages.json

This commit is contained in:
aixianling
2021-11-15 14:23:50 +08:00
parent 5440b43b9c
commit aa4f0c8837
6 changed files with 86 additions and 623 deletions

View File

@@ -1,174 +0,0 @@
<template>
<section class="app">
<u-swiper :list="list" height="240" bg-color="#408CFF"></u-swiper>
<label class="useful-app">常用应用</label>
<u-grid
:col="o.length"
:border="false"
v-for="(o, i) in gridGroup"
:key="i"
>
<u-grid-item v-for="(i, j) in o" :key="j" @click="linkTo(i)">
<u-icon :name="i.icon" :size="100"></u-icon>
<view class="grid-text">{{ i.label }}</view>
</u-grid-item>
</u-grid>
<label class="useful-app notice">通知公告</label>
<section class="list">
<div class="item" v-for="(item, index) in dataList" :key="index">
<label class="title hidden">{{ item.title }}</label>
<div class="content hidden">{{ item.content }}</div>
<div class="date">{{ item.createTime }}</div>
</div>
<u-loadmore :status="status" />
</section>
</section>
</template>
<script>
export default {
name: 'app',
data() {
return {
list: [this.imgHomeUrl + 'banner.png'],
gridGroup: [
[
{
icon: `${this.imgHomeUrl}icon1.png`,
label: '随心问',
link: '/pages/casuallyask/casuallyask'
},
{
icon: `${this.imgHomeUrl}icon2.png`,
label: '随手拍',
link: '/pages/snapshot/snapshot'
},
{
icon: `${this.imgHomeUrl}icon3.png`,
label: '网上办事',
link: '/pages/workonline/workonline'
},
{ icon: `${this.imgHomeUrl}icon4.png`, label: '调查走访' }
],
[
{
icon: `${this.imgHomeUrl}icon5.png`,
label: '信用好超市',
link: '/pages/supermarket/supermarket'
},
{ icon: `${this.imgHomeUrl}icon6.png`, label: '中心工作' },
{ icon: `${this.imgHomeUrl}icon7.png`, label: '会务通知' },
{ icon: `${this.imgHomeUrl}icon8.png`, label: '工作去向' },
{ icon: `${this.imgHomeUrl}icon8.png`, label: '大喇叭' }
]
],
status: 'nomore',
dataList: [],
current: 0
}
},
onLoad() {
this.getList()
},
methods: {
getList() {
if (this.loadingStatus == 'nomore') return
this.$http
.post(`/app/appworkcenternotice/list`, null, {
params: {
withoutToken: true,
current: this.current + 1,
size: 10
}
})
.then(res => {
if (res && res.data) {
this.dataList = res.data.records
}
})
},
linkTo(val) {
if (val.link) {
uni.navigateTo({ url: val.link })
}
}
},
onReachBottom() {
this.getList()
}
}
</script>
<style lang="scss" scoped>
.app {
min-height: 100%;
background-color: #ffffff;
box-sizing: border-box;
padding: 32px;
position: relative;
.grid-text {
font-size: 28px;
color: #333333;
line-height: 46px;
}
.useful-app {
margin-top: 80px;
display: inherit;
font-size: 36px;
font-weight: bold;
color: #333333;
line-height: 50px;
}
.notice {
margin-top: 56px;
}
.list {
margin-top: 38px;
.item {
height: 192px;
background: #f7f9ff;
border-radius: 8px;
box-sizing: border-box;
padding: 20px;
margin-bottom: 32px;
.title {
font-size: 32px;
font-weight: 800;
color: #343d65;
}
.content {
font-size: 28px;
color: #333333;
font-weight: 500;
margin: 20px 0 8px 0;
}
.date {
font-size: 28px;
color: #666666;
}
}
}
.hidden {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .u-indicator-item-round {
background-color: #d8dde6;
}
::v-deep .u-indicator-item-round-active {
background-color: #408cff !important;
}
}
</style>

View File

@@ -82,40 +82,10 @@ export default {
uni.showLoading({
title: "加载中"
})
this.initAccess()?.then(() => {
uni.hideLoading()
if (this.token) {
if (this.currentApp.name) {
this.redirectTo(this.currentApp.path)
} else if (this.$route.query.url) {
this.redirectTo(this.$route.query.url)
} else {
this.result = {
status: "error",
tips: "应用加载失败",
btn: "重新加载",
btnTap() {
location.href = location.href?.replace("#error", '')
}
}
}
} else if (this.isDev) {
this.result = {
tips: "欢迎进入开发应用",
}
} else {
this.result = {
status: "error",
tips: "应用加载失败",
btn: "重新加载",
btnTap() {
location.href = location.href?.replace("#error", '')
}
}
}
})?.catch(() => {
uni.navigateTo({url: './login'})
})
uni.hideLoading()
this.result = {
tips: "欢迎进入开发应用",
}
}
}
</script>