1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-12 13:19:31 +08:00

update: 调整联系博页面,可在后台配置显示隐藏

This commit is contained in:
小莫唐尼
2024-07-02 18:04:18 +08:00
parent add84f6e4b
commit d9db03959a
3 changed files with 84 additions and 74 deletions
-1
View File
@@ -8,7 +8,6 @@ export const DefaultAppConfigs = {
authorConfig: {}, authorConfig: {},
appConfig: {}, appConfig: {},
pluginConfig: {}, pluginConfig: {},
adConfig: {},
} }
/** /**
+55 -54
View File
@@ -181,37 +181,38 @@ export default {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
_isWx = true; _isWx = true;
// #endif // #endif
this.navList = [{ this.navList = [
key: 'archives', {
title: '文章归档', key: 'archives',
leftIcon: 'halocoloricon-classify', title: '文章归档',
leftIconColor: 'red', leftIcon: 'halocoloricon-classify',
rightText: '已归档的文章', leftIconColor: 'red',
path: '/pagesA/archives/archives', rightText: '已归档的文章',
isAdmin: false, path: '/pagesA/archives/archives',
type: 'page', isAdmin: false,
show: false type: 'page',
}, { show: false
key: 'love', }, {
title: '恋爱日记', key: 'love',
leftIcon: 'halocoloricon-attent', title: '恋爱日记',
leftIconColor: 'red', leftIcon: 'halocoloricon-attent',
rightText: '甜蜜恋人的专属', leftIconColor: 'red',
path: '/pagesA/love/love', rightText: '甜蜜恋人的专属',
isAdmin: false, path: '/pagesA/love/love',
type: 'page', isAdmin: false,
show: this.haloConfigs.loveConfig.loveEnabled type: 'page',
}, { show: this.haloConfigs.loveConfig.loveEnabled
key: 'disclaimers', }, {
title: '友情链接', key: 'disclaimers',
leftIcon: 'icon-lianjie', title: '友情链接',
leftIconColor: 'blue', leftIcon: 'icon-lianjie',
rightText: '看看朋友们吧', leftIconColor: 'blue',
path: '/pagesA/friend-links/friend-links', rightText: '看看朋友们吧',
isAdmin: false, path: '/pagesA/friend-links/friend-links',
type: 'page', isAdmin: false,
show: true type: 'page',
}, show: true
},
{ {
key: 'disclaimers', key: 'disclaimers',
title: '免责声明', title: '免责声明',
@@ -232,7 +233,7 @@ export default {
path: '/pagesA/contact/contact', path: '/pagesA/contact/contact',
isAdmin: false, isAdmin: false,
type: 'page', type: 'page',
show: true show: this.haloConfigs.authorConfig.social.enabled
}, },
{ {
key: 'session', key: 'session',
@@ -291,28 +292,28 @@ export default {
// type: 'poup', // type: 'poup',
// show: true // show: true
// }, // },
{ // {
key: 'setting', // key: 'setting',
title: '应用设置', // title: '应用设置',
leftIcon: 'icon-cog', // leftIcon: 'icon-cog',
leftIconColor: 'indigo', // leftIconColor: 'indigo',
rightText: `进入系统常用设置`, // rightText: `进入系统常用设置`,
path: '/pagesA/setting/setting', // path: '/pagesA/setting/setting',
isAdmin: false, // isAdmin: false,
type: 'page', // type: 'page',
show: false // show: false
}, // },
{ // {
key: 'admin', // key: 'admin',
title: '后台管理', // title: '后台管理',
leftIcon: 'icon-lock', // leftIcon: 'icon-lock',
leftIconColor: 'gray', // leftIconColor: 'gray',
rightText: '博客后台系统入口', // rightText: '博客后台系统入口',
path: '/pagesB/admin/admin', // path: '/pagesB/admin/admin',
isAdmin: true, // isAdmin: true,
type: 'page', // type: 'page',
show: this.globalAppSettings.about.showAdmin // show: false
} // }
]; ];
}, },
fnGetData() { fnGetData() {
+29 -19
View File
@@ -26,7 +26,6 @@
<!-- 社交联系方式列表 --> <!-- 社交联系方式列表 -->
<view class="contact ma-50 mt-0 pt-12"> <view class="contact ma-50 mt-0 pt-12">
<block v-if="calcIsNotEmpty"> <block v-if="calcIsNotEmpty">
<block v-for="(item, index) in result" :key="index"> <block v-for="(item, index) in result" :key="index">
<view v-if="item.value" class="item mt-24 flex" @click="fnOnClick(item)"> <view v-if="item.value" class="item mt-24 flex" @click="fnOnClick(item)">
<view class="left"> <view class="left">
@@ -37,9 +36,9 @@
</view> </view>
</block> </block>
</block> </block>
<view v-else class="mt-12 pt-12"> <view v-else class="mt-12 pt-12">
<tm-empty icon="icon-shiliangzhinengduixiang-" label="暂无联系方式"/> <tm-empty icon="icon-shiliangzhinengduixiang-" label="暂无联系方式"/>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
@@ -137,36 +136,47 @@ export default {
return blogger; return blogger;
}, },
socialConfig() { socialConfig() {
return this.authorConfig.social return this.authorConfig.social;
}, },
calcIsNotEmpty() { calcIsNotEmpty() {
return this.result.some((item) => item.value !== ""); return this.result.some((item) => item.value !== "");
} }
}, },
watch: {
socialConfig: {
handler(newVal) {
if (!newVal) return;
this.fnGetData();
},
deep: true,
immediate: true
}
},
onLoad() { onLoad() {
this.fnSetPageTitle('联系博主'); this.fnSetPageTitle('联系博主');
}, },
created() {
this.fnGetData();
},
methods: { methods: {
fnGetData() { fnGetData() {
for (let key in this.socialConfig) { for (let key in this.socialConfig) {
if (key === 'enabled') {
continue;
}
this.result.find(x => x.key === key).value = this.socialConfig[key]; this.result.find(x => x.key === key).value = this.socialConfig[key];
} }
}, },
fnOnClick(item) { fnOnClick(item) {
if (this.globalAppSettings.contact.isLinkCopy && this.$utils.checkIsUrl(item.value)) { this.$utils.copyText(item.value, item.name + ' 已复制!');
uni.navigateTo({ // if (this.globalAppSettings.contact.isLinkCopy && this.$utils.checkIsUrl(item.value)) {
url: '/pagesC/website/website?data=' + // uni.navigateTo({
JSON.stringify({ // url: '/pagesC/website/website?data=' +
title: item.name, // JSON.stringify({
url: item.value // title: item.name,
}) // url: item.value
}); // })
} else { // });
this.$utils.copyText(item.value, item.name + ' 已复制!'); // } else {
} // this.$utils.copyText(item.value, item.name + ' 已复制!');
// }
} }
} }
}; };