mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-06-12 13:19:31 +08:00
feat: 添加插件检测
This commit is contained in:
+52
-3
@@ -1,11 +1,15 @@
|
|||||||
/**
|
/**
|
||||||
* 所有的接口
|
* 所有的接口
|
||||||
*/
|
*/
|
||||||
import {getPersonalToken} from '@/utils/token.js'
|
import {
|
||||||
|
getPersonalToken
|
||||||
|
} from '@/utils/token.js'
|
||||||
import HttpHandler from '@/common/http/request.js'
|
import HttpHandler from '@/common/http/request.js'
|
||||||
import qs from 'qs'
|
import qs from 'qs'
|
||||||
|
|
||||||
import {getAppConfigs} from '@/config/index.js'
|
import {
|
||||||
|
getAppConfigs
|
||||||
|
} from '@/config/index.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
/**
|
/**
|
||||||
@@ -241,6 +245,51 @@ export default {
|
|||||||
*/
|
*/
|
||||||
submitUpvote(data) {
|
submitUpvote(data) {
|
||||||
return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/trackers/upvote`, data, {})
|
return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/trackers/upvote`, data, {})
|
||||||
}
|
},
|
||||||
|
|
||||||
|
//----------- 投票 -----------------
|
||||||
|
/**
|
||||||
|
* 获取投票列表
|
||||||
|
*/
|
||||||
|
getVoteList: (params) => {
|
||||||
|
return HttpHandler.Get(`/apis/console.api.vote.kunkunyu.com/v1alpha1/votes`, params, {
|
||||||
|
custom: {
|
||||||
|
personalToken: getPersonalToken()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取投票详情
|
||||||
|
* @param {String} name id
|
||||||
|
*/
|
||||||
|
getVoteDetail: (name) => {
|
||||||
|
return HttpHandler.Get(`/apis/api.vote.kunkunyu.com/v1alpha1/votes/${name}/detail`, {})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取投票用户列表
|
||||||
|
* @param {String} name id
|
||||||
|
*/
|
||||||
|
getVoteUserList: (name) => {
|
||||||
|
return HttpHandler.Get(`/apis/api.vote.kunkunyu.com/v1alpha1/votes/${name}/user-list`, {})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 提交投票
|
||||||
|
* @param {String} name id
|
||||||
|
* @param {Object} { voteData:["选项ID"] } 提交的数据
|
||||||
|
* @param {Boolean} canAnonymously 是否匿名 默认匿名
|
||||||
|
*/
|
||||||
|
submitVote: (name, data, canAnonymously = true) => {
|
||||||
|
return HttpHandler.Post(`/apis/api.vote.kunkunyu.com/v1alpha1/votes/${name}/submit`, data, {
|
||||||
|
custom: {
|
||||||
|
personalToken: canAnonymously ? undefined : getPersonalToken()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 检查是否安装启用插件
|
||||||
|
* @param {String} name 插件id
|
||||||
|
*/
|
||||||
|
checkPluginAvailable: (name) => {
|
||||||
|
return HttpHandler.Get(`/apis/api.plugin.halo.run/v1alpha1/plugins/${name}/available`, {})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
/**
|
||||||
|
* 功能:插件检查
|
||||||
|
*/
|
||||||
|
import {
|
||||||
|
NeedPluginIds,
|
||||||
|
NeedPlugins,
|
||||||
|
checkNeedPluginAvailable
|
||||||
|
} from "@/utils/plugin.js"
|
||||||
|
import PluginUnavailable from '@/components/plugin-unavailable/plugin-unavailable.vue'
|
||||||
|
|
||||||
|
|
||||||
|
const HaloPluginAvailableMixin = {
|
||||||
|
components: {
|
||||||
|
PluginUnavailable
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
NeedPluginIds,
|
||||||
|
NeedPlugins,
|
||||||
|
uniHaloPluginAvailableError: "",
|
||||||
|
uniHaloPluginAvailable: true,
|
||||||
|
uniHaloPluginId: "", // 当前需要的插件
|
||||||
|
uniHaloPluginInfo: "" // 当前插件信息
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 设置插件ID */
|
||||||
|
setPluginId(pluginId) {
|
||||||
|
this.uniHaloPluginId = pluginId
|
||||||
|
this.uniHaloPluginInfo = NeedPlugins.get(pluginId)
|
||||||
|
},
|
||||||
|
/** 检查插件状态 */
|
||||||
|
async checkPluginAvailable(pluginId) {
|
||||||
|
pluginId = pluginId ?? this.uniHaloPluginId
|
||||||
|
if (!pluginId) return false;
|
||||||
|
const available = await checkNeedPluginAvailable(pluginId)
|
||||||
|
this.uniHaloPluginAvailable = available
|
||||||
|
return available
|
||||||
|
},
|
||||||
|
/** 设置错误信息 */
|
||||||
|
setPluginError(text) {
|
||||||
|
this.uniHaloPluginAvailableError = text
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HaloPluginAvailableMixin;
|
||||||
@@ -172,3 +172,170 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 文本省略样式 结束 */
|
/* 文本省略样式 结束 */
|
||||||
|
|
||||||
|
|
||||||
|
// 定义尺寸变量(单位:rpx)
|
||||||
|
$spacing-sizes: (
|
||||||
|
0: 0,
|
||||||
|
2: 4rpx,
|
||||||
|
4: 8rpx,
|
||||||
|
8: 16rpx,
|
||||||
|
12: 24rpx,
|
||||||
|
24: 48rpx,
|
||||||
|
48: 96rpx
|
||||||
|
);
|
||||||
|
|
||||||
|
// 内边距类
|
||||||
|
@each $name, $size in $spacing-sizes {
|
||||||
|
// 全方向内边距:p-{size}
|
||||||
|
.p-#{$name} {
|
||||||
|
padding: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 水平方向内边距:px-{size}
|
||||||
|
.px-#{$name} {
|
||||||
|
padding-left: $size !important;
|
||||||
|
padding-right: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 垂直方向内边距:py-{size}
|
||||||
|
.py-#{$name} {
|
||||||
|
padding-top: $size !important;
|
||||||
|
padding-bottom: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上内边距:pt-{size}
|
||||||
|
.pt-#{$name} {
|
||||||
|
padding-top: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 右内边距:pr-{size}
|
||||||
|
.pr-#{$name} {
|
||||||
|
padding-right: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下内边距:pb-{size}
|
||||||
|
.pb-#{$name} {
|
||||||
|
padding-bottom: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 左内边距:pl-{size}
|
||||||
|
.pl-#{$name} {
|
||||||
|
padding-left: $size !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//外边距工具类
|
||||||
|
@each $name, $size in $spacing-sizes {
|
||||||
|
// 全方向外边距:m-{size}
|
||||||
|
.m-#{$name} {
|
||||||
|
margin: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 水平方向外边距:mx-{size}
|
||||||
|
.mx-#{$name} {
|
||||||
|
margin-left: $size !important;
|
||||||
|
margin-right: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 垂直方向外边距:my-{size}
|
||||||
|
.my-#{$name} {
|
||||||
|
margin-top: $size !important;
|
||||||
|
margin-bottom: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上外边距:mt-{size}
|
||||||
|
.mt-#{$name} {
|
||||||
|
margin-top: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 右外边距:mr-{size}
|
||||||
|
.mr-#{$name} {
|
||||||
|
margin-right: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下外边距:mb-{size}
|
||||||
|
.mb-#{$name} {
|
||||||
|
margin-bottom: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 左外边距:ml-{size}
|
||||||
|
.ml-#{$name} {
|
||||||
|
margin-left: $size !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// gap 类
|
||||||
|
@each $name, $size in $spacing-sizes {
|
||||||
|
// 全方向gap:gap-{size}
|
||||||
|
.gap-#{$name} {
|
||||||
|
gap: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 水平方向gap:gap-x-{size}
|
||||||
|
.gap-x-#{$name} {
|
||||||
|
column-gap: $size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 垂直方向gap:gap-y-{size}
|
||||||
|
.gap-y-#{$name} {
|
||||||
|
row-gap: $size !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.w-full {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h-full {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-col {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-1 {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-shrink-0 {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.items-center {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.items-start {
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.items-end {
|
||||||
|
align-items: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.justify-between {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.justify-around {
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
|
.justify-end {
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.justify-start {
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.justify-center {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-page">
|
<view class="app-page">
|
||||||
|
<PluginUnavailable v-if="!uniHaloPluginAvailable" :pluginId="uniHaloPluginId"
|
||||||
|
:error-text="uniHaloPluginAvailableError" />
|
||||||
|
<template v-else>
|
||||||
<!-- 顶部切换 -->
|
<!-- 顶部切换 -->
|
||||||
<view class="e-fixed" v-if="category.list.length > 0">
|
<view class="e-fixed" v-if="category.list.length > 0">
|
||||||
<tm-tabs color="light-blue" :shadow="0" v-model="category.activeIndex" range-key="displayName" :list="category.list"
|
<tm-tabs color="light-blue" :shadow="0" v-model="category.activeIndex" range-key="displayName"
|
||||||
align="left" @change="fnOnCategoryChange($event, false)"></tm-tabs>
|
:list="category.list" align="left" @change="fnOnCategoryChange($event, false)"></tm-tabs>
|
||||||
</view>
|
</view>
|
||||||
<!-- 占位区域 -->
|
<!-- 占位区域 -->
|
||||||
<view v-if="category.list.length > 0" style="width: 100vw;height: 90rpx;"></view>
|
<view v-if="category.list.length > 0" style="width: 100vw;height: 90rpx;"></view>
|
||||||
@@ -29,7 +32,8 @@
|
|||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-if="galleryConfig.useWaterfall">
|
<block v-if="galleryConfig.useWaterfall">
|
||||||
<!--瀑布流-->
|
<!--瀑布流-->
|
||||||
<tm-flowLayout-custom ref="wafll" style="width: 100%;" @click="fnOnFlowClick"></tm-flowLayout-custom>
|
<tm-flowLayout-custom ref="wafll" style="width: 100%;"
|
||||||
|
@click="fnOnFlowClick"></tm-flowLayout-custom>
|
||||||
</block>
|
</block>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<block v-else>
|
<block v-else>
|
||||||
@@ -38,7 +42,7 @@
|
|||||||
animation-name="fadeUp" :wait="calcAniWait(index)">
|
animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<view style="border-radius: 12rpx;overflow: hidden;width: 100%;height: 250rpx;">
|
<view style="border-radius: 12rpx;overflow: hidden;width: 100%;height: 250rpx;">
|
||||||
<image style="width: 100%;height: 100%;" mode="aspectFill" :src="item.spec.url"
|
<image style="width: 100%;height: 100%;" mode="aspectFill" :src="item.spec.url"
|
||||||
@click="fnPreview(item)"/>
|
@click="fnPreview(item)" />
|
||||||
</view>
|
</view>
|
||||||
</tm-translate>
|
</tm-translate>
|
||||||
</block>
|
</block>
|
||||||
@@ -54,25 +58,29 @@
|
|||||||
<tm-button @click="fnToTopPage" size="m" :fab="true" theme="light-blue"
|
<tm-button @click="fnToTopPage" size="m" :fab="true" theme="light-blue"
|
||||||
icon="icon-angle-up"></tm-button>
|
icon="icon-angle-up"></tm-button>
|
||||||
</view>
|
</view>
|
||||||
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';
|
import tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';
|
||||||
import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue';
|
import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue';
|
||||||
import tmFlowLayoutCustom from '@/tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue';
|
import tmFlowLayoutCustom from '@/tm-vuetify/components/tm-flowLayout-custom/tm-flowLayout-custom.vue';
|
||||||
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
import tmTabs from '@/tm-vuetify/components/tm-tabs/tm-tabs.vue';
|
||||||
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
import tmButton from '@/tm-vuetify/components/tm-button/tm-button.vue';
|
||||||
|
|
||||||
export default {
|
import pluginAvailable from "@/common/mixins/pluginAvailable.js"
|
||||||
|
|
||||||
|
export default {
|
||||||
options: {
|
options: {
|
||||||
multipleSlots: true
|
multipleSlots: true
|
||||||
},
|
},
|
||||||
|
mixins: [pluginAvailable],
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
@@ -103,7 +111,7 @@ export default {
|
|||||||
loadMoreText: '',
|
loadMoreText: '',
|
||||||
hasNext: false,
|
hasNext: false,
|
||||||
dataList: [],
|
dataList: [],
|
||||||
lock:false
|
lock: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -116,13 +124,13 @@ export default {
|
|||||||
mockJson() {
|
mockJson() {
|
||||||
return this.$tm.vx.getters().getMockJson;
|
return this.$tm.vx.getters().getMockJson;
|
||||||
},
|
},
|
||||||
calcAuditModeEnabled(){
|
calcAuditModeEnabled() {
|
||||||
return this.haloConfigs.auditConfig.auditModeEnabled
|
return this.haloConfigs.auditConfig.auditModeEnabled
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
galleryConfig: {
|
galleryConfig: {
|
||||||
handler(newValue, oldValue) {
|
async handler(newValue, oldValue) {
|
||||||
if (!newValue) return;
|
if (!newValue) return;
|
||||||
this.fnSetPageTitle(newValue.pageTitle);
|
this.fnSetPageTitle(newValue.pageTitle);
|
||||||
this.fnGetCategory();
|
this.fnGetCategory();
|
||||||
@@ -131,13 +139,21 @@ export default {
|
|||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async onLoad() {
|
||||||
|
// 检查插件
|
||||||
|
this.setPluginId(this.NeedPluginIds.PluginPhotos)
|
||||||
|
this.setPluginError("阿偶,检测到当前插件没有安装或者启用,无法使用图库功能哦,请联系管理员")
|
||||||
|
await this.checkPluginAvailable()
|
||||||
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
if (!this.uniHaloPluginAvailable) return;
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.isLoadMore = false;
|
this.isLoadMore = false;
|
||||||
this.queryParams.page = 1;
|
this.queryParams.page = 1;
|
||||||
this.fnGetData(true);
|
this.fnGetData(true);
|
||||||
},
|
},
|
||||||
onReachBottom(e) {
|
onReachBottom(e) {
|
||||||
|
if (!this.uniHaloPluginAvailable) return;
|
||||||
if (this.calcAuditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -145,6 +161,7 @@ export default {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.hasNext) {
|
if (this.hasNext) {
|
||||||
this.queryParams.page += 1;
|
this.queryParams.page += 1;
|
||||||
this.isLoadMore = true;
|
this.isLoadMore = true;
|
||||||
@@ -157,7 +174,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fnGetDataByCategory(index){
|
fnGetDataByCategory(index) {
|
||||||
this.fnResetSetAniWaitIndex();
|
this.fnResetSetAniWaitIndex();
|
||||||
this.queryParams.group = this.category.list[index].name;
|
this.queryParams.group = this.category.list[index].name;
|
||||||
this.queryParams.page = 1;
|
this.queryParams.page = 1;
|
||||||
@@ -166,7 +183,7 @@ export default {
|
|||||||
this.fnGetData(true);
|
this.fnGetData(true);
|
||||||
},
|
},
|
||||||
fnOnCategoryChange(index) {
|
fnOnCategoryChange(index) {
|
||||||
if(this.lock) {
|
if (this.lock) {
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: "上一个请求进行中...",
|
// title: "上一个请求进行中...",
|
||||||
// icon: "none"
|
// icon: "none"
|
||||||
@@ -190,13 +207,13 @@ export default {
|
|||||||
displayName: item.spec.displayName,
|
displayName: item.spec.displayName,
|
||||||
priority: item.spec.priority
|
priority: item.spec.priority
|
||||||
}
|
}
|
||||||
}).sort((a,b) => a.priority - b.priority);
|
}).sort((a, b) => a.priority - b.priority);
|
||||||
|
|
||||||
if (this.category.list.length !== 0) {
|
if (this.category.list.length !== 0) {
|
||||||
this.queryParams.group = this.category.list[0].name;
|
this.queryParams.group = this.category.list[0].name;
|
||||||
this.fnGetData(true);
|
this.fnGetData(true);
|
||||||
}
|
}
|
||||||
}).catch(e=>{
|
}).catch(e => {
|
||||||
this.loading = 'error'
|
this.loading = 'error'
|
||||||
this.category.list = []
|
this.category.list = []
|
||||||
this.category.activeIndex = 0
|
this.category.activeIndex = 0
|
||||||
@@ -279,7 +296,9 @@ export default {
|
|||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fnOnFlowClick({item}) {
|
fnOnFlowClick({
|
||||||
|
item
|
||||||
|
}) {
|
||||||
this.fnPreview(item)
|
this.fnPreview(item)
|
||||||
},
|
},
|
||||||
// 预览
|
// 预览
|
||||||
@@ -291,39 +310,40 @@ export default {
|
|||||||
loop: true
|
loop: true
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
touchLeft(){
|
touchLeft() {
|
||||||
if(this.loading != "success") return;
|
if (this.loading != "success") return;
|
||||||
this.category.activeIndex += 1
|
this.category.activeIndex += 1
|
||||||
if(this.category.activeIndex >= this.category.list.length){
|
if (this.category.activeIndex >= this.category.list.length) {
|
||||||
this.category.activeIndex = 0
|
this.category.activeIndex = 0
|
||||||
}
|
}
|
||||||
this.lock = true
|
this.lock = true
|
||||||
this.fnGetDataByCategory(this.category.activeIndex)
|
this.fnGetDataByCategory(this.category.activeIndex)
|
||||||
},
|
},
|
||||||
touchRight(){
|
touchRight() {
|
||||||
if(this.loading != "success") return;
|
if (this.loading != "success") return;
|
||||||
this.category.activeIndex -= 1
|
this.category.activeIndex -= 1
|
||||||
if(this.category.activeIndex < 0){
|
if (this.category.activeIndex < 0) {
|
||||||
this.category.activeIndex = 0
|
this.category.activeIndex = 0
|
||||||
}
|
}
|
||||||
this.lock = true
|
this.lock = true
|
||||||
this.fnGetDataByCategory(this.category.activeIndex)
|
this.fnGetDataByCategory(this.category.activeIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding-bottom: 24rpx;
|
padding-bottom: 24rpx;
|
||||||
background-color: #fafafa;
|
background-color: #fafafa;
|
||||||
}
|
}
|
||||||
.content {
|
|
||||||
width:100%;
|
.content {
|
||||||
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@@ -335,26 +355,28 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.touch-listen-content {
|
|
||||||
width:100%;
|
.touch-listen-content {
|
||||||
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 24rpx 24rpx 0;
|
padding: 24rpx 24rpx 0;
|
||||||
gap: 12rpx 0;
|
gap: 12rpx 0;
|
||||||
}
|
}
|
||||||
.loading-wrap {
|
|
||||||
|
.loading-wrap {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 24rpx;
|
padding: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.load-text {
|
.load-text {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.flot-buttons {
|
.flot-buttons {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 100rpx;
|
bottom: 100rpx;
|
||||||
right: 32rpx;
|
right: 32rpx;
|
||||||
@@ -362,5 +384,5 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
gap: 6rpx;
|
gap: 6rpx;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-page">
|
<view class="app-page">
|
||||||
|
<PluginUnavailable v-if="!uniHaloPluginAvailable" :pluginId="uniHaloPluginId"
|
||||||
|
:error-text="uniHaloPluginAvailableError" />
|
||||||
|
<template v-else>
|
||||||
<view v-if="loading !== 'success'" class="loading-wrap">
|
<view v-if="loading !== 'success'" class="loading-wrap">
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
@@ -13,8 +16,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<!-- 卡片 -->
|
<!-- 卡片 -->
|
||||||
<tm-translate v-for="(moment, index) in dataList" :key="moment.metadata.name" animation-name="fadeUp"
|
<tm-translate v-for="(moment, index) in dataList" :key="moment.metadata.name"
|
||||||
:wait="calcAniWait(index)">
|
animation-name="fadeUp" :wait="calcAniWait(index)">
|
||||||
<view class="moment-card">
|
<view class="moment-card">
|
||||||
<view class="head" style="display: flex;align-items: center;">
|
<view class="head" style="display: flex;align-items: center;">
|
||||||
<view class="avatar" style="flex-shrink: 0;">
|
<view class="avatar" style="flex-shrink: 0;">
|
||||||
@@ -39,15 +42,16 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-if="moment.images && moment.images.length!==0" class="images"
|
<view v-if="moment.images && moment.images.length!==0" class="images"
|
||||||
:class="['images-'+moment.images.length]">
|
:class="['images-'+moment.images.length]">
|
||||||
<view class="image-item" v-for="(image,mediumIndex) in moment.images" :key="mediumIndex">
|
<view class="image-item" v-for="(image,mediumIndex) in moment.images"
|
||||||
|
:key="mediumIndex">
|
||||||
<image mode="aspectFill" style="width: 100%;height: 100%;border-radius: 6rpx;"
|
<image mode="aspectFill" style="width: 100%;height: 100%;border-radius: 6rpx;"
|
||||||
:src="image.url" @click="handlePreview(mediumIndex,moment.images)" />
|
:src="image.url" @click="handlePreview(mediumIndex,moment.images)" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="moment.audios && moment.audios.length!==0" class="mb-12"
|
<view v-if="moment.audios && moment.audios.length!==0" class="mb-12"
|
||||||
style="display: flex; flex-direction: column; gap: 12rpx 0;padding: 0 24rpx;padding-right:28rpx;">
|
style="display: flex; flex-direction: column; gap: 12rpx 0;padding: 0 24rpx;padding-right:28rpx;">
|
||||||
<audio v-for="(audio,index) in moment.audios" :controls="true" :key="index" :id="audio.url"
|
<audio v-for="(audio,index) in moment.audios" :controls="true" :key="index"
|
||||||
:poster="bloggerInfo.avatar"
|
:id="audio.url" :poster="bloggerInfo.avatar"
|
||||||
:name="'来自' + (startConfig.title||bloggerInfo.nickname) + '的声音'"
|
:name="'来自' + (startConfig.title||bloggerInfo.nickname) + '的声音'"
|
||||||
:author="bloggerInfo.nickname" :src="audio.url"></audio>
|
:author="bloggerInfo.nickname" :src="audio.url"></audio>
|
||||||
</view>
|
</view>
|
||||||
@@ -74,6 +78,7 @@
|
|||||||
<view class="load-text">{{ loadMoreText }}</view>
|
<view class="load-text">{{ loadMoreText }}</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -92,7 +97,11 @@
|
|||||||
import {
|
import {
|
||||||
generateUUID
|
generateUUID
|
||||||
} from '@/utils/uuid.js';
|
} from '@/utils/uuid.js';
|
||||||
|
|
||||||
|
import pluginAvailable from "@/common/mixins/pluginAvailable.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [pluginAvailable],
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmFlotbutton,
|
tmFlotbutton,
|
||||||
@@ -141,10 +150,16 @@
|
|||||||
return this.haloConfigs.appConfig.startConfig;
|
return this.haloConfigs.appConfig.startConfig;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
async onLoad() {
|
||||||
|
// 检查插件
|
||||||
|
this.setPluginId(this.NeedPluginIds.PluginMoments)
|
||||||
|
this.setPluginError("阿偶,检测到当前插件没有安装或者启用,无法使用瞬间功能哦,请联系管理员")
|
||||||
|
if (!await this.checkPluginAvailable()) return
|
||||||
|
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
if (!this.uniHaloPluginAvailable) return;
|
||||||
this.isLoadMore = false;
|
this.isLoadMore = false;
|
||||||
this.queryParams.page = 0;
|
this.queryParams.page = 0;
|
||||||
this.videoContexts = {};
|
this.videoContexts = {};
|
||||||
@@ -152,6 +167,7 @@
|
|||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
},
|
},
|
||||||
onReachBottom(e) {
|
onReachBottom(e) {
|
||||||
|
if (!this.uniHaloPluginAvailable) return;
|
||||||
if (this.calcAuditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -322,7 +338,9 @@
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
|
box-sizing: border-box;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 24rpx 0;
|
padding: 24rpx 0;
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-page card-shadow">
|
<view class="app-page card-shadow">
|
||||||
|
<PluginUnavailable v-if="!uniHaloPluginAvailable" :pluginId="uniHaloPluginId"
|
||||||
|
:error-text="uniHaloPluginAvailableError" />
|
||||||
|
<template v-else>
|
||||||
<view v-if="loading != 'success'" class="loading-wrap">
|
<view v-if="loading != 'success'" class="loading-wrap">
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
<tm-skeleton model="listAvatr"></tm-skeleton>
|
<tm-skeleton model="listAvatr"></tm-skeleton>
|
||||||
@@ -73,10 +76,12 @@
|
|||||||
<view class="poup pa-36" v-if="detail.data">
|
<view class="poup pa-36" v-if="detail.data">
|
||||||
<view class="info flex">
|
<view class="info flex">
|
||||||
<view class="poup-logo bg-gradient-amber-accent pa-4 shadow-24">
|
<view class="poup-logo bg-gradient-amber-accent pa-4 shadow-24">
|
||||||
<image class="poup-logo_img" :src="$utils.checkImageUrl(detail.data.spec.logo)" mode="aspectFill"></image>
|
<image class="poup-logo_img" :src="$utils.checkImageUrl(detail.data.spec.logo)"
|
||||||
|
mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="pl-24 info-detail">
|
<view class="pl-24 info-detail">
|
||||||
<view class="poup-name text-size-lg text-weight-b">{{ detail.data.spec.displayName }}</view>
|
<view class="poup-name text-size-lg text-weight-b">{{ detail.data.spec.displayName }}
|
||||||
|
</view>
|
||||||
<view class="poup-tag ml--10">
|
<view class="poup-tag ml--10">
|
||||||
<tm-tags color="bg-gradient-light-blue-lighten" size="n" model="fill">
|
<tm-tags color="bg-gradient-light-blue-lighten" size="n" model="fill">
|
||||||
{{ detail.data.spec.groupName }}
|
{{ detail.data.spec.groupName }}
|
||||||
@@ -103,19 +108,23 @@
|
|||||||
|
|
||||||
<view class="load-text">{{ loadMoreText }}</view>
|
<view class="load-text">{{ loadMoreText }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
import tmSkeleton from '@/tm-vuetify/components/tm-skeleton/tm-skeleton.vue';
|
||||||
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
import tmTranslate from '@/tm-vuetify/components/tm-translate/tm-translate.vue';
|
||||||
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
import tmFlotbutton from '@/tm-vuetify/components/tm-flotbutton/tm-flotbutton.vue';
|
||||||
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
import tmTags from '@/tm-vuetify/components/tm-tags/tm-tags.vue';
|
||||||
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
import tmEmpty from '@/tm-vuetify/components/tm-empty/tm-empty.vue';
|
||||||
import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue';
|
import tmImages from '@/tm-vuetify/components/tm-images/tm-images.vue';
|
||||||
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
import tmPoup from '@/tm-vuetify/components/tm-poup/tm-poup.vue';
|
||||||
|
|
||||||
export default {
|
import pluginAvailable from "@/common/mixins/pluginAvailable.js"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [pluginAvailable],
|
||||||
components: {
|
components: {
|
||||||
tmSkeleton,
|
tmSkeleton,
|
||||||
tmTranslate,
|
tmTranslate,
|
||||||
@@ -171,17 +180,23 @@ export default {
|
|||||||
return this.haloConfigs.auditConfig.auditModeEnabled
|
return this.haloConfigs.auditConfig.auditModeEnabled
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad() {
|
async onLoad() {
|
||||||
this.fnSetPageTitle('友情链接');
|
this.fnSetPageTitle('友情链接');
|
||||||
|
// 检查插件
|
||||||
|
this.setPluginId(this.NeedPluginIds.PluginLinks)
|
||||||
|
this.setPluginError("阿偶,检测到当前插件没有安装或者启用,无法使用友情链接功能哦,请联系管理员")
|
||||||
|
if (!await this.checkPluginAvailable()) return
|
||||||
this.fnGetLinkGroupData();
|
this.fnGetLinkGroupData();
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
if (!this.uniHaloPluginAvailable) return;
|
||||||
this.isLoadMore = false;
|
this.isLoadMore = false;
|
||||||
this.queryParams.page = 1;
|
this.queryParams.page = 1;
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.fnGetData();
|
this.fnGetData();
|
||||||
},
|
},
|
||||||
onReachBottom(e) {
|
onReachBottom(e) {
|
||||||
|
if (!this.uniHaloPluginAvailable) return;
|
||||||
if (this.hasNext) {
|
if (this.hasNext) {
|
||||||
this.queryParams.page += 1;
|
this.queryParams.page += 1;
|
||||||
this.isLoadMore = true;
|
this.isLoadMore = true;
|
||||||
@@ -210,7 +225,8 @@ export default {
|
|||||||
},
|
},
|
||||||
findLinkGroupDisplayNameByGroupMetadataName(groupName) {
|
findLinkGroupDisplayNameByGroupMetadataName(groupName) {
|
||||||
if (this.linkGroupList.length === 0) return groupName || "未分组"
|
if (this.linkGroupList.length === 0) return groupName || "未分组"
|
||||||
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.calcAuditModeEnabled) {
|
if (this.calcAuditModeEnabled) {
|
||||||
@@ -228,7 +244,8 @@ export default {
|
|||||||
this.hasNext = res.hasNext;
|
this.hasNext = res.hasNext;
|
||||||
const list = res.items.map(item => {
|
const list = res.items.map(item => {
|
||||||
item.spec.logo = this.$utils.checkAvatarUrl(item.spec?.logo)
|
item.spec.logo = this.$utils.checkAvatarUrl(item.spec?.logo)
|
||||||
item.spec.groupName = this.findLinkGroupDisplayNameByGroupMetadataName(item.spec?.groupName)
|
item.spec.groupName = this.findLinkGroupDisplayNameByGroupMetadataName(item.spec
|
||||||
|
?.groupName)
|
||||||
return item;
|
return item;
|
||||||
})
|
})
|
||||||
this.dataList = this.dataList.concat(list);
|
this.dataList = this.dataList.concat(list);
|
||||||
@@ -304,24 +321,24 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-page {
|
.app-page {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background-color: #fafafd;
|
background-color: #fafafd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading-wrap {
|
.loading-wrap {
|
||||||
padding: 24rpx;
|
padding: 24rpx;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
padding: 0 24rpx;
|
padding: 0 24rpx;
|
||||||
padding-top: 24rpx;
|
padding-top: 24rpx;
|
||||||
|
|
||||||
@@ -331,9 +348,9 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-card {
|
.link-card {
|
||||||
border-bottom: 2rpx solid #f5f5f5;
|
border-bottom: 2rpx solid #f5f5f5;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
|
|
||||||
@@ -377,20 +394,20 @@ export default {
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-card_name {
|
.link-card_name {
|
||||||
// color: #303133;
|
// color: #303133;
|
||||||
// color: #0080fe;
|
// color: #0080fe;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-card_desc {
|
.link-card_desc {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
color: #303133;
|
color: #303133;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-logo {
|
.link-logo {
|
||||||
width: 140rpx;
|
width: 140rpx;
|
||||||
height: 140rpx;
|
height: 140rpx;
|
||||||
|
|
||||||
@@ -398,9 +415,9 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.poup-logo {
|
.poup-logo {
|
||||||
width: 140rpx;
|
width: 140rpx;
|
||||||
height: 140rpx;
|
height: 140rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
@@ -410,22 +427,22 @@ export default {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-detail {
|
.info-detail {
|
||||||
width: 0;
|
width: 0;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poup-desc {
|
.poup-desc {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
color: #555 !important;
|
color: #555 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.preview-site {
|
.preview-site {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 300rpx;
|
height: 300rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
import utils from '@/utils/index.js'
|
||||||
|
import v2Apis from "@/api/v2/all.api.js"
|
||||||
|
|
||||||
|
export const NeedPluginIds = Object.freeze({
|
||||||
|
PluginUniHalo: "plugin-uni-halo",
|
||||||
|
PluginPhotos: "PluginPhotos",
|
||||||
|
PluginLinks: "PluginLinks",
|
||||||
|
PluginMoments: "PluginMoments",
|
||||||
|
PluginSearchWidget: "PluginSearchWidget",
|
||||||
|
PluginCommentWidget: "PluginCommentWidget",
|
||||||
|
PluginVote: "vote",
|
||||||
|
})
|
||||||
|
|
||||||
|
export const NeedPlugins = new Map([
|
||||||
|
[
|
||||||
|
NeedPluginIds.PluginUniHalo, {
|
||||||
|
id: "plugin-uni-halo",
|
||||||
|
name: "UniHalo配置",
|
||||||
|
desc: "uni-halo 核心插件,未安装和启用的情况下,将无法使用 uni-halo,请检查是否已安装和启用。",
|
||||||
|
logo: utils.checkUrl("/plugins/plugin-uni-halo/assets/logo.png"),
|
||||||
|
url: "https://www.halo.run/store/apps/app-ryemX"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
NeedPluginIds.PluginPhotos, {
|
||||||
|
id: "PluginPhotos",
|
||||||
|
name: "图库管理",
|
||||||
|
desc: "图库功能模块所需要的插件,用于展示",
|
||||||
|
logo: utils.checkUrl("/plugins/PluginPhotos/assets/logo.svg"),
|
||||||
|
url: "https://www.halo.run/store/apps/app-BmQJW"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
NeedPluginIds.PluginLinks, {
|
||||||
|
id: "PluginLinks",
|
||||||
|
name: "链接管理",
|
||||||
|
desc: "链接管理模块,用于网站友情链接功能模块。",
|
||||||
|
logo: utils.checkUrl("/plugins/PluginLinks/assets/logo.svg"),
|
||||||
|
url: "https://www.halo.run/store/apps/app-hfbQg"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
NeedPluginIds.PluginMoments, {
|
||||||
|
id: "PluginMoments",
|
||||||
|
name: "瞬间",
|
||||||
|
desc: "提供一个轻量级的内容图文、视频、音频等内容展示。",
|
||||||
|
logo: utils.checkUrl("/plugins/PluginMoments/assets/logo.svg"),
|
||||||
|
url: "https://www.halo.run/store/apps/app-SnwWD"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
NeedPluginIds.PluginSearchWidget, {
|
||||||
|
id: "PluginSearchWidget",
|
||||||
|
name: "搜索组件",
|
||||||
|
desc: "为应用提供统一的搜索组件。",
|
||||||
|
logo: utils.checkUrl("/plugins/PluginSearchWidget/assets/logo.svg"),
|
||||||
|
url: "https://www.halo.run/store/apps/app-DlacW"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
NeedPluginIds.PluginCommentWidget, {
|
||||||
|
id: "PluginCommentWidget",
|
||||||
|
name: "评论组件",
|
||||||
|
desc: "为用户前台提供完整的评论解决方案",
|
||||||
|
logo: utils.checkUrl("/plugins/PluginCommentWidget/assets/logo.svg"),
|
||||||
|
url: "https://www.halo.run/store/apps/app-YXyaD"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
NeedPluginIds.PluginVote, {
|
||||||
|
id: "vote",
|
||||||
|
name: "投票管理",
|
||||||
|
desc: "投票模块所需要的插件,用于展示投票和提交投票",
|
||||||
|
logo: utils.checkUrl("/plugins/vote/assets/logo.png"),
|
||||||
|
url: "https://www.halo.run/store/apps/app-veyvzyhv"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查插件是否启用、安装
|
||||||
|
* @param {String} pluginId 插件id
|
||||||
|
* @return {Boolean} true = 安装、启用 false= 未安装启用
|
||||||
|
*/
|
||||||
|
export const checkNeedPluginAvailable = (pluginId) => {
|
||||||
|
return new Promise(async (resolve) => {
|
||||||
|
try {
|
||||||
|
const available = await v2Apis.checkPluginAvailable(pluginId)
|
||||||
|
resolve(available)
|
||||||
|
} catch (err) {
|
||||||
|
resolve(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user