mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-09-12 16:40:40 +08:00
chore: 批量新增项目依赖、工具函数、页面与组件资源
1. 新增mp-html、qs等生产依赖,补全项目基础库 2. 新增平台判断、缓存、工具函数等通用工具集 3. 新增标签页、网站浏览页、关于页等业务页面 4. 新增分类卡片、通知弹窗等业务组件 5. 新增uts-progressNotification、liu-poster、uhalo-upgrade等uni模块 6. 补充audio/video组件样式补件,修复uni-components路径缺失问题 7. 新增环境变量Halo个人令牌配置项 8. 重构store导出结构,新增appConfig/halo/setting三个状态模块 9. 新增tsconfig编译目标配置,适配更高版本ES语法
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
<script lang="ts" setup>
|
||||
/**
|
||||
* 通知弹窗(源自旧项目 components/notify-dialog,新建复刻)
|
||||
* wd-popup + mp-html 渲染 markdown 内容,可选跳转外链
|
||||
*/
|
||||
import { ref, watch } from 'vue'
|
||||
import { checkIsUrl } from '@/utils/url'
|
||||
import { markdownConfig } from '@/config/markdown'
|
||||
|
||||
const props = defineProps<{
|
||||
show: boolean
|
||||
title: string
|
||||
content: string
|
||||
url: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'on-change', show: boolean): void
|
||||
}>()
|
||||
|
||||
const isShow = ref(props.show)
|
||||
|
||||
watch(() => props.show, (val) => {
|
||||
isShow.value = val
|
||||
})
|
||||
|
||||
function handleOnChange(e: unknown) {
|
||||
isShow.value = false
|
||||
emit('on-change', Boolean(e))
|
||||
}
|
||||
|
||||
function handleToWebview() {
|
||||
if (checkIsUrl(props.url)) {
|
||||
uni.navigateTo({
|
||||
url: `/pages-blog/website/website?data=${JSON.stringify({
|
||||
title: props.title,
|
||||
url: encodeURIComponent(props.url),
|
||||
})}`,
|
||||
success: () => {
|
||||
handleOnChange(false)
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<wd-popup v-model="isShow" width="80vw" position="center" custom-style="border-radius:12rpx;" @close="handleOnChange(false)">
|
||||
<view class="uh-notify-dialog box-border w-[80vw] p-3">
|
||||
<view class="text-overflow-2 mb-6 text-center font-bold">
|
||||
{{ title }}
|
||||
</view>
|
||||
<view class="content-box">
|
||||
<scroll-view scroll-y :style="{ height: url ? '600rpx' : '680rpx' }">
|
||||
<mp-html
|
||||
class="evan-markdown"
|
||||
lazy-load
|
||||
:domain="markdownConfig.domain ?? ''"
|
||||
:loading-img="markdownConfig.loadingGif"
|
||||
scroll-table
|
||||
selectable
|
||||
:tag-style="markdownConfig.tagStyle"
|
||||
:container-style="markdownConfig.containStyle"
|
||||
:content="content"
|
||||
:markdown="true"
|
||||
:show-line-number="true"
|
||||
:show-language-name="true"
|
||||
copy-by-long-press
|
||||
/>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view v-if="url" class="mt-6 flex justify-center">
|
||||
<wd-button size="small" type="primary" @click="handleToWebview">
|
||||
点击跳转内容链接
|
||||
</wd-button>
|
||||
</view>
|
||||
</view>
|
||||
</wd-popup>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.uh-notify-dialog {
|
||||
/* 无额外样式,布局全部由 UnoCSS 原子类实现 */
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user