mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-06-12 21:29:31 +08:00
feat: 新增首页轮播支持配置
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right-hot-ttf">
|
<view class="right-hot-ttf">
|
||||||
<text class="text hot-text">{{ title }}</text>
|
<text class="text hot-text text-overflow-2">{{ title }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<view class="Top-Title">
|
<view class="Top-Title">
|
||||||
<text class="text title-text">{{ item.title }}</text>
|
<text class="text title-text text-overflow-2">{{ item.title }}</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- 用户信息 -->
|
<!-- 用户信息 -->
|
||||||
<view v-if="false" class="Bottom-UserInfo">
|
<view v-if="false" class="Bottom-UserInfo">
|
||||||
@@ -217,4 +217,4 @@
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import './e-swiper.scss';
|
@import './e-swiper.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
<template>
|
||||||
|
<tm-poup v-model="isShow" width="80vw" height="70vh" position="center" :round="6" @change="fnOnChange">
|
||||||
|
<view class="fulled pa-4">
|
||||||
|
<view class="mt-24 fulled text-weight-b text-size-sm text-align-center text-overflow-2 pb-12">{{ title }}</view>
|
||||||
|
<view class="fulled mt-2">
|
||||||
|
<scroll-view class="fulled" scroll-y :style="{
|
||||||
|
height: url? '52vh': '59vh'
|
||||||
|
}">
|
||||||
|
<mp-html class="evan-markdown" lazy-load :domain="markdownConfig.domain"
|
||||||
|
:loading-img="markdownConfig.loadingGif" :scroll-table="true" :selectable="true"
|
||||||
|
:tag-style="markdownConfig.tagStyle" :container-style="markdownConfig.containStyle"
|
||||||
|
:content="content" :markdown="true" :showLineNumber="true" :showLanguageName="true"
|
||||||
|
:copyByLongPress="true"/>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
<view v-if="url" class="fulled mt-12 flex flex-center">
|
||||||
|
<tm-button theme="bg-gradient-light-blue-accent" size="m" @click="fnToWebview()">
|
||||||
|
点击跳转内容链接
|
||||||
|
</tm-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</tm-poup>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
||||||
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
|
import mpHtml from '@/components/mp-html/components/mp-html/mp-html.vue';
|
||||||
|
|
||||||
|
import MarkdownConfig from '@/common/markdown/markdown.config.js';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'notify-dialog',
|
||||||
|
components: {
|
||||||
|
tmPoup,
|
||||||
|
tmButton,
|
||||||
|
mpHtml
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
show: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isShow: false,
|
||||||
|
markdownConfig: MarkdownConfig,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.isShow = this.show;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fnToWebview() {
|
||||||
|
if (this.$utils.checkIsUrl(this.url)) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesC/website/website?data=' +
|
||||||
|
JSON.stringify({
|
||||||
|
title: this.title,
|
||||||
|
url: encodeURIComponent(this.url)
|
||||||
|
}),
|
||||||
|
success: () => {
|
||||||
|
this.fnOnChange(false)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fnOnChange(e) {
|
||||||
|
this.isShow = false;
|
||||||
|
this.$emit('on-change', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
</style>
|
||||||
+23
-1
@@ -4,6 +4,7 @@ export const _AppMockJsonKey = 'APP_GLOBAL_MOCK_JSON';
|
|||||||
|
|
||||||
// 默认的应用设置
|
// 默认的应用设置
|
||||||
export const DefaultAppConfigs = {
|
export const DefaultAppConfigs = {
|
||||||
|
basicConfig: {},
|
||||||
loveConfig: {},
|
loveConfig: {},
|
||||||
imagesConfig: {},
|
imagesConfig: {},
|
||||||
authorConfig: {},
|
authorConfig: {},
|
||||||
@@ -12,7 +13,28 @@ export const DefaultAppConfigs = {
|
|||||||
toolsPlugin: {},
|
toolsPlugin: {},
|
||||||
linksSubmitPlugin: {},
|
linksSubmitPlugin: {},
|
||||||
},
|
},
|
||||||
pageConfig: {}
|
pageConfig: {
|
||||||
|
homeConfig: {
|
||||||
|
pageTitle: "首页",
|
||||||
|
useCategory: true,
|
||||||
|
bannerConfig: {
|
||||||
|
enabled: true,
|
||||||
|
showTitle: true,
|
||||||
|
showIndicator: true,
|
||||||
|
height: "400rpx",
|
||||||
|
dotPosition: "right",
|
||||||
|
type: "post",
|
||||||
|
list: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
auditConfig: {
|
||||||
|
auditModeEnabled: false,
|
||||||
|
auditModeData: {
|
||||||
|
jsonUrl: "",
|
||||||
|
jsonData: ""
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import Vue from "vue";
|
|||||||
// 挂载全局工具类
|
// 挂载全局工具类
|
||||||
import utils from "./utils/index.js";
|
import utils from "./utils/index.js";
|
||||||
Vue.prototype.$utils = utils;
|
Vue.prototype.$utils = utils;
|
||||||
|
uni.$utils = utils;
|
||||||
|
|
||||||
// 全局统一样式的对话框
|
// 全局统一样式的对话框
|
||||||
import Fy from '@/js_sdk/fy-showModal/index.js'
|
import Fy from '@/js_sdk/fy-showModal/index.js'
|
||||||
|
|||||||
@@ -31,8 +31,15 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// 获取mockjson
|
// 获取mockjson
|
||||||
if (res.basicConfig.auditModeEnabled) {
|
if (res.auditConfig.auditModeEnabled) {
|
||||||
await uni.$tm.vx.actions('config/fetchMockJson')
|
if (res.auditConfig.auditModeData.jsonUrl) {
|
||||||
|
await uni.$tm.vx.actions('config/fetchMockJson')
|
||||||
|
} else {
|
||||||
|
const mockJson = uni.$utils.checkJsonAndParse(res.auditConfig.auditModeData.jsonData)
|
||||||
|
if (mockJson.ok) {
|
||||||
|
uni.$tm.vx.commit('config/setMockJson', mockJson.jsonData)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 进入检查
|
// 进入检查
|
||||||
|
|||||||
@@ -152,7 +152,9 @@ export default {
|
|||||||
},
|
},
|
||||||
copyrightConfig() {
|
copyrightConfig() {
|
||||||
return this.haloConfigs.basicConfig.copyrightConfig;
|
return this.haloConfigs.basicConfig.copyrightConfig;
|
||||||
}
|
}, calcAuditModeEnabled() {
|
||||||
|
return this.haloConfigs.auditConfig.auditModeEnabled
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
haloConfigs: {
|
haloConfigs: {
|
||||||
@@ -180,10 +182,10 @@ export default {
|
|||||||
this.navList = [
|
this.navList = [
|
||||||
{
|
{
|
||||||
key: 'archives',
|
key: 'archives',
|
||||||
title: this.haloConfigs.basicConfig.auditModeEnabled ? '内容归档' : '文章归档',
|
title: this.calcAuditModeEnabled ? '内容归档' : '文章归档',
|
||||||
leftIcon: 'halocoloricon-classify',
|
leftIcon: 'halocoloricon-classify',
|
||||||
leftIconColor: 'red',
|
leftIconColor: 'red',
|
||||||
rightText: this.haloConfigs.basicConfig.auditModeEnabled ? '已归档的内容' : '已归档的文章',
|
rightText: this.calcAuditModeEnabled ? '已归档的内容' : '已归档的文章',
|
||||||
path: '/pagesA/archives/archives',
|
path: '/pagesA/archives/archives',
|
||||||
isAdmin: false,
|
isAdmin: false,
|
||||||
type: 'page',
|
type: 'page',
|
||||||
@@ -396,7 +398,7 @@ export default {
|
|||||||
url: '/pagesC/website/website?data=' +
|
url: '/pagesC/website/website?data=' +
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
title: item.text || this.$haloConfig.title,
|
title: item.text || this.$haloConfig.title,
|
||||||
url: item.path
|
url: encodeURIComponent(item.path)
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<view class="catgory-card" :style="{backgroundImage:`url(${item.spec.cover})`}">
|
<view class="catgory-card" :style="{backgroundImage:`url(${item.spec.cover})`}">
|
||||||
<view class="content" @click="handleToCategory(item)">
|
<view class="content" @click="handleToCategory(item)">
|
||||||
<view style="font-size: 32rpx;color: #ffffff;">{{ item.spec.displayName }}</view>
|
<view style="font-size: 32rpx;color: #ffffff;">{{ item.spec.displayName }}</view>
|
||||||
<view v-if="!haloConfigs.basicConfig.auditModeEnabled" style="font-size: 24rpx;color: #ffffff;margin-top: 6rpx;">
|
<view v-if="!calcAuditModeEnabled" style="font-size: 24rpx;color: #ffffff;margin-top: 6rpx;">
|
||||||
共 {{ item.postCount }} 篇文章
|
共 {{ item.postCount }} 篇文章
|
||||||
</view>
|
</view>
|
||||||
<view v-else style="font-size: 24rpx;color: #ffffff;margin-top: 6rpx;">
|
<view v-else style="font-size: 24rpx;color: #ffffff;margin-top: 6rpx;">
|
||||||
@@ -73,6 +73,9 @@ export default {
|
|||||||
haloConfigs() {
|
haloConfigs() {
|
||||||
return this.$tm.vx.getters().getConfigs;
|
return this.$tm.vx.getters().getConfigs;
|
||||||
},
|
},
|
||||||
|
calcAuditModeEnabled(){
|
||||||
|
return this.haloConfigs.auditConfig.auditModeEnabled
|
||||||
|
},
|
||||||
mockJson() {
|
mockJson() {
|
||||||
return this.$tm.vx.getters().getMockJson;
|
return this.$tm.vx.getters().getMockJson;
|
||||||
}
|
}
|
||||||
@@ -87,7 +90,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onReachBottom(e) {
|
onReachBottom(e) {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '没有更多数据了'
|
title: '没有更多数据了'
|
||||||
@@ -107,7 +110,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fnGetData() {
|
fnGetData() {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
this.dataList = this.mockJson.category.list.map((item) => {
|
this.dataList = this.mockJson.category.list.map((item) => {
|
||||||
return {
|
return {
|
||||||
metadata: {
|
metadata: {
|
||||||
@@ -176,7 +179,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleToCategory(data) {
|
handleToCategory(data) {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
@@ -100,7 +100,10 @@ export default {
|
|||||||
},
|
},
|
||||||
mockJson() {
|
mockJson() {
|
||||||
return this.$tm.vx.getters().getMockJson;
|
return this.$tm.vx.getters().getMockJson;
|
||||||
}
|
},
|
||||||
|
calcAuditModeEnabled(){
|
||||||
|
return this.haloConfigs.auditConfig.auditModeEnabled
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
galleryConfig: {
|
galleryConfig: {
|
||||||
@@ -120,7 +123,7 @@ export default {
|
|||||||
this.fnGetData(true);
|
this.fnGetData(true);
|
||||||
},
|
},
|
||||||
onReachBottom(e) {
|
onReachBottom(e) {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '没有更多数据了'
|
title: '没有更多数据了'
|
||||||
@@ -148,7 +151,7 @@ export default {
|
|||||||
this.fnGetData(true);
|
this.fnGetData(true);
|
||||||
},
|
},
|
||||||
fnGetCategory() {
|
fnGetCategory() {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
this.fnGetData(true);
|
this.fnGetData(true);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -169,7 +172,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
fnGetData(isClearWaterfall = false) {
|
fnGetData(isClearWaterfall = false) {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
this.dataList = this.mockJson.gallery.list.map(item => {
|
this.dataList = this.mockJson.gallery.list.map(item => {
|
||||||
return {
|
return {
|
||||||
metadata: {
|
metadata: {
|
||||||
|
|||||||
+98
-37
@@ -21,16 +21,18 @@
|
|||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<view class="bg-white pb-24">
|
<view v-if="bannerConfig.enabled" class="bg-white pb-24">
|
||||||
<view class="banner bg-white ml-24 mr-24 mt-12 round-3" v-if="bannerList.length !== 0">
|
<view class="banner bg-white ml-24 mr-24 mt-12 round-3" v-if="bannerList.length !== 0">
|
||||||
<e-swiper
|
<e-swiper
|
||||||
height="400rpx"
|
:height="bannerConfig.height"
|
||||||
dotPosition="right"
|
:dotPosition="bannerConfig.dotPosition"
|
||||||
:autoplay="true"
|
:autoplay="true"
|
||||||
:useDot="false"
|
:useDot="bannerConfig.showIndicator"
|
||||||
:list="bannerList"
|
:showTitle="bannerConfig.showTitle"
|
||||||
|
:type="bannerConfig.type"
|
||||||
|
:list="bannerList"
|
||||||
@on-click="fnOnBannerClick"
|
@on-click="fnOnBannerClick"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 精品分类 -->
|
<!-- 精品分类 -->
|
||||||
@@ -86,6 +88,11 @@
|
|||||||
icon="icon-angle-up"></tm-flotbutton>
|
icon="icon-angle-up"></tm-flotbutton>
|
||||||
</block>
|
</block>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 弹窗 -->
|
||||||
|
<NotifyDialog v-if="notify.show" :show="notify.show" :title="notify.data.title" :content="notify.data.content"
|
||||||
|
:url="notify.data.url" @on-change="fnOnNotifyChange"></NotifyDialog>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -98,6 +105,7 @@ import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';
|
|||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
|
|
||||||
import eSwiper from '@/components/e-swiper/e-swiper.vue';
|
import eSwiper from '@/components/e-swiper/e-swiper.vue';
|
||||||
|
import NotifyDialog from "@/components/notify-dialog/notify-dialog.vue";
|
||||||
import qs from 'qs'
|
import qs from 'qs'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -108,7 +116,8 @@ export default {
|
|||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
tmIcons,
|
tmIcons,
|
||||||
tmEmpty,
|
tmEmpty,
|
||||||
eSwiper
|
eSwiper,
|
||||||
|
NotifyDialog
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -126,6 +135,10 @@ export default {
|
|||||||
noticeList: [],
|
noticeList: [],
|
||||||
articleList: [],
|
articleList: [],
|
||||||
categoryList: [],
|
categoryList: [],
|
||||||
|
notify: {
|
||||||
|
show: false,
|
||||||
|
data: {}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -145,14 +158,20 @@ export default {
|
|||||||
mockJson() {
|
mockJson() {
|
||||||
return this.$tm.vx.getters().getMockJson;
|
return this.$tm.vx.getters().getMockJson;
|
||||||
},
|
},
|
||||||
|
calcAuditModeEnabled() {
|
||||||
|
return this.haloConfigs.auditConfig.auditModeEnabled
|
||||||
|
},
|
||||||
calcIsShowCategory() {
|
calcIsShowCategory() {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled && this.categoryList.length !== 0) {
|
if (this.calcAuditModeEnabled && this.categoryList.length !== 0) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return this.haloConfigs.pageConfig.homeConfig.useCategory
|
return this.haloConfigs.pageConfig.homeConfig.useCategory
|
||||||
|
},
|
||||||
|
bannerConfig() {
|
||||||
|
return this.haloConfigs.pageConfig.homeConfig.bannerConfig
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@@ -167,7 +186,7 @@ export default {
|
|||||||
this.fnQuery();
|
this.fnQuery();
|
||||||
},
|
},
|
||||||
onReachBottom(e) {
|
onReachBottom(e) {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '没有更多数据了'
|
title: '没有更多数据了'
|
||||||
@@ -187,13 +206,12 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fnQuery() {
|
fnQuery() {
|
||||||
console.log('this.mockJson', this.mockJson)
|
|
||||||
this.fnGetBanner();
|
this.fnGetBanner();
|
||||||
this.fnGetArticleList();
|
this.fnGetArticleList();
|
||||||
this.fnGetCategoryList();
|
this.fnGetCategoryList();
|
||||||
},
|
},
|
||||||
fnGetCategoryList() {
|
fnGetCategoryList() {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
this.categoryList = this.mockJson.home.categoryList.map((item) => {
|
this.categoryList = this.mockJson.home.categoryList.map((item) => {
|
||||||
return {
|
return {
|
||||||
metadata: {
|
metadata: {
|
||||||
@@ -215,8 +233,8 @@ export default {
|
|||||||
|
|
||||||
this.$httpApi.v2
|
this.$httpApi.v2
|
||||||
.getCategoryList({
|
.getCategoryList({
|
||||||
fieldSelector:['spec.hideFromList=false']
|
fieldSelector: ['spec.hideFromList=false']
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.categoryList = res.items.sort((a, b) => {
|
this.categoryList = res.items.sort((a, b) => {
|
||||||
return b.postCount - a.postCount;
|
return b.postCount - a.postCount;
|
||||||
@@ -239,7 +257,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取轮播图
|
// 获取轮播图
|
||||||
fnGetBanner() {
|
fnGetBanner() {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
this.bannerList = this.mockJson.home.bannerList.map((item) => {
|
this.bannerList = this.mockJson.home.bannerList.map((item) => {
|
||||||
return {
|
return {
|
||||||
mp4: '',
|
mp4: '',
|
||||||
@@ -250,27 +268,37 @@ export default {
|
|||||||
createTime: item.time,
|
createTime: item.time,
|
||||||
title: item.title,
|
title: item.title,
|
||||||
src: this.$utils.checkThumbnailUrl(item.cover),
|
src: this.$utils.checkThumbnailUrl(item.cover),
|
||||||
image: this.$utils.checkThumbnailUrl(item.cover)
|
image: this.$utils.checkThumbnailUrl(item.cover),
|
||||||
|
type: "custom",
|
||||||
|
content: "",
|
||||||
|
url: ""
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const _this = this;
|
|
||||||
const _format = function (list) {
|
|
||||||
return list.map((item, index) => {
|
if (!this.bannerConfig.enabled) return;
|
||||||
|
|
||||||
|
if (this.bannerConfig.type === 'custom') {
|
||||||
|
this.bannerList = this.bannerConfig.list.map((item) => {
|
||||||
return {
|
return {
|
||||||
mp4: '',
|
mp4: '',
|
||||||
id: item.metadata.name,
|
id: Date.now() * Math.random(),
|
||||||
nickname: item.owner.displayName,
|
nickname: this.haloConfigs.authorConfig.blogger.nickname,
|
||||||
avatar: _this.$utils.checkAvatarUrl(item.owner.avatar),
|
avatar: this.$utils.checkAvatarUrl(this.haloConfigs.authorConfig.blogger.avatar),
|
||||||
address: '',
|
address: '',
|
||||||
createTime: uni.$tm.dayjs(item.spec.publishTime).fromNow(),
|
createTime: "",
|
||||||
title: item.spec.title,
|
title: item.title,
|
||||||
src: _this.$utils.checkThumbnailUrl(item.spec.cover),
|
src: this.$utils.checkThumbnailUrl(item.cover),
|
||||||
image: _this.$utils.checkThumbnailUrl(item.spec.cover)
|
image: this.$utils.checkThumbnailUrl(item.cover),
|
||||||
};
|
type: "custom",
|
||||||
});
|
content: item.content,
|
||||||
};
|
url: item.url
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const paramsStr = qs.stringify(this.queryParams, {
|
const paramsStr = qs.stringify(this.queryParams, {
|
||||||
allowDots: true,
|
allowDots: true,
|
||||||
@@ -283,20 +311,53 @@ export default {
|
|||||||
url: this.$baseApiUrl + '/apis/api.content.halo.run/v1alpha1/posts?' + paramsStr,
|
url: this.$baseApiUrl + '/apis/api.content.halo.run/v1alpha1/posts?' + paramsStr,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
this.bannerList = _format(res.data.items);
|
this.bannerList = res.data.items.map((item, index) => {
|
||||||
|
return {
|
||||||
|
mp4: '',
|
||||||
|
id: item.metadata.name,
|
||||||
|
nickname: item.owner.displayName,
|
||||||
|
avatar: this.$utils.checkAvatarUrl(item.owner.avatar),
|
||||||
|
address: '',
|
||||||
|
createTime: uni.$tm.dayjs(item.spec.publishTime).fromNow(),
|
||||||
|
title: item.spec.title,
|
||||||
|
src: this.$utils.checkThumbnailUrl(item.spec.cover),
|
||||||
|
image: this.$utils.checkThumbnailUrl(item.spec.cover),
|
||||||
|
type: "post",
|
||||||
|
content: item.status.excerpt,
|
||||||
|
url: ""
|
||||||
|
};
|
||||||
|
});
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
fnOnBannerChange(e) {
|
fnOnNotifyChange(e) {
|
||||||
this.bannerCurrent = e.current;
|
this.notify.show = e;
|
||||||
},
|
},
|
||||||
fnOnBannerClick(item) {
|
fnOnBannerClick(item) {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (item.type === 'custom') {
|
||||||
|
if (item.content) {
|
||||||
|
this.notify.data = item
|
||||||
|
this.notify.show = true
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (uni.$utils.checkIsUrl(item.url)) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesC/website/website?data=' +
|
||||||
|
JSON.stringify({
|
||||||
|
title: item.title || "加载中...",
|
||||||
|
url: encodeURIComponent(item.url)
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (item.id === '') return;
|
if (item.id === '') return;
|
||||||
this.fnToArticleDetail({
|
this.fnToArticleDetail({
|
||||||
metadata: {
|
metadata: {
|
||||||
@@ -306,7 +367,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 文章列表
|
// 文章列表
|
||||||
fnGetArticleList() {
|
fnGetArticleList() {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
this.articleList = this.mockJson.home.postList.map((item) => {
|
this.articleList = this.mockJson.home.postList.map((item) => {
|
||||||
return {
|
return {
|
||||||
metadata: {
|
metadata: {
|
||||||
@@ -371,7 +432,7 @@ export default {
|
|||||||
},
|
},
|
||||||
//跳转文章详情
|
//跳转文章详情
|
||||||
fnToArticleDetail(article) {
|
fnToArticleDetail(article) {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -409,7 +470,7 @@ export default {
|
|||||||
|
|
||||||
// 根据slug查询分类下的文章
|
// 根据slug查询分类下的文章
|
||||||
fnToCategoryBy(category) {
|
fnToCategoryBy(category) {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
@@ -107,7 +107,10 @@ export default {
|
|||||||
},
|
},
|
||||||
mockJson() {
|
mockJson() {
|
||||||
return this.$tm.vx.getters().getMockJson;
|
return this.$tm.vx.getters().getMockJson;
|
||||||
}
|
},
|
||||||
|
calcAuditModeEnabled() {
|
||||||
|
return this.haloConfigs.auditConfig.auditModeEnabled
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@@ -120,7 +123,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onReachBottom(e) {
|
onReachBottom(e) {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '没有更多数据了'
|
title: '没有更多数据了'
|
||||||
@@ -140,7 +143,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fnGetData() {
|
fnGetData() {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
this.dataList = this.mockJson.moments.list.map((item) => {
|
this.dataList = this.mockJson.moments.list.map((item) => {
|
||||||
return {
|
return {
|
||||||
metadata: {
|
metadata: {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<!-- 加载完成区域 -->
|
<!-- 加载完成区域 -->
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<view v-if="dataList.length === 0" class="list-empty flex flex-center">
|
<view v-if="dataList.length === 0" class="list-empty flex flex-center">
|
||||||
<tm-empty v-if="haloConfigs.basicConfig.auditModeEnabled" icon="icon-shiliangzhinengduixiang-" label="暂无归档的内容"></tm-empty>
|
<tm-empty v-if="calcAuditModeEnabled" icon="icon-shiliangzhinengduixiang-" label="暂无归档的内容"></tm-empty>
|
||||||
<tm-empty v-else icon="icon-shiliangzhinengduixiang-" label="暂无归档的文章"></tm-empty>
|
<tm-empty v-else icon="icon-shiliangzhinengduixiang-" label="暂无归档的文章"></tm-empty>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="e-timeline tm-timeline mt-24">
|
<view v-else class="e-timeline tm-timeline mt-24">
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<view class="flex time text-weight-b mb-24">
|
<view class="flex time text-weight-b mb-24">
|
||||||
<text>{{ item.year }}年</text>
|
<text>{{ item.year }}年</text>
|
||||||
<text v-if="tab.activeIndex === 0">{{ item.month }}月</text>
|
<text v-if="tab.activeIndex === 0">{{ item.month }}月</text>
|
||||||
<view v-if="haloConfigs.basicConfig.auditModeEnabled" class="text-size-s text-grey-darken-1 ml-12">
|
<view v-if="calcAuditModeEnabled" class="text-size-s text-grey-darken-1 ml-12">
|
||||||
(共 {{ item.posts.length }} 篇内容)
|
(共 {{ item.posts.length }} 篇内容)
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="text-size-s text-grey-darken-1 ml-12">
|
<view v-else class="text-size-s text-grey-darken-1 ml-12">
|
||||||
@@ -128,7 +128,10 @@ export default {
|
|||||||
},
|
},
|
||||||
mockJson() {
|
mockJson() {
|
||||||
return this.$tm.vx.getters().getMockJson;
|
return this.$tm.vx.getters().getMockJson;
|
||||||
}
|
},
|
||||||
|
calcAuditModeEnabled() {
|
||||||
|
return this.haloConfigs.auditConfig.auditModeEnabled
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
@@ -139,7 +142,7 @@ export default {
|
|||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
},
|
},
|
||||||
onReachBottom(e) {
|
onReachBottom(e) {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '没有更多数据了'
|
title: '没有更多数据了'
|
||||||
@@ -165,7 +168,7 @@ export default {
|
|||||||
this.fnToTopPage();
|
this.fnToTopPage();
|
||||||
},
|
},
|
||||||
fnGetData() {
|
fnGetData() {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
const dataList = this.mockJson.archives.list.map(item => {
|
const dataList = this.mockJson.archives.list.map(item => {
|
||||||
const date = new Date(item.time)
|
const date = new Date(item.time)
|
||||||
const year = date.getFullYear()
|
const year = date.getFullYear()
|
||||||
@@ -353,7 +356,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
fnToArticleDetail(article) {
|
fnToArticleDetail(article) {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
@@ -1067,7 +1067,7 @@ export default {
|
|||||||
url: '/pagesC/website/website?data=' +
|
url: '/pagesC/website/website?data=' +
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
title: data.title,
|
title: data.title,
|
||||||
url: data.url
|
url: encodeURIComponent(data.url)
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -85,9 +85,12 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
haloConfigs() {
|
haloConfigs() {
|
||||||
return this.$tm.vx.getters().getConfigs;
|
return this.$tm.vx.getters().getConfigs;
|
||||||
},
|
},
|
||||||
|
calcAuditModeEnabled() {
|
||||||
|
return this.haloConfigs.auditConfig.auditModeEnabled
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fnSetPageTitle('内容搜索');
|
this.fnSetPageTitle('内容搜索');
|
||||||
@@ -130,11 +133,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
fnGetData() {
|
fnGetData() {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 设置状态为加载中
|
// 设置状态为加载中
|
||||||
this.loading = 'loading';
|
this.loading = 'loading';
|
||||||
this.$httpApi.v2
|
this.$httpApi.v2
|
||||||
.getPostListByKeyword(this.queryParams)
|
.getPostListByKeyword(this.queryParams)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
|||||||
@@ -166,7 +166,10 @@ export default {
|
|||||||
}
|
}
|
||||||
return 'https://image.thum.io/get/width/1000/crop/800/' + val;
|
return 'https://image.thum.io/get/width/1000/crop/800/' + val;
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
|
calcAuditModeEnabled() {
|
||||||
|
return this.haloConfigs.auditConfig.auditModeEnabled
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.fnSetPageTitle('友情链接');
|
this.fnSetPageTitle('友情链接');
|
||||||
@@ -210,8 +213,8 @@ export default {
|
|||||||
return this.linkGroupList.find(item => item.metadata.name === groupName)?.spec?.displayName || groupName || "未分组"
|
return this.linkGroupList.find(item => item.metadata.name === groupName)?.spec?.displayName || groupName || "未分组"
|
||||||
},
|
},
|
||||||
fnGetData() {
|
fnGetData() {
|
||||||
if (this.haloConfigs.basicConfig.auditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.isLoadMore) {
|
if (!this.isLoadMore) {
|
||||||
this.loading = 'loading';
|
this.loading = 'loading';
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
const {title, url} = JSON.parse(e.query.data);
|
const {title, url} = JSON.parse(e.query.data);
|
||||||
this.webUrl = url;
|
this.webUrl = decodeURIComponent(url);
|
||||||
this.fnSetPageTitle(title);
|
if (title) {
|
||||||
|
this.fnSetPageTitle(title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -15,13 +15,13 @@
|
|||||||
<!-- <view class="tm-poup-wk bottom">{{ show ? 'on' : 'off'}}</view> -->
|
<!-- <view class="tm-poup-wk bottom">{{ show ? 'on' : 'off'}}</view> -->
|
||||||
<scroll-view :animation="aniData" @click.stop.prevent="" class="tm-poup-wk dhshiKa" scroll-y="true" :class="[
|
<scroll-view :animation="aniData" @click.stop.prevent="" class="tm-poup-wk dhshiKa" scroll-y="true" :class="[
|
||||||
position_sv == 'top'?'round-b-' + round:'',
|
position_sv == 'top'?'round-b-' + round:'',
|
||||||
position_sv == 'bottom'?'round-t-' + round:'',
|
position_sv == 'bottom'?'round-t-' + round:'',
|
||||||
position_sv, aniOn ? 'on ' : 'off',
|
position_sv, aniOn ? 'on ' : 'off',
|
||||||
black_tmeme ? 'grey-darken-5 bk' : bgColor
|
black_tmeme ? 'grey-darken-5 bk' : bgColor
|
||||||
]" :style="{
|
]" :style="{
|
||||||
width: (position_sv == 'top' || position_sv == 'bottom') ? '100%' : width_w,
|
width: (position_sv == 'top' || position_sv == 'bottom') ? '100%' : width_w,
|
||||||
height: position_sv == 'right' || position_sv == 'left' ?'100%' : height_h,
|
height: position_sv == 'right' || position_sv == 'left' ?'100%' : height_h,
|
||||||
|
|
||||||
}">
|
}">
|
||||||
<view :class="[clssStyle]" >
|
<view :class="[clssStyle]" >
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
dhshiKa:true,//是否结束动画
|
dhshiKa:true,//是否结束动画
|
||||||
aniData:null,
|
aniData:null,
|
||||||
timdiiid:6369784254,
|
timdiiid:6369784254,
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
deactivated() {
|
deactivated() {
|
||||||
@@ -198,7 +198,7 @@
|
|||||||
this.close();
|
this.close();
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
let t = this;
|
let t = this;
|
||||||
clearTimeout(this.timdiiid)
|
clearTimeout(this.timdiiid)
|
||||||
this.dhshiKa=false;
|
this.dhshiKa=false;
|
||||||
t.aniOn=false;
|
t.aniOn=false;
|
||||||
@@ -213,18 +213,18 @@
|
|||||||
open() {
|
open() {
|
||||||
let t = this;
|
let t = this;
|
||||||
clearTimeout(this.timdiiid)
|
clearTimeout(this.timdiiid)
|
||||||
|
|
||||||
|
|
||||||
this.dhshiKa=false
|
this.dhshiKa=false
|
||||||
this.aniOn=true;
|
this.aniOn=true;
|
||||||
|
|
||||||
this.createBtT(this.position_sv,'on').then(()=>{
|
this.createBtT(this.position_sv,'on').then(()=>{
|
||||||
t.dhshiKa=true
|
t.dhshiKa=true
|
||||||
|
|
||||||
t.isclick=false
|
t.isclick=false
|
||||||
// console.log('on');
|
// console.log('on');
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
//下至上。
|
//下至上。
|
||||||
createBtT(pos,type){
|
createBtT(pos,type){
|
||||||
@@ -239,60 +239,60 @@
|
|||||||
if(type=='on'){
|
if(type=='on'){
|
||||||
aniData.translateY('0%').step();
|
aniData.translateY('0%').step();
|
||||||
this.aniData = aniData.export()
|
this.aniData = aniData.export()
|
||||||
|
|
||||||
}
|
}
|
||||||
if(type=='off'){
|
if(type=='off'){
|
||||||
aniData.translateY('100%').step();
|
aniData.translateY('100%').step();
|
||||||
this.aniData = aniData.export()
|
this.aniData = aniData.export()
|
||||||
|
|
||||||
}
|
}
|
||||||
}else if(pos=='top'){
|
}else if(pos=='top'){
|
||||||
if(type=='on'){
|
if(type=='on'){
|
||||||
aniData.translateY('0%').step();
|
aniData.translateY('0%').step();
|
||||||
this.aniData = aniData.export()
|
this.aniData = aniData.export()
|
||||||
|
|
||||||
}
|
}
|
||||||
if(type=='off'){
|
if(type=='off'){
|
||||||
aniData.translateY('-100%').step();
|
aniData.translateY('-100%').step();
|
||||||
this.aniData = aniData.export()
|
this.aniData = aniData.export()
|
||||||
|
|
||||||
}
|
}
|
||||||
}else if(pos=='left'){
|
}else if(pos=='left'){
|
||||||
if(type=='on'){
|
if(type=='on'){
|
||||||
aniData.translateX('0%').step();
|
aniData.translateX('0%').step();
|
||||||
this.aniData = aniData.export()
|
this.aniData = aniData.export()
|
||||||
|
|
||||||
}
|
}
|
||||||
if(type=='off'){
|
if(type=='off'){
|
||||||
aniData.translateX('-100%').step();
|
aniData.translateX('-100%').step();
|
||||||
this.aniData = aniData.export()
|
this.aniData = aniData.export()
|
||||||
|
|
||||||
}
|
}
|
||||||
}else if(pos=='right'){
|
}else if(pos=='right'){
|
||||||
if(type=='on'){
|
if(type=='on'){
|
||||||
aniData.translateX('0%').step();
|
aniData.translateX('0%').step();
|
||||||
this.aniData = aniData.export()
|
this.aniData = aniData.export()
|
||||||
|
|
||||||
}
|
}
|
||||||
if(type=='off'){
|
if(type=='off'){
|
||||||
aniData.translateX('100%').step();
|
aniData.translateX('100%').step();
|
||||||
this.aniData = aniData.export()
|
this.aniData = aniData.export()
|
||||||
|
|
||||||
}
|
}
|
||||||
}else if(pos=='center'){
|
}else if(pos=='center'){
|
||||||
|
|
||||||
if(type=='on'){
|
if(type=='on'){
|
||||||
aniData.opacity(1).scale(1).step();
|
aniData.opacity(1).scale(1).step();
|
||||||
this.aniData = aniData.export()
|
this.aniData = aniData.export()
|
||||||
|
|
||||||
}
|
}
|
||||||
if(type=='off'){
|
if(type=='off'){
|
||||||
aniData.opacity(0).scale(0.6).step();
|
aniData.opacity(0).scale(0.6).step();
|
||||||
this.aniData = aniData.export()
|
this.aniData = aniData.export()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise(res=>{
|
return new Promise(res=>{
|
||||||
t.timdiiid = setTimeout(()=>{
|
t.timdiiid = setTimeout(()=>{
|
||||||
t.aniData = null;
|
t.aniData = null;
|
||||||
@@ -319,7 +319,7 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
||||||
&.isClickbled {
|
&.isClickbled {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
@@ -346,7 +346,7 @@
|
|||||||
transform: translateY(100%);
|
transform: translateY(100%);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.top {
|
&.top {
|
||||||
@@ -382,7 +382,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
|
|
||||||
|
|
||||||
.tm-poup-wk {
|
.tm-poup-wk {
|
||||||
position: static;
|
position: static;
|
||||||
|
|||||||
@@ -160,6 +160,24 @@ const utils = {
|
|||||||
urls: list,
|
urls: list,
|
||||||
loop: true
|
loop: true
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 检查是否为json字符串
|
||||||
|
* @param {Object} jsonStr 数据源
|
||||||
|
*/
|
||||||
|
checkJsonAndParse(jsonStr) {
|
||||||
|
try {
|
||||||
|
const jsonResult = JSON.parse(jsonStr);
|
||||||
|
return {
|
||||||
|
ok: true,
|
||||||
|
jsonData: jsonResult,
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return {
|
||||||
|
ok: false,
|
||||||
|
jsonData: {},
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user